-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
executable file
·135 lines (111 loc) · 4.92 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
124
125
126
127
128
129
130
131
132
133
134
135
cmake_minimum_required(VERSION 2.6)
project(HARDWAR)
cmake_policy(SET CMP0003 NEW)
# project version
SET( HARDWAR_MAJOR_VERSION 0 )
SET( HARDWAR_MINOR_VERSION 1 )
SET( HARDWAR_PATCH_LEVEL 0 )
SET( CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH}"
"${HARDWAR_SOURCE_DIR}/cmake/modules"
"${HARDWAR_SOURCE_DIR}/cmake/scripts"
)
message(STATUS "Building Hardwar version ${HARDWAR_VERSION_STRING}")
set(abi_version ${HARDWAR_VERSION_STRING})
SET(EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/bin)
SET(LIBRARY_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/lib)
# Set compiler specific build flags
IF (UNIX)
add_definitions(-msse -O3)
ENDIF()
if(WIN32)
set(CMAKE_DEBUG_POSTFIX "_d")
endif(WIN32)
if(MSVC80 OR MSVC90 OR MSVC10)
# Option is to enable the /MP switch for Visual Studio 2005 or later
option(OGITOR_MSVC_ENABLE_MP
"Set to ON to build Ogitor with the /MP option (Visual Studio 2005 and above)." ON)
mark_as_advanced(OGITOR_MSVC_ENABLE_MP)
if(OGITOR_MSVC_ENABLE_MP)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
endif(OGITOR_MSVC_ENABLE_MP)
message(STATUS "Setting Visual Studio 2005+ option /MP to ${HARDWAR_MSVC_ENABLE_MP}")
add_definitions(-D_SCL_SECURE_NO_WARNINGS)
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
add_definitions(-DNOMINMAX)
endif(MSVC80 OR MSVC90 OR MSVC10)
#IF (MSVC_IDE)
# SET(PLATFORM_C_FLAGS "/D \"WIN32\" /D \"_WINDOWS\" /D \"TIXML_USE_STL\" /D \"ENET_DLL\" /fp:fast /EHsc")
# SET(CMAKE_CXX_FLAGS "${PLATFORM_C_FLAGS}")
# SET(CMAKE_CXX_FLAGS_RELEASE "${PLATFORM_C_FLAGS}")
# SET(CMAKE_CXX_FLAGS_DEBUG "${PLATFORM_C_FLAGS} /MDd")
#ENDIF (MSVC_IDE)
#set(Boost_USE_MULTITHREADED True)
#if (WIN32)
# get_filename_component(windows_extras ${CMAKE_SOURCE_DIR}/../hardwar-deps ABSOLUTE)
# set (BOOST_ROOT "${windows_extras}/boost_1_42")#
#
# if (WIN32 OR APPLE)
# set(Boost_USE_STATIC_LIBS TRUE)
# endif ()
#
# set(Boost_ADDITIONAL_VERSIONS "1.42" "1.42.0" "1.41.0" "1.41" "1.40.0" "1.40" "1.39.0" "1.39" "1.38.0" "1.38" "1.37.0" "1.37" )
#endif ()
#set(deps_built True)
find_package(OGRE REQUIRED)
if((NOT "${OGRE_VERSION_NAME}" STREQUAL "Byatis") AND (NOT "${OGRE_VERSION_NAME}" STREQUAL "Ghadamon"))
message(SEND_ERROR "You need Ogre 1.8 Byatis or later to build this.")
endif()
if(APPLE)
find_package(CG REQUIRED)
endif(APPLE)
if (NOT OGRE_BUILD_PLATFORM_IPHONE)
if (WIN32 OR APPLE)
set(Boost_USE_STATIC_LIBS TRUE)
else ()
# Statically linking boost to a dynamic Ogre build doesn't work on Linux 64bit
set(Boost_USE_STATIC_LIBS ${OGRE_STATIC})
endif ()
set(Boost_ADDITIONAL_VERSIONS "1.38.0" "1.38" "1.39.0" "1.39" "1.40.0" "1.40" "1.44.0" "1.44" "1.45" "1.46" "1.47" "1.48" "1.49" "1.49.0" "1.50" "1.50.0")
# Components that need linking (NB does not include header-only components like bind)
set(OGRE_BOOST_COMPONENTS thread date_time regex)
find_package(Boost COMPONENTS ${OGRE_BOOST_COMPONENTS} QUIET)
if (NOT Boost_FOUND)
# Try again with the other type of libs
set(Boost_USE_STATIC_LIBS NOT ${Boost_USE_STATIC_LIBS})
find_package(Boost COMPONENTS ${OGRE_BOOST_COMPONENTS} QUIET)
endif()
if (Boost_FOUND AND WIN32)
if(Boost_VERSION GREATER 104700)
set(OGRE_BOOST_COMPONENTS thread filesystem system)
endif(Boost_VERSION GREATER 104700)
if(Boost_VERSION GREATER 104900)
set(OGRE_BOOST_COMPONENTS thread filesystem system)
endif(Boost_VERSION GREATER 104900)
find_package(Boost COMPONENTS ${OGRE_BOOST_COMPONENTS} QUIET)
endif(Boost_FOUND AND WIN32)
find_package(Boost QUIET)
endif(NOT OGRE_BUILD_PLATFORM_IPHONE)
if(UNIX)
get_filename_component(OGRE_PLUGIN_DIR_LINUX ${OGRE_Plugin_OctreeSceneManager_LIBRARY_REL} PATH)
set (OGRE_PLUGIN_DIR_LINUX ${OGRE_PLUGIN_DIR_LINUX} CACHE STRING "Ogre plugin dir (release)")
endif(UNIX)
include_directories(${OGRE_INCLUDE_DIRS})
include_directories(${OGRE_Terrain_INCLUDE_DIR})
include_directories(${OGRE_Paging_INCLUDE_DIR})
include_directories(${Boost_INCLUDE_DIR})
set(HARDWAR_INCLUDES "${CMAKE_CURRENT_SOURCE_DIR}/code/client/include")
set(HARDWAR_LIBPATH "${CMAKE_CURRENT_SOURCE_DIR}/lib")
set(DEPENDENCIES_INCLUDES
"${CMAKE_CURRENT_SOURCE_DIR}/dependencies/enet/include"
"${CMAKE_CURRENT_SOURCE_DIR}/dependencies/sqlite3"
"${CMAKE_CURRENT_SOURCE_DIR}/dependencies/poshlib"
"${CMAKE_CURRENT_SOURCE_DIR}/dependencies/TinyXML"
)
set(DEPENDENCIES_LIBPATH "${CMAKE_CURRENT_SOURCE_DIR}/lib")
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/dependencies/enet)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/dependencies/sqlite3)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/dependencies/poshlib)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/dependencies/TinyXML)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/dependencies/OgreMax)
#add_subdirectory(code/client)
#add_subdirectory(code/server)