[evolution-data-server/wip/cmake] Merge changes done in the evolution/



commit cb2b8e8e2bdbb08bc30a3847400953f08786956b
Author: Milan Crha <mcrha redhat com>
Date:   Fri Sep 30 16:52:54 2016 +0200

    Merge changes done in the evolution/

 CMakeLists.txt                                    |    1 -
 cmake/modules/FindIntltool.cmake                  |   31 ++++++++++++++++++++-
 cmake/modules/FindSMIME.cmake                     |   10 +++++++
 cmake/modules/PkgConfigEx.cmake                   |    2 +-
 services/evolution-source-registry/CMakeLists.txt |    2 +-
 5 files changed, 42 insertions(+), 4 deletions(-)
---
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 509d951..c3b48e4 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -257,7 +257,6 @@ CHECK_INCLUDE_FILE(zlib.h HAVE_ZLIB_H)
 CHECK_FUNCTION_EXISTS(fsync HAVE_FSYNC)
 CHECK_FUNCTION_EXISTS(strptime HAVE_STRPTIME)
 CHECK_FUNCTION_EXISTS(nl_langinfo HAVE_NL_LANGINFO)
-CHECK_FUNCTION_EXISTS(fsync HAVE_FSYNC)
 
 # ******************************
 # required executables
diff --git a/cmake/modules/FindIntltool.cmake b/cmake/modules/FindIntltool.cmake
index 17b1718..f6f27fe 100644
--- a/cmake/modules/FindIntltool.cmake
+++ b/cmake/modules/FindIntltool.cmake
@@ -36,6 +36,10 @@
 #    Adds rule to call intltool-merge. The args are optional arguments.
 #    This can be called in any folder, only the GETTEXT_PO_DIR should
 #    be properly set, otherwise the call will fail.
+#
+# add_appdata_file(_infilename _outfilename)
+#    A shortcut to call intltool-merge() for an appdata file and install it
+#    to ${SHARE_INSTALL_DIR}/appdata
 
 include(FindGettext)
 
@@ -173,8 +177,33 @@ macro(intltool_merge _in_filename _out_filename)
                )
        else(_has_no_translations)
                add_custom_command(OUTPUT ${_out}
-                       COMMAND ${INTLTOOL_MERGE} ${_args} --quiet "${GETTEXT_PO_DIR}" "${_in}" "${_out}"
+                       COMMAND ${INTLTOOL_MERGE} ${_args} --quiet 
--cache="${CMAKE_BINARY_DIR}/po/.intltool-merge-cache" "${GETTEXT_PO_DIR}" "${_in}" "${_out}"
                        DEPENDS ${_in}
                )
        endif(_has_no_translations)
 endmacro(intltool_merge)
+
+macro(add_appdata_file _infilename _outfilename)
+       if(NOT TARGET appdata-files)
+               add_custom_target(appdata-files ALL)
+       endif(NOT TARGET appdata-files)
+
+       set(_out ${_outfilename})
+       get_filename_component(_outtarget ${_out} NAME_WE)
+       get_filename_component(_path ${_out} DIRECTORY)
+       if(_path STREQUAL "")
+               set(_out ${CMAKE_CURRENT_BINARY_DIR}/${_out})
+       endif(_path STREQUAL "")
+
+       intltool_merge(${_infilename} ${_out} --xml-style --utf8)
+
+       add_custom_target(appdata-${_outtarget}
+               DEPENDS ${_out}
+       )
+
+       add_dependencies(appdata-files appdata-${_outtarget})
+
+       install(FILES ${_out}
+               DESTINATION ${SHARE_INSTALL_DIR}/appdata
+       )
+endmacro(add_appdata_file)
diff --git a/cmake/modules/FindSMIME.cmake b/cmake/modules/FindSMIME.cmake
index 043dfed..3f47a65 100644
--- a/cmake/modules/FindSMIME.cmake
+++ b/cmake/modules/FindSMIME.cmake
@@ -9,6 +9,7 @@
 #    MANUAL_NSPR_LIBS - if non-empty, then contains manual nspr libraries, used for target_link_libraries() 
and similar commands
 #    MANUAL_NSS_INCLUDES - if non-empty, then contains manual nss include directory, used for 
target_include_directories() and similar commands
 #    MANUAL_NSS_LIBS - if non-empty, then contains manual nss libraries, used for target_link_libraries() 
and similar commands
+#    MOZILLA_NSS_LIB_DIR - a lib directory where Mozilla stores its libraries
 
 include(CheckIncludeFiles)
 include(CheckCSourceCompiles)
