diff options
| author | Stefan Boberg <[email protected]> | 2021-11-04 14:18:54 +0100 |
|---|---|---|
| committer | Stefan Boberg <[email protected]> | 2021-11-04 14:19:05 +0100 |
| commit | 472569d4a5f2daaef7e234d93b417ccb650be624 (patch) | |
| tree | 085c33f178855ad5ffe48b01bf99d41516ffa011 /thirdparty/utfcpp/CMakeLists.txt | |
| parent | Merge branch 'main' of https://github.com/EpicGames/zen (diff) | |
| download | zen-472569d4a5f2daaef7e234d93b417ccb650be624.tar.xz zen-472569d4a5f2daaef7e234d93b417ccb650be624.zip | |
Renamed 3rdparty -> thirdparty for legal compliance
Diffstat (limited to 'thirdparty/utfcpp/CMakeLists.txt')
| -rw-r--r-- | thirdparty/utfcpp/CMakeLists.txt | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/thirdparty/utfcpp/CMakeLists.txt b/thirdparty/utfcpp/CMakeLists.txt new file mode 100644 index 000000000..4e63087bc --- /dev/null +++ b/thirdparty/utfcpp/CMakeLists.txt @@ -0,0 +1,43 @@ +cmake_minimum_required (VERSION 3.0.2) +project (utf8cpp VERSION 3.1.2 LANGUAGES CXX) + +if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) + set(IS_ROOT_PROJECT ON) +else() + set(IS_ROOT_PROJECT OFF) +endif() + +option(UTF8_TESTS "Enable tests for UTF8-CPP" ${IS_ROOT_PROJECT}) +option(UTF8_INSTALL "Enable installation for UTF8-CPP" ${IS_ROOT_PROJECT}) +option(UTF8_SAMPLES "Enable building samples for UTF8-CPP" ${IS_ROOT_PROJECT}) + +add_library(utf8cpp INTERFACE) +target_include_directories(utf8cpp INTERFACE + "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/source>" + $<INSTALL_INTERFACE:include/utf8cpp> +) +add_library(utf8::cpp ALIAS utf8cpp) + +if(UTF8_INSTALL) + if(MSVC) + set(DEF_INSTALL_CMAKE_DIR CMake) + else() + include(GNUInstallDirs) # define CMAKE_INSTALL_* + set(DEF_INSTALL_CMAKE_DIR ${CMAKE_INSTALL_LIBDIR}/cmake/utf8cpp) + endif() + + install(DIRECTORY source/ DESTINATION include/utf8cpp) + install(TARGETS utf8cpp EXPORT utf8cppConfig) + install(EXPORT utf8cppConfig DESTINATION ${DEF_INSTALL_CMAKE_DIR}) +endif() + +if(UTF8_SAMPLES) + add_executable(docsample ${PROJECT_SOURCE_DIR}/samples/docsample.cpp) + target_link_libraries(docsample PRIVATE utf8::cpp) +endif() + +if(UTF8_TESTS) + enable_testing() + add_subdirectory(extern/gtest) + add_subdirectory(tests) +endif() |