Re: [CMake] Linking with an external project also built with CMake

2015-09-18 Thread Wojtek Mamrak
Or you can export ExternalLib directly from the build tree. export(TARGETS ExternalLib FILE "${PROJECT_BINARY_DIR}/ExternalLibTargets.cmake") configure_file("${PROJECT_SOURCE_DIR}/ExternalLibConfig.cmake" "${PROJECT_BINARY_DIR}/ExternalLibConfig.cmake") export(PACKAGE ExternalLib) with

[CMake] Linking with an external project also built with CMake

2015-09-17 Thread Saad Khattak
Hello, I have a project *ExternalLib* that uses CMake to build its libraries. I then have my own project (separate from the external library) that needs to include ExternalLib's headers and link with its libraries. ExternalLib does not have a find_package module. Since ExternalLib is also built

Re: [CMake] Linking with an external project also built with CMake

2015-09-17 Thread Tamás Kenéz
1. There is a (semi-)automatic way: you can export the targets of ExternalLib with install(EXPORT...) from its CMakeLists.txt. In the simplest cases you can use the generated export file as a config module: install(TARGETS ... EXPORT externallib ...) install(EXPORT externallib FILE