CMake one build directory for multiple projects

后端 未结 2 1604
逝去的感伤
逝去的感伤 2020-12-23 10:01

I´m a beginner user of CMake. My environment has several projects like:

project
  |------ CMakeLists.txt (The main Cmake)
  |------ ProjectA
  |          |--         


        
2条回答
  •  长情又很酷
    2020-12-23 10:45

    A) You can do 1 CMakeLists.txt for N projects. When you define a library, you can use it in an executable defined in the cmake (add_executable and target_link_libraries to see).

    B) see target_include_directories

    C) it seems you can call cmake --target target to generate the Makefile for only one of the target of your cmakelists.txt file.

提交回复
热议问题