@@ -27,6 +28,7 @@ endif(NOT ENABLE_SMIME)
 
 set(mozilla_nspr "")
 set(mozilla_nss "")
+set(MOZILLA_NSS_LIB_DIR "")
 
 # Use pkg-config when none is specified
 if((WITH_NSPR_INCLUDES STREQUAL "") AND (WITH_NSPR_LIBS STREQUAL "") AND (WITH_NSS_INCLUDES STREQUAL "") AND 
(WITH_NSS_INCLUDES STREQUAL ""))
@@ -47,10 +49,13 @@ if((WITH_NSPR_INCLUDES STREQUAL "") AND (WITH_NSPR_LIBS STREQUAL "") AND (WITH_N
        endforeach(pkg)
 
        if((NOT (mozilla_nspr STREQUAL "")) AND (NOT (mozilla_nss STREQUAL "")))
+               pkg_check_variable(_nss_libdir ${mozilla_nss} libdir)
+
                set(MANUAL_NSPR_INCLUDES "")
                set(MANUAL_NSPR_LIBS "")
                set(MANUAL_NSS_INCLUDES "")
                set(MANUAL_NSS_LIBS "")
+               set(MOZILLA_NSS_LIB_DIR "${_nss_libdir}")
                return()
        endif((NOT (mozilla_nspr STREQUAL "")) AND (NOT (mozilla_nss STREQUAL "")))
 endif()
@@ -131,6 +136,11 @@ set(MANUAL_NSS_LIBS "")
 
 if(NOT (WITH_NSS_LIBS STREQUAL ""))
        set(MANUAL_NSS_LIBS "-L${WITH_NSS_LIBS}")
+       set(MOZILLA_NSS_LIB_DIR "${WITH_NSS_LIBS}")
 endif(NOT (WITH_NSS_LIBS STREQUAL ""))
 
 set(MANUAL_NSS_LIBS "${MANUAL_NSS_LIBS} ${nsslibs} ${MANUAL_NSPR_LIBS}")
+
+if(MOZILLA_NSS_LIB_DIR STREQUAL "")
+       set(MOZILLA_NSS_LIB_DIR "${LIB_INSTALL_DIR}")
+endif(MOZILLA_NSS_LIB_DIR STREQUAL "")
diff --git a/cmake/modules/PkgConfigEx.cmake b/cmake/modules/PkgConfigEx.cmake
index 5c4a17d..866fe7c 100644
--- a/cmake/modules/PkgConfigEx.cmake
+++ b/cmake/modules/PkgConfigEx.cmake
@@ -29,7 +29,7 @@ macro(pkg_check_modules_for_option _option_name _option_description _prefix _mod
        pkg_check_modules(${_prefix} ${_module0} ${ARGN})
 
        if(NOT ${_prefix}_FOUND)
-               message(FATAL_ERROR "Necessary libraries not or not enough version. If you want to disable 
${_option_description}, please use -D${_option_name}=OFF argument to cmake command.")
+               message(FATAL_ERROR "Necessary libraries not found or not enough version. If you want to 
disable ${_option_description}, please use -D${_option_name}=OFF argument to cmake command.")
        endif(NOT ${_prefix}_FOUND)
 endmacro()
 
diff --git a/services/evolution-source-registry/CMakeLists.txt 
b/services/evolution-source-registry/CMakeLists.txt
index 457ea61..fa105b2 100644
--- a/services/evolution-source-registry/CMakeLists.txt
+++ b/services/evolution-source-registry/CMakeLists.txt
@@ -47,7 +47,7 @@ endif(NOT EXISTS ${CMAKE_CURRENT_BINARY_DIR}/builtin)
 
 set(builtin_sources)
 foreach(_file ${builtin_sources_files})
-       intltool_merge(${CMAKE_CURRENT_SOURCE_DIR}/builtin/${_file}.in 
${CMAKE_CURRENT_BINARY_DIR}/builtin/${_file} -d -u -c ${CMAKE_BINARY_DIR}/po/.intltool-merge-cache)
+       intltool_merge(${CMAKE_CURRENT_SOURCE_DIR}/builtin/${_file}.in 
${CMAKE_CURRENT_BINARY_DIR}/builtin/${_file} -d -u)
        list(APPEND builtin_sources ${CMAKE_CURRENT_BINARY_DIR}/builtin/${_file})
 endforeach(_file)
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]