From a4edb47f005d021dcd16999ec039b279ba4eb584 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sl=C3=A1vek=20Banko?= Date: Wed, 13 Feb 2019 22:59:19 +0100 Subject: Use common CMake tests. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Slávek Banko (cherry picked from commit ea8d5387f2d3f1d986341228715b235e96995e15) --- CMakeLists.txt | 3 --- ConfigureChecks.cmake | 39 +++++++++++++++++---------------------- po/CMakeLists.txt | 28 ++++------------------------ 3 files changed, 21 insertions(+), 49 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b263635..c74594b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -28,9 +28,6 @@ set(CPACK_SOURCE_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}-${QTCURVE_VERSION_FULL set(CPACK_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}-${QTCURVE_VERSION_FULL}") include(CPack) -exec_program(tde-config - ARGS --install locale --expandvars - OUTPUT_VARIABLE KDE3_LOCALE_PREFIX) ##### general package setup ##################### diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake index c98d708..2b4b88f 100644 --- a/ConfigureChecks.cmake +++ b/ConfigureChecks.cmake @@ -9,26 +9,25 @@ # ################################################# -##### check for gcc visibility support ######### -# FIXME -# This should check for [T]Qt3 visibility support + +# required stuff +find_package( TQt ) +find_package( TDE ) + +tde_setup_architecture_flags( ) + +include(TestBigEndian) +test_big_endian(WORDS_BIGENDIAN) + +tde_setup_largefiles( ) + + +##### check for gcc visibility support if( WITH_GCC_VISIBILITY ) - if( NOT UNIX ) - tde_message_fatal(FATAL_ERROR "\ngcc visibility support was requested, but your system is not *NIX" ) - endif( NOT UNIX ) - set( __KDE_HAVE_GCC_VISIBILITY 1 ) - set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility=hidden -fvisibility-inlines-hidden") - set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden -fvisibility-inlines-hidden") -endif( ) - - -if( BUILD_TRANSLATIONS AND NOT DEFINED MSGFMT_EXECUTABLE ) - find_program( MSGFMT_EXECUTABLE msgfmt ) - if( NOT MSGFMT_EXECUTABLE ) - tde_message_fatal( "msgfmt program is required, but was not found on your system" ) - endif( ) -endif( ) + tde_setup_gcc_visibility( ) +endif( WITH_GCC_VISIBILITY ) + check_type_size( "int" SIZEOF_INT BUILTIN_TYPES_ONLY ) check_type_size( "long" SIZEOF_LONG BUILTIN_TYPES_ONLY ) @@ -38,7 +37,3 @@ check_include_file( systems.h HAVE_SYSTEMS_H ) check_include_file( linux/inotify.h HAVE_INOTIFY ) check_function_exists( statvfs HAVE_STATVFS ) - -# common required stuff -find_package( TQt ) -find_package( TDE ) diff --git a/po/CMakeLists.txt b/po/CMakeLists.txt index e76a565..deef1da 100644 --- a/po/CMakeLists.txt +++ b/po/CMakeLists.txt @@ -1,25 +1,5 @@ -find_program(GETTEXT_MSGFMT_EXECUTABLE msgfmt) - -if(NOT GETTEXT_MSGFMT_EXECUTABLE) - message("------\n" - "NOTE: msgfmt not found. Translations will *not* be installed\n" - "------\n") -else(NOT GETTEXT_MSGFMT_EXECUTABLE) - set(catalogname qtcurve) - add_custom_target(translations ALL) - file(GLOB PO_FILES *.po) - foreach(_poFile ${PO_FILES}) - get_filename_component(_poFileName ${_poFile} NAME) - string(REGEX REPLACE "^${catalogname}_?" "" _langCode ${_poFileName} ) - string(REGEX REPLACE "\\.po$" "" _langCode ${_langCode} ) - if(_langCode) - get_filename_component(_lang ${_poFile} NAME_WE) - set(_gmoFile ${CMAKE_CURRENT_BINARY_DIR}/${_lang}.gmo) - add_custom_command(TARGET translations - COMMAND ${GETTEXT_MSGFMT_EXECUTABLE} --check -o ${_gmoFile} ${_poFile} - DEPENDS ${_poFile}) - install(FILES ${_gmoFile} DESTINATION ${KDE3_LOCALE_PREFIX}/${_langCode}/LC_MESSAGES/ RENAME ${catalogname}.mo) - endif( _langCode ) - endforeach(_poFile ${PO_FILES}) -endif(NOT GETTEXT_MSGFMT_EXECUTABLE) +file( GLOB _srcs RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.po ) +if( _srcs ) + tde_create_translation( LANG auto OUTPUT_NAME qtcurve ) +endif( ) -- cgit v1.2.1