![]() DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=. To sum up the steps required to make this work: $ mkdir build & cd build To build both, you need to have two add_library calls with two different names, one STATIC, the other SHARED. (assuming make is run from the build dir).Īlso, this setup lets you choose if you want to build static or shared libraries, by using: -DBUILD_SHARED_LIBS=ON. Please note that this setup needs the make install step to create bin and lib at the location of your choice as given in the command line invocation of cmake -DCMAKE_INSTALL_PREFIX=. ProjectB CMakeLists.txt file (assuming projectB is a library): add_library(projectB file1.cpp file2.cpp. Install(TARGETS projectA RUNTIME DESTINATION bin) Set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY $/projectB) # include files from ProjectB My original CMakeList.txt on the project folder: cmake_minimum_required(VERSION 3.2.2.) I´m having difficulties configuring CMAKE. Preferrably that It can be divided into multiple subprojects, like build/projectA, build/ProjectB so that if I need to rebuild a single project I can delete the whole build/Project file and all is gone and a new Cmake will build it again. I would like to use a single build directory for every project, as showed above. My environment has several projects like: project
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |