Bugfix

Bugfix

--- modules/HdrHistogram.cmake
+++ modules/HdrHistogram.cmake
@@ -14,7 +14,10 @@
   if(CMAKE_MAKE_PROGRAM MATCHES "(MSBuild|devenv|msdev|nmake)")
     set_source_files_properties(${SOURCE_FILES} PROPERTIES COMPILE_FLAGS "/wd4146 /wd4200 /wd4244")
   elseif(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_GNUC)
-    set_source_files_properties(${SOURCE_FILES} PROPERTIES COMPILE_FLAGS "-Wall -Werror")
+    set(CMAKE_OLD_C_FLAGS ${CMAKE_C_FLAGS})
+    set(CMAKE_OLD_CXX_FLAGS ${CMAKE_CXX_FLAGS})
+    string(REPLACE "-pedantic" "" CMAKE_C_FLAGS ${CMAKE_C_FLAGS})
+    string(REPLACE "-pedantic" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
   endif()

   # Add module library
@@ -24,4 +27,10 @@
   # Set module folder
   set_target_properties(histogram PROPERTIES FOLDER modules/HdrHistogram)

+  # Restore default warnings
+  if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_GNUC)
+    set(CMAKE_C_FLAGS ${CMAKE_OLD_C_FLAGS})
+    set(CMAKE_CXX_FLAGS ${CMAKE_OLD_CXX_FLAGS})
+  endif()
+
 endif()


cmake: Check for existing header file in neon cmake module.

Reviewed-by: Andreas Schneider <5be00ddc76278cf6077f5047ca3384a88460c671@cryptomilk.org>

--- cmake/Modules/FindNeon.cmake
+++ cmake/Modules/FindNeon.cmake
@@ -23,7 +23,7 @@

 find_path(NEON_INCLUDE_DIR
     NAMES
-        neon/neon_basics.h
+        neon/ne_basic.h
     PATHS
         ${_NEON_INCLUDEDIR}
 )


libproj4 2016-05-13 (4b728422)

libproj4 2016-05-13 (4b728422)

Code extracted from:

    https://gitlab.kitware.com/third-party/proj.git

at commit 4b7284226e6a218cc06d26511d01ee3f362d30d8 (for/vtk).

--- cmake/Proj4InstallPath.cmake
+++ cmake/Proj4InstallPath.cmake
@@ -1,23 +1,6 @@
 #----------------------------------------------
 # installation path settings
 #----------------------------------------------
-if(WIN32)
-  if(DEFINED ENV{OSGEO4W_ROOT})
-    set(OSGEO4W_ROOT_DIR $ENV{OSGEO4W_ROOT})
-  else()
-    set(OSGEO4W_ROOT_DIR c:/OSGeo4W)
-  endif()
-  set(DEFAULT_PROJ_ROOT_DIR ${OSGEO4W_ROOT_DIR})
-endif()
-if(UNIX)
-  set(DEFAULT_PROJ_ROOT_DIR "/usr/local/")
-endif(UNIX)
-
-
-IF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
-	SET(CMAKE_INSTALL_PREFIX ${DEFAULT_PROJ_ROOT_DIR} CACHE PATH "Foo install
-		 prefix" FORCE)
-ENDIF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)

 #TODO
 # for data install testing the PROJ_LIB envVar


build: filter out a filtering list, 80-col (NFC)

Rather than check the two names individually use a `IN_LIST` to make it
simpler to reason about.  Wrap another conditional to 80-columns.  NFC.

--- cmake/modules/AddSwift.cmake
+++ cmake/modules/AddSwift.cmake
@@ -1764,14 +1764,18 @@
         # Add Swift standard library targets as dependencies to the top-level
         # convenience target.
         if(SWIFTLIB_TARGET_LIBRARY)
+          set(FILTERED_UNITTESTS
+                swiftStdlibCollectionUnittest
+                swiftStdlibUnicodeUnittest)
+
           foreach(arch ${SWIFT_SDK_${sdk}_ARCHITECTURES})
             set(VARIANT_SUFFIX "-${SWIFT_SDK_${sdk}_LIB_SUBDIR}-${arch}")
-            if(TARGET "swift-stdlib${VARIANT_SUFFIX}" AND TARGET "swift-test-stdlib${VARIANT_SUFFIX}")
+            if(TARGET "swift-stdlib${VARIANT_SUFFIX}" AND
+               TARGET "swift-test-stdlib${VARIANT_SUFFIX}")
               add_dependencies("swift-stdlib${VARIANT_SUFFIX}"
                   ${lipo_target}
                   ${lipo_target_static})
-              if((NOT "${name}" STREQUAL "swiftStdlibCollectionUnittest") AND
-                 (NOT "${name}" STREQUAL "swiftStdlibUnicodeUnittest"))
+              if(NOT "${name}" IN_LIST FILTERED_UNITTESTS)
                 add_dependencies("swift-test-stdlib${VARIANT_SUFFIX}"
                     ${lipo_target}
                     ${lipo_target_static})


cmake: Add ``-Fsystem ${SDK_PATH}/System/Library/PrivateFrameworks``
for overlays builds.

Related to rdar://problem/28466433

--- cmake/modules/AddSwift.cmake
+++ cmake/modules/AddSwift.cmake
@@ -1542,6 +1542,11 @@
           elseif(SWIFTLIB_STATIC)
             list(APPEND swiftlib_swift_compile_flags_all -D_LIB)
           endif()
+        endif()
+
+        # Add PrivateFrameworks, rdar://28466433
+        if(SWIFTLIB_IS_SDK_OVERLAY)
+          list(APPEND swiftlib_swift_compile_flags_all "-Fsystem" "${SWIFT_SDK_${sdk}_PATH}/System/Library/PrivateFrameworks/")
         endif()

         # Add this library variant.


build: avoid passing in `--sysroot=` twice on Android

This just cleans up the invocation generation for android to avoid passing in
`--sysroot=` twice to the driver with the same value.  This has no impact, but
cleans up the command line so it is easier to see what is going on.

--- cmake/modules/AddSwift.cmake
+++ cmake/modules/AddSwift.cmake
@@ -132,10 +132,11 @@
   endif()

   if("${CFLAGS_SDK}" STREQUAL "ANDROID")
-    list(APPEND result
-      "--sysroot=${SWIFT_SDK_ANDROID_ARCH_${CFLAGS_ARCH}_PATH}"
-      # Use the linker included in the Android NDK.
-      "-B" "${SWIFT_SDK_ANDROID_ARCH_${CFLAGS_ARCH}_NDK_PREBUILT_PATH}/${SWIFT_SDK_ANDROID_ARCH_${CFLAGS_ARCH}_NDK_TRIPLE}/bin/")
+    # lld can handle targeting the android build.  However, if lld is not
+    # enabled, then fallback to the linker included in the android NDK.
+    if(NOT SWIFT_ENABLE_LLD_LINKER)
+      list(APPEND result "-B" "${SWIFT_SDK_ANDROID_ARCH_${CFLAGS_ARCH}_NDK_PREBUILT_PATH}/${SWIFT_SDK_ANDROID_ARCH_${CFLAGS_ARCH}_NDK_TRIPLE}/bin")
+    endif()
   endif()

   if(IS_DARWIN)


Trivial packaging fix

Trivial packaging fix

--- cmake/BALLPackageConfig.cmake
+++ cmake/BALLPackageConfig.cmake
@@ -22,7 +22,7 @@
 		SET(CPACK_NSIS_DISPLAY_NAME "BALLView-RT-${CPACK_PACKAGE_VERSION}")
 	ELSE()
 		SET(CPACK_NSIS_DISPLAY_NAME "BALLView-${CPACK_PACKAGE_VERSION}")
-	ENDIF
+	ENDIF()
 	SET(CPACK_NSIS_HELP_LINK "http:\\\\\\\\www.ball-project.org")
 	SET(CPACK_NSIS_URL_INFO_ABOUT "http:\\\\\\\\www.ball-project.org")
 	SET(CPACK_NSIS_CONTACT "ball@bioinf.uni-sb.de")


search for boost_system in FindBoost

search for boost_system in FindBoost

--- cmake/Modules/FindBoost.cmake
+++ cmake/Modules/FindBoost.cmake
@@ -21,6 +21,7 @@
 #  BOOST_THREAD-MT_FOUND               True if Boost Thread was found.
 #  BOOST_UNIT_TEST_FRAMEWORK_FOUND     True if Boost Unit Test Framework was found.
 #  BOOST_WSERIALIZATION_FOUND          True if Boost WSerialization was found.
+#  BOOST_SYSTEM_FOUND                  True if Boost System was found.
 #
 #  BOOST_DATE_TIME_LIBRARY             The Boost Date Time libary.
 #  BOOST_FILESYSTEM_LIBRARY            The Boost Filesystem libary.
@@ -35,6 +36,7 @@
 #  BOOST_THREAD_LIBRARY                The Boost Thread libary.
 #  BOOST_UNIT_TEST_FRAMEWORK_LIBRARY   The Boost Unit Test Framework libary.
 #  BOOST_WSERIALIZATION_LIBRARY        The Boost WSerialization libary.
+#  BOOST_SYSTEM_LIBRARY                The Boost System libary.
 #
 #  Copyright (c) 2006 Andreas Schneider <mail@cynapses.org>
 #  Copyright (c) 2007 Wengo
@@ -312,6 +314,15 @@
           ${BOOST_LIBRARIES_SEARCH_DIRS}
       )
     endif (NOT BOOST_WSERIALIZATION_LIBRARY)
+
+    if (NOT BOOST_SYSTEM_LIBRARY)
+      find_library(BOOST_SYSTEM_LIBRARY
+        NAMES
+          boost_system${TMP_BOOST_LIBRARIES_SUFFIX}
+        PATHS
+          ${BOOST_LIBRARIES_SEARCH_DIRS}
+      )
+    endif (NOT BOOST_SYSTEM_LIBRARY)

     if (BOOST_DATE_TIME_LIBRARY)
       set(BOOST_DATE_TIME_FOUND TRUE)
@@ -352,6 +363,9 @@
     if (BOOST_WSERIALIZATION_LIBRARY)
       set(BOOST_WSERIALIZATION_FOUND TRUE)
     endif (BOOST_WSERIALIZATION_LIBRARY)
+    if (BOOST_SYSTEM_LIBRARY)
+      set(BOOST_SYSTEM_FOUND TRUE)
+    endif (BOOST_SYSTEM_LIBRARY)

   endforeach (TMP_BOOST_LIBRARIES_SUFFIX)

@@ -437,6 +451,12 @@
       ${BOOST_WSERIALIZATION_LIBRARY}
     )
   endif (BOOST_WSERIALIZATION_FOUND)
+  if (BOOST_SYSTEM_FOUND)
+    set(BOOST_LIBRARIES
+      ${BOOST_LIBRARIES}
+      ${BOOST_SYSTEM_LIBRARY}
+    )
+  endif (BOOST_SYSTEM_FOUND)

   if (BOOST_INCLUDE_DIRS AND BOOST_LIBRARIES)
     set(BOOST_FOUND TRUE)


Do not overwrite CBLAS_LIBRARIES given via command line

--- cmake/Modules/FindCBLAS.cmake
+++ cmake/Modules/FindCBLAS.cmake
@@ -18,7 +18,9 @@
 # handle the QUIETLY and REQUIRED arguments and set CBLAS_FOUND to TRUE if
 # all listed variables are TRUE

-set (CBLAS_LIBRARIES ${CBLAS_LIBRARIES_PRE})
+if (CBLAS_LIBRARIES_PRE)
+  set (CBLAS_LIBRARIES ${CBLAS_LIBRARIES_PRE})
+endif ()
 if (CBLAS_INCLUDES_PRE)
   set (CBLAS_INCLUDES ${CBLAS_INCLUDES_PRE})
   set (CBLAS_FOUND TRUE CACHE INTERNAL "")


Try to fix ppa debuild.

Try to fix ppa debuild.

--- cmake/Modules/UploadPPA.cmake
+++ cmake/Modules/UploadPPA.cmake
@@ -70,12 +70,12 @@

     file(WRITE "${DEBIAN_SOURCE_DIR}/debian/${CPACK_DEBIAN_PACKAGE_NAME}.install"
          "usr/bin/*\n"
-         "usr/share/*/conf/*\n"
-         "usr/share/*/refs/*\n")
+         "usr/share/aff3ct-${AFF3CT_VERSION_FULL}/conf/*\n"
+         "usr/share/aff3ct-${AFF3CT_VERSION_FULL}/refs/*\n")

     file(WRITE "${DEBIAN_SOURCE_DIR}/debian/${CPACK_DEBIAN_PACKAGE_NAME}-dev.install"
-         "usr/lib/*\n"
-         "usr/include/*\n")
+         "usr/lib/x86_64-linux-gnu/*\n"
+         "usr/include/aff3ct-${AFF3CT_VERSION_FULL}/*\n")

     ##############################################################################
     # debian/copyright
@@ -89,11 +89,11 @@
          "\n\n%:\n"
          "\tdh  $@ --buildsystem=cmake\n"
          "\noverride_dh_auto_configure:\n"
-         "\tDESTDIR=\"$(CURDIR)/debian/${CPACK_DEBIAN_PACKAGE_NAME}\" dh_auto_configure"
+         "\tDESTDIR=\"$(CURDIR)\" dh_auto_configure"
          " -- -DCMAKE_BUILD_TYPE=Release -DAFF3CT_COMPILE_SHARED_LIB=ON -DPACKAGE_TGZ=OFF "
          "-DAFF3CT_OVERRIDE_VERSION=${GIT_VERSION} -DCMAKE_CXX_FLAGS='${CMAKE_CXX_FLAGS}'"
          "\n\noverride_dh_auto_install:\n"
-         "\tdh_auto_install --destdir=\"$(CURDIR)/debian/${CPACK_DEBIAN_PACKAGE_NAME}\" --buildsystem=cmake"
+         "\tdh_auto_install --destdir=\"$(CURDIR)\" --buildsystem=cmake"
          "\n\noverride_dh_strip:\n")

     execute_process(COMMAND chmod +x ${DEBIAN_RULES})


thou shalt respect $ENV{PYTHONPATH}

thou shalt respect $ENV{PYTHONPATH}

--- cmake/PythonEnvironment.cmake
+++ cmake/PythonEnvironment.cmake
@@ -1,7 +1,7 @@
 MACRO(GET_PYTHON_ENV)
 	LIST(APPEND PYTHON_ENV_VARS GDB="gdb -x ${CMAKE_SOURCE_DIR}/src/.gdb --args")
 	LIST(APPEND PYTHON_ENV_VARS PYTHON=${PYTHON_EXECUTABLE})
-	LIST(APPEND PYTHON_ENV_VARS PYTHONPATH=${CMAKE_INSTALL_PREFIX}/${PYTHON_PACKAGES_PATH})
+	LIST(APPEND PYTHON_ENV_VARS PYTHONPATH=${CMAKE_INSTALL_PREFIX}/${PYTHON_PACKAGES_PATH}:$ENV{PYTHONPATH})
 	if(WIN32)
 	  LIST(APPEND PYTHON_ENV_VARS PATH=${CMAKE_INSTALL_PREFIX}/lib;$ENV{PATH})
 	elseif(APPLE)
@@ -9,4 +9,4 @@
 	else()
 	  LIST(APPEND PYTHON_ENV_VARS LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:$ENV{LD_LIBRARY_PATH})
 	endif()
-ENDMACRO()+ENDMACRO()


Add some description of when the last two IFs can happen in version number recognition.

--- cmake/modules/FindP4EST.cmake
+++ cmake/modules/FindP4EST.cmake
@@ -141,7 +141,12 @@
   #
   # We cannot rely on the fact that SUBMINOR or PATCH are defined.
   # Nevertheless, we need a full version number for our preprocessor macros
-  # to work. Therefore, set those numbers to 0 if necessary.
+  # to work. If the p4est version number is only of the form x.y instead of
+  # a.b.c.d, then the last two REGEX_REPLACE calls above will have failed
+  # because the regular expression didn't match the version string,
+  # and P4EST_VERSION_SUBMINOR and P4EST_VERSION_PATCH will either be
+  # empty or be the full version string. In those cases, set those numbers
+  # to 0 if necessary.
   #
   IF("${P4EST_VERSION_SUBMINOR}" MATCHES "^(|${P4EST_VERSION})$")
     SET(P4EST_VERSION_SUBMINOR "0")


wxwidgets.cmake now sets options for agg if library was found (similar to freetype inclusion).

svn path=/trunk/; revision=7071

