forked from GabrielDosReis/ipr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
78 lines (67 loc) · 1.58 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
66
67
68
69
70
71
72
73
74
75
76
77
cmake_minimum_required(
VERSION 3.15
)
option(BUILD_DOC
"Build LaTeX documentation"
OFF
)
project(ipr
VERSION 0.50
LANGUAGES CXX
)
add_library(${PROJECT_NAME}
src/interface.cxx
src/impl.cxx
src/io.cxx
src/traversal.cxx
src/utility.cxx
)
target_include_directories(${PROJECT_NAME}
PUBLIC
${PROJECT_SOURCE_DIR}/include
)
set_target_properties(${PROJECT_NAME}
PROPERTIES
CXX_STANDARD 20
CXX_STANDARD_REQUIRED ON
CXX_EXTENSIONS OFF
)
target_compile_options(${PROJECT_NAME}
PRIVATE
$<$<CXX_COMPILER_ID:MSVC>:
/W2 # Usual warnings
/permissive- # Turn on strict language conformance
/EHsc # Turn on exception handling semantics
>
$<$<OR:$<CXX_COMPILER_ID:GNU>,$<CXX_COMPILER_ID:Clang>>:
-Wall # Turn on all useful warnings
-pedantic # Turn on strict language conformance
>
$<$<CXX_COMPILER_ID:Clang>:
-Wno-overloaded-virtual # Too many false positives
-Wno-delete-non-abstract-non-virtual-dtor # System headers plagued
>
)
target_compile_definitions(${PROJECT_NAME}
PRIVATE
$<$<PLATFORM_ID:UNIX>:
_FILE_OFFSET_BITS=64 # We want the ability to process large files.
>
)
install(
TARGETS ipr
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
)
install(
DIRECTORY include/ipr
DESTINATION include
)
if(BUILD_DOC)
include(cmake/UseLATEX.cmake)
add_subdirectory(doc)
endif()
# Testing
enable_testing()
set(DOCTEST_INCLUDE_DIR "${PROJECT_SOURCE_DIR}/3rdparty")
add_subdirectory(tests)