mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-11-25 08:39:06 +08:00
Merge pull request #1140 from danielshaw42/master
[rttr] initial commit of version 0.9.5
This commit is contained in:
commit
9f0a7173a2
3
ports/rttr/CONTROL
Normal file
3
ports/rttr/CONTROL
Normal file
@ -0,0 +1,3 @@
|
||||
Source: rttr
|
||||
Version: 0.9.5
|
||||
Description: an easy and intuitive way to use reflection in C++
|
36
ports/rttr/fix-directory-output.patch
Normal file
36
ports/rttr/fix-directory-output.patch
Normal file
@ -0,0 +1,36 @@
|
||||
diff --git a/CMake/config.cmake b/CMake/config.cmake
|
||||
index 1d753b3..02fe814 100644
|
||||
--- a/CMake/config.cmake
|
||||
+++ b/CMake/config.cmake
|
||||
@@ -124,7 +124,7 @@ install(
|
||||
FILES
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/CMake/rttr-config-version.cmake"
|
||||
DESTINATION
|
||||
- cmake
|
||||
+ share/rttr
|
||||
COMPONENT
|
||||
Devel
|
||||
)
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index d64ee41..e33e7bf 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -76,4 +76,4 @@ add_subdirectory(src)
|
||||
add_subdirectory(doc)
|
||||
|
||||
# here we specify the installation directory
|
||||
-set(CMAKE_INSTALL_PREFIX ${RTTR_INSTALL_DIR} CACHE PATH "RTTR install prefix" FORCE)
|
||||
+set(CMAKE_INSTALL_PREFIX ${RTTR_INSTALL_DIR} CACHE PATH "RTTR install prefix")
|
||||
diff --git a/src/rttr/CMakeLists.txt b/src/rttr/CMakeLists.txt
|
||||
index 3dffa2c..405b377 100644
|
||||
--- a/src/rttr/CMakeLists.txt
|
||||
+++ b/src/rttr/CMakeLists.txt
|
||||
@@ -47,7 +47,7 @@ install(TARGETS rttr_core EXPORT rttr_targets
|
||||
ARCHIVE DESTINATION ${RTTR_LIB_INSTALL_DIR})
|
||||
|
||||
install(EXPORT rttr_targets
|
||||
- DESTINATION cmake
|
||||
+ DESTINATION share/rttr
|
||||
NAMESPACE RTTR::
|
||||
FILE rttr-config.cmake)
|
||||
|
36
ports/rttr/portfile.cmake
Normal file
36
ports/rttr/portfile.cmake
Normal file
@ -0,0 +1,36 @@
|
||||
include(vcpkg_common_functions)
|
||||
set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/rttr-0.9.5-src)
|
||||
vcpkg_download_distfile(ARCHIVE
|
||||
URLS "http://www.rttr.org/releases/rttr-0.9.5-src.zip"
|
||||
FILENAME "rttr-0.9.5-src.zip"
|
||||
SHA512 49110cb588d2dd40a42de34b21a898fe7e21bd1e57f33b9183292c9e7cb8c8aa9e811e24613854a91e97d5cee2e561b430d89deab9f715081a3c6a1866966258
|
||||
)
|
||||
vcpkg_extract_source_archive(${ARCHIVE})
|
||||
|
||||
vcpkg_apply_patches(
|
||||
SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/rttr-0.9.5-src
|
||||
PATCHES "${CMAKE_CURRENT_LIST_DIR}/fix-directory-output.patch"
|
||||
)
|
||||
|
||||
vcpkg_configure_cmake(
|
||||
SOURCE_PATH ${SOURCE_PATH}
|
||||
PREFER_NINJA
|
||||
)
|
||||
|
||||
vcpkg_install_cmake()
|
||||
|
||||
vcpkg_fixup_cmake_targets()
|
||||
|
||||
#Handle copyright
|
||||
file(COPY ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/rttr)
|
||||
file(RENAME ${CURRENT_PACKAGES_DIR}/share/rttr/LICENSE.txt ${CURRENT_PACKAGES_DIR}/share/rttr/copyright)
|
||||
file(REMOVE_RECURSE
|
||||
${CURRENT_PACKAGES_DIR}/cmake
|
||||
${CURRENT_PACKAGES_DIR}/debug/include
|
||||
${CURRENT_PACKAGES_DIR}/debug/README.md
|
||||
${CURRENT_PACKAGES_DIR}/debug/LICENSE.txt
|
||||
${CURRENT_PACKAGES_DIR}/LICENSE.txt
|
||||
${CURRENT_PACKAGES_DIR}/README.md
|
||||
)
|
||||
|
||||
|
@ -19,7 +19,7 @@ function(vcpkg_fixup_cmake_targets)
|
||||
set(DEBUG_SHARE ${CURRENT_PACKAGES_DIR}/debug/share/${PORT})
|
||||
set(RELEASE_SHARE ${CURRENT_PACKAGES_DIR}/share/${PORT})
|
||||
|
||||
if(NOT ${_vfct_CONFIG_PATH} STREQUAL "")
|
||||
if(_vfct_CONFIG_PATH)
|
||||
set(DEBUG_CONFIG ${CURRENT_PACKAGES_DIR}/debug/${_vfct_CONFIG_PATH})
|
||||
set(RELEASE_CONFIG ${CURRENT_PACKAGES_DIR}/${_vfct_CONFIG_PATH})
|
||||
|
||||
@ -34,26 +34,26 @@ function(vcpkg_fixup_cmake_targets)
|
||||
|
||||
get_filename_component(DEBUG_CONFIG_DIR_NAME ${DEBUG_CONFIG} NAME)
|
||||
string(TOLOWER "${DEBUG_CONFIG_DIR_NAME}" DEBUG_CONFIG_DIR_NAME)
|
||||
if(${DEBUG_CONFIG_DIR_NAME} STREQUAL "cmake")
|
||||
if(DEBUG_CONFIG_DIR_NAME STREQUAL "cmake")
|
||||
file(REMOVE_RECURSE ${DEBUG_CONFIG})
|
||||
else()
|
||||
get_filename_component(DEBUG_CONFIG_PARENT_DIR ${DEBUG_CONFIG} DIRECTORY)
|
||||
get_filename_component(DEBUG_CONFIG_DIR_NAME ${DEBUG_CONFIG_PARENT_DIR} NAME)
|
||||
string(TOLOWER "${DEBUG_CONFIG_DIR_NAME}" DEBUG_CONFIG_DIR_NAME)
|
||||
if(${DEBUG_CONFIG_DIR_NAME} STREQUAL "cmake")
|
||||
if(DEBUG_CONFIG_DIR_NAME STREQUAL "cmake")
|
||||
file(REMOVE_RECURSE ${DEBUG_CONFIG_PARENT_DIR})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
get_filename_component(RELEASE_CONFIG_DIR_NAME ${RELEASE_CONFIG} NAME)
|
||||
string(TOLOWER "${RELEASE_CONFIG_DIR_NAME}" RELEASE_CONFIG_DIR_NAME)
|
||||
if(${RELEASE_CONFIG_DIR_NAME} STREQUAL "cmake")
|
||||
if(RELEASE_CONFIG_DIR_NAME STREQUAL "cmake")
|
||||
file(REMOVE_RECURSE ${RELEASE_CONFIG})
|
||||
else()
|
||||
get_filename_component(RELEASE_CONFIG_PARENT_DIR ${RELEASE_CONFIG} DIRECTORY)
|
||||
get_filename_component(RELEASE_CONFIG_DIR_NAME ${RELEASE_CONFIG_PARENT_DIR} NAME)
|
||||
string(TOLOWER "${RELEASE_CONFIG_DIR_NAME}" RELEASE_CONFIG_DIR_NAME)
|
||||
if(${RELEASE_CONFIG_DIR_NAME} STREQUAL "cmake")
|
||||
if(RELEASE_CONFIG_DIR_NAME STREQUAL "cmake")
|
||||
file(REMOVE_RECURSE ${RELEASE_CONFIG_PARENT_DIR})
|
||||
endif()
|
||||
endif()
|
||||
@ -63,10 +63,18 @@ function(vcpkg_fixup_cmake_targets)
|
||||
message(FATAL_ERROR "'${DEBUG_SHARE}' does not exist.")
|
||||
endif()
|
||||
|
||||
file(GLOB UNUSED_FILES "${DEBUG_SHARE}/*[Tt]argets.cmake" "${DEBUG_SHARE}/*[Cc]onfig.cmake" "${DEBUG_SHARE}/*[Cc]onfigVersion.cmake")
|
||||
file(GLOB UNUSED_FILES
|
||||
"${DEBUG_SHARE}/*[Tt]argets.cmake"
|
||||
"${DEBUG_SHARE}/*[Cc]onfig.cmake"
|
||||
"${DEBUG_SHARE}/*[Cc]onfigVersion.cmake"
|
||||
"${DEBUG_SHARE}/*[Cc]onfig-version.cmake"
|
||||
)
|
||||
file(REMOVE ${UNUSED_FILES})
|
||||
|
||||
file(GLOB RELEASE_TARGETS "${RELEASE_SHARE}/*[Tt]argets-release.cmake")
|
||||
file(GLOB RELEASE_TARGETS
|
||||
"${RELEASE_SHARE}/*[Tt]argets-release.cmake"
|
||||
"${RELEASE_SHARE}/*[Cc]onfig-release.cmake"
|
||||
)
|
||||
foreach(RELEASE_TARGET ${RELEASE_TARGETS})
|
||||
get_filename_component(RELEASE_TARGET_NAME ${RELEASE_TARGET} NAME)
|
||||
|
||||
@ -75,7 +83,10 @@ function(vcpkg_fixup_cmake_targets)
|
||||
file(WRITE ${RELEASE_TARGET} "${_contents}")
|
||||
endforeach()
|
||||
|
||||
file(GLOB DEBUG_TARGETS "${DEBUG_SHARE}/*[Tt]argets-debug.cmake")
|
||||
file(GLOB DEBUG_TARGETS
|
||||
"${DEBUG_SHARE}/*[Tt]argets-debug.cmake"
|
||||
"${DEBUG_SHARE}/*[Cc]onfig-debug.cmake"
|
||||
)
|
||||
foreach(DEBUG_TARGET ${DEBUG_TARGETS})
|
||||
get_filename_component(DEBUG_TARGET_NAME ${DEBUG_TARGET} NAME)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user