From 9986f2a073a237b5797fd8a030e521fe99cb8858 Mon Sep 17 00:00:00 2001 From: Tim Paine <3105306+timkpaine@users.noreply.github.com> Date: Sat, 2 Sep 2023 13:20:51 -0400 Subject: [PATCH] Move .capnp file to share to avoid excess stuff in lib, make sure windows .lib and .dll in same dir --- CMakeLists.txt | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 46da5de0..ef184b43 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -66,9 +66,16 @@ else() endif() # NOTE: Set the global output directories after the subprojects have had their go at it -set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lib) -set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lib) -set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin) +if(${CMAKE_SYSTEM_NAME} MATCHES "Windows") + # Force all .lib and .dll into bin for windows + set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lib) + set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin) + set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin) +else() + set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lib) + set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lib) + set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin) +endif() set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${PROJECT_SOURCE_DIR}/model/models.lst @@ -367,7 +374,7 @@ install( install(DIRECTORY ${GENDIR}/uhdm/ DESTINATION ${CMAKE_INSTALL_PREFIX}/include/uhdm/) install(FILES ${GENDIR}/src/UHDM.capnp - DESTINATION ${CMAKE_INSTALL_PREFIX}/lib) + DESTINATION ${CMAKE_INSTALL_PREFIX}/share/uhdm) # Generate cmake config files for reuse by downstream packages include(CMakePackageConfigHelpers)