-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
63 lines (49 loc) · 1.92 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
cmake_minimum_required(VERSION 2.8.11)
# Name of the project
set(PROJECT_NAME EmbededPython)
project(${PROJECT_NAME})
#Bring the headers into the project (local ones)
include_directories(include $ENV{HOME}/NGL/include)
#the file(GLOB...) allows for wildcard additions of our src dir
set(SOURCES ${PROJECT_SOURCE_DIR}/src/main.cpp
${PROJECT_SOURCE_DIR}/src/NGLScene.cpp
${PROJECT_SOURCE_DIR}/src/Agent.cpp
${PROJECT_SOURCE_DIR}/include/NGLScene.h
${PROJECT_SOURCE_DIR}/include/Agent.h
)
# use C++ 11
set(CMAKE_CXX_STANDARD 11)
find_package(PythonLibs REQUIRED)
include_directories(${PYTHON_INCLUDE_PATH})
# see what platform we are on and set platform defines
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
find_library(MACGL OpenGL)
set ( PROJECT_LINK_LIBS -lNGL ${MACGL} ${PYTHON_LIBRARIES})
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
set ( PROJECT_LINK_LIBS -lNGL -lGL ${PYTHON_LIBRARIES})
endif()
#As were using Qt we need to run moc
#disable -rdynamic
SET(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "")
SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "")
# define this if you want to include the stanford data sets
# these are very big and make compilation time huge
add_definitions(-DADDLARGEMODELS)
# Find includes in corresponding build directories
set(CMAKE_INCLUDE_CURRENT_DIR ON)
# Instruct CMake to run moc automatically when needed.
set(CMAKE_AUTOMOC ON)
add_definitions(-O2 -D_FILE_OFFSET_BITS=64 -fPIC)
# now add NGL specific values
#set ( PROJECT_LINK_LIBS -lNGL )
link_directories( $ENV{HOME}/NGL/lib )
# as NGL uses Qt we need to define this flag
add_definitions(-DQT5BUILD)
# NGL also needs the OpenGL framework from Qt so add it
find_package(Qt5OpenGL)
find_package(Qt5Widgets)
find_package(Qt5Gui)
find_package(Qt5Core)
# add exe and link libs this must be after the other defines
add_executable(${PROJECT_NAME} ${SOURCES})
target_link_libraries(${PROJECT_NAME} ${PROJECT_LINK_LIBS} Qt5::OpenGL Qt5::Core Qt5::Gui Qt5::Widgets )