2021-04-10 00:59:25 +08:00
|
|
|
# FLTK has many improperly shared global variables that get duplicated into every DLL
|
|
|
|
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
|
|
|
|
|
2021-05-21 16:16:33 +08:00
|
|
|
vcpkg_from_github(
|
2019-10-29 08:49:22 +08:00
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
2021-05-21 16:16:33 +08:00
|
|
|
REPO fltk/fltk
|
2022-01-21 06:05:41 +08:00
|
|
|
REF release-1.3.8
|
2022-01-24 16:14:29 +08:00
|
|
|
SHA512 197848d3b80a65cca936daf4f0b74609f0fe8332a4cd11af53385fb2aa45ad698b1e239a48732b118cd3cb189bc531711b72fb2eeeb85be887dc6c5a558fa4b3
|
2019-10-29 08:49:22 +08:00
|
|
|
PATCHES
|
|
|
|
findlibsfix.patch
|
2020-07-31 13:41:46 +08:00
|
|
|
config-path.patch
|
|
|
|
include.patch
|
2021-04-10 00:59:25 +08:00
|
|
|
fix-system-link.patch
|
2019-10-29 08:49:22 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
if (VCPKG_TARGET_ARCHITECTURE MATCHES "arm" OR VCPKG_TARGET_ARCHITECTURE MATCHES "arm64")
|
|
|
|
set(OPTION_USE_GL "-DOPTION_USE_GL=OFF")
|
|
|
|
else()
|
|
|
|
set(OPTION_USE_GL "-DOPTION_USE_GL=ON")
|
|
|
|
endif()
|
|
|
|
|
2022-04-30 02:40:30 +08:00
|
|
|
set(fluid_path_param "")
|
|
|
|
if(VCPKG_CROSSCOMPILING)
|
|
|
|
set(fluid_path_param "-DFLUID_PATH=${CURRENT_HOST_INSTALLED_DIR}/tools/fltk/fluid${VCPKG_HOST_EXECUTABLE_SUFFIX}")
|
|
|
|
endif()
|
|
|
|
|
2021-12-07 12:18:22 +08:00
|
|
|
vcpkg_cmake_configure(
|
|
|
|
SOURCE_PATH "${SOURCE_PATH}"
|
2019-10-29 08:49:22 +08:00
|
|
|
OPTIONS
|
2021-05-21 16:16:33 +08:00
|
|
|
-DFLTK_BUILD_TEST=OFF
|
2019-10-29 08:49:22 +08:00
|
|
|
-DOPTION_LARGE_FILE=ON
|
|
|
|
-DOPTION_USE_THREADS=ON
|
|
|
|
-DOPTION_USE_SYSTEM_ZLIB=ON
|
|
|
|
-DOPTION_USE_SYSTEM_LIBPNG=ON
|
|
|
|
-DOPTION_USE_SYSTEM_LIBJPEG=ON
|
2020-07-31 13:41:46 +08:00
|
|
|
-DOPTION_BUILD_SHARED_LIBS=OFF
|
|
|
|
-DFLTK_CONFIG_PATH=share/fltk
|
2022-04-30 02:40:30 +08:00
|
|
|
${fluid_path_param}
|
2019-10-29 08:49:22 +08:00
|
|
|
${OPTION_USE_GL}
|
|
|
|
)
|
|
|
|
|
2021-12-07 12:18:22 +08:00
|
|
|
vcpkg_cmake_install()
|
2019-10-29 08:49:22 +08:00
|
|
|
|
2021-12-07 12:18:22 +08:00
|
|
|
vcpkg_cmake_config_fixup()
|
2019-10-29 08:49:22 +08:00
|
|
|
|
2021-04-10 00:59:25 +08:00
|
|
|
vcpkg_copy_pdbs()
|
|
|
|
|
2022-04-30 02:40:30 +08:00
|
|
|
# don't install fluid
|
|
|
|
if(VCPKG_CROSSCOMPILING)
|
|
|
|
if(NOT VCPKG_TARGET_IS_WINDOWS)
|
|
|
|
vcpkg_copy_tools(TOOL_NAMES fltk-config AUTO_CLEAN)
|
|
|
|
endif()
|
|
|
|
elseif(VCPKG_TARGET_IS_OSX)
|
2020-07-31 13:41:46 +08:00
|
|
|
vcpkg_copy_tools(TOOL_NAMES fluid.app fltk-config AUTO_CLEAN)
|
|
|
|
elseif(VCPKG_TARGET_IS_WINDOWS)
|
2021-12-07 12:18:22 +08:00
|
|
|
file(REMOVE "${CURRENT_PACKAGES_DIR}/bin/fltk-config" "${CURRENT_PACKAGES_DIR}/debug/bin/fltk-config")
|
2020-07-31 13:41:46 +08:00
|
|
|
vcpkg_copy_tools(TOOL_NAMES fluid AUTO_CLEAN)
|
|
|
|
else()
|
|
|
|
vcpkg_copy_tools(TOOL_NAMES fluid fltk-config AUTO_CLEAN)
|
|
|
|
endif()
|
2021-12-07 12:18:22 +08:00
|
|
|
if(EXISTS "${CURRENT_PACKAGES_DIR}/tools/fltk/fltk-config")
|
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/tools/fltk/fltk-config" "${CURRENT_PACKAGES_DIR}" "`dirname $0`/../..")
|
|
|
|
endif()
|
2019-10-29 08:49:22 +08:00
|
|
|
|
|
|
|
if(VCPKG_LIBRARY_LINKAGE STREQUAL static)
|
|
|
|
file(REMOVE_RECURSE
|
2021-12-07 12:18:22 +08:00
|
|
|
"${CURRENT_PACKAGES_DIR}/debug/bin"
|
|
|
|
"${CURRENT_PACKAGES_DIR}/bin"
|
2019-10-29 08:49:22 +08:00
|
|
|
)
|
|
|
|
endif()
|
2020-07-31 13:41:46 +08:00
|
|
|
file(REMOVE_RECURSE
|
2021-12-07 12:18:22 +08:00
|
|
|
"${CURRENT_PACKAGES_DIR}/debug/include"
|
|
|
|
"${CURRENT_PACKAGES_DIR}/debug/share"
|
2020-07-31 13:41:46 +08:00
|
|
|
)
|
2019-10-29 08:49:22 +08:00
|
|
|
|
|
|
|
foreach(FILE Fl_Export.H fl_utf8.h)
|
|
|
|
if(VCPKG_LIBRARY_LINKAGE STREQUAL static)
|
2021-12-07 12:18:22 +08:00
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/FL/${FILE}" "defined(FL_DLL)" "0")
|
2019-10-29 08:49:22 +08:00
|
|
|
else()
|
2021-12-07 12:18:22 +08:00
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/FL/${FILE}" "defined(FL_DLL)" "1")
|
2019-10-29 08:49:22 +08:00
|
|
|
endif()
|
|
|
|
endforeach()
|
|
|
|
|
2021-12-07 12:18:22 +08:00
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/share/fltk/UseFLTK.cmake" "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel;${SOURCE_PATH}" [[${CMAKE_CURRENT_LIST_DIR}/../../include]])
|
|
|
|
|
2021-04-10 00:59:25 +08:00
|
|
|
file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
|