-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
54 lines (40 loc) · 1.25 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
# Distributed under the MIT License (See accompanying file /LICENSE )
# CMake build : global project
cmake_minimum_required (VERSION 3.3)
project (algorithms)
set_property (GLOBAL PROPERTY USE_FOLDERS ON)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
if (WIN32)
#Visual Studio 2017
if (MSVC_VERSION GREATER_EQUAL "1900")
MESSAGE ("=> C++17 Compatible")
include(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG("/std:c++latest" _cpp_latest_flag_supported)
if (_cpp_latest_flag_supported)
add_compile_options("/std:c++latest")
endif()
else()
MESSAGE ("=> C++14 Compatible")
set (CMAKE_CXX_STANDARD 14)
set (CMAKE_CXX_STANDARD_REQUIRED ON)
endif()
else()
endif()
set (THREADS_PREFER_PTHREAD_FLAG ON)
find_package (Threads REQUIRED)
option(DIR_SAMPLE "Enable building sample subdirectory" ON)
option(DIR_SORT "Enable building sort" ON)
#option(DIR_APP "Enable building main App" ON)
add_subdirectory (third_party EXCLUDE_FROM_ALL)
if(DIR_SORT)
add_subdirectory (sort)
endif()
#if(DIR_APP)
# add_subdirectory (app)
#endif()
if(DIR_SAMPLE)
add_subdirectory (sample)
endif()
enable_testing ()