Use lowercase for cmake commands consistenly

Inspired from https://github.com/InsightSoftwareConsortium/ITK/blob/master/Utilities/Maintenance/HowToCreateTheCMakeCaseConversion.txt
This needs vim 7.3 and fails with vim 7.4

This also fixes a number of :
- missing empty line at end of files
- useless space at end of lines
This commit is contained in:
Julien Malik 2016-05-02 16:03:16 +02:00
parent ba0cf122f6
commit 17a0a8a195
21 changed files with 201 additions and 201 deletions

View File

@ -56,7 +56,7 @@ set(PACKAGE_VERSION
# you can specify your own OPENJPEG_SOVERSION at cmake configuration time: # you can specify your own OPENJPEG_SOVERSION at cmake configuration time:
# cmake -DOPENJPEG_SOVERSION:STRING=42 /path/to/openjpeg # cmake -DOPENJPEG_SOVERSION:STRING=42 /path/to/openjpeg
if(NOT OPENJPEG_SOVERSION) if(NOT OPENJPEG_SOVERSION)
SET(OPENJPEG_SOVERSION 7) set(OPENJPEG_SOVERSION 7)
endif(NOT OPENJPEG_SOVERSION) endif(NOT OPENJPEG_SOVERSION)
set(OPENJPEG_LIBRARY_PROPERTIES set(OPENJPEG_LIBRARY_PROPERTIES
VERSION "${OPENJPEG_VERSION_MAJOR}.${OPENJPEG_VERSION_MINOR}.${OPENJPEG_VERSION_BUILD}" VERSION "${OPENJPEG_VERSION_MAJOR}.${OPENJPEG_VERSION_MINOR}.${OPENJPEG_VERSION_BUILD}"
@ -190,7 +190,7 @@ if(CMAKE_COMPILER_IS_GNUCC)
# For all builds, make sure openjpeg is std99 compliant: # For all builds, make sure openjpeg is std99 compliant:
# set(CMAKE_C_FLAGS "-Wall -std=c99 ${CMAKE_C_FLAGS}") # FIXME: this setting prevented us from setting a coverage build. # set(CMAKE_C_FLAGS "-Wall -std=c99 ${CMAKE_C_FLAGS}") # FIXME: this setting prevented us from setting a coverage build.
# Do not use ffast-math for all build, it would produce incorrect results, only set for release: # Do not use ffast-math for all build, it would produce incorrect results, only set for release:
SET(OPENJPEG_LIBRARY_COMPILE_OPTIONS ${OPENJPEG_LIBRARY_COMPILE_OPTIONS} "$<$<CONFIG:Release>:-ffast-math>") set(OPENJPEG_LIBRARY_COMPILE_OPTIONS ${OPENJPEG_LIBRARY_COMPILE_OPTIONS} "$<$<CONFIG:Release>:-ffast-math>")
endif() endif()
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------

View File

@ -1,7 +1,7 @@
# Build the demo app, small examples # Build the demo app, small examples
# First thing define the common source: # First thing define the common source:
SET(common_SRCS set(common_SRCS
convert.c convert.c
${OPENJPEG_SOURCE_DIR}/src/bin/common/opj_getopt.c ${OPENJPEG_SOURCE_DIR}/src/bin/common/opj_getopt.c
) )
@ -26,15 +26,15 @@ if(WIN32)
endif() endif()
# Loop over all executables: # Loop over all executables:
FOREACH(exe opj_jp3d_compress opj_jp3d_decompress) foreach(exe opj_jp3d_compress opj_jp3d_decompress)
ADD_EXECUTABLE(${exe} ${exe}.c ${common_SRCS}) add_executable(${exe} ${exe}.c ${common_SRCS})
TARGET_LINK_LIBRARIES(${exe} openjp3d) target_link_libraries(${exe} openjp3d)
# On unix you need to link to the math library: # On unix you need to link to the math library:
IF(UNIX) if(UNIX)
TARGET_LINK_LIBRARIES(${exe} m) target_link_libraries(${exe} m)
ENDIF(UNIX) endif(UNIX)
# Install exe # Install exe
INSTALL(TARGETS ${exe} install(TARGETS ${exe}
EXPORT OpenJP3DTargets EXPORT OpenJP3DTargets
DESTINATION ${OPENJPEG_INSTALL_BIN_DIR} COMPONENT Applications DESTINATION ${OPENJPEG_INSTALL_BIN_DIR} COMPONENT Applications
) )

View File

@ -5,9 +5,9 @@ include_directories(
${OPENJPEG_BINARY_DIR}/src/lib/openjp2 # opj_config.h ${OPENJPEG_BINARY_DIR}/src/lib/openjp2 # opj_config.h
) )
SET(OPENJP3D_LIBRARY_NAME openjp3d) set(OPENJP3D_LIBRARY_NAME openjp3d)
# Defines the source code for the library # Defines the source code for the library
SET(OPENJP3D_SRCS set(OPENJP3D_SRCS
bio.c cio.c dwt.c event.c jp3d.c jp3d_lib.c mct.c mqc.c openjp3d.c bio.c cio.c dwt.c event.c jp3d.c jp3d_lib.c mct.c mqc.c openjp3d.c
pi.c raw.c t1.c t1_3d.c t2.c tcd.c tgt.c volume.c pi.c raw.c t1.c t1_3d.c t2.c tcd.c tgt.c volume.c
) )

View File

@ -58,7 +58,7 @@ install(TARGETS ${OPENMJ2_LIBRARY_NAME}
) )
# Install includes files # Install includes files
#INSTALL(FILES mj2.h #install(FILES mj2.h
# DESTINATION ${OPENJPEG_INSTALL_INCLUDE_DIR}/${subdir} # DESTINATION ${OPENJPEG_INSTALL_INCLUDE_DIR}/${subdir}
# COMPONENT Headers # COMPONENT Headers
#) #)

View File

@ -2,117 +2,117 @@
#------------ #------------
# Try to find lib Z # Try to find lib Z
IF(BUILD_THIRDPARTY) if(BUILD_THIRDPARTY)
# Try to build it # Try to build it
message(STATUS "We will build Z lib from thirdparty") message(STATUS "We will build Z lib from thirdparty")
ADD_SUBDIRECTORY(libz) add_subdirectory(libz)
SET(Z_LIBNAME z PARENT_SCOPE) set(Z_LIBNAME z PARENT_SCOPE)
SET(Z_INCLUDE_DIRNAME ${OPENJPEG_SOURCE_DIR}/thirdparty/include PARENT_SCOPE) set(Z_INCLUDE_DIRNAME ${OPENJPEG_SOURCE_DIR}/thirdparty/include PARENT_SCOPE)
SET(ZLIB_FOUND 1) set(ZLIB_FOUND 1)
ELSE (BUILD_THIRDPARTY) else(BUILD_THIRDPARTY)
# Try to find lib Z # Try to find lib Z
FIND_PACKAGE(ZLIB) find_package(ZLIB)
IF(ZLIB_FOUND) if(ZLIB_FOUND)
SET(Z_LIBNAME ${ZLIB_LIBRARIES} PARENT_SCOPE) set(Z_LIBNAME ${ZLIB_LIBRARIES} PARENT_SCOPE)
SET(Z_INCLUDE_DIRNAME ${ZLIB_INCLUDE_DIRS} PARENT_SCOPE) set(Z_INCLUDE_DIRNAME ${ZLIB_INCLUDE_DIRS} PARENT_SCOPE)
message(STATUS "Your system seems to have a Z lib available, we will use it to generate PNG lib") message(STATUS "Your system seems to have a Z lib available, we will use it to generate PNG lib")
# message(STATUS "DEBUG: ${ZLIB_INCLUDE_DIRS} vs ${ZLIB_INCLUDE_DIR}") # message(STATUS "DEBUG: ${ZLIB_INCLUDE_DIRS} vs ${ZLIB_INCLUDE_DIR}")
ELSE (ZLIB_FOUND) # not found else(ZLIB_FOUND) # not found
message(STATUS "Z lib not found, activate BUILD_THIRDPARTY if you want build it (necessary to build libPNG)") message(STATUS "Z lib not found, activate BUILD_THIRDPARTY if you want build it (necessary to build libPNG)")
ENDIF(ZLIB_FOUND) endif(ZLIB_FOUND)
ENDIF(BUILD_THIRDPARTY) endif(BUILD_THIRDPARTY)
#------------ #------------
# Try to find lib PNG (which depends on zlib) # Try to find lib PNG (which depends on zlib)
IF(BUILD_THIRDPARTY) if(BUILD_THIRDPARTY)
# Try to build it # Try to build it
message(STATUS "We will build PNG lib from thirdparty") message(STATUS "We will build PNG lib from thirdparty")
ADD_SUBDIRECTORY(libpng) add_subdirectory(libpng)
SET(OPJ_HAVE_PNG_H 1 PARENT_SCOPE) set(OPJ_HAVE_PNG_H 1 PARENT_SCOPE)
SET(OPJ_HAVE_LIBPNG 1 PARENT_SCOPE) set(OPJ_HAVE_LIBPNG 1 PARENT_SCOPE)
SET(PNG_LIBNAME png PARENT_SCOPE) set(PNG_LIBNAME png PARENT_SCOPE)
SET(PNG_INCLUDE_DIRNAME ${OPENJPEG_SOURCE_DIR}/thirdparty/libpng PARENT_SCOPE) set(PNG_INCLUDE_DIRNAME ${OPENJPEG_SOURCE_DIR}/thirdparty/libpng PARENT_SCOPE)
ELSE (BUILD_THIRDPARTY) else(BUILD_THIRDPARTY)
IF (ZLIB_FOUND) if(ZLIB_FOUND)
FIND_PACKAGE(PNG) find_package(PNG)
IF(PNG_FOUND) if(PNG_FOUND)
message(STATUS "Your system seems to have a PNG lib available, we will use it") message(STATUS "Your system seems to have a PNG lib available, we will use it")
SET(OPJ_HAVE_PNG_H 1 PARENT_SCOPE) set(OPJ_HAVE_PNG_H 1 PARENT_SCOPE)
SET(OPJ_HAVE_LIBPNG 1 PARENT_SCOPE) set(OPJ_HAVE_LIBPNG 1 PARENT_SCOPE)
SET(PNG_LIBNAME ${PNG_LIBRARIES} PARENT_SCOPE) set(PNG_LIBNAME ${PNG_LIBRARIES} PARENT_SCOPE)
SET(PNG_INCLUDE_DIRNAME ${PNG_PNG_INCLUDE_DIR} PARENT_SCOPE) set(PNG_INCLUDE_DIRNAME ${PNG_PNG_INCLUDE_DIR} PARENT_SCOPE)
ELSE(PNG_FOUND) # not found else(PNG_FOUND) # not found
SET(OPJ_HAVE_PNG_H 0 PARENT_SCOPE) set(OPJ_HAVE_PNG_H 0 PARENT_SCOPE)
SET(OPJ_HAVE_LIBPNG 0 PARENT_SCOPE) set(OPJ_HAVE_LIBPNG 0 PARENT_SCOPE)
message(STATUS "PNG lib not found, activate BUILD_THIRDPARTY if you want build it") message(STATUS "PNG lib not found, activate BUILD_THIRDPARTY if you want build it")
ENDIF(PNG_FOUND) endif(PNG_FOUND)
ENDIF (ZLIB_FOUND) endif(ZLIB_FOUND)
ENDIF(BUILD_THIRDPARTY) endif(BUILD_THIRDPARTY)
#------------ #------------
# Try to find lib TIFF # Try to find lib TIFF
IF(BUILD_THIRDPARTY) if(BUILD_THIRDPARTY)
# Try to build it # Try to build it
message(STATUS "We will build TIFF lib from thirdparty") message(STATUS "We will build TIFF lib from thirdparty")
ADD_SUBDIRECTORY(libtiff) add_subdirectory(libtiff)
SET(TIFF_LIBNAME tiff PARENT_SCOPE) set(TIFF_LIBNAME tiff PARENT_SCOPE)
SET(TIFF_INCLUDE_DIRNAME set(TIFF_INCLUDE_DIRNAME
${OPENJPEG_SOURCE_DIR}/thirdparty/libtiff ${OPENJPEG_SOURCE_DIR}/thirdparty/libtiff
${OPENJPEG_BINARY_DIR}/thirdparty/libtiff ${OPENJPEG_BINARY_DIR}/thirdparty/libtiff
PARENT_SCOPE) PARENT_SCOPE)
SET(OPJ_HAVE_TIFF_H 1 PARENT_SCOPE) set(OPJ_HAVE_TIFF_H 1 PARENT_SCOPE)
SET(OPJ_HAVE_LIBTIFF 1 PARENT_SCOPE) set(OPJ_HAVE_LIBTIFF 1 PARENT_SCOPE)
ELSE (BUILD_THIRDPARTY) else(BUILD_THIRDPARTY)
FIND_PACKAGE(TIFF) find_package(TIFF)
IF(TIFF_FOUND) if(TIFF_FOUND)
message(STATUS "Your system seems to have a TIFF lib available, we will use it") message(STATUS "Your system seems to have a TIFF lib available, we will use it")
SET(OPJ_HAVE_TIFF_H 1 PARENT_SCOPE) set(OPJ_HAVE_TIFF_H 1 PARENT_SCOPE)
SET(OPJ_HAVE_LIBTIFF 1 PARENT_SCOPE) set(OPJ_HAVE_LIBTIFF 1 PARENT_SCOPE)
SET(TIFF_LIBNAME ${TIFF_LIBRARIES} PARENT_SCOPE) set(TIFF_LIBNAME ${TIFF_LIBRARIES} PARENT_SCOPE)
SET(TIFF_INCLUDE_DIRNAME ${TIFF_INCLUDE_DIR} PARENT_SCOPE) set(TIFF_INCLUDE_DIRNAME ${TIFF_INCLUDE_DIR} PARENT_SCOPE)
ELSE (TIFF_FOUND) # not found else(TIFF_FOUND) # not found
SET(OPJ_HAVE_TIFF_H 0 PARENT_SCOPE) set(OPJ_HAVE_TIFF_H 0 PARENT_SCOPE)
SET(OPJ_HAVE_LIBTIFF 0 PARENT_SCOPE) set(OPJ_HAVE_LIBTIFF 0 PARENT_SCOPE)
message(STATUS "TIFF lib not found, activate BUILD_THIRDPARTY if you want build it") message(STATUS "TIFF lib not found, activate BUILD_THIRDPARTY if you want build it")
ENDIF(TIFF_FOUND) endif(TIFF_FOUND)
ENDIF(BUILD_THIRDPARTY) endif(BUILD_THIRDPARTY)
#------------ #------------
# Try to find lib LCMS2 (or by default LCMS) # Try to find lib LCMS2 (or by default LCMS)
SET(OPJ_HAVE_LCMS_H 0 PARENT_SCOPE) set(OPJ_HAVE_LCMS_H 0 PARENT_SCOPE)
SET(OPJ_HAVE_LIBLCMS 0 PARENT_SCOPE) set(OPJ_HAVE_LIBLCMS 0 PARENT_SCOPE)
IF( BUILD_THIRDPARTY) if( BUILD_THIRDPARTY)
# Try to build lcms2 # Try to build lcms2
message(STATUS "We will build LCMS2 lib from thirdparty") message(STATUS "We will build LCMS2 lib from thirdparty")
ADD_SUBDIRECTORY(liblcms2) add_subdirectory(liblcms2)
SET(LCMS_LIBNAME lcms2 PARENT_SCOPE) set(LCMS_LIBNAME lcms2 PARENT_SCOPE)
SET(LCMS_INCLUDE_DIRNAME ${OPENJPEG_SOURCE_DIR}/thirdparty/liblcms2/include PARENT_SCOPE) # set(LCMS_INCLUDE_DIRNAME ${OPENJPEG_SOURCE_DIR}/thirdparty/liblcms2/include PARENT_SCOPE) #
SET(OPJ_HAVE_LCMS2_H 1 PARENT_SCOPE) set(OPJ_HAVE_LCMS2_H 1 PARENT_SCOPE)
SET(OPJ_HAVE_LIBLCMS2 1 PARENT_SCOPE) set(OPJ_HAVE_LIBLCMS2 1 PARENT_SCOPE)
ELSE (BUILD_THIRDPARTY) else(BUILD_THIRDPARTY)
FIND_PACKAGE(LCMS2) find_package(LCMS2)
IF(LCMS2_FOUND) if(LCMS2_FOUND)
message(STATUS "Your system seems to have a LCMS2 lib available, we will use it") message(STATUS "Your system seems to have a LCMS2 lib available, we will use it")
SET(OPJ_HAVE_LCMS2_H 1 PARENT_SCOPE) set(OPJ_HAVE_LCMS2_H 1 PARENT_SCOPE)
SET(OPJ_HAVE_LIBLCMS2 1 PARENT_SCOPE) set(OPJ_HAVE_LIBLCMS2 1 PARENT_SCOPE)
SET(LCMS_LIBNAME ${LCMS2_LIBRARIES} PARENT_SCOPE) set(LCMS_LIBNAME ${LCMS2_LIBRARIES} PARENT_SCOPE)
SET(LCMS_INCLUDE_DIRNAME ${LCMS2_INCLUDE_DIRS} PARENT_SCOPE) set(LCMS_INCLUDE_DIRNAME ${LCMS2_INCLUDE_DIRS} PARENT_SCOPE)
ELSE (LCMS2_FOUND) # not found lcms2 else(LCMS2_FOUND) # not found lcms2
# try to find LCMS # try to find LCMS
FIND_PACKAGE(LCMS) find_package(LCMS)
IF(LCMS_FOUND) if(LCMS_FOUND)
message(STATUS "Your system seems to have a LCMS lib available, we will use it") message(STATUS "Your system seems to have a LCMS lib available, we will use it")
SET(OPJ_HAVE_LCMS_H 1 PARENT_SCOPE) set(OPJ_HAVE_LCMS_H 1 PARENT_SCOPE)
SET(OPJ_HAVE_LIBLCMS 1 PARENT_SCOPE) set(OPJ_HAVE_LIBLCMS 1 PARENT_SCOPE)
SET(LCMS_LIBNAME ${LCMS_LIBRARIES} PARENT_SCOPE) set(LCMS_LIBNAME ${LCMS_LIBRARIES} PARENT_SCOPE)
SET(LCMS_INCLUDE_DIRNAME ${LCMS_INCLUDE_DIRS} PARENT_SCOPE) set(LCMS_INCLUDE_DIRNAME ${LCMS_INCLUDE_DIRS} PARENT_SCOPE)
ELSE (LCMS_FOUND) # not found lcms else(LCMS_FOUND) # not found lcms
SET(OPJ_HAVE_LCMS2_H 0 PARENT_SCOPE) set(OPJ_HAVE_LCMS2_H 0 PARENT_SCOPE)
SET(OPJ_HAVE_LIBLCMS2 0 PARENT_SCOPE) set(OPJ_HAVE_LIBLCMS2 0 PARENT_SCOPE)
message(STATUS "LCMS2 or LCMS lib not found, activate BUILD_THIRDPARTY if you want build it") message(STATUS "LCMS2 or LCMS lib not found, activate BUILD_THIRDPARTY if you want build it")
ENDIF (LCMS_FOUND) endif(LCMS_FOUND)
ENDIF(LCMS2_FOUND) endif(LCMS2_FOUND)
ENDIF(BUILD_THIRDPARTY) endif(BUILD_THIRDPARTY)

View File

@ -1,19 +1,19 @@
PROJECT(liblcms2 C) project(liblcms2 C)
# #
INCLUDE_DIRECTORIES("${CMAKE_CURRENT_SOURCE_DIR}/include") include_directories("${CMAKE_CURRENT_SOURCE_DIR}/include")
# #
FILE(GLOB SRCS src/*.c) file(GLOB SRCS src/*.c)
FILE(GLOB HDRS include/*.h) file(GLOB HDRS include/*.h)
# #
SET(LIBTARGET "lcms2") set(LIBTARGET "lcms2")
# #
ADD_LIBRARY(${LIBTARGET} STATIC ${SRCS} ${HDRS}) add_library(${LIBTARGET} STATIC ${SRCS} ${HDRS})
# #
IF(MSVC) if(MSVC)
SET_TARGET_PROPERTIES(${LIBTARGET} PROPERTIES PREFIX "lib") set_target_properties(${LIBTARGET} PROPERTIES PREFIX "lib")
ENDIF(MSVC) endif(MSVC)
# #
SET_TARGET_PROPERTIES(${LIBTARGET} set_target_properties(${LIBTARGET}
PROPERTIES PROPERTIES
OUTPUT_NAME "${LIBTARGET}" OUTPUT_NAME "${LIBTARGET}"
ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/thirdparty/lib) ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/thirdparty/lib)

View File

@ -1,28 +1,28 @@
PROJECT(libpng C) project(libpng C)
INCLUDE_DIRECTORIES( include_directories(
"${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}"
${OPENJPEG_SOURCE_DIR}/thirdparty/include ${OPENJPEG_SOURCE_DIR}/thirdparty/include
) )
FILE(GLOB SRCS *.c) file(GLOB SRCS *.c)
FILE(GLOB HDRS *.h) file(GLOB HDRS *.h)
SET(EXT_HDRS set(EXT_HDRS
${OPENJPEG_SOURCE_DIR}/thirdparty/include/zlib.h ${OPENJPEG_SOURCE_DIR}/thirdparty/include/zlib.h
${OPENJPEG_SOURCE_DIR}/thirdparty/include/zconf.h ${OPENJPEG_SOURCE_DIR}/thirdparty/include/zconf.h
) )
# #
SET(LIBTARGET "png") set(LIBTARGET "png")
# #
ADD_LIBRARY(${LIBTARGET} STATIC ${SRCS} ${HDRS} ${EXT_HDRS}) add_library(${LIBTARGET} STATIC ${SRCS} ${HDRS} ${EXT_HDRS})
# #
IF(MSVC) if(MSVC)
SET_TARGET_PROPERTIES(${LIBTARGET} PROPERTIES PREFIX "lib") set_target_properties(${LIBTARGET} PROPERTIES PREFIX "lib")
ENDIF(MSVC) endif(MSVC)
# #
TARGET_LINK_LIBRARIES(${LIBTARGET} ${Z_LIBNAME} ${M_LIBRARY}) target_link_libraries(${LIBTARGET} ${Z_LIBNAME} ${M_LIBRARY})
# #
SET_TARGET_PROPERTIES(${LIBTARGET} set_target_properties(${LIBTARGET}
PROPERTIES PROPERTIES
OUTPUT_NAME "${LIBTARGET}" OUTPUT_NAME "${LIBTARGET}"
ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/thirdparty/lib) ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/thirdparty/lib)

View File

@ -1,12 +1,12 @@
CMAKE_MINIMUM_REQUIRED(VERSION 2.6) cmake_minimum_required(VERSION 2.6)
project(libtiff C) project(libtiff C)
# This convenient copy of libtiff does not support encapsulated zlib or jpeg # This convenient copy of libtiff does not support encapsulated zlib or jpeg
# stream. see ZIP_SUPPORT and JPEG_SUPPORT values # stream. see ZIP_SUPPORT and JPEG_SUPPORT values
INCLUDE_DIRECTORIES(BEFORE "${CMAKE_CURRENT_SOURCE_DIR}") include_directories(BEFORE "${CMAKE_CURRENT_SOURCE_DIR}")
INCLUDE_DIRECTORIES(BEFORE "${CMAKE_CURRENT_BINARY_DIR}") include_directories(BEFORE "${CMAKE_CURRENT_BINARY_DIR}")
SET(TARGET_FILES set(TARGET_FILES
t4.h t4.h
tiffiop.h tiffiop.h
tif_aux.c tif_aux.c
@ -53,16 +53,16 @@ SET(TARGET_FILES
uvcode.h uvcode.h
) )
IF(UNIX) if(UNIX)
SET(TARGET_FILES ${TARGET_FILES} tif_unix.c) set(TARGET_FILES ${TARGET_FILES} tif_unix.c)
# Large file support # Large file support
# This might not catch every possibility catered for by # This might not catch every possibility catered for by
# AC_SYS_LARGEFILE. # AC_SYS_LARGEFILE.
add_definitions(-D_FILE_OFFSET_BITS=64) add_definitions(-D_FILE_OFFSET_BITS=64)
set(_FILE_OFFSET_BITS 64) set(_FILE_OFFSET_BITS 64)
ELSE() else()
SET(TARGET_FILES ${TARGET_FILES} tif_win32.c) set(TARGET_FILES ${TARGET_FILES} tif_win32.c)
ENDIF() endif()
include(${CMAKE_ROOT}/Modules/TestBigEndian.cmake) include(${CMAKE_ROOT}/Modules/TestBigEndian.cmake)
TEST_BIG_ENDIAN(WORDS_BIGENDIAN) TEST_BIG_ENDIAN(WORDS_BIGENDIAN)
@ -151,7 +151,7 @@ int main(void) {
}" HAVE_SNPRINTF) }" HAVE_SNPRINTF)
if(NOT HAVE_SNPRINTF) if(NOT HAVE_SNPRINTF)
SET(TARGET_FILES ${TARGET_FILES} snprintf.c) set(TARGET_FILES ${TARGET_FILES} snprintf.c)
endif() endif()
include(CheckTypeSize) include(CheckTypeSize)
@ -250,28 +250,28 @@ CHECK_SYMBOL_EXISTS(lfind "search.h" HAVE_LFIND)
CHECK_SYMBOL_EXISTS(setmod "io.h" HAVE_SETMODE) CHECK_SYMBOL_EXISTS(setmod "io.h" HAVE_SETMODE)
# http://www.cmake.org/pipermail/cmake/2007-September/016285.html # http://www.cmake.org/pipermail/cmake/2007-September/016285.html
FOREACH(KEYWORD "inline" "__inline__" "__inline") foreach(KEYWORD "inline" "__inline__" "__inline")
IF(NOT DEFINED C_INLINE) if(NOT DEFINED C_INLINE)
TRY_COMPILE(C_HAS_${KEYWORD} "${CMAKE_CURRENT_BINARY_DIR}" try_compile(C_HAS_${KEYWORD} "${CMAKE_CURRENT_BINARY_DIR}"
"${CMAKE_CURRENT_SOURCE_DIR}/test_inline.c" "${CMAKE_CURRENT_SOURCE_DIR}/test_inline.c"
COMPILE_DEFINITIONS "-Dinline=${KEYWORD}") COMPILE_DEFINITIONS "-Dinline=${KEYWORD}")
IF(C_HAS_${KEYWORD}) if(C_HAS_${KEYWORD})
SET(C_INLINE TRUE) set(C_INLINE TRUE)
SET(INLINE_KEYWORD "${KEYWORD}") set(INLINE_KEYWORD "${KEYWORD}")
ENDIF(C_HAS_${KEYWORD}) endif(C_HAS_${KEYWORD})
ENDIF(NOT DEFINED C_INLINE) endif(NOT DEFINED C_INLINE)
ENDFOREACH(KEYWORD) endforeach(KEYWORD)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/tiffconf.h.cmake.in configure_file(${CMAKE_CURRENT_SOURCE_DIR}/tiffconf.h.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/tiffconf.h @ONLY) ${CMAKE_CURRENT_BINARY_DIR}/tiffconf.h @ONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/tif_config.h.cmake.in configure_file(${CMAKE_CURRENT_SOURCE_DIR}/tif_config.h.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/tif_config.h @ONLY) ${CMAKE_CURRENT_BINARY_DIR}/tif_config.h @ONLY)
SET(LIBTARGET "tiff") set(LIBTARGET "tiff")
# #
ADD_LIBRARY(${LIBTARGET} STATIC ${TARGET_FILES}) add_library(${LIBTARGET} STATIC ${TARGET_FILES})
# #
SET_TARGET_PROPERTIES(${LIBTARGET} set_target_properties(${LIBTARGET}
PROPERTIES PROPERTIES
OUTPUT_NAME "${LIBTARGET}" OUTPUT_NAME "${LIBTARGET}"
ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/thirdparty/lib ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/thirdparty/lib

View File

@ -1,14 +1,14 @@
#based on zlib-1.2.5/CMakeLists.txt #based on zlib-1.2.5/CMakeLists.txt
# #
cmake_minimum_required(VERSION 2.6) cmake_minimum_required(VERSION 2.6)
SET(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS ON) set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS ON)
PROJECT(zlib C) project(zlib C)
INCLUDE(CheckTypeSize) include(CheckTypeSize)
INCLUDE(CheckFunctionExists) include(CheckFunctionExists)
INCLUDE(CheckIncludeFile) include(CheckIncludeFile)
INCLUDE(CheckCSourceCompiles) include(CheckCSourceCompiles)
CHECK_INCLUDE_FILE(sys/types.h HAVE_SYS_TYPES_H) CHECK_INCLUDE_FILE(sys/types.h HAVE_SYS_TYPES_H)
CHECK_INCLUDE_FILE(stdint.h HAVE_STDINT_H) CHECK_INCLUDE_FILE(stdint.h HAVE_STDINT_H)
@ -17,47 +17,47 @@ CHECK_INCLUDE_FILE(stddef.h HAVE_STDDEF_H)
# #
# Check to see if we have large file support # Check to see if we have large file support
# #
SET(CMAKE_REQUIRED_DEFINITIONS -D_LARGEFILE64_SOURCE=1) set(CMAKE_REQUIRED_DEFINITIONS -D_LARGEFILE64_SOURCE=1)
# We add these other definitions here because CheckTypeSize.cmake # We add these other definitions here because CheckTypeSize.cmake
# in CMake 2.4.x does not automatically do so and we want # in CMake 2.4.x does not automatically do so and we want
# compatibility with CMake 2.4.x. # compatibility with CMake 2.4.x.
IF(HAVE_SYS_TYPES_H) if(HAVE_SYS_TYPES_H)
LIST(APPEND CMAKE_REQUIRED_DEFINITIONS -DHAVE_SYS_TYPES_H) list(APPEND CMAKE_REQUIRED_DEFINITIONS -DHAVE_SYS_TYPES_H)
ENDIF() endif()
IF(HAVE_STDINT_H) if(HAVE_STDINT_H)
LIST(APPEND CMAKE_REQUIRED_DEFINITIONS -DHAVE_STDINT_H) list(APPEND CMAKE_REQUIRED_DEFINITIONS -DHAVE_STDINT_H)
ENDIF() endif()
IF(HAVE_STDDEF_H) if(HAVE_STDDEF_H)
LIST(APPEND CMAKE_REQUIRED_DEFINITIONS -DHAVE_STDDEF_H) list(APPEND CMAKE_REQUIRED_DEFINITIONS -DHAVE_STDDEF_H)
ENDIF() endif()
CHECK_TYPE_SIZE(off64_t OFF64_T) CHECK_TYPE_SIZE(off64_t OFF64_T)
IF(HAVE_OFF64_T) if(HAVE_OFF64_T)
ADD_DEFINITIONS(-D_LARGEFILE64_SOURCE=1) add_definitions(-D_LARGEFILE64_SOURCE=1)
ENDIF() endif()
SET(CMAKE_REQUIRED_DEFINITIONS) # clear variable set(CMAKE_REQUIRED_DEFINITIONS) # clear variable
# #
# Check for fseeko # Check for fseeko
# #
CHECK_FUNCTION_EXISTS(fseeko HAVE_FSEEKO) CHECK_FUNCTION_EXISTS(fseeko HAVE_FSEEKO)
IF(NOT HAVE_FSEEKO) if(NOT HAVE_FSEEKO)
ADD_DEFINITIONS(-DNO_FSEEKO) add_definitions(-DNO_FSEEKO)
ENDIF() endif()
# #
# Check for unistd.h # Check for unistd.h
# #
CHECK_INCLUDE_FILE(unistd.h Z_HAVE_UNISTD_H) CHECK_INCLUDE_FILE(unistd.h Z_HAVE_UNISTD_H)
INCLUDE_DIRECTORIES( include_directories(
${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}
${OPENJPEG_SOURCE_DIR}/thirdparty/include ${OPENJPEG_SOURCE_DIR}/thirdparty/include
) )
# #
SET(EXT_HDRS set(EXT_HDRS
${OPENJPEG_SOURCE_DIR}/thirdparty/include/zlib.h ${OPENJPEG_SOURCE_DIR}/thirdparty/include/zlib.h
${OPENJPEG_SOURCE_DIR}/thirdparty/include/zconf.h ${OPENJPEG_SOURCE_DIR}/thirdparty/include/zconf.h
) )
SET(HDRS set(HDRS
crc32.h crc32.h
deflate.h deflate.h
gzguts.h gzguts.h
@ -68,7 +68,7 @@ SET(HDRS
trees.h trees.h
zutil.h zutil.h
) )
SET(SRCS set(SRCS
adler32.c adler32.c
compress.c compress.c
crc32.c crc32.c
@ -86,15 +86,15 @@ SET(SRCS
zutil.c zutil.c
) )
SET(LIBTARGET "z") set(LIBTARGET "z")
# #
ADD_LIBRARY(${LIBTARGET} STATIC ${SRCS} ${EXT_HDRS} ${HDRS}) add_library(${LIBTARGET} STATIC ${SRCS} ${EXT_HDRS} ${HDRS})
# #
IF(MSVC) if(MSVC)
SET_TARGET_PROPERTIES(${LIBTARGET} PROPERTIES PREFIX "lib") set_target_properties(${LIBTARGET} PROPERTIES PREFIX "lib")
ENDIF(MSVC) endif(MSVC)
SET_TARGET_PROPERTIES(${LIBTARGET} set_target_properties(${LIBTARGET}
PROPERTIES PROPERTIES
OUTPUT_NAME "${LIBTARGET}" OUTPUT_NAME "${LIBTARGET}"
ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/thirdparty/lib ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/thirdparty/lib