考虑以下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)
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 ..
Run Code Online (Sandbox Code Playgroud)
我该如何解决这个错误?