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