Wed, 05 Aug 2009 17:10:56 +0100
add README
philpem@5 | 1 | # |
philpem@5 | 2 | # File : CMakeLists.txt |
philpem@5 | 3 | # ( Cmake configuration file ) |
philpem@5 | 4 | # |
philpem@5 | 5 | # Description : CMake can use this to generate a working Makefile. |
philpem@5 | 6 | # This file is a part of the CImg Library project. |
philpem@5 | 7 | # ( http://cimg.sourceforge.net ) |
philpem@5 | 8 | # |
philpem@5 | 9 | # Copyright : Baptiste Mougel |
philpem@5 | 10 | # ( http://www.mougel.org ) |
philpem@5 | 11 | # David Tschumperle |
philpem@5 | 12 | # ( http://www.greyc.ensicaen.fr/~dtschump/ ) |
philpem@5 | 13 | # |
philpem@5 | 14 | # License : CeCILL v2.0 |
philpem@5 | 15 | # ( http://www.cecill.info/licences/Licence_CeCILL_V2-en.html ) |
philpem@5 | 16 | # |
philpem@5 | 17 | # This software is governed by the CeCILL license under French law and |
philpem@5 | 18 | # abiding by the rules of distribution of free software. You can use, |
philpem@5 | 19 | # modify and/ or redistribute the software under the terms of the CeCILL |
philpem@5 | 20 | # license as circulated by CEA, CNRS and INRIA at the following URL |
philpem@5 | 21 | # "http://www.cecill.info". |
philpem@5 | 22 | # |
philpem@5 | 23 | # As a counterpart to the access to the source code and rights to copy, |
philpem@5 | 24 | # modify and redistribute granted by the license, users are provided only |
philpem@5 | 25 | # with a limited warranty and the software's author, the holder of the |
philpem@5 | 26 | # economic rights, and the successive licensors have only limited |
philpem@5 | 27 | # liability. |
philpem@5 | 28 | # |
philpem@5 | 29 | # In this respect, the user's attention is drawn to the risks associated |
philpem@5 | 30 | # with loading, using, modifying and/or developing or reproducing the |
philpem@5 | 31 | # software by the user in light of its specific status of free software, |
philpem@5 | 32 | # that may mean that it is complicated to manipulate, and that also |
philpem@5 | 33 | # therefore means that it is reserved for developers and experienced |
philpem@5 | 34 | # professionals having in-depth computer knowledge. Users are therefore |
philpem@5 | 35 | # encouraged to load and test the software's suitability as regards their |
philpem@5 | 36 | # requirements in conditions enabling the security of their systems and/or |
philpem@5 | 37 | # data to be ensured and, more generally, to use and operate it in the |
philpem@5 | 38 | # same conditions as regards security. |
philpem@5 | 39 | # |
philpem@5 | 40 | # The fact that you are presently reading this means that you have had |
philpem@5 | 41 | # knowledge of the CeCILL license and that you accept its terms. |
philpem@5 | 42 | # |
philpem@5 | 43 | |
philpem@5 | 44 | #------------------- |
philpem@5 | 45 | # IMPORTANT NOTICE : This file is intended to be copied in the 'examples/' directory before use. |
philpem@5 | 46 | #------------------- |
philpem@5 | 47 | project(CIMG) |
philpem@5 | 48 | |
philpem@5 | 49 | IF(UNIX) |
philpem@5 | 50 | CMAKE_MINIMUM_REQUIRED (VERSION 2.4.0 FATAL_ERROR) |
philpem@5 | 51 | MESSAGE(STATUS "Compilation mode : UNIX") |
philpem@5 | 52 | ELSE(UNIX) |
philpem@5 | 53 | IF(WIN32) |
philpem@5 | 54 | CMAKE_MINIMUM_REQUIRED(VERSION 2.4.6 FATAL_ERROR) |
philpem@5 | 55 | MESSAGE(STATUS "Compilation mode : Win32") |
philpem@5 | 56 | ELSE(WIN32) |
philpem@5 | 57 | IF(APPLE) |
philpem@5 | 58 | CMAKE_MINIMUM_REQUIRED(VERSION 2.6.0 FATAL_ERROR) |
philpem@5 | 59 | IF(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4 AND ${CMAKE_PATCH_VERSION} LESS 7) |
philpem@5 | 60 | MESSAGE("Warning: A critical CMake bug exists in 2.4.6 and below. Trying to build Universal Binaries will result in a compile error that seems unrelated. Either avoid building Universal Binaries by changing the CMAKE_OSX_ARCHITECTURES field to list only your architecture, or upgrade to the current CVS version of CMake or a newer stable version if it exists.") |
philpem@5 | 61 | ENDIF(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4 AND ${CMAKE_PATCH_VERSION} LESS 7) |
philpem@5 | 62 | MESSAGE(STATUS "Compilation mode : MAC OSX") |
philpem@5 | 63 | ELSE(APPLE) |
philpem@5 | 64 | CMAKE_MINIMUM_REQUIRED(VERSION 2.4.0 FATAL_ERROR) |
philpem@5 | 65 | ENDIF(APPLE) |
philpem@5 | 66 | ENDIF(WIN32) |
philpem@5 | 67 | ENDIF(UNIX) |
philpem@5 | 68 | |
philpem@5 | 69 | #----------------------------------------------------------------------------- |
philpem@5 | 70 | # CImg version number. An even minor number corresponds to releases. |
philpem@5 | 71 | SET(CIMG_VERSION "1.3.0") |
philpem@5 | 72 | SET(CIMG_H "CImg.h") |
philpem@5 | 73 | |
philpem@5 | 74 | MESSAGE(STATUS "CImg version : ${CIMG_VERSION}") |
philpem@5 | 75 | |
philpem@5 | 76 | #----------------------------------------------------------------------------- |
philpem@5 | 77 | # Output directories. |
philpem@5 | 78 | INCLUDE_DIRECTORIES ( |
philpem@5 | 79 | ${CIMG_BINARY_DIR} |
philpem@5 | 80 | ${CIMG_SOURCE_DIR} |
philpem@5 | 81 | ) |
philpem@5 | 82 | |
philpem@5 | 83 | IF(NOT LIBRARY_OUTPUT_PATH) |
philpem@5 | 84 | SET (LIBRARY_OUTPUT_PATH ${CIMG_BINARY_DIR}/ CACHE INTERNAL "Single output directory for building all libraries.") |
philpem@5 | 85 | ENDIF(NOT LIBRARY_OUTPUT_PATH) |
philpem@5 | 86 | IF(NOT EXECUTABLE_OUTPUT_PATH) |
philpem@5 | 87 | SET (EXECUTABLE_OUTPUT_PATH ${CIMG_BINARY_DIR}/ CACHE INTERNAL "Single output directory for building all executables.") |
philpem@5 | 88 | ENDIF(NOT EXECUTABLE_OUTPUT_PATH) |
philpem@5 | 89 | |
philpem@5 | 90 | #MARK_AS_ADVANCED(LIBRARY_OUTPUT_PATH EXECUTABLE_OUTPUT_PATH) |
philpem@5 | 91 | |
philpem@5 | 92 | #----------------------------------------------------------------------------- |
philpem@5 | 93 | # Compilation. |
philpem@5 | 94 | |
philpem@5 | 95 | SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -W -ansi -pedantic") |
philpem@5 | 96 | SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -W -ansi -pedantic") |
philpem@5 | 97 | SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lm -lpthread") |
philpem@5 | 98 | SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -lm -lpthread") |
philpem@5 | 99 | SET(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -lm -lpthread") |
philpem@5 | 100 | |
philpem@5 | 101 | OPTION(BUILD_EXAMPLES "Build the Examples directory." ON) |
philpem@5 | 102 | IF (BUILD_EXAMPLES) |
philpem@5 | 103 | ADD_EXECUTABLE(CImg_demo CImg_demo.cpp) |
philpem@5 | 104 | ADD_EXECUTABLE(captcha captcha.cpp) |
philpem@5 | 105 | ADD_EXECUTABLE(curve_editor curve_editor.cpp) |
philpem@5 | 106 | ADD_EXECUTABLE(dtmri_view dtmri_view.cpp) |
philpem@5 | 107 | ADD_EXECUTABLE(edge_explorer edge_explorer.cpp) |
philpem@5 | 108 | ADD_EXECUTABLE(fade_images fade_images.cpp) |
philpem@5 | 109 | ADD_EXECUTABLE(generate_loop_macros generate_loop_macros.cpp) |
philpem@5 | 110 | ADD_EXECUTABLE(gmic gmic.cpp) |
philpem@5 | 111 | ADD_EXECUTABLE(greycstoration greycstoration.cpp) |
philpem@5 | 112 | ADD_EXECUTABLE(hough_transform hough_transform.cpp) |
philpem@5 | 113 | ADD_EXECUTABLE(image2ascii image2ascii.cpp) |
philpem@5 | 114 | ADD_EXECUTABLE(image_registration image_registration.cpp) |
philpem@5 | 115 | ADD_EXECUTABLE(image_surface image_surface.cpp) |
philpem@5 | 116 | ADD_EXECUTABLE(jawbreaker jawbreaker.cpp) |
philpem@5 | 117 | ADD_EXECUTABLE(mcf_levelsets3d mcf_levelsets3d.cpp) |
philpem@5 | 118 | ADD_EXECUTABLE(mcf_levelsets mcf_levelsets.cpp) |
philpem@5 | 119 | ADD_EXECUTABLE(odykill odykill.cpp) |
philpem@5 | 120 | ADD_EXECUTABLE(pde_heatflow2d pde_heatflow2d.cpp) |
philpem@5 | 121 | ADD_EXECUTABLE(pde_TschumperleDeriche2d pde_TschumperleDeriche2d.cpp) |
philpem@5 | 122 | ADD_EXECUTABLE(radon_transform radon_transform.cpp) |
philpem@5 | 123 | ADD_EXECUTABLE(scene3d scene3d.cpp) |
philpem@5 | 124 | ADD_EXECUTABLE(tetris tetris.cpp) |
philpem@5 | 125 | ADD_EXECUTABLE(tron tron.cpp) |
philpem@5 | 126 | ADD_EXECUTABLE(tutorial tutorial.cpp) |
philpem@5 | 127 | ADD_EXECUTABLE(wavelet_atrous wavelet_atrous.cpp) |
philpem@5 | 128 | ADD_EXECUTABLE(use_draw_gradient use_draw_gradient.cpp) |
philpem@5 | 129 | ADD_EXECUTABLE(use_greycstoration use_greycstoration.cpp) |
philpem@5 | 130 | ADD_EXECUTABLE(use_nlmeans use_nlmeans.cpp) |
philpem@5 | 131 | ADD_EXECUTABLE(use_RGBclass use_RGBclass.cpp) |
philpem@5 | 132 | ADD_EXECUTABLE(use_skeleton use_skeleton.cpp) |
philpem@5 | 133 | ENDIF (BUILD_EXAMPLES) |
philpem@5 | 134 | |
philpem@5 | 135 | # Flags to enable code debugging. |
philpem@5 | 136 | OPTION(CIMG_DEBUG_FLAGS "Flags to enable code debugging." OFF) |
philpem@5 | 137 | IF (CIMG_DEBUG_FLAGS) |
philpem@5 | 138 | ADD_DEFINITIONS(-Dcimg_debug=3) |
philpem@5 | 139 | SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g") |
philpem@5 | 140 | SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g") |
philpem@5 | 141 | ENDIF(CIMG_DEBUG_FLAGS) |
philpem@5 | 142 | |
philpem@5 | 143 | # Flags to enable color output messages. |
philpem@5 | 144 | # (requires a VT100 compatible terminal) |
philpem@5 | 145 | OPTION(CIMG_VT100_FLAGS "Flags to enable color output messages. (requires a VT100 compatible terminal)" ON) |
philpem@5 | 146 | IF (CIMG_VT100_FLAGS) |
philpem@5 | 147 | ADD_DEFINITIONS(-Dcimg_use_vt100) |
philpem@5 | 148 | ENDIF(CIMG_VT100_FLAGS) |
philpem@5 | 149 | |
philpem@5 | 150 | # Flags to enable code optimization by the compiler. |
philpem@5 | 151 | OPTION(CIMG_OPT_FLAGS "Flags to enable code optimization by the compiler." ON) |
philpem@5 | 152 | IF (CIMG_OPT_FLAGS) |
philpem@5 | 153 | SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O3 -ffast-math") |
philpem@5 | 154 | SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -ffast-math") |
philpem@5 | 155 | ENDIF(CIMG_OPT_FLAGS) |
philpem@5 | 156 | |
philpem@5 | 157 | # Flags to enable OpenMP support. |
philpem@5 | 158 | OPTION(CIMG_OPENMP_FLAGS "Flags to enable code optimization by the compiler." OFF) |
philpem@5 | 159 | IF (CIMG_OPENMP_FLAGS) |
philpem@5 | 160 | SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fopenmp") |
philpem@5 | 161 | SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp") |
philpem@5 | 162 | ADD_DEFINITIONS(-Dcimg_use_openmp) |
philpem@5 | 163 | ENDIF(CIMG_OPENMP_FLAGS) |
philpem@5 | 164 | |
philpem@5 | 165 | # Flags to enable the use of the X11 library. |
philpem@5 | 166 | # (X11 is used by CImg to handle display windows) |
philpem@5 | 167 | # !!! For 64bits systems : replace -L$(X11PATH)/lib by -L$(X11PATH)/lib64 !!! |
philpem@5 | 168 | OPTION(CIMG_X11_FLAGS "Flags to enable fast image display, using the XSHM library." ON) |
philpem@5 | 169 | IF (CIMG_X11_FLAGS) |
philpem@5 | 170 | |
philpem@5 | 171 | FIND_PATH(X11_PATH /bin/xterm /usr/X11R6) |
philpem@5 | 172 | |
philpem@5 | 173 | OPTION(CIMG_SYSTEMS_64BITS "For 64bits systems." OFF) |
philpem@5 | 174 | IF (CIMG_SYSTEMS_64BITS) |
philpem@5 | 175 | INCLUDE_DIRECTORIES(${X11_PATH}/include) |
philpem@5 | 176 | LINK_DIRECTORIES(${X11_PATH}/lib64) |
philpem@5 | 177 | SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -L${X11_PATH}/lib64 -lX11") |
philpem@5 | 178 | SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -L${X11_PATH}/lib64 -lX11") |
philpem@5 | 179 | SET(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -L${X11_PATH}/lib64 -lX11") |
philpem@5 | 180 | ELSE (CIMG_SYSTEMS_64BITS) |
philpem@5 | 181 | INCLUDE_DIRECTORIES(${X11_PATH}/include) |
philpem@5 | 182 | LINK_DIRECTORIES(${X11_PATH}/lib) |
philpem@5 | 183 | SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -L${X11_PATH}/lib -lX11") |
philpem@5 | 184 | SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -L${X11_PATH}/lib -lX11") |
philpem@5 | 185 | SET(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -L${X11_PATH}/lib -lX11") |
philpem@5 | 186 | ENDIF(CIMG_SYSTEMS_64BITS) |
philpem@5 | 187 | |
philpem@5 | 188 | # Flags to enable fast image display, using the XSHM library. |
philpem@5 | 189 | # (CIMG_X11_FLAGS must be defined also) |
philpem@5 | 190 | OPTION(CIMG_XSHM_FLAGS "Flags to enable fast image display, using the XSHM library." ON) |
philpem@5 | 191 | IF (CIMG_XSHM_FLAGS) |
philpem@5 | 192 | ADD_DEFINITIONS(-Dcimg_use_xshm) |
philpem@5 | 193 | SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lXext") |
philpem@5 | 194 | SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -lXext") |
philpem@5 | 195 | SET(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -lXext") |
philpem@5 | 196 | ENDIF(CIMG_XSHM_FLAGS) |
philpem@5 | 197 | |
philpem@5 | 198 | # Flags to enable screen mode switching, using the XRandr library. |
philpem@5 | 199 | # (CIMG_X11_FLAGS must be defined also) |
philpem@5 | 200 | OPTION(CIMG_XRANDR_FLAGS "Flags to enable screen mode switching, using the XRandr library." ON) |
philpem@5 | 201 | IF (CIMG_XRANDR_FLAGS) |
philpem@5 | 202 | ADD_DEFINITIONS(-Dcimg_use_xrandr) |
philpem@5 | 203 | SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lXrandr") |
philpem@5 | 204 | SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -lXrandr") |
philpem@5 | 205 | SET(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -lXrandr") |
philpem@5 | 206 | ENDIF(CIMG_XRANDR_FLAGS) |
philpem@5 | 207 | |
philpem@5 | 208 | # Flags to compile on Solaris |
philpem@5 | 209 | #CIMG_SOLARIS_FLAGS = -R$(X11PATH)/lib -lrt -lnsl -lsocket |
philpem@5 | 210 | OPTION(CIMG_SOLARIS_FLAGS "Flags to compile on Solaris." OFF) |
philpem@5 | 211 | IF (CIMG_SOLARIS_FLAGS) |
philpem@5 | 212 | SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -R$(X11_PATH)/lib -lrt -lnsl -lsocket") |
philpem@5 | 213 | SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -R$(X11_PATH)/lib -lrt -lnsl -lsocket") |
philpem@5 | 214 | SET(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -R$(X11_PATH)/lib -lrt -lnsl -lsocket") |
philpem@5 | 215 | ENDIF(CIMG_SOLARIS_FLAGS) |
philpem@5 | 216 | |
philpem@5 | 217 | ENDIF(CIMG_X11_FLAGS) |
philpem@5 | 218 | |
philpem@5 | 219 | |
philpem@5 | 220 | # Flags to enable native support for PNG image files, using the PNG library. |
philpem@5 | 221 | #CIMG_PNG_FLAGS = -Dcimg_use_png -lpng -lz |
philpem@5 | 222 | OPTION(CIMG_PNG_FLAGS "Flags to enable native support for PNG image files, using the PNG library." OFF) |
philpem@5 | 223 | IF (CIMG_PNG_FLAGS) |
philpem@5 | 224 | ADD_DEFINITIONS(-Dcimg_use_png) |
philpem@5 | 225 | SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lpng -lz") |
philpem@5 | 226 | SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -lpng -lz") |
philpem@5 | 227 | SET(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -lpng -lz") |
philpem@5 | 228 | ENDIF(CIMG_PNG_FLAGS) |
philpem@5 | 229 | |
philpem@5 | 230 | # Flags to enable native support for JPEG image files, using the JPEG library. |
philpem@5 | 231 | #CIMG_JPEG_FLAGS = -Dcimg_use_jpeg -ljpeg |
philpem@5 | 232 | OPTION(CIMG_JPEG_FLAGS "Flags to enable native support for JPEG image files, using the JPEG library." OFF) |
philpem@5 | 233 | IF (CIMG_JPEG_FLAGS) |
philpem@5 | 234 | ADD_DEFINITIONS(-Dcimg_use_jpeg) |
philpem@5 | 235 | SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -ljpeg") |
philpem@5 | 236 | SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -ljpeg") |
philpem@5 | 237 | SET(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -ljpeg") |
philpem@5 | 238 | ENDIF(CIMG_JPEG_FLAGS) |
philpem@5 | 239 | |
philpem@5 | 240 | # Flags to enable native support for TIFF image files, using the TIFF library. |
philpem@5 | 241 | #CIMG_TIFF_FLAGS = -Dcimg_use_tiff -ltiff |
philpem@5 | 242 | OPTION(CIMG_TIFF_FLAGS "Flags to enable native support for TIFF image files, using the TIFF library." OFF) |
philpem@5 | 243 | IF (CIMG_TIFF_FLAGS) |
philpem@5 | 244 | ADD_DEFINITIONS(-Dcimg_use_tiff) |
philpem@5 | 245 | SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -ltiff") |
philpem@5 | 246 | SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -ltiff") |
philpem@5 | 247 | SET(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -ltiff") |
philpem@5 | 248 | ENDIF(CIMG_TIFF_FLAGS) |
philpem@5 | 249 | |
philpem@5 | 250 | # Flags to enable native support for various video files, using the FFMPEG library. |
philpem@5 | 251 | #CIMG_FFMPEG_FLAGS = -Dcimg_use_ffmpeg -lavcodec -lavformat |
philpem@5 | 252 | OPTION(CIMG_FFMPEG_FLAGS "Flags to enable native support for various video files, using the FFMPEG library." OFF) |
philpem@5 | 253 | IF (CIMG_FFMPEG_FLAGS) |
philpem@5 | 254 | ADD_DEFINITIONS(-Dcimg_use_ffmpeg) |
philpem@5 | 255 | SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lavcodec -lavformat") |
philpem@5 | 256 | SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -lavcodec -lavformat") |
philpem@5 | 257 | SET(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -lavcodec -lavformat") |
philpem@5 | 258 | ENDIF(CIMG_FFMPEG_FLAGS) |
philpem@5 | 259 | |
philpem@5 | 260 | # Flags to enable native support for compressed .cimgz files, using the Zlib library. |
philpem@5 | 261 | #CIMG_ZLIB_FLAGS = -Dcimg_use_zlib -lz |
philpem@5 | 262 | OPTION(CIMG_ZLIB_FLAGS "Flags to enable native support for compressed .cimgz files, using the Zlib library." OFF) |
philpem@5 | 263 | IF (CIMG_ZLIB_FLAGS) |
philpem@5 | 264 | ADD_DEFINITIONS(-Dcimg_use_zlib) |
philpem@5 | 265 | SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lz") |
philpem@5 | 266 | SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -lz") |
philpem@5 | 267 | SET(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -lz") |
philpem@5 | 268 | ENDIF(CIMG_ZLIB_FLAGS) |
philpem@5 | 269 | |
philpem@5 | 270 | # Flags to enable native support of most classical image file formats, using the Magick++ library. |
philpem@5 | 271 | #CIMG_MAGICK_FLAGS = -Dcimg_use_magick `Magick++-config --cppflags` `Magick++-config --cxxflags` `Magick++-config --ldflags` `Magick++-config --libs` |
philpem@5 | 272 | OPTION(CIMG_MAGICK_FLAGS "Flags to enable native support of most classical image file formats, using the Magick++ library." OFF) |
philpem@5 | 273 | IF (CIMG_MAGICK_FLAGS) |
philpem@5 | 274 | ADD_DEFINITIONS(-Dcimg_use_magick) |
philpem@5 | 275 | SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} `Magick++-config --cppflags` `Magick++-config --cxxflags`") |
philpem@5 | 276 | SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} `Magick++-config --cppflags` `Magick++-config --cxxflags`") |
philpem@5 | 277 | SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} `Magick++-config --ldflags` `Magick++-config --libs`") |
philpem@5 | 278 | SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} `Magick++-config --ldflags` `Magick++-config --libs`") |
philpem@5 | 279 | SET(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} `Magick++-config --ldflags` `Magick++-config --libs`") |
philpem@5 | 280 | ENDIF(CIMG_MAGICK_FLAGS) |
philpem@5 | 281 | |
philpem@5 | 282 | # Flags to enable faster Discrete Fourier Transform computation, using the FFTW3 library |
philpem@5 | 283 | #CIMG_FFTW3_FLAGS = -Dcimg_use_fftw3 -lfftw3 |
philpem@5 | 284 | OPTION(CIMG_FFTW3_FLAGS "Flags to enable faster Discrete Fourier Transform computation, using the FFTW3 library." OFF) |
philpem@5 | 285 | IF (CIMG_FFTW3_FLAGS) |
philpem@5 | 286 | ADD_DEFINITIONS(-Dcimg_use_fftw3) |
philpem@5 | 287 | SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lfftw3") |
philpem@5 | 288 | SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -lfftw3") |
philpem@5 | 289 | SET(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -lfftw3") |
philpem@5 | 290 | ENDIF(CIMG_FFTW3_FLAGS) |
philpem@5 | 291 | |
philpem@5 | 292 | # Flags to enable the use of LAPACK routines for matrix computation |
philpem@5 | 293 | #CIMG_LAPACK_FLAGS = -Dcimg_use_lapack -lblas -lg2c -llapack |
philpem@5 | 294 | OPTION(CIMG_LAPACK_FLAGS "Flags to enable the use of LAPACK routines for matrix computation" OFF) |
philpem@5 | 295 | IF (CIMG_LAPACK_FLAGS) |
philpem@5 | 296 | ADD_DEFINITIONS(-Dcimg_use_lapack) |
philpem@5 | 297 | SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lblas -lg2c -llapack") |
philpem@5 | 298 | SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -lblas -lg2c -llapack") |
philpem@5 | 299 | SET(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -lblas -lg2c -llapack") |
philpem@5 | 300 | ENDIF(CIMG_LAPACK_FLAGS) |
philpem@5 | 301 | |
philpem@5 | 302 | # Flags to enable the use of the Board library |
philpem@5 | 303 | #CIMG_BOARD_FLAGS = -Dcimg_use_board -I/usr/include/board -lboard |
philpem@5 | 304 | OPTION(CIMG_BOARD_FLAGS "Flags to enable the use of the Board library." OFF) |
philpem@5 | 305 | IF (CIMG_BOARD_FLAGS) |
philpem@5 | 306 | ADD_DEFINITIONS(-Dcimg_use_board) |
philpem@5 | 307 | INCLUDE_DIRECTORIES(/usr/include/board) |
philpem@5 | 308 | SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lboard") |
philpem@5 | 309 | SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -lboard") |
philpem@5 | 310 | SET(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -lboard") |
philpem@5 | 311 | ENDIF(CIMG_BOARD_FLAGS) |
philpem@5 | 312 | |
philpem@5 | 313 | # Flags to compile on MacOSX with Carbon-based display support |
philpem@5 | 314 | #CIMG_CARBON_FLAGS = -Dcimg_display=3 -framework Carbon |
philpem@5 | 315 | IF(APPLE) |
philpem@5 | 316 | OPTION(CIMG_CARBON_FLAGS "Flags to compile on MacOSX with Carbon-based display support." ON) |
philpem@5 | 317 | IF (CIMG_CARBON_FLAGS) |
philpem@5 | 318 | ADD_DEFINITIONS(-Dcimg_display=3) |
philpem@5 | 319 | SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -framework Carbon") |
philpem@5 | 320 | SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -framework Carbon") |
philpem@5 | 321 | SET(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -framework Carbon") |
philpem@5 | 322 | ENDIF(CIMG_CARBON_FLAGS) |
philpem@5 | 323 | ENDIF(APPLE) |