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:
# cmake -DOPENJPEG_SOVERSION:STRING=42 /path/to/openjpeg
if(NOT OPENJPEG_SOVERSION)
SET(OPENJPEG_SOVERSION 7)
set(OPENJPEG_SOVERSION 7)
endif(NOT OPENJPEG_SOVERSION)
set(OPENJPEG_LIBRARY_PROPERTIES
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:
# 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:
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()
#-----------------------------------------------------------------------------

View File

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

View File

@ -5,9 +5,9 @@ include_directories(
${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
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
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(FILES mj2.h
#install(FILES mj2.h
# DESTINATION ${OPENJPEG_INSTALL_INCLUDE_DIR}/${subdir}
# COMPONENT Headers
#)

View File

@ -2,117 +2,117 @@
#------------
# Try to find lib Z
IF(BUILD_THIRDPARTY)
if(BUILD_THIRDPARTY)
# Try to build it
message(STATUS "We will build Z lib from thirdparty")
ADD_SUBDIRECTORY(libz)
SET(Z_LIBNAME z PARENT_SCOPE)
SET(Z_INCLUDE_DIRNAME ${OPENJPEG_SOURCE_DIR}/thirdparty/include PARENT_SCOPE)
SET(ZLIB_FOUND 1)
ELSE (BUILD_THIRDPARTY)
add_subdirectory(libz)
set(Z_LIBNAME z PARENT_SCOPE)
set(Z_INCLUDE_DIRNAME ${OPENJPEG_SOURCE_DIR}/thirdparty/include PARENT_SCOPE)
set(ZLIB_FOUND 1)
else(BUILD_THIRDPARTY)
# Try to find lib Z
FIND_PACKAGE(ZLIB)
IF(ZLIB_FOUND)
SET(Z_LIBNAME ${ZLIB_LIBRARIES} PARENT_SCOPE)
SET(Z_INCLUDE_DIRNAME ${ZLIB_INCLUDE_DIRS} PARENT_SCOPE)
find_package(ZLIB)
if(ZLIB_FOUND)
set(Z_LIBNAME ${ZLIB_LIBRARIES} 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 "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)")
ENDIF(ZLIB_FOUND)
ENDIF(BUILD_THIRDPARTY)
endif(ZLIB_FOUND)
endif(BUILD_THIRDPARTY)
#------------
# Try to find lib PNG (which depends on zlib)
IF(BUILD_THIRDPARTY)
if(BUILD_THIRDPARTY)
# Try to build it
message(STATUS "We will build PNG lib from thirdparty")
ADD_SUBDIRECTORY(libpng)
SET(OPJ_HAVE_PNG_H 1 PARENT_SCOPE)
SET(OPJ_HAVE_LIBPNG 1 PARENT_SCOPE)
SET(PNG_LIBNAME png PARENT_SCOPE)
SET(PNG_INCLUDE_DIRNAME ${OPENJPEG_SOURCE_DIR}/thirdparty/libpng PARENT_SCOPE)
ELSE (BUILD_THIRDPARTY)
IF (ZLIB_FOUND)
FIND_PACKAGE(PNG)
IF(PNG_FOUND)
add_subdirectory(libpng)
set(OPJ_HAVE_PNG_H 1 PARENT_SCOPE)
set(OPJ_HAVE_LIBPNG 1 PARENT_SCOPE)
set(PNG_LIBNAME png PARENT_SCOPE)
set(PNG_INCLUDE_DIRNAME ${OPENJPEG_SOURCE_DIR}/thirdparty/libpng PARENT_SCOPE)
else(BUILD_THIRDPARTY)
if(ZLIB_FOUND)
find_package(PNG)
if(PNG_FOUND)
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_LIBPNG 1 PARENT_SCOPE)
SET(PNG_LIBNAME ${PNG_LIBRARIES} PARENT_SCOPE)
SET(PNG_INCLUDE_DIRNAME ${PNG_PNG_INCLUDE_DIR} PARENT_SCOPE)
ELSE(PNG_FOUND) # not found
SET(OPJ_HAVE_PNG_H 0 PARENT_SCOPE)
SET(OPJ_HAVE_LIBPNG 0 PARENT_SCOPE)
set(OPJ_HAVE_PNG_H 1 PARENT_SCOPE)
set(OPJ_HAVE_LIBPNG 1 PARENT_SCOPE)
set(PNG_LIBNAME ${PNG_LIBRARIES} PARENT_SCOPE)
set(PNG_INCLUDE_DIRNAME ${PNG_PNG_INCLUDE_DIR} PARENT_SCOPE)
else(PNG_FOUND) # not found
set(OPJ_HAVE_PNG_H 0 PARENT_SCOPE)
set(OPJ_HAVE_LIBPNG 0 PARENT_SCOPE)
message(STATUS "PNG lib not found, activate BUILD_THIRDPARTY if you want build it")
ENDIF(PNG_FOUND)
ENDIF (ZLIB_FOUND)
ENDIF(BUILD_THIRDPARTY)
endif(PNG_FOUND)
endif(ZLIB_FOUND)
endif(BUILD_THIRDPARTY)
#------------
# Try to find lib TIFF
IF(BUILD_THIRDPARTY)
if(BUILD_THIRDPARTY)
# Try to build it
message(STATUS "We will build TIFF lib from thirdparty")
ADD_SUBDIRECTORY(libtiff)
SET(TIFF_LIBNAME tiff PARENT_SCOPE)
SET(TIFF_INCLUDE_DIRNAME
add_subdirectory(libtiff)
set(TIFF_LIBNAME tiff PARENT_SCOPE)
set(TIFF_INCLUDE_DIRNAME
${OPENJPEG_SOURCE_DIR}/thirdparty/libtiff
${OPENJPEG_BINARY_DIR}/thirdparty/libtiff
PARENT_SCOPE)
SET(OPJ_HAVE_TIFF_H 1 PARENT_SCOPE)
SET(OPJ_HAVE_LIBTIFF 1 PARENT_SCOPE)
ELSE (BUILD_THIRDPARTY)
FIND_PACKAGE(TIFF)
IF(TIFF_FOUND)
set(OPJ_HAVE_TIFF_H 1 PARENT_SCOPE)
set(OPJ_HAVE_LIBTIFF 1 PARENT_SCOPE)
else(BUILD_THIRDPARTY)
find_package(TIFF)
if(TIFF_FOUND)
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_LIBTIFF 1 PARENT_SCOPE)
SET(TIFF_LIBNAME ${TIFF_LIBRARIES} PARENT_SCOPE)
SET(TIFF_INCLUDE_DIRNAME ${TIFF_INCLUDE_DIR} PARENT_SCOPE)
ELSE (TIFF_FOUND) # not found
SET(OPJ_HAVE_TIFF_H 0 PARENT_SCOPE)
SET(OPJ_HAVE_LIBTIFF 0 PARENT_SCOPE)
set(OPJ_HAVE_TIFF_H 1 PARENT_SCOPE)
set(OPJ_HAVE_LIBTIFF 1 PARENT_SCOPE)
set(TIFF_LIBNAME ${TIFF_LIBRARIES} PARENT_SCOPE)
set(TIFF_INCLUDE_DIRNAME ${TIFF_INCLUDE_DIR} PARENT_SCOPE)
else(TIFF_FOUND) # not found
set(OPJ_HAVE_TIFF_H 0 PARENT_SCOPE)
set(OPJ_HAVE_LIBTIFF 0 PARENT_SCOPE)
message(STATUS "TIFF lib not found, activate BUILD_THIRDPARTY if you want build it")
ENDIF(TIFF_FOUND)
ENDIF(BUILD_THIRDPARTY)
endif(TIFF_FOUND)
endif(BUILD_THIRDPARTY)
#------------
# Try to find lib LCMS2 (or by default LCMS)
SET(OPJ_HAVE_LCMS_H 0 PARENT_SCOPE)
SET(OPJ_HAVE_LIBLCMS 0 PARENT_SCOPE)
set(OPJ_HAVE_LCMS_H 0 PARENT_SCOPE)
set(OPJ_HAVE_LIBLCMS 0 PARENT_SCOPE)
IF( BUILD_THIRDPARTY)
if( BUILD_THIRDPARTY)
# Try to build lcms2
message(STATUS "We will build LCMS2 lib from thirdparty")
ADD_SUBDIRECTORY(liblcms2)
SET(LCMS_LIBNAME lcms2 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_LIBLCMS2 1 PARENT_SCOPE)
ELSE (BUILD_THIRDPARTY)
FIND_PACKAGE(LCMS2)
IF(LCMS2_FOUND)
add_subdirectory(liblcms2)
set(LCMS_LIBNAME lcms2 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_LIBLCMS2 1 PARENT_SCOPE)
else(BUILD_THIRDPARTY)
find_package(LCMS2)
if(LCMS2_FOUND)
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_LIBLCMS2 1 PARENT_SCOPE)
SET(LCMS_LIBNAME ${LCMS2_LIBRARIES} PARENT_SCOPE)
SET(LCMS_INCLUDE_DIRNAME ${LCMS2_INCLUDE_DIRS} PARENT_SCOPE)
ELSE (LCMS2_FOUND) # not found lcms2
set(OPJ_HAVE_LCMS2_H 1 PARENT_SCOPE)
set(OPJ_HAVE_LIBLCMS2 1 PARENT_SCOPE)
set(LCMS_LIBNAME ${LCMS2_LIBRARIES} PARENT_SCOPE)
set(LCMS_INCLUDE_DIRNAME ${LCMS2_INCLUDE_DIRS} PARENT_SCOPE)
else(LCMS2_FOUND) # not found lcms2
# try to find LCMS
FIND_PACKAGE(LCMS)
IF(LCMS_FOUND)
find_package(LCMS)
if(LCMS_FOUND)
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_LIBLCMS 1 PARENT_SCOPE)
SET(LCMS_LIBNAME ${LCMS_LIBRARIES} PARENT_SCOPE)
SET(LCMS_INCLUDE_DIRNAME ${LCMS_INCLUDE_DIRS} PARENT_SCOPE)
ELSE (LCMS_FOUND) # not found lcms
SET(OPJ_HAVE_LCMS2_H 0 PARENT_SCOPE)
SET(OPJ_HAVE_LIBLCMS2 0 PARENT_SCOPE)
set(OPJ_HAVE_LCMS_H 1 PARENT_SCOPE)
set(OPJ_HAVE_LIBLCMS 1 PARENT_SCOPE)
set(LCMS_LIBNAME ${LCMS_LIBRARIES} PARENT_SCOPE)
set(LCMS_INCLUDE_DIRNAME ${LCMS_INCLUDE_DIRS} PARENT_SCOPE)
else(LCMS_FOUND) # not found lcms
set(OPJ_HAVE_LCMS2_H 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")
ENDIF (LCMS_FOUND)
ENDIF(LCMS2_FOUND)
ENDIF(BUILD_THIRDPARTY)
endif(LCMS_FOUND)
endif(LCMS2_FOUND)
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 HDRS include/*.h)
file(GLOB SRCS src/*.c)
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)
SET_TARGET_PROPERTIES(${LIBTARGET} PROPERTIES PREFIX "lib")
ENDIF(MSVC)
if(MSVC)
set_target_properties(${LIBTARGET} PROPERTIES PREFIX "lib")
endif(MSVC)
#
SET_TARGET_PROPERTIES(${LIBTARGET}
set_target_properties(${LIBTARGET}
PROPERTIES
OUTPUT_NAME "${LIBTARGET}"
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}"
${OPENJPEG_SOURCE_DIR}/thirdparty/include
)
FILE(GLOB SRCS *.c)
FILE(GLOB HDRS *.h)
SET(EXT_HDRS
file(GLOB SRCS *.c)
file(GLOB HDRS *.h)
set(EXT_HDRS
${OPENJPEG_SOURCE_DIR}/thirdparty/include/zlib.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)
SET_TARGET_PROPERTIES(${LIBTARGET} PROPERTIES PREFIX "lib")
ENDIF(MSVC)
if(MSVC)
set_target_properties(${LIBTARGET} PROPERTIES PREFIX "lib")
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
OUTPUT_NAME "${LIBTARGET}"
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)
# This convenient copy of libtiff does not support encapsulated zlib or jpeg
# stream. see ZIP_SUPPORT and JPEG_SUPPORT values
INCLUDE_DIRECTORIES(BEFORE "${CMAKE_CURRENT_SOURCE_DIR}")
INCLUDE_DIRECTORIES(BEFORE "${CMAKE_CURRENT_BINARY_DIR}")
include_directories(BEFORE "${CMAKE_CURRENT_SOURCE_DIR}")
include_directories(BEFORE "${CMAKE_CURRENT_BINARY_DIR}")
SET(TARGET_FILES
set(TARGET_FILES
t4.h
tiffiop.h
tif_aux.c
@ -53,16 +53,16 @@ SET(TARGET_FILES
uvcode.h
)
IF(UNIX)
SET(TARGET_FILES ${TARGET_FILES} tif_unix.c)
if(UNIX)
set(TARGET_FILES ${TARGET_FILES} tif_unix.c)
# Large file support
# This might not catch every possibility catered for by
# AC_SYS_LARGEFILE.
add_definitions(-D_FILE_OFFSET_BITS=64)
set(_FILE_OFFSET_BITS 64)
ELSE()
SET(TARGET_FILES ${TARGET_FILES} tif_win32.c)
ENDIF()
else()
set(TARGET_FILES ${TARGET_FILES} tif_win32.c)
endif()
include(${CMAKE_ROOT}/Modules/TestBigEndian.cmake)
TEST_BIG_ENDIAN(WORDS_BIGENDIAN)
@ -151,7 +151,7 @@ int main(void) {
}" HAVE_SNPRINTF)
if(NOT HAVE_SNPRINTF)
SET(TARGET_FILES ${TARGET_FILES} snprintf.c)
set(TARGET_FILES ${TARGET_FILES} snprintf.c)
endif()
include(CheckTypeSize)
@ -250,28 +250,28 @@ CHECK_SYMBOL_EXISTS(lfind "search.h" HAVE_LFIND)
CHECK_SYMBOL_EXISTS(setmod "io.h" HAVE_SETMODE)
# http://www.cmake.org/pipermail/cmake/2007-September/016285.html
FOREACH(KEYWORD "inline" "__inline__" "__inline")
IF(NOT DEFINED C_INLINE)
TRY_COMPILE(C_HAS_${KEYWORD} "${CMAKE_CURRENT_BINARY_DIR}"
foreach(KEYWORD "inline" "__inline__" "__inline")
if(NOT DEFINED C_INLINE)
try_compile(C_HAS_${KEYWORD} "${CMAKE_CURRENT_BINARY_DIR}"
"${CMAKE_CURRENT_SOURCE_DIR}/test_inline.c"
COMPILE_DEFINITIONS "-Dinline=${KEYWORD}")
IF(C_HAS_${KEYWORD})
SET(C_INLINE TRUE)
SET(INLINE_KEYWORD "${KEYWORD}")
ENDIF(C_HAS_${KEYWORD})
ENDIF(NOT DEFINED C_INLINE)
ENDFOREACH(KEYWORD)
if(C_HAS_${KEYWORD})
set(C_INLINE TRUE)
set(INLINE_KEYWORD "${KEYWORD}")
endif(C_HAS_${KEYWORD})
endif(NOT DEFINED C_INLINE)
endforeach(KEYWORD)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/tiffconf.h.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/tiffconf.h @ONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/tif_config.h.cmake.in
${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
OUTPUT_NAME "${LIBTARGET}"
ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/thirdparty/lib

View File

@ -1,14 +1,14 @@
#based on zlib-1.2.5/CMakeLists.txt
#
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(CheckFunctionExists)
INCLUDE(CheckIncludeFile)
INCLUDE(CheckCSourceCompiles)
include(CheckTypeSize)
include(CheckFunctionExists)
include(CheckIncludeFile)
include(CheckCSourceCompiles)
CHECK_INCLUDE_FILE(sys/types.h HAVE_SYS_TYPES_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
#
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
# in CMake 2.4.x does not automatically do so and we want
# compatibility with CMake 2.4.x.
IF(HAVE_SYS_TYPES_H)
LIST(APPEND CMAKE_REQUIRED_DEFINITIONS -DHAVE_SYS_TYPES_H)
ENDIF()
IF(HAVE_STDINT_H)
LIST(APPEND CMAKE_REQUIRED_DEFINITIONS -DHAVE_STDINT_H)
ENDIF()
IF(HAVE_STDDEF_H)
LIST(APPEND CMAKE_REQUIRED_DEFINITIONS -DHAVE_STDDEF_H)
ENDIF()
if(HAVE_SYS_TYPES_H)
list(APPEND CMAKE_REQUIRED_DEFINITIONS -DHAVE_SYS_TYPES_H)
endif()
if(HAVE_STDINT_H)
list(APPEND CMAKE_REQUIRED_DEFINITIONS -DHAVE_STDINT_H)
endif()
if(HAVE_STDDEF_H)
list(APPEND CMAKE_REQUIRED_DEFINITIONS -DHAVE_STDDEF_H)
endif()
CHECK_TYPE_SIZE(off64_t OFF64_T)
IF(HAVE_OFF64_T)
ADD_DEFINITIONS(-D_LARGEFILE64_SOURCE=1)
ENDIF()
SET(CMAKE_REQUIRED_DEFINITIONS) # clear variable
if(HAVE_OFF64_T)
add_definitions(-D_LARGEFILE64_SOURCE=1)
endif()
set(CMAKE_REQUIRED_DEFINITIONS) # clear variable
#
# Check for fseeko
#
CHECK_FUNCTION_EXISTS(fseeko HAVE_FSEEKO)
IF(NOT HAVE_FSEEKO)
ADD_DEFINITIONS(-DNO_FSEEKO)
ENDIF()
if(NOT HAVE_FSEEKO)
add_definitions(-DNO_FSEEKO)
endif()
#
# Check for unistd.h
#
CHECK_INCLUDE_FILE(unistd.h Z_HAVE_UNISTD_H)
INCLUDE_DIRECTORIES(
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}
${OPENJPEG_SOURCE_DIR}/thirdparty/include
)
#
SET(EXT_HDRS
set(EXT_HDRS
${OPENJPEG_SOURCE_DIR}/thirdparty/include/zlib.h
${OPENJPEG_SOURCE_DIR}/thirdparty/include/zconf.h
)
SET(HDRS
set(HDRS
crc32.h
deflate.h
gzguts.h
@ -68,7 +68,7 @@ SET(HDRS
trees.h
zutil.h
)
SET(SRCS
set(SRCS
adler32.c
compress.c
crc32.c
@ -86,15 +86,15 @@ SET(SRCS
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)
SET_TARGET_PROPERTIES(${LIBTARGET} PROPERTIES PREFIX "lib")
ENDIF(MSVC)
if(MSVC)
set_target_properties(${LIBTARGET} PROPERTIES PREFIX "lib")
endif(MSVC)
SET_TARGET_PROPERTIES(${LIBTARGET}
set_target_properties(${LIBTARGET}
PROPERTIES
OUTPUT_NAME "${LIBTARGET}"
ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/thirdparty/lib