-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
70 lines (57 loc) · 1.84 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
cmake_minimum_required(VERSION 2.8.4)
project(voxelizer)
#
# Compiler Strings
#
if(APPLE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wno-int-to-void-pointer-cast")
elseif(WIN32)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
endif()
include(${CMAKE_CURRENT_SOURCE_DIR}/render/render_files.cmake)
#
# Source Files
#
set(SOURCE_FILES ${RENDER_FILES}
src/Main.cpp
src/IsoVoxels.cpp
src/VBOCube.cpp
src/VoxelBase.cpp
src/VoxelizerApp.cpp
src/VoxelizerApp.h
src/VoxelAsset.h
src/VoxelAsset.cpp)
#
# Link Directories
#
if(APPLE)
link_directories(ext/libs-lldb)
elseif(WIN32 AND MINGW)
link_directories(ext/libs-ming64)
endif()
find_package(OpenGL REQUIRED)
# OSX required libraries
if(APPLE)
find_package(zlib REQUIRED)
find_library(COCOA_LIBRARY Cocoa REQUIRED)
find_library(IOKIT_LIBRARY IOKit REQUIRED)
find_library(COREVID_LIBRARY CoreVideo REQUIRED)
endif()
include_directories(render ext/include)
include_directories(${OPENGL_INCLUDE_DIRS})
include_directories(${ZLIB_INCLUDE_DIRS})
include_directories(/usr/local/opt/opencv3/include)
add_executable(${PROJECT_NAME} ${SOURCE_FILES})
set_target_properties(${PROJECT_NAME} PROPERTIES LINK_SEARCH_END_STATIC 1)
target_link_libraries(${PROJECT_NAME} ${COREVID_LIBRARY})
target_link_libraries(${PROJECT_NAME} ${COCOA_LIBRARY})
target_link_libraries(${PROJECT_NAME} ${IOKIT_LIBRARY})
target_link_libraries(${PROJECT_NAME} ${OPENGL_LIBRARIES})
target_link_libraries(${PROJECT_NAME} ${ZLIB_LIBRARIES})
target_link_libraries(${PROJECT_NAME} libglfw3.a)
target_link_libraries(${PROJECT_NAME} libassimp.a)
if(WIN32 AND MINGW)
target_link_libraries(${PROJECT_NAME} libopengl32.a)
target_link_libraries(${PROJECT_NAME} libimm32.a)
target_link_libraries(${PROJECT_NAME} libzlibstatic.a)
endif()