How to configure CMake, googleTest, XCode and an external library to work together
In this post I give a list of useful tips to make CMake, googleTest, XCode and an external library work together.
Make install
When you compile a library, like VXL or ITK with unix makefiles, you can use make install
after make
. This way you can use find_package(<package_name>)
.
List all variables after find_package
When writing your own and you use CMakeLists.txt and you use find_package(<package_name>)
, it might be useful to list all variables. It makes much easier to find library and include paths variables.
Other
Variables listing all files:
Printing variables:
Adding executables. Remember that in each executable you can have just one main()
.
Overwriting non-intuitive division of code into source groups visible in an IDE, like XCode