diff --git a/MyxCMake/modules/MyxCMakeCommonTargetProperties.cmake b/MyxCMake/modules/MyxCMakeCommonTargetProperties.cmake index 18dca1f..5377c0c 100644 --- a/MyxCMake/modules/MyxCMakeCommonTargetProperties.cmake +++ b/MyxCMake/modules/MyxCMakeCommonTargetProperties.cmake @@ -51,16 +51,16 @@ function(myx_cmake_common_target_properties target) target_compile_features(${target} ${__visibility} cxx_alias_templates cxx_nullptr cxx_override) if(_target_type STREQUAL EXECUTABLE) - set_target_properties(${target} PROPERTIES POSITION_INDEPENDENT_CODE ON) - set_target_properties( - ${target} PROPERTIES RUNTIME_OUTPUT_DIRECTORY - ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_BINDIR}) + set_target_properties(${target} PROPERTIES + POSITION_INDEPENDENT_CODE ON + RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_BINDIR}) if(CMAKE_CXX_COMPILE_OPTIONS_PIE) target_compile_options(${target} PUBLIC ${CMAKE_CXX_COMPILE_OPTIONS_PIE}) endif() if(CMAKE_CXX_COMPILER_IS_GCC AND MYX_CMAKE_CODE_COVERAGE) myx_cmake_code_coverage(${target}) endif() + install(TARGETS ${target} COMPONENT main RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) endif() if(APPLE)