forked from neudinger/PDIC
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
58 lines (46 loc) · 1.33 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
cmake_minimum_required(VERSION 3.21)
set(TARGET "pdic")
project(${TARGET} VERSION 0.1)
include(FetchContent)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
option(DEBUG "DEBUG option" OFF) # OFF by default
message(STATUS "DEBUG is " ${DEBUG})
option(SKBUILD "SKBUILD option" OFF) # OFF by default
message(STATUS "SKBUILD is " ${SKBUILD})
option(BINARY "BINARY option" OFF) # OFF by default
message(STATUS "BINARY is " ${BINARY})
option(TEST "TEST option" OFF) # OFF by default
message(STATUS "TEST is " ${TEST})
if(DEBUG)
add_compile_definitions(DEBUG=True)
endif(DEBUG)
set(WORKDIR ${CMAKE_CURRENT_LIST_DIR}/src/pdic)
message(STATUS "WORKDIR in: ${WORKDIR}")
file(GLOB SRC
"${WORKDIR}/*.hpp"
"${WORKDIR}/*.cpp"
)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/modules)
if((BINARY OR TEST) OR SKBUILD)
include(Builder)
else((BINARY OR TEST) OR SKBUILD)
message("
Please Use one at least one cmake flag \n\
But only one between\n\
- SKBUILD : python lib\n\
- BINARY : embedded binary\n\
- TEST : ctest\n\n\
cmake -S . \n\
-DSKBUILD:BOOL=OFF # or ON\n\
-DBINARY:BOOL=ON # or OFF\n\
-DTEST:BOOL=OFF # or ON\n\
-DDEBUG:BOOL=ON # or OFF\n\
-B build "
)
endif((BINARY OR TEST) OR SKBUILD)
set(ignoreMe "${SKBUILD}")
unset(DEBUG CACHE)
unset(SKBUILD CACHE)
unset(BINARY CACHE)
unset(TEST CACHE)