forked from openwayne/GameFrame
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
93 lines (68 loc) · 2.54 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
cmake_minimum_required(VERSION 2.8)
project(GameFrame)
# Global project settings
if (NOT DEFINED CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Debug)
endif (NOT DEFINED CMAKE_BUILD_TYPE)
message("Build type: ${CMAKE_BUILD_TYPE}")
if (CMAKE_COMPILER_IS_GNUCXX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -std=c++0x")
elseif (MSVC)
set(CMAKE_SHARED_LINKER_FLAGS ${CMAKE_SHARED_LINKER_FLAGS} "/NODEFAULTLIBS:LIBCMT")
set(CMAKE_SHARED_LINKER_FLAGS ${CMAKE_SHARED_LINKER_FLAGS} "/NODEFAULTLIBS:MSVCRT")
set(CMAKE_SHARED_LINKER_FLAGS ${CMAKE_SHARED_LINKER_FLAGS} "/NODEFAULTLIBS:MSVCPRTD")
endif (CMAKE_COMPILER_IS_GNUCXX)
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin)
set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/lib)
# Global dependencies
set(Boost_USE_STATIC_LIBS ON)
set(Boost_USE_MULTITHREADED ON)
set(Boost_USE_STATIC_RUNTIME OFF)
find_package(Boost 1.47 REQUIRED COMPONENTS system chrono thread date_time)
if (NOT Boost_FOUND)
message(FATAL_ERROR "Boost was not found")
endif (NOT Boost_FOUND)
find_package(SDL)
if (NOT SDL_FOUND)
message(FATAL_ERROR "SDL was not found (yes, it isn't necessary for the core framework, but I haven't built this to be that flexible yet. With time. With time.")
endif (NOT SDL_FOUND)
find_package(SDL_image)
if (NOT SDLIMAGE_FOUND)
message(FATAL_ERROR "SDL_image was not found (yes, it isn't necessary for the core framework, but I haven't built this to be that flexible yet. With time. With time.")
endif (NOT SDLIMAGE_FOUND)
# Global includes
include_directories("${Boost_INCLUDE_DIRS}")
include_directories("${SDL_INCLUDE_DIR}")
include_directories("${SDLIMAGE_INCLUDE_DIR}")
#include_directories("${PROJECT_SOURCE_DIR}")
include_directories("${GameFrame_SOURCE_DIR}")
# CMake modules path
set(CMAKE_MODULE_PATH
${CMAKE_MODULE_PATH}
${CMAKE_SOURCE_DIR}/cmake
)
# Core library
add_subdirectory(gf)
# Core library test cases
add_subdirectory(test)
# Demo application
add_subdirectory(demo)
# include_directories("${SOME_VAR_NAME}/directory")
#link_directories("${PROJECT_BINARY_DIR}") #CMAKE_CURRENT_BINARY_DIR
#file(GLOB webclient_cpp
# "*.cpp"
# "*.h"
#)
#set(webserver_cpp
# "flo.cpp"
#)
#find_package(Boost REQUIRED COMPONENTS thread)
#if (NOT Boost_FOUND)
# message(FATAL_ERROR "Boost was not found")
#endif (NOT Boost_FOUND)
#add_executable(flo ${webserver_cpp})
#target_link_libraries(flo ${Boost_LIBRARIES})
#file(COPY "${PROJECT_SOURCE_DIR}/www" DESTINATION "${PROJECT_BINARY_DIR}")
#add_subdirectory (Hello)
#add_library (Hello hello.cxx)
# install (TARGETS download DESTINATION bin)