-
Notifications
You must be signed in to change notification settings - Fork 4
/
External.cmake
154 lines (129 loc) · 4.32 KB
/
External.cmake
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
##################################################################################
# LIBPNG
##################################################################################
find_package(PNG)
if(PNG_FOUND)
include_directories(${PNG_INCLUDE_DIR})
list(APPEND cimg_libs ${PNG_LIBRARY})
list(APPEND cimg_defs "cimg_use_png")
list(APPEND svg_cpp_plot_libs ${PNG_LIBRARY})
list(APPEND svg_cpp_plot_defs "USE_PNG")
endif(PNG_FOUND)
find_package(JPEG)
if(JPEG_FOUND)
include_directories(${JPEG_INCLUDE_DIR})
list(APPEND cimg_libs ${JPEG_LIBRARY})
list(APPEND cimg_defs "cimg_use_jpeg")
endif(JPEG_FOUND)
find_package(TIFF)
if(TIFF_FOUND)
include_directories(${TIFF_INCLUDE_DIR})
list(APPEND cimg_libs ${TIFF_LIBRARY})
list(APPEND image_defs "cimg_use_tiff")
endif(TIFF_FOUND)
if(FFTW3_FOUND)
include_directories(${FFTW3_INCLUDE_DIR})
list(APPEND cimg_libs ${FFTW3_LIBRARY})
list(APPEND cimg_defs "cimg_use_fftw3")
endif(FFTW3_FOUND)
#find_package(ImageMagick COMPONENTS Magick++)
#if (ImageMagick_FOUND)
# include_directories(${ImageMagick_INCLUDE_DIRS})
# list(APPEND cimg_libs ${ImageMagick_LIBRARIES})
# list(APPEND cimg_defs "cimg_use_magick")
# list(APPEND cimg_defs "MAGICKCORE_QUANTUM_DEPTH=16")
# list(APPEND cimg_defs "MAGICKCORE_HDRI_ENABLE=0")
#endif(ImageMagick_FOUND)
if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
# Windows specific code
list(APPEND cimgdisplay_libs gdi32)
list(APPEND cimgdisplay_defs cimg_display=2)
list(APPEND cimg_defs cimg_OS=2)
else(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
list(APPEND cimg_libs pthread)
list(APPEND cimgdisplay_libs X11)
list(APPEND cimgdisplay_defs cimg_display=1)
list(APPEND cimg_defs cimg_OS=1)
endif(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
######################################################################
# EXTERNAL LIBRARIES
######################################################################
if (NOT EXTERNAL_INSTALL_LOCATION)
set(EXTERNAL_INSTALL_LOCATION ${CMAKE_CURRENT_SOURCE_DIR}/external)
endif()
if (NOT IS_DIRECTORY ${EXTERNAL_INSTALL_LOCATION})
file(MAKE_DIRECTORY ${EXTERNAL_INSTALL_LOCATION})
endif()
include(ExternalProject)
# External include directory
include_directories(${EXTERNAL_INSTALL_LOCATION})
add_custom_target(update)
ExternalProject_Add(svg-cpp-plot
GIT_REPOSITORY https://github.com/adolfomunoz/svg-cpp-plot.git
SOURCE_DIR ${EXTERNAL_INSTALL_LOCATION}/svg-cpp-plot
UPDATE_DISCONNECTED 1
STEP_TARGETS update
BUILD_COMMAND ""
CONFIGURE_COMMAND ""
INSTALL_COMMAND ""
)
add_dependencies(update svg-cpp-plot-update)
ExternalProject_Add(perlin-noise
GIT_REPOSITORY https://github.com/Reputeless/PerlinNoise
SOURCE_DIR ${EXTERNAL_INSTALL_LOCATION}/PerlinNoise
UPDATE_DISCONNECTED 1
STEP_TARGETS update
BUILD_COMMAND ""
CONFIGURE_COMMAND ""
INSTALL_COMMAND ""
)
add_dependencies(update perlin-noise-update)
ExternalProject_Add(cimg
GIT_REPOSITORY https://github.com/dtschump/CImg.git
SOURCE_DIR ${EXTERNAL_INSTALL_LOCATION}/CImg
UPDATE_DISCONNECTED 1
STEP_TARGETS update
BUILD_COMMAND ""
CONFIGURE_COMMAND ""
INSTALL_COMMAND ""
)
add_dependencies(update cimg-update)
ExternalProject_Add(cimg-additions
GIT_REPOSITORY https://github.com/adolfomunoz/cimg_additions.git
SOURCE_DIR ${EXTERNAL_INSTALL_LOCATION}/cimg_additions
UPDATE_DISCONNECTED 1
STEP_TARGETS update
BUILD_COMMAND ""
CONFIGURE_COMMAND ""
INSTALL_COMMAND ""
)
add_dependencies(update cimg-additions-update)
ExternalProject_Add(mj2
GIT_REPOSITORY https://github.com/adolfomunoz/mj2.git
SOURCE_DIR ${EXTERNAL_INSTALL_LOCATION}/mj2
UPDATE_DISCONNECTED 1
STEP_TARGETS update
BUILD_COMMAND ""
CONFIGURE_COMMAND ""
INSTALL_COMMAND ""
)
add_dependencies(update mj2-update)
ExternalProject_Add(eigen
GIT_REPOSITORY https://github.com/eigenteam/eigen-git-mirror
SOURCE_DIR ${EXTERNAL_INSTALL_LOCATION}/eigen
UPDATE_DISCONNECTED 1
STEP_TARGETS update
BUILD_COMMAND ""
CONFIGURE_COMMAND ""
INSTALL_COMMAND ""
)
add_dependencies(update eigen-update)
include_directories(${EXTERNAL_INSTALL_LOCATION}/CImg)
include_directories(${EXTERNAL_INSTALL_LOCATION}/cimg_additions)
include_directories(${EXTERNAL_INSTALL_LOCATION}/eigen)
set(function_2d_defs ${cimg_defs})
set(function_2d_libs ${cimg_libs})
set(function_2d_deps perlin-noise cimg cimg-additions)
set(function_1d_defs "")
set(function_1d_libs "")
set(function_1d_deps perlin-noise)