Skip to content

Commit

Permalink
removed accidental cmake 3.14 requirement (minimum is now 3.13)
Browse files Browse the repository at this point in the history
  • Loading branch information
jornbr committed Jan 11, 2024
1 parent c7cdc93 commit ba224fe
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
7 changes: 5 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# Minimum cmake version:
# - 3.12 is needed for https://cmake.org/cmake/help/latest/command/target_link_libraries.html#id8
# - 3.12 is needed for https://cmake.org/cmake/help/latest/command/add_compile_definitions.html
cmake_minimum_required(VERSION 3.12)
# - 3.13 is needed to install targets that were created in other directories (https://cmake.org/cmake/help/latest/command/install.html)
cmake_minimum_required(VERSION 3.13)

project(fabm
VERSION 2.0.1
Expand Down Expand Up @@ -86,9 +87,11 @@ endif()
# Use solution folders in IDEs
set_property(GLOBAL PROPERTY USE_FOLDERS ON)

# Determine default installation directories (CMAKE_INSTALL_LIBDIR, CMAKE_INSTALL_INCLUDEDIR)
include(GNUInstallDirs)

# Add YAML parsing library, unless the yaml target was already defined by a parent CMakeLists.txt
if(NOT TARGET yaml)
include(GNUInstallDirs)
add_subdirectory("${CMAKE_CURRENT_LIST_DIR}/src/yaml" yaml EXCLUDE_FROM_ALL)
set_property(TARGET yaml PROPERTY FOLDER fabm/yaml)
install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/yaml/modules/\${BUILD_TYPE}/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/yaml)
Expand Down
10 changes: 7 additions & 3 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -216,14 +216,18 @@ endif()

# Install FABM library and include files, unless the host overruled this.
if (NOT DEFINED FABM_NO_LIBRARY_INSTALL)
install(TARGETS fabm EXPORT fabmConfig)
# Note: using an implicit destination for install(TARGETS ...) below,
# or TYPE instead of DESTINATION, requires cmake >= 3.14
install(TARGETS fabm
EXPORT fabmConfig
DESTINATION ${CMAKE_INSTALL_LIBDIR})
install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/modules/\${BUILD_TYPE}/
TYPE INCLUDE)
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
install(FILES
${CMAKE_CURRENT_LIST_DIR}/../include/fabm.h
${CMAKE_CURRENT_LIST_DIR}/../include/fabm_version.h
${CMAKE_CURRENT_LIST_DIR}/drivers/${FABM_HOST}/fabm_driver.h
TYPE INCLUDE)
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
endif()

export(EXPORT fabmConfig)
Expand Down

0 comments on commit ba224fe

Please sign in to comment.