diff --git a/CMakeLists.txt b/CMakeLists.txt index ec55ba0a5..9dbb8c3d3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -257,18 +257,17 @@ if( CMAKE_GENERATOR MATCHES "Visual Studio" ) include( InstallRequiredSystemLibraries ) endif() -# Where the final product is stored -set( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin ) - set ( _SHARED_PROXY_BASE "shared" ) set ( _SHARED_PROXY_BASE_PATH "${CMAKE_BINARY_DIR}/${_SHARED_PROXY_BASE}") -# Define the non-install and executable paths +# Define the non-install and executable paths and where the final product is stored if( CMAKE_CONFIGURATION_TYPES ) + set( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin ) set( _DESTDIR "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}" ) set( _SHARED_PROXY_PATH "${_SHARED_PROXY_BASE_PATH}/${CMAKE_CFG_INTDIR}") else() - set( _DESTDIR "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}" ) + set( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/${CMAKE_BUILD_TYPE} ) + set( _DESTDIR "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/" ) set( _SHARED_PROXY_PATH "${_SHARED_PROXY_BASE_PATH}/${CMAKE_BUILD_TYPE}") endif() diff --git a/cmake-proxies/cmake-modules/AudacityDependencies.cmake b/cmake-proxies/cmake-modules/AudacityDependencies.cmake index 8fad83465..65fb60ce4 100644 --- a/cmake-proxies/cmake-modules/AudacityDependencies.cmake +++ b/cmake-proxies/cmake-modules/AudacityDependencies.cmake @@ -246,7 +246,7 @@ macro( resolve_conan_dependencies ) OPTIONS ${CONAN_PACKAGE_OPTIONS} ") - if(MSVC OR XCODE) + if(MSVC OR XCODE AND NOT DEFINED CMAKE_BUILD_TYPE) foreach(TYPE ${CMAKE_CONFIGURATION_TYPES}) _conan_install(${TYPE}) endforeach() diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 7308db3dd..dedc5eff7 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1137,13 +1137,16 @@ if( CMAKE_SYSTEM_NAME MATCHES "Windows" ) ) # Copy the VC runtime libraries as well - add_custom_command( - TARGET - ${TARGET} - COMMAND - ${CMAKE_COMMAND} -E copy ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS} ${_DEST} - POST_BUILD - ) + if(NOT "_X${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS}" STREQUAL "_X") + add_custom_command( + TARGET + ${TARGET} + COMMAND + ${CMAKE_COMMAND} -E copy ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS} ${_DEST} + POST_BUILD + ) + endif() + elseif( CMAKE_SYSTEM_NAME MATCHES "Darwin" ) # Bug 2400 workaround #