[cppcms] Fix dependencies and linkage (#35578)

* [cppcms] No uwp

* [cppcms] Fix dependencies and linkage

* [cppcms] No python for build

* Fixup
This commit is contained in:
Kai Pastor 2023-12-12 10:28:04 +01:00 committed by GitHub
parent dd38f20a86
commit 87e44be6f5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 112 additions and 70 deletions

View File

@ -0,0 +1,41 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5ce0d53..d2b91f5 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -268,8 +268,8 @@ check_cxx_source_compiles(
CPPCMS_HAVE_FSEEKI64
)
if(NOT DISABLE_GZIP)
- find_library(ZLIB NAMES z zdll zlib${ZLIB_SUFFIX} zlib)
- find_path(ZLIB_INCLUDE_DIR zlib.h)
+ find_package(ZLIB REQUIRED)
+ set(ZLIB "${ZLIB_LIBRARIES}")
if(NOT ZLIB OR NOT ZLIB_INCLUDE_DIR)
message(FATAL_ERROR "Can't fild zlib")
endif()
@@ -423,8 +423,8 @@ if(NOT DISABLE_GCRYPT)
endif()
if(NOT DISABLE_OPENSSL)
- find_path(OPENSSL_INCLUDE_DIR openssl/aes.h)
- find_library(LIB_OPENSSL NAMES crypto libcrypto libeay32)
+ find_package(OpenSSL REQUIRED)
+ set(LIB_OPENSSL "${OPENSSL_CRYPTO_LIBRARIES}")
endif()
if (OPENSSL_INCLUDE_DIR AND LIB_OPENSSL)
diff --git a/booster/CMakeLists.txt b/booster/CMakeLists.txt
index 4f81833..822c470 100644
--- a/booster/CMakeLists.txt
+++ b/booster/CMakeLists.txt
@@ -123,6 +123,10 @@ endif()
if(NOT DISABLE_ICU_LOCALE)
message("-- Looking for ICU libraries")
+ find_package(ICU REQUIRED COMPONENTS i18n uc data)
+ include_directories(${ICU_INCLUDE_DIRS})
+ set(ICU_I18N "${ICU_LIBRARIES}")
+elseif(0)
if("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
if(MSVC)

View File

@ -0,0 +1,13 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c91ec97..11d475b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -692,7 +692,7 @@ target_link_libraries(hello_world ${CPPCMS_LIB})
if(NOT DISABLE_TCPCACHE)
add_executable(cppcms_scale src/cache_server_main.cpp)
target_link_libraries(cppcms_scale ${CPPCMS_LIB})
- if(WIN32 OR CYGWIN)
+ if(NOT DISABLE_SHARED)
set_target_properties(cppcms_scale PROPERTIES COMPILE_DEFINITIONS DLL_EXPORT)
endif()
endif()

View File

@ -1,58 +1,33 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5ce0d53..5b432c8 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -685,9 +685,10 @@ if(NOT DISABLE_SHARED)
endif(NOT DISABLE_SHARED)
-
+if(FALSE)
add_executable(hello_world src/hello_world.cpp skin1.cpp skin2.cpp)
target_link_libraries(hello_world ${CPPCMS_LIB})
+endif()
if(NOT DISABLE_TCPCACHE)
add_executable(cppcms_scale src/cache_server_main.cpp)
@@ -710,7 +711,7 @@ endif(DISABLE_SHARED)
#########################################
# Tests
#########################################
-
+if(FALSE)
set(ALL_TESTS
form_test
proto_test
@@ -775,14 +776,14 @@ set(ALL_TESTS ${ALL_TESTS} external_session_test)
if(NOT DISABLE_GZIP)
target_link_libraries(response_test ${ZLIB})
endif()
-
+endif()
#####################################
# End of tests
#####################################
# These are use export
if(IS_WINDOWS AND NOT DISABLE_SHARED)
- set_target_properties(${ALL_TESTS} hello_world cppcms PROPERTIES
+ set_target_properties(${ALL_TESTS} cppcms PROPERTIES
COMPILE_DEFINITIONS DLL_EXPORT)
endif()
@@ -830,7 +831,7 @@ install(DIRECTORY cppcms DESTINATION include
#############
-
+if(FALSE)
set(CNF "${CMAKE_CURRENT_SOURCE_DIR}/tests")
add_test(base64_test base64_test)
@@ -1103,5 +1104,5 @@ if(NOT IS_WINDOWS)
PROPERTIES TIMEOUT 120)
endif()
-
+endif()
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d2b91f5..c91ec97 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -647,7 +647,7 @@ add_custom_command(
-if(NOT DISABLE_SHARED)
+if(installing-plugins)
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/skin3.cpp
COMMAND ${PYTHON} ${CMAKE_CURRENT_SOURCE_DIR}/bin/cppcms_tmpl_cc
@@ -779,6 +779,7 @@ endif()
#####################################
# End of tests
#####################################
+set_target_properties(${ALL_TESTS} hello_world PROPERTIES EXCLUDE_FROM_ALL 1)
# These are use export
if(IS_WINDOWS AND NOT DISABLE_SHARED)
diff --git a/booster/CMakeLists.txt b/booster/CMakeLists.txt
index 822c470..0a95248 100644
--- a/booster/CMakeLists.txt
+++ b/booster/CMakeLists.txt
@@ -674,6 +674,7 @@ macro(add_booster_param_test MODULE TEST PARAMETER)
add_executable(${TEST_NAME} ${TEST_SRC})
target_link_libraries(${TEST_NAME} ${BOOSTER_LIB})
set_target_properties(${TEST_NAME} PROPERTIES COMPILE_DEFINITIONS "${EXE_COM_DEFS}")
+ set_target_properties(${TEST_NAME} PROPERTIES EXCLUDE_FROM_ALL 1)
add_test(${TEST_NAME} ${TEST_NAME} ${PARAMETER})
set_tests_properties(${TEST_NAME} PROPERTIES TIMEOUT 20)
endmacro()

View File

@ -1,32 +1,40 @@
vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY ONLY_DYNAMIC_CRT)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO artyom-beilis/cppcms
REF b72b19915794d1af63c9a9e9bea58e20a4ad93d4
SHA512 e99d34d14fbde22be725ac2c0bec069fb584e45c66767af75efaf454ca61a7a5e57434bf86109f910884c72202b8cf98fe16505e7d3d30d9218abd4d8b27d5df
PATCHES
dependencies.diff
dllexport.diff
no-tests-and-examples.patch
fix_narrowing_error.patch
)
vcpkg_find_acquire_program(PYTHON2)
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" DISABLE_DYNAMIC)
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" DISABLE_SHARED)
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" DISABLE_STATIC)
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
-DPYTHON=${PYTHON2} # Switch to python3 on the next update
-DCMAKE_CXX_STANDARD=11
-DPYTHON=:
-DUSE_WINDOWS6_API=ON
-DDISABLE_SHARED=${DISABLE_DYNAMIC}
-DDISABLE_SHARED=${DISABLE_SHARED}
-DDISABLE_STATIC=${DISABLE_STATIC}
-DDISABLE_GCRYPT=ON
-DDISABLE_ICONV=ON
)
vcpkg_cmake_install()
vcpkg_copy_pdbs()
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/tools/${PORT}")
foreach(script IN ITEMS cppcms_tmpl_cc cppcms_run)
file(RENAME "${CURRENT_PACKAGES_DIR}/bin/${script}" "${CURRENT_PACKAGES_DIR}/tools/${PORT}/${script}")
file(REMOVE "${CURRENT_PACKAGES_DIR}/debug/bin/${script}")
endforeach()
vcpkg_copy_tools(TOOL_NAMES cppcms_scale cppcms_make_key cppcms_config_find_param AUTO_CLEAN)
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(INSTALL "${SOURCE_PATH}/MIT.TXT" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/MIT.TXT" "${SOURCE_PATH}/THIRD_PARTY_SOFTWARE.TXT")

View File

@ -1,11 +1,11 @@
{
"name": "cppcms",
"version": "1.2.1",
"port-version": 6,
"port-version": 7,
"description": "CppCMS is a Free High Performance Web Development Framework (not a CMS) aimed at Rapid Web Application Development",
"homepage": "https://github.com/artyom-beilis/cppcms",
"license": "MIT",
"supports": "!(linux | osx | (windows & static))",
"license": null,
"supports": "!uwp",
"dependencies": [
"icu",
"openssl",

View File

@ -1850,7 +1850,7 @@
},
"cppcms": {
"baseline": "1.2.1",
"port-version": 6
"port-version": 7
},
"cppcodec": {
"baseline": "0.2",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "44e220f750bca1f74095cf460adb1753a4deb423",
"version": "1.2.1",
"port-version": 7
},
{
"git-tree": "e2fff22eecee1fc50eee291ea49bed2717704031",
"version": "1.2.1",