Date: Fri, 15 Jan 2021 21:17:36 +0100 From: Tomasz CEDRO <tomek@cedro.info> To: Gleb Popov <arrowd@freebsd.org> Cc: freebsd-ports <freebsd-ports@freebsd.org> Subject: Re: CMAKE_PREFIX_PATH and /usr/local Message-ID: <CAM8r67D7OVuAv81kxp4-y9GVH90j7q1-4BQzvnvAUJ6kbfmaiA@mail.gmail.com> In-Reply-To: <CALH631ky5P8dd9TCKska-WaQGnVxuuD%2BLb8Xd1Vshya2Vz-kWw@mail.gmail.com> References: <CAM8r67DO%2BaiAR7FbtCzOFQKZqbOMV8Xubz9ERCtVujRj3NpxCw@mail.gmail.com> <CALH631ky5P8dd9TCKska-WaQGnVxuuD%2BLb8Xd1Vshya2Vz-kWw@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Jan 15, 2021 at 10:05 AM Gleb Popov wrote: > On Fri, Jan 15, 2021 at 12:50 AM Tomasz CEDRO 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? Hello Gleb :-) This seems the LimeSuite CMake issue not to use /usr/local/include where some GL includes are located. Without it there is a build problem as GL.h (something like this) is not found. I am not sure it this is the only occurrence of this symptom. Simply adding /usr/local/include solves the problem. Accorging to cmake 3.19 documentation CMAKE_PREFIX_PATH is empty by default and it needs to be filled with search paths by the project: CMAKE_PREFIX_PATH is empty by default, so the project sets the value, so the /usr/local is missing now and should be put here (but still in the source code so the patch seems unavoidable): https://cmake.org/cmake/help/latest/variable/CMAKE_PREFIX_PATH.html?highlight=cmake_prefix_path We are back in the point either to fix the upstream and add "/usr/local" into CMAKE_PREFIX_PATH or propagate is somehow from a port anyhow..? Thanks :-) Tomek -- CeDeROM, SQ7MHZ, http://www.tomek.cedro.info
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAM8r67D7OVuAv81kxp4-y9GVH90j7q1-4BQzvnvAUJ6kbfmaiA>