-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
87 lines (76 loc) · 3 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
cmake_minimum_required(VERSION 2.6)
OPTION(TAK_USE_ENET "Enable ENET support" ON)
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake ${CMAKE_CURRENT_SOURCE_DIR}/config.h)
FILE(GLOB all_headers *.h)
source_group(headers FILES ${all_headers})
FILE(GLOB all_sources *.cpp)
source_group(sources FILES ${all_sources})
ADD_LIBRARY(tak STATIC ${all_sources})
#####################################################################
# Find packages
#####################################################################
# cmake --help-module-list
if(MSVC)
include_directories(${CMAKE_SOURCE_DIR}/external/vstudio2k10/SFML-2.0-rc/include)
target_link_libraries (tak debug sfml-graphics-d)
target_link_libraries (tak debug sfml-main-d)
target_link_libraries (tak debug sfml-system-d)
target_link_libraries (tak debug sfml-window-d)
target_link_libraries (tak debug sfml-audio-d)
target_link_libraries (tak optimized sfml-graphics)
target_link_libraries (tak optimized sfml-main)
target_link_libraries (tak optimized sfml-system)
target_link_libraries (tak optimized sfml-window)
target_link_libraries (tak optimized sfml-audio)
else(MSVC)
find_package(SFML 2 COMPONENTS system window graphics audio REQUIRED)
include_directories(${SFML_INCLUDE_DIR})
target_link_libraries (tak ${SFML_LIBRARIES})
endif(MSVC)
if(MSVC)
include_directories(${CMAKE_SOURCE_DIR}/external/vstudio2k10/bullet-2.80/include)
target_link_libraries (tak debug BulletSoftBody_debug)
target_link_libraries (tak debug BulletDynamics_debug)
target_link_libraries (tak debug BulletCollision_debug)
target_link_libraries (tak debug LinearMath_debug)
target_link_libraries (tak optimized BulletSoftBody)
target_link_libraries (tak optimized BulletDynamics)
target_link_libraries (tak optimized BulletCollision)
target_link_libraries (tak optimized LinearMath)
else(MSVC)
find_package (Bullet REQUIRED)
include_directories(${BULLET_INCLUDE_DIRS})
target_link_libraries (tak ${BULLET_LIBRARIES})
endif(MSVC)
find_package (OpenGL REQUIRED)
include_directories(${OPENGL_INCLUDE_DIRS})
target_link_libraries (tak ${OPENGL_LIBRARIES})
if(MSVC)
include_directories(${CMAKE_SOURCE_DIR}/external/vstudio2k10/DevIL-SDK-x86-1.7.8/include)
target_link_libraries (tak DevIL)
target_link_libraries (tak ILU)
target_link_libraries (tak ILUT)
else(MSVC)
find_package (DevIL REQUIRED)
include_directories(${IL_INCLUDE_DIR})
target_link_libraries (tak ${IL_LIBRARIES})
target_link_libraries (tak ${ILU_LIBRARIES})
endif(MSVC)
if(MSVC)
include_directories(C:/boost/boost_1_51_0)
else(MSVC)
find_package (Boost COMPONENTS locale REQUIRED)
include_directories(${Boost_INCLUDE_DIRS})
target_link_libraries (tak ${Boost_LIBRARIES})
endif(MSVC)
if(MSVC)
include_directories(${CMAKE_SOURCE_DIR}/external/vstudio2k10/glew-1.7.0/include)
target_link_libraries (tak glew32)
else(MSVC)
target_link_libraries (tak GLEW)
endif(MSVC)
if(NOT MSVC)
target_link_libraries (tak pthread)
endif(NOT MSVC)
#avoid ZERO_CHECK project generated on visual studio
set(CMAKE_SUPPRESS_REGENERATION TRUE)