-
Notifications
You must be signed in to change notification settings - Fork 3
/
CMakeLists.txt
48 lines (38 loc) · 1.27 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
cmake_minimum_required(VERSION 3.5)
project(CMakeSL)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKESL_DIR ${CMAKE_CURRENT_SOURCE_DIR})
set(CMAKESL_DOC_DIR ${CMAKESL_DIR}/doc)
set(CMAKESL_SCRIPTS_DIR ${CMAKESL_DIR}/scripts)
set(CMAKESL_SOURCES_DIR ${CMAKESL_DIR}/source)
set(CMAKESL_GENERATED_PARENT_DIR ${CMAKE_CURRENT_BINARY_DIR})
if(NOT WIN32)
set(CMAKESL_ADDITIONAL_COMPILER_FLAGS -Wall -Werror)
endif()
include_directories(facade)
add_subdirectory(source)
option(CMAKESL_WITH_TOOLS "When ON, tools will be built" OFF)
if (CMAKESL_WITH_TOOLS)
add_subdirectory(tools)
endif ()
option(CMAKESL_WITH_EXAMPLES "When ON, examples will be built" OFF)
if (CMAKESL_WITH_EXAMPLES)
if(NOT CMAKESL_WITH_TOOLS)
message(FATAL_ERROR
Examples can not be built without tools support.
Enable CMAKESL_WITH_TOOLS option and try again)
endif()
add_subdirectory(examples)
endif ()
option(CMAKESL_WITH_TESTS "When ON, test will be built" OFF)
if (CMAKESL_WITH_TESTS)
enable_testing()
include(CTest)
add_subdirectory(external/googletest EXCLUDE_FROM_ALL)
add_subdirectory(test)
endif ()
option(CMAKESL_WITH_DOCS "When ON, documentation will be built" OFF)
if (CMAKESL_WITH_DOCS)
add_subdirectory(doc)
endif ()