--- cmake/modules/wxwidgets.cmake
+++ cmake/modules/wxwidgets.cmake
@@ -57,6 +57,18 @@
       ${FREETYPE_LIBRARIES}
       )
     endif(WITH_FREETYPE)
+    if(WITH_AGG)
+			message( "${AGG_INCLUDE_DIR} ${AGG_LIBRARIES} ${AGG_DEFINITIONS}" )
+      set(
+      wxwidgets_COMPILE_FLAGS
+      "${wxwidgets_COMPILE_FLAGS} -I${AGG_INCLUDE_DIR}"
+      )
+      set(
+      wxwidgets_LINK_FLAGS
+      ${wxwidgets_LINK_FLAGS}
+      ${AGG_LIBRARIES}
+      )
+    endif(WITH_AGG)
     set(DRIVERS_LINK_FLAGS ${DRIVERS_LINK_FLAGS} ${wxwidgets_LINK_FLAGS})
   else(wxWidgets_FOUND)
     set(PLD_wxwidgets OFF CACHE BOOL "Enable wxwidgets device" FORCE)


enhance cmscopyfiles script to copy directories

see issue https://github.com/smanders/externpro/issues/151#issuecomment-341579613

--- modules/cmscopyfiles.cmake
+++ modules/cmscopyfiles.cmake
@@ -9,6 +9,10 @@
   endif()
   file(GLOB files ${item})
   foreach(f ${files})
-    execute_process(COMMAND ${CMAKE_COMMAND} -E copy ${f} ${dst})
+    if(IS_DIRECTORY ${f})
+      execute_process(COMMAND ${CMAKE_COMMAND} -E copy_directory ${f} ${dst})
+    else()
+      execute_process(COMMAND ${CMAKE_COMMAND} -E copy ${f} ${dst})
+    endif()
   endforeach()
 endforeach()


Create virtualenv only once

Create virtualenv only once

--- scripts/PythonVirtualEnv.cmake
+++ scripts/PythonVirtualEnv.cmake
@@ -1,5 +1,9 @@
 # Creates a python virtual environment in the build directory
 # See https://github.com/UCL/GreatCMakeCookOff/wiki for information
+if(VIRTUALENV_WAS_CREATED)
+  return()
+endif()
+
 find_package(PythonInterp)
 include(Utilities)
 include(PythonPackage)
@@ -46,7 +50,7 @@
 find_python_package(venv QUIET)
 find_python_package(virtualenv QUIET)

