Skip to content

Commit 7df7df6

Browse files
committed
Fix system cityhash setup
cityhash does not provide any CMake packages, so it cannot be imported with `find_package` or used with the alias `cityhash::cityhash`. To fix that, we need the following: 1. Use `find_library` to find the `cityhash` library. 2. Remove the `cityhash::cityhash` alias, and use plain `cityhash` to refer to the library. Signed-off-by: Ruoyu Zhong <[email protected]>
1 parent 5a140ad commit 7df7df6

File tree

3 files changed

+2
-4
lines changed

3 files changed

+2
-4
lines changed

CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ PROJECT (CLICKHOUSE-CLIENT)
7777
ENDIF ()
7878

7979
IF (WITH_SYSTEM_CITYHASH)
80-
FIND_PACKAGE(cityhash REQUIRED)
80+
FIND_LIBRARY(SYSTEM_CITYHASH NAMES cityhash REQUIRED)
8181
ELSE ()
8282
INCLUDE_DIRECTORIES (contrib/cityhash/cityhash)
8383
SUBDIRS (contrib/cityhash/cityhash)

clickhouse/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ ADD_LIBRARY (clickhouse-cpp-lib ${clickhouse-cpp-lib-src})
4242
SET_TARGET_PROPERTIES (clickhouse-cpp-lib PROPERTIES LINKER_LANGUAGE CXX)
4343
TARGET_LINK_LIBRARIES (clickhouse-cpp-lib
4444
absl::int128
45-
cityhash::cityhash
45+
cityhash
4646
lz4::lz4
4747
)
4848
TARGET_INCLUDE_DIRECTORIES (clickhouse-cpp-lib

contrib/cityhash/cityhash/CMakeLists.txt

-2
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,3 @@ ADD_LIBRARY (cityhash STATIC
33
)
44

55
set_property(TARGET cityhash PROPERTY POSITION_INDEPENDENT_CODE ON)
6-
7-
ADD_LIBRARY (cityhash::cityhash ALIAS cityhash)

0 commit comments

Comments
 (0)