@@ -8,7 +8,7 @@ cmake_minimum_required(VERSION 3.25...3.31)
88project(beman_execution VERSION 0.0.1 LANGUAGES CXX)
99
1010if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
11- message(FATAL_ERROR "In-source builds are not allowed!")
11+ message(FATAL_ERROR "In-source builds are not allowed!")
1212endif()
1313
1414set(TARGET_NAME execution)
@@ -20,112 +20,61 @@ set(TARGET_PACKAGE_NAME ${PROJECT_NAME}-config)
2020set(TARGETS_EXPORT_NAME ${PROJECT_NAME}-targets)
2121
2222option(
23- BEMAN_EXECUTION_ENABLE_TESTING
24- "Enable building tests and test infrastructure. Values : { ON, OFF }."
25- ${PROJECT_IS_TOP_LEVEL}
23+ BEMAN_EXECUTION_ENABLE_TESTING
24+ "Enable building tests and test infrastructure. Values : { ON, OFF }."
25+ ${PROJECT_IS_TOP_LEVEL}
2626)
2727
2828option(
29- BEMAN_EXECUTION_BUILD_EXAMPLES
30- "Enable building examples. Values : { ON, OFF }."
31- ${PROJECT_IS_TOP_LEVEL}
29+ BEMAN_EXECUTION_BUILD_EXAMPLES
30+ "Enable building examples. Values : { ON, OFF }."
31+ ${PROJECT_IS_TOP_LEVEL}
3232)
3333
3434option(
35- BEMAN_EXECUTION_ENABLE_INSTALL
36- "Install the project components. Values : { ON, OFF }."
37- ${PROJECT_IS_TOP_LEVEL}
35+ BEMAN_EXECUTION_ENABLE_INSTALL
36+ "Install the project components. Values : { ON, OFF }."
37+ ${PROJECT_IS_TOP_LEVEL}
3838)
3939
4040include (GNUInstallDirs)
4141set(INSTALL_CONFIGDIR ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME})
4242
43- if(FALSE)
44- if(PROJECT_IS_TOP_LEVEL AND NOT BEMAN_EXECUTION_ENABLE_INSTALL OR CMAKE_SKIP_INSTALL_RULES)
45- set(CMAKE_SKIP_INSTALL_RULES ON)
46-
47- include (FetchContent)
48-
49- # Add project_options from https://github.com/aminya/project_options
50- # Change the version in the following URL to update the package
51- # (watch the releases of the repository for future updates)
52- set(PROJECT_OPTIONS_VERSION "v0.41.0")
53- FetchContent_Declare(
54- _project_options URL https ://github.com/aminya/project_options/archive/refs/tags/${PROJECT_OPTIONS_VERSION}.zip
55- )
56- FetchContent_MakeAvailable(_project_options)
57- include (${_project_options_SOURCE_DIR}/Index.cmake)
58-
59- # Initialize project_options variable related to this project
60- # This overwrites `project_options` and sets `project_warnings`
61- # uncomment to enable the options. Some of them accept one or more inputs:
62- project_options(
63- PREFIX
64- ${TARGET_NAME}
65- ENABLE_CACHE
66- # NO! # ENABLE_CLANG_TIDY
67- # NO! ENABLE_VS_ANALYSIS
68- # ENABLE_INTERPROCEDURAL_OPTIMIZATION
69- # ENABLE_NATIVE_OPTIMIZATION
70- # ENABLE_DOXYGEN
71- # ENABLE_COVERAGE
72- ENABLE_SANITIZER_ADDRESS
73- ENABLE_SANITIZER_UNDEFINED
74- # TODO: ENABLE_SANITIZER_THREAD
75- # FIXME: on Linux only with clang++? ENABLE_SANITIZER_MEMORY
76- ENABLE_SANITIZER_POINTER_COMPARE
77- ENABLE_SANITIZER_POINTER_SUBTRACT
78- ENABLE_CONTROL_FLOW_PROTECTION
79- ENABLE_STACK_PROTECTION
80- ENABLE_OVERFLOW_PROTECTION
81- # ENABLE_ELF_PROTECTION
82- # ENABLE_RUNTIME_SYMBOLS_RESOLUTION
83- # ENABLE_COMPILE_COMMANDS_SYMLINK
84- # ENABLE_PCH
85- # PCH_HEADERS
86- # WARNINGS_AS_ERRORS
87- # ENABLE_INCLUDE_WHAT_YOU_USE
88- # ENABLE_GCC_ANALYZER
89- # ENABLE_BUILD_WITH_TIME_TRACE
90- # TODO: buggy! ENABLE_UNITY
91- # LINKER "lld"
92- )
93- endif()
94- endif()
95-
9643add_subdirectory(src/beman/execution)
9744
9845if(BEMAN_EXECUTION_ENABLE_TESTING)
99- enable_testing()
46+ enable_testing()
10047
101- add_subdirectory(tests/beman/execution)
48+ add_subdirectory(tests/beman/execution)
10249endif()
10350
10451if(BEMAN_EXECUTION_BUILD_EXAMPLES)
105- add_subdirectory(examples)
52+ add_subdirectory(examples)
10653endif()
10754
10855if(NOT BEMAN_EXECUTION_ENABLE_INSTALL OR CMAKE_SKIP_INSTALL_RULES)
109- return()
56+ return()
11057endif()
11158
11259include (CMakePackageConfigHelpers)
11360
11461write_basic_package_version_file(
115- ${CMAKE_CURRENT_BINARY_DIR}/${TARGET_PACKAGE_NAME}-version.cmake
116- VERSION ${CMAKE_PROJECT_VERSION}
117- COMPATIBILITY AnyNewerVersion
62+ ${CMAKE_CURRENT_BINARY_DIR}/${TARGET_PACKAGE_NAME}-version.cmake
63+ VERSION ${CMAKE_PROJECT_VERSION}
64+ COMPATIBILITY AnyNewerVersion
11865)
11966
12067configure_package_config_file(
121- "cmake/Config.cmake.in" ${CMAKE_CURRENT_BINARY_DIR}/${TARGET_PACKAGE_NAME}.cmake
122- INSTALL_DESTINATION ${INSTALL_CONFIGDIR}
68+ "cmake/Config.cmake.in"
69+ ${CMAKE_CURRENT_BINARY_DIR}/${TARGET_PACKAGE_NAME}.cmake
70+ INSTALL_DESTINATION ${INSTALL_CONFIGDIR}
12371)
12472
12573install(
126- FILES ${CMAKE_CURRENT_BINARY_DIR}/${TARGET_PACKAGE_NAME}.cmake
74+ FILES
75+ ${CMAKE_CURRENT_BINARY_DIR}/${TARGET_PACKAGE_NAME}.cmake
12776 ${CMAKE_CURRENT_BINARY_DIR}/${TARGET_PACKAGE_NAME}-version.cmake
128- DESTINATION ${INSTALL_CONFIGDIR}
77+ DESTINATION ${INSTALL_CONFIGDIR}
12978)
13079
13180set(CPACK_GENERATOR TGZ)
0 commit comments