-
Notifications
You must be signed in to change notification settings - Fork 4
/
CMakeLists.txt
65 lines (49 loc) · 2.29 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
cmake_minimum_required(VERSION 3.21 FATAL_ERROR )
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules")
include(get_fixed_math_version)
include(cmake/CPM.cmake)
project(fixed_math
LANGUAGES CXX
VERSION "${fixed_math_VERSION_MAJOR}.${fixed_math_VERSION_MINOR}.${fixed_math_VERSION_PATCH}" )
message(STATUS "fixed_math VERSION: ${fixed_math_VERSION}")
set(fixed_math_HOMEPAGE_URL "https://github.com/arturbac/fixed_math")
set(fixed_math_DESCRIPTION "fixed point math library in C++20")
include(FeatureSummary)
# Set a default build type if none was specified
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
message(STATUS "Setting build type to 'Release' as none was specified.")
set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build." FORCE)
# Set the possible values of build type for cmake-gui
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
endif()
include(GNUInstallDirs)
#-----------------------------------------------------------------------------
# options
#-----------------------------------------------------------------------------
if(PROJECT_IS_TOP_LEVEL)
option(FIXEDMATH_ENABLE_UNIT_TESTS "unit tests available from CTest" ON )
add_feature_info("FIXEDMATH_ENABLE_UNIT_TESTS" FIXEDMATH_ENABLE_UNIT_TESTS "unit test available from CTest")
option(FIXEDMATH_ENABLE_DEVEL_CODE "enable internaly used for development code" OFF )
add_feature_info("ENABLE_DEVEL_CODE" ENABLE_DEVEL_CODE "enable internaly used for development code")
endif()
# if(NOT DEFINED CMAKE_CXX_STANDARD OR CMAKE_CXX_STANDARD LESS 23 )
# message(STATUS "Assuming by default c++23 standard")
# set( CMAKE_CXX_STANDARD 23 )
# endif()
# set( CMAKE_CXX_STANDARD_REQUIRED ON )
set( CMAKE_CXX_EXTENSIONS OFF)
#-----------------------------------------------------------------------------
# project
#-----------------------------------------------------------------------------
add_subdirectory( fixed_lib )
if(PROJECT_IS_TOP_LEVEL AND FIXEDMATH_ENABLE_DEVEL_CODE)
# add_subdirectory(perf_test_suite)
endif()
if( PROJECT_IS_TOP_LEVEL AND FIXEDMATH_ENABLE_UNIT_TESTS)
enable_testing( TRUE )
add_subdirectory(unit_tests)
endif()
if( PROJECT_IS_TOP_LEVEL)
feature_summary(WHAT ALL)
endif()
add_subdirectory(examples)