forked from mamontov-cpp/saddy-graphics-engine-2d
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
executable file
·52 lines (42 loc) · 1.46 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 2.8.12)
project(saddy-graphics-engine-2d)
file(GLOB_RECURSE SRCS src/*.cpp src/*.cc)
file(GLOB_RECURSE HDRS include/*.h)
set(SADDY_LIBRARY_NAME "saddy")
set(SADDY_CXX_DEBUG_FLAGS "-std=c++14 -Wno-reorder -Wno-unused -Wno-sign-compare -w")
set(SADDY_CXX_RELEASE_FLAGS "-std=c++14 -O2 -Wno-reorder -Wno-unused -Wno-sign-compare -w")
if (NOT CMAKE_BUILD_TYPE)
message(STATUS "No build type selected, default to Release")
set(CMAKE_BUILD_TYPE "Release")
set(SADDY_LIBRARY_NAME "${SADDY_LIBRARY_NAME}")
endif()
macro(SET_GCC_FLAGS)
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${SADDY_CXX_DEBUG_FLAGS}")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${SADDY_CXX_RELEASE_FLAGS}")
if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${SADDY_CXX_RELEASE_FLAGS}")
endif()
endmacro(SET_GCC_FLAGS)
include_directories(include)
IF (WIN32)
add_definitions(-DWIN32)
IF (MINGW)
add_definitions(-DMINGW)
SET_GCC_FLAGS()
ENDIF()
IF (MSVC)
add_definitions(-DCRT_SECURE_NO_WARNINGS -D_CRT_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS -D_SCL_SECURE_NO_DEPRECATE)
ENDIF()
ELSE()
add_definitions(-DUNIX -DLINUX -DGCC -DX11)
SET_GCC_FLAGS()
ENDIF()
add_library(${SADDY_LIBRARY_NAME} ${SRCS} ${HDRS})
set_target_properties(${SADDY_LIBRARY_NAME}
PROPERTIES
ARCHIVE_OUTPUT_DIRECTORY "lib"
LIBRARY_OUTPUT_DIRECTORY "lib"
RUNTIME_OUTPUT_DIRECTORY "bin"
DEBUG_POSTFIX "-debug"
RELEASE_POSTFIX "-release"
)