DRC | 8469703 | 2010-10-15 03:43:24 +0000 | [diff] [blame] | 1 | # |
| 2 | # Setup |
| 3 | # |
| 4 | |
| 5 | cmake_minimum_required(VERSION 2.6) |
| 6 | |
DRC | 5d6f858 | 2011-02-18 23:08:58 +0000 | [diff] [blame] | 7 | project(libjpeg-turbo C) |
DRC | 3367f40 | 2012-07-03 20:00:35 +0000 | [diff] [blame] | 8 | set(VERSION 1.2.2) |
DRC | 8469703 | 2010-10-15 03:43:24 +0000 | [diff] [blame] | 9 | |
DRC | 378da4d | 2010-10-15 19:11:11 +0000 | [diff] [blame] | 10 | if(MINGW OR CYGWIN) |
DRC | 8469703 | 2010-10-15 03:43:24 +0000 | [diff] [blame] | 11 | execute_process(COMMAND "date" "+%Y%m%d" OUTPUT_VARIABLE BUILD) |
| 12 | string(REGEX REPLACE "\n" "" BUILD ${BUILD}) |
| 13 | elseif(WIN32) |
DRC | 5e3bb3e | 2012-10-12 10:19:09 +0000 | [diff] [blame] | 14 | execute_process(COMMAND "wmic.exe" "os" "get" "LocalDateTime" OUTPUT_VARIABLE |
| 15 | BUILD) |
| 16 | string(REGEX REPLACE "[^0-9]" "" BUILD "${BUILD}") |
| 17 | if (BUILD STREQUAL "") |
| 18 | execute_process(COMMAND "cmd.exe" "/C" "DATE" "/T" OUTPUT_VARIABLE BUILD) |
| 19 | string(REGEX REPLACE ".*[ ]([0-9]*)[/.]([0-9]*)[/.]([0-9]*).*" "\\3\\2\\1" BUILD "${BUILD}") |
| 20 | else() |
| 21 | string(SUBSTRING "${BUILD}" 0 8 BUILD) |
| 22 | endif() |
DRC | 8469703 | 2010-10-15 03:43:24 +0000 | [diff] [blame] | 23 | else() |
DRC | 378da4d | 2010-10-15 19:11:11 +0000 | [diff] [blame] | 24 | message(FATAL_ERROR "Platform not supported by this build system. Use autotools instead.") |
DRC | 8469703 | 2010-10-15 03:43:24 +0000 | [diff] [blame] | 25 | endif() |
| 26 | |
DRC | 2ffcb8e | 2011-04-04 04:56:24 +0000 | [diff] [blame] | 27 | # This does nothing except when using MinGW. CMAKE_BUILD_TYPE has no meaning |
| 28 | # in Visual Studio, and it always defaults to Debug when using NMake. |
DRC | 8469703 | 2010-10-15 03:43:24 +0000 | [diff] [blame] | 29 | if(NOT CMAKE_BUILD_TYPE) |
| 30 | set(CMAKE_BUILD_TYPE Release) |
| 31 | endif() |
| 32 | |
| 33 | message(STATUS "CMAKE_BUILD_TYPE = ${CMAKE_BUILD_TYPE}") |
| 34 | |
| 35 | # This only works if building from the command line. There is currently no way |
DRC | 2ffcb8e | 2011-04-04 04:56:24 +0000 | [diff] [blame] | 36 | # to set a variable's value based on the build type when using Visual Studio. |
DRC | 8469703 | 2010-10-15 03:43:24 +0000 | [diff] [blame] | 37 | if(CMAKE_BUILD_TYPE STREQUAL "Debug") |
| 38 | set(BUILD "${BUILD}d") |
| 39 | endif() |
| 40 | |
DRC | eb2b9d6 | 2010-10-15 04:55:13 +0000 | [diff] [blame] | 41 | message(STATUS "VERSION = ${VERSION}, BUILD = ${BUILD}") |
| 42 | |
DRC | ddcd5a1 | 2011-04-15 00:24:02 +0000 | [diff] [blame] | 43 | option(WITH_SIMD "Include SIMD extensions" TRUE) |
| 44 | option(WITH_ARITH_ENC "Include arithmetic encoding support" TRUE) |
| 45 | option(WITH_ARITH_DEC "Include arithmetic decoding support" TRUE) |
| 46 | option(WITH_JPEG7 "Emulate libjpeg v7 API/ABI (this makes libjpeg-turbo backward incompatible with libjpeg v6b)" FALSE) |
| 47 | option(WITH_JPEG8 "Emulate libjpeg v8 API/ABI (this makes libjpeg-turbo backward incompatible with libjpeg v6b)" FALSE) |
| 48 | option(WITH_JAVA "Build Java wrapper for the TurboJPEG/OSS library" FALSE) |
DRC | 245cfdf | 2010-11-23 17:11:06 +0000 | [diff] [blame] | 49 | |
| 50 | if(WITH_ARITH_ENC) |
| 51 | set(C_ARITH_CODING_SUPPORTED 1) |
DRC | 990e28d | 2011-01-04 21:40:11 +0000 | [diff] [blame] | 52 | message(STATUS "Arithmetic encoding support enabled") |
DRC | 245cfdf | 2010-11-23 17:11:06 +0000 | [diff] [blame] | 53 | else() |
DRC | 990e28d | 2011-01-04 21:40:11 +0000 | [diff] [blame] | 54 | message(STATUS "Arithmetic encoding support disabled") |
DRC | 245cfdf | 2010-11-23 17:11:06 +0000 | [diff] [blame] | 55 | endif() |
| 56 | |
| 57 | if(WITH_ARITH_DEC) |
| 58 | set(D_ARITH_CODING_SUPPORTED 1) |
DRC | 990e28d | 2011-01-04 21:40:11 +0000 | [diff] [blame] | 59 | message(STATUS "Arithmetic decoding support enabled") |
DRC | 245cfdf | 2010-11-23 17:11:06 +0000 | [diff] [blame] | 60 | else() |
DRC | 990e28d | 2011-01-04 21:40:11 +0000 | [diff] [blame] | 61 | message(STATUS "Arithmetic decoding support disabled") |
DRC | 245cfdf | 2010-11-23 17:11:06 +0000 | [diff] [blame] | 62 | endif() |
| 63 | |
DRC | 957d623 | 2011-04-01 11:13:11 +0000 | [diff] [blame] | 64 | if(WITH_JAVA) |
| 65 | message(STATUS "TurboJPEG/OSS Java wrapper enabled") |
DRC | 218c0c1 | 2011-02-05 06:01:18 +0000 | [diff] [blame] | 66 | else() |
DRC | 957d623 | 2011-04-01 11:13:11 +0000 | [diff] [blame] | 67 | message(STATUS "TurboJPEG/OSS Java wrapper disabled") |
DRC | 218c0c1 | 2011-02-05 06:01:18 +0000 | [diff] [blame] | 68 | endif() |
| 69 | |
DRC | 8469703 | 2010-10-15 03:43:24 +0000 | [diff] [blame] | 70 | set(JPEG_LIB_VERSION 62) |
| 71 | set(DLL_VERSION ${JPEG_LIB_VERSION}) |
DRC | a9d5b25 | 2010-10-15 06:42:45 +0000 | [diff] [blame] | 72 | set(FULLVERSION ${DLL_VERSION}.0.0) |
DRC | 8469703 | 2010-10-15 03:43:24 +0000 | [diff] [blame] | 73 | if(WITH_JPEG8) |
| 74 | set(JPEG_LIB_VERSION 80) |
| 75 | set(DLL_VERSION 8) |
DRC | a9d5b25 | 2010-10-15 06:42:45 +0000 | [diff] [blame] | 76 | set(FULLVERSION ${DLL_VERSION}.0.2) |
DRC | f38eee0 | 2011-02-18 07:00:38 +0000 | [diff] [blame] | 77 | message(STATUS "Emulating libjpeg v8 API/ABI") |
DRC | 8469703 | 2010-10-15 03:43:24 +0000 | [diff] [blame] | 78 | elseif(WITH_JPEG7) |
| 79 | set(JPEG_LIB_VERSION 70) |
| 80 | set(DLL_VERSION 7) |
DRC | a9d5b25 | 2010-10-15 06:42:45 +0000 | [diff] [blame] | 81 | set(FULLVERSION ${DLL_VERSION}.0.0) |
DRC | 8469703 | 2010-10-15 03:43:24 +0000 | [diff] [blame] | 82 | message(STATUS "Emulating libjpeg v7 API/ABI") |
| 83 | endif(WITH_JPEG8) |
| 84 | |
| 85 | if(MSVC) |
| 86 | # Use the static C library for all build types |
| 87 | foreach(var CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE |
DRC | 2e4d044 | 2011-02-08 01:18:37 +0000 | [diff] [blame] | 88 | CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELWITHDEBINFO) |
DRC | 8469703 | 2010-10-15 03:43:24 +0000 | [diff] [blame] | 89 | if(${var} MATCHES "/MD") |
| 90 | string(REGEX REPLACE "/MD" "/MT" ${var} "${${var}}") |
| 91 | endif() |
| 92 | endforeach() |
| 93 | |
| 94 | add_definitions(-W3 -wd4996) |
| 95 | endif() |
| 96 | |
| 97 | # Detect whether compiler is 64-bit |
| 98 | if(MSVC AND CMAKE_CL_64) |
| 99 | set(SIMD_X86_64 1) |
| 100 | set(64BIT 1) |
| 101 | elseif(CMAKE_SIZEOF_VOID_P MATCHES 8) |
| 102 | set(SIMD_X86_64 1) |
| 103 | set(64BIT 1) |
| 104 | endif() |
| 105 | |
| 106 | if(64BIT) |
| 107 | message(STATUS "64-bit build") |
| 108 | else() |
| 109 | message(STATUS "32-bit build") |
| 110 | endif() |
| 111 | |
| 112 | configure_file(win/jconfig.h.in jconfig.h) |
| 113 | configure_file(win/config.h.in config.h) |
| 114 | |
| 115 | include_directories(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_SOURCE_DIR}) |
| 116 | |
DRC | 957d623 | 2011-04-01 11:13:11 +0000 | [diff] [blame] | 117 | if(WITH_JAVA) |
| 118 | find_package(Java) |
| 119 | find_package(JNI) |
DRC | db42506 | 2011-04-03 06:10:18 +0000 | [diff] [blame] | 120 | if(DEFINED JAVACFLAGS) |
| 121 | message(STATUS "Java compiler flags = ${JAVACFLAGS}") |
| 122 | endif() |
DRC | 218c0c1 | 2011-02-05 06:01:18 +0000 | [diff] [blame] | 123 | endif() |
| 124 | |
DRC | 8469703 | 2010-10-15 03:43:24 +0000 | [diff] [blame] | 125 | |
| 126 | # |
| 127 | # Targets |
| 128 | # |
| 129 | |
DRC | 245cfdf | 2010-11-23 17:11:06 +0000 | [diff] [blame] | 130 | set(JPEG_SOURCES jcapimin.c jcapistd.c jccoefct.c jccolor.c jcdctmgr.c jchuff.c |
| 131 | jcinit.c jcmainct.c jcmarker.c jcmaster.c jcomapi.c jcparam.c jcphuff.c |
| 132 | jcprepct.c jcsample.c jctrans.c jdapimin.c jdapistd.c jdatadst.c jdatasrc.c |
| 133 | jdcoefct.c jdcolor.c jddctmgr.c jdhuff.c jdinput.c jdmainct.c jdmarker.c |
| 134 | jdmaster.c jdmerge.c jdphuff.c jdpostct.c jdsample.c jdtrans.c jerror.c |
| 135 | jfdctflt.c jfdctfst.c jfdctint.c jidctflt.c jidctfst.c jidctint.c jidctred.c |
| 136 | jquant1.c jquant2.c jutils.c jmemmgr.c jmemnobs.c) |
| 137 | |
| 138 | if(WITH_ARITH_ENC OR WITH_ARITH_DEC) |
| 139 | set(JPEG_SOURCES ${JPEG_SOURCES} jaricom.c) |
| 140 | endif() |
| 141 | |
| 142 | if(WITH_ARITH_ENC) |
| 143 | set(JPEG_SOURCES ${JPEG_SOURCES} jcarith.c) |
| 144 | endif() |
| 145 | |
| 146 | if(WITH_ARITH_DEC) |
| 147 | set(JPEG_SOURCES ${JPEG_SOURCES} jdarith.c) |
| 148 | endif() |
DRC | 8469703 | 2010-10-15 03:43:24 +0000 | [diff] [blame] | 149 | |
| 150 | if(WITH_SIMD) |
| 151 | add_definitions(-DWITH_SIMD) |
| 152 | add_subdirectory(simd) |
| 153 | if(SIMD_X86_64) |
| 154 | set(JPEG_SOURCES ${JPEG_SOURCES} simd/jsimd_x86_64.c) |
| 155 | else() |
| 156 | set(JPEG_SOURCES ${JPEG_SOURCES} simd/jsimd_i386.c) |
| 157 | endif() |
| 158 | # This tells CMake that the "source" files haven't been generated yet |
| 159 | set_source_files_properties(${SIMD_OBJS} PROPERTIES GENERATED 1) |
| 160 | else() |
| 161 | set(JPEG_SOURCES ${JPEG_SOURCES} jsimd_none.c) |
DRC | 6f4ba61 | 2010-10-16 21:27:38 +0000 | [diff] [blame] | 162 | message(STATUS "Not using SIMD acceleration") |
DRC | 8469703 | 2010-10-15 03:43:24 +0000 | [diff] [blame] | 163 | endif() |
| 164 | |
DRC | 957d623 | 2011-04-01 11:13:11 +0000 | [diff] [blame] | 165 | if(WITH_JAVA) |
| 166 | add_subdirectory(java) |
| 167 | endif() |
| 168 | |
DRC | 8469703 | 2010-10-15 03:43:24 +0000 | [diff] [blame] | 169 | add_subdirectory(sharedlib) |
| 170 | |
| 171 | add_library(jpeg-static STATIC ${JPEG_SOURCES} ${SIMD_OBJS}) |
DRC | 8469703 | 2010-10-15 03:43:24 +0000 | [diff] [blame] | 172 | if(NOT MSVC) |
| 173 | set_target_properties(jpeg-static PROPERTIES OUTPUT_NAME jpeg) |
| 174 | endif() |
| 175 | if(WITH_SIMD) |
| 176 | add_dependencies(jpeg-static simd) |
| 177 | endif() |
| 178 | |
DRC | 418dbdf | 2011-05-26 10:45:06 +0000 | [diff] [blame] | 179 | set(TURBOJPEG_SOURCES turbojpeg.c transupp.c jdatadst-tj.c jdatasrc-tj.c) |
DRC | 957d623 | 2011-04-01 11:13:11 +0000 | [diff] [blame] | 180 | if(WITH_JAVA) |
DRC | 218c0c1 | 2011-02-05 06:01:18 +0000 | [diff] [blame] | 181 | set(TURBOJPEG_SOURCES ${TURBOJPEG_SOURCES} turbojpeg-jni.c) |
DRC | 957d623 | 2011-04-01 11:13:11 +0000 | [diff] [blame] | 182 | include_directories(${JAVA_INCLUDE_PATH} ${JAVA_INCLUDE_PATH2}) |
DRC | 218c0c1 | 2011-02-05 06:01:18 +0000 | [diff] [blame] | 183 | endif() |
| 184 | |
| 185 | add_library(turbojpeg SHARED ${TURBOJPEG_SOURCES}) |
DRC | 8469703 | 2010-10-15 03:43:24 +0000 | [diff] [blame] | 186 | set_target_properties(turbojpeg PROPERTIES DEFINE_SYMBOL DLLDEFINE) |
DRC | 389c472 | 2011-02-06 18:48:13 +0000 | [diff] [blame] | 187 | if(MINGW) |
| 188 | set_target_properties(turbojpeg PROPERTIES LINK_FLAGS -Wl,--kill-at) |
| 189 | endif() |
DRC | 8469703 | 2010-10-15 03:43:24 +0000 | [diff] [blame] | 190 | target_link_libraries(turbojpeg jpeg-static) |
| 191 | set_target_properties(turbojpeg PROPERTIES LINK_INTERFACE_LIBRARIES "") |
| 192 | |
| 193 | add_library(turbojpeg-static STATIC ${JPEG_SOURCES} ${SIMD_OBJS} |
DRC | 418dbdf | 2011-05-26 10:45:06 +0000 | [diff] [blame] | 194 | turbojpeg.c transupp.c jdatadst-tj.c jdatasrc-tj.c) |
DRC | 8469703 | 2010-10-15 03:43:24 +0000 | [diff] [blame] | 195 | if(NOT MSVC) |
| 196 | set_target_properties(turbojpeg-static PROPERTIES OUTPUT_NAME turbojpeg) |
| 197 | endif() |
| 198 | if(WITH_SIMD) |
| 199 | add_dependencies(turbojpeg-static simd) |
| 200 | endif() |
| 201 | |
DRC | 3185cb9 | 2011-05-25 03:52:22 +0000 | [diff] [blame] | 202 | add_executable(tjunittest tjunittest.c tjutil.c) |
| 203 | target_link_libraries(tjunittest turbojpeg) |
DRC | 8469703 | 2010-10-15 03:43:24 +0000 | [diff] [blame] | 204 | |
DRC | 3185cb9 | 2011-05-25 03:52:22 +0000 | [diff] [blame] | 205 | add_executable(tjunittest-static tjunittest.c tjutil.c) |
| 206 | target_link_libraries(tjunittest-static turbojpeg-static) |
DRC | 8469703 | 2010-10-15 03:43:24 +0000 | [diff] [blame] | 207 | |
DRC | 3185cb9 | 2011-05-25 03:52:22 +0000 | [diff] [blame] | 208 | add_executable(tjbench tjbench.c bmp.c tjutil.c rdbmp.c rdppm.c wrbmp.c |
DRC | 4348464 | 2011-05-24 17:03:51 +0000 | [diff] [blame] | 209 | wrppm.c) |
DRC | 4ad6003 | 2011-09-20 05:41:54 +0000 | [diff] [blame] | 210 | target_link_libraries(tjbench turbojpeg jpeg-static) |
DRC | 3185cb9 | 2011-05-25 03:52:22 +0000 | [diff] [blame] | 211 | set_property(TARGET tjbench PROPERTY COMPILE_FLAGS |
DRC | 4348464 | 2011-05-24 17:03:51 +0000 | [diff] [blame] | 212 | "-DBMP_SUPPORTED -DPPM_SUPPORTED") |
DRC | 8469703 | 2010-10-15 03:43:24 +0000 | [diff] [blame] | 213 | |
DRC | 3185cb9 | 2011-05-25 03:52:22 +0000 | [diff] [blame] | 214 | add_executable(tjbench-static tjbench.c bmp.c tjutil.c rdbmp.c rdppm.c wrbmp.c |
DRC | 4348464 | 2011-05-24 17:03:51 +0000 | [diff] [blame] | 215 | wrppm.c) |
DRC | 3185cb9 | 2011-05-25 03:52:22 +0000 | [diff] [blame] | 216 | target_link_libraries(tjbench-static turbojpeg-static jpeg-static) |
| 217 | set_property(TARGET tjbench-static PROPERTY COMPILE_FLAGS |
DRC | 4348464 | 2011-05-24 17:03:51 +0000 | [diff] [blame] | 218 | "-DBMP_SUPPORTED -DPPM_SUPPORTED") |
DRC | 8469703 | 2010-10-15 03:43:24 +0000 | [diff] [blame] | 219 | |
| 220 | add_executable(cjpeg-static cjpeg.c cdjpeg.c rdbmp.c rdgif.c rdppm.c rdswitch.c |
| 221 | rdtarga.c) |
| 222 | set_property(TARGET cjpeg-static PROPERTY COMPILE_FLAGS |
DRC | 5ee81f4 | 2011-05-02 00:35:50 +0000 | [diff] [blame] | 223 | "-DBMP_SUPPORTED -DGIF_SUPPORTED -DPPM_SUPPORTED -DTARGA_SUPPORTED -DUSE_SETMODE") |
DRC | 8469703 | 2010-10-15 03:43:24 +0000 | [diff] [blame] | 224 | target_link_libraries(cjpeg-static jpeg-static) |
| 225 | |
| 226 | add_executable(djpeg-static djpeg.c cdjpeg.c rdcolmap.c rdswitch.c wrbmp.c wrgif.c |
| 227 | wrppm.c wrtarga.c) |
| 228 | set_property(TARGET djpeg-static PROPERTY COMPILE_FLAGS |
DRC | 5ee81f4 | 2011-05-02 00:35:50 +0000 | [diff] [blame] | 229 | "-DBMP_SUPPORTED -DGIF_SUPPORTED -DPPM_SUPPORTED -DTARGA_SUPPORTED -DUSE_SETMODE") |
DRC | 8469703 | 2010-10-15 03:43:24 +0000 | [diff] [blame] | 230 | target_link_libraries(djpeg-static jpeg-static) |
| 231 | |
| 232 | add_executable(jpegtran-static jpegtran.c cdjpeg.c rdswitch.c transupp.c) |
| 233 | target_link_libraries(jpegtran-static jpeg-static) |
DRC | 7e3fd2f | 2011-05-25 06:04:43 +0000 | [diff] [blame] | 234 | set_property(TARGET jpegtran-static PROPERTY COMPILE_FLAGS "-DUSE_SETMODE") |
DRC | 8469703 | 2010-10-15 03:43:24 +0000 | [diff] [blame] | 235 | |
| 236 | add_executable(rdjpgcom rdjpgcom.c) |
| 237 | |
DRC | a81f542 | 2014-06-22 20:50:14 +0000 | [diff] [blame^] | 238 | add_executable(wrjpgcom wrjpgcom.c) |
DRC | 8469703 | 2010-10-15 03:43:24 +0000 | [diff] [blame] | 239 | |
| 240 | |
| 241 | # |
| 242 | # Tests |
| 243 | # |
| 244 | |
DRC | 957d623 | 2011-04-01 11:13:11 +0000 | [diff] [blame] | 245 | if(MSVC_IDE) |
| 246 | set(OBJDIR "\${CTEST_CONFIGURATION_TYPE}/") |
| 247 | else() |
| 248 | set(OBJDIR "") |
| 249 | endif() |
| 250 | |
DRC | 8469703 | 2010-10-15 03:43:24 +0000 | [diff] [blame] | 251 | enable_testing() |
DRC | 957d623 | 2011-04-01 11:13:11 +0000 | [diff] [blame] | 252 | if(WITH_JAVA) |
| 253 | add_test(TJUnitTest ${JAVA_RUNTIME} -cp java/${OBJDIR}turbojpeg.jar -Djava.library.path=${CMAKE_CURRENT_BINARY_DIR}/${OBJDIR} TJUnitTest) |
| 254 | add_test(TJUnitTest-yuv ${JAVA_RUNTIME} -cp java/${OBJDIR}turbojpeg.jar -Djava.library.path=${CMAKE_CURRENT_BINARY_DIR}/${OBJDIR} TJUnitTest -yuv) |
| 255 | add_test(TJUnitTest-bi ${JAVA_RUNTIME} -cp java/${OBJDIR}turbojpeg.jar -Djava.library.path=${CMAKE_CURRENT_BINARY_DIR}/${OBJDIR} TJUnitTest -bi) |
| 256 | add_test(TJUnitTest-bi-yuv ${JAVA_RUNTIME} -cp java/${OBJDIR}turbojpeg.jar -Djava.library.path=${CMAKE_CURRENT_BINARY_DIR}/${OBJDIR} TJUnitTest -bi -yuv) |
| 257 | endif() |
DRC | 3185cb9 | 2011-05-25 03:52:22 +0000 | [diff] [blame] | 258 | add_test(tjunittest tjunittest) |
| 259 | add_test(tjunittest-alloc tjunittest -alloc) |
| 260 | add_test(tjunittest-yuv tjunittest -yuv) |
DRC | 6ebf110 | 2012-01-31 04:58:26 +0000 | [diff] [blame] | 261 | add_test(cjpeg-int sharedlib/cjpeg -dct int -outfile testoutint.jpg ${CMAKE_SOURCE_DIR}/testimages/testorig.ppm) |
| 262 | add_test(cjpeg-int-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimages/testimgint.jpg testoutint.jpg) |
| 263 | add_test(cjpeg-fast sharedlib/cjpeg -dct fast -opt -outfile testoutfst.jpg ${CMAKE_SOURCE_DIR}/testimages/testorig.ppm) |
| 264 | add_test(cjpeg-fast-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimages/testimgfst.jpg testoutfst.jpg) |
| 265 | add_test(cjpeg-fast-100 sharedlib/cjpeg -dct fast -quality 100 -opt -outfile testoutfst100.jpg ${CMAKE_SOURCE_DIR}/testimages/testorig.ppm) |
| 266 | add_test(cjpeg-fast-100-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimages/testimgfst100.jpg testoutfst100.jpg) |
| 267 | add_test(cjpeg-float sharedlib/cjpeg -dct float -outfile testoutflt.jpg ${CMAKE_SOURCE_DIR}/testimages/testorig.ppm) |
DRC | 8469703 | 2010-10-15 03:43:24 +0000 | [diff] [blame] | 268 | if(WITH_SIMD) |
DRC | 6ebf110 | 2012-01-31 04:58:26 +0000 | [diff] [blame] | 269 | add_test(cjpeg-float-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimages/testimgflt.jpg testoutflt.jpg) |
DRC | 8469703 | 2010-10-15 03:43:24 +0000 | [diff] [blame] | 270 | else() |
DRC | 6ebf110 | 2012-01-31 04:58:26 +0000 | [diff] [blame] | 271 | add_test(cjpeg-float-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimages/testimgflt-nosimd.jpg testoutflt.jpg) |
DRC | 8469703 | 2010-10-15 03:43:24 +0000 | [diff] [blame] | 272 | endif() |
DRC | 6ebf110 | 2012-01-31 04:58:26 +0000 | [diff] [blame] | 273 | add_test(cjpeg-int-gray sharedlib/cjpeg -dct int -grayscale -outfile testoutgray.jpg ${CMAKE_SOURCE_DIR}/testimages/testorig.ppm) |
| 274 | add_test(cjpeg-int-gray-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimages/testimggray.jpg testoutgray.jpg) |
| 275 | add_test(djpeg-int sharedlib/djpeg -dct int -fast -ppm -outfile testoutint.ppm ${CMAKE_SOURCE_DIR}/testimages/testorig.jpg) |
| 276 | add_test(djpeg-int-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimages/testimgint.ppm testoutint.ppm) |
| 277 | add_test(djpeg-fast sharedlib/djpeg -dct fast -ppm -outfile testoutfst.ppm ${CMAKE_SOURCE_DIR}/testimages/testorig.jpg) |
| 278 | add_test(djpeg-fast-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimages/testimgfst.ppm testoutfst.ppm) |
| 279 | add_test(djpeg-float sharedlib/djpeg -dct float -ppm -outfile testoutflt.ppm ${CMAKE_SOURCE_DIR}/testimages/testorig.jpg) |
DRC | 8469703 | 2010-10-15 03:43:24 +0000 | [diff] [blame] | 280 | if(WITH_SIMD) |
DRC | 6ebf110 | 2012-01-31 04:58:26 +0000 | [diff] [blame] | 281 | add_test(djpeg-float-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimages/testimgflt.ppm testoutflt.ppm) |
DRC | 8469703 | 2010-10-15 03:43:24 +0000 | [diff] [blame] | 282 | else() |
DRC | 6ebf110 | 2012-01-31 04:58:26 +0000 | [diff] [blame] | 283 | add_test(djpeg-float-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimages/testorig.ppm testoutflt.ppm) |
DRC | 8469703 | 2010-10-15 03:43:24 +0000 | [diff] [blame] | 284 | endif() |
DRC | 6ebf110 | 2012-01-31 04:58:26 +0000 | [diff] [blame] | 285 | add_test(djpeg-int-1_2 sharedlib/djpeg -dct int -scale 1/2 -ppm -outfile testoutint1_2.ppm ${CMAKE_SOURCE_DIR}/testimages/testorig.jpg) |
| 286 | add_test(djpeg-int-1_2-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimages/testimgint1_2.ppm testoutint1_2.ppm) |
| 287 | add_test(djpeg-fast-1_2 sharedlib/djpeg -dct fast -scale 1/2 -ppm -outfile testoutfst1_2.ppm ${CMAKE_SOURCE_DIR}/testimages/testorig.jpg) |
| 288 | add_test(djpeg-fast-1_2-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimages/testimgfst1_2.ppm testoutfst1_2.ppm) |
| 289 | add_test(djpeg-int-1_4 sharedlib/djpeg -dct int -scale 1/4 -ppm -outfile testoutint1_4.ppm ${CMAKE_SOURCE_DIR}/testimages/testorig.jpg) |
| 290 | add_test(djpeg-int-1_4-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimages/testimgint1_4.ppm testoutint1_4.ppm) |
| 291 | add_test(djpeg-fast-1_4 sharedlib/djpeg -dct fast -scale 1/4 -ppm -outfile testoutfst1_4.ppm ${CMAKE_SOURCE_DIR}/testimages/testorig.jpg) |
| 292 | add_test(djpeg-fast-1_4-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimages/testimgfst1_4.ppm testoutfst1_4.ppm) |
| 293 | add_test(djpeg-int-1_8 sharedlib/djpeg -dct int -scale 1/8 -ppm -outfile testoutint1_8.ppm ${CMAKE_SOURCE_DIR}/testimages/testorig.jpg) |
| 294 | add_test(djpeg-int-1_8-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimages/testimgint1_8.ppm testoutint1_8.ppm) |
| 295 | add_test(djpeg-fast-1_8 sharedlib/djpeg -dct fast -scale 1/8 -ppm -outfile testoutfst1_8.ppm ${CMAKE_SOURCE_DIR}/testimages/testorig.jpg) |
| 296 | add_test(djpeg-fast-1_8-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimages/testimgfst1_8.ppm testoutfst1_8.ppm) |
| 297 | add_test(djpeg-256 sharedlib/djpeg -dct int -bmp -colors 256 -outfile testout.bmp ${CMAKE_SOURCE_DIR}/testimages/testorig.jpg) |
| 298 | add_test(djpeg-256-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimages/testimg.bmp testout.bmp) |
| 299 | add_test(cjpeg-prog sharedlib/cjpeg -dct int -progressive -outfile testoutp.jpg ${CMAKE_SOURCE_DIR}/testimages/testorig.ppm) |
| 300 | add_test(cjpeg-prog-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimages/testimgp.jpg testoutp.jpg) |
DRC | 8469703 | 2010-10-15 03:43:24 +0000 | [diff] [blame] | 301 | add_test(jpegtran-prog sharedlib/jpegtran -outfile testoutt.jpg testoutp.jpg) |
DRC | 6ebf110 | 2012-01-31 04:58:26 +0000 | [diff] [blame] | 302 | add_test(jpegtran-prog-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimages/testimgint.jpg testoutt.jpg) |
DRC | 245cfdf | 2010-11-23 17:11:06 +0000 | [diff] [blame] | 303 | if(WITH_ARITH_ENC) |
DRC | 6ebf110 | 2012-01-31 04:58:26 +0000 | [diff] [blame] | 304 | add_test(cjpeg-ari sharedlib/cjpeg -dct int -arithmetic -outfile testoutari.jpg ${CMAKE_SOURCE_DIR}/testimages/testorig.ppm) |
| 305 | add_test(cjpeg-ari-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimages/testimgari.jpg testoutari.jpg) |
| 306 | add_test(jpegtran-toari sharedlib/jpegtran -arithmetic -outfile testouta.jpg ${CMAKE_SOURCE_DIR}/testimages/testimgint.jpg) |
| 307 | add_test(jpegtran-toari-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimages/testimgari.jpg testouta.jpg) |
DRC | e163653 | 2013-11-06 07:45:39 +0000 | [diff] [blame] | 308 | add_test(cjpeg-prog-ari sharedlib/cjpeg -dct int -progressive -arithmetic -sample 1x1 -outfile testoutpa.jpg ${CMAKE_SOURCE_DIR}/testimages/testorig.ppm) |
| 309 | add_test(cjpeg-prog-ari-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimages/testimgpa.jpg testoutpa.jpg) |
DRC | 245cfdf | 2010-11-23 17:11:06 +0000 | [diff] [blame] | 310 | endif() |
| 311 | if(WITH_ARITH_DEC) |
DRC | 6ebf110 | 2012-01-31 04:58:26 +0000 | [diff] [blame] | 312 | add_test(djpeg-ari sharedlib/djpeg -dct int -fast -ppm -outfile testoutari.ppm ${CMAKE_SOURCE_DIR}/testimages/testimgari.jpg) |
| 313 | add_test(djpeg-ari-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimages/testimgari.ppm testoutari.ppm) |
| 314 | add_test(jpegtran-fromari sharedlib/jpegtran -outfile testouta.jpg ${CMAKE_SOURCE_DIR}/testimages/testimgari.jpg) |
| 315 | add_test(jpegtran-fromari-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimages/testimgint.jpg testouta.jpg) |
DRC | 245cfdf | 2010-11-23 17:11:06 +0000 | [diff] [blame] | 316 | endif() |
DRC | 6ebf110 | 2012-01-31 04:58:26 +0000 | [diff] [blame] | 317 | add_test(jpegtran-crop sharedlib/jpegtran -crop 120x90+20+50 -transpose -perfect -outfile testoutcrop.jpg ${CMAKE_SOURCE_DIR}/testimages/testorig.jpg) |
| 318 | add_test(jpegtran-crop-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimages/testimgcrop.jpg testoutcrop.jpg) |
DRC | 8469703 | 2010-10-15 03:43:24 +0000 | [diff] [blame] | 319 | |
DRC | 3185cb9 | 2011-05-25 03:52:22 +0000 | [diff] [blame] | 320 | add_test(tjunittest-static tjunittest-static) |
| 321 | add_test(tjunittest-static-alloc tjunittest-static -alloc) |
| 322 | add_test(tjunittest-static-yuv tjunittest-static -yuv) |
DRC | 6ebf110 | 2012-01-31 04:58:26 +0000 | [diff] [blame] | 323 | add_test(cjpeg-static-int cjpeg-static -dct int -outfile testoutint.jpg ${CMAKE_SOURCE_DIR}/testimages/testorig.ppm) |
| 324 | add_test(cjpeg-static-int-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimages/testimgint.jpg testoutint.jpg) |
| 325 | add_test(cjpeg-static-fast cjpeg-static -dct fast -opt -outfile testoutfst.jpg ${CMAKE_SOURCE_DIR}/testimages/testorig.ppm) |
| 326 | add_test(cjpeg-static-fast-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimages/testimgfst.jpg testoutfst.jpg) |
| 327 | add_test(cjpeg-static-fast-100 cjpeg-static -dct fast -quality 100 -opt -outfile testoutfst100.jpg ${CMAKE_SOURCE_DIR}/testimages/testorig.ppm) |
| 328 | add_test(cjpeg-static-fast-100-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimages/testimgfst100.jpg testoutfst100.jpg) |
| 329 | add_test(cjpeg-static-float cjpeg-static -dct float -outfile testoutflt.jpg ${CMAKE_SOURCE_DIR}/testimages/testorig.ppm) |
DRC | 8469703 | 2010-10-15 03:43:24 +0000 | [diff] [blame] | 330 | if(WITH_SIMD) |
DRC | 6ebf110 | 2012-01-31 04:58:26 +0000 | [diff] [blame] | 331 | add_test(cjpeg-static-float-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimages/testimgflt.jpg testoutflt.jpg) |
DRC | 8469703 | 2010-10-15 03:43:24 +0000 | [diff] [blame] | 332 | else() |
DRC | 6ebf110 | 2012-01-31 04:58:26 +0000 | [diff] [blame] | 333 | add_test(cjpeg-static-float-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimages/testimgflt-nosimd.jpg testoutflt.jpg) |
DRC | 8469703 | 2010-10-15 03:43:24 +0000 | [diff] [blame] | 334 | endif() |
DRC | 6ebf110 | 2012-01-31 04:58:26 +0000 | [diff] [blame] | 335 | add_test(cjpeg-static-int-gray cjpeg-static -dct int -grayscale -outfile testoutgray.jpg ${CMAKE_SOURCE_DIR}/testimages/testorig.ppm) |
| 336 | add_test(cjpeg-static-int-gray-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimages/testimggray.jpg testoutgray.jpg) |
| 337 | add_test(djpeg-static-int djpeg-static -dct int -fast -ppm -outfile testoutint.ppm ${CMAKE_SOURCE_DIR}/testimages/testorig.jpg) |
| 338 | add_test(djpeg-static-int-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimages/testimgint.ppm testoutint.ppm) |
| 339 | add_test(djpeg-static-fast djpeg-static -dct fast -ppm -outfile testoutfst.ppm ${CMAKE_SOURCE_DIR}/testimages/testorig.jpg) |
| 340 | add_test(djpeg-static-fast-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimages/testimgfst.ppm testoutfst.ppm) |
| 341 | add_test(djpeg-static-float djpeg-static -dct float -ppm -outfile testoutflt.ppm ${CMAKE_SOURCE_DIR}/testimages/testorig.jpg) |
DRC | 8469703 | 2010-10-15 03:43:24 +0000 | [diff] [blame] | 342 | if(WITH_SIMD) |
DRC | 6ebf110 | 2012-01-31 04:58:26 +0000 | [diff] [blame] | 343 | add_test(djpeg-static-float-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimages/testimgflt.ppm testoutflt.ppm) |
DRC | 8469703 | 2010-10-15 03:43:24 +0000 | [diff] [blame] | 344 | else() |
DRC | 6ebf110 | 2012-01-31 04:58:26 +0000 | [diff] [blame] | 345 | add_test(djpeg-static-float-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimages/testorig.ppm testoutflt.ppm) |
DRC | 8469703 | 2010-10-15 03:43:24 +0000 | [diff] [blame] | 346 | endif() |
DRC | 6ebf110 | 2012-01-31 04:58:26 +0000 | [diff] [blame] | 347 | add_test(djpeg-static-int-1_2 djpeg-static -dct int -scale 1/2 -ppm -outfile testoutint1_2.ppm ${CMAKE_SOURCE_DIR}/testimages/testorig.jpg) |
| 348 | add_test(djpeg-static-int-1_2-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimages/testimgint1_2.ppm testoutint1_2.ppm) |
| 349 | add_test(djpeg-static-fast-1_2 djpeg-static -dct fast -scale 1/2 -ppm -outfile testoutfst1_2.ppm ${CMAKE_SOURCE_DIR}/testimages/testorig.jpg) |
| 350 | add_test(djpeg-static-fast-1_2-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimages/testimgfst1_2.ppm testoutfst1_2.ppm) |
| 351 | add_test(djpeg-static-int-1_4 djpeg-static -dct int -scale 1/4 -ppm -outfile testoutint1_4.ppm ${CMAKE_SOURCE_DIR}/testimages/testorig.jpg) |
| 352 | add_test(djpeg-static-int-1_4-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimages/testimgint1_4.ppm testoutint1_4.ppm) |
| 353 | add_test(djpeg-static-fast-1_4 djpeg-static -dct fast -scale 1/4 -ppm -outfile testoutfst1_4.ppm ${CMAKE_SOURCE_DIR}/testimages/testorig.jpg) |
| 354 | add_test(djpeg-static-fast-1_4-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimages/testimgfst1_4.ppm testoutfst1_4.ppm) |
| 355 | add_test(djpeg-static-int-1_8 djpeg-static -dct int -scale 1/8 -ppm -outfile testoutint1_8.ppm ${CMAKE_SOURCE_DIR}/testimages/testorig.jpg) |
| 356 | add_test(djpeg-static-int-1_8-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimages/testimgint1_8.ppm testoutint1_8.ppm) |
| 357 | add_test(djpeg-static-fast-1_8 djpeg-static -dct fast -scale 1/8 -ppm -outfile testoutfst1_8.ppm ${CMAKE_SOURCE_DIR}/testimages/testorig.jpg) |
| 358 | add_test(djpeg-static-fast-1_8-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimages/testimgfst1_8.ppm testoutfst1_8.ppm) |
| 359 | add_test(djpeg-static-256 djpeg-static -dct int -bmp -colors 256 -outfile testout.bmp ${CMAKE_SOURCE_DIR}/testimages/testorig.jpg) |
| 360 | add_test(djpeg-static-256-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimages/testimg.bmp testout.bmp) |
| 361 | add_test(cjpeg-static-prog cjpeg-static -dct int -progressive -outfile testoutp.jpg ${CMAKE_SOURCE_DIR}/testimages/testorig.ppm) |
| 362 | add_test(cjpeg-static-prog-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimages/testimgp.jpg testoutp.jpg) |
DRC | 8469703 | 2010-10-15 03:43:24 +0000 | [diff] [blame] | 363 | add_test(jpegtran-static-prog jpegtran-static -outfile testoutt.jpg testoutp.jpg) |
DRC | 6ebf110 | 2012-01-31 04:58:26 +0000 | [diff] [blame] | 364 | add_test(jpegtran-static-prog-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimages/testimgint.jpg testoutt.jpg) |
DRC | 245cfdf | 2010-11-23 17:11:06 +0000 | [diff] [blame] | 365 | if(WITH_ARITH_ENC) |
DRC | 6ebf110 | 2012-01-31 04:58:26 +0000 | [diff] [blame] | 366 | add_test(cjpeg-static-ari cjpeg-static -dct int -arithmetic -outfile testoutari.jpg ${CMAKE_SOURCE_DIR}/testimages/testorig.ppm) |
| 367 | add_test(cjpeg-static-ari-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimages/testimgari.jpg testoutari.jpg) |
| 368 | add_test(jpegtran-static-toari jpegtran-static -arithmetic -outfile testouta.jpg ${CMAKE_SOURCE_DIR}/testimages/testimgint.jpg) |
| 369 | add_test(jpegtran-static-toari-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimages/testimgari.jpg testouta.jpg) |
DRC | e163653 | 2013-11-06 07:45:39 +0000 | [diff] [blame] | 370 | add_test(cjpeg-static-prog-ari cjpeg-static -dct int -progressive -arithmetic -sample 1x1 -outfile testoutpa.jpg ${CMAKE_SOURCE_DIR}/testimages/testorig.ppm) |
| 371 | add_test(cjpeg-static-prog-ari-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimages/testimgpa.jpg testoutpa.jpg) |
DRC | 245cfdf | 2010-11-23 17:11:06 +0000 | [diff] [blame] | 372 | endif() |
| 373 | if(WITH_ARITH_DEC) |
DRC | 6ebf110 | 2012-01-31 04:58:26 +0000 | [diff] [blame] | 374 | add_test(djpeg-static-ari djpeg-static -dct int -fast -ppm -outfile testoutari.ppm ${CMAKE_SOURCE_DIR}/testimages/testimgari.jpg) |
| 375 | add_test(djpeg-static-ari-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimages/testimgari.ppm testoutari.ppm) |
| 376 | add_test(jpegtran-static-fromari jpegtran-static -outfile testouta.jpg ${CMAKE_SOURCE_DIR}/testimages/testimgari.jpg) |
| 377 | add_test(jpegtran-static-fromari-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimages/testimgint.jpg testouta.jpg) |
DRC | 245cfdf | 2010-11-23 17:11:06 +0000 | [diff] [blame] | 378 | endif() |
DRC | 6ebf110 | 2012-01-31 04:58:26 +0000 | [diff] [blame] | 379 | add_test(jpegtran-static-crop jpegtran-static -crop 120x90+20+50 -transpose -perfect -outfile testoutcrop.jpg ${CMAKE_SOURCE_DIR}/testimages/testorig.jpg) |
| 380 | add_test(jpegtran-static-crop-cmp ${CMAKE_COMMAND} -E compare_files ${CMAKE_SOURCE_DIR}/testimages/testimgcrop.jpg testoutcrop.jpg) |
DRC | 2c0a4e1 | 2010-10-16 08:51:43 +0000 | [diff] [blame] | 381 | |
DRC | a0f878a | 2011-04-02 04:43:14 +0000 | [diff] [blame] | 382 | add_custom_target(testclean COMMAND ${CMAKE_COMMAND} -P |
| 383 | ${CMAKE_SOURCE_DIR}/cmakescripts/testclean.cmake) |
| 384 | |
DRC | 2c0a4e1 | 2010-10-16 08:51:43 +0000 | [diff] [blame] | 385 | |
| 386 | # |
| 387 | # Installer |
| 388 | # |
| 389 | |
DRC | 2c0a4e1 | 2010-10-16 08:51:43 +0000 | [diff] [blame] | 390 | if(MSVC) |
| 391 | set(INST_PLATFORM "Visual C++") |
DRC | b94f2de | 2011-03-22 09:31:25 +0000 | [diff] [blame] | 392 | set(INST_NAME ${CMAKE_PROJECT_NAME}-${VERSION}-vc) |
| 393 | set(INST_DIR ${CMAKE_PROJECT_NAME}) |
DRC | 2c0a4e1 | 2010-10-16 08:51:43 +0000 | [diff] [blame] | 394 | elseif(MINGW) |
| 395 | set(INST_PLATFORM GCC) |
DRC | b94f2de | 2011-03-22 09:31:25 +0000 | [diff] [blame] | 396 | set(INST_NAME ${CMAKE_PROJECT_NAME}-${VERSION}-gcc) |
| 397 | set(INST_DIR ${CMAKE_PROJECT_NAME}-gcc) |
DRC | 2c0a4e1 | 2010-10-16 08:51:43 +0000 | [diff] [blame] | 398 | set(INST_DEFS -DGCC) |
| 399 | endif() |
| 400 | |
| 401 | if(64BIT) |
| 402 | set(INST_PLATFORM "${INST_PLATFORM} 64-bit") |
| 403 | set(INST_NAME ${INST_NAME}64) |
DRC | b94f2de | 2011-03-22 09:31:25 +0000 | [diff] [blame] | 404 | set(INST_DIR ${INST_DIR}64) |
DRC | 2c0a4e1 | 2010-10-16 08:51:43 +0000 | [diff] [blame] | 405 | set(INST_DEFS ${INST_DEFS} -DWIN64) |
| 406 | endif() |
| 407 | |
DRC | 957d623 | 2011-04-01 11:13:11 +0000 | [diff] [blame] | 408 | if(WITH_JAVA) |
| 409 | set(INST_DEFS ${INST_DEFS} -DJAVA) |
| 410 | endif() |
| 411 | |
DRC | 2c0a4e1 | 2010-10-16 08:51:43 +0000 | [diff] [blame] | 412 | if(MSVC_IDE) |
DRC | 926e01f | 2011-04-06 06:35:38 +0000 | [diff] [blame] | 413 | set(INST_DEFS ${INST_DEFS} "-DBUILDDIR=${CMAKE_CFG_INTDIR}\\") |
DRC | 2c0a4e1 | 2010-10-16 08:51:43 +0000 | [diff] [blame] | 414 | else() |
| 415 | set(INST_DEFS ${INST_DEFS} "-DBUILDDIR=") |
| 416 | endif() |
| 417 | |
| 418 | configure_file(release/libjpeg-turbo.nsi.in libjpeg-turbo.nsi @ONLY) |
| 419 | |
| 420 | add_custom_target(installer |
| 421 | makensis -nocd ${INST_DEFS} libjpeg-turbo.nsi |
DRC | b94f2de | 2011-03-22 09:31:25 +0000 | [diff] [blame] | 422 | DEPENDS jpeg jpeg-static turbojpeg turbojpeg-static rdjpgcom wrjpgcom |
DRC | 3185cb9 | 2011-05-25 03:52:22 +0000 | [diff] [blame] | 423 | cjpeg djpeg jpegtran tjbench |
DRC | 2c0a4e1 | 2010-10-16 08:51:43 +0000 | [diff] [blame] | 424 | SOURCES libjpeg-turbo.nsi) |
DRC | 7284c9a | 2010-10-16 21:55:14 +0000 | [diff] [blame] | 425 | |
DRC | 3185cb9 | 2011-05-25 03:52:22 +0000 | [diff] [blame] | 426 | install(TARGETS jpeg-static turbojpeg turbojpeg-static rdjpgcom wrjpgcom tjbench |
DRC | 7284c9a | 2010-10-16 21:55:14 +0000 | [diff] [blame] | 427 | ARCHIVE DESTINATION lib |
| 428 | LIBRARY DESTINATION lib |
| 429 | RUNTIME DESTINATION bin |
| 430 | ) |
| 431 | |
DRC | a1647c8 | 2012-02-10 00:39:05 +0000 | [diff] [blame] | 432 | install(FILES ${CMAKE_SOURCE_DIR}/README ${CMAKE_SOURCE_DIR}/README-turbo.txt |
| 433 | ${CMAKE_SOURCE_DIR}/example.c ${CMAKE_SOURCE_DIR}/libjpeg.txt |
| 434 | ${CMAKE_SOURCE_DIR}/structure.txt ${CMAKE_SOURCE_DIR}/usage.txt |
| 435 | ${CMAKE_SOURCE_DIR}/wizard.txt |
DRC | 7284c9a | 2010-10-16 21:55:14 +0000 | [diff] [blame] | 436 | DESTINATION doc) |
DRC | e2befde | 2010-10-17 07:28:08 +0000 | [diff] [blame] | 437 | |
| 438 | install(FILES ${CMAKE_BINARY_DIR}/jconfig.h ${CMAKE_SOURCE_DIR}/jerror.h |
| 439 | ${CMAKE_SOURCE_DIR}/jmorecfg.h ${CMAKE_SOURCE_DIR}/jpeglib.h |
| 440 | ${CMAKE_SOURCE_DIR}/turbojpeg.h DESTINATION include) |