-
Notifications
You must be signed in to change notification settings - Fork 6
/
CMakeLists.txt
53 lines (41 loc) · 1.41 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
cmake_minimum_required(VERSION 2.8)
project(tinyflock)
find_package(Threads REQUIRED)
find_package(GLUT REQUIRED)
include_directories(${GLUT_INCLUDE_DIRECTORIES})
link_directories(${GLUT_LIBRARY_DIRECTORIES})
add_definitions(${GLUT_DEFINITIONS})
if(NOT GLUT_FOUND)
message(FATAL_ERROR "GLUT not found")
endif(NOT GLUT_FOUND)
find_package(OpenGL REQUIRED)
include_directories(${OPENGL_INCLUDE_DIRS})
link_directories(${OPENGL_LIBRARY_DIRS})
add_definitions(${OPENGL_DEFINITIONS})
if(NOT OPENGL_FOUND)
message(FATAL_ERROR "OpenGL not found")
endif(NOT OPENGL_FOUND)
find_package(OpenMP REQUIRED)
set(CMAKE_C_FLAGS "-std=gnu11 -O3 ${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS} ${OPENGL_C_FLAGS}")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}")
if(NOT OPENMP_FOUND)
message(FATAL_ERROR "OpenMP not found")
endif(NOT OPENMP_FOUND)
FILE(GLOB SOURCE_FILES src/*.c)
add_executable(
tinyflock
${SOURCE_FILES})
add_subdirectory(glfw)
if(IS_DIRECTORY fann)
add_subdirectory(fann)
add_definitions(-DENABLE_ANN)
include_directories(fann/src/include)
set(FANN_LIBRARIES fann)
else(IS_DIRECTORY fann)
message(WARNING "FANN not found, disabling ANN features")
endif(IS_DIRECTORY fann)
include_directories(include)
include_directories(glfw/include)
include_directories(src)
target_link_libraries(tinyflock glfw
${GLFW_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} ${OPENGL_LIBRARIES} ${FANN_LIBRARIES})