[master] CMakeLists.txt updated with bugfixes and improvements
This commit is contained in:
parent
a21c94e3dc
commit
f6ce318061
5
ANNOUNCE
5
ANNOUNCE
@ -1,5 +1,5 @@
|
|||||||
|
|
||||||
Libpng 1.2.40beta02 - August 22, 2009
|
Libpng 1.2.40beta02 - August 27, 2009
|
||||||
|
|
||||||
This is not intended to be a public release. It will be replaced
|
This is not intended to be a public release. It will be replaced
|
||||||
within a few weeks by a public version or by another test version.
|
within a few weeks by a public version or by another test version.
|
||||||
@ -46,7 +46,8 @@ version 1.2.40beta01 [August 20, 2009]
|
|||||||
Removed an extra png_debug() recently added to png_write_find_filter().
|
Removed an extra png_debug() recently added to png_write_find_filter().
|
||||||
Fixed incorrect #ifdef in pngset.c regarding unknown chunk support.
|
Fixed incorrect #ifdef in pngset.c regarding unknown chunk support.
|
||||||
|
|
||||||
version 1.2.40beta02 [August 22, 2009]
|
version 1.2.40beta02 [August 27, 2009]
|
||||||
|
Various bugfixes and improvements to CMakeLists.txt (Philip Lowman)
|
||||||
|
|
||||||
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
|
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
|
||||||
|
|
||||||
|
3
CHANGES
3
CHANGES
@ -2463,7 +2463,8 @@ version 1.2.40beta01 [August 20, 2009]
|
|||||||
Removed an extra png_debug() recently added to png_write_find_filter().
|
Removed an extra png_debug() recently added to png_write_find_filter().
|
||||||
Fixed incorrect #ifdef in pngset.c regarding unknown chunk support.
|
Fixed incorrect #ifdef in pngset.c regarding unknown chunk support.
|
||||||
|
|
||||||
version 1.2.40beta02 [August 22, 2009]
|
version 1.2.40beta02 [August 27, 2009]
|
||||||
|
Various bugfixes and improvements to CMakeLists.txt (Philip Lowman)
|
||||||
|
|
||||||
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
|
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
|
||||||
(subscription required; visit
|
(subscription required; visit
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
|
project(PNG C)
|
||||||
project(PNG)
|
cmake_minimum_required(VERSION 2.4.3)
|
||||||
|
|
||||||
# Copyright (C) 2007 Glenn Randers-Pehrson
|
# Copyright (C) 2007 Glenn Randers-Pehrson
|
||||||
|
|
||||||
@ -13,8 +13,12 @@ set(PNGLIB_RELEASE 40)
|
|||||||
set(PNGLIB_NAME libpng${PNGLIB_MAJOR}${PNGLIB_MINOR})
|
set(PNGLIB_NAME libpng${PNGLIB_MAJOR}${PNGLIB_MINOR})
|
||||||
set(PNGLIB_VERSION ${PNGLIB_MAJOR}.${PNGLIB_MINOR}.${PNGLIB_RELEASE})
|
set(PNGLIB_VERSION ${PNGLIB_MAJOR}.${PNGLIB_MINOR}.${PNGLIB_RELEASE})
|
||||||
|
|
||||||
|
set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS true)
|
||||||
|
|
||||||
# needed packages
|
# needed packages
|
||||||
find_package(ZLIB REQUIRED)
|
find_package(ZLIB REQUIRED)
|
||||||
|
include_directories(${ZLIB_INCLUDE_DIR})
|
||||||
|
|
||||||
if(NOT WIN32)
|
if(NOT WIN32)
|
||||||
find_library(M_LIBRARY
|
find_library(M_LIBRARY
|
||||||
NAMES m
|
NAMES m
|
||||||
@ -23,24 +27,33 @@ if(NOT WIN32)
|
|||||||
if(NOT M_LIBRARY)
|
if(NOT M_LIBRARY)
|
||||||
message(STATUS
|
message(STATUS
|
||||||
"math library 'libm' not found - floating point support disabled")
|
"math library 'libm' not found - floating point support disabled")
|
||||||
endif(NOT M_LIBRARY)
|
endif()
|
||||||
else(NOT WIN32)
|
else()
|
||||||
# not needed on windows
|
# not needed on windows
|
||||||
set(M_LIBRARY "")
|
set(M_LIBRARY "")
|
||||||
endif(NOT WIN32)
|
endif()
|
||||||
|
|
||||||
|
|
||||||
# COMMAND LINE OPTIONS
|
# COMMAND LINE OPTIONS
|
||||||
option(PNG_SHARED "Build shared lib" YES)
|
if(DEFINED PNG_SHARED)
|
||||||
option(PNG_STATIC "Build static lib" YES)
|
option(PNG_SHARED "Build shared lib" ${PNG_SHARED})
|
||||||
|
else()
|
||||||
|
option(PNG_SHARED "Build shared lib" ON)
|
||||||
|
endif()
|
||||||
|
if(DEFINED PNG_STATIC)
|
||||||
|
option(PNG_STATIC "Build static lib" ${PNG_STATIC})
|
||||||
|
else()
|
||||||
|
option(PNG_STATIC "Build static lib" ON)
|
||||||
|
endif()
|
||||||
|
|
||||||
if(MINGW)
|
if(MINGW)
|
||||||
option(PNG_TESTS "Build pngtest" NO)
|
option(PNG_TESTS "Build pngtest" NO)
|
||||||
else(MINGW)
|
else(MINGW)
|
||||||
option(PNG_TESTS "Build pngtest" YES)
|
option(PNG_TESTS "Build pngtest" YES)
|
||||||
endif(MINGW)
|
endif(MINGW)
|
||||||
|
|
||||||
option(PNG_NO_CONSOLE_IO "FIXME" YES)
|
option(PNG_NO_CONSOLE_IO "FIXME" YES)
|
||||||
option(PNG_NO_STDIO "FIXME" YES)
|
option(PNG_NO_STDIO "FIXME" YES)
|
||||||
option(PNG_DEBUG "Build with debug output" YES)
|
option(PNG_DEBUG "Build with debug output" NO)
|
||||||
option(PNGARG "FIXME" YES)
|
option(PNGARG "FIXME" YES)
|
||||||
#TODO:
|
#TODO:
|
||||||
# PNG_CONSOLE_IO_SUPPORTED
|
# PNG_CONSOLE_IO_SUPPORTED
|
||||||
@ -57,20 +70,16 @@ if(NOT WIN32)
|
|||||||
set(png_asm_tmp "OFF")
|
set(png_asm_tmp "OFF")
|
||||||
endif("uname_output" MATCHES "^.*i[1-9]86.*$")
|
endif("uname_output" MATCHES "^.*i[1-9]86.*$")
|
||||||
endif(uname_executable)
|
endif(uname_executable)
|
||||||
else(NOT WIN32)
|
else()
|
||||||
# this env var is normally only set on win64
|
# this env var is normally only set on win64
|
||||||
SET(TEXT "ProgramFiles(x86)")
|
SET(TEXT "ProgramFiles(x86)")
|
||||||
if("$ENV{${TEXT}}" STREQUAL "")
|
if("$ENV{${TEXT}}" STREQUAL "")
|
||||||
set(png_asm_tmp "ON")
|
set(png_asm_tmp "ON")
|
||||||
endif("$ENV{${TEXT}}" STREQUAL "")
|
endif("$ENV{${TEXT}}" STREQUAL "")
|
||||||
endif(NOT WIN32)
|
endif()
|
||||||
|
|
||||||
# SET LIBNAME
|
# SET LIBNAME
|
||||||
# msvc does not append 'lib' - do it here to have consistent name
|
set(PNG_LIB_NAME png${PNGLIB_MAJOR}${PNGLIB_MINOR})
|
||||||
if(MSVC)
|
|
||||||
set(PNG_LIB_NAME lib)
|
|
||||||
endif(MSVC)
|
|
||||||
set(PNG_LIB_NAME ${PNG_LIB_NAME}png${PNGLIB_MAJOR}${PNGLIB_MINOR})
|
|
||||||
|
|
||||||
# to distinguish between debug and release lib
|
# to distinguish between debug and release lib
|
||||||
set(CMAKE_DEBUG_POSTFIX "d")
|
set(CMAKE_DEBUG_POSTFIX "d")
|
||||||
@ -104,54 +113,67 @@ if(MSVC)
|
|||||||
add_definitions(-DPNG_NO_MODULEDEF -D_CRT_SECURE_NO_DEPRECATE)
|
add_definitions(-DPNG_NO_MODULEDEF -D_CRT_SECURE_NO_DEPRECATE)
|
||||||
endif(MSVC)
|
endif(MSVC)
|
||||||
|
|
||||||
add_definitions(-DZLIB_DLL)
|
if(PNG_SHARED OR NOT MSVC)
|
||||||
|
#if building msvc static this has NOT do be defined
|
||||||
|
add_definitions(-DZLIB_DLL)
|
||||||
|
endif()
|
||||||
|
|
||||||
add_definitions(-DLIBPNG_NO_MMX)
|
add_definitions(-DLIBPNG_NO_MMX)
|
||||||
add_definitions(-DPNG_NO_MMX_CODE)
|
add_definitions(-DPNG_NO_MMX_CODE)
|
||||||
|
|
||||||
if(PNG_CONSOLE_IO_SUPPORTED)
|
if(PNG_CONSOLE_IO_SUPPORTED)
|
||||||
add_definitions(-DPNG_CONSOLE_IO_SUPPORTED)
|
add_definitions(-DPNG_CONSOLE_IO_SUPPORTED)
|
||||||
endif(PNG_CONSOLE_IO_SUPPORTED)
|
endif()
|
||||||
|
|
||||||
if(PNG_NO_CONSOLE_IO)
|
if(PNG_NO_CONSOLE_IO)
|
||||||
add_definitions(-DPNG_NO_CONSOLE_IO)
|
add_definitions(-DPNG_NO_CONSOLE_IO)
|
||||||
endif(PNG_NO_CONSOLE_IO)
|
endif()
|
||||||
|
|
||||||
if(PNG_NO_STDIO)
|
if(PNG_NO_STDIO)
|
||||||
add_definitions(-DPNG_NO_STDIO)
|
add_definitions(-DPNG_NO_STDIO)
|
||||||
endif(PNG_NO_STDIO)
|
endif()
|
||||||
|
|
||||||
if(PNG_DEBUG)
|
if(PNG_DEBUG)
|
||||||
add_definitions(-DPNG_DEBUG)
|
add_definitions(-DPNG_DEBUG)
|
||||||
endif(PNG_DEBUG)
|
endif()
|
||||||
|
|
||||||
if(NOT M_LIBRARY AND NOT WIN32)
|
if(NOT M_LIBRARY AND NOT WIN32)
|
||||||
add_definitions(-DPNG_NO_FLOATING_POINT_SUPPORTED)
|
add_definitions(-DPNG_NO_FLOATING_POINT_SUPPORTED)
|
||||||
endif(NOT M_LIBRARY AND NOT WIN32)
|
endif()
|
||||||
|
|
||||||
# NOW BUILD OUR TARGET
|
# NOW BUILD OUR TARGET
|
||||||
include_directories(${PNG_SOURCE_DIR} ${ZLIB_INCLUDE_DIR})
|
include_directories(${PNG_SOURCE_DIR} ${ZLIB_INCLUDE_DIR})
|
||||||
|
|
||||||
if(PNG_SHARED)
|
if(PNG_SHARED)
|
||||||
add_library(${PNG_LIB_NAME} SHARED ${libpng_sources})
|
add_library(${PNG_LIB_NAME} SHARED ${libpng_sources})
|
||||||
|
if(MSVC)
|
||||||
|
# msvc does not append 'lib' - do it here to have consistent name
|
||||||
|
set_target_properties(${PNG_LIB_NAME} PROPERTIES PREFIX "lib")
|
||||||
|
endif()
|
||||||
target_link_libraries(${PNG_LIB_NAME} ${ZLIB_LIBRARY} ${M_LIBRARY})
|
target_link_libraries(${PNG_LIB_NAME} ${ZLIB_LIBRARY} ${M_LIBRARY})
|
||||||
endif(PNG_SHARED)
|
endif()
|
||||||
|
|
||||||
if(PNG_STATIC)
|
if(PNG_STATIC)
|
||||||
# does not work without changing name
|
# does not work without changing name
|
||||||
set(PNG_LIB_NAME_STATIC ${PNG_LIB_NAME}_static)
|
set(PNG_LIB_NAME_STATIC ${PNG_LIB_NAME}_static)
|
||||||
add_library(${PNG_LIB_NAME_STATIC} STATIC ${libpng_sources})
|
add_library(${PNG_LIB_NAME_STATIC} STATIC ${libpng_sources})
|
||||||
endif(PNG_STATIC)
|
if(MSVC)
|
||||||
|
# msvc does not append 'lib' - do it here to have consistent name
|
||||||
|
set_target_properties(${PNG_LIB_NAME_STATIC} PROPERTIES PREFIX "lib")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
|
||||||
if(PNG_SHARED AND WIN32)
|
if(PNG_SHARED AND WIN32)
|
||||||
set_target_properties(${PNG_LIB_NAME} PROPERTIES DEFINE_SYMBOL PNG_BUILD_DLL)
|
set_target_properties(${PNG_LIB_NAME} PROPERTIES DEFINE_SYMBOL PNG_BUILD_DLL)
|
||||||
endif(PNG_SHARED AND WIN32)
|
endif()
|
||||||
|
|
||||||
if(PNG_TESTS)
|
if(PNG_TESTS AND PNG_SHARED)
|
||||||
# does not work with msvc due to png_lib_ver issue
|
# does not work with msvc due to png_lib_ver issue
|
||||||
add_executable(pngtest ${pngtest_sources})
|
add_executable(pngtest ${pngtest_sources})
|
||||||
target_link_libraries(pngtest ${PNG_LIB_NAME})
|
target_link_libraries(pngtest ${PNG_LIB_NAME})
|
||||||
# add_test(pngtest ${PNG_SOURCE_DIR}/pngtest.png)
|
# add_test(pngtest ${PNG_SOURCE_DIR}/pngtest.png)
|
||||||
endif(PNG_TESTS)
|
endif()
|
||||||
|
|
||||||
|
|
||||||
# CREATE PKGCONFIG FILES
|
# CREATE PKGCONFIG FILES
|
||||||
@ -171,30 +193,49 @@ configure_file(${PNG_SOURCE_DIR}/scripts/libpng-config.in
|
|||||||
${PNG_BINARY_DIR}/${PNGLIB_NAME}-config)
|
${PNG_BINARY_DIR}/${PNGLIB_NAME}-config)
|
||||||
|
|
||||||
# SET UP LINKS
|
# SET UP LINKS
|
||||||
set_target_properties(${PNG_LIB_NAME} PROPERTIES
|
if(PNG_SHARED)
|
||||||
|
set_target_properties(${PNG_LIB_NAME} PROPERTIES
|
||||||
# VERSION 0.${PNGLIB_RELEASE}.1.2.40beta02
|
# VERSION 0.${PNGLIB_RELEASE}.1.2.40beta02
|
||||||
VERSION 0.${PNGLIB_RELEASE}.0
|
VERSION 0.${PNGLIB_RELEASE}.0
|
||||||
SOVERSION 0
|
SOVERSION 0
|
||||||
CLEAN_DIRECT_OUTPUT 1)
|
CLEAN_DIRECT_OUTPUT 1)
|
||||||
if(NOT WIN32)
|
endif()
|
||||||
# that's uncool on win32 - it overwrites our static import lib...
|
|
||||||
set_target_properties(${PNG_LIB_NAME_STATIC} PROPERTIES
|
|
||||||
OUTPUT_NAME ${PNG_LIB_NAME}
|
|
||||||
CLEAN_DIRECT_OUTPUT 1)
|
|
||||||
endif(NOT WIN32)
|
|
||||||
# INSTALL
|
|
||||||
install_targets(/lib ${PNG_LIB_NAME})
|
|
||||||
if(PNG_STATIC)
|
if(PNG_STATIC)
|
||||||
install_targets(/lib ${PNG_LIB_NAME_STATIC})
|
if(NOT WIN32)
|
||||||
endif(PNG_STATIC)
|
# that's uncool on win32 - it overwrites our static import lib...
|
||||||
|
set_target_properties(${PNG_LIB_NAME_STATIC} PROPERTIES
|
||||||
|
OUTPUT_NAME ${PNG_LIB_NAME}
|
||||||
|
CLEAN_DIRECT_OUTPUT 1)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# INSTALL
|
||||||
|
if(NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL )
|
||||||
|
if(PNG_SHARED)
|
||||||
|
install(TARGETS ${PNG_LIB_NAME}
|
||||||
|
RUNTIME DESTINATION bin
|
||||||
|
LIBRARY DESTINATION lib
|
||||||
|
ARCHIVE DESTINATION lib)
|
||||||
|
endif()
|
||||||
|
if(PNG_STATIC)
|
||||||
|
install(TARGETS ${PNG_LIB_NAME_STATIC}
|
||||||
|
LIBRARY DESTINATION lib
|
||||||
|
ARCHIVE DESTINATION lib)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(NOT SKIP_INSTALL_HEADERS AND NOT SKIP_INSTALL_ALL )
|
||||||
install(FILES png.h pngconf.h DESTINATION include)
|
install(FILES png.h pngconf.h DESTINATION include)
|
||||||
install(FILES png.h pngconf.h DESTINATION include/${PNGLIB_NAME})
|
install(FILES png.h pngconf.h DESTINATION include/${PNGLIB_NAME})
|
||||||
install(FILES libpng.3 libpngpf.3 DESTINATION man/man3)
|
endif()
|
||||||
install(FILES png.5 DESTINATION man/man5)
|
if(NOT SKIP_INSTALL_FILES AND NOT SKIP_INSTALL_ALL )
|
||||||
install(FILES ${PNG_BINARY_DIR}/libpng.pc DESTINATION lib/pkgconfig)
|
install(FILES libpng.3 libpngpf.3 DESTINATION man/man3)
|
||||||
install(FILES ${PNG_BINARY_DIR}/libpng-config DESTINATION bin)
|
install(FILES png.5 DESTINATION man/man5)
|
||||||
install(FILES ${PNG_BINARY_DIR}/${PNGLIB_NAME}.pc DESTINATION lib/pkgconfig)
|
install(FILES ${PNG_BINARY_DIR}/libpng.pc DESTINATION lib/pkgconfig)
|
||||||
install(FILES ${PNG_BINARY_DIR}/${PNGLIB_NAME}-config DESTINATION bin)
|
install(FILES ${PNG_BINARY_DIR}/libpng-config DESTINATION bin)
|
||||||
|
install(FILES ${PNG_BINARY_DIR}/${PNGLIB_NAME}.pc DESTINATION lib/pkgconfig)
|
||||||
|
install(FILES ${PNG_BINARY_DIR}/${PNGLIB_NAME}-config DESTINATION bin)
|
||||||
|
endif()
|
||||||
|
|
||||||
# what's with libpng.txt and all the extra files?
|
# what's with libpng.txt and all the extra files?
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user