Skip to content
Snippets Groups Projects

Initial provision of cmake-format configuration file.

3 files
+ 93
15
Compare changes
  • Side-by-side
  • Inline
Files
3
@@ -8,15 +8,22 @@
# SPDX-License-Identifier: EPL-2.0
################################################################################
find_package(units CONFIG REQUIRED)
find_package(
units CONFIG REQUIRED
)
file(
GLOB_RECURSE HEADERS
RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
CONFIGURE_DEPENDS "*.h")
CONFIGURE_DEPENDS "*.h"
)
add_library(ScenarioAPI INTERFACE)
add_library(ScenarioAPI::ScenarioAPI ALIAS ScenarioAPI)
add_library(
ScenarioAPI INTERFACE
)
add_library(
ScenarioAPI::ScenarioAPI ALIAS ScenarioAPI
)
target_link_libraries(ScenarioAPI INTERFACE units)
@@ -24,21 +31,24 @@ include(GNUInstallDirs)
set(INSTALL_CONFIG_DIR "${CMAKE_INSTALL_LIBDIR}/cmake/ScenarioAPI")
target_include_directories(
ScenarioAPI INTERFACE $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
ScenarioAPI
INTERFACE $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
)
target_compile_features(ScenarioAPI INTERFACE cxx_std_17)
include(CMakePackageConfigHelpers)
configure_package_config_file(
"${PROJECT_SOURCE_DIR}/cmake/ScenarioAPIConfig.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/ScenarioAPIConfig.cmake"
"${PROJECT_SOURCE_DIR}/cmake/ScenarioAPIConfig.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/ScenarioAPIConfig.cmake"
INSTALL_DESTINATION ${INSTALL_CONFIG_DIR}
PATH_VARS CMAKE_INSTALL_INCLUDEDIR)
PATH_VARS CMAKE_INSTALL_INCLUDEDIR
)
write_basic_package_version_file(
"${CMAKE_CURRENT_BINARY_DIR}/ScenarioAPIConfigVersion.cmake"
VERSION ${PROJECT_VERSION}
COMPATIBILITY SameMajorVersion)
COMPATIBILITY SameMajorVersion
)
install(DIRECTORY MantleAPI TYPE INCLUDE)
install(TARGETS ScenarioAPI EXPORT ScenarioAPITargets)
@@ -46,10 +56,12 @@ install(TARGETS ScenarioAPI EXPORT ScenarioAPITargets)
install(
EXPORT ScenarioAPITargets
DESTINATION ${INSTALL_CONFIG_DIR}
NAMESPACE ScenarioAPI::)
NAMESPACE ScenarioAPI::
)
install(
FILES "${CMAKE_CURRENT_BINARY_DIR}/ScenarioAPIConfig.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/ScenarioAPIConfigVersion.cmake"
DESTINATION ${INSTALL_CONFIG_DIR}
COMPONENT dev)
COMPONENT dev
)
Loading