-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
80 lines (69 loc) · 1.77 KB
/
CMakeLists.txt
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
cmake_minimum_required(VERSION 3.19)
project(
unicode
VERSION "1.0.0"
DESCRIPTION "Unicode related library"
HOMEPAGE_URL https://github.com/gavrilikhin-d/unicode
LANGUAGES CXX
)
option(BUILD_SHARED_LIBS "Build shared libraries" ON)
if(MSVC)
# warning level 4
add_compile_options(/W4)
else()
# lots of warnings
add_compile_options(-Wall -Wextra -Wpedantic)
endif()
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
set_property(
CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS
Debug RelWithDebInfo Release MinSizeRel
)
set(
CMAKE_BUILD_TYPE "Debug" CACHE STRING
"Debug | RelWithDebInfo | Release | MinSizeRel"
FORCE
)
message(
STATUS
"No build type was specified, will default to ${CMAKE_BUILD_TYPE}"
)
endif()
# Print out path and version of any installed commands
message(STATUS "CMake (${CMAKE_COMMAND}) Version: ${CMAKE_VERSION}")
if(XCODE)
set(version_flag -version)
else()
set(version_flag --version)
endif()
execute_process(
COMMAND ${CMAKE_MAKE_PROGRAM} ${version_flag}
OUTPUT_VARIABLE _CMAKE_MAKE_PROGRAM_VERSION
OUTPUT_STRIP_TRAILING_WHITESPACE
)
message(
STATUS
"CMake Make Program (${CMAKE_MAKE_PROGRAM}) Version:
${_CMAKE_MAKE_PROGRAM_VERSION}"
)
message(
STATUS
"C Compiler (${CMAKE_C_COMPILER}) Version: ${CMAKE_C_COMPILER_VERSION}"
)
message(
STATUS
"C++ Compiler (${CMAKE_CXX_COMPILER}) Version:
${CMAKE_CXX_COMPILER_VERSION}"
)
message(STATUS "")
set(CMAKE_DISABLE_IN_SOURCE_BUILD YES)
# ICU dependency
find_package(ICU 70 COMPONENTS uc i18n REQUIRED)
while (NOT EXISTS ${ICU_INCLUDE_DIRS}/unicode/brkiter.h)
# TODO: fallback to other package
message(FATAL_ERROR "ICU include directory doesn't contain brkiter.h")
endwhile()
include_directories(include)
add_subdirectory(sources)
add_subdirectory(tests)
add_subdirectory(benchmarks)