forked from jdanecki/FractalCL
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
88 lines (74 loc) · 2.36 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
# Copyright (C) 2018 Jacek Danecki <[email protected]>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
project(FractalCL)
cmake_minimum_required(VERSION 3.2)
option(FP_64_SUPPORT "Use fp64 extension" ON)
option(SDL_ACCELERATED "Use SDL with GPU acceleration" OFF)
option(OPENCL_SUPPORT "Use OpenCL acceleration" ON)
find_package(PkgConfig)
pkg_check_modules(SDL sdl2)
pkg_check_modules(SDL_TTF SDL2_ttf)
include_directories(include)
include_directories(kernels)
add_definitions("-g -Wall -Wno-deprecated-declarations " ${SDL_CFLAGS} ${SDL_TTF_CFLAGS} -DHOST_APP -DDATA_PATH=${CMAKE_INSTALL_PREFIX}/share/FractalCL -DVERSION=${VERSION})
if(FP_64_SUPPORT)
add_definitions("-DFP_64_SUPPORT=1")
endif()
if(SDL_ACCELERATED)
add_definitions("-DSDL_ACCELERATED=1")
endif()
if(OPENCL_SUPPORT)
add_definitions("-DOPENCL_SUPPORT=1")
find_package(OpenCL REQUIRED)
set(OPTIONAL_LIBRARIES ${OpenCL_LIBRARY})
set(OPTIONAL_SOURCES
fractal_ocl.c
ocl.c
include/fractal_ocl.h
)
endif()
add_executable(FractalCL
fractal.c
gui.c
parameters.c
palette.c
timer.c
include/fractal_complex.h
include/fractal.h
include/gui.h
include/window.h
include/parameters.h
include/palette.h
${OPTIONAL_SOURCES}
)
target_link_libraries(FractalCL
${SDL_LDFLAGS} ${SDL_TTF_LDFLAGS}
${OPTIONAL_LIBRARIES}
-lm -lpthread
)
install(PROGRAMS
${FractalCL_BINARY_DIR}/FractalCL
DESTINATION ${CMAKE_INSTALL_PREFIX}/bin
)
install(DIRECTORY
kernels
DESTINATION ${CMAKE_INSTALL_PREFIX}/share/FractalCL
)
install(FILES
FreeMono.ttf
DESTINATION ${CMAKE_INSTALL_PREFIX}/share/FractalCL
)
message(STATUS "Installation dir: ${CMAKE_INSTALL_PREFIX}")
message(STATUS "Data dir: ${CMAKE_INSTALL_PREFIX}/share/FractalCL")