-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathCMakeLists.txt
53 lines (43 loc) · 1.31 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
cmake_minimum_required (VERSION 3.6)
set_property (GLOBAL PROPERTY USE_FOLDERS ON)
set (CMAKE_SUPPRESS_REGENERATION 1)
set (CMAKE_CONFIGURATION_TYPES Debug;Release;RelWithDebInfo)
add_definitions (-DUNICODE -D_UNICODE)
project (TinyCppTest)
enable_testing ()
function (SetCompilerOptions module)
target_compile_options (${module} PUBLIC "$<$<CONFIG:Debug>:-DDEBUG>")
if (WIN32)
set (AdditionalWarnings /w44061 /w44062 /w44265 /w44266 /w44355 /w44596 /w44800)
target_compile_options (${module} PUBLIC /W4 /WX ${AdditionalWarnings} ${VSE_CUSTOM_BUILD_OPTIONS})
else ()
target_compile_options (${module} PUBLIC -std=c++11 -Wall -Wextra -Werror ${VSE_CUSTOM_BUILD_OPTIONS})
endif ()
endfunction ()
# TinyCppTest
set (TinyCppTestSourcesFolder Sources)
file (GLOB TinyCppTestSourceFiles
${TinyCppTestSourcesFolder}/*.hpp
)
add_custom_target (
TinyCppTest ALL
SOURCES ${TinyCppTestSourceFiles}
)
source_group ("Sources" FILES ${TinyCppTestSourceFiles})
# Example
set (ExampleSourcesFolder Example)
file (GLOB
ExampleSourceFiles
${ExampleSourcesFolder}/*.hpp
${ExampleSourcesFolder}/*.cpp
)
add_executable (
Example
${ExampleSourceFiles}
)
target_include_directories (Example PUBLIC
${TinyCppTestSourcesFolder}
)
SetCompilerOptions (Example)
source_group ("Sources" FILES ${ExampleSourceFiles})
add_test (Example Example)