-
Notifications
You must be signed in to change notification settings - Fork 0
/
External.cmake
126 lines (106 loc) · 3.67 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
##################################################################################
# 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)
find_package(Eigen3 REQUIRED)
include_directories(${EIGEN3_INCLUDE_DIR})
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(cimg
GIT_REPOSITORY https://framagit.org/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(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)
ExternalProject_Add(catch
GIT_REPOSITORY https://github.com/philsquared/Catch.git
SOURCE_DIR ${EXTERNAL_INSTALL_LOCATION}/catch
UPDATE_DISCONNECTED 1
STEP_TARGETS update
BUILD_COMMAND ""
CONFIGURE_COMMAND ""
INSTALL_COMMAND ""
)
add_dependencies(update catch-update)
include_directories(${EXTERNAL_INSTALL_LOCATION}/CImg)
include_directories(${EXTERNAL_INSTALL_LOCATION}/cimg_additions)
include_directories(${EXTERNAL_INSTALL_LOCATION}/eigen)
include_directories(${EXTERNAL_INSTALL_LOCATION}/catch/single_include/catch2)