forked from katietz/crender
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
79 lines (59 loc) · 1.65 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
78
79
cmake_minimum_required(VERSION 3.0.0)
set(target_name crender)
project("${target_name}")
# update submodules
# jinja2cpp
add_subdirectory(Jinja2Cpp)
# yaml-cpp
add_subdirectory(yaml-cpp)
# Possibly set some flags
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-strict-aliasing" )
#set(CMAKE_POSITION_INDEPENDENT_CODE ON)
# Boost!
#find_package( Boost REQUIRED date_time thread system chrono)
#include_directories(SYSTEM ${Boost_INCLUDE_DIRS})
#if( NOT WIN32 AND NATIVE_SIZE EQUAL 64 )
# set( Boost_LIBRARIES ${Boost_LIBRARIES} rt)
#endif()
# Not everyone considers GLOBing good form in a mature project.
file(GLOB_RECURSE src_cpp src/*.cpp src/*.cc)
file(GLOB_RECURSE src_h src/*.h)
add_executable(${target_name} ${src_cpp} ${src_h} )
set_property(TARGET ${target_name} PROPERTY CXX_STANDARD 17)
target_include_directories(${target_name} PRIVATE
${CMAKE_SOURCE_DIR}/src
)
target_include_directories(${target_name} SYSTEM PRIVATE
${CMAKE_SOURCE_DIR}/Jinja2Cpp/include
${CMAKE_SOURCE_DIR}/yaml-cpp/include
)
#target_link_directories(${target_name} PRIVATE # maybe this should be public?
# )
target_link_libraries(${target_name} PRIVATE # maybe this should be public?
jinja2cpp
yaml-cpp
pthread
)
if( APPLE OR UNIX OR MINGW )
target_compile_options(${target_name} PRIVATE
-Wall
-Wextra
-Werror
-Wfloat-equal
-Wshadow
# -Wduplicated-branches
-Wctor-dtor-privacy
-Wnon-virtual-dtor
-Wsuggest-override
-Wredundant-decls
# -Wlogical-op
-Wold-style-cast
)
elseif(MSVC)
target_compile_options(${target_name} PRIVATE
/W4
/WX
)
else()
message(FATAL_ERROR "Can't set compile options")
endif()