File tree Expand file tree Collapse file tree 5 files changed +31
-11
lines changed Expand file tree Collapse file tree 5 files changed +31
-11
lines changed Original file line number Diff line number Diff line change @@ -9,8 +9,13 @@ environment:
9
9
matrix :
10
10
- job_name : " Internal xxhash"
11
11
LSQPACK_XXH : ON
12
- - job_name : " External xxhash"
12
+ XXH_CMAKE : UNUSED
13
+ - job_name : " External xxhash (CMake)"
13
14
LSQPACK_XXH : OFF
15
+ XXH_CMAKE : REQUIRE
16
+ - job_name : " External xxhash (pkgconfig)"
17
+ LSQPACK_XXH : OFF
18
+ XXH_CMAKE : DISABLE
14
19
15
20
before_build :
16
21
- git -C c:\tools\vcpkg\ fetch
@@ -26,6 +31,7 @@ before_build:
26
31
-DCMAKE_GENERATOR_PLATFORM=x64
27
32
-DLSQPACK_TESTS=ON
28
33
-DLSQPACK_XXH=%LSQPACK_XXH%
34
+ -DCMAKE_%XXH_CMAKE%_FIND_PACKAGE_xxHash=ON
29
35
-DGETOPT_INCLUDE_DIR=c:/tools/vcpkg/installed/x64-windows/include
30
36
-DGETOPT_LIB=c:/tools/vcpkg/installed/x64-windows/lib/getopt.lib
31
37
Original file line number Diff line number Diff line change @@ -37,10 +37,14 @@ if(LSQPACK_XXH)
37
37
target_sources (ls-qpack PRIVATE deps/xxhash/xxhash.c )
38
38
set (LSQPACK_DEPENDS "" )
39
39
else ()
40
- find_package (PkgConfig REQUIRED )
41
- pkg_check_modules (XXH REQUIRED IMPORTED_TARGET libxxhash )
42
- target_link_libraries (ls-qpack PUBLIC PkgConfig::XXH )
43
- set (LSQPACK_DEPENDS "libxxhash" )
40
+ find_package (xxHash CONFIG )
41
+ if (NOT xxHash_FOUND )
42
+ find_package (PkgConfig REQUIRED )
43
+ pkg_check_modules (LS_QPACK_XXH REQUIRED IMPORTED_TARGET libxxhash GLOBAL )
44
+ add_library (xxHash::xxhash ALIAS PkgConfig::LS_QPACK_XXH )
45
+ endif ()
46
+ target_link_libraries (ls-qpack PRIVATE xxHash::xxhash )
47
+ set (LSQPACK_DEPENDS "libxxhash" )
44
48
endif ()
45
49
46
50
if (WIN32 OR EMSCRIPTEN )
@@ -128,10 +132,14 @@ configure_file(lsqpack.pc.in lsqpack.pc @ONLY)
128
132
install (FILES "${CMAKE_CURRENT_BINARY_DIR} /lsqpack.pc"
129
133
DESTINATION ${CMAKE_INSTALL_LIBDIR} /pkgconfig )
130
134
135
+ configure_file (ls-qpack-config.cmake.in ls-qpack-config.cmake @ONLY )
131
136
install (TARGETS ls-qpack EXPORT ls-qpack-config
132
137
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} )
138
+ install (FILES "${CMAKE_CURRENT_BINARY_DIR} /ls-qpack-config.cmake"
139
+ DESTINATION ${CMAKE_INSTALL_LIBDIR} /cmake/ls-qpack )
133
140
install (
134
141
EXPORT ls-qpack-config
142
+ FILE ls-qpack-targets.cmake
135
143
NAMESPACE ls-qpack::
136
144
DESTINATION ${CMAKE_INSTALL_LIBDIR} /cmake/ls-qpack
137
145
)
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ function(lsqpack_add_executable TARGET)
7
7
target_include_directories (${TARGET} PRIVATE ../deps/xxhash )
8
8
else ()
9
9
target_sources (${TARGET} PRIVATE ${TARGET} .c )
10
- target_link_libraries (${TARGET} PUBLIC PkgConfig::XXH )
10
+ target_link_libraries (${TARGET} PUBLIC xxHash::xxhash )
11
11
endif ()
12
12
13
13
if (WIN32 )
Original file line number Diff line number Diff line change
1
+ if (NOT "@BUILD_SHARED_LIBS@" AND NOT "@LSQPACK_XXH@" )
2
+ include (CMakeFindDependencyMacro )
3
+ if ("@xxHash_FOUND@" )
4
+ find_dependency (xxHash CONFIG )
5
+ else ()
6
+ find_dependency (PkgConfig )
7
+ pkg_check_modules (XXH REQUIRED IMPORTED_TARGET libxxhash )
8
+ endif ()
9
+ endif ()
10
+ include ("${CMAKE_CURRENT_LIST_DIR} /ls-qpack-targets.cmake" )
Original file line number Diff line number Diff line change 1
1
function (lsqpack_add_test TARGET )
2
2
add_executable (test_${TARGET} "" )
3
3
target_sources (test_${TARGET} PRIVATE test_${TARGET}.c )
4
- if (LSQPACK_XXH )
5
- target_link_libraries (test_${TARGET} ls-qpack )
6
- else ()
7
- target_link_libraries (test_${TARGET} ls-qpack PkgConfig::XXH )
8
- endif ()
4
+ target_link_libraries (test_${TARGET} ls-qpack )
9
5
10
6
if (WIN32 )
11
7
target_include_directories (test_${TARGET} PRIVATE ../wincompat )
You can’t perform that action at this time.
0 commit comments