CMake: Fix CPack dependencies for libpng 1.6
Vicki Pfau vi@endrift.com
Sat, 16 Sep 2017 10:00:09 -0700
2 files changed,
11 insertions(+),
1 deletions(-)
M
CHANGES
→
CHANGES
@@ -48,6 +48,7 @@ - Test: Restructure test suite into multiple executables
- Python: Integrate tests from cinema test suite - Util: Don't build crc32 if the function already exists - GBA: Detect hardware for Pokémon FireRed ROM hacks + - CMake: Fix CPack dependencies for libpng 1.6 0.6.0: (2017-07-16) Features:
M
CMakeLists.txt
→
CMakeLists.txt
@@ -124,6 +124,7 @@ string(TOUPPER ${REQUIRE} UREQUIRE)
set(${UREQUIRE}_CFLAGS_OTHER ${${REQUIRE}_CFLAGS_OTHER} PARENT_SCOPE) set(${UREQUIRE}_FOUND ${${REQUIRE}_FOUND} PARENT_SCOPE) set(${UREQUIRE}_INCLUDE_DIRS ${${REQUIRE}_INCLUDE_DIRS} PARENT_SCOPE) + set(${UREQUIRE}_VERSION_STRING ${${REQUIRE}_VERSION_STRING} PARENT_SCOPE) if (APPLE) set(IS_FRAMEWORK OFF) set(LIBS)@@ -526,7 +527,15 @@ if(USE_PNG)
list(APPEND FEATURES PNG) include_directories(AFTER ${PNG_INCLUDE_DIRS}) list(APPEND DEPENDENCY_LIB ${PNG_LIBRARIES} ${ZLIB_LIBRARIES}) - set(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS},libpng12-0") + if(PNG_VERSION_STRING) + string(REGEX MATCH "^[0-9]+\\.[0-9]+" PNG_VERSION_PARTIAL ${PNG_VERSION_STRING}) + if(${PNG_VERSION_PARTIAL} STREQUAL "1.6") + set(PNG_DEB_VERSION "16-16") + else() + set(PNG_DEB_VERSION "12-0") + endif() + set(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS},libpng${PNG_DEB_VERSION}") + endif() endif() if(WANT_SQLITE3 AND NOT USE_SQLITE3)