Reputation: 1468
My project is structured as follows
ProjDir
| - CMakeLists.txt
| - SubDir1
| | - CMakeLists.txt
| | - src
| | - inc
| - SubDir2
| | - CMakeLists.txt
| | - src
| | - inc
I have targets in each subdirectory and the subdirectories are included in the main CMakeLists.txt
as follows.
add_subdirectory(${CMAKE_SOURCE_DIR}/SubDir1)
add_subdirectory(${CMAKE_SOURCE_DIR}/SubDir2)
My targets in each subdirectory are installed with the cmake function install
. These commands are in the CMakeLists.txt
of respective subdirectories and are specified per-target (see this post).
install(TARGETS exe1 DESTINATION ${CMAKE_INSTALL_PREFIX}/bin CONFIGURATIONS Release)
While I'm able to successfully compile, the install
command doesn't move the binaries to ${CMAKE_INSTALL_PREFIX}/bin
but rather finishes after generated the output:
Install the project...
-- Install configuration: ""
How could I resolve this?
Upvotes: 0
Views: 370
Reputation: 66338
On Linux, default build configuration is empty: neither debug, nor release, etc. It can be easily found from the CMake output:
-- Install configuration: ""
Because your install
command is "tagged" with Release
configuration, it is not triggered by default (with empty configuration).
Upvotes: 1