forked from SteerSuite/steersuite-rutgers
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
86 lines (82 loc) · 3.12 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
cmake_minimum_required( VERSION 2.8.11 )
project( SteerSuite )
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/CMakeModules;${CMAKE_MODULE_PATH}")
set(CMAKE_DEBUG_POSTFIX "d")
include(CheckCXXCompilerFlag)
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_CLANGXX)
if(EMSCRIPTEN)
set(STEERSUITE_GCC_HAS_SSE FALSE)
else()
check_cxx_compiler_flag(-msse STEERSUITE_GCC_HAS_SSE)
endif()
if(STEERSUITE_GCC_HAS_SSE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse")
endif ()
set(STEERSUITE_WARNING_FLAGS "-Wall -Winit-self -Wno-overloaded-virtual -Wcast-qual -Wwrite-strings -Wextra -Wno-unused-parameter -Wshadow -Wno-missing-field-initializers -Wno-long-long")
if(EMSCRIPTEN)
set(STEERSUITE_WARNING_FLAGS "${STEERSUITE_WARNING_FLAGS} -Wno-warn-absolute-paths")
elseif (NOT APPLE)
set(STEERSUITE_WARNING_FLAGS "${STEERSUITE_WARNING_FLAGS} -Wno-unused-but-set-parameter")
endif ()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${STEERSUITE_WARNING_FLAGS} -std=c++0x -ggdb")
endif ()
if(MSVC)
if(CMAKE_BUILD_TOOL STREQUAL "nmake")
set(NMAKE TRUE)
endif()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /fp:fast")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /Oi")
if(CMAKE_CL_64)
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /bigobj")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /bigobj")
endif ()
if(MSVC_VERSION GREATER 1500 OR MSVC_VERSION EQUAL 1500)
option(STEERSUITE_BUILD_MSVC_MP "Enable build with multiple processes in Visual Studio" TRUE)
else()
set(STEERSUITE_BUILD_MSVC_MP FALSE CACHE BOOL "Compiler option /MP requires at least Visual Studio 2008 (VS9) or newer" FORCE)
endif()
if(STEERSUITE_BUILD_MSVC_MP)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
endif ()
endif ()
if(MINGW)
add_definitions(-D_WIN32_WINNT=0x0601)
if(CMAKE_SIZEOF_VOID_P EQUAL 4)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=i686")
endif()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fpermissive -fno-tree-slp-vectorize -Wno-error=cast-qual -Wno-unused-local-typedefs")
endif()
if((CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_CLANGXX) AND NOT MINGW)
if(CMAKE_SIZEOF_VOID_P EQUAL 8 AND NOT APPLE)
add_definitions(-fPIC)
endif()
endif()
find_package(OpenGL REQUIRED)
find_package(GLEW REQUIRED)
find_package(GLUT REQUIRED)
include_directories(${OPENGL_INCLUDE_DIR} ${GLEW_INCLUDE_DIR} ${GLUT_INCLUDE_DIR})
add_definitions(-DENABLE_GUI -DENABLE_GLFW -DGLFW_DLL)
#set(CMAKE_AUTOMOC ON)
#find_package(Qt5Core)
#find_package(Qt5Gui)
#find_package(Qt5OpenGL)
#if(${Qt5OpenGL_FOUND})
# include_directories(${Qt5OpenGL_INCLUDE_DIRS})
# add_definitions(-DENABLE_QT)
#endif()
add_subdirectory( external/tinyxml )
add_subdirectory( external/glfw )
add_subdirectory( util )
add_subdirectory( steerlib )
add_subdirectory( steersimlib )
add_subdirectory( steersim )
add_subdirectory( simpleAI )
add_subdirectory( socialForcesAI )
add_subdirectory( rvo2AI )
add_subdirectory( pprAI )
add_subdirectory( external/recastnavigation )
add_subdirectory( navmeshBuilder )
add_subdirectory( steerbench )
add_subdirectory( documentation )
add_subdirectory( curveAI )
install(DIRECTORY testcases DESTINATION share)