-
Notifications
You must be signed in to change notification settings - Fork 57
/
CMakeLists.txt
47 lines (38 loc) · 1.38 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
project(scriptbots)
cmake_minimum_required(VERSION 2.8)
find_package(OpenGL REQUIRED)
find_package(GLUT REQUIRED)
if (WIN32 AND NOT GLUT_FOUND)
find_library(GLUT32_LIBRARY NAMES glut32 PATHS ${CMAKE_CURRENT_SOURCE_DIR})
SET (LOCAL_GLUT32 1)
endif()
find_package(OpenMP)
if (OPENMP_FOUND)
SET (HAVE_OPENMP 1)
SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
endif()
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h)
include_directories(${CMAKE_CURRENT_BINARY_DIR} ${OPENGL_INCLUDE_DIRS} ${GLUT_INCLUDE_DIRS})
set( SB_SRCS
View.cpp
GLView.cpp
main.cpp
DWRAONBrain.cpp
Agent.cpp
World.cpp
vmath.cpp )
add_executable(scriptbots ${SB_SRCS})
if (WIN32 AND NOT GLUT_FOUND)
target_link_libraries(scriptbots ${OPENGL_LIBRARIES} ${GLUT_LIBRARIES} ${GLUT32_LIBRARY})
else()
target_link_libraries(scriptbots ${OPENGL_LIBRARIES} ${GLUT_LIBRARIES})
endif()
# copy glut32.dll to the output dirs
# not sure how msvc could be true and win32 not, but just in case..
if (MSVC AND WIN32 AND NOT GLUT_FOUND)
file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/Debug)
file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/Release)
file(COPY glut32.dll DESTINATION ${PROJECT_BINARY_DIR}/Debug)
file(COPY glut32.dll DESTINATION ${PROJECT_BINARY_DIR}/Release)
endif()