-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
59 lines (47 loc) · 1.37 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
# Minimum CMake required
cmake_minimum_required(VERSION 3.9)
# Project
project(nforce LANGUAGES CXX VERSION 0.1.0)
# Options
option(NFORCE_BUILD_TESTS "Build tests" ON)
option(NFORCE_BUILD_EXAMPLES "Build examples" ON)
# General Config
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
# Compilation flags
if (MSVC)
set(NFORCE_TEST_COMPILE_OPTIONS_DEBUG "/MDd")
set(NFORCE_TEST_COMPILE_OPTIONS_RELEASE "/MD")
endif()
# Dependencies
add_subdirectory(third_party)
# Lib
set (NFORCE_LIB nforce)
set (NFORCE_INCL
include/nforce/core/except.h
include/nforce/core/status.h
include/nforce/expr.h
include/nforce/lexer.h
include/nforce/parser.h
)
set (NFORCE_SRCS
lib/except.cpp
lib/lexer.cpp
lib/parser.cpp
)
add_library(${NFORCE_LIB} ${NFORCE_INCL} ${NFORCE_SRCS})
set_target_properties(${NFORCE_LIB} PROPERTIES FOLDER "lib")
target_compile_features(${NFORCE_LIB} PUBLIC cxx_std_17)
target_include_directories(${NFORCE_LIB} PRIVATE lib PUBLIC include)
# Tests
if (NFORCE_BUILD_TESTS)
enable_testing()
add_subdirectory(tests)
endif()
# Examples
if (NFORCE_BUILD_EXAMPLES)
add_subdirectory(examples)
endif()
# Summary
message(STATUS "Configuration summary")
message(STATUS "-- Project name : ${PROJECT_NAME}")
message(STATUS "-- Project version : ${PROJECT_VERSION}")