From 8be6db8fc2c0cbd7076bf8cab9abca2ea28483cd Mon Sep 17 00:00:00 2001 From: Bruk Tedla Date: Tue, 8 Sep 2020 17:58:44 +0300 Subject: [PATCH 1/3] Add new port [libsigcpp-3] --- ports/libsigcpp-3/CmakeLists.txt | 101 +++++++++++++++++++++++++++++++ ports/libsigcpp-3/portfile.cmake | 23 +++++++ ports/libsigcpp-3/vcpkg.json | 6 ++ 3 files changed, 130 insertions(+) create mode 100644 ports/libsigcpp-3/CmakeLists.txt create mode 100644 ports/libsigcpp-3/portfile.cmake create mode 100644 ports/libsigcpp-3/vcpkg.json diff --git a/ports/libsigcpp-3/CmakeLists.txt b/ports/libsigcpp-3/CmakeLists.txt new file mode 100644 index 00000000000000..d65e8a56efbd1e --- /dev/null +++ b/ports/libsigcpp-3/CmakeLists.txt @@ -0,0 +1,101 @@ +cmake_minimum_required (VERSION 3.2) + +set (SIGCXX_MAJOR_VERSION 2) +set (SIGCXX_MINOR_VERSION 99) +set (SIGCXX_MICRO_VERSION 1) + +set (SIGCXX_API_VERSION 3.0) +set (PACKAGE_VERSION ${SIGCXX_MAJOR_VERSION}.${SIGCXX_MINOR_VERSION}.${SIGCXX_MICRO_VERSION}) +set (LIBSIGCPP_SOVERSION 0) + +option (SIGCXX_DISABLE_DEPRECATED "Disable deprecated" OFF) + +project (sigc++) + +set( CMAKE_CXX_STANDARD 17 ) + +# Turn on warnings for MSVC. Remove the CMake default of /W3 because when you +# add /W4, MSVC will complain about two warning level flags. This default +# changed at CMake 3.15 (see +# https://cmake.org/cmake/help/v3.15/policy/CMP0092.html#policy:CMP0092 for +# more details) + if (MSVC AND CMAKE_VERSION VERSION_LESS "13.15") + string(REGEX REPLACE "(^|[ \t])/W[0-9]($|[ \t])" "\\1\\2" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") + string(REGEX REPLACE "(^|[ \t])/W[0-9]($|[ \t])" "\\1\\2" CMAKE_CXX_FLAGS + "${CMAKE_CXX_FLAGS}") +endif() + +# Add compiler warning flags & turn warnings into errors +add_compile_options( + "$<$,$>:/W4;/WX>" + "$<$,$>:-pedantic;-Wall;-Wextra;-Wsuggest-override;-Wshadow;-Wzero-as-null-pointer-constant;-Wformat-security>" + "$<$,$,$,$>:-pedantic;-Wall;-Wextra;-Wshadow;-Wzero-as-null-pointer-constant;-Wformat-security>" +) + +set (PROJECT_SOURCE_DIR "${sigc++_SOURCE_DIR}/sigc++") + +include_directories (${sigc++_SOURCE_DIR}) +include_directories (${sigc++_BINARY_DIR}) + +configure_file (sigc++config.h.cmake sigc++config.h) + +set (prefix ${CMAKE_INSTALL_PREFIX}) +set (exec_prefix \${prefix}) +set (libdir \${exec_prefix}/lib) +set (datarootdir \${prefix}) +set (datadir \${datarootdir}) +set (includedir \${prefix}/include) +set (top_srcdir .) +configure_file (sigc++.pc.in sigc++-${SIGCXX_API_VERSION}.pc @ONLY) +configure_file (sigc++-uninstalled.pc.in sigc++-${SIGCXX_API_VERSION}-uninstalled.pc @ONLY) + +configure_file( + "${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in" + "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" + IMMEDIATE @ONLY) + +add_custom_target(uninstall + COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake) + + +install (FILES + "${CMAKE_CURRENT_BINARY_DIR}/sigc++config.h" + DESTINATION + "${CMAKE_INSTALL_PREFIX}/lib/${PROJECT_NAME}-${SIGCXX_API_VERSION}/include") + +install (FILES + "${CMAKE_CURRENT_BINARY_DIR}/sigc++-${SIGCXX_API_VERSION}.pc" + DESTINATION + "${CMAKE_INSTALL_PREFIX}/lib/pkgconfig") + +add_subdirectory (sigc++) + +set (PROJECT_CMAKE_NAME "${PROJECT_NAME}-3") +set (VERSION_CONFIG "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_CMAKE_NAME}ConfigVersion.cmake") +set (LIBSIGCXX_INCLUDE_DIR "${CMAKE_INSTALL_PREFIX}/lib/${PROJECT_NAME}-${SIGCXX_API_VERSION}/include") +set (PROJECT_CONFIG "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_CMAKE_NAME}Config.cmake") +set (CONFIG_INSTALL_DIR "lib/cmake/${PROJECT_CMAKE_NAME}") +set (TARGETS_EXPORT_NAME "${PROJECT_CMAKE_NAME}Targets") +include (CMakePackageConfigHelpers) + +write_basic_package_version_file ( + "${VERSION_CONFIG}" + VERSION ${PACKAGE_VERSION} + COMPATIBILITY SameMajorVersion +) + +configure_package_config_file ( + "cmake/sigc++-3Config.cmake.in" + "${PROJECT_CONFIG}" + INSTALL_DESTINATION "${CONFIG_INSTALL_DIR}" +) + +install ( + FILES "${PROJECT_CONFIG}" "${VERSION_CONFIG}" + DESTINATION "${CONFIG_INSTALL_DIR}" +) + +install ( + EXPORT "${TARGETS_EXPORT_NAME}" + DESTINATION "${CONFIG_INSTALL_DIR}" +) diff --git a/ports/libsigcpp-3/portfile.cmake b/ports/libsigcpp-3/portfile.cmake new file mode 100644 index 00000000000000..c93ae425de2225 --- /dev/null +++ b/ports/libsigcpp-3/portfile.cmake @@ -0,0 +1,23 @@ +include(vcpkg_common_functions) + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO libsigcplusplus/libsigcplusplus + REF v3.0.3 + SHA512 4ba1eeb1296ea8b3e911a7c6ce66c402f877485fd3da1ff1c2e6cfe89a986788cb9bcc9ff8d8ef57dc6dbaa046d7a18d30f6b32a0235fe66fb7afae4ec12e13e + HEAD_REF master +) + +file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} +) +vcpkg_install_cmake() +vcpkg_copy_pdbs() +vcpkg_fixup_pkgconfig() +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/sigc++-3 TARGET_PATH share/sigc++-3) + +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") +file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/libsigcpp-3) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/libsigcpp-3/COPYING ${CURRENT_PACKAGES_DIR}/share/libsigcpp-3/copyright) diff --git a/ports/libsigcpp-3/vcpkg.json b/ports/libsigcpp-3/vcpkg.json new file mode 100644 index 00000000000000..b7cf550dbd6db7 --- /dev/null +++ b/ports/libsigcpp-3/vcpkg.json @@ -0,0 +1,6 @@ +{ + "name": "libsigcpp-3", + "version-string": "3.0.3", + "description": "Typesafe callback framework for C++", + "homepage": "https://libsigcplusplus.github.io/libsigcplusplus/" +} From eac511f370116c9a12c31090135b34b0cc3d1b1a Mon Sep 17 00:00:00 2001 From: brukted <40060643+brukted@users.noreply.github.com> Date: Tue, 8 Sep 2020 18:29:26 +0300 Subject: [PATCH 2/3] Update CmakeLists.txt --- ports/libsigcpp-3/CmakeLists.txt | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/ports/libsigcpp-3/CmakeLists.txt b/ports/libsigcpp-3/CmakeLists.txt index d65e8a56efbd1e..69340d51276a5c 100644 --- a/ports/libsigcpp-3/CmakeLists.txt +++ b/ports/libsigcpp-3/CmakeLists.txt @@ -1,3 +1,19 @@ +# Copyright 2016, The libsigc++ Development Team +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + cmake_minimum_required (VERSION 3.2) set (SIGCXX_MAJOR_VERSION 2) From 867cbcb0be288909d828131a2c54eb92e37a8ab4 Mon Sep 17 00:00:00 2001 From: Bruk Tedla Date: Tue, 8 Sep 2020 19:32:03 +0300 Subject: [PATCH 3/3] Update portfile.cmake --- ports/libsigcpp-3/portfile.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/libsigcpp-3/portfile.cmake b/ports/libsigcpp-3/portfile.cmake index c93ae425de2225..3c5831196a5df2 100644 --- a/ports/libsigcpp-3/portfile.cmake +++ b/ports/libsigcpp-3/portfile.cmake @@ -3,8 +3,8 @@ include(vcpkg_common_functions) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO libsigcplusplus/libsigcplusplus - REF v3.0.3 - SHA512 4ba1eeb1296ea8b3e911a7c6ce66c402f877485fd3da1ff1c2e6cfe89a986788cb9bcc9ff8d8ef57dc6dbaa046d7a18d30f6b32a0235fe66fb7afae4ec12e13e + REF 7e20b36bddab74faed39aa3768d07fd372fce596 + SHA512 6220a3974ee90afb5028a5b60ffcbff353fffbbfcf1570d8db05b6d91604324a73badcb17c73c852d6c5265e2b31e1c2de1b3ea20c0e60ecdb17ce90c9ca40bd HEAD_REF master )