-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
62 lines (49 loc) · 1.55 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
#
#
# @description: crtc dc module third party dependency package
cmake_minimum_required(VERSION 3.10)
project(crtc_dc VERSION 0.0.1 LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
project(crtc_dc)
# crtc_dc dependencies
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/deps/crtc_dc/include)
# crtc_dc global complier settings
if(MSVC)
set(variables CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE
CMAKE_CXX_FLAGS_RELWITHDEBINFO CMAKE_CXX_FLAGS_MINSIZEREL)
foreach(variable ${variables})
if(${variable} MATCHES "/MT")
string(REGEX REPLACE "/MT" "/MD" ${variable} "${${variable}}")
endif()
if(${variable} MATCHES "/MTd")
string(REGEX REPLACE "/MTd" "/MDd" ${variable} "${${variable}}")
endif()
endforeach()
add_compile_options(
$<$<CONFIG:>:/MD> # ---------|
$<$<CONFIG:Debug>:/MDd> # ---|-- Statically link the runtime libraries
$<$<CONFIG:Release>:/MD> # --|
$<$<CONFIG:MinSizeRel>:/MD> # --|
$<$<CONFIG:RelWithDebInfo>:/MD> # --|
)
endif()
# crtc_dc global macro settings
if(MSVC)
add_compile_definitions(_CRT_SECURE_NO_DEPRECATE _CRT_NONSTDC_NO_DEPRECATE)
endif()
if(WIN32)
add_definitions(-D_UNICODE -DUNICODE -DNOMINMAX)
else()
add_definitions(-D_POSIX_)
endif()
if(APPLE)
add_definitions(-D__APPLE__)
endif()
# crtc_dc sub directory
add_subdirectory(crtc_utils)
# crtc_dc test
enable_testing()
add_subdirectory(tests)