CMAKE_PREFIX_PATH and /usr/local

Gleb Popov arrowd at freebsd.org
Fri Jan 15 09:05:53 UTC 2021


On Fri, Jan 15, 2021 at 12:50 AM Tomasz CEDRO <tomek at cedro.info> wrote:

> Hello world :-)
>
> I am porting LimeSuite to FreeBSD. Local patch fixes missing
> "/usr/local/" path in CMakeLists.txt so the package now builds fine on
> FreeBSD. On Linux probably most of the libraries and includes are
> located in /usr/ do problem does not exist.
>
> Upstream has some objections to accept this patch and considers
> "/usr/local" a non-standard path [1]. But they propose to use
> CMAKE_PREFIX_PATH to add "/usr/local". This however does not seem to
> be supported in Ports (yet?).
>
> The question is how to tell CMake about "/usr/local/include" without
> source code modification? :-)
>
> Below is the proposed patch:
>
> > @@ -171,6 +171,11 @@ if (ENABLE_NEW_GAIN_BEHAVIOUR)
>      add_definitions(-DNEW_GAIN_BEHAVIOUR)
>  endif()
>
> +if (CMAKE_SYSTEM_NAME MATCHES "BSD")
> +    include_directories("/usr/local/include")
>

This is most certainly a wrong thing to do. Instead of simply adding
-I/usr/local/include everywhere, you should fix problems for each
dependency that the software requires.

What error do you get without your patch?


More information about the freebsd-ports mailing list