![]() ![]() Of course CMake being what it is there are a lot of inner workings and edge cases which can be covered when using find_package, so be sure to refer to the original documentation if stuck. ![]() That is all that is to know to get started. Target_link_libraries(SomeExecutable PRIVATE libImagePipeline::libImagePipeline) CMAKE uses a text file named CMakeLists.txt, in the home directory of the software package, to specify the actions that are necessary to set up the software. Modifying the generated file libTargets.cmake is not a good idea, but thankfully libTargets.cmake contains code to include files libTargets-.cmake (like libTargets-noconfig. CMake is able to build successfully using the library headers, but CLion highlights the include in red: include I guess the CLion's integration with CMake does not handle the includedirectories directive.Now, the library is available like a normal target defined in CMake and can be linked to any other existing target with target_link_libraries. In order to get access to it code needs to be either in libTargets.cmake or in any file included from that file. The REQUIRED keyword marking that the library is essential for the build and that CMake will stop with an error if the package is not found. In final-project-/CMakeLists.![]() The details on how to use it is explained at the end of this article, but it looks something like this: list(APPEND CMAKE_MODULE_PATH "$/CMake/")įrom here on the package can be included by calling find_package. Including header files in your code will allow you to compile the code. Once the library is found it can be linked to targets using target_link_libraries. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |