-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
95 lines (82 loc) · 2.1 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
87
88
89
90
91
92
93
94
95
cmake_minimum_required(VERSION 2.8)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/CMakeModules")
project(evoimage-gl)
# Locate necessary libraries
find_package(OpenGL REQUIRED)
find_package(GLUT REQUIRED)
find_package(PNG REQUIRED)
find_package(Cairo REQUIRED)
set(EPICFAILMSG "")
if(NOT OPENGL_FOUND)
set(EPICFAILMSG "${EPICFAILMSG} OpenGL not found\n")
endif()
if(NOT GLUT_FOUND)
set(EPICFAILMSG "${EPICFAILMSG} GLUT not found\n")
endif()
if(NOT PNG_FOUND)
set(EPICFAILMSG "${EPICFAILMSG} PNG not found\n")
endif()
if(NOT CAIRO_FOUND)
set(EPICFAILMSG "${EPICFAILMSG} Cairo not found\n")
endif()
if(EPICFAILMSG)
message(FATAL_ERROR "Evoimage-gl needs the following libraries installed:\n${EPICFAILMSG}")
endif()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -O3")
# Define the core GA engine library
file(GLOB ENGINE_SRCS engine/*.cpp)
add_library(engine STATIC
${ENGINE_SRCS})
include_directories(inc ${PNG_INCLUDE_DIRS} ${CAIRO_INCLUDE_DIRS})
# ----------------------------------------------------------------
# Executables to build:
#
# evoimagegl is the primary image evolver. This command-line program
# renders current mutations in the OpenGL window.
#
#add_executable(evoimagegl
# src/evoimagegl.cpp
#)
#target_link_libraries(evoimagegl
# engine
# ${OPENGL_LIBRARIES}
# ${GLUT_LIBRARIES}
# ${PNG_LIBRARIES}
#)
#
# test_mutation is a command-line program that exercises the mutation engine
#
add_executable(test_mutation
src/test_mutation.cpp
)
target_link_libraries(test_mutation
engine
)
#
# evoimagecairo is another tool that uses the Cairo graphics lib for rendering
#
add_executable(evoimagecairo
src/evoimagecairo.cpp
)
target_link_directories(evoimagecairo
PUBLIC /opt/local/lib # for jsoncpp
)
target_link_libraries(evoimagecairo
engine
${CAIRO_LIBRARIES}
jsoncpp
)
#
# evorender renders a JSON drawing to PNG at some resolution
#
add_executable(evorender
src/evorender.cpp
)
target_link_directories(evorender
PUBLIC /opt/local/lib # for jsoncpp
)
target_link_libraries(evorender
engine
${CAIRO_LIBRARIES}
jsoncpp
)