clipnax.blogg.se

Cmake install lib
Cmake install lib










cmake install lib

You need to make a MyLibConfig.cmake, but you can do it either by exporting your targets directly to it, or by writing it by hand, then including the targets file. That looks like this: include(CMakePackageConfigHelpers) It's usually a good idea to give CMake access to the version, so that find_package can have a version specified. It only sets the includes destination on the exported target (which is often already set by target_include_directories, so check the MyLibTargets file and make sure you don't have the include directory included twice if you want clean cmake files). The includes destination is special since a target does not install includes. The various destinations are only needed if you have a library, static library, or program to install. Your basic target install command looks like this: install(TARGETS MyLib Install commands cause a file or target to be "installed" into the install tree when you make install.












Cmake install lib