vcpkg/ports/sfml/portfile.cmake

44 lines
1.9 KiB
CMake
Raw Normal View History

2016-12-08 06:02:23 +08:00
include(vcpkg_common_functions)
2017-09-24 00:19:29 +08:00
vcpkg_from_github(OUT_SOURCE_PATH SOURCE_PATH
2018-04-27 18:15:17 +08:00
REPO SFML/SFML
REF 2.4.2
2017-09-24 00:19:29 +08:00
HEAD_REF master
2018-04-27 18:15:17 +08:00
SHA512 8acfdf320939c953a9a3413398f82d02d68a56a337f1366c2677c14ce032baa8ba059113ac3c91bb6e6fc22eef119369a265be7ef6894526e6a97a01f37e1972
)
2016-12-08 06:02:23 +08:00
file(REMOVE_RECURSE ${SOURCE_PATH}/extlibs)
file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
2018-04-27 18:15:17 +08:00
if(VCPKG_CMAKE_SYSTEM_NAME AND NOT VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
message("SFML currently requires the following libraries from the system package manager:\n libudev\n libx11\n libxrandr\n opengl\n\nThese can be installed on Ubuntu systems via apt-get install libx11-dev libxrandr-dev libxi-dev libudev-dev mesa-common-dev")
endif()
2016-12-08 06:02:23 +08:00
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
2018-04-27 18:15:17 +08:00
OPTIONS_DEBUG
-DSFML_SKIP_HEADERS=ON
)
2016-12-08 06:02:23 +08:00
vcpkg_install_cmake()
vcpkg_copy_pdbs()
# don't force users to define SFML_STATIC while using static library
if(VCPKG_LIBRARY_LINKAGE STREQUAL static)
file(APPEND ${CURRENT_PACKAGES_DIR}/include/SFML/Config.hpp "#undef SFML_API_IMPORT\n#define SFML_API_IMPORT\n")
endif()
# move sfml-main to manual link dir
2018-04-27 18:15:17 +08:00
if(EXISTS ${CURRENT_PACKAGES_DIR}/lib/sfml-main.lib)
file(COPY ${CURRENT_PACKAGES_DIR}/lib/sfml-main.lib DESTINATION ${CURRENT_PACKAGES_DIR}/lib/manual-link)
file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/sfml-main.lib)
file(COPY ${CURRENT_PACKAGES_DIR}/debug/lib/sfml-main-d.lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib/manual-link)
file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/sfml-main-d.lib)
endif()
2016-12-08 06:02:23 +08:00
2017-09-24 00:19:29 +08:00
# At the time of writing, HEAD has license.md instead of license.txt
2018-04-27 18:15:17 +08:00
if(VCPKG_HEAD_VERSION)
2017-09-24 00:19:29 +08:00
file(INSTALL ${SOURCE_PATH}/license.md DESTINATION ${CURRENT_PACKAGES_DIR}/share/sfml RENAME copyright)
else()
file(INSTALL ${SOURCE_PATH}/license.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/sfml RENAME copyright)
endif()