-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
46 lines (33 loc) · 969 Bytes
/
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
cmake_minimum_required(VERSION 3.15)
project(capi VERSION 0.3)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(CMAKE_VERBOSE_MAKEFILE ON)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
add_compile_options(-fno-rtti)
list(APPEND CMAKE_MODULE_PATH
${CMAKE_CURRENT_SOURCE_DIR}/cmake
${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules)
include(ToolchainOptions)
#include(CMakePackageConfigHelpers)
add_format_target(format-sources
"Formats project source files"
TARGETS
lib/*.cpp
lib/*.h
)
add_subdirectory(lib)
add_subdirectory(scripts)
add_subdirectory(examples)
if (ENABLE_TESTING)
enable_testing()
add_subdirectory(test)
endif()
include(GetGitRevisionDescription)
get_git_head_revision(GIT_REFSPEC GIT_SHA1)
if(NOT DEFINED GIT_SHA1)
set(GIT_SHA1 "NO_GIT_ROOT")
endif()
configure_file(capi_version.h.in capi_version.h)