From 0ac15db802577211f477a707ea6c0ce3acfc2075 Mon Sep 17 00:00:00 2001 From: Andreas Weis Date: Wed, 2 Oct 2024 17:47:21 +0200 Subject: [PATCH] Install debug build binaries to a separate folder (#39) * Install debug build binaries to a separate folder This will mirror the directory structure used by vcpkg: * Debug binaries will get installed to a subdirectory debug/lib for ARCHIVE and LIBRARY artifacts and debug/bin for RUNTIME artifacts * All other configurations install binaries directly to lib and bin respectively * Other artifacts go to the same include/share/... directories for all configurations, including Debug * Build both debug and release configurations on CI --- .ci/docker/ubuntu.Dockerfile | 11 +++++++---- .github/workflows/ci_tests.yml | 3 ++- src/beman/exemplar/CMakeLists.txt | 5 ++++- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/.ci/docker/ubuntu.Dockerfile b/.ci/docker/ubuntu.Dockerfile index 74154ff..e71b915 100644 --- a/.ci/docker/ubuntu.Dockerfile +++ b/.ci/docker/ubuntu.Dockerfile @@ -26,10 +26,13 @@ ARG cmake_args= RUN sysctl vm.mmap_rnd_bits=28 # Build. -ENV CC="$cc" CXX="$cxx" CMAKE_GENERATOR="Ninja" CMAKE_EXPORT_COMPILE_COMMANDS=on +ENV CC="$cc" CXX="$cxx" CMAKE_GENERATOR="Ninja Multi-Config" CMAKE_EXPORT_COMPILE_COMMANDS=on RUN ls -lR src RUN cmake -B build -S . "$cmake_args" -RUN cmake --build build --verbose -RUN cmake --build build --target all_verify_interface_header_sets -RUN cmake --install build --prefix /opt/beman.exemplar +RUN cmake --build build --config Release --verbose +RUN cmake --build build --config Release --target all_verify_interface_header_sets +RUN cmake --install build --config Release --prefix /opt/beman.exemplar +RUN cmake --build build --config Debug --verbose +RUN cmake --build build --config Debug --target all_verify_interface_header_sets +RUN cmake --install build --config Debug --prefix /opt/beman.exemplar RUN find /opt/beman.exemplar -type f diff --git a/.github/workflows/ci_tests.yml b/.github/workflows/ci_tests.yml index e1b3a80..671e28a 100644 --- a/.github/workflows/ci_tests.yml +++ b/.github/workflows/ci_tests.yml @@ -67,4 +67,5 @@ jobs: cache-to: type=gha,mode=max - name: Run tests run: | - docker run ${{ matrix.cfg.id }} ctest --test-dir build + docker run ${{ matrix.cfg.id }} ctest --test-dir build -C Release + docker run ${{ matrix.cfg.id }} ctest --test-dir build -C Debug diff --git a/src/beman/exemplar/CMakeLists.txt b/src/beman/exemplar/CMakeLists.txt index e4b624c..da3d195 100644 --- a/src/beman/exemplar/CMakeLists.txt +++ b/src/beman/exemplar/CMakeLists.txt @@ -18,8 +18,11 @@ set_target_properties(beman.exemplar PROPERTIES VERIFY_INTERFACE_HEADER_SETS ON) install( TARGETS beman.exemplar EXPORT beman.exemplar + DESTINATION $<$:debug/>${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION $<$:debug/>${CMAKE_INSTALL_BINDIR} FILE_SET HEADERS - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} +) if(BUILD_TESTING) include(GoogleTest)