blob: f8bf5ad972635af16789126cae2b6db5c3664675 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
|
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a3abd0f..c37c36b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -12,6 +12,10 @@ include(GNUInstallDirs)
include(CTest)
include(cmake/idna-flags.cmake)
+if(ADA_USE_SIMDUTF)
+ find_package(simdutf CONFIG REQUIRED)
+endif()
+
add_subdirectory(src)
option(ADA_USE_SIMDUTF "Whether to use SIMDUTF for unicode transcoding" OFF)
@@ -20,16 +24,6 @@ if(ADA_IDNA_BENCHMARKS OR BUILD_TESTING)
include(cmake/CPM.cmake)
endif()
-if(ADA_USE_SIMDUTF)
- include(cmake/CPM.cmake)
- CPMAddPackage(
- NAME simdutf
- GITHUB_REPOSITORY simdutf/simdutf
- VERSION 7.0.0
- OPTIONS "SIMDUTF_TESTS OFF"
- )
-endif()
-
if (ADA_IDNA_BENCHMARKS)
message(STATUS "Ada benchmarks enabled.")
CPMAddPackage(
@@ -63,8 +57,6 @@ else()
endif()
endif(BUILD_TESTING)
-add_subdirectory(singleheader)
-
add_library(ada-idna::ada-idna ALIAS ada-idna)
set_target_properties(
@@ -95,3 +87,8 @@ install(
ARCHIVE COMPONENT ada-idna_development
INCLUDES DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
)
+
+install(EXPORT ada-idna_targets
+ FILE unofficial-ada-idna-config.cmake
+ NAMESPACE unofficial::ada-idna::
+ DESTINATION share/unofficial-ada-idna)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index e48bcda..3e7ba16 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -12,7 +12,7 @@ target_include_directories(ada-idna PRIVATE $<BUILD_INTERFACE:${CMAKE_CURRENT_SO
target_include_directories(ada-idna PUBLIC "$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>")
if(ADA_USE_SIMDUTF)
- target_link_libraries(ada-idna PRIVATE simdutf)
+ target_link_libraries(ada-idna PRIVATE simdutf::simdutf)
target_compile_definitions(ada-idna PRIVATE ADA_USE_SIMDUTF)
endif()
|