summaryrefslogtreecommitdiff
path: root/indra/cmake
diff options
context:
space:
mode:
authorakleshchev <117672381+akleshchev@users.noreply.github.com>2023-04-19 20:12:48 +0300
committerGitHub <noreply@github.com>2023-04-19 20:12:48 +0300
commitf78773f0c91d728f7e450c4030ab1ae93145a528 (patch)
tree017bd903f4bcffe224cdb4ff5d8b42938ae311bd /indra/cmake
parent8dad411e9055c32a753e575ccd6142073eb27aae (diff)
parent337d2f984ff7f448fdbdc8dc2448e2b67cd23572 (diff)
SL-19623 Merge 'CMake' pull request #150 from Ansariel
Fix CMake files related to ICU4C
Diffstat (limited to 'indra/cmake')
-rw-r--r--indra/cmake/CMakeLists.txt1
-rw-r--r--indra/cmake/FindICU4C.cmake33
-rw-r--r--indra/cmake/ICU4C.cmake37
3 files changed, 20 insertions, 51 deletions
diff --git a/indra/cmake/CMakeLists.txt b/indra/cmake/CMakeLists.txt
index f0b35c08f3..286ef3d411 100644
--- a/indra/cmake/CMakeLists.txt
+++ b/indra/cmake/CMakeLists.txt
@@ -30,6 +30,7 @@ set(cmake_SOURCE_FILES
GoogleMock.cmake
Havok.cmake
Hunspell.cmake
+ ICU4C.cmake
JsonCpp.cmake
LLAddBuildTest.cmake
LLAppearance.cmake
diff --git a/indra/cmake/FindICU4C.cmake b/indra/cmake/FindICU4C.cmake
deleted file mode 100644
index 327d761a88..0000000000
--- a/indra/cmake/FindICU4C.cmake
+++ /dev/null
@@ -1,33 +0,0 @@
-# -*- cmake -*-
-
-# - Find ICU4C
-# This module defines
-# ICU4C_INCLUDE_DIR, where to find headers
-# ICU4C_LIBRARY, the library needed to use ICU4C.
-# ICU4C_FOUND, If false, do not try to use ICU4C.
-
-find_path(ICU4C_INCLUDE_DIR uchar.h
- PATH_SUFFIXES unicode
- )
-
-set(ICU4C_NAMES ${ICU4C_NAMES} icuuc)
-find_library(ICU4C_LIBRARY
- NAMES ${ICU4C_NAMES}
- )
-
-if (ICU4C_LIBRARY AND ICU4C_INCLUDE_DIR)
- set(ICU4C_FOUND "YES")
-else (ICU4C_LIBRARY AND ICU4C_INCLUDE_DIR)
- set(ICU4C_FOUND "NO")
-endif (ICU4C_LIBRARY AND ICU4C_INCLUDE_DIR)
-
-if (ICU4C_FOUND)
- message(STATUS "Found ICU4C: Library in '${ICU4C_LIBRARY}' and header in '${ICU4C_INCLUDE_DIR}' ")
-else (ICU4C_FOUND)
- message(FATAL_ERROR " * * *\nCould not find ICU4C library! * * *")
-endif (ICU4C_FOUND)
-
-mark_as_advanced(
- ICU4C_LIBRARY
- ICU4C_INCLUDE_DIR
- )
diff --git a/indra/cmake/ICU4C.cmake b/indra/cmake/ICU4C.cmake
index b51087e0e7..7b27665483 100644
--- a/indra/cmake/ICU4C.cmake
+++ b/indra/cmake/ICU4C.cmake
@@ -1,22 +1,23 @@
# -*- cmake -*-
include(Prebuilt)
-set(ICU4C_FIND_QUIETLY ON)
-set(ICU4C_FIND_REQUIRED ON)
+include_guard()
-if (USESYSTEMLIBS)
- include(FindICU4C)
-else (USESYSTEMLIBS)
- use_prebuilt_binary(icu4c)
- if (WINDOWS)
- set(ICU4C_LIBRARY icuuc)
- elseif(DARWIN)
- set(ICU4C_LIBRARY icuuc)
- #elseif(LINUX)
- # set(ICU4C_LIBRARY ...)
- else()
- message(FATAL_ERROR "Invalid platform")
- endif()
- set(ICU4C_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include/unicode)
- use_prebuilt_binary(dictionaries)
-endif (USESYSTEMLIBS)
+add_library( ll::icu4c INTERFACE IMPORTED )
+
+
+use_system_binary(icu4c)
+use_prebuilt_binary(icu4c)
+if (WINDOWS)
+ target_link_libraries( ll::icu4c INTERFACE icuuc)
+elseif(DARWIN)
+ target_link_libraries( ll::icu4c INTERFACE icuuc)
+#elseif(LINUX)
+## target_link_libraries( ll::icu4c INTERFACE )
+else()
+ message(FATAL_ERROR "Invalid platform")
+endif()
+
+target_include_directories( ll::icu4c SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include/unicode )
+
+use_prebuilt_binary(dictionaries)