1
CMAKE_MINIMUM_REQUIRED(VERSION 2.4)
1
cmake_minimum_required(VERSION 2.6)
4
4
# where the game programs are installed
5
IF( NOT BEAR_ENGINE_INSTALL_EXECUTABLE_DIR )
6
SET( BEAR_ENGINE_INSTALL_EXECUTABLE_DIR bin )
7
ENDIF( NOT BEAR_ENGINE_INSTALL_EXECUTABLE_DIR )
5
if( NOT BEAR_ENGINE_INSTALL_EXECUTABLE_DIR )
6
set( BEAR_ENGINE_INSTALL_EXECUTABLE_DIR bin )
7
endif( NOT BEAR_ENGINE_INSTALL_EXECUTABLE_DIR )
9
9
# where the engine libraries are installed
10
IF( NOT BEAR_ENGINE_INSTALL_LIBRARY_DIR )
12
SET( BEAR_ENGINE_INSTALL_LIBRARY_DIR
10
if( NOT BEAR_ENGINE_INSTALL_LIBRARY_DIR )
12
set( BEAR_ENGINE_INSTALL_LIBRARY_DIR
13
13
"${BEAR_ENGINE_INSTALL_EXECUTABLE_DIR}"
16
SET( BEAR_ENGINE_INSTALL_LIBRARY_DIR lib )
18
ENDIF( NOT BEAR_ENGINE_INSTALL_LIBRARY_DIR )
16
set( BEAR_ENGINE_INSTALL_LIBRARY_DIR lib )
18
endif( NOT BEAR_ENGINE_INSTALL_LIBRARY_DIR )
20
20
# Directories where the executable and libraries are built
21
SET( EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}/bin" )
22
SET( LIBRARY_OUTPUT_PATH "${EXECUTABLE_OUTPUT_PATH}" )
21
set( EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}/bin" )
22
set( LIBRARY_OUTPUT_PATH "${EXECUTABLE_OUTPUT_PATH}" )
25
SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}" )
25
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}" )
27
27
#-------------------------------------------------------------------------------
28
28
# various libraries
33
33
# Not really optional, but we want to display a custom message if we do not find
35
INCLUDE(FindCLAW OPTIONAL)
35
include(FindCLAW OPTIONAL)
38
VERSION_GREATER_EQUAL( ${CLAW_VERSION} "1.6.0" CLAW_VERSION_OK )
40
if( NOT CLAW_VERSION_OK )
42
"It seems that libclaw is installed on your system in a too old version."
43
"Check http://libclaw.sourceforge.net/ to download the latest release."
45
endif( NOT CLAW_VERSION_OK )
39
48
"It seems that libclaw is not installed on your system. If your "
40
49
"distribution does not give you an easy installation procedure, check "
41
50
"http://libclaw.sourceforge.net/ to download it."
44
ENDIF( NOT CLAW_FOUND )
46
54
#-------------------------------------------------------------------------------
47
55
# Include directories for Claw
49
57
${CLAW_INCLUDE_DIRECTORY}
50
58
${CLAW_GRAPHIC_INCLUDE_DIRECTORY}
53
61
#-------------------------------------------------------------------------------
54
62
# Link directories for Claw
56
64
${CLAW_LINK_DIRECTORY}
57
65
${CLAW_GRAPHIC_LINK_DIRECTORY}
60
68
#-------------------------------------------------------------------------------
64
FIND_PACKAGE( Boost 1.33 REQUIRED COMPONENTS filesystem thread )
68
"You must have the boost::filesystem library installed (at least 1.33)" )
69
ENDIF( NOT Boost_FOUND )
72
find_package( Boost 1.35 REQUIRED COMPONENTS filesystem system thread )
76
"You must have boost::filesystem and boost::thread libraries installed (at least 1.35)" )
77
endif( NOT Boost_FOUND )
71
79
#-------------------------------------------------------------------------------
72
80
# Include directories for Boost
74
82
${Boost_INCLUDE_DIR}
77
85
#-------------------------------------------------------------------------------
78
86
# Link directories for Boost
80
88
${Boost_LIBRARY_DIRS}
83
91
#-------------------------------------------------------------------------------
85
FIND_PATH( BOOST_SPIRIT boost/spirit.hpp PATHS ${Boost_INCLUDE_DIR} )
87
IF ( NOT BOOST_SPIRIT )
89
"You must have the Boost::Spirit library installed (at least 1.33)" )
90
ENDIF( NOT BOOST_SPIRIT )
92
#-------------------------------------------------------------------------------
96
IF( NOT OPENGL_FOUND )
97
MESSAGE( FATAL_ERROR "OpenGL must be installed." )
98
ENDIF( NOT OPENGL_FOUND )
95
if( NOT OPENGL_FOUND )
96
message( FATAL_ERROR "OpenGL must be installed." )
97
endif( NOT OPENGL_FOUND )
100
99
#-------------------------------------------------------------------------------
105
MESSAGE( FATAL_ERROR "SDL lbrary must be installed." )
106
ELSE( NOT SDL_FOUND )
104
message( FATAL_ERROR "SDL lbrary must be installed." )
105
else( NOT SDL_FOUND )
107
106
#-----------------------------------------------------------------------------
108
107
# Include directories for SDL
110
109
${SDL_INCLUDE_DIR}
112
ENDIF( NOT SDL_FOUND )
111
endif( NOT SDL_FOUND )
114
113
#-------------------------------------------------------------------------------
115
114
# check SDL::mixer
116
INCLUDE( FindSDL_mixer )
115
include( FindSDL_mixer )
118
IF( NOT SDLMIXER_FOUND )
119
MESSAGE( FATAL_ERROR "SDL_mixer lbrary must be installed." )
120
ELSE( NOT SDLMIXER_FOUND )
117
if( NOT SDLMIXER_FOUND )
118
message( FATAL_ERROR "SDL_mixer lbrary must be installed." )
119
else( NOT SDLMIXER_FOUND )
121
120
#-----------------------------------------------------------------------------
122
121
# Include directories for all these libraries
124
123
${SDLMIXER_INCLUDE_DIR}
126
ENDIF( NOT SDLMIXER_FOUND )
125
endif( NOT SDLMIXER_FOUND )
128
127
#-------------------------------------------------------------------------------
129
128
# Link directories for the game
131
130
${LIBRARY_OUTPUT_PATH}
134
133
#-------------------------------------------------------------------------------
135
INCLUDE_DIRECTORIES( common/include )
134
include_directories( common/include )
137
SET( BEAR_ENGINE_INCLUDE_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/core/src" )
136
set( BEAR_ENGINE_INCLUDE_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/core/src" )
139
138
#-------------------------------------------------------------------------------