blob: c8ac5c4c385f7b7839c36399dfcd52a5fd4251ce (
plain) (
blame)
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
|
project(locales C)
cmake_minimum_required(VERSION 2.8)
option(LOCALE_PROFILE "Install profile file setting the MUSL_LOCPATH environment variable" ON)
include(GNUInstallDirs)
list (APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR})
set(GETTEXT_PACKAGE "musl-locales")
set(MUSL_LOCPATH i18n/locales/musl CACHE PATH "Locales directory" FORCE)
configure_file(config.h.in config.h)
if(LOCALE_PROFILE)
configure_file(locale.in 00locale.sh)
endif(LOCALE_PROFILE)
find_package(Intl)
set(LOCALE_SOURCES locale.c categories.c categories.h config.h)
add_executable(locale ${LOCALE_SOURCES})
if(Intl_LIBRARIES)
target_link_libraries(locale ${Intl_LIBRARIES})
endif()
target_compile_options(locale
PRIVATE $<$<COMPILE_LANGUAGE:C>:-std=gnu11 -Wno-pedantic>
)
if(LOCALE_PROFILE)
install(PROGRAMS ${CMAKE_BINARY_DIR}/00locale.sh DESTINATION
"${CMAKE_INSTALL_FULL_SYSCONFDIR}/profile.d")
endif(LOCALE_PROFILE)
install(TARGETS locale DESTINATION bin)
add_subdirectory(po)
add_subdirectory(musl-po)
|