-
Notifications
You must be signed in to change notification settings - Fork 4
/
CMakeLists.txt
79 lines (67 loc) · 1.83 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
project(demo)
cmake_minimum_required(VERSION 2.8.9)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
if(WIN32)
set(CMAKE_LIBRARY_PATH "C:\\Program Files (x86)\\Windows Kits\\8.0\\Lib\\win8\\um\\x64")
cmake_policy(SET CMP0020 NEW) # to avoid cmake warning
endif()
set(CMAKE_AUTOMOC ON)
find_package(Qt5Widgets REQUIRED)
find_package(Qt5OpenGL REQUIRED)
find_package(OpenGL REQUIRED)
if(UNIX)
find_package(Qt5X11Extras REQUIRED)
find_package(Boost REQUIRED COMPONENTS system thread)
find_package(GLEW REQUIRED)
endif()
set(OGRE_RESOURCE_FOLDER ${PROJECT_SOURCE_DIR}/resources)
if(UNIX)
include_directories(/usr/include/OGRE)
set(BOOST_LINK_LIBS
boost_system
boost_thread
)
set(OGRE_PLUGIN_FOLDER /usr/lib/OGRE/)
elseif(WIN32)
include_directories(
"${OGRE_HOME}\\include"
"${OGRE_HOME}\\include\\OGRE"
"${OGRE_HOME}\\include\\OGRE\\RenderSystems\\GL"
"${OGRE_HOME}\\boost"
)
set(BOOST_LINK_LIBS
libboost_system-vc100-mt-1_55
libboost_thread-vc100-mt-1_55
)
link_directories(
${LINK_DIRECORIES}
"${OGRE_HOME}\\lib\\Release"
"${OGRE_HOME}\\boost\\lib"
)
set(OGRE_PLUGIN_FOLDER "${OGRE_HOME}\\bin\\Release")
endif()
add_executable(QOgreWidgetDemo
QOgreWidget.cpp
QOgreWidgetDemo.cpp
main.cpp
)
if(UNIX)
qt5_use_modules(QOgreWidgetDemo OpenGL Widgets X11Extras)
elseif(WIN32)
qt5_use_modules(QOgreWidgetDemo OpenGL Widgets)
endif()
target_link_libraries(QOgreWidgetDemo
${OPENGL_LIBRARIES}
${BOOST_LINK_LIBS}
OgreMain
OIS
)
configure_file (
"${PROJECT_SOURCE_DIR}/plugins.cfg.in"
"${PROJECT_BINARY_DIR}/plugins.cfg"
)
configure_file (
"${PROJECT_SOURCE_DIR}/resources.cfg.in"
"${PROJECT_BINARY_DIR}/resources.cfg"
)
install(TARGETS QOgreWidgetDemo RUNTIME DESTINATION bin)