Consider the following CMakeLists.txt
file:
add_subdirectory(execA)
add_subdirectory(libB)
install(TARGETS execA libB
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib)
I get the following error:
install TARGETS given target "execA" which does not exist in this
directory
execA
and libB
have their own CMakeList.txt
files and are located under project
directory, as well as the build directory I'm running 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 ..
How do I fix this error?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…