From f0f0607638f332746bc8fe444c9da8ad1075c894 Mon Sep 17 00:00:00 2001 From: Thomas Fussell Date: Tue, 25 Oct 2016 21:12:57 -0400 Subject: [PATCH] revert to old cmake output directory method, fix travis build --- CMakeLists.txt | 13 +++++++++++++ samples/CMakeLists.txt | 12 ------------ source/CMakeLists.txt | 28 ++-------------------------- tests/CMakeLists.txt | 7 ------- 4 files changed, 15 insertions(+), 45 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4ea4de9f..bae84089 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -58,6 +58,19 @@ set(THIRD_PARTY_DIR ${CMAKE_SOURCE_DIR}/third-party) set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH}) +# Put output files in the same directory +set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) +set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) + +foreach(OUTPUTCONFIG ${CMAKE_CONFIGURATION_TYPES}) + string(TOUPPER ${OUTPUTCONFIG} OUTPUTCONFIG) + set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_${OUTPUTCONFIG} ${CMAKE_BINARY_DIR}/lib) + set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_${OUTPUTCONFIG} ${CMAKE_BINARY_DIR}/lib) + set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_${OUTPUTCONFIG} ${CMAKE_BINARY_DIR}/bin) +endforeach() + + # Add components according to selected options if (WITH_SAMPLES) add_subdirectory(samples) diff --git a/samples/CMakeLists.txt b/samples/CMakeLists.txt index 16126d75..0ee5548f 100644 --- a/samples/CMakeLists.txt +++ b/samples/CMakeLists.txt @@ -10,21 +10,9 @@ endif() add_executable(sample-basic ../samples/sample.cpp) target_link_libraries(sample-basic ${XLNT_LIB}) -set_target_properties(sample-basic - PROPERTIES - RUNTIME_OUTPUT_DIRECTORY_DEBUG "${CMAKE_BINARY_DIR}/bin" - RUNTIME_OUTPUT_DIRECTORY_MINSIZEREL "${CMAKE_BINARY_DIR}/bin" - RUNTIME_OUTPUT_DIRECTORY_RELWITHDEBINFO "${CMAKE_BINARY_DIR}/bin" - RUNTIME_OUTPUT_DIRECTORY_RELEASE "${CMAKE_BINARY_DIR}/bin") add_executable(sample-decrypt ../samples/decrypt.cpp) target_link_libraries(sample-decrypt ${XLNT_LIB}) -set_target_properties(sample-decrypt - PROPERTIES - RUNTIME_OUTPUT_DIRECTORY_DEBUG "${CMAKE_BINARY_DIR}/bin" - RUNTIME_OUTPUT_DIRECTORY_MINSIZEREL "${CMAKE_BINARY_DIR}/bin" - RUNTIME_OUTPUT_DIRECTORY_RELWITHDEBINFO "${CMAKE_BINARY_DIR}/bin" - RUNTIME_OUTPUT_DIRECTORY_RELEASE "${CMAKE_BINARY_DIR}/bin") file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/data DESTINATION ${CMAKE_BINARY_DIR}/bin) diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt index 07efd560..2b2dff9b 100644 --- a/source/CMakeLists.txt +++ b/source/CMakeLists.txt @@ -116,19 +116,7 @@ if(SHARED) OUTPUT_NAME xlnt VERSION ${PROJECT_VERSION_FULL} SOVERSION ${PROJECT_VERSION} - INSTALL_NAME_DIR "${LIB_DEST_DIR}" - RUNTIME_OUTPUT_DIRECTORY_DEBUG "${CMAKE_BINARY_DIR}/bin" - RUNTIME_OUTPUT_DIRECTORY_MINSIZEREL "${CMAKE_BINARY_DIR}/bin" - RUNTIME_OUTPUT_DIRECTORY_RELEASE "${CMAKE_BINARY_DIR}/bin" - RUNTIME_OUTPUT_DIRECTORY_RELWITHDEBINFO "${CMAKE_BINARY_DIR}/bin" - ARCHIVE_OUTPUT_DIRECTORY_DEBUG "${CMAKE_BINARY_DIR}/lib" - ARCHIVE_OUTPUT_DIRECTORY_MINSIZEREL "${CMAKE_BINARY_DIR}/lib" - ARCHIVE_OUTPUT_DIRECTORY_RELEASE "${CMAKE_BINARY_DIR}/lib" - ARCHIVE_OUTPUT_DIRECTORY_RELWITHDEBINFO "${CMAKE_BINARY_DIR}/lib" - LIBRARY_OUTPUT_DIRECTORY_DEBUG "${CMAKE_BINARY_DIR}/lib" - LIBRARY_OUTPUT_DIRECTORY_MINSIZEREL "${CMAKE_BINARY_DIR}/lib" - LIBRARY_OUTPUT_DIRECTORY_RELEASE "${CMAKE_BINARY_DIR}/lib" - LIBRARY_OUTPUT_DIRECTORY_RELWITHDEBINFO "${CMAKE_BINARY_DIR}/lib") + INSTALL_NAME_DIR "${LIB_DEST_DIR}") if(FRAMEWORK) add_custom_command( @@ -160,19 +148,7 @@ if(STATIC) ) set_target_properties(xlnt.static PROPERTIES - OUTPUT_NAME xlnt - RUNTIME_OUTPUT_DIRECTORY_DEBUG "${CMAKE_BINARY_DIR}/bin" - RUNTIME_OUTPUT_DIRECTORY_MINSIZEREL "${CMAKE_BINARY_DIR}/bin" - RUNTIME_OUTPUT_DIRECTORY_RELEASE "${CMAKE_BINARY_DIR}/bin" - RUNTIME_OUTPUT_DIRECTORY_RELWITHDEBINFO "${CMAKE_BINARY_DIR}/bin" - ARCHIVE_OUTPUT_DIRECTORY_DEBUG "${CMAKE_BINARY_DIR}/lib" - ARCHIVE_OUTPUT_DIRECTORY_MINSIZEREL "${CMAKE_BINARY_DIR}/lib" - ARCHIVE_OUTPUT_DIRECTORY_RELEASE "${CMAKE_BINARY_DIR}/lib" - ARCHIVE_OUTPUT_DIRECTORY_RELWITHDEBINFO "${CMAKE_BINARY_DIR}/lib" - LIBRARY_OUTPUT_DIRECTORY_DEBUG "${CMAKE_BINARY_DIR}/lib" - LIBRARY_OUTPUT_DIRECTORY_MINSIZEREL "${CMAKE_BINARY_DIR}/lib" - LIBRARY_OUTPUT_DIRECTORY_RELEASE "${CMAKE_BINARY_DIR}/lib" - LIBRARY_OUTPUT_DIRECTORY_RELWITHDEBINFO "${CMAKE_BINARY_DIR}/lib") + OUTPUT_NAME xlnt) endif() source_group(xlnt FILES ${ROOT_HEADERS}) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 4a02fc6e..5ac8bfad 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -36,13 +36,6 @@ set_source_files_properties(${RUNNER} PROPERTIES GENERATED TRUE) add_executable(xlnt.test ${TEST_HELPERS} ${TESTS} ${RUNNER} ${PUGIXML}) -set_target_properties(${PROJECT_NAME} - PROPERTIES - RUNTIME_OUTPUT_DIRECTORY_DEBUG "${CMAKE_BINARY_DIR}/bin" - RUNTIME_OUTPUT_DIRECTORY_MINSIZEREL "${CMAKE_BINARY_DIR}/bin" - RUNTIME_OUTPUT_DIRECTORY_RELWITHDEBINFO "${CMAKE_BINARY_DIR}/bin" - RUNTIME_OUTPUT_DIRECTORY_RELEASE "${CMAKE_BINARY_DIR}/bin") - source_group(helpers FILES ${TEST_HELPERS}) source_group(tests\\cell FILES ${CELL_TESTS}) source_group(tests\\charts FILES ${CHARTS_TESTS})