-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
123 lines (92 loc) · 3.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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
cmake_minimum_required(VERSION 2.8)
project(IcicleEngine)
# Version nuber.
set (ICE_VERSION_MAJOR 1)
set (ICE_VERSION_MINOR 0)
#Configuration options
option (BUILD_TESTS "Build Icicle Engine tests" ON)
#3rd party library directories
link_directories ("${CMAKE_SOURCE_DIR}/3rd-party/bgfx/lib/linux")
link_directories ("${CMAKE_SOURCE_DIR}/3rd-party/mygui/lib/${CMAKE_CXX_COMPILER_ID}")
link_directories ("${CMAKE_SOURCE_DIR}/3rd-party/physfs/lib/${CMAKE_CXX_COMPILER_ID}")
link_directories ("${CMAKE_SOURCE_DIR}/3rd-party/bgfx/lib/${CMAKE_CXX_COMPILER_ID}")
link_directories ("${CMAKE_SOURCE_DIR}/3rd-party/glfw/lib/${CMAKE_CXX_COMPILER_ID}")
link_directories ("${CMAKE_SOURCE_DIR}/3rd-party/sfml/lib/${CMAKE_CXX_COMPILER_ID}")
# Generate configuration header
configure_file("${CMAKE_SOURCE_DIR}/include/IcicleConfig.h.in" "${CMAKE_SOURCE_DIR}/include/IcicleConfig.h")
#Load custom modules
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/3rd-party/cmake/modules/")
#Directories
file (GLOB ENGINE_INCLUDE_DIR "${CMAKE_SOURCE_DIR}/include"
"${CMAKE_SOURCE_DIR}/source"
)
include_directories (
"${ENGINE_INCLUDE_DIR}"
"${CMAKE_SOURCE_DIR}/3rd-party/libRocket/include"
"${CMAKE_SOURCE_DIR}/3rd-party/sfml/include"
"${CMAKE_SOURCE_DIR}/3rd-party/bgfx/include"
"${CMAKE_SOURCE_DIR}/3rd-party/glfw/include"
"${CMAKE_SOURCE_DIR}/3rd-party/physfs"
"${CMAKE_SOURCE_DIR}/3rd-party/glm")
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/lib/${CMAKE_CXX_COMPILER_ID})
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/lib/${CMAKE_CXX_COMPILER_ID})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin/${CMAKE_CXX_COMPILER_ID})
#Linux compile
if ( NOT WIN32 )
find_package(OpenGL REQUIRED)
include_directories(${OPENGL_INCLUDE_DIR})
FIND_PACKAGE ( X11 REQUIRED )
include_directories(${X11_INCLUDE_DIR})
set( CMAKE_CXX_FLAGS "-Wall -g -std=gnu++0x" )
find_package(GLIB REQUIRED)
include_directories(${GLIB2_LIBRARIES})
add_definitions(-DICE_DEBUG)
endif ( NOT WIN32 )
file(GLOB ICE_INCLUDES
"${CMAKE_SOURCE_DIR}/include/core/*.h"
"${CMAKE_SOURCE_DIR}/include/system/*.h"
"${CMAKE_SOURCE_DIR}/include/graphics/*.h"
"${CMAKE_SOURCE_DIR}/include/gui/*.h"
)
#icicle-core
file(GLOB CORE_SOURCES
${ICE_INCLUDES}
"${CMAKE_SOURCE_DIR}/source/core/*.h"
"${CMAKE_SOURCE_DIR}/source/core/*.cpp"
)
add_library(icicle-core ${CORE_SOURCES})
#icicle-system
file(GLOB SYSTEM_SOURCES
${ICE_INCLUDES}
"${CMAKE_SOURCE_DIR}/source/system/*.h"
"${CMAKE_SOURCE_DIR}/source/system/*.cpp"
)
add_library(icicle-system ${SYSTEM_SOURCES})
target_link_libraries (icicle-system "icicle-core")
#icicle-graphics
file(GLOB GRAPHICS_SOURCES
${ICE_INCLUDES}
"${CMAKE_SOURCE_DIR}/source/graphics/*.h"
"${CMAKE_SOURCE_DIR}/source/graphics/*.cpp"
)
add_library(icicle-graphics ${GRAPHICS_SOURCES})
#icicle-gui
file(GLOB GUI_SOURCES
${ICE_INCLUDES}
"${CMAKE_SOURCE_DIR}/source/gui/*.h"
"${CMAKE_SOURCE_DIR}/source/gui/*.cpp"
)
add_library(icicle-gui ${GUI_SOURCES})
#icicle-examples
file(GLOB EXAMPLES_SOURCES
${ICE_INCLUDES}
"${CMAKE_SOURCE_DIR}/source/examples/*.h"
"${CMAKE_SOURCE_DIR}/source/examples/*.cpp"
)
add_executable(icicle-examples ${EXAMPLES_SOURCES})
if ( WIN32 )
target_link_libraries (icicle-examples opengl32 icicle-core icicle-gui icicle-graphics icicle-system glfw3 psapi d3d11 D3DCompiler)
endif ( WIN32 )
if ( NOT WIN32 )
target_link_libraries (icicle-examples GL icicle-core icicle-gui icicle-graphics icicle-system sfml-system sfml-network glfw physfs bgfxDebug X11 glib-2.0 pthread dl CEGUIBase-0 CEGUIOpenGLRenderer-0)
endif ( NOT WIN32 )