diff options
| author | Samuel Marks <807580+SamuelMarks@users.noreply.github.com> | 2020-03-11 06:20:42 +1100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-03-10 12:20:42 -0700 |
| commit | d1b89575bd2945e5a4fc54dca484a6f86112d33e (patch) | |
| tree | 56a1ca21787086369dfbd1401b19364239efef85 /ports/zookeeper | |
| parent | 7ffa425e1db8b0c3edf9c50f2f3a0f25a324541d (diff) | |
| download | vcpkg-d1b89575bd2945e5a4fc54dca484a6f86112d33e.tar.gz vcpkg-d1b89575bd2945e5a4fc54dca484a6f86112d33e.zip | |
[zkpp] Add new port (#7001)
* [zkpp] Add new port
* [zkpp] Change name of underlying library
* [zookeeper] Fix interface include directories
* [zkpp] Sanity
* Fix patch
* Correctly expose include directories
* Bump version
* Explicitly fail on Windows
Co-authored-by: Raed Romanov <raid_r@mail.ru>
Diffstat (limited to 'ports/zookeeper')
| -rw-r--r-- | ports/zookeeper/CONTROL | 2 | ||||
| -rw-r--r-- | ports/zookeeper/cmake.patch | 124 |
2 files changed, 75 insertions, 51 deletions
diff --git a/ports/zookeeper/CONTROL b/ports/zookeeper/CONTROL index d10b1683a..43c5407ff 100644 --- a/ports/zookeeper/CONTROL +++ b/ports/zookeeper/CONTROL @@ -1,5 +1,5 @@ Source: zookeeper -Version: 3.5.5 +Version: 3.5.5-1 Description: ZooKeeper C bindings Default-Features: sync diff --git a/ports/zookeeper/cmake.patch b/ports/zookeeper/cmake.patch index 4dd8ef93b..f47d4697e 100644 --- a/ports/zookeeper/cmake.patch +++ b/ports/zookeeper/cmake.patch @@ -1,50 +1,74 @@ -diff --git a/zookeeper-client/zookeeper-client-c/CMakeLists.txt b/zookeeper-client/zookeeper-client-c/CMakeLists.txt
-index 24a5a1b..1b0ce4a 100644
---- a/zookeeper-client/zookeeper-client-c/CMakeLists.txt
-+++ b/zookeeper-client/zookeeper-client-c/CMakeLists.txt
-@@ -153,7 +153,7 @@ configure_file(cmake_config.h.in ${CMAKE_CURRENT_BINARY_DIR}/include/config.h)
- # hashtable library
- set(hashtable_sources src/hashtable/hashtable_itr.c src/hashtable/hashtable.c)
- add_library(hashtable STATIC ${hashtable_sources})
--target_include_directories(hashtable PUBLIC include)
-+target_include_directories(hashtable PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}> $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>)
- target_link_libraries(hashtable PUBLIC $<$<OR:$<PLATFORM_ID:Linux>,$<PLATFORM_ID:FreeBSD>>:m>)
-
- # zookeeper library
-@@ -176,7 +176,10 @@ if(WIN32)
- endif()
-
- add_library(zookeeper STATIC ${zookeeper_sources})
--target_include_directories(zookeeper PUBLIC include ${CMAKE_CURRENT_BINARY_DIR}/include generated)
-+target_include_directories(zookeeper PUBLIC
-+ $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
-+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include ${CMAKE_CURRENT_BINARY_DIR}/include ${CMAKE_CURRENT_SOURCE_DIR}/generated>)
-+
- target_link_libraries(zookeeper PUBLIC
- hashtable
- $<$<PLATFORM_ID:Linux>:rt> # clock_gettime
-@@ -247,3 +250,23 @@ if(WANT_CPPUNIT)
- "ZKROOT=${CMAKE_CURRENT_SOURCE_DIR}/../.."
- "CLASSPATH=$CLASSPATH:$CLOVER_HOME/lib/clover*.jar")
- endif()
-+
-+
-+target_compile_definitions(zookeeper PRIVATE _CRT_SECURE_NO_WARNINGS _WINSOCK_DEPRECATED_NO_WARNINGS _CRT_NONSTDC_NO_DEPRECATE)
-+target_compile_definitions(cli PRIVATE _CRT_SECURE_NO_WARNINGS)
-+
-+file(GLOB ZOOKEEPER_HEADERS include/*.h)
-+
-+install(FILES ${ZOOKEEPER_HEADERS} generated/zookeeper.jute.h DESTINATION include/zookeeper)
-+
-+install(TARGETS zookeeper hashtable
-+ EXPORT zookeeperConfig
-+ RUNTIME DESTINATION bin
-+ ARCHIVE DESTINATION lib
-+ LIBRARY DESTINATION lib
-+)
-+install(EXPORT zookeeperConfig
-+ FILE zookeeperConfig.cmake
-+ NAMESPACE zookeeper::
-+ DESTINATION "${CMAKE_INSTALL_PREFIX}/share/zookeeper"
-+)
-\ No newline at end of file
+diff --git a/zookeeper-client/zookeeper-client-c/CMakeLists.txt b/zookeeper-client/zookeeper-client-c/CMakeLists.txt +index 24a5a1b..40fa67e 100644 +--- a/zookeeper-client/zookeeper-client-c/CMakeLists.txt ++++ b/zookeeper-client/zookeeper-client-c/CMakeLists.txt +@@ -147,13 +147,15 @@ endforeach() + include(CheckStructHasMember) + check_struct_has_member("struct sockaddr_in6" sin6_addr "netinet/in.h" ZOO_IPV6_ENABLED) + ++include(GNUInstallDirs) ++ + # configure + configure_file(cmake_config.h.in ${CMAKE_CURRENT_BINARY_DIR}/include/config.h) + + # hashtable library + set(hashtable_sources src/hashtable/hashtable_itr.c src/hashtable/hashtable.c) + add_library(hashtable STATIC ${hashtable_sources}) +-target_include_directories(hashtable PUBLIC include) ++target_include_directories(hashtable PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}> $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>) + target_link_libraries(hashtable PUBLIC $<$<OR:$<PLATFORM_ID:Linux>,$<PLATFORM_ID:FreeBSD>>:m>) + + # zookeeper library +@@ -176,11 +178,16 @@ if(WIN32) + endif() + + add_library(zookeeper STATIC ${zookeeper_sources}) +-target_include_directories(zookeeper PUBLIC include ${CMAKE_CURRENT_BINARY_DIR}/include generated) ++target_include_directories(zookeeper PUBLIC ++ $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}> ++ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include> ++ $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/include> ++ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/generated>) ++ + target_link_libraries(zookeeper PUBLIC +- hashtable + $<$<PLATFORM_ID:Linux>:rt> # clock_gettime +- $<$<PLATFORM_ID:Windows>:ws2_32>) # Winsock 2.0 ++ $<$<PLATFORM_ID:Windows>:ws2_32> # Winsock 2.0 ++ PRIVATE hashtable) + + if(WANT_SYNCAPI AND NOT WIN32) + find_package(Threads REQUIRED) +@@ -189,7 +196,7 @@ endif() + + # cli executable + add_executable(cli src/cli.c) +-target_link_libraries(cli zookeeper) ++target_link_libraries(cli PRIVATE zookeeper) + + # load_gen executable + if(WANT_SYNCAPI AND NOT WIN32) +@@ -247,3 +254,23 @@ if(WANT_CPPUNIT) + "ZKROOT=${CMAKE_CURRENT_SOURCE_DIR}/../.." + "CLASSPATH=$CLASSPATH:$CLOVER_HOME/lib/clover*.jar") + endif() ++ ++ ++target_compile_definitions(zookeeper PRIVATE _CRT_SECURE_NO_WARNINGS _WINSOCK_DEPRECATED_NO_WARNINGS _CRT_NONSTDC_NO_DEPRECATE) ++target_compile_definitions(cli PRIVATE _CRT_SECURE_NO_WARNINGS) ++ ++file(GLOB ZOOKEEPER_HEADERS include/*.h) ++ ++install(FILES ${ZOOKEEPER_HEADERS} generated/zookeeper.jute.h DESTINATION include/zookeeper) ++ ++install(TARGETS zookeeper hashtable ++ EXPORT zookeeperConfig ++ RUNTIME DESTINATION bin ++ ARCHIVE DESTINATION lib ++ LIBRARY DESTINATION lib ++) ++install(EXPORT zookeeperConfig ++ FILE zookeeperConfig.cmake ++ NAMESPACE zookeeper:: ++ DESTINATION "${CMAKE_INSTALL_PREFIX}/share/zookeeper" ++) |
