Skip to content

Commit

Permalink
[cutelyst2] no absolute paths (microsoft#21574)
Browse files Browse the repository at this point in the history
  • Loading branch information
autoantwort authored Dec 20, 2021
1 parent f2149f0 commit 9143670
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 19 deletions.
36 changes: 20 additions & 16 deletions ports/cutelyst2/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -12,38 +12,42 @@ if (VCPKG_TARGET_IS_WINDOWS AND VCPKG_LIBRARY_LINKAGE STREQUAL static)
set(BUILD_WIN_STATIC ON)
endif()

vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
-DBUILD_TESTS:BOOL=OFF
-DBUILD_WIN_STATIC=${BUILD_WIN_STATIC}
)

vcpkg_install_cmake()
vcpkg_cmake_install()

# Move CMake config files to the right place
vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/Cutelyst2Qt5 TARGET_PATH share/cutelyst2qt5)
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/Cutelyst2Qt5)

file(GLOB EXES ${CURRENT_PACKAGES_DIR}/bin/cutelyst2 ${CURRENT_PACKAGES_DIR}/bin/cutelyst2-wsgi ${CURRENT_PACKAGES_DIR}/bin/cutelyst2.exe ${CURRENT_PACKAGES_DIR}/bin/cutelyst-wsgi2.exe)
file(GLOB DEBUG_EXES ${CURRENT_PACKAGES_DIR}/debug/bin/cutelyst2 ${CURRENT_PACKAGES_DIR}/debug/bin/cutelyst2-wsgi ${CURRENT_PACKAGES_DIR}/debug/bin/cutelyst2.exe ${CURRENT_PACKAGES_DIR}/debug/bin/cutelyst-wsgi2.exe)
file(GLOB EXES "${CURRENT_PACKAGES_DIR}/bin/cutelyst2" "${CURRENT_PACKAGES_DIR}/bin/cutelyst2-wsgi" "${CURRENT_PACKAGES_DIR}/bin/cutelyst2.exe" "${CURRENT_PACKAGES_DIR}/bin/cutelyst-wsgi2.exe")
file(GLOB DEBUG_EXES "${CURRENT_PACKAGES_DIR}/debug/bin/cutelyst2" "${CURRENT_PACKAGES_DIR}/debug/bin/cutelyst2-wsgi" "${CURRENT_PACKAGES_DIR}/debug/bin/cutelyst2.exe" "${CURRENT_PACKAGES_DIR}/debug/bin/cutelyst-wsgi2.exe")
if(EXES OR DEBUG_EXES)
file(COPY ${EXES} DESTINATION ${CURRENT_PACKAGES_DIR}/tools/cutelyst2)
file(COPY ${EXES} DESTINATION "${CURRENT_PACKAGES_DIR}/tools/cutelyst2")
file(REMOVE ${EXES} ${DEBUG_EXES})
vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/cutelyst2)
vcpkg_copy_tool_dependencies("${CURRENT_PACKAGES_DIR}/tools/cutelyst2")
endif()

if(EXISTS ${CURRENT_PACKAGES_DIR}/lib/cutelyst2-plugins/ActionREST.dll)
file(RENAME ${CURRENT_PACKAGES_DIR}/lib/cutelyst2-plugins ${CURRENT_PACKAGES_DIR}/bin/cutelyst2-plugins)
if(EXISTS "${CURRENT_PACKAGES_DIR}/lib/cutelyst2-plugins/ActionREST.dll")
file(RENAME "${CURRENT_PACKAGES_DIR}/lib/cutelyst2-plugins" "${CURRENT_PACKAGES_DIR}/bin/cutelyst2-plugins")
endif()
if(EXISTS ${CURRENT_PACKAGES_DIR}/debug/lib/cutelyst2-plugins/ActionREST.dll)
file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/cutelyst2-plugins ${CURRENT_PACKAGES_DIR}/debug/bin/cutelyst2-plugins)
if(EXISTS "${CURRENT_PACKAGES_DIR}/debug/lib/cutelyst2-plugins/ActionREST.dll")
file(RENAME "${CURRENT_PACKAGES_DIR}/debug/lib/cutelyst2-plugins" "${CURRENT_PACKAGES_DIR}/debug/bin/cutelyst2-plugins")
endif()

file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include ${CURRENT_PACKAGES_DIR}/debug/share)
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include" "${CURRENT_PACKAGES_DIR}/debug/share")

# Handle copyright
configure_file(${SOURCE_PATH}/COPYING ${CURRENT_PACKAGES_DIR}/share/cutelyst2/copyright COPYONLY)
configure_file("${SOURCE_PATH}/COPYING" "${CURRENT_PACKAGES_DIR}/share/cutelyst2/copyright" COPYONLY)

vcpkg_copy_pdbs()
if(VCPKG_TARGET_IS_WINDOWS)
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/lib/pkgconfig" "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig")
else()
vcpkg_fixup_pkgconfig()
endif()
12 changes: 10 additions & 2 deletions ports/cutelyst2/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
{
"name": "cutelyst2",
"version-string": "2.12.0",
"port-version": 1,
"version": "2.12.0",
"port-version": 2,
"description": "A C++ Web Framework built on top of Qt, using the simple approach of Catalyst (Perl) framework",
"dependencies": [
{
"name": "qt5-base",
"default-features": false
},
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
]
}
2 changes: 1 addition & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -1714,7 +1714,7 @@
},
"cutelyst2": {
"baseline": "2.12.0",
"port-version": 1
"port-version": 2
},
"cwalk": {
"baseline": "1.2.6",
Expand Down
5 changes: 5 additions & 0 deletions versions/c-/cutelyst2.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "b172ddad5af65084452d225b55de761bcf4b8592",
"version": "2.12.0",
"port-version": 2
},
{
"git-tree": "1ad13c203a854aeb411f66b4f8e083882d7415cd",
"version-string": "2.12.0",
Expand Down

0 comments on commit 9143670

Please sign in to comment.