【发布时间】:2016-03-30 07:52:41
【问题描述】:
考虑以下CMakeLists.txt 文件:
add_subdirectory(execA)
add_subdirectory(libB)
install(TARGETS execA libB
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib)
我收到以下错误:
install TARGETS given target "execA" which does not exist in this
directory
execA 和libB 有自己的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 ..
如何解决这个错误?
【问题讨论】: