-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
53 lines (42 loc) · 1.42 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
CMAKE_MINIMUM_REQUIRED(VERSION 3.2)
PROJECT(cpp-sandbox)
SET_PROPERTY(GLOBAL PROPERTY USE_FOLDERS ON)
SET(CMAKE_CXX_STANDARD 14)
SET(CMAKE_CXX_STANDARD_REQUIRED ON)
#
# Preprocessor Definitions
#
ADD_DEFINITIONS(-DUNICODE)
ADD_DEFINITIONS(-D_UNICODE)
IF (MSVC)
ADD_DEFINITIONS(-D_SCL_SECURE_NO_WARNINGS)
ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS)
ADD_DEFINITIONS(-D_CRT_SECURE_NO_DEPRECATE)
ADD_DEFINITIONS(-D_CRT_NONSTDC_NO_DEPRECATE)
ADD_DEFINITIONS(-D_SCL_SECURE_NO_DEPRECATE)
ELSEIF (APPLE)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
ELSE ()
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden")
endif()
SET(ROOT_DIR "${CMAKE_CURRENT_LIST_DIR}")
SET(BUILD_LIB_DIR "${PROJECT_BINARY_DIR}/lib")
SET(BUILD_DEBUG_LIB_DIR "${PROJECT_BINARY_DIR}/lib/Debug")
SET(BUILD_RELEASE_LIB_DIR "${PROJECT_BINARY_DIR}/lib/Release")
SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${BUILD_LIB_DIR})
SET(BUILD_BIN_DIR "${PROJECT_BINARY_DIR}/bin")
SET(BUILD_DEBUG_BIN_DIR "${PROJECT_BINARY_DIR}/bin/Debug")
SET(BUILD_RELEASE_BIN_DIR "${PROJECT_BINARY_DIR}/bin/Release")
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${BUILD_BIN_DIR})
IF (WIN32)
SET(NULL_DEVICE NUL)
ELSE ()
set(NULL_DEVICE /dev/null)
ENDIF ()
IF (CMAKE_COMPILER_IS_GNUCXX)
# Link in filesystem
SET(GLOBAL_LINK_LIBRARIES pthread stdc++fs)
ENDIF()
SET(ROOT_THIRDPARTY_DIR "${CMAKE_SOURCE_DIR}/thirdparty")
ADD_SUBDIRECTORY(thirdparty)
ADD_SUBDIRECTORY(source/cpp-sandbox)