![]() Installing: /Users/YOURNAME/code/cpp/someLibrary/install/cmake/SomeLibrar圜onfig-release.cmake ![]() Up-to-date: /Users/YOURNAME/code/cpp/someLibrary/install/include/SomeLibrary/some.h Install configuration: "Release" - Installing: /Users/YOURNAME/code/cpp/someLibrary/install/lib/libSomeLibrary.a Installing: /Users/YOURNAME/code/cpp/someLibrary/install/cmake/SomeLibrar圜onfig-debug.cmake Install configuration: "Debug" - Installing: /Users/YOURNAME/code/cpp/someLibrary/install/lib/libSomeLibraryd.a Linking CXX static library libSomeLibraryd.a This is because we ran configuration without specifying the build type - better to explicitly set it then, both Debug and Release: Note that SomeLibrar圜onfig-noconfig.cmake has this weird noconfig suffix. Installing: /Users/YOURNAME/code/cpp/someLibrary/install/cmake/SomeLibrar圜onfig-noconfig.cmake Installing: /Users/YOURNAME/code/cpp/someLibrary/install/cmake/SomeLibrar圜onfig.cmake Installing: /Users/YOURNAME/code/cpp/someLibrary/install/include/SomeLibrary/some.h Install configuration: "" - Installing: /Users/YOURNAME/code/cpp/someLibrary/install/lib/libSomeLibrary.a ![]() Linking CXX static library libSomeLibrary.a Building CXX object CMakeFiles/SomeLibrary.dir/src/ Scanning dependencies of target SomeLibrary Configuring done - Generating done - Build files have been written to: /Users/YOURNAME/code/cpp/someLibrary/build Will set it to /Users/YOURNAME/code/cpp/someLibrary/install Detecting CXX compile features - done - This project is a top-level one Detecting CXX compiler ABI info - done - Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ - skipped Detecting C compile features - done - Detecting CXX compiler ABI info Detecting C compiler ABI info - done - Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc - skipped The CXX compiler identification is AppleClang 12.0032 ![]() The C compiler identification is AppleClang 12.0032 Having it, if you now try to find your package in external project ( cmake-library-example/external-project/CMakeLists.txt) like this: The write_basic_package_version_file() function from above will create SomeLibrar圜onfigVersion.cmake file in the install folder. Knowing that, here’s how you can check if you are in the top-level project or not: This variable persists across all the nested projects, and so calling project command from nested projects will not change CMAKE_PROJECT_NAME, but will set another variable called PROJECT_NAME. It stores the top-level project name that you set with project command. In CMake projects there is a variable called CMAKE_PROJECT_NAME. So let’s gradually create a CMakeLists.txt for the library project.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |