1
1
cmake_minimum_required (VERSION 3.18)
2
2
3
- set (CCMATH_BUILD_VERSION 0.1.3 )
3
+ set (CCMATH_BUILD_VERSION 0.1.4 )
4
4
5
5
project (ccmath VERSION ${CCMATH_BUILD_VERSION} )
6
6
7
7
set (is_root_project OFF ) # Identifies if this is the root project
8
- if (CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME )
9
- set (is_root_project ON )
10
- endif ()
8
+ if (CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME )
9
+ set (is_root_project ON )
10
+ endif ()
11
11
12
12
set (CMAKE_CXX_STANDARD 17)
13
13
set (CMAKE_CXX_STANDARD_REQUIRED ON )
@@ -27,24 +27,24 @@ include(cmake/GlobalConfig.cmake)
27
27
add_library (${PROJECT_NAME} -compile-options INTERFACE )
28
28
add_library (${PROJECT_NAME} ::${PROJECT_NAME} -compile-options ALIAS ${PROJECT_NAME} -compile-options )
29
29
30
- if (CMAKE_CXX_COMPILER_ID STREQUAL Clang OR CMAKE_CXX_COMPILER_ID STREQUAL GNU)
31
- target_compile_options (${PROJECT_NAME} -compile-options INTERFACE
32
- -Wall -Wextra -Wpedantic -Wconversion -Werror=return-type
33
- )
34
-
35
- # TODO: Remove this later.
36
- # Some variables have been provided but are not currently being used, but it would not atm make sense to remove them.
37
- # So to clean up the warnings we are just silencing these specific cases.
38
- target_compile_options (${PROJECT_NAME} -compile-options INTERFACE
39
- -Wno-unused-but-set-variable -Wno-unused-value
40
- )
41
- endif ()
42
-
43
- if (CMAKE_CXX_COMPILER_ID STREQUAL MSVC )
44
- target_compile_options (${PROJECT_NAME} -compile-options INTERFACE
45
- /W4 /Wall /WX /permissive- /Zc:__cplusplus
46
- )
47
- endif ()
30
+ if (CMAKE_CXX_COMPILER_ID STREQUAL Clang OR CMAKE_CXX_COMPILER_ID STREQUAL GNU)
31
+ target_compile_options (${PROJECT_NAME} -compile-options INTERFACE
32
+ -Wall -Wextra -Wpedantic -Wconversion -Werror=return-type
33
+ )
34
+
35
+ # TODO: Remove this later.
36
+ # Some variables have been provided but are not currently being used, but it would not atm make sense to remove them.
37
+ # So to clean up the warnings we are just silencing these specific cases.
38
+ target_compile_options (${PROJECT_NAME} -compile-options INTERFACE
39
+ -Wno-unused-but-set-variable -Wno-unused-value
40
+ )
41
+ endif ()
42
+
43
+ if (CMAKE_CXX_COMPILER_ID STREQUAL MSVC )
44
+ target_compile_options (${PROJECT_NAME} -compile-options INTERFACE
45
+ /W4 /Wall /WX /permissive- /Zc:__cplusplus
46
+ )
47
+ endif ()
48
48
49
49
include (ccmath_headers.cmake)
50
50
@@ -54,9 +54,9 @@ add_library(${PROJECT_NAME}::${PROJECT_NAME} ALIAS ${PROJECT_NAME})
54
54
target_sources (${PROJECT_NAME} INTERFACE "$<BUILD_INTERFACE:${ccmath_headers} >" )
55
55
56
56
if (CCMATH_ENABLE_EXTENSIONS)
57
- include (ccmath_extensions_headers.cmake)
58
- target_sources (${PROJECT_NAME} INTERFACE "$<BUILD_INTERFACE:${ccmath_extensions_headers} >" )
59
- endif ()
57
+ include (ccmath_extensions_headers.cmake)
58
+ target_sources (${PROJECT_NAME} INTERFACE "$<BUILD_INTERFACE:${ccmath_extensions_headers} >" )
59
+ endif ()
60
60
61
61
target_include_directories (${PROJECT_NAME} INTERFACE $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR} /include />)
62
62
target_include_directories (${PROJECT_NAME} SYSTEM INTERFACE $<INSTALL_INTERFACE:$<INSTALL_PREFIX >/include >)
@@ -71,63 +71,63 @@ target_link_libraries(${PROJECT_NAME} INTERFACE
71
71
configure_file (cmake/version .hpp.in "${CMAKE_CURRENT_BINARY_DIR} /include/${PROJECT_NAME} /version.hpp" @ONLY)
72
72
73
73
if (CCMATH_BUILD_EXAMPLES OR CCMATH_BUILD_BENCHMARKS OR CCMATH_BUILD_TESTS)
74
- add_subdirectory (thirdparty)
75
- endif ()
74
+ add_subdirectory (thirdparty)
75
+ endif ()
76
76
77
77
if (CCMATH_BUILD_EXAMPLES)
78
- add_subdirectory (example)
79
- endif ()
78
+ add_subdirectory (example)
79
+ endif ()
80
80
81
81
if (CCMATH_BUILD_BENCHMARKS)
82
- add_subdirectory (benchmark)
83
- endif ()
82
+ add_subdirectory (benchmark)
83
+ endif ()
84
84
85
85
if (CCMATH_BUILD_TESTS)
86
- enable_testing ()
87
- add_subdirectory (test )
88
- endif ()
86
+ enable_testing ()
87
+ add_subdirectory (test )
88
+ endif ()
89
89
90
90
if (CCMATH_USE_SIMD)
91
- # TODO: Add a better way to handle enabling simd internally.
92
- add_compile_definitions (INTERNAL_CCMATH_ENABLE_CHECK_FOR_SIMD)
91
+ # TODO: Add a better way to handle enabling simd internally.
92
+ add_compile_definitions (INTERNAL_CCMATH_ENABLE_CHECK_FOR_SIMD)
93
93
endif ()
94
94
95
95
96
- if (CCMATH_INSTALL)
97
- include (GNUInstallDirs)
98
- include (CMakePackageConfigHelpers)
96
+ if (CCMATH_INSTALL)
97
+ include (GNUInstallDirs)
98
+ include (CMakePackageConfigHelpers)
99
99
100
- install (TARGETS
101
- ${PROJECT_NAME}
102
- ${PROJECT_NAME} -compile-options
103
- EXPORT ${PROJECT_NAME} -targets
104
- )
100
+ install (TARGETS
101
+ ${PROJECT_NAME}
102
+ ${PROJECT_NAME} -compile-options
103
+ EXPORT ${PROJECT_NAME} -targets
104
+ )
105
105
106
- install (DIRECTORY
107
- "${CMAKE_CURRENT_SOURCE_DIR} /include/"
108
- DESTINATION "${CMAKE_INSTALL_INCLUDEDIR} "
109
- FILES_MATCHING PATTERN "*.hpp"
110
- )
106
+ install (DIRECTORY
107
+ "${CMAKE_CURRENT_SOURCE_DIR} /include/"
108
+ DESTINATION "${CMAKE_INSTALL_INCLUDEDIR} "
109
+ FILES_MATCHING PATTERN "*.hpp"
110
+ )
111
111
112
- install (FILES
112
+ install (FILES
113
113
"${CMAKE_CURRENT_BINARY_DIR} /include/${PROJECT_NAME} /version.hpp"
114
114
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR} /${PROJECT_NAME} "
115
- )
115
+ )
116
116
117
- install (EXPORT ${PROJECT_NAME} -targets
118
- FILE ${PROJECT_NAME} -targets.cmake
119
- NAMESPACE ${PROJECT_NAME} ::
120
- DESTINATION "${CMAKE_INSTALL_LIBDIR} /cmake/${PROJECT_NAME} "
121
- )
117
+ install (EXPORT ${PROJECT_NAME} -targets
118
+ FILE ${PROJECT_NAME} -targets.cmake
119
+ NAMESPACE ${PROJECT_NAME} ::
120
+ DESTINATION "${CMAKE_INSTALL_LIBDIR} /cmake/${PROJECT_NAME} "
121
+ )
122
122
123
- configure_package_config_file(
123
+ configure_package_config_file(
124
124
cmake/${PROJECT_NAME} -config.cmake.in
125
125
"${CMAKE_CURRENT_BINARY_DIR} /${PROJECT_NAME} -config.cmake"
126
126
INSTALL_DESTINATION "${CMAKE_INSTALL_LIBDIR} /cmake/${PROJECT_NAME} "
127
- )
127
+ )
128
128
129
- install (FILES
130
- "${CMAKE_CURRENT_BINARY_DIR} /${PROJECT_NAME} -config.cmake"
131
- DESTINATION "${CMAKE_INSTALL_LIBDIR} /cmake/${PROJECT_NAME} " )
129
+ install (FILES
130
+ "${CMAKE_CURRENT_BINARY_DIR} /${PROJECT_NAME} -config.cmake"
131
+ DESTINATION "${CMAKE_INSTALL_LIBDIR} /cmake/${PROJECT_NAME} " )
132
132
133
- endif ()
133
+ endif ()
0 commit comments