From 3bdd13ae95119075c7e8e5e51379a8b9426d7636 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Rombauts?= Date: Fri, 18 Aug 2023 16:09:35 +0200 Subject: [PATCH] set CMAKE_RUNTIME_OUTPUT_DIRECTORY so that executables and dlls share the bin/ directory --- CMakeLists.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9fe97d1..345e723 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -25,6 +25,8 @@ option(SQLITECPP_BUILD_TESTS "Build and run tests." OFF) # BUILD_SHARED_LIBS is a standard CMake variable, but we declare it here to make it prominent option(BUILD_SHARED_LIBS "Build shared libraries (DLLs)." OFF) +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) + # Define useful variables to handle OS differences: if (WIN32) set(DEV_NULL "NUL") @@ -485,11 +487,11 @@ if (SQLITECPP_BUILD_TESTS) enable_testing() # does the tests pass? - add_test(UnitTests SQLiteCpp_tests) + add_test(UnitTests bin/SQLiteCpp_tests) if (SQLITECPP_BUILD_EXAMPLES) # does the example1 runs successfully? - add_test(Example1Run SQLiteCpp_example1) + add_test(Example1Run bin/SQLiteCpp_example1) endif (SQLITECPP_BUILD_EXAMPLES) else (SQLITECPP_BUILD_TESTS) message(STATUS "SQLITECPP_BUILD_TESTS OFF")