相关疑难解决方法(0)

CMake安装(子目录中的TARGETS)

考虑以下CMakeLists.txt文件:

add_subdirectory(execA)
add_subdirectory(libB)

install(TARGETS execA libB
        RUNTIME DESTINATION bin
        LIBRARY DESTINATION lib
        ARCHIVE DESTINATION lib)
Run Code Online (Sandbox Code Playgroud)

我收到以下错误:

install TARGETS given target "execA" which does not exist in this
  directory
Run Code Online (Sandbox Code Playgroud)

execAlibB拥有自己的CMakeList.txt文件,位于project目录下,以及我正在运行的构建目录cmake(cmake ..):

project
  |------ CMakeList.txt (the one with the code)
  |----execA
  |      \- .cpp, .hpp and CMakelist.txt
  |----libB
  |      \- .cpp, .hpp and CMakelist.txt
  |---- lib
  |---- bin
  \---- build (where I´m commanding: $ cmake ..
Run Code Online (Sandbox Code Playgroud)

我该如何解决这个错误?

c++ makefile cmake

20
推荐指数
3
解决办法
1万
查看次数

标签 统计

c++ ×1

cmake ×1

makefile ×1