-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
65 lines (57 loc) · 2 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
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
PROJECT(libogreal-dev)
SET(CPACK_PACKAGE_CONTACT "Patrick Charrier <[email protected]>")
INCLUDE(CPack)
# options
OPTION(BUILD_WITH_OPENMP "Build with OpenMP support." OFF)
OPTION(Boost_USE_STATIC_LIBS "Use Boost Static Libs" ON)
OPTION(Boost_USE_MULTITHREADED "Use Boost Multithreaded Libs" ON)
OPTION(Boost_USE_STATIC_RUNTIME "Use Boost Static Runtime" OFF)
OPTION(Boost_DISABLE_AUTOLINKING "Disable Boost auto linking." ON)
IF(Boost_DISABLE_AUTOLINKING)
ADD_DEFINITIONS(-DBOOST_ALL_NO_LIB)
ENDIF(Boost_DISABLE_AUTOLINKING)
# use packages
SET(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
FIND_PACKAGE(Boost COMPONENTS thread date_time REQUIRED)
FIND_PACKAGE(OGRE REQUIRED)
FIND_PACKAGE(OIS REQUIRED)
FIND_PACKAGE(OpenAL REQUIRED)
FIND_PACKAGE(OggVorbis REQUIRED)
# setup directories
SET (CMAKE_LIBRARY_OUTPUT_DIRECTORY
${PROJECT_BINARY_DIR}/bin
CACHE PATH
"Single Directory for all Libraries"
)
SET (CMAKE_RUNTIME_OUTPUT_DIRECTORY
${PROJECT_BINARY_DIR}/bin
CACHE PATH
"Single Directory for all Executables."
)
SET (CMAKE_ARCHIVE_OUTPUT_DIRECTORY
${PROJECT_BINARY_DIR}/lib
CACHE PATH
"Single Directory for all static libraries."
)
# settings
SET(CMAKE_BUILD_TYPE Release)
INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIR} ${OGRE_INCLUDE_DIR} ${OGRE_Overlay_INCLUDE_DIR} "${OGRE_INCLUDE_DIR}/OGRE" ${OIS_INCLUDE_DIRS}
${OPENAL_INCLUDE_DIR} ${OGG_INCLUDE_DIR} ${VORBIS_INCLUDE_DIR} include)
LINK_DIRECTORIES(${Boost_LIBRARY_DIRS} ${OGRE_LIB_DIR})
# build subdirectories
ADD_SUBDIRECTORY(src)
ADD_SUBDIRECTORY(Demos)
# install
INSTALL(DIRECTORY "include/." DESTINATION "include/OgreAL" PATTERN "*.svn" EXCLUDE)
# OpenMP settings
if(BUILD_WITH_OPENMP)
FIND_PACKAGE(OpenMP REQUIRED)
if(OPENMP_FOUND)
set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS})
endif(OPENMP_FOUND)
if(UNIX)
#TARGET_LINK_LIBRARIES(BeeGame gomp)
#ADD_DEFINITIONS(-D_GLIBCXX_PARALLEL) # CAUSING LINKER ERROR
endif(UNIX)
endif(BUILD_WITH_OPENMP)