-set(VIRTUALENV_DIRECTORY ${CMAKE_BINARY_DIR}/external/virtualenv
+set(VIRTUALENV_DIRECTORY "${CMAKE_BINARY_DIR}/external/virtualenv"
     CACHE INTERNAL "Path to virtualenv" )
 if(venv_EXECUTABLE)
   _create_virtualenv_from_exec("${venv_EXECUTABLE}")
@@ -97,6 +101,7 @@
     message(FATAL_ERROR "script failed")
 endif()

+set(VIRTUALENV_WAS_CREATED TRUE CACHE INTERNAL "Virtualenv has been created")

 function(add_package_to_virtualenv PACKAGE)
     find_python_package(${PACKAGE} LOCAL)


VirtualEnv to work with and without canopy

Corrects problem introduced when dealing with issue #82

--- scripts/PythonVirtualEnv.cmake
+++ scripts/PythonVirtualEnv.cmake
@@ -31,9 +31,24 @@
     _add_to_a_path("${PROJECT_BINARY_DIR}/ldpaths" "${PATH}")
 endfunction()

-function(_create_virtualenv call)
-    execute_process(
-	COMMAND ${call} --system-site-packages ${VIRTUALENV_DIRECTORY}
+function(_create_virtualenv_from_exec call)
+    execute_process(COMMAND
+        ${call} --system-site-packages ${VIRTUALENV_DIRECTORY}
+        RESULT_VARIABLE RESULT
+        ERROR_VARIABLE ERROR
+        OUTPUT_VARIABLE OUTPUT
+    )
+    if(NOT "${RESULT}" STREQUAL "0")
+        message(STATUS "${RESULT}")
+        message(STATUS "${OUTPUT}")
+        message(STATUS "${ERROR}")
+        message(FATAL_ERROR "Could not create virtual environment")
+    endif()
+endfunction()
+function(_create_virtualenv_from_package PACKAGE)
+    execute_process(COMMAND
+        ${PYTHON_EXECUTABLE} -m ${PACKAGE}
+            --system-site-packages ${VIRTUALENV_DIRECTORY}
         RESULT_VARIABLE RESULT
         ERROR_VARIABLE ERROR
         OUTPUT_VARIABLE OUTPUT
@@ -50,17 +65,17 @@
 # Canopy makes things more difficult.
 get_filename_component(python_bin "${PYTHON_EXECUTABLE}" PATH)
 find_program(venv_EXECUTABLE venv PATHS "${python_bin}" NO_DEFAULT_PATH)
-find_python_package(venv)
-find_python_package(virtualenv)
+find_python_package(venv QUIET)
+find_python_package(virtualenv QUIET)

 set(VIRTUALENV_DIRECTORY ${CMAKE_BINARY_DIR}/external/virtualenv
     CACHE INTERNAL "Path to virtualenv" )
 if(venv_EXECUTABLE)
-  _create_virtualenv("${venv_EXECUTABLE}")
+  _create_virtualenv_from_exec("${venv_EXECUTABLE}")
 elseif(venv_FOUND)
-  _create_virtualenv("${PYTHON_EXECUTABLE} -m venv")
+  _create_virtualenv_from_package("venv")
 elseif(virtualenv_FOUND)
-  _create_virtualenv("${PYTHON_EXECUTABLE} -m virtualenv")
+  _create_virtualenv_from_package("virtualenv")
 else()
   message(FATAL_ERROR "Could find neither venv nor virtualenv")
 endif()


fix for finding python libs

fix for finding python libs

--- cmake/FindPythonLibsNew.cmake
+++ cmake/FindPythonLibsNew.cmake
@@ -139,7 +139,9 @@
     # information the python interpreter itself gave us were more complete.
     find_library(PYTHON_LIBRARY
         NAMES "python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}"
+              "python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}m"
               "python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}mu"
+              "python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}dm"
         PATHS ${_PYTHON_LIBS_SEARCH}
         NO_SYSTEM_ENVIRONMENT_PATH)
 endif()


changed default libexecdir path to lib/...

git-svn-id: e31799a7ad59d6ea355ca047c69e0aee8a59fcd3@2886 53f5c7ee-bee3-0310-bbc5-ea0e15fffd5e

--- cmake/OpenSyncPlatforms.cmake
+++ cmake/OpenSyncPlatforms.cmake
@@ -6,14 +6,14 @@

 IF (NOT WIN32)
 	SET( LIB_INSTALL_DIR  "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}" )
-	SET( LIBEXEC_INSTALL_DIR  "${CMAKE_INSTALL_PREFIX}/libexec" )
+	SET( LIBEXEC_INSTALL_DIR  "${CMAKE_INSTALL_PREFIX}/lib" )
 	SET( BIN_INSTALL_DIR  "${CMAKE_INSTALL_PREFIX}/bin" )
 	SET( SHARE_INSTALL_DIR  "${CMAKE_INSTALL_PREFIX}/share" )
 	SET( INCLUDE_INSTALL_DIR  "${CMAKE_INSTALL_PREFIX}/include" )
 ELSE (NOT WIN32)
 	# Windows stuff goes here...
 	SET( LIB_INSTALL_DIR  "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}" )
-	SET( LIBEXEC_INSTALL_DIR  "${CMAKE_INSTALL_PREFIX}/libexec" )
+	SET( LIBEXEC_INSTALL_DIR  "${CMAKE_INSTALL_PREFIX}/lib" )
 	SET( BIN_INSTALL_DIR  "${CMAKE_INSTALL_PREFIX}/bin" )
 	SET( SHARE_INSTALL_DIR  "${CMAKE_INSTALL_PREFIX}/share" )
 	SET( INCLUDE_INSTALL_DIR  "${CMAKE_INSTALL_PREFIX}/include" )


more CMake output

more CMake output

--- cmake/custom/build_info.cmake
+++ cmake/custom/build_info.cmake
@@ -12,7 +12,7 @@
 set(_system                 "unknown")
 if (CMAKE_SYSTEM)
     set(_system ${CMAKE_SYSTEM})
-    message("-- System                   : ${CMAKE_SYSTEM}")
+    message("-- Operating system         : ${CMAKE_SYSTEM}")
 endif()

 set(_system_name            "unknown")
@@ -21,13 +21,11 @@
     #message("-- System name              : ${CMAKE_SYSTEM_NAME}")
 endif()

-
 set(_cmake_version          "unknown")
 if (CMAKE_VERSION)
     set(_cmake_version     ${CMAKE_VERSION})
     message("-- CMake version            : ${CMAKE_VERSION}")
 endif()
-

 set(_cmake_generator       "unknown")
 if (CMAKE_GENERATOR)
@@ -41,7 +39,6 @@
     message("-- CMake build type         : ${CMAKE_BUILD_TYPE}")
 endif()

-
 set(_fortran_compiler_id       "unknown")
 if (CMAKE_Fortran_COMPILER_ID)
     set(_fortran_compiler_id ${CMAKE_Fortran_COMPILER_ID})
@@ -52,6 +49,12 @@
 if (CMAKE_Fortran_COMPILER)
     set(_fortran_compiler ${CMAKE_Fortran_COMPILER})
     message("-- Fortran compiler         : ${CMAKE_Fortran_COMPILER}")
+endif()
+
+set(_python_fortran_version "unknown")
+if (PYTHON_Fortran_VERSION)
+    set(_python_fortran_version ${PYTHON_Fortran_VERSION})
+    message("-- Fortran compiler version : ${PYTHON_Fortran_VERSION}")
 endif()

 set(_fortran_compiler_flags "unknown")
@@ -72,10 +75,22 @@
     message("-- C compiler               : ${CMAKE_C_COMPILER}")
 endif()

+set(_python_c_version "unknown")
+if (PYTHON_C_VERSION)
+    set(_python_c_version ${PYTHON_C_VERSION})
+    message("-- C compiler version       : ${PYTHON_C_VERSION}")
+endif()
+
 set(_c_compiler_flags "unknown")
 if (CMAKE_C_FLAGS)
     set(_c_compiler_flags ${CMAKE_C_FLAGS})
     message("-- C compiler flags         : ${CMAKE_C_FLAGS}")
+endif()
+
+set(_cxx_compiler_id       "unknown")
+if (CMAKE_CXX_COMPILER_ID)
+    set(_cxx_compiler_id ${CMAKE_CXX_COMPILER_ID})
+    message("-- C++ compiler ID          : ${CMAKE_CXX_COMPILER_ID}")
 endif()

 set(_cxx_compiler           "unknown")
@@ -84,10 +99,16 @@
     message("-- C++ compiler             : ${CMAKE_CXX_COMPILER}")
 endif()

+set(_python_cxx_version "unknown")
+if (PYTHON_CXX_VERSION)
+    set(_python_cxx_version ${PYTHON_CXX_VERSION})
+    message("-- C++ compiler version     : ${PYTHON_CXX_VERSION}")
+endif()
+
 set(_cxx_compiler_flags     "unknown")
 if (CMAKE_CXX_FLAGS)
     set(_cxx_compiler_flags ${CMAKE_CXX_FLAGS})
-    message("-- CXX compiler flags     : ${CMAKE_CXX_FLAGS}")
+    message("-- C++ compiler flags     : ${CMAKE_CXX_FLAGS}")
 endif()

 set(_static_linking         "unknown")
@@ -108,7 +129,6 @@
     message("--     Explicit libraries   : ${EXPLICIT_LIBS}")
 endif()

-
 # generate the build_info.h include file with defined set of variables
 configure_file(
     ${CMAKE_CURRENT_LIST_DIR}/build_info.h.in


Correct declaration of internal CMake variables.

--- cmake/environmentchecks.cmake
+++ cmake/environmentchecks.cmake
@@ -84,25 +84,25 @@
 endif()

 if(CLANG_FORMAT_EXE AND GIT_EXE)
-  set(CLANG_FORMAT_TESTING_AVAILABLE TRUE INTERNAL BOOL "Executables required to run the ClangFormat test are available.")
+  set(CLANG_FORMAT_TESTING_AVAILABLE TRUE CACHE INTERNAL "Executables required to run the ClangFormat test are available.")
 endif()

 if(CLANG_TIDY_EXE)
-  set(CLANG_TIDY_AVAILABLE TRUE INTERNAL BOOL "Executable required to perform static analysis is available.")
+  set(CLANG_TIDY_AVAILABLE TRUE CACHE INTERNAL "Executable required to perform static analysis is available.")
 endif()

 if(FIND_EXE AND GCOV_EXE AND Python_Interpreter_FOUND AND GCC_COVERAGE_COMPILER_FLAGS_OK)
-  set(COVERAGE_TESTING_AVAILABLE TRUE INTERNAL BOOL "Executables required to run the coverage testing are available.")
+  set(COVERAGE_TESTING_AVAILABLE TRUE CACHE INTERNAL "Executables required to run the coverage testing are available.")
 endif()

 if(SWIG_EXECUTABLE)
-  set(BINDINGS_AVAILABLE TRUE INTERNAL BOOL "Executable required to generate bindings is available.")
+  set(BINDINGS_AVAILABLE TRUE CACHE INTERNAL "Executable required to generate bindings is available.")
 endif()

 if(VALGRIND_EXE AND Python_Interpreter_FOUND)
-  set(VALGRIND_TESTING_AVAILABLE TRUE INTERNAL BOOL "Executable required to run valgrind testing is available.")
+  set(VALGRIND_TESTING_AVAILABLE TRUE CACHE INTERNAL "Executable required to run valgrind testing is available.")
 endif()

 if(LLVM_PROFDATA_EXE AND LLVM_COV_EXE AND FIND_EXE AND LLVM_COVERAGE_COMPILER_FLAGS_OK)
-  set(LLVM_COVERAGE_TESTING_AVAILABLE TRUE INTERNAL BOOL "Executables required to run the llvm coverage testing are available.")
+  set(LLVM_COVERAGE_TESTING_AVAILABLE TRUE CACHE INTERNAL "Executables required to run the llvm coverage testing are available.")
 endif()


Update protobuf version

Update protobuf version

--- cmake/external/protobuf.cmake
+++ cmake/external/protobuf.cmake
@@ -58,7 +58,7 @@
 ExternalProject_Add(${PROTOBUF_TARGET}
     PREFIX ${PROTOBUF_TARGET}
     GIT_REPOSITORY https://github.com/google/protobuf.git
-    GIT_TAG 47b7d2c
+    GIT_TAG 96f7c53
     UPDATE_COMMAND ""
     CONFIGURE_COMMAND ${CMAKE_COMMAND} ${PROTOBUF_INSTALL_DIR}/src/${PROTOBUF_TARGET}/cmake
         -G${CMAKE_GENERATOR}


Fix for cmake 1.11 (#14350)

Fix for cmake 1.11 (#14350)

test=develop

--- cmake/external/protobuf.cmake
+++ cmake/external/protobuf.cmake
@@ -30,66 +30,61 @@
 UNSET_VAR(PROTOBUF_LIBRARY)
 UNSET_VAR(PROTOBUF_INCLUDE_DIR)
 UNSET_VAR(Protobuf_PROTOC_EXECUTABLE)
-
-if(NOT COMMAND protobuf_generate_python)  # before cmake 3.4, protobuf_genrerate_python is not defined.
-    function(protobuf_generate_python SRCS)
-        # shameless copy from https://github.com/Kitware/CMake/blob/master/Modules/FindProtobuf.cmake
-        if(NOT ARGN)
-            message(SEND_ERROR "Error: PROTOBUF_GENERATE_PYTHON() called without any proto files")
-            return()
-        endif()
-
-        if(PROTOBUF_GENERATE_CPP_APPEND_PATH)
-            # Create an include path for each file specified
-            foreach(FIL ${ARGN})
-                get_filename_component(ABS_FIL ${FIL} ABSOLUTE)
-                get_filename_component(ABS_PATH ${ABS_FIL} PATH)
-                list(FIND _protobuf_include_path ${ABS_PATH} _contains_already)
-                if(${_contains_already} EQUAL -1)
-                    list(APPEND _protobuf_include_path -I ${ABS_PATH})
-                endif()
-            endforeach()
-        else()
-            set(_protobuf_include_path -I ${CMAKE_CURRENT_SOURCE_DIR})
-        endif()
-
-        if(DEFINED PROTOBUF_IMPORT_DIRS AND NOT DEFINED Protobuf_IMPORT_DIRS)
-            set(Protobuf_IMPORT_DIRS "${PROTOBUF_IMPORT_DIRS}")
-        endif()
-
-        if(DEFINED Protobuf_IMPORT_DIRS)
-            foreach(DIR ${Protobuf_IMPORT_DIRS})
-                get_filename_component(ABS_PATH ${DIR} ABSOLUTE)
-                list(FIND _protobuf_include_path ${ABS_PATH} _contains_already)
-                if(${_contains_already} EQUAL -1)
-                    list(APPEND _protobuf_include_path -I ${ABS_PATH})
-                endif()
-            endforeach()
-        endif()
-
-        set(${SRCS})
+function(protobuf_generate_python SRCS)
+    # shameless copy from https://github.com/Kitware/CMake/blob/master/Modules/FindProtobuf.cmake
+    if(NOT ARGN)
+        message(SEND_ERROR "Error: PROTOBUF_GENERATE_PYTHON() called without any proto files")
+        return()
+    endif()
+
+    if(PROTOBUF_GENERATE_CPP_APPEND_PATH)
+        # Create an include path for each file specified
         foreach(FIL ${ARGN})
             get_filename_component(ABS_FIL ${FIL} ABSOLUTE)
-            get_filename_component(FIL_WE ${FIL} NAME_WE)
-            if(NOT PROTOBUF_GENERATE_CPP_APPEND_PATH)
-                get_filename_component(FIL_DIR ${FIL} DIRECTORY)
-                if(FIL_DIR)
-                    set(FIL_WE "${FIL_DIR}/${FIL_WE}")
-                endif()
+            get_filename_component(ABS_PATH ${ABS_FIL} PATH)
+            list(FIND _protobuf_include_path ${ABS_PATH} _contains_already)
+            if(${_contains_already} EQUAL -1)
+                list(APPEND _protobuf_include_path -I ${ABS_PATH})
             endif()
-
-            list(APPEND ${SRCS} "${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}_pb2.py")
-            add_custom_command(
-                    OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}_pb2.py"
-                    COMMAND  ${Protobuf_PROTOC_EXECUTABLE} --python_out ${CMAKE_CURRENT_BINARY_DIR} ${_protobuf_include_path} ${ABS_FIL}
-                    DEPENDS ${ABS_FIL} ${Protobuf_PROTOC_EXECUTABLE}
-                    COMMENT "Running Python protocol buffer compiler on ${FIL}"
-                    VERBATIM )
         endforeach()
-
-        set(${SRCS} ${${SRCS}} PARENT_SCOPE)
-    endfunction()
-endif()
+    else()
+        set(_protobuf_include_path -I ${CMAKE_CURRENT_SOURCE_DIR})
+    endif()
+    if(DEFINED PROTOBUF_IMPORT_DIRS AND NOT DEFINED Protobuf_IMPORT_DIRS)
+        set(Protobuf_IMPORT_DIRS "${PROTOBUF_IMPORT_DIRS}")
+    endif()
+
+    if(DEFINED Protobuf_IMPORT_DIRS)
+        foreach(DIR ${Protobuf_IMPORT_DIRS})
+            get_filename_component(ABS_PATH ${DIR} ABSOLUTE)
+            list(FIND _protobuf_include_path ${ABS_PATH} _contains_already)
+            if(${_contains_already} EQUAL -1)
+                list(APPEND _protobuf_include_path -I ${ABS_PATH})
+            endif()
+        endforeach()
+    endif()
+
+    set(${SRCS})
+    foreach(FIL ${ARGN})
+        get_filename_component(ABS_FIL ${FIL} ABSOLUTE)
+        get_filename_component(FIL_WE ${FIL} NAME_WE)
+        if(NOT PROTOBUF_GENERATE_CPP_APPEND_PATH)
+            get_filename_component(FIL_DIR ${FIL} DIRECTORY)
+            if(FIL_DIR)
+                set(FIL_WE "${FIL_DIR}/${FIL_WE}")
+            endif()
+        endif()
+        list(APPEND ${SRCS} "${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}_pb2.py")
+        add_custom_command(
+                OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}_pb2.py"
+                COMMAND  ${PROTOBUF_PROTOC_EXECUTABLE} --python_out ${CMAKE_CURRENT_BINARY_DIR} ${_protobuf_include_path} ${ABS_FIL}
+                DEPENDS ${ABS_FIL} ${PROTOBUF_PROTOC_EXECUTABLE}
+                COMMENT "Running Python protocol buffer compiler on ${FIL}"
+                VERBATIM )
+    endforeach()
+
+    set(${SRCS} ${${SRCS}} PARENT_SCOPE)
+endfunction()

 # Print and set the protobuf library information,
 # finish this cmake process and exit from this file.
@@ -126,6 +121,7 @@
     # FIND_Protobuf.cmake uses `Protobuf_PROTOC_EXECUTABLE`.
     # make `protobuf_generate_cpp` happy.
     SET(Protobuf_PROTOC_EXECUTABLE ${PROTOBUF_PROTOC_EXECUTABLE})
+
     FOREACH(dep ${protobuf_DEPS})
         ADD_DEPENDENCIES(protobuf ${dep})
         ADD_DEPENDENCIES(protobuf_lite ${dep})


Reverted FindMySQL change

Reverted FindMySQL change

--- cmake/modules/FindMySQL.cmake
+++ cmake/modules/FindMySQL.cmake
@@ -1,103 +1,137 @@
-#[==[
-Provides the following variables:
+# - Try to find MySQL.
+# Once done this will define:
+# MYSQL_FOUND			- If false, do not try to use MySQL.
+# MYSQL_INCLUDE_DIRS	- Where to find mysql.h, etc.
+# MYSQL_LIBRARIES		- The libraries to link against.
+# MYSQL_VERSION_STRING	- Version in a string of MySQL.
+#
+# Created by RenatoUtsch based on eAthena implementation.
+#
+# Please note that this module only supports Windows and Linux officially, but
+# should work on all UNIX-like operational systems too.
+#

-  * `MYSQL_INCLUDE_DIRS`: Include directories necessary to use MySQL.
-  * `MYSQL_LIBRARIES`: Libraries necessary to use MySQL.
-  * A `mysql::mysql` imported target.
-#]==]
+#=============================================================================
+# Copyright 2012 RenatoUtsch
+#
+# Distributed under the OSI-approved BSD License (the "License");
+# see accompanying file Copyright.txt for details.
+#
+# This software is distributed WITHOUT ANY WARRANTY; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the License for more information.
+#=============================================================================
+# (To distribute this file outside of CMake, substitute the full
+#  License text for the above reference.)

-# No .pc files are shipped with MySQL on Windows.
-set(_MySQL_use_pkgconfig 0)
-if (NOT WIN32)
-  find_package(PkgConfig)
-  if (PkgConfig_FOUND)
-    set(_MySQL_use_pkgconfig 1)
-  endif ()
-endif ()
+if( WIN32 )

-if (_MySQL_use_pkgconfig)
-  pkg_check_modules(_mariadb "mariadb" QUIET IMPORTED_TARGET)
-  unset(_mysql_target)
-  if (NOT _mariadb_FOUND)
-    pkg_check_modules(_mysql "mysql" QUIET IMPORTED_TARGET)
-    if (_mysql_FOUND)
-      set(_mysql_target "_mysql")
-    endif ()
-  else ()
-    set(_mysql_target "_mariadb")
-    if (_mariadb_VERSION VERSION_LESS 10.4)
-      get_property(_include_dirs
-        TARGET    "PkgConfig::_mariadb"
-        PROPERTY  "INTERFACE_INCLUDE_DIRECTORIES")
-      # Remove "${prefix}/mariadb/.." from the interface since it breaks other
-      # projects.
-      list(FILTER _include_dirs EXCLUDE REGEX "\\.\\.")
-      set_property(TARGET "PkgConfig::_mariadb"
-        PROPERTY
-          "INTERFACE_INCLUDE_DIRECTORIES" "${_include_dirs}")
-      unset(_include_dirs)
-    endif ()
-  endif ()
+	SET(BINDIR32_ENV_NAME "Program Files")
+	find_path( MYSQL_INCLUDE_DIR
+		NAMES "mysql.h"
+		PATHS "${CMAKE_THIRD_PARTY_INCLUDE_DIR}"
+				"${CMAKE_EXTERNAL_INCLUDE_DIR}"
+			  "C:/Program Files/MySQL/MySQL Connector.C */include"
+			  "C:/${BINDIR32_ENV_NAME}/MySQL/MySQL Connector.C */include"
+			  "$ENV{SYSTEMDRIVE}/MySQL/MySQL Connector.C */include"
+			  "$ENV{PROGRAMFILES}/MySQL/*/include"
+			  "C:/${BINDIR32_ENV_NAME}/MySQL/*/include"
+			  "$ENV{SYSTEMDRIVE}/MySQL/*/include"
+			  "C:/Program Files/MySQL/*/include"
+			  )

-  set(MySQL_FOUND 0)
-  if (_mysql_target)
-    set(MySQL_FOUND 1)
-    add_library(MySQL::MySQL INTERFACE IMPORTED)
-    target_link_libraries(MySQL::MySQL
-      INTERFACE "PkgConfig::${_mysql_target}")
-    set(MYSQL_INCLUDE_DIRS ${${_mysql_target}_INCLUDE_DIRS})
-    set(MYSQL_LIBRARIES ${${_mysql_target}_LINK_LIBRARIES})
-  endif ()
-  unset(_mysql_target)
-else ()
-  set(_MySQL_mariadb_versions 10.2 10.3 10.4)
-  set(_MySQL_versions 5.0 8.0)
-  set(_MySQL_paths)
-  foreach (_MySQL_version IN LISTS _MySQL_mariadb_versions)
-    list(APPEND _MySQL_paths
-      "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MariaDB ${_MySQL_version};INSTALLDIR]"
-      "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MariaDB ${_MySQL_version} (x64);INSTALLDIR]")
-  endforeach ()
-  foreach (_MySQL_version IN LISTS _MySQL_versions)
-    list(APPEND _MySQL_paths
-      "C:/Program Files/MySQL/MySQL Server ${_MySQL_version}/lib/opt"
-      "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MySQL AB\\MySQL Server ${_MySQL_version};Location]"
-      "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\MySQL AB\\MySQL Server ${_MySQL_version};Location]")
-  endforeach ()
-  unset(_MySQL_version)
-  unset(_MySQL_versions)
-  unset(_MySQL_mariadb_versions)
+	find_path( MYSQL_LIBRARY_PATH
+		NAMES "libmysql.lib" "mysqlclient_r.lib"
+		PATHS "${CMAKE_THIRD_PARTY_LIBRARY_DIR}"
+				"${CMAKE_EXTERNAL_LIBRARY_DIR}"
+			  "C:/Program Files/MySQL/MySQL Connector.C */lib"
+			  "C:/${BINDIR32_ENV_NAME}/MySQL/MySQL Connector.C */lib"
+			  "$ENV{SYSTEMDRIVE}/MySQL/MySQL Connector.C */lib"
+			  "$ENV{PROGRAMFILES}/MySQL/*/lib"
+			  "C:/${BINDIR32_ENV_NAME}/MySQL/*/lib"
+			  "$ENV{SYSTEMDRIVE}/MySQL/*/lib"
+			  "C:/Program Files/MySQL/*/lib"
+			  )

-  find_path(MySQL_INCLUDE_DIR
-    NAMES mysql.h
-    PATHS
-      "C:/Program Files/MySQL/include"
-      "C:/MySQL/include"
-      ${_MySQL_paths}
-    PATH_SUFFIXES include include/mysql
-    DOC "Location of mysql.h")
-  mark_as_advanced(MySQL_INCLUDE_DIR)
-  find_library(MySQL_LIBRARY
-    NAMES libmariadb mysql libmysql mysqlclient
-    PATHS
-      "C:/Program Files/MySQL/lib"
-      "C:/MySQL/lib/debug"
-      ${_MySQL_paths}
-    PATH_SUFFIXES lib lib/opt
-    DOC "Location of the mysql library")
-  mark_as_advanced(MySQL_LIBRARY)
+	find_library( MYSQL_LIBRARY
+		NAMES "libmysql" "mysqlclient_r"
+		PATHS "${CMAKE_THIRD_PARTY_LIBRARY_DIR}"
+				"${CMAKE_EXTERNAL_LIBRARY_DIR}"
+			  "C:/Program Files/MySQL/MySQL Connector.C */lib"
+			  "C:/${BINDIR32_ENV_NAME}/MySQL/MySQL Connector.C */lib"
+			  "$ENV{SYSTEMDRIVE}/MySQL/MySQL Connector.C */lib"
+			  "$ENV{PROGRAMFILES}/MySQL/*/lib"
+			  "C:/${BINDIR32_ENV_NAME}/MySQL/*/lib"
+			  "$ENV{SYSTEMDRIVE}/MySQL/*/lib"
+			  "C:/Program Files/MySQL/*/lib"
+			  )
+else()
+	find_path( MYSQL_INCLUDE_DIR
+		NAMES "mysql.h"
+		PATHS "${CMAKE_THIRD_PARTY_INCLUDE_DIR}"
+			  "$ENV{HOME}/mysql/include"
+			  "/usr/include/mysql"
+			  "/usr/local/include/mysql"
+			  "/usr/mysql/include/mysql" )

-  include(FindPackageHandleStandardArgs)
-  find_package_handle_standard_args(MySQL
-    REQUIRED_VARS MySQL_INCLUDE_DIR MySQL_LIBRARY)
+	find_path( MYSQL_LIBRARY_PATH
+		NAMES libmysqlclient.a libmysqlclient.so libmysqlclient_r.a libmysqlclient_r.so
+		PATHS "${CMAKE_THIRD_PARTY_LIBRARY_DIR}"
+			  "$ENV{HOME}/mysql/lib"
+			  "/lib/mysql"
+			  "/lib64/mysql"
+        "/usr/lib"
+			  "/usr/lib/mysql"
+			  "/usr/lib64/mysql"
+			  "/usr/local/lib/mysql"
+			  "/usr/local/lib64/mysql"
+			  "/usr/mysql/lib/mysql"
+			  "/usr/mysql/lib64/mysql"
+        "/usr/lib/x86_64-linux-gnu" )

-  if (MySQL_FOUND)
+	find_library( MYSQL_LIBRARY
+		NAMES mysqlclient mysqlclient_r
+		PATHS "${CMAKE_THIRD_PARTY_LIBRARY_DIR}"
+			  "$ENV{HOME}/mysql/lib"
+			  "/lib/mysql"
+			  "/lib64/mysql"
+        "/usr/lib"
+			  "/usr/lib/mysql"
+			  "/usr/lib64/mysql"
+			  "/usr/local/lib/mysql"
+			  "/usr/local/lib64/mysql"
+			  "/usr/mysql/lib/mysql"
+			  "/usr/mysql/lib64/mysql" )
+endif()
+
+message(STATUS "MySQL Library: ${MYSQL_LIBRARY}")
+message(STATUS "MySQL Library Path: ${MYSQL_LIBRARY_PATH}")
+message(STATUS "MySQL Include Path: ${MYSQL_INCLUDE_DIR}")
+
+if( MYSQL_INCLUDE_DIR AND EXISTS "${MYSQL_INCLUDE_DIR}/mysql_version.h" )
+	file( STRINGS "${MYSQL_INCLUDE_DIR}/mysql_version.h"
+		MYSQL_VERSION_H REGEX "^#define[ \t]+MYSQL_SERVER_VERSION[ \t]+\"[^\"]+\".*$" )
+	string( REGEX REPLACE
+		"^.*MYSQL_SERVER_VERSION[ \t]+\"([^\"]+)\".*$" "\\1" MYSQL_VERSION_STRING
+		"${MYSQL_VERSION_H}" )
+endif()
+
+# handle the QUIETLY and REQUIRED arguments and set MYSQL_FOUND to TRUE if
+# all listed variables are TRUE
+include( FindPackageHandleStandardArgs )
+find_package_handle_standard_args( MYSQL
+	REQUIRED_VARS MYSQL_LIBRARY MYSQL_LIBRARY_PATH MYSQL_INCLUDE_DIR
+	VERSION_VAR MYSQL_VERSION_STRING
+	)
+
+set( MYSQL_INCLUDE_DIRS ${MYSQL_INCLUDE_DIR} )
+set( MYSQL_LIBRARIES ${MYSQL_LIBRARY} )
+
+if(MYSQL_FOUND AND NOT TARGET mysql::mysql)
     add_library(mysql::mysql UNKNOWN IMPORTED)
-    set_target_properties(mysql::mysql PROPERTIES
-      IMPORTED_LOCATION "${MySQL_LIBRARY}"
-      INTERFACE_INCLUDE_DIRECTORIES "${MySQL_INCLUDE_DIR}")
-    set(MYSQL_INCLUDE_DIRS "${MySQL_INCLUDE_DIR}")
-    set(MYSQL_LIBRARIES "${MySQL_LIBRARY}")
-  endif ()
-endif ()
-unset(_MySQL_use_pkgconfig)
+    set_target_properties(mysql::mysql PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${MYSQL_INCLUDE_DIR}")
+    set_property(TARGET mysql::mysql APPEND PROPERTY IMPORTED_LOCATION "${MYSQL_LIBRARY}")
+endif()
+
+mark_as_advanced( MYSQL_INCLUDE_DIR MYSQL_LIBRARY MYSQL_LIBRARY_PATH )
+


Add ${INCLUDE_INSTALL_DIR} to the include dirs, not ${INCLUDE_INSTALL_DIR}/qjson

Having ${INCLUDE_INSTALL_DIR}/qjson in the include dirs means one include qjson
files with #include <parser.h>, which can cause the wrong file to be included because
parser.h is a very generic name.

If only ${INCLUDE_INSTALL_DIR} is in the include dirs, people have to use
#include <qjson/parser.h> instead, which avoids any confusion.

--- cmake/modules/FindQJSON.cmake
+++ cmake/modules/FindQJSON.cmake
@@ -31,9 +31,7 @@

   find_path (QJSON_INCLUDE_DIR
     NAMES
-    parser.h
-    PATH_SUFFIXES
-    qjson
+    qjson/parser.h
     PATHS
     ${QJSON_INCLUDE_DIRS}
     ${INCLUDE_INSTALL_DIR}


[FindQJSON.cmake] Use separate variable when querying pkg-config to correctly set _INCLUDE_DIR and _LIBRARIES

--- cmake/modules/FindQJSON.cmake
+++ cmake/modules/FindQJSON.cmake
@@ -17,14 +17,14 @@
     # use pkg-config to get the values of QJSON_INCLUDE_DIRS
     # and QJSON_LIBRARY_DIRS to add as hints to the find commands.
     include (FindPkgConfig)
-    pkg_check_modules (QJSON QJson>=0.5)
+    pkg_check_modules (PC_QJSON QJson>=0.5)
   endif (NOT WIN32)

   find_library (QJSON_LIBRARIES
     NAMES
     qjson
     PATHS
-    ${QJSON_LIBRARY_DIRS}
+    ${PC_QJSON_LIBRARY_DIRS}
     ${LIB_INSTALL_DIR}
     ${KDE4_LIB_DIR}
   )
@@ -35,7 +35,7 @@
     PATH_SUFFIXES
     qjson
     PATHS
-    ${QJSON_INCLUDE_DIRS}
+    ${PC_QJSON_INCLUDE_DIRS}
     ${INCLUDE_INSTALL_DIR}
     ${KDE4_INCLUDE_DIR}
   )


Add support for iPhoneOS to find psapi module

Change-Id: Iedfaa92a3143755ba3dacb3b329ae9ace84510f8

--- cmake/modules/Findpsapi.cmake
+++ cmake/modules/Findpsapi.cmake
@@ -51,6 +51,17 @@
     SET(${PACKAGE_NAME}_INCLUDE_DIRS "")
     SET(${PACKAGE_NAME}_LIBRARIES  "" )
     SET(${PACKAGE_NAME}_FOUND "TRUE")
+
+ELSEIF("${TARGET_OS}" STREQUAL "iPhoneSimulatorOS")
+
+    SET(${PACKAGE_NAME}_INCLUDE_DIRS "")
+    SET(${PACKAGE_NAME}_LIBRARIES  "" )
+    SET(${PACKAGE_NAME}_FOUND "TRUE")
+
+ELSEIF("${TARGET_OS}" STREQUAL "iPhoneOS")
+    SET(${PACKAGE_NAME}_INCLUDE_DIRS "")
+    SET(${PACKAGE_NAME}_LIBRARIES  "" )
+    SET(${PACKAGE_NAME}_FOUND "TRUE")

 ENDIF()


GLibTools.cmake: Generate signal marshallers without source reference

It helps with reproducible builds, by not including the source path
in the public header files.

Related to https://gitlab.gnome.org/GNOME/evolution/-/issues/1273

--- cmake/modules/GLibTools.cmake
+++ cmake/modules/GLibTools.cmake
@@ -146,7 +146,7 @@
 function(glib_genmarshal _output_filename_noext _prefix _marshallist_filename)
 	add_custom_command(
 		OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_output_filename_noext}.h
-		COMMAND ${GLIB_GENMARSHAL} --header --prefix=${_prefix} "${CMAKE_CURRENT_SOURCE_DIR}/${_marshallist_filename}" >${CMAKE_CURRENT_BINARY_DIR}/${_output_filename_noext}.h.tmp
+		COMMAND ${GLIB_GENMARSHAL} --header --skip-source --prefix=${_prefix} "${CMAKE_CURRENT_SOURCE_DIR}/${_marshallist_filename}" >${CMAKE_CURRENT_BINARY_DIR}/${_output_filename_noext}.h.tmp
 		COMMAND ${CMAKE_COMMAND} -E rename ${CMAKE_CURRENT_BINARY_DIR}/${_output_filename_noext}.h.tmp ${CMAKE_CURRENT_BINARY_DIR}/${_output_filename_noext}.h
 		DEPENDS ${_marshallist_filename}
 	)
@@ -154,7 +154,7 @@
 	add_custom_command(
 		OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_output_filename_noext}.c
 		COMMAND ${CMAKE_COMMAND} -E echo " #include \\\"${_output_filename_noext}.h\\\"" >${CMAKE_CURRENT_BINARY_DIR}/${_output_filename_noext}.c.tmp
-		COMMAND ${GLIB_GENMARSHAL} --body --prefix=${_prefix} "${CMAKE_CURRENT_SOURCE_DIR}/${_marshallist_filename}" >>${CMAKE_CURRENT_BINARY_DIR}/${_output_filename_noext}.c.tmp
+		COMMAND ${GLIB_GENMARSHAL} --body --skip-source --prefix=${_prefix} "${CMAKE_CURRENT_SOURCE_DIR}/${_marshallist_filename}" >>${CMAKE_CURRENT_BINARY_DIR}/${_output_filename_noext}.c.tmp
 		COMMAND ${CMAKE_COMMAND} -E rename ${CMAKE_CURRENT_BINARY_DIR}/${_output_filename_noext}.c.tmp ${CMAKE_CURRENT_BINARY_DIR}/${_output_filename_noext}.c
 		DEPENDS ${_marshallist_filename}
 	)


Missing build dependency for gdbus-codegen on input .xml file

Related to https://gitlab.gnome.org/GNOME/evolution-data-server/issues/7

--- cmake/modules/GLibTools.cmake
+++ cmake/modules/GLibTools.cmake
@@ -175,6 +175,7 @@
 			--generate-docbook ${_files_prefix}
 			${_args}
 			${CMAKE_CURRENT_SOURCE_DIR}/${_xml}
+		MAIN_DEPENDENCY ${CMAKE_CURRENT_SOURCE_DIR}/${_xml}
 		VERBATIM
 	)
 endfunction(gdbus_codegen_custom)


Backup.

Backup.

--- cmake_modules/LPSCommon.cmake
+++ cmake_modules/LPSCommon.cmake
@@ -753,7 +753,7 @@
             file(APPEND ${CMAKE_BINARY_DIR}/${INSTALL_CONFIG_FILE} "\n")
             file(APPEND ${CMAKE_BINARY_DIR}/${INSTALL_CONFIG_FILE} "set(VTK_INC_DIR @SHEAFSYSTEM_HOME@/vtk/include CACHE PATH \"VTK library path\")\n")
             file(APPEND ${CMAKE_BINARY_DIR}/${INSTALL_CONFIG_FILE} "\n")
-            file(APPEND ${CMAKE_BINARY_DIR}/${INSTALL_CONFIG_FILE} "set(VTK_LIB_DIR @SHEAFSYSTEM_HOME@/lib/vtk CACHE PATH \"VTK library path\")\n")
+            file(APPEND ${CMAKE_BINARY_DIR}/${INSTALL_CONFIG_FILE} "set(VTK_LIB_DIR @SHEAFSYSTEM_HOME@/vtk/lib CACHE PATH \"VTK library path\")\n")
             file(APPEND ${CMAKE_BINARY_DIR}/${INSTALL_CONFIG_FILE} "\n")
             file(APPEND ${CMAKE_BINARY_DIR}/${INSTALL_CONFIG_FILE} "\n")
             file(APPEND ${CMAKE_BINARY_DIR}/${INSTALL_CONFIG_FILE} "set(JMF_JAR ${JMF_JAR} CACHE STRING \"JMF jar location\")\n")
@@ -904,19 +904,26 @@
 function(install_prereqs)
     # Prerequisite components install
     if(LINUX64INTEL OR LINUX64GNU)
-        foreach(name ${VTK_LIBS})
-            file(GLOB files "${VTK_LIB_DIR}/lib${name}.*")
-            string(REPLACE "${VTK_LIB_DIR}/lib${name}.a" "" files "${files}")
-            set(VTK_INST_LIBS ${VTK_INST_LIBS} "${files}")
-        endforeach()
-        install(FILES ${VTK_INST_LIBS} DESTINATION lib/vtk/
-        PERMISSIONS
-        OWNER_WRITE OWNER_READ OWNER_EXECUTE
-        GROUP_READ GROUP_EXECUTE
-        WORLD_READ WORLD_EXECUTE
-        )
+    install(DIRECTORY ${VTK_LIB_DIR}/ DESTINATION vtk/lib/ USE_SOURCE_PERMISSIONS
+        PATTERN "CMake" EXCLUDE
+        PATTERN "doc" EXCLUDE
+        PATTERN "doxygen" EXCLUDE
+        PATTERN "hints" EXCLUDE
+        PATTERN "testing" EXCLUDE
+        PATTERN "*.cmake" EXCLUDE)
+#        foreach(name ${VTK_LIBS})
+#            file(GLOB files "${VTK_LIB_DIR}/lib${name}.*")
+#            string(REPLACE "${VTK_LIB_DIR}/lib${name}.a" "" files "${files}")
+#            set(VTK_INST_LIBS ${VTK_INST_LIBS} "${files}")
+#        endforeach()
+#        install(FILES ${VTK_INST_LIBS} DESTINATION lib/vtk/
+#        PERMISSIONS
+#        OWNER_WRITE OWNER_READ OWNER_EXECUTE
+#        GROUP_READ GROUP_EXECUTE
+#        WORLD_READ WORLD_EXECUTE
+#        )
         file(APPEND ${CMAKE_BINARY_DIR}/${EXPORTS_FILE} "\n")
-        file(APPEND ${CMAKE_BINARY_DIR}/${EXPORTS_FILE} "set(VTK_LIB_DIR @SHEAFSYSTEM_HOME@/lib/vtk CACHE STRING \"Location of VTK libs\")\n")
+        file(APPEND ${CMAKE_BINARY_DIR}/${EXPORTS_FILE} "set(VTK_LIB_DIR @SHEAFSYSTEM_HOME@/vtk/lib CACHE STRING \"Location of VTK libs\")\n")
         file(APPEND ${CMAKE_BINARY_DIR}/${EXPORTS_FILE} "\n")

     elseif(WIN32)


COMP: Fixed "warning C4996: 'std::tr1': warning STL4002" for MSVC >= Visual Studio 2012. IN VS2017 it appeared as an error (showstopper!)

Note that GTest has fixed this issue at "Remove C4996 warning in VS2017", Dec 7, 2017 https://github.com/google/googletest/commit/57bb0bbbf80b006f35a249951fe2e051221173ae

--- SuperBuild/ExternalGoogleTest.cmake
+++ SuperBuild/ExternalGoogleTest.cmake
@@ -32,7 +32,7 @@
 endif()

 set( MSVS_ARGS )
-if(MSVC_VERSION EQUAL 1700)
+if(NOT (MSVC_VERSION LESS 1700))
   set(MSVS_ARGS ${MSVS_ARGS} -D CMAKE_CXX_FLAGS=-DGTEST_HAS_TR1_TUPLE=0 ${CMAKE_CXX_FLAGS})
 endif()


ENH: remove duplicates from list of files to download in MIDAS+CTest

SVN-Revision: 3264

--- Application/CMakeScript/MIDAS.cmake
+++ Application/CMakeScript/MIDAS.cmake
@@ -69,8 +69,9 @@

   # Substitute the downloaded file argument(s)
   foreach(arg ${ARGN})
-    if(arg MATCHES "^MIDAS{[^}]*}$")
-      string(REGEX REPLACE "^MIDAS{([^}]*)}$" "\\1" keyFile "${arg}")
+    if(arg MATCHES "MIDAS{[^}]*}")
+      string(REGEX MATCH "MIDAS{([^}]*)}" toReplace "${arg}")
+      string(REGEX REPLACE "MIDAS{([^}]*)}" "\\1" keyFile "${toReplace}")
       # Split up the checksum extension from the real filename
       string(REGEX MATCH "\\.[^\\.]*$" hash_alg "${keyFile}")
       string(REGEX REPLACE "\\.[^\\.]*$" "" base_file "${keyFile}")
@@ -125,10 +126,11 @@
 ")

       list(APPEND downloadScripts "${MIDAS_DATA_DIR}/MIDAS_FetchScripts/download_${checksum}.cmake")
-      list(APPEND testArgs "${MIDAS_DATA_DIR}/${base_file}")
-    else(arg MATCHES "^MIDAS{[^}]*}$")
+      string(REGEX REPLACE toReplace "${MIDAS_DATA_DIR}/${base_file}" newArg "${arg}")
+      list(APPEND testArgs ${newArg})
+    else(arg MATCHES "MIDAS{[^}]*}")
       list(APPEND testArgs ${arg})
-    endif(arg MATCHES "^MIDAS{[^}]*}$")
+    endif(arg MATCHES "MIDAS{[^}]*}")
   endforeach(arg)

   file(WRITE "${MIDAS_DATA_DIR}/MIDAS_FetchScripts/${testName}_fetchData.cmake"
@@ -143,4 +145,4 @@
   # Finally, create the test
   add_test(${testName} ${testArgs})
   set_tests_properties(${testName} PROPERTIES DEPENDS ${testName}_fetchData)
-endfunction(midas_add_test)
+endfunction(midas_add_test)


Update FW

Update FW

--- cmake/Depthai/DepthaiDeviceSideConfig.cmake
+++ cmake/Depthai/DepthaiDeviceSideConfig.cmake
@@ -2,7 +2,7 @@
 set(DEPTHAI_DEVICE_SIDE_MATURITY "snapshot")

 # "full commit hash of device side binary"
-set(DEPTHAI_DEVICE_SIDE_COMMIT "7e4ab98f6d7ee21586e69839dca5a993c40fb87a")
+set(DEPTHAI_DEVICE_SIDE_COMMIT "f7763c62bcc77f0d7bb259a5684d076e8e74b4a9")

 # "version if applicable"
 set(DEPTHAI_DEVICE_SIDE_VERSION "")


ARROW-14401: [C++] Fix bundled crc32c's include path

Closes #11489 from kou/cpp-crc32c-include

Authored-by: Sutou Kouhei <73218711cdd5d5c30ac66da3cc4d9d9204caf34b@clear-code.com>
Signed-off-by: Sutou Kouhei <73218711cdd5d5c30ac66da3cc4d9d9204caf34b@clear-code.com>

--- cpp/cmake_modules/ThirdpartyToolchain.cmake
+++ cpp/cmake_modules/ThirdpartyToolchain.cmake
@@ -3527,6 +3527,7 @@
     message(STATUS "Building crc32c from source")
     # Build crc32c
     set(CRC32C_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/crc32c_ep-install")
+    set(CRC32C_INCLUDE_DIR "${CRC32C_PREFIX}/include")
     set(CRC32C_CMAKE_ARGS
         ${EP_COMMON_CMAKE_ARGS}
         -DCMAKE_INSTALL_LIBDIR=lib
@@ -3550,12 +3551,12 @@
                         CMAKE_ARGS ${CRC32C_CMAKE_ARGS}
                         BUILD_BYPRODUCTS ${CRC32C_BUILD_BYPRODUCTS})
     # Work around https://gitlab.kitware.com/cmake/cmake/issues/15052
-    file(MAKE_DIRECTORY "${CRC32C_INCLUDE}/include")
+    file(MAKE_DIRECTORY "${CRC32C_INCLUDE_DIR}")
     add_library(Crc32c::crc32c STATIC IMPORTED)
     set_target_properties(Crc32c::crc32c
                           PROPERTIES IMPORTED_LOCATION ${_CRC32C_STATIC_LIBRARY}
                                      INTERFACE_INCLUDE_DIRECTORIES
-                                     "${CRC32C_INCLUDE}/include")
+                                     "${CRC32C_INCLUDE_DIR}")
     add_dependencies(Crc32c::crc32c crc32c_ep)
   endif()
 endmacro()


Setting correct dependencies for the static variants of the libraries

--- Code/cmake/Modules/RDKitUtils.cmake
+++ Code/cmake/Modules/RDKitUtils.cmake
@@ -56,6 +56,15 @@
       if(RDK_INSTALL_STATIC_LIBS)
         add_library(${RDKLIB_NAME}_static ${RDKLIB_SOURCES})
         target_link_libraries(${RDKLIB_NAME}_static PUBLIC rdkit_base)
+        foreach(RDKLIB_LINK_LIBRARY ${RDKLIB_LINK_LIBRARIES})
+          set(STATIC_LIB ${RDKLIB_LINK_LIBRARY}_static)
+          # if the static variant exist, link against it, otherwise link against the unmodified name (-> boost, etc)
+          if (TARGET ${STATIC_LIB})
+            target_link_libraries(${RDKLIB_NAME}_static PUBLIC ${STATIC_LIB})
+          else()
+            target_link_libraries(${RDKLIB_NAME}_static PUBLIC ${RDKLIB_LINK_LIBRARY})
+          endif()
+        endforeach()
         INSTALL(TARGETS ${RDKLIB_NAME}_static EXPORT ${RDKit_EXPORTED_TARGETS}
                 DESTINATION ${RDKit_LibDir}/${RDKLIB_DEST}
                 COMPONENT dev )


Update cmake variable names to be better.

--- external/Swig.cmake
+++ external/Swig.cmake
@@ -19,10 +19,8 @@
 # http://numenta.org/licenses/
 # -----------------------------------------------------------------------------

-set(swig_download_url
-    "${REPOSITORY_DIR}/external/common/src/swig-3.0.2.tar.gz")
-set(pcre_download_url
-    "${REPOSITORY_DIR}/external/common/src/pcre-8.37.tar.gz")
+set(swig_path "${REPOSITORY_DIR}/external/common/src/swig-3.0.2.tar.gz")
+set(pcre_path "${REPOSITORY_DIR}/external/common/src/pcre-8.37.tar.gz")

 if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
   add_custom_target(Swig)
@@ -32,11 +30,11 @@
 else()
   ExternalProject_Add(
     Swig
-    URL ${swig_download_url}
+    URL ${swig_path}
     UPDATE_COMMAND ""
     CONFIGURE_COMMAND
       mkdir -p ${EP_BASE}/Source/Swig/Tools/ &&
-      cp ${pcre_download_url} ${EP_BASE}/Build/Swig/ &&
+      cp ${pcre_path} ${EP_BASE}/Build/Swig/ &&
       ${EP_BASE}/Source/Swig/Tools/pcre-build.sh &&
       ${EP_BASE}/Source/Swig/configure --prefix=${EP_BASE}/Install --enable-cpp11-testing
   )


doc: replace C point2d

doc: replace C point2d

--- doc/doxygen.config.cmake
+++ doc/doxygen.config.cmake
@@ -715,7 +715,7 @@
 # wildcard * is used, a substring. Examples: ANamespace, AClass,
 # AClass::ANamespace, ANamespace::*Test

-EXCLUDE_SYMBOLS        = CvPoint2D64f
+EXCLUDE_SYMBOLS        = cv::Point2d

 # The EXAMPLE_PATH tag can be used to specify one or more files or
 # directories that contain example code fragments that are included (see


Pass cmake toolchain file and skip tests

Signed-off-by: Matthias Kretz <372ea4eca737a13cd010ee806d4ce7b98ee71550@kde.org>

--- test.cmake
+++ test.cmake
@@ -375,6 +375,10 @@
 list(APPEND configure_options "-DUSE_CCACHE=ON")
 if(DEFINED target_architecture)
    list(APPEND configure_options "-DTARGET_ARCHITECTURE=${target_architecture}")
+endif()
+if(NOT "$ENV{CMAKE_TOOLCHAIN_FILE}" STREQUAL "")
+   set(skip_tests TRUE)  # cross-compiling, can't run the tests
+   list(APPEND configure_options "-DCMAKE_TOOLCHAIN_FILE=${CTEST_SOURCE_DIRECTORY}/$ENV{CMAKE_TOOLCHAIN_FILE}")
 endif()

 if("${COMPILER_VERSION}" MATCHES "(GCC|Open64).*4\\.[01234567]\\."


hunter_get_lang_standard_flag(): extend comments

--- cmake/modules/hunter_get_lang_standard_flag.cmake
+++ cmake/modules/hunter_get_lang_standard_flag.cmake
@@ -20,6 +20,7 @@
   string(COMPARE EQUAL "${CMAKE_${LANG}_STANDARD_DEFAULT}" "" no_default)
   if(no_default)
     # This compiler has no notion of language standard levels.
+    # https://github.com/Kitware/CMake/blob/3bccdd89c88864839a0c8d4ea56bd069c90fa02b/Source/cmLocalGenerator.cxx#L1427-L1432
     return()
   endif()

@@ -27,11 +28,14 @@
   string(COMPARE EQUAL "${standard}" "" no_standard)
   if(no_standard)
     # The standard not defined by user.
+    # https://github.com/Kitware/CMake/blob/3bccdd89c88864839a0c8d4ea56bd069c90fa02b/Source/cmLocalGenerator.cxx#L1433-L1437
     return()
   endif()

-  set(flag "")
-  set(ext "EXTENSION")  # By default extensions are assumed On.
+  # Decide on version with extensions or a clean one.
+  # By default extensions are assumed On.
+  # https://github.com/Kitware/CMake/blob/3bccdd89c88864839a0c8d4ea56bd069c90fa02b/Source/cmLocalGenerator.cxx#L1438-L1446
+  set(ext "EXTENSION")
   if(DEFINED CMAKE_${LANG}_EXTENSIONS AND NOT CMAKE_${LANG}_EXTENSIONS)
     set(ext "STANDARD")
   endif()
@@ -42,6 +46,8 @@
     hunter_internal_error("${LANG} standard ${standard} not known")
     return()
   endif()
+
+  set(flag "")
   list(LENGTH standards end)
   math(EXPR end "${end} - 1")
   foreach(idx RANGE ${begin} ${end})


sync with kdelibs/cmake/modules/FindQt.cmake

svn path=/trunk/kdesupport/strigi/; revision=688586

--- cmake/FindQt4.cmake
+++ cmake/FindQt4.cmake
@@ -29,7 +29,7 @@
 #
 #  macro QT4_WRAP_CPP(outfiles inputfile ... )
 #  macro QT4_WRAP_UI(outfiles inputfile ... )
-#  macro QT4_ADD_RESOURCE(outfiles inputfile ... )
+#  macro QT4_ADD_RESOURCES(outfiles inputfile ... )
 #  macro QT4_AUTOMOC(inputfile ... )
 #  macro QT4_GENERATE_MOC(inputfile outputfile )
 #
@@ -40,6 +40,16 @@
 #
 #  macro QT4_ADD_DBUS_INTERFACES(outfiles inputfile ... )
 #        create the interface header and implementation files
+#        for all listed interface xml files
+#        the name will be automatically determined from the name of the xml file
+#
+#  macro QT4_ADD_DBUS_INTERFACE_NO_NAMESPACE(outfiles interface basename)
+#        create a the interface without namespace header and implementation files with the
+#        given basename from the given interface xml file and add it to
+#        the list of sources
+#
+#  macro QT4_ADD_DBUS_INTERFACES_NO_NAMESPACE(outfiles inputfile ... )
+#        create the interface header without namespace and implementation files
 #        for all listed interface xml files
 #        the name will be automatically determined from the name of the xml file
 #
@@ -177,6 +187,7 @@

 INCLUDE(CheckSymbolExists)
 INCLUDE(MacroAddFileDependencies)
+INCLUDE(MacroPushRequiredVars)

 SET(QT_USE_FILE ${CMAKE_ROOT}/Modules/UseQt4.cmake)

@@ -376,14 +387,19 @@
   # Find out what window system we're using
   #
   #############################################
-  # Save required includes variable
-  SET(CMAKE_REQUIRED_INCLUDES_SAVE ${CMAKE_REQUIRED_INCLUDES})
+  # Save required includes and required_flags variables
+  macro_push_required_vars()
   # Add QT_INCLUDE_DIR to CMAKE_REQUIRED_INCLUDES
   SET(CMAKE_REQUIRED_INCLUDES "${CMAKE_REQUIRED_INCLUDES};${QT_INCLUDE_DIR}")
+  # On Mac OS X when Qt has framework support, also add the framework path
+  IF( QT_USE_FRAMEWORKS )
+    SET(CMAKE_REQUIRED_FLAGS "-F${QT_LIBRARY_DIR} ")
+  ENDIF( QT_USE_FRAMEWORKS )
   # Check for Window system symbols (note: only one should end up being set)
   CHECK_SYMBOL_EXISTS(Q_WS_X11 "QtCore/qglobal.h" Q_WS_X11)
+  CHECK_SYMBOL_EXISTS(Q_WS_WIN "QtCore/qglobal.h" Q_WS_WIN)
+  CHECK_SYMBOL_EXISTS(Q_WS_QWS "QtCore/qglobal.h" Q_WS_QWS)
   CHECK_SYMBOL_EXISTS(Q_WS_MAC "QtCore/qglobal.h" Q_WS_MAC)
-  CHECK_SYMBOL_EXISTS(Q_WS_WIN "QtCore/qglobal.h" Q_WS_WIN)

   IF (QT_QTCOPY_REQUIRED)
      CHECK_SYMBOL_EXISTS(QT_IS_QTCOPY "QtCore/qglobal.h" QT_KDE_QT_COPY)
@@ -392,8 +408,8 @@
      ENDIF (NOT QT_IS_QTCOPY)
   ENDIF (QT_QTCOPY_REQUIRED)

-  # Restore CMAKE_REQUIRED_INCLUDES variable
-  SET(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES_SAVE})
+  # Restore CMAKE_REQUIRED_INCLUDES+CMAKE_REQUIRED_FLAGS variables
+  macro_pop_required_vars()
   #
   #############################################

@@ -632,67 +648,82 @@
   ELSE (QT_USE_FRAMEWORKS)

     # Set QT_QTCORE_LIBRARY by searching for a lib with "QtCore."  as part of the filename
-    FIND_LIBRARY(QT_QTCORE_LIBRARY NAMES QtCore QtCore4          PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH )
+    FIND_LIBRARY(QT_QTCORE_LIBRARY NAMES QtCore QtCore4 QtCored4          PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH )

     # Set QT_QT3SUPPORT_LIBRARY
-    FIND_LIBRARY(QT_QT3SUPPORT_LIBRARY NAMES Qt3Support Qt3Support4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
+    FIND_LIBRARY(QT_QT3SUPPORT_LIBRARY NAMES Qt3Support Qt3Support4 Qt3Supportd4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)

     # Set QT_QTGUI_LIBRARY
-    FIND_LIBRARY(QT_QTGUI_LIBRARY NAMES QtGui QtGui4             PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
+    FIND_LIBRARY(QT_QTGUI_LIBRARY NAMES QtGui QtGui4 QtGuid4            PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)

     # Set QT_QTMOTIF_LIBRARY
     IF(Q_WS_X11)
-      FIND_LIBRARY(QT_QTMOTIF_LIBRARY NAMES QtMotif              PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
+      FIND_LIBRARY(QT_QTMOTIF_LIBRARY NAMES QtMotif          PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
     ENDIF(Q_WS_X11)

     # Set QT_QTNETWORK_LIBRARY
-    FIND_LIBRARY(QT_QTNETWORK_LIBRARY NAMES QtNetwork QtNetwork4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
+    FIND_LIBRARY(QT_QTNETWORK_LIBRARY NAMES QtNetwork QtNetwork4 QtNetworkd4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)

     # Set QT_QTNSPLUGIN_LIBRARY
-    FIND_LIBRARY(QT_QTNSPLUGIN_LIBRARY NAMES QtNsPlugin          PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
+    FIND_LIBRARY(QT_QTNSPLUGIN_LIBRARY NAMES QtNsPlugin      PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)

     # Set QT_QTOPENGL_LIBRARY
-    FIND_LIBRARY(QT_QTOPENGL_LIBRARY NAMES QtOpenGL QtOpenGL4    PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
+    FIND_LIBRARY(QT_QTOPENGL_LIBRARY NAMES QtOpenGL QtOpenGL4 QtOpenGLd4    PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)

     # Set QT_QTSQL_LIBRARY
-    FIND_LIBRARY(QT_QTSQL_LIBRARY NAMES QtSql QtSql4             PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
+    FIND_LIBRARY(QT_QTSQL_LIBRARY NAMES QtSql QtSql4 QtSqld4       PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)

     # Set QT_QTXML_LIBRARY
-    FIND_LIBRARY(QT_QTXML_LIBRARY NAMES QtXml QtXml4             PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
+    FIND_LIBRARY(QT_QTXML_LIBRARY NAMES QtXml QtXml4 QtXmld4       PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)

     # Set QT_QTSVG_LIBRARY
-    FIND_LIBRARY(QT_QTSVG_LIBRARY NAMES QtSvg QtSvg4             PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
+    FIND_LIBRARY(QT_QTSVG_LIBRARY NAMES QtSvg QtSvg4 QtSvgd4       PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)

     # Set QT_QTSCRIPT_LIBRARY
-    FIND_LIBRARY(QT_QTSCRIPT_LIBRARY NAMES QtScript QtScript4    PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
+    FIND_LIBRARY(QT_QTSCRIPT_LIBRARY NAMES QtScript QtScript4 QtScriptd4   PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)

     # Set QT_QTUITOOLS_LIBRARY
-    FIND_LIBRARY(QT_QTUITOOLS_LIBRARY NAMES QtUiTools QtUiTools4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
+    FIND_LIBRARY(QT_QTUITOOLS_LIBRARY NAMES QtUiTools QtUiTools4 QtUiToolsd4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)

     # Set QT_QTTEST_LIBRARY
-    FIND_LIBRARY(QT_QTTEST_LIBRARY NAMES QtTest QtTest4          PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
-
-    FIND_LIBRARY(QT_QTDBUS_LIBRARY NAMES QtDBus QtDBus4          PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
+    FIND_LIBRARY(QT_QTTEST_LIBRARY NAMES QtTest QtTest4 QtTestd4          PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
+
+    FIND_LIBRARY(QT_QTDBUS_LIBRARY NAMES QtDBus QtDBus4 QtDBusd4         PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)

     IF(MSVC)
+      FIND_LIBRARY(QT_QTCORE_LIBRARY_RELEASE    NAMES QtCore4            PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
       FIND_LIBRARY(QT_QTCORE_LIBRARY_DEBUG      NAMES QtCored4            PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
+      FIND_LIBRARY(QT_QT3SUPPORT_LIBRARY_RELEASE NAMES Qt3Support4        PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
       FIND_LIBRARY(QT_QT3SUPPORT_LIBRARY_DEBUG  NAMES Qt3Supportd4        PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
+      FIND_LIBRARY(QT_QTGUI_LIBRARY_RELEASE     NAMES QtGui4             PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
       FIND_LIBRARY(QT_QTGUI_LIBRARY_DEBUG       NAMES QtGuid4             PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
+      FIND_LIBRARY(QT_QTNETWORK_LIBRARY_RELEASE NAMES QtNetwork4         PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
       FIND_LIBRARY(QT_QTNETWORK_LIBRARY_DEBUG   NAMES QtNetworkd4         PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
+      FIND_LIBRARY(QT_QTOPENGL_LIBRARY_RELEASE  NAMES QtOpenGL4          PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
       FIND_LIBRARY(QT_QTOPENGL_LIBRARY_DEBUG    NAMES QtOpenGLd4          PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
+      FIND_LIBRARY(QT_QTSQL_LIBRARY_RELEASE     NAMES QtSql4             PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
       FIND_LIBRARY(QT_QTSQL_LIBRARY_DEBUG       NAMES QtSqld4             PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
+      FIND_LIBRARY(QT_QTXML_LIBRARY_RELEASE     NAMES QtXml4             PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
       FIND_LIBRARY(QT_QTXML_LIBRARY_DEBUG       NAMES QtXmld4             PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
+      FIND_LIBRARY(QT_QTSVG_LIBRARY_RELEASE     NAMES QtSvg4             PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
       FIND_LIBRARY(QT_QTSVG_LIBRARY_DEBUG       NAMES QtSvgd4             PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
+      FIND_LIBRARY(QT_QTSCRIPT_LIBRARY_RELEASE  NAMES QtScript4          PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
       FIND_LIBRARY(QT_QTSCRIPT_LIBRARY_DEBUG    NAMES QtScriptd4          PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
+      FIND_LIBRARY(QT_QTUITOOLS_LIBRARY_RELEASE NAMES QtUiTools QtUiTools4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
       FIND_LIBRARY(QT_QTUITOOLS_LIBRARY_DEBUG   NAMES QtUiToolsd QtUiToolsd4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
+      FIND_LIBRARY(QT_QTTEST_LIBRARY_RELEASE    NAMES QtTest4            PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
       FIND_LIBRARY(QT_QTTEST_LIBRARY_DEBUG      NAMES QtTestd4            PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
+      FIND_LIBRARY(QT_QTDBUS_LIBRARY_RELEASE    NAMES QtDBus4            PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
       FIND_LIBRARY(QT_QTDBUS_LIBRARY_DEBUG      NAMES QtDBusd4            PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
+      FIND_LIBRARY(QT_QTASSISTANT_LIBRARY_RELEASE NAMES QtAssistantClient4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
       FIND_LIBRARY(QT_QTASSISTANT_LIBRARY_DEBUG NAMES QtAssistantClientd4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
-      FIND_LIBRARY(QT_QTDESIGNER_LIBRARY_DEBUG           NAMES QtDesigner4            PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
+      FIND_LIBRARY(QT_QTDESIGNER_LIBRARY_RELEASE NAMES QtDesigner4            PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
+      FIND_LIBRARY(QT_QTDESIGNER_LIBRARY_DEBUG  NAMES QtDesignerd4            PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
+      FIND_LIBRARY(QT_QTDESIGNERCOMPONENTS_LIBRARY_RELEASE NAMES QtDesignerComponents4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
       FIND_LIBRARY(QT_QTDESIGNERCOMPONENTS_LIBRARY_DEBUG NAMES QtDesignerComponentsd4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
+      FIND_LIBRARY(QT_QTMAIN_LIBRARY_RELEASE    NAMES qtmain             PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
       FIND_LIBRARY(QT_QTMAIN_LIBRARY_DEBUG      NAMES qtmaind             PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
     ENDIF(MSVC)
-
   ENDIF (QT_USE_FRAMEWORKS)

   IF( NOT QT_QTCORE_LIBRARY )
@@ -702,17 +733,17 @@
   ENDIF( NOT QT_QTCORE_LIBRARY )

   # Set QT_QTASSISTANT_LIBRARY
-  FIND_LIBRARY(QT_QTASSISTANT_LIBRARY NAMES QtAssistantClient QtAssistantClient4 QtAssistant QtAssistant4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
+  FIND_LIBRARY(QT_QTASSISTANT_LIBRARY NAMES QtAssistantClient QtAssistantClient4 QtAssistant QtAssistant4 QtAssistantd4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)

   # Set QT_QTDESIGNER_LIBRARY
-  FIND_LIBRARY(QT_QTDESIGNER_LIBRARY NAMES QtDesigner QtDesigner4 PATHS ${QT_LIBRARY_DIR}        NO_DEFAULT_PATH)
+  FIND_LIBRARY(QT_QTDESIGNER_LIBRARY NAMES QtDesigner QtDesigner4 QtDesignerd4 PATHS ${QT_LIBRARY_DIR}        NO_DEFAULT_PATH)

   # Set QT_QTDESIGNERCOMPONENTS_LIBRARY
-  FIND_LIBRARY(QT_QTDESIGNERCOMPONENTS_LIBRARY NAMES QtDesignerComponents QtDesignerComponents4 PATHS ${QT_LIBRARY_DIR}        NO_DEFAULT_PATH)
+  FIND_LIBRARY(QT_QTDESIGNERCOMPONENTS_LIBRARY NAMES QtDesignerComponents QtDesignerComponents4 QtDesignerComponentsd4 PATHS ${QT_LIBRARY_DIR}        NO_DEFAULT_PATH)

   # Set QT_QTMAIN_LIBRARY
   IF(WIN32)
-    FIND_LIBRARY(QT_QTMAIN_LIBRARY NAMES qtmain PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
+    FIND_LIBRARY(QT_QTMAIN_LIBRARY NAMES qtmain qtmaind PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
   ENDIF(WIN32)

   ############################################
@@ -725,16 +756,20 @@
     IF (QT_${basename}_LIBRARY OR QT_${basename}_LIBRARY_DEBUG)

       IF(MSVC)
-
         # Both set
-        IF (QT_${basename}_LIBRARY AND QT_${basename}_LIBRARY_DEBUG)
-          SET(QT_${basename}_LIBRARY optimized ${QT_${basename}_LIBRARY} debug ${QT_${basename}_LIBRARY_DEBUG})
-        ENDIF (QT_${basename}_LIBRARY AND QT_${basename}_LIBRARY_DEBUG)
+        IF (QT_${basename}_LIBRARY_RELEASE AND QT_${basename}_LIBRARY_DEBUG)
+          SET(QT_${basename}_LIBRARY optimized ${QT_${basename}_LIBRARY_RELEASE} debug ${QT_${basename}_LIBRARY_DEBUG})
+        ENDIF (QT_${basename}_LIBRARY_RELEASE AND QT_${basename}_LIBRARY_DEBUG)

         # Only debug was found
-        IF (NOT QT_${basename}_LIBRARY AND QT_${basename}_LIBRARY_DEBUG)
+        IF (NOT QT_${basename}_LIBRARY_RELEASE AND QT_${basename}_LIBRARY_DEBUG)
           SET(QT_${basename}_LIBRARY ${QT_${basename}_LIBRARY_DEBUG})
-        ENDIF (NOT QT_${basename}_LIBRARY AND QT_${basename}_LIBRARY_DEBUG)
+        ENDIF (NOT QT_${basename}_LIBRARY_RELEASE AND QT_${basename}_LIBRARY_DEBUG)
+
+        # Only release was found
+        IF (QT_${basename}_LIBRARY_RELEASE AND NOT QT_${basename}_LIBRARY_DEBUG)
+          SET(QT_${basename}_LIBRARY ${QT_${basename}_LIBRARY_RELEASE})
+        ENDIF (QT_${basename}_LIBRARY_RELEASE AND NOT QT_${basename}_LIBRARY_DEBUG)

         # Hmm, is this used anywhere ? Yes, in UseQt4.cmake. We are currently incompatible :-(
         SET(QT_${basename}_LIBRARIES optimized ${QT_${basename}_LIBRARY} debug ${QT_${basename}_LIBRARY_DEBUG})
@@ -787,10 +822,6 @@
     _QT4_ADJUST_LIB_VARS(QTMAIN)
   ENDIF(WIN32)

-  IF(QT_QTSCRIPT_LIBRARY AND QT_QTUITOOLS_LIBRARY)
-    SET(QT_QTUITOOLS_LIBRARY ${QT_QTUITOOLS_LIBRARY} ${QT_QTSCRIPT_LIBRARY} )
-  ENDIF(QT_QTSCRIPT_LIBRARY AND QT_QTUITOOLS_LIBRARY)
-
   #######################################
   #
   #       Check the executables of Qt
@@ -922,7 +953,7 @@
   ENDMACRO (QT4_WRAP_UI)

-  # QT4_ADD_RESOURCE(outfiles inputfile ... )
+  # QT4_ADD_RESOURCES(outfiles inputfile ... )
   # TODO  perhaps consider adding support for compression and root options to rcc

   MACRO (QT4_ADD_RESOURCES outfiles )
@@ -956,11 +987,18 @@
     SET(_header ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.h)
     SET(_impl   ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.cpp)
     SET(_moc    ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.moc)
-
-    ADD_CUSTOM_COMMAND(OUTPUT ${_impl} ${_header}
-        COMMAND ${QT_DBUSXML2CPP_EXECUTABLE} -m -p ${_basename} ${_infile}
+
+    GET_SOURCE_FILE_PROPERTY(_nonamespace ${_infile} NO_NAMESPACE)
+    IF ( _nonamespace )
+        SET(_params -N -m -p)
+    ELSE ( _nonamespace )
+        SET(_params -m -p)
+    ENDIF ( _nonamespace )
+
+     ADD_CUSTOM_COMMAND(OUTPUT ${_impl} ${_header}
+        COMMAND ${QT_DBUSXML2CPP_EXECUTABLE} ${_params} ${_basename} ${_infile}
         DEPENDS ${_infile})
-
+
     SET_SOURCE_FILES_PROPERTIES(${_impl} PROPERTIES SKIP_AUTOMOC TRUE)

     QT4_GENERATE_MOC(${_header} ${_moc})
@@ -969,20 +1007,33 @@
     MACRO_ADD_FILE_DEPENDENCIES(${_impl} ${_moc})

   ENDMACRO(QT4_ADD_DBUS_INTERFACE)
-
-
+
+  MACRO(QT4_ADD_DBUS_INTERFACE_NO_NAMESPACE _sources _interface _basename)
+    SET_SOURCE_FILES_PROPERTIES(${_interface} PROPERTIES NO_NAMESPACE TRUE)
+    QT4_ADD_DBUS_INTERFACE(${_sources} ${_interface} ${_basename})
+  ENDMACRO(QT4_ADD_DBUS_INTERFACE_NO_NAMESPACE)
+
+  # Internal (avoid to duplicate code between QT4_ADD_DBUS_INTERFACES_NO_NAMESPACE and QT4_ADD_DBUS_INTERFACES
+  MACRO(_QT4_ADD_DBUS_INTERFACES _sources _filename)
+        GET_FILENAME_COMPONENT(_infile ${_filename} ABSOLUTE)
+        # get the part before the ".xml" suffix
+        STRING(REGEX REPLACE "(.*[/\\.])?([^\\.]+)\\.xml" "\\2" _basename ${_current_FILE})
+        STRING(TOLOWER ${_basename} _basename)
+        QT4_ADD_DBUS_INTERFACE(${_sources} ${_infile} ${_basename}interface)
+  ENDMACRO(_QT4_ADD_DBUS_INTERFACES)
+
   MACRO(QT4_ADD_DBUS_INTERFACES _sources)
      FOREACH (_current_FILE ${ARGN})
-        GET_FILENAME_COMPONENT(_infile ${_current_FILE} ABSOLUTE)
-
-  # get the part before the ".xml" suffix
-        STRING(REGEX REPLACE "(.*[/\\.])?([^\\.]+)\\.xml" "\\2" _basename ${_current_FILE})
-        STRING(TOLOWER ${_basename} _basename)
-
-        QT4_ADD_DBUS_INTERFACE(${_sources} ${_infile} ${_basename}interface)
+        _QT4_ADD_DBUS_INTERFACES(${_sources} ${_current_FILE})
      ENDFOREACH (_current_FILE)
   ENDMACRO(QT4_ADD_DBUS_INTERFACES)
-
+
+  MACRO(QT4_ADD_DBUS_INTERFACES_NO_NAMESPACE _sources)
+    FOREACH (_current_FILE ${ARGN})
+	SET_SOURCE_FILES_PROPERTIES(${_current_FILE} PROPERTIES NO_NAMESPACE TRUE)
+        _QT4_ADD_DBUS_INTERFACES(${_sources} ${_current_FILE})
+    ENDFOREACH (_current_FILE)
+  ENDMACRO(QT4_ADD_DBUS_INTERFACES_NO_NAMESPACE)

   MACRO(QT4_GENERATE_DBUS_INTERFACE _header) # _customName )
     SET(_customName "${ARGV1}")
@@ -1093,7 +1144,11 @@
   IF( QT_LIBRARY_DIR AND QT_INCLUDE_DIR AND QT_MOC_EXECUTABLE AND QT_UIC_EXECUTABLE AND QT_RCC_EXECUTABLE)
     SET( QT4_FOUND "YES" )
     IF( NOT Qt4_FIND_QUIETLY)
-      MESSAGE(STATUS "Found Qt-Version ${QTVERSION}")
+      IF (WIN32)
+        MESSAGE(STATUS "Found Qt-Version ${QTVERSION} with qmake at ${QT_QMAKE_EXECUTABLE}")
+      ELSE (WIN32)
+        MESSAGE(STATUS "Found Qt-Version ${QTVERSION}")
+      ENDIF (WIN32)
     ENDIF( NOT Qt4_FIND_QUIETLY)
   ELSE( QT_LIBRARY_DIR AND QT_INCLUDE_DIR AND QT_MOC_EXECUTABLE AND QT_UIC_EXECUTABLE AND QT_RCC_EXECUTABLE)
     SET( QT4_FOUND "NO")


Further cmake fixes.

Further cmake fixes.

--- cmake/FindXDR.cmake
+++ cmake/FindXDR.cmake
@@ -70,7 +70,7 @@
 		SET(XDR_FOUND TRUE)

 		## Let's see if we have an implementation for xdr_u_hyper
-		IF (${XDR_LIBRARIES})
+		IF (XDR_LIBRARIES)
 			CHECK_LIBRARY_EXISTS(${XDR_LIBRARIES} xdr_u_hyper "" BALL_HAS_XDR_U_HYPER)
 		ELSE()
 			CHECK_FUNCTION_EXISTS(xdr_u_hyper BALL_HAS_XDR_U_HYPER)


Added DEB along with RPM to the CPack generator list.

--- cmake/dtkPack.cmake
+++ cmake/dtkPack.cmake
@@ -75,7 +75,7 @@
 endif(WIN32)

 if(UNIX AND NOT APPLE)
-  set(CPACK_GENERATOR "RPM")
+  set(CPACK_GENERATOR "DEB;RPM")
 endif(UNIX AND NOT APPLE)

 ## #################################################################


Remove unused file

Remove unused file

--- cmake/jenkins.cmake
+++ cmake/jenkins.cmake
@@ -1,18 +0,0 @@
-set(LABEL_EXPR "$ENV{label_exp}")
-if ("${LABEL_EXPR}" MATCHES "gcc" OR "${LABEL_EXPR}" MATCHES "gcovr")
-  message(STATUS "Set CXX to g++ based on label_expr content")
-  set(CMAKE_C_COMPILER "gcc" CACHE PATH "C compiler option")
-  set(CMAKE_CXX_COMPILER "g++" CACHE PATH "C++ compiler option")
-  # OpenCL header on OSX do not work with GCC
-  if(APPLE)
-    set(CAF_NO_OPENCL yes CACHE BOOL "Configure OpenCL module")
-  endif(APPLE)
-elseif ("${LABEL_EXPR}" MATCHES "clang")
-  message(STATUS "Set CXX to clang++ based on label_expr content")
-  set(CMAKE_C_COMPILER "clang" CACHE STRING "C compiler option")
-  set(CMAKE_CXX_COMPILER "clang++" CACHE STRING "C++ compiler option")
-endif()
-# disable SSL when doing leak checking due to a known issue with the module
-if (${LABEL_EXPR} MATCHES "LeakSanitizer")
-  set(CAF_NO_OPENSSL yes CACHE BOOL "Configure OpenSSL module")
-endif()


Fixed windows build: taget name for sha256 password plugin wasn't specified

--- cmake/plugins.cmake
+++ cmake/plugins.cmake
@@ -39,7 +39,7 @@

 # AUTHENTICATION
 IF(WIN32 OR WITH_SSL STREQUAL "OPENSSL")
-  REGISTER_PLUGIN("AUTH_SHA256PW" "${CC_SOURCE_DIR}/plugins/auth/sha256_pw.c" "sha256_password_client_plugin" "DYNAMIC" "" 0)
+  REGISTER_PLUGIN("AUTH_SHA256PW" "${CC_SOURCE_DIR}/plugins/auth/sha256_pw.c" "sha256_password_client_plugin" "DYNAMIC" sha256_password 1)
 ENDIF()
 REGISTER_PLUGIN("AUTH_NATIVE" "${CC_SOURCE_DIR}/plugins/auth/my_auth.c" "native_password_client_plugin" "STATIC" "" 0)
 REGISTER_PLUGIN("AUTH_OLDPASSWORD" "${CC_SOURCE_DIR}/plugins/auth/old_password.c" "old_password_client_plugin" "STATIC" "" 1)


CMake: Added & clearified logs in boost-download

--- src/cmake/boost-download.cmake
+++ src/cmake/boost-download.cmake
@@ -159,6 +159,7 @@
     # Run bootstrap
     file( GLOB IS_B2_BUILT "${TMP_DIR}/b2*" )
     if(NOT IS_B2_BUILT)
+        message("Running boost bootstrap...")
         execute_process(
             COMMAND ${BOOTSTRAP_SCRIPT}
             WORKING_DIRECTORY "${TMP_DIR}"
@@ -166,12 +167,14 @@
     endif()

     # Generate header sym-links
+    message("Generating header sym-links...")
     execute_process(
         COMMAND ${BUILD_SCRIPT} "headers"
         WORKING_DIRECTORY "${TMP_DIR}"
     )

     # Build bcp. Will be put in dist/bin/
+    message("Building bcp...")
     if(NOT EXISTS "${TMP_DIR}/${BCP_EXEC_PATH}*")
         execute_process(
             COMMAND ${BUILD_SCRIPT} "tools/bcp"
@@ -187,6 +190,7 @@
     )

     # Clean up tmp-repo and remove (can't remove with all symlinks in ./boost/...)
+    message("Creating repo with minimal subset of boost...")
     execute_git(
         COMMAND clean --force -d -x
         WORKING_DIRECTORY "${TMP_DIR}"
@@ -211,6 +215,6 @@
         WORKING_DIRECTORY "${args_CLONE_DIR}"
     )

-    message("A minimal version containing required modules for: \n\t'${args_SUBMODULES}' \nhas been created at: \n\t${args_CLONE_DIR}")
+    message("A minimal subset containing required modules for: \n\t'${args_SUBMODULES}' \nhas been created at: \n\t${args_CLONE_DIR}")

 endfunction()


Patch cmake list

Patch cmake list

--- src/cmake/public-headers.cmake
+++ src/cmake/public-headers.cmake
@@ -62,7 +62,6 @@
 core/smtp/MCSMTPProgressCallback.h
 core/smtp/MCSMTPSession.h
 core/nntp/MCNNTP.h
-core/nntp/MCNNTPArticleInfo.h
 core/nntp/MCNNTPGroupInfo.h
 core/nntp/MCNNTPProgressCallback.h
 core/nntp/MCNNTPSession.h


Fix typo in CMake boiler plate

Fix typo in CMake boiler plate

--- x86_energyConfig.cmake
+++ x86_energyConfig.cmake
@@ -1,4 +1,4 @@
-include("${CMAKE_CURRENT_LIST_DIR}/ix86_energyTargets.cmake")
+include("${CMAKE_CURRENT_LIST_DIR}/x86_energyTargets.cmake")

 set(x86_energy_FOUND TRUE)


Fix polly_init

Fix polly_init

--- ios-nocodesign-11-4-dep-9-3-arm64.cmake
+++ ios-nocodesign-11-4-dep-9-3-arm64.cmake
@@ -16,7 +16,7 @@

 set(POLLY_XCODE_COMPILER "clang")
 polly_init(
-    "iOS ${IOS_SDK_VERSION} / Deployment ${IOS_DEPLOYMENT_SDK_VERSION} / Universal (iphoneos + iphonesimulator) / \
+    "iOS ${IOS_SDK_VERSION} / Deployment ${IOS_DEPLOYMENT_SDK_VERSION} / arm64 / \
 ${POLLY_XCODE_COMPILER} / \
 No code sign / \
 c++14 support"


Fix yum conf file name

Fix yum conf file name

--- cmake/package-yum.cmake
+++ cmake/package-yum.cmake
@@ -5,7 +5,7 @@
 set(YUM_DIR packages/redhat)

 file(COPY ${YUM_DIR}/01-cdnalizer.conf ${YUM_DIR}/postrm DESTINATION .)
-install(FILES ${CMAKE_CURRENT_BINARY_DIR}/cdnalizer.conf DESTINATION /etc/httpd/conf.modules.d/)
+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/01-cdnalizer.conf DESTINATION /etc/httpd/conf.modules.d/)

 configure_file(${YUM_DIR}/postinst postinst)
 SET(CPACK_RPM_POST_INSTALL_SCRIPT_FILE ${CMAKE_CURRENT_BINARY_DIR}/postinst )


propagate zacc.system library

propagate zacc.system library

--- cmake/zacc.shared.cmake
+++ cmake/zacc.shared.cmake
@@ -201,7 +201,7 @@

     add_library(${target_name} SHARED  ${target_sources})
-    target_link_libraries(${target_name} PRIVATE zacc.system zacc.system.loader ${target_libraries})
+    target_link_libraries(${target_name} PUBLIC zacc.system zacc.system.loader ${target_libraries})

     #if(NOT WIN32) # dlls are copied to bin folder for windows targets
     #    set(search_prefix "../lib/")


remove dependency of libcurl within cmake

--- source/ConfigureChecks.cmake
+++ source/ConfigureChecks.cmake
@@ -97,7 +97,6 @@
 FIND_PACKAGE(TokyoCabinet 1.4.29 REQUIRED)
 FIND_PACKAGE(Glog REQUIRED)
 FIND_PACKAGE(sqlite3 REQUIRED)
-FIND_PACKAGE(LibCURL REQUIRED)

 ##################################################
 # Driver Docs


remove unused INTEL_MKL_ROOT etc.

remove unused INTEL_MKL_ROOT etc.

--- cmake/cblas.cmake
+++ cmake/cblas.cmake
@@ -27,44 +27,6 @@

   message(STATUS "Found cblas and lapack in MKLML "
     "(include: ${CBLAS_INC_DIR}, library: ${CBLAS_LIBRARIES})")
-  return()
-endif()
-
-## Then find MKL.
-set(INTEL_MKL_ROOT "/opt/intel/mkl" CACHE PATH "Folder contains intel mkl libs")
-set(MKL_ROOT $ENV{MKL_ROOT} CACHE PATH "Folder contains env MKL")
-
-set(MKL_INCLUDE_SEARCH_PATHS
-  ${MKL_ROOT}/include
-  ${INTEL_MKL_ROOT}/include)
-set(MKL_LIB_SEARCH_PATHS
-  ${MKL_ROOT}/lib
-  ${MKL_ROOT}/lib/intel64
-  ${INTEL_MKL_ROOT}/lib
-  ${INTEL_MKL_ROOT}/lib/intel64)
-
-find_path(MKL_INC_DIR mkl.h PATHS
-  ${MKL_INCLUDE_SEARCH_PATHS})
-find_path(MKL_LAPACK_INC_DIR mkl_lapacke.h PATHS
-  ${MKL_INCLUDE_SEARCH_PATHS})
-find_library(MKL_CORE_LIB NAMES mkl_core PATHS
-  ${MKL_LIB_SEARCH_PATHS})
-find_library(MKL_SEQUENTIAL_LIB NAMES mkl_sequential PATHS
-  ${MKL_LIB_SEARCH_PATHS})
-find_library(MKL_INTEL_LP64 NAMES mkl_intel_lp64 PATHS
-  ${MKL_LIB_SEARCH_PATHS})
-
-if(MKL_LAPACK_INC_DIR AND MKL_INC_DIR AND MKL_CORE_LIB AND MKL_SEQUENTIAL_LIB AND MKL_INTEL_LP64)
-  set(CBLAS_FOUND ON)
-  set(CBLAS_PROVIDER MKL)
-  set(CBLAS_INC_DIR ${MKL_INC_DIR} ${MKL_LAPACK_INC_DIR})
-  set(CBLAS_LIBRARIES ${MKL_INTEL_LP64} ${MKL_SEQUENTIAL_LIB} ${MKL_CORE_LIB})
-
-  add_definitions(-DPADDLE_USE_MKL)
-  add_definitions(-DLAPACK_FOUND)
-
-  message(STATUS "Found MKL (include: ${MKL_INC_DIR}, library: ${CBLAS_LIBRARIES})")
-  message(STATUS "Found lapack in MKL (include: ${MKL_LAPACK_INC_DIR})")
   return()
 endif()


Remove a trailing whitespace

Remove a trailing whitespace

--- cmake/flags.cmake
+++ cmake/flags.cmake
@@ -1,7 +1,7 @@
 include(CheckCXXCompilerFlag)

 function (vistk_check_compiler_flag variable flag)
-  string(REPLACE "+" "plus" safeflag "${flag}")
+  string(REPLACE "+" "plus" safeflag "${flag}")

   check_cxx_compiler_flag("${flag}" "have_compiler_flag-${safeflag}")


Remove unused vars.

Remove unused vars.

svn path=/trunk/kdesupport/akonadi/; revision=961878

--- cmake/modules/InstallSettings.cmake
+++ cmake/modules/InstallSettings.cmake
@@ -3,134 +3,88 @@
 # Redistribution and use is allowed according to the terms of the BSD license.
 # For details see the accompanying COPYING-CMAKE-SCRIPTS file.

-set(LIB_SUFFIX "" CACHE STRING "Define suffix of directory name (32/64)" )
+set (LIB_SUFFIX "" CACHE STRING "Define suffix of directory name (32/64)")

 if (WIN32)
-# use relative install prefix to avoid hardcoded install paths in cmake_install.cmake files
+  # use relative install prefix to avoid hardcoded install paths in cmake_install.cmake files

-   set(LIB_INSTALL_DIR      "lib${LIB_SUFFIX}" )            # The subdirectory relative to the install prefix where libraries will be installed (default is ${EXEC_INSTALL_PREFIX}/lib${LIB_SUFFIX})
+  set (EXEC_INSTALL_PREFIX "") # Base directory for executables and libraries

-   set(EXEC_INSTALL_PREFIX  "" )        # Base directory for executables and libraries
-   set(SHARE_INSTALL_PREFIX "share" )   # Base directory for files which go to share/
-   set(BIN_INSTALL_DIR      "bin"   )   # The install dir for executables (default ${EXEC_INSTALL_PREFIX}/bin)
-   set(SBIN_INSTALL_DIR     "sbin"  )   # The install dir for system executables (default ${EXEC_INSTALL_PREFIX}/sbin)
+  ## ${CMAKE_INSTALL_PREFIX}/*
+  set (BIN_INSTALL_DIR             "bin")                     # The install dir for executables (default ${EXEC_INSTALL_PREFIX}/bin)
+  set (INCLUDE_INSTALL_DIR         "include")                 # The subdirectory to the header prefix
+  set (LIB_INSTALL_DIR             "lib${LIB_SUFFIX}")        # The subdirectory relative to the install prefix where libraries will be installed (default is ${EXEC_INSTALL_PREFIX}/lib${LIB_SUFFIX})
+  set (SHARE_INSTALL_PREFIX        "share")                   # Base directory for files which go to share/

-   set(LIBEXEC_INSTALL_DIR  "${BIN_INSTALL_DIR}"          ) # The subdirectory relative to the install prefix where libraries will be installed (default is ${BIN_INSTALL_DIR})
-   set(INCLUDE_INSTALL_DIR  "include"                     ) # The subdirectory to the header prefix
-
-   set(PLUGIN_INSTALL_DIR       "lib${LIB_SUFFIX}/kde4"   ) #                "The subdirectory relative to the install prefix where plugins will be installed (default is ${LIB_INSTALL_DIR}/kde4)
-   set(CONFIG_INSTALL_DIR       "share/config"            ) # The config file install dir
-   set(DATA_INSTALL_DIR         "share/apps"              ) # The parent directory where applications can install their data
-   set(HTML_INSTALL_DIR         "share/doc/HTML"          ) # The HTML install dir for documentation
-   set(ICON_INSTALL_DIR         "share/icons"             ) # The icon install dir (default ${SHARE_INSTALL_PREFIX}/share/icons/)
-   set(KCFG_INSTALL_DIR         "share/config.kcfg"       ) # The install dir for kconfig files
-   set(LOCALE_INSTALL_DIR       "share/locale"            ) # The install dir for translations
-   set(MIME_INSTALL_DIR         "share/mimelnk"           ) # The install dir for the mimetype desktop files
-   set(SERVICES_INSTALL_DIR     "share/kde4/services"     ) # The install dir for service (desktop, protocol, ...) files
-   set(SERVICETYPES_INSTALL_DIR "share/kde4/servicetypes" ) # The install dir for servicestypes desktop files
-   set(SOUND_INSTALL_DIR        "share/sounds"            ) # The install dir for sound files
-   set(TEMPLATES_INSTALL_DIR    "share/templates"         ) # The install dir for templates (Create new file...)
-   set(WALLPAPER_INSTALL_DIR    "share/wallpapers"        ) # The install dir for wallpapers
-   set(DEMO_INSTALL_DIR         "share/demos"             ) # The install dir for demos
-   set(KCONF_UPDATE_INSTALL_DIR "share/apps/kconf_update" ) # The kconf_update install dir
-   set(AUTOSTART_INSTALL_DIR    "share/autostart"         ) # The install dir for autostart files
-
-   set(XDG_APPS_INSTALL_DIR      "share/applications/kde4"   ) # The XDG apps dir
-   set(XDG_DIRECTORY_INSTALL_DIR "share/desktop-directories" ) # The XDG directory
-   set(XDG_MIME_INSTALL_DIR      "share/mime/packages"       ) # The install dir for the xdg mimetypes
-
-   set(SYSCONF_INSTALL_DIR       "etc"                       ) # The kde sysconfig install dir (default /etc)
-   set(MAN_INSTALL_DIR           "share/man"                 ) # The kde man install dir (default ${SHARE_INSTALL_PREFIX}/man/)
-   set(INFO_INSTALL_DIR          "share/info"                ) # The kde info install dir (default ${SHARE_INSTALL_PREFIX}/info)")
-   set(DBUS_INTERFACES_INSTALL_DIR "share/dbus-1/interfaces" ) # The kde dbus interfaces install dir (default  ${SHARE_INSTALL_PREFIX}/dbus-1/interfaces)")
-   set(DBUS_SERVICES_INSTALL_DIR "share/dbus-1/services"     ) # The kde dbus services install dir (default  ${SHARE_INSTALL_PREFIX}/dbus-1/services)")
+  ## ${CMAKE_INSTALL_PREFIX}/share/*
+  set (CONFIG_INSTALL_DIR          "share/config")            # The config file install dir
+  set (DBUS_INTERFACES_INSTALL_DIR "share/dbus-1/interfaces") # The DBus interfaces install dir (default ${SHARE_INSTALL_PREFIX}/dbus-1/interfaces)")
+  set (DBUS_SERVICES_INSTALL_DIR   "share/dbus-1/services")   # The DBus services install dir (default ${SHARE_INSTALL_PREFIX}/dbus-1/services)")
+  set (XDG_MIME_INSTALL_DIR        "share/mime/packages")     # The install dir for the xdg mimetypes

 else (WIN32)
+  # this macro implements some very special logic how to deal with the cache
+  # by default the various install locations inherit their value from theit "parent" variable
+  # so if you set CMAKE_INSTALL_PREFIX, then EXEC_INSTALL_PREFIX, PLUGIN_INSTALL_DIR will
+  # calculate their value by appending subdirs to CMAKE_INSTALL_PREFIX
+  # this would work completely without using the cache.
+  # but if somebody wants e.g. a different EXEC_INSTALL_PREFIX this value has to go into
+  # the cache, otherwise it will be forgotten on the next cmake run.
+  # Once a variable is in the cache, it doesn't depend on its "parent" variables
+  # anymore and you can only change it by editing it directly.
+  # this macro helps in this regard, because as long as you don't set one of the
+  # variables explicitely to some location, it will always calculate its value from its
+  # parents. So modifying CMAKE_INSTALL_PREFIX later on will have the desired effect.
+  # But once you decide to set e.g. EXEC_INSTALL_PREFIX to some special location
+  # this will go into the cache and it will no longer depend on CMAKE_INSTALL_PREFIX.
+  macro(_SET_FANCY _var _value _comment)
+    SET (predefinedvalue "${_value}")

-   # this macro implements some very special logic how to deal with the cache
-   # by default the various install locations inherit their value from theit "parent" variable
-   # so if you set CMAKE_INSTALL_PREFIX, then EXEC_INSTALL_PREFIX, PLUGIN_INSTALL_DIR will
-   # calculate their value by appending subdirs to CMAKE_INSTALL_PREFIX
-   # this would work completely without using the cache.
-   # but if somebody wants e.g. a different EXEC_INSTALL_PREFIX this value has to go into
-   # the cache, otherwise it will be forgotten on the next cmake run.
-   # Once a variable is in the cache, it doesn't depend on its "parent" variables
-   # anymore and you can only change it by editing it directly.
-   # this macro helps in this regard, because as long as you don't set one of the
-   # variables explicitely to some location, it will always calculate its value from its
-   # parents. So modifying CMAKE_INSTALL_PREFIX later on will have the desired effect.
-   # But once you decide to set e.g. EXEC_INSTALL_PREFIX to some special location
-   # this will go into the cache and it will no longer depend on CMAKE_INSTALL_PREFIX.
-   macro(_SET_FANCY _var _value _comment)
-      set(predefinedvalue "${_value}")
-
-      if (NOT DEFINED ${_var})
-         set(${_var} ${predefinedvalue})
-      else (NOT DEFINED ${_var})
-         set(${_var} "${${_var}}" CACHE PATH "${_comment}")
-      endif (NOT DEFINED ${_var})
-   endmacro(_SET_FANCY)
+    if (NOT DEFINED ${_var})
+      SET (${_var} ${predefinedvalue})
+    else (NOT DEFINED ${_var})
+      SET (${_var} "${${_var}}" CACHE PATH "${_comment}")
+    endif (NOT DEFINED ${_var})
+  endmacro(_SET_FANCY)

-   _set_fancy(EXEC_INSTALL_PREFIX  "${CMAKE_INSTALL_PREFIX}"                 "Base directory for executables and libraries")
-   _set_fancy(SHARE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}/share"           "Base directory for files which go to share/")
-   _set_fancy(BIN_INSTALL_DIR      "${EXEC_INSTALL_PREFIX}/bin"              "The install dir for executables (default ${EXEC_INSTALL_PREFIX}/bin)")
-   _set_fancy(SBIN_INSTALL_DIR     "${EXEC_INSTALL_PREFIX}/sbin"             "The install dir for system executables (default ${EXEC_INSTALL_PREFIX}/sbin)")
-   _set_fancy(LIB_INSTALL_DIR      "${EXEC_INSTALL_PREFIX}/lib${LIB_SUFFIX}" "The subdirectory relative to the install prefix where libraries will be installed (default is ${EXEC_INSTALL_PREFIX}/lib${LIB_SUFFIX})")
-   _set_fancy(LIBEXEC_INSTALL_DIR  "${LIB_INSTALL_DIR}/kde4/libexec"         "The subdirectory relative to the install prefix where libraries will be installed (default is ${LIB_INSTALL_DIR}/kde4/libexec)")
-   _set_fancy(INCLUDE_INSTALL_DIR  "${CMAKE_INSTALL_PREFIX}/include"         "The subdirectory to the header prefix")
+  _set_fancy(EXEC_INSTALL_PREFIX  "${CMAKE_INSTALL_PREFIX}"                 "Base directory for executables and libraries")

-   _set_fancy(PLUGIN_INSTALL_DIR       "${LIB_INSTALL_DIR}/kde4"                "The subdirectory relative to the install prefix where plugins will be installed (default is ${LIB_INSTALL_DIR}/kde4)")
-   _set_fancy(CONFIG_INSTALL_DIR       "${SHARE_INSTALL_PREFIX}/config"         "The config file install dir")
-   _set_fancy(DATA_INSTALL_DIR         "${SHARE_INSTALL_PREFIX}/apps"           "The parent directory where applications can install their data")
-   _set_fancy(HTML_INSTALL_DIR         "${SHARE_INSTALL_PREFIX}/doc/HTML"       "The HTML install dir for documentation")
-   _set_fancy(ICON_INSTALL_DIR         "${SHARE_INSTALL_PREFIX}/icons"          "The icon install dir (default ${SHARE_INSTALL_PREFIX}/share/icons/)")
-   _set_fancy(KCFG_INSTALL_DIR         "${SHARE_INSTALL_PREFIX}/config.kcfg"    "The install dir for kconfig files")
-   _set_fancy(LOCALE_INSTALL_DIR       "${SHARE_INSTALL_PREFIX}/locale"         "The install dir for translations")
-   _set_fancy(MIME_INSTALL_DIR         "${SHARE_INSTALL_PREFIX}/mimelnk"        "The install dir for the mimetype desktop files")
-   _set_fancy(SERVICES_INSTALL_DIR     "${SHARE_INSTALL_PREFIX}/kde4/services"  "The install dir for service (desktop, protocol, ...) files")
-   _set_fancy(SERVICETYPES_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/kde4/servicetypes" "The install dir for servicestypes desktop files")
-   _set_fancy(SOUND_INSTALL_DIR        "${SHARE_INSTALL_PREFIX}/sounds"         "The install dir for sound files")
-   _set_fancy(TEMPLATES_INSTALL_DIR    "${SHARE_INSTALL_PREFIX}/templates"      "The install dir for templates (Create new file...)")
-   _set_fancy(WALLPAPER_INSTALL_DIR    "${SHARE_INSTALL_PREFIX}/wallpapers"     "The install dir for wallpapers")
-   _set_fancy(DEMO_INSTALL_DIR         "${SHARE_INSTALL_PREFIX}/demos"          "The install dir for demos")
-   _set_fancy(KCONF_UPDATE_INSTALL_DIR "${DATA_INSTALL_DIR}/kconf_update"       "The kconf_update install dir")
-   _set_fancy(AUTOSTART_INSTALL_DIR    "${SHARE_INSTALL_PREFIX}/autostart"      "The install dir for autostart files")
+  ## ${CMAKE_INSTALL_PREFIX}/*
+  _set_fancy(BIN_INSTALL_DIR      "${EXEC_INSTALL_PREFIX}/bin"              "The install dir for executables (default ${EXEC_INSTALL_PREFIX}/bin)")
+  _set_fancy(INCLUDE_INSTALL_DIR  "${CMAKE_INSTALL_PREFIX}/include"         "The subdirectory to the header prefix")
+  _set_fancy(LIB_INSTALL_DIR      "${EXEC_INSTALL_PREFIX}/lib${LIB_SUFFIX}" "The subdirectory relative to the install prefix where libraries will be installed (default is ${EXEC_INSTALL_PREFIX}/lib${LIB_SUFFIX})")
+  _set_fancy(SHARE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}/share"           "Base directory for files which go to share/")

-   _set_fancy(XDG_APPS_INSTALL_DIR     "${SHARE_INSTALL_PREFIX}/applications/kde4"         "The XDG apps dir")
-   _set_fancy(XDG_DIRECTORY_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/desktop-directories"      "The XDG directory")
-   _set_fancy(XDG_MIME_INSTALL_DIR     "${SHARE_INSTALL_PREFIX}/mime/packages"  "The install dir for the xdg mimetypes")

-   _set_fancy(SYSCONF_INSTALL_DIR      "${CMAKE_INSTALL_PREFIX}/etc"            "The kde sysconfig install dir (default ${CMAKE_INSTALL_PREFIX}/etc)")
-   _set_fancy(MAN_INSTALL_DIR          "${SHARE_INSTALL_PREFIX}/man"            "The kde man install dir (default ${SHARE_INSTALL_PREFIX}/man/)")
-   _set_fancy(INFO_INSTALL_DIR         "${SHARE_INSTALL_PREFIX}/info"           "The kde info install dir (default ${SHARE_INSTALL_PREFIX}/info)")
-   _set_fancy(DBUS_INTERFACES_INSTALL_DIR      "${SHARE_INSTALL_PREFIX}/dbus-1/interfaces" "The kde dbus interfaces install dir (default  ${SHARE_INSTALL_PREFIX}/dbus-1/interfaces)")
-   _set_fancy(DBUS_SERVICES_INSTALL_DIR      "${SHARE_INSTALL_PREFIX}/dbus-1/services"     "The kde dbus services install dir (default  ${SHARE_INSTALL_PREFIX}/dbus-1/services)")
+  ## ${CMAKE_INSTALL_PREFIX}/share/*
+  _set_fancy(CONFIG_INSTALL_DIR          "${SHARE_INSTALL_PREFIX}/config"            "The config file install dir")
+  _set_fancy(DBUS_INTERFACES_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/dbus-1/interfaces" "The DBus interfaces install dir (default ${SHARE_INSTALL_PREFIX}/dbus-1/interfaces)")
+  _set_fancy(DBUS_SERVICES_INSTALL_DIR   "${SHARE_INSTALL_PREFIX}/dbus-1/services"   "The DBus services install dir (default ${SHARE_INSTALL_PREFIX}/dbus-1/services)")
+  _set_fancy(XDG_MIME_INSTALL_DIR        "${SHARE_INSTALL_PREFIX}/mime/packages"     "The install dir for the xdg mimetypes")

 endif (WIN32)

 # The INSTALL_TARGETS_DEFAULT_ARGS variable should be used when libraries are installed.
 # The arguments are also ok for regular executables, i.e. executables which don't go
-# into sbin/ or libexec/, but for installing executables the basic syntax
+# into sbin/ or libexec/, but for installing executables the basic syntax
 # INSTALL(TARGETS kate DESTINATION "${BIN_INSTALL_DIR}")
 # is enough, so using this variable there doesn't help a lot.
 # The variable must not be used for installing plugins.
 # Usage is like this:
-#    install(TARGETS kdecore kdeui ${INSTALL_TARGETS_DEFAULT_ARGS} )
+# install(TARGETS kdecore kdeui ${INSTALL_TARGETS_DEFAULT_ARGS})
 #
 # This will install libraries correctly under UNIX, OSX and Windows (i.e. dll's go
 # into bin/.
 # Later on it will be possible to extend this for installing OSX frameworks
-# The COMPONENT Devel argument has the effect that static libraries belong to the
+# The COMPONENT Devel argument has the effect that static libraries belong to the
 # "Devel" install component. If we use this also for all install() commands
 # for header files, it will be possible to install
-#   -everything: make install OR cmake -P cmake_install.cmake
-#   -only the development files: cmake -DCOMPONENT=Devel -P cmake_install.cmake
-#   -everything except the development files: cmake -DCOMPONENT=Unspecified -P cmake_install.cmake
+# -everything: make install OR cmake -P cmake_install.cmake
+# -only the development files: cmake -DCOMPONENT=Devel -P cmake_install.cmake
+# -everything except the development files: cmake -DCOMPONENT=Unspecified -P cmake_install.cmake
 # This can then also be used for packaging with cpack.

-set(INSTALL_TARGETS_DEFAULT_ARGS  RUNTIME DESTINATION "${BIN_INSTALL_DIR}"
-                                  LIBRARY DESTINATION "${LIB_INSTALL_DIR}"
-                                  ARCHIVE DESTINATION "${LIB_INSTALL_DIR}" COMPONENT Devel )
-
-
+SET (INSTALL_TARGETS_DEFAULT_ARGS RUNTIME DESTINATION "${BIN_INSTALL_DIR}"
+LIBRARY DESTINATION "${LIB_INSTALL_DIR}"
+ARCHIVE DESTINATION "${LIB_INSTALL_DIR}" COMPONENT Devel)


SetupBuildFlags.cmake: Use -Werror=implicit-function-declaration only for C code compilation

The C++ code produces a compile time warning:
  cc1plus: warning: ‘-Werror=’ argument ‘-Werror=implicit-function-declaration’ is not valid for C++
despite CMake's check_cxx_compiler_flag() returning success.

--- cmake/modules/SetupBuildFlags.cmake
+++ cmake/modules/SetupBuildFlags.cmake
@@ -10,7 +10,6 @@

 macro(setup_build_flags _maintainer_mode)
 	list(APPEND proposed_flags
-		-Werror-implicit-function-declaration
 		-Wformat
 		-Wformat-security
 		-Winit-self
@@ -40,6 +39,7 @@

 	list(APPEND proposed_c_flags
 		${proposed_flags}
+		-Werror-implicit-function-declaration
 		-Wdeclaration-after-statement
 		-Wno-missing-field-initializers
 		-Wno-sign-compare


Added mitkLabeledImageLookupTable

Added mitkLabeledImageLookupTable

--- Core/DataStructures/files.cmake
+++ Core/DataStructures/files.cmake
@@ -38,6 +38,7 @@
   mitkImage.cpp
   mitkImageDataItem.cpp
   mitkItkBaseDataAdapter.cpp
+  mitkLabeledImageLookupTable.cpp
   mitkLandmarkBasedCurvedGeometry.cpp
   mitkLandmarkProjectorBasedCurvedGeometry.cpp
   mitkLandmarkProjector.cpp


Add a hack to bundle the fontconfig Qt's platform plugins link to

This should be installed by calling the install dependencies script but
it is not, so we add a hack to make it install.  We should debug the
install dependencies script in future to remove the need for this.

--- projects/unix/tomviz.bundle.cmake
+++ projects/unix/tomviz.bundle.cmake
@@ -78,6 +78,17 @@
   endforeach()"
   COMPONENT superbuild)

+# This is a hack to install fontconfig.  The above install dependencies does not get it
+# even though it is a dependency of the libqxcb platform plugin.  We should figure out why
+# the above doesn't find and install fontconfig since this could break at some point in
+# the future.
+install(DIRECTORY "${Qt5_DIR}/../../"
+  DESTINATION "lib"
+  COMPONENT superbuild
+  FILES_MATCHING
+  PATTERN "*/" EXCLUDE
+  PATTERN "libfontconfig.so.*")
+
 if(itk_ENABLED)
   install(CODE
 "


needed by cmake builds on x86* Gentoo systems

--- CMake/FindGMP.cmake
+++ CMake/FindGMP.cmake
@@ -35,7 +35,8 @@
 if(GMP_INCLUDE_DIRS)
   # Since the GMP version macros may be in a file included by gmp.h of the form
   # gmp-.*[_]?.*.h (e.g., gmp-x86_64.h), we search each of them.
-  file(GLOB GMP_HEADERS "${GMP_INCLUDE_DIRS}/gmp.h" "${GMP_INCLUDE_DIRS}/gmp-*.h")
+  file(GLOB GMP_HEADERS "${GMP_INCLUDE_DIRS}/gmp.h" "${GMP_INCLUDE_DIRS}/gmp-*.h"
+	  "${GMP_INCLUDE_DIRS}/x86*/gmp.h")
   foreach(gmp_header_filename ${GMP_HEADERS})
     file(READ "${gmp_header_filename}" _gmp_version_header)
     string(REGEX MATCH
@@ -72,4 +73,4 @@
 include(FindPackageHandleStandardArgs)
 find_package_handle_standard_args(GMP DEFAULT_MSG
                                   GMP_INCLUDE_DIRS GMP_LIBRARIES GMP_VERSION_OK)
-mark_as_advanced(GMP_INCLUDE_DIRS GMP_LIBRARIES)+mark_as_advanced(GMP_INCLUDE_DIRS GMP_LIBRARIES)


make adding cppcheck target conditional on finding cppchec exe

--- cmake/DuneUtils.cmake
+++ cmake/DuneUtils.cmake
@@ -52,12 +52,17 @@
 ENDMACRO( HEADERCHECK )

 MACRO( ADD_CPPCHECK )
-	FOREACH( SOURCEFILE ${ARGN} )
-		LIST( APPEND CHECKPATHS ${SOURCEFILE} )
-	ENDFOREACH( SOURCEFILE )
-	TO_LIST_SPACES( CPPCHECK_FLAGS CPPCHECK_FLAGS_SPLIT )
-	ADD_CUSTOM_TARGET(  cppcheck cppcheck "--xml" "--enable=all" "-f" "--quiet" "-j 3"
-						${CPPCHECK_FLAGS_SPLIT} ${CHECKPATHS} "2>cppcheck.xml" )
+	find_program( CPPCHECK_BINARY NAMES cppcheck )
+	IF( EXISTS ${CPPCHECK_BINARY} )
+		FOREACH( SOURCEFILE ${ARGN} )
+			LIST( APPEND CHECKPATHS ${SOURCEFILE} )
+		ENDFOREACH( SOURCEFILE )
+		TO_LIST_SPACES( CPPCHECK_FLAGS CPPCHECK_FLAGS_SPLIT )
+		ADD_CUSTOM_TARGET(  cppcheck cppcheck "--xml" "--enable=all" "-f" "--quiet" "-j 3"
+							${CPPCHECK_FLAGS_SPLIT} ${CHECKPATHS} "2>cppcheck.xml" )
+	ELSE( EXISTS ${CPPCHECK_BINARY} )
+		MESSAGE( STATUS "Not adding cppcheck target because cppcheck executable not found" )
+	ENDIF( EXISTS ${CPPCHECK_BINARY} )
 ENDMACRO( ADD_CPPCHECK )

 MACRO( ADD_DUNE_MODULES )
@@ -141,4 +146,4 @@
 	endif()
 endif()

-ENABLE_TESTING()+ENABLE_TESTING()