Add: introduce CMake for project management
CMake works on all our supported platforms, like MSVC, Mingw, GCC,
Clang, and many more. It allows for a single way of doing things,
so no longer we need shell scripts and vbs scripts to work on all
our supported platforms.
Additionally, CMake allows to generate project files for like MSVC,
KDevelop, etc.
This heavily reduces the lines of code we need to support multiple
platforms from a project perspective.
Addtiionally, this heavily improves our detection of libraries, etc.
2019-04-07 09:57:55 +00:00
|
|
|
#[=======================================================================[.rst:
|
|
|
|
FindICU
|
|
|
|
-------
|
|
|
|
|
|
|
|
Finds components of the ICU library.
|
|
|
|
|
|
|
|
Accepted components are: uc, i18n, le, lx, io
|
|
|
|
|
|
|
|
Result Variables
|
|
|
|
^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
This will define the following variables:
|
|
|
|
|
|
|
|
``ICU_FOUND``
|
|
|
|
True if components of ICU library are found.
|
|
|
|
``ICU_VERSION``
|
|
|
|
The version of the ICU library which was found.
|
|
|
|
``ICU_<c>_FOUND``
|
|
|
|
True if the system has the <c> component of ICU library.
|
|
|
|
``ICU_<c>_INCLUDE_DIRS``
|
|
|
|
Include directories needed to use the <c> component of ICU library.
|
|
|
|
``ICU_<c>_LIBRARIES``
|
|
|
|
Libraries needed to link to the <c> component of ICU library.
|
|
|
|
|
|
|
|
#]=======================================================================]
|
|
|
|
|
|
|
|
find_package(PkgConfig QUIET)
|
|
|
|
|
|
|
|
set(ICU_KNOWN_COMPONENTS "uc" "i18n" "le" "lx" "io")
|
|
|
|
|
|
|
|
foreach(MOD_NAME IN LISTS ICU_FIND_COMPONENTS)
|
2020-09-25 11:55:25 +00:00
|
|
|
if(NOT MOD_NAME IN_LIST ICU_KNOWN_COMPONENTS)
|
Add: introduce CMake for project management
CMake works on all our supported platforms, like MSVC, Mingw, GCC,
Clang, and many more. It allows for a single way of doing things,
so no longer we need shell scripts and vbs scripts to work on all
our supported platforms.
Additionally, CMake allows to generate project files for like MSVC,
KDevelop, etc.
This heavily reduces the lines of code we need to support multiple
platforms from a project perspective.
Addtiionally, this heavily improves our detection of libraries, etc.
2019-04-07 09:57:55 +00:00
|
|
|
message(FATAL_ERROR "Unknown ICU component: ${MOD_NAME}")
|
|
|
|
endif()
|
|
|
|
pkg_check_modules(PC_ICU_${MOD_NAME} QUIET icu-${MOD_NAME})
|
|
|
|
|
|
|
|
# Check the libraries returned by pkg-config really exist.
|
|
|
|
unset(PC_LIBRARIES)
|
|
|
|
foreach(LIBRARY IN LISTS PC_ICU_${MOD_NAME}_LIBRARIES)
|
|
|
|
unset(PC_LIBRARY CACHE)
|
|
|
|
find_library(PC_LIBRARY NAMES ${LIBRARY})
|
2020-09-25 11:55:25 +00:00
|
|
|
if(NOT PC_LIBRARY)
|
Add: introduce CMake for project management
CMake works on all our supported platforms, like MSVC, Mingw, GCC,
Clang, and many more. It allows for a single way of doing things,
so no longer we need shell scripts and vbs scripts to work on all
our supported platforms.
Additionally, CMake allows to generate project files for like MSVC,
KDevelop, etc.
This heavily reduces the lines of code we need to support multiple
platforms from a project perspective.
Addtiionally, this heavily improves our detection of libraries, etc.
2019-04-07 09:57:55 +00:00
|
|
|
unset(PC_ICU_${MOD_NAME}_FOUND)
|
|
|
|
endif()
|
|
|
|
list(APPEND PC_LIBRARIES ${PC_LIBRARY})
|
|
|
|
endforeach()
|
|
|
|
unset(PC_LIBRARY CACHE)
|
|
|
|
|
2020-09-25 11:55:25 +00:00
|
|
|
if(${PC_ICU_${MOD_NAME}_FOUND})
|
Add: introduce CMake for project management
CMake works on all our supported platforms, like MSVC, Mingw, GCC,
Clang, and many more. It allows for a single way of doing things,
so no longer we need shell scripts and vbs scripts to work on all
our supported platforms.
Additionally, CMake allows to generate project files for like MSVC,
KDevelop, etc.
This heavily reduces the lines of code we need to support multiple
platforms from a project perspective.
Addtiionally, this heavily improves our detection of libraries, etc.
2019-04-07 09:57:55 +00:00
|
|
|
set(ICU_COMPONENT_FOUND TRUE)
|
|
|
|
set(ICU_${MOD_NAME}_FOUND TRUE)
|
|
|
|
set(ICU_${MOD_NAME}_LIBRARIES ${PC_LIBRARIES})
|
|
|
|
set(ICU_${MOD_NAME}_INCLUDE_DIRS ${PC_ICU_${MOD_NAME}_INCLUDE_DIRS})
|
|
|
|
set(ICU_VERSION ${PC_ICU_${MOD_NAME}_VERSION})
|
|
|
|
endif()
|
|
|
|
endforeach()
|
|
|
|
|
|
|
|
include(FindPackageHandleStandardArgs)
|
|
|
|
find_package_handle_standard_args(ICU
|
|
|
|
FOUND_VAR ICU_FOUND
|
|
|
|
REQUIRED_VARS ICU_COMPONENT_FOUND
|
|
|
|
VERSION_VAR ICU_VERSION
|
|
|
|
HANDLE_COMPONENTS
|
|
|
|
)
|