summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2022-09-30 09:44:24 +0200
committerSlávek Banko <slavek.banko@axis.cz>2022-09-30 10:13:50 +0200
commit175f6eab4b0462c46362d2694e3b9e46b8dfbf6c (patch)
treee0360ee108ddb5d311d50f79bdf09fe9e21e6456 /CMakeLists.txt
parenta24f135509b218992d30e7d84d916c99f86cecfc (diff)
downloadkoffice-i18n-175f6eab4b0462c46362d2694e3b9e46b8dfbf6c.tar.gz
koffice-i18n-175f6eab4b0462c46362d2694e3b9e46b8dfbf6c.zip
Conversion to CMake build system.
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt66
1 files changed, 66 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644
index 00000000..1a76174e
--- /dev/null
+++ b/CMakeLists.txt
@@ -0,0 +1,66 @@
+#################################################
+#
+# (C) 2020-2022 Slávek Banko
+# slavek.banko (AT) axis.cz
+#
+# Improvements and feedback are welcome
+#
+# This file is released under GPL >= 2
+#
+#################################################
+
+cmake_minimum_required( VERSION 3.1 )
+
+
+##### general package setup #####################
+
+project( koffice-i18n )
+
+
+##### include essential cmake modules ###########
+
+include( FindPkgConfig ) # required for find_package( TDE )
+
+
+##### include our cmake modules #################
+
+include( TDEMacros )
+
+
+##### set version number ########################
+
+tde_set_project_version( )
+
+
+##### find required stuff #######################
+
+find_package( TDE )
+
+include( TDESetupPaths )
+tde_setup_paths( )
+
+
+##### process languages #########################
+
+file( GLOB _dirs RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} * )
+list( SORT _dirs )
+
+string( REGEX REPLACE "[ \r\n\t]+" ";" _linguas "$ENV{LINGUAS}" )
+
+foreach( _dir IN LISTS _dirs )
+ string( REGEX REPLACE "^${PROJECT_NAME}-" "" _lang "${_dir}" )
+ if( "${_dir}" MATCHES "^${PROJECT_NAME}-"
+ AND IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/${_dir}
+ AND EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${_dir}/CMakeLists.txt
+ AND ( "${_lang}" STREQUAL "en" OR
+ "${_linguas}" MATCHES "^;*$" OR
+ ";${_linguas};" MATCHES ";${_lang};" ))
+ add_subdirectory( ${_dir} )
+ string( REGEX REPLACE "@" "_" _lang_target "${_lang}" )
+ add_custom_target( install-${_lang_target}
+ COMMAND ${CMAKE_COMMAND}
+ -DCOMPONENT=${_lang}
+ -P ${CMAKE_BINARY_DIR}/cmake_install.cmake
+ )
+ endif()
+endforeach()