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. will you need to have it as DLL on WindowsĮverything from this list is handled by CMake.when its sources are nested in their source tree.when they are using it pre-built as an external dependency.how other applications can find the library.where install artifacts should be placed.what artifacts should the library produce at install step.Here are some of the things you need to take care of: But doing just that would be too easy, wouldn’t it. Making a library with CMake is not that different from making an application - instead of add_executable you call add_library. #include const std ::string someString = "some string" CMakeLists
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |