2018-07-01 12:05:51 +08:00
|
|
|
vcpkg_from_github(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
REPO LibRaw/LibRaw
|
2019-06-05 04:55:57 +08:00
|
|
|
REF d4f05dd1b9b2d44c8f7e82043cbad3c724db2416
|
|
|
|
SHA512 5794521f535163afd7815ad005295301c5e0e2f8b2f34ef0a911d9dd1572c1f456b292777548203f9767957a55782b5bc9041c033190d25d1e9b4240d7df32b9
|
2018-07-01 12:05:51 +08:00
|
|
|
HEAD_REF master
|
2016-11-02 02:37:29 +08:00
|
|
|
)
|
2018-07-01 12:05:51 +08:00
|
|
|
|
2019-10-08 01:35:13 +08:00
|
|
|
vcpkg_from_github(
|
|
|
|
OUT_SOURCE_PATH LIBRAW_CMAKE_SOURCE_PATH
|
|
|
|
REPO LibRaw/LibRaw-cmake
|
|
|
|
REF a71f3b83ee3dccd7be32f9a2f410df4d9bdbde0a
|
|
|
|
SHA512 607e6f76bcb57534da4f0c864b7a421f1ed49244468b1b52abe77f65aa599cae80715520b3a951294321b812deffd4f163757c9949f337571aa54f414ccc58a5
|
|
|
|
HEAD_REF master
|
|
|
|
PATCHES
|
|
|
|
findlibraw_debug_fix.patch
|
|
|
|
lcms2_debug_fix.patch
|
2016-11-02 02:37:29 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
file(COPY ${LIBRAW_CMAKE_SOURCE_PATH}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
|
|
|
|
file(COPY ${LIBRAW_CMAKE_SOURCE_PATH}/cmake DESTINATION ${SOURCE_PATH})
|
|
|
|
|
|
|
|
vcpkg_configure_cmake(
|
|
|
|
SOURCE_PATH ${SOURCE_PATH}
|
2017-08-12 19:47:52 +08:00
|
|
|
PREFER_NINJA
|
2016-11-03 04:16:34 +08:00
|
|
|
OPTIONS
|
2016-11-30 09:12:45 +08:00
|
|
|
-DINSTALL_CMAKE_MODULE_PATH=${CURRENT_PACKAGES_DIR}/share/libraw
|
2017-11-13 09:14:05 +08:00
|
|
|
-DCMAKE_DEBUG_POSTFIX=d
|
2016-11-02 02:37:29 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
vcpkg_install_cmake()
|
|
|
|
|
2017-08-12 19:47:52 +08:00
|
|
|
file(READ ${CURRENT_PACKAGES_DIR}/include/libraw/libraw_types.h LIBRAW_H)
|
|
|
|
if(VCPKG_LIBRARY_LINKAGE STREQUAL static)
|
|
|
|
string(REPLACE "#ifdef LIBRAW_NODLL" "#if 1" LIBRAW_H "${LIBRAW_H}")
|
|
|
|
else()
|
|
|
|
string(REPLACE "#ifdef LIBRAW_NODLL" "#if 0" LIBRAW_H "${LIBRAW_H}")
|
|
|
|
endif()
|
|
|
|
file(WRITE ${CURRENT_PACKAGES_DIR}/include/libraw/libraw_types.h "${LIBRAW_H}")
|
|
|
|
|
2018-08-29 04:48:03 +08:00
|
|
|
if(NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
|
|
|
|
# Rename thread-safe version to be "raw.lib". This is unfortunately needed
|
|
|
|
# because otherwise libraries that build on top of libraw have to choose.
|
|
|
|
file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/raw.lib ${CURRENT_PACKAGES_DIR}/debug/lib/rawd.lib)
|
|
|
|
file(RENAME ${CURRENT_PACKAGES_DIR}/lib/raw_r.lib ${CURRENT_PACKAGES_DIR}/lib/raw.lib)
|
2019-02-28 15:44:03 +08:00
|
|
|
if(NOT VCPKG_BUILD_TYPE STREQUAL "release")
|
|
|
|
file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/raw_rd.lib ${CURRENT_PACKAGES_DIR}/debug/lib/rawd.lib)
|
|
|
|
endif()
|
2016-11-03 04:16:34 +08:00
|
|
|
|
2018-08-29 04:48:03 +08:00
|
|
|
# Cleanup
|
|
|
|
file(GLOB RELEASE_EXECUTABLES ${CURRENT_PACKAGES_DIR}/bin/*.exe)
|
|
|
|
file(REMOVE ${RELEASE_EXECUTABLES})
|
2019-02-28 15:44:03 +08:00
|
|
|
if(NOT VCPKG_BUILD_TYPE STREQUAL "release")
|
|
|
|
file(GLOB DEBUG_EXECUTABLES ${CURRENT_PACKAGES_DIR}/debug/bin/*.exe)
|
|
|
|
file(REMOVE ${DEBUG_EXECUTABLES})
|
|
|
|
endif()
|
2018-08-29 03:10:26 +08:00
|
|
|
endif()
|
|
|
|
|
2016-11-03 04:22:10 +08:00
|
|
|
if(VCPKG_LIBRARY_LINKAGE STREQUAL static)
|
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin)
|
2016-11-30 09:12:45 +08:00
|
|
|
else()
|
2018-08-29 04:48:03 +08:00
|
|
|
if(VCPKG_CMAKE_SYSTEM_NAME AND NOT VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
|
|
|
|
file(REMOVE ${CURRENT_PACKAGES_DIR}/bin/raw.dll ${CURRENT_PACKAGES_DIR}/debug/bin/rawd.dll)
|
|
|
|
endif()
|
2018-08-29 03:10:26 +08:00
|
|
|
endif()
|
|
|
|
|
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
|
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
|
2016-11-02 02:37:29 +08:00
|
|
|
|
2016-11-30 09:48:32 +08:00
|
|
|
# Rename cmake module into a config in order to allow more flexible lookup rules
|
2020-01-07 05:15:20 +08:00
|
|
|
file(RENAME ${CURRENT_PACKAGES_DIR}/share/libraw/FindLibRaw.cmake ${CURRENT_PACKAGES_DIR}/share/libraw/libraw-config.cmake)
|
2016-11-30 09:48:32 +08:00
|
|
|
|
2019-03-11 15:03:47 +08:00
|
|
|
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
|
|
|
|
file(COPY ${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/libraw)
|
|
|
|
endif()
|
|
|
|
|
2018-07-01 12:05:51 +08:00
|
|
|
vcpkg_copy_pdbs()
|
2020-01-07 05:15:20 +08:00
|
|
|
|
|
|
|
file(INSTALL ${SOURCE_PATH}/COPYRIGHT DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
|
|
|
|
|