Re: [CMake] cmake_check_build_system is causing a rebuild at "make install"

2015-10-20 Thread James Bigler
The cpp file dependency is generator specific. CMake supports cpp file dependency for Makefiles only. The solution we have works for any generator. The dependencies could be generated at configure time, and I have a local version used internally where I work that does this, but it's not a cure-a

Re: [CMake] linking hared libraries

2015-10-20 Thread Chuck Atkins
> > On Mon, Oct 19, 2015 at 8:43 PM, Owen Alanzo Hogarth > wrote: > > Also you said the PROJECT() should only be defined once, but shouldn't > each > > cmakelists.txt contain a project() or else cmake complains at me. > > > According to the last paragraph of: > > https://cmake.org/cmake/help/v3.0/

Re: [CMake] Creating relocatable packages

2015-10-20 Thread Zac Bergquist
Yes, that was exactly what I needed. Now my installed targets file has IMPORTED_LINK_INTERFACE_LIBRARIES "PCAP" instead of an absolute path, and the FindPCAP.cmake module kicks in and does what I would expect. Thanks again for your time - much appreciated. Zac On Tue, Oct 20, 2015 at 9:25 AM, G

Re: [CMake] Creating relocatable packages

2015-10-20 Thread Guillaume Dumont
Hi Zac, target_link_libraries will work with either full library paths or target names including imported targets. You need to use target_link_libraries in your CMakeLists.txt and find_dependency in your PackageConfig.cmake. Like so: in CMakeLists.txt: target_link_libraries(mylib ${PCAP_LIBRARI

Re: [CMake] Creating relocatable packages

2015-10-20 Thread Zac Bergquist
I think I'm on the right track now. I was definitely missing the add_library(PCAP IMPORTED) section. Could you elaborate on the last part? I thought target_link_libraries() is the reason I'm getting absolute paths. Should I be using the FindDependency macro instead of target_link_libraries()?

Re: [CMake] CMake string REGEX REPLACE and environment variables

2015-10-20 Thread Nils Gladitz
On 10/20/2015 01:49 PM, Oleg Trenkin wrote: Hi all, Does anybody know why I can't evaluate environment variable inside "REGEX REPLACE"? Example, I have a value: set(value "LD_LIBRARY_PATH=my_path:$LD_LIBRARY_PATH") I expect: value = "LD_LIBRARY_PATH=my_path:some_system_path_from_env" What I'm

[CMake] CMake string REGEX REPLACE and environment variables

2015-10-20 Thread Oleg Trenkin
Hi all, Does anybody know why I can't evaluate environment variable inside "REGEX REPLACE"? Example, I have a value: set(value "LD_LIBRARY_PATH=my_path:$LD_LIBRARY_PATH") I expect: value = "LD_LIBRARY_PATH=my_path:some_system_path_from_env" What I'm doing: string(REGEX REPLACE "\\$\\{([a-zA-Z0-