-
Notifications
You must be signed in to change notification settings - Fork 3
/
CMakeDependenciesConfig.txt
66 lines (57 loc) · 2.36 KB
/
CMakeDependenciesConfig.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
IF(WIN32)
set(Ogre_INCLUDE_DIRS "include/Ogre" CACHE PATH "The ogre include path to use")
set(Ogre_LIBRARY_DIRS "lib" CACHE PATH "The ogre lib path to use")
set(Ogre_LIBRARIES "OgreMain" CACHE STRING "The ogre lib to link against")
set(Ois_INCLUDE_DIRS "include/ois" CACHE PATH "The OIS include path to use")
set(Ois_LIBRARY_DIRS "lib" CACHE PATH "The OIS lib path to use")
set(Ois_LIBRARIES "ois" CACHE STRING "The ogre lib to link against")
# add includes to check directories
set(CMAKE_REQUIRED_INCLUDES ${Ogre_INCLUDE_DIRS} ${Ois_INCLUDE_DIRS})
# check for libs and include files we want to use
CHECK_INCLUDE_FILE(windows.h HAVE_WINDOWS_INCLUDES)
if(NOT HAVE_WINDOWS_INCLUDES)
message(FATAL_ERROR "could not find the windows platform includes. Please install them.")
endif()
set(BOOST_PATH "C:/Program Files/boost/boost_1_39" CACHE PATH "The BOOST root path to use")
include_directories(${BOOST_PATH})
link_directories (${BOOST_PATH}/lib)
ELSEIF(UNIX)
find_package(PkgConfig)
PKG_CHECK_MODULES (Ogre OGRE REQUIRED)
PKG_CHECK_MODULES (Ois OIS REQUIRED)
# add includes to check directories
set(CMAKE_REQUIRED_INCLUDES ${Ogre_INCLUDE_DIRS} ${Ois_INCLUDE_DIRS})
# check for libs and include files we want to use
# check below not working!?
#CHECK_LIBRARY_EXISTS(libOgreMain.so loadPlugins "" HAVE_OGRE_LIBS)
#if(NOT HAVE_OGRE_LIBS)
# message(FATAL_ERROR "could not link against Ogre, please check of you have the required libraries installed")
#endif()
ENDIF(WIN32)
IF(NOT WIN32)
# XXX TODO: fix the checks for windows!
# add this so the checks work
set(CMAKE_REQUIRED_INCLUDES ${Ogre_INCLUDE_DIRS} ${Ois_INCLUDE_DIRS})
# cross platform checks
# check for libs and include files we want to use
CHECK_INCLUDE_FILE_CXX(OgrePrerequisites.h HAVE_OGRE_INCLUDES)
if(NOT HAVE_OGRE_INCLUDES)
message("could not find the Ogre includes. Please install them.")
endif()
CHECK_INCLUDE_FILE_CXX(OIS/OIS.h HAVE_OIS_DIR_INCLUDES)
if(HAVE_OIS_DIR_INCLUDES)
set(OIS_INCLUDE "OIS/OIS.h")
endif()
CHECK_INCLUDE_FILE_CXX(OIS.h HAVE_OIS_INCLUDES)
if(HAVE_OIS_INCLUDES)
set(OIS_INCLUDE "OIS.h")
endif()
if(NOT HAVE_OIS_DIR_INCLUDES AND NOT HAVE_OIS_INCLUDES)
message("could not find the OIS includes. Please install them.")
endif()
if(HAVE_OIS_DIR_INCLUDES AND NOT HAVE_OIS_INCLUDES)
set(OIS_USING_DIR TRUE)
else()
set(OIS_USING_DIR FALSE)
endif()
endif()