From 0e67b7392decb6ed1a446c26824ce010b52de6ed Mon Sep 17 00:00:00 2001 From: Jan Macheta Date: Fri, 25 Oct 2024 13:01:35 +0200 Subject: [PATCH] fix include of install scripts --- CMakeLists.txt | 13 +++++++++---- cmake/{logger_install.cmake => install.cmake} | 2 +- src/CMakeLists.txt | 4 ---- 3 files changed, 10 insertions(+), 9 deletions(-) rename cmake/{logger_install.cmake => install.cmake} (90%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5e2bc70..238c62e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.25) -project(logger VERSION 1.1.5) +project(logger VERSION 1.1.6) include(CMakeDependentOption) @@ -38,7 +38,7 @@ option(LOGGER_VERBOSE_ERRORS "Uses custom compiler pragmas to display additional debug information on compilation errors" OFF ) -option(LOGGER_TESTS "Build test cases" OFF) +option(LOGGER_TESTS "Build test cases" ${PROJECT_IS_TOP_LEVEL}) option(LOGGER_INSTALL "Configure install target" ON) set(EXTENDED_MODULE_PATH ${CMAKE_MODULE_PATH};${CMAKE_CURRENT_LIST_DIR}/cmake) @@ -50,8 +50,13 @@ set(CMAKE_MODULE_PATH add_subdirectory(src) -if (LOGGER_TESTS OR PROJECT_IS_TOP_LEVEL) +if (LOGGER_TESTS) include(CTest) - enable_testing() add_subdirectory(tests EXCLUDE_FROM_ALL) endif () + + + +if (LOGGER_INSTALL OR PROJECT_IS_TOP_LEVEL) + include(cmake/install.cmake) +endif () diff --git a/cmake/logger_install.cmake b/cmake/install.cmake similarity index 90% rename from cmake/logger_install.cmake rename to cmake/install.cmake index b361b2e..10a491c 100644 --- a/cmake/logger_install.cmake +++ b/cmake/install.cmake @@ -12,7 +12,7 @@ configure_package_config_file( install(TARGETS logger EXPORT logger_targets) -install(DIRECTORY include/embetech DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) +install(DIRECTORY src/include/embetech DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/logger-config.cmake ${CMAKE_CURRENT_BINARY_DIR}/logger-config-version.cmake DESTINATION ${CMAKES_EXPORT_DIR} diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 4a849d1..c604801 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -41,7 +41,3 @@ target_compile_definitions( target_compile_features(logger PUBLIC c_std_99) add_library(embetech::logger ALIAS logger) - -if (LOGGER_INSTALL OR PROJECT_IS_TOP_LEVEL) - include(logger_install) -endif ()