Skip to content

Commit

Permalink
fix include of install scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
Jan Macheta committed Oct 25, 2024
1 parent 2c1ac7c commit 0e67b73
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
13 changes: 9 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.25)

project(logger VERSION 1.1.5)
project(logger VERSION 1.1.6)

include(CMakeDependentOption)

Expand Down Expand Up @@ -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)
Expand All @@ -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 ()
2 changes: 1 addition & 1 deletion cmake/logger_install.cmake → cmake/install.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
4 changes: 0 additions & 4 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 ()

0 comments on commit 0e67b73

Please sign in to comment.