mirror of
https://git.code.sf.net/p/libpng/code.git
synced 2025-07-10 18:04:09 +02:00
[libpng15] Revised CMakeLists.txt to work with mingw and removed some material
from CMakeLists.txt that is no longer useful in libpng-1.5.
This commit is contained in:
parent
8e25a61277
commit
e29c4b9b93
2
ANNOUNCE
2
ANNOUNCE
@ -49,6 +49,8 @@ Version 1.5.6beta03 [September 27, 2011]
|
|||||||
Revised test-pngtest.sh to report FAIL when pngtest fails.
|
Revised test-pngtest.sh to report FAIL when pngtest fails.
|
||||||
Added "--strict" option to pngtest, to report FAIL when the failure is
|
Added "--strict" option to pngtest, to report FAIL when the failure is
|
||||||
only because the resulting valid files are different.
|
only because the resulting valid files are different.
|
||||||
|
Revised CMakeLists.txt to work with mingw and removed some material from
|
||||||
|
CMakeLists.txt that is no longer useful in libpng-1.5.
|
||||||
|
|
||||||
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
|
||||||
|
2
CHANGES
2
CHANGES
@ -3610,6 +3610,8 @@ Version 1.5.6beta03 [September 27, 2011]
|
|||||||
Revised test-pngtest.sh to report FAIL when pngtest fails.
|
Revised test-pngtest.sh to report FAIL when pngtest fails.
|
||||||
Added "--strict" option to pngtest, to report FAIL when the failure is
|
Added "--strict" option to pngtest, to report FAIL when the failure is
|
||||||
only because the resulting valid files are different.
|
only because the resulting valid files are different.
|
||||||
|
Revised CMakeLists.txt to work with mingw and removed some material from
|
||||||
|
CMakeLists.txt that is no longer useful in libpng-1.5.
|
||||||
|
|
||||||
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
|
||||||
|
@ -69,39 +69,11 @@ else()
|
|||||||
option(PNG_STATIC "Build static lib" ON)
|
option(PNG_STATIC "Build static lib" ON)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(MINGW)
|
option(PNG_TESTS "Build libpng tests" YES)
|
||||||
option(PNG_TESTS "Build pngtest" NO)
|
|
||||||
else()
|
|
||||||
option(PNG_TESTS "Build pngtest" YES)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
option(PNG_NO_CONSOLE_IO "FIXME" YES)
|
# Many more configuration options could be added here
|
||||||
option(PNG_NO_STDIO "FIXME" YES)
|
|
||||||
option(PNG_DEBUG "Build with debug output" NO)
|
option(PNG_DEBUG "Build with debug output" NO)
|
||||||
option(PNGARG "FIXME" YES)
|
option(PNGARG "Disable ANSI-C prototypes" NO)
|
||||||
#TODO:
|
|
||||||
# PNG_CONSOLE_IO_SUPPORTED
|
|
||||||
|
|
||||||
# maybe needs improving, but currently I don't know when we can enable what :)
|
|
||||||
set(png_asm_tmp "OFF")
|
|
||||||
if(NOT WIN32)
|
|
||||||
find_program(uname_executable NAMES uname PATHS /bin /usr/bin /usr/local/bin)
|
|
||||||
if(uname_executable)
|
|
||||||
exec_program(${uname_executable}
|
|
||||||
ARGS --machine OUTPUT_VARIABLE uname_output)
|
|
||||||
if("uname_output" MATCHES "^.*i[1-9]86.*$")
|
|
||||||
set(png_asm_tmp "ON")
|
|
||||||
else("uname_output" MATCHES "^.*i[1-9]86.*$")
|
|
||||||
set(png_asm_tmp "OFF")
|
|
||||||
endif("uname_output" MATCHES "^.*i[1-9]86.*$")
|
|
||||||
endif(uname_executable)
|
|
||||||
else()
|
|
||||||
# this env var is normally only set on win64
|
|
||||||
set(TEXT "ProgramFiles(x86)")
|
|
||||||
if("$ENV{${TEXT}}" STREQUAL "")
|
|
||||||
set(png_asm_tmp "ON")
|
|
||||||
endif("$ENV{${TEXT}}" STREQUAL "")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# SET LIBNAME
|
# SET LIBNAME
|
||||||
set(PNG_LIB_NAME png${PNGLIB_MAJOR}${PNGLIB_MINOR})
|
set(PNG_LIB_NAME png${PNGLIB_MAJOR}${PNGLIB_MINOR})
|
||||||
@ -110,6 +82,9 @@ set(PNG_LIB_NAME png${PNGLIB_MAJOR}${PNGLIB_MINOR})
|
|||||||
set(CMAKE_DEBUG_POSTFIX "d")
|
set(CMAKE_DEBUG_POSTFIX "d")
|
||||||
|
|
||||||
# Use the prebuilt pnglibconf.h file from the scripts folder
|
# Use the prebuilt pnglibconf.h file from the scripts folder
|
||||||
|
# TODO: fix this by building with awk; without this no cmake build can be
|
||||||
|
# configured directly (to do so indirectly use your local awk to build a
|
||||||
|
# pnglibconf.h in the build directory.)
|
||||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/scripts/pnglibconf.h.prebuilt
|
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/scripts/pnglibconf.h.prebuilt
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.h)
|
${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.h)
|
||||||
include_directories(${CMAKE_CURRENT_BINARY_DIR})
|
include_directories(${CMAKE_CURRENT_BINARY_DIR})
|
||||||
@ -145,39 +120,21 @@ set(libpng_sources
|
|||||||
set(pngtest_sources
|
set(pngtest_sources
|
||||||
pngtest.c
|
pngtest.c
|
||||||
)
|
)
|
||||||
|
set(pngvalid_sources
|
||||||
|
pngvalid.c
|
||||||
|
)
|
||||||
# SOME NEEDED DEFINITIONS
|
# SOME NEEDED DEFINITIONS
|
||||||
|
|
||||||
add_definitions(-DPNG_CONFIGURE_LIBPNG)
|
add_definitions(-DPNG_CONFIGURE_LIBPNG)
|
||||||
|
|
||||||
if(MSVC)
|
if(MSVC)
|
||||||
add_definitions(-DPNG_NO_MODULEDEF -D_CRT_SECURE_NO_DEPRECATE)
|
add_definitions(-D_CRT_SECURE_NO_DEPRECATE)
|
||||||
endif(MSVC)
|
endif(MSVC)
|
||||||
|
|
||||||
if(PNG_SHARED OR NOT MSVC)
|
|
||||||
#if building msvc static this has NOT to be defined
|
|
||||||
add_definitions(-DZLIB_DLL)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(PNG_CONSOLE_IO_SUPPORTED)
|
|
||||||
add_definitions(-DPNG_CONSOLE_IO_SUPPORTED)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(PNG_NO_CONSOLE_IO)
|
|
||||||
add_definitions(-DPNG_NO_CONSOLE_IO)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(PNG_NO_STDIO)
|
|
||||||
add_definitions(-DPNG_NO_STDIO)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(PNG_DEBUG)
|
if(PNG_DEBUG)
|
||||||
add_definitions(-DPNG_DEBUG)
|
add_definitions(-DPNG_DEBUG)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(NOT M_LIBRARY AND NOT WIN32)
|
|
||||||
add_definitions(-DPNG_NO_FLOATING_POINT_SUPPORTED)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# NOW BUILD OUR TARGET
|
# NOW BUILD OUR TARGET
|
||||||
include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${ZLIB_INCLUDE_DIR})
|
include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${ZLIB_INCLUDE_DIR})
|
||||||
|
|
||||||
@ -211,6 +168,10 @@ if(PNG_TESTS AND PNG_SHARED)
|
|||||||
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 ./pngtest ${CMAKE_CURRENT_SOURCE_DIR}/pngtest.png)
|
add_test(pngtest ./pngtest ${CMAKE_CURRENT_SOURCE_DIR}/pngtest.png)
|
||||||
|
#
|
||||||
|
add_executable(pngvalid ${pngvalid_sources})
|
||||||
|
target_link_libraries(pngvalid ${PNG_LIB_NAME})
|
||||||
|
add_test(pngvalid ./pngvalid)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Ensure the CMAKE_LIBRARY_OUTPUT_DIRECTORY is set
|
# Ensure the CMAKE_LIBRARY_OUTPUT_DIRECTORY is set
|
||||||
@ -241,11 +202,16 @@ macro(CREATE_SYMLINK SRC_FILE DEST_FILE)
|
|||||||
endif(WIN32 AND NOT CYGWIN)
|
endif(WIN32 AND NOT CYGWIN)
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
# CREATE PKGCONFIG FILES
|
# libpng is a library so default to 'lib'
|
||||||
# we use the same files like ./configure, so we have to set its vars
|
|
||||||
if(NOT DEFINED CMAKE_INSTALL_LIBDIR)
|
if(NOT DEFINED CMAKE_INSTALL_LIBDIR)
|
||||||
set(CMAKE_INSTALL_LIBDIR lib)
|
set(CMAKE_INSTALL_LIBDIR lib)
|
||||||
endif(NOT DEFINED CMAKE_INSTALL_LIBDIR)
|
endif(NOT DEFINED CMAKE_INSTALL_LIBDIR)
|
||||||
|
|
||||||
|
# CREATE PKGCONFIG FILES
|
||||||
|
# we use the same files like ./configure, so we have to set its vars
|
||||||
|
# Only do this on Windows for Cygwin - the files don't make much sense outside
|
||||||
|
# a UNIX look alike
|
||||||
|
if(NOT WIN32 OR CYGWIN)
|
||||||
set(prefix ${CMAKE_INSTALL_PREFIX})
|
set(prefix ${CMAKE_INSTALL_PREFIX})
|
||||||
set(exec_prefix ${CMAKE_INSTALL_PREFIX})
|
set(exec_prefix ${CMAKE_INSTALL_PREFIX})
|
||||||
set(libdir ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR})
|
set(libdir ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR})
|
||||||
@ -258,6 +224,7 @@ CREATE_SYMLINK(${PNGLIB_NAME}.pc libpng.pc)
|
|||||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/libpng-config.in
|
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/libpng-config.in
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/${PNGLIB_NAME}-config @ONLY)
|
${CMAKE_CURRENT_BINARY_DIR}/${PNGLIB_NAME}-config @ONLY)
|
||||||
CREATE_SYMLINK(${PNGLIB_NAME}-config libpng-config)
|
CREATE_SYMLINK(${PNGLIB_NAME}-config libpng-config)
|
||||||
|
endif(NOT WIN32 OR CYGWIN)
|
||||||
|
|
||||||
# SET UP LINKS
|
# SET UP LINKS
|
||||||
if(PNG_SHARED)
|
if(PNG_SHARED)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user