-
Notifications
You must be signed in to change notification settings - Fork 14
/
CMakeLists.txt
51 lines (39 loc) · 1.48 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
CMAKE_MINIMUM_REQUIRED(VERSION 3.2 FATAL_ERROR)
PROJECT(GenTC CXX C)
SET(GenTC_MAJOR_VERSION 0)
SET(GenTC_MINOR_VERSION 0)
SET(GenTC_PATCH_VERSION 1)
SET(GenTC_VERSION ${GenTC_MAJOR_VERSION}.${GenTC_MINOR_VERSION}.${GenTC_PATCH_VERSION})
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
OPTION(TREAT_WARNINGS_AS_ERRORS "Treat compiler warnings as errors. We use the highest warnings levels for compilers." OFF)
IF(MSVC)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
ELSEIF(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -fms-extensions")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -fms-extensions")
ENDIF(MSVC)
IF(TREAT_WARNINGS_AS_ERRORS)
IF(MSVC)
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /WX")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /WX")
ELSEIF(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror")
ENDIF(MSVC)
ENDIF(TREAT_WARNINGS_AS_ERRORS)
SET(CMAKE_MODULE_PATH "${GenTC_SOURCE_DIR}/CMakeModules" ${CMAKE_MODULE_PATH})
SET(CMAKE_CXX_STANDARD 11)
# Add GLFW... but turn off examples by default.
ADD_SUBDIRECTORY(glfw-3.1)
# Add test directory
ADD_SUBDIRECTORY(googletest)
ENABLE_TESTING()
SET(BUILD_DEMOS ON CACHE BOOL "Build the demo executables")
ADD_SUBDIRECTORY(gpu)
ADD_SUBDIRECTORY(ans)
ADD_SUBDIRECTORY(lib)
ADD_SUBDIRECTORY(codec)
IF (BUILD_DEMOS)
ADD_SUBDIRECTORY(demo)
ENDIF (BUILD_DEMOS)