Updated STIR_TAG

Updated STIR_TAG

In the previously tagged version there was a problem when enabling ITK
(fixed in https://github.com/UCL/STIR/commit/e6c14b7f5d50d43fb27741b1886b88a7d961a754#diff-34406963e3557abc3518c7b3aa314937)

--- version_config.cmake
+++ version_config.cmake
@@ -143,8 +143,7 @@

   ## STIR
   set(DEFAULT_STIR_URL https://github.com/UCL/STIR )
-  set(DEFAULT_STIR_TAG a5fefe741f97a65de95ac51ac612719f5000ac47)
-#  set(DEFAULT_STIR_TAG 9e62872c74cbcea1886d107cb22ab28a5a33083e)
+  set(DEFAULT_STIR_TAG fd3a7576a11930856d6af50d217f17d4848c2bff)

   ## Gadgetron
   set(DEFAULT_Gadgetron_URL https://github.com/gadgetron/gadgetron )


Updated the core/math.

Updated the core/math.

--- core/math.cmake
+++ core/math.cmake
@@ -1,5 +1,17 @@
 #!/usr/bin/env cmake -P
 cmake_minimum_required(VERSION 3.0.2)

-math(EXPR result "1+1")
-message("result: ${result}")
+function(verify_math expr)
+  math(EXPR result "${expr}")
+  message("${expr} = ${result}")
+endfunction()
+
+verify_math("1 + 1")
+verify_math("1 - 5")
+verify_math("2 * 3")
+verify_math("2 * 3 + (2 + 4)")
+verify_math("1 << 3")
+verify_math("8 >> 2")
+verify_math("12 % 10")
+verify_math("8 | 15")
+verify_math("8 & 15")


ToolingFindPackageUtil: psq_check_and_report_tool_version must be a macro

--- ToolingFindPackageUtil.cmake
+++ ToolingFindPackageUtil.cmake
@@ -249,7 +249,7 @@
 # VERSION: The detected tool version
 # REQUIRED_VARS : Required variables, set in parent scope if present
 #                 Must specify at least one.
-function (psq_check_and_report_tool_version PREFIX VERSION)
+macro (psq_check_and_report_tool_version PREFIX VERSION)

     string (STRIP "${VERSION}" VERSION)

@@ -275,7 +275,7 @@

     endif ()

-endfunction ()
+endmacro ()

 # psq_find_executable_installation_root
 #


Message for error 52 from CURL

Message for error 52 from CURL

[skip ci]

--- cmake/modules/hunter_check_download_error_message.cmake
+++ cmake/modules/hunter_check_download_error_message.cmake
@@ -52,6 +52,8 @@
     set(expected_message "\"Timeout was reached\"")
   elseif(x_ERROR_CODE EQUAL 1)
     set(expected_message "\"Unsupported protocol\"")
+  elseif(x_ERROR_CODE EQUAL 52)
+    set(expected_message "\"Server returned nothing (no headers, no data)\"")
   else()
     file(REMOVE "${x_REMOVE_ON_ERROR}")
     hunter_internal_error(


ENH: Added vtk executable settings.

ENH: Added vtk executable settings.

--- vtkCMakeOptions.cmake
+++ vtkCMakeOptions.cmake
@@ -184,3 +184,24 @@
 SET(VTK_FIND_STRING_TCL ${VTK_SOURCE_DIR}/Common/Testing/Tcl/FindString.tcl)
 SET(VTK_PRINT_SELF_CHECK_TCL ${VTK_SOURCE_DIR}/Common/Testing/Tcl/PrintSelfCheck.tcl)
 SET(VTK_RT_IMAGE_TEST_TCL ${VTK_SOURCE_DIR}/Common/Testing/Tcl/rtImageTest.tcl)
+
+IF(VTK_USE_PARALLEL)
+  SET(VTK_PRT_IMAGE_TEST_TCL ${VTK_SOURCE_DIR}/Common/Testing/Tcl/prtImageTest.tcl)
+ENDIF(VTK_USE_PARALLEL)
+
+# VTK executable locations
+IF(VTK_WRAP_TCL)
+  SET(VTK_TCL_EXE ${VTK_EXECUTABLE_PATH}/vtk)
+  SET(VTK_WRAP_TCL_EXE ${VTK_WRAP_TCL_EXE})
+  SET(VTK_TCL_HOME ${VTK_SOURCE_DIR}/Wrapping/Tcl)
+ENDIF(VTK_WRAP_TCL)
+IF(VTK_WRAP_PYTHON)
+  SET(VTK_WRAP_PYTHON_EXE ${VTK_WRAP_PYTHON_EXE})
+  IF(VTK_BUILD_PYTHON_EXECUTABLE)
+    SET(VTK_PYTHON_EXE ${VTK_EXECUTABLE_PATH}/vtkpython)
+  ENDIF(VTK_BUILD_PYTHON_EXECUTABLE)
+ENDIF(VTK_WRAP_PYTHON)
+IF(VTK_WRAP_JAVA)
+  SET(VTK_PARSE_JAVA_EXE ${VTK_PARSE_JAVA_EXE})
+  SET(VTK_WRAP_JAVA_EXE ${VTK_WRAP_JAVA_EXE})
+ENDIF(VTK_WRAP_JAVA)


Add opencv_dir option

Add opencv_dir option

--- CI/configure_option.cmake
+++ CI/configure_option.cmake
@@ -63,3 +63,6 @@
 foreach(option ${otb_options})
   set( CONFIGURE_OPTIONS "${CONFIGURE_OPTIONS}-D${option};")
 endforeach(option)
+
+# This should be removed as soon as possible
+set( CONFIGURE_OPTIONS "${CONFIGURE_OPTIONS}-Dopencv_INCLUDE_DIR:PATH=/usr/include;")


CMake: Change variable name

CMake: Change variable name

Change-Id: Ifff6a6d77ea7f62d3286c3d261b42a4aa0976707

--- CMake/CodeGenerator.cmake
+++ CMake/CodeGenerator.cmake
@@ -8,8 +8,8 @@
 set (GENERATE_JS_CLIENT_PROJECT FALSE CACHE BOOL "Generate js npm client library")
 set (DISABLE_LIBRARIES_GENERATION FALSE CACHE BOOL "Disable C/C++ libraries generation, just useful for generating client code")

-set (KTOOL_ROM_PROCESSOR_CHECK_FORMAT FALSE CACHE BOOL "Check if codding style of generated code is correct")
-mark_as_advanced(KTOOL_ROM_PROCESSOR_CHECK_FORMAT)
+set (ENABLE_CODE_GENERATION_FORMAT_CHECK FALSE CACHE BOOL "Check if codding style of generated code is correct")
+mark_as_advanced(ENABLE_CODE_GENERATION_FORMAT_CHECK)

 set (KURENTO_MODULES_DIR /usr/share/kurento/modules CACHE STRING "Directory where kurento modules descriptors can be found")
 mark_as_advanced(KURENTO_MODULES_DIR)
@@ -153,7 +153,7 @@
         list (APPEND GENERATED_HEADER_FILES ${PARAM_GEN_FILES_DIR}/${_FILE})
         message (STATUS "Generated: ${_FILE}")
       endif ()
-      if (KTOOL_ROM_PROCESSOR_CHECK_FORMAT)
+      if (ENABLE_CODE_GENERATION_FORMAT_CHECK)
         if (EXISTS ${PARAM_GEN_FILES_DIR}/${_FILE}.orig)
           file (REMOVE ${PARAM_GEN_FILES_DIR}/${_FILE}.orig)
         endif()


Fix compiler error on Android (#933)

Fix compiler error on Android (#933)

--- CMake/CompilerFlags.cmake
+++ CMake/CompilerFlags.cmake
@@ -37,6 +37,7 @@
         -Wparentheses
         -Wunknown-pragmas
         -Wunreachable-code
+        -Wunused-parameter
         -DREALM_HAVE_CONFIG
     )
 endif()


Fix a RPATH issue if -DOCE_INSTALL_LIB_DIR is absolute.

--- adm/cmake/BuildToolkit.cmake
+++ adm/cmake/BuildToolkit.cmake
@@ -162,7 +162,7 @@
 	SET_TARGET_PROPERTIES_INSTALL_RPATH(${TOOLKIT} "${${PROJECT_NAME}_INSTALL_PACKAGE_LIB_DIR_RPATH};${${PROJECT_NAME}_INSTALL_LIB_DIR_RPATH}")
 ELSE(TOOLKIT_IS_PRIVATE)
 	SET(TOOLKIT_INSTALL_LIB_DIR ${${PROJECT_NAME}_INSTALL_LIB_DIR})
-	SET_TARGET_PROPERTIES_INSTALL_RPATH(${TOOLKIT} "${${PROJECT_NAME}_INSTALL_PREFIX}/${${PROJECT_NAME}_INSTALL_LIB_DIR}")
+	SET_TARGET_PROPERTIES_INSTALL_RPATH(${TOOLKIT} "${${PROJECT_NAME}_INSTALL_LIB_DIR_RPATH}")
 ENDIF(TOOLKIT_IS_PRIVATE)

 INSTALL(TARGETS ${TOOLKIT}


build: Fix HAVE_ATTRIBUTE_PACKED and HAVE_PRAGMA_PACK checks

C++14 standard has a std::static_assert, so let's rename the struct used
in HAVE_ATTRIBUTE_PACKED and HAVE_PRAGMA_PACK checks.

Fixed by @ergo720.

--- CMake/BuildConfigH.cmake
+++ CMake/BuildConfigH.cmake
@@ -10,24 +10,24 @@
 check_include_file(netinet/in.h HAVE_NETINET_IN_H)

 CHECK_CXX_SOURCE_COMPILES("
-template <bool x> struct static_assert;
-template <> struct static_assert<true> {};
+template <bool x> struct static_assertion;
+template <> struct static_assertion<true> {};
 struct s { char c; int i; } __attribute__((packed));
 int main() {
-	sizeof(static_assert< sizeof(struct s) == sizeof(char) + sizeof(int) >);
+	sizeof(static_assertion< sizeof(struct s) == sizeof(char) + sizeof(int) >);
 	return 0;
 }
 "
 HAVE_ATTRIBUTE_PACKED)

 CHECK_CXX_SOURCE_COMPILES("
-template <bool x> struct static_assert;
-template <> struct static_assert<true> {};
+template <bool x> struct static_assertion;
+template <> struct static_assertion<true> {};
 __pragma(pack(push, 1))
 struct s { char c; int i; };
 __pragma(pack(pop))
 int main() {
-	sizeof(static_assert< sizeof(struct s) == sizeof(char) + sizeof(int) >);
+	sizeof(static_assertion< sizeof(struct s) == sizeof(char) + sizeof(int) >);
 	return 0;
 }
 "


Fix march flag for 32-bit build

Fix march flag for 32-bit build

--- toolchains/msys2-m32-toolchain.cmake
+++ toolchains/msys2-m32-toolchain.cmake
@@ -15,4 +15,4 @@
 set (CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) # Find libs in target
 set (CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) # Find includes in target

-set (MINGW_FLAG "-m64")
+set (MINGW_FLAG "-m32")


Add --target=openacc to the base test case template


cmake: check zephyr version if specified and ZEPHYR_BASE is set

Fixes: #35187

This extends the Zephyr package to also honor version when ZEPHYR_BASE
is set in environment.

Specifying `find_package(Zephyr 2.x.y)` without using ZEPHYR_BASE will
lookup a Zephyr in following order:
- Current repo, if that is a Zephyr repo
- Current west workspace
- Exported Zephyr CMake package for freestanding application
and ensure that the chosen Zephyr meets the version criteria.

When setting ZEPHYR_BASE in environment the version check is disabled
and the Zephyr referenced by ZEPHYR_BASE will always be used regardless
of its version.

A user doing `find_package(Zephyr 2.6.0)` and using ZEPHYR_BASE
presumable still want to ensure that the Zephyr referenced by
ZEPHYR_BASE is v2.6.0 or newer.

Also, `west build` with a freestanding application requires ZEPHYR_BASE
in order for west to lookup the `west build` extension command.

This practically means a user cannot both specify a Zephyr version for a
freestanding application and at the same time use `west build` but has
to use plain CMake to ensure correct version check, see #35187.

With this commit, users will have complete Zephyr package version
checking with freestanding applications
find_package(Zephyr 2.6.0 REQUIRED HINTS $ENV{ZEPHYR_BASE})
find_package(Zephyr 2.6.0 EXACT REQUIRED HINTS $ENV{ZEPHYR_BASE})
when also having ZEPHYR_BASE in environment.

This commit has no behavioral change for those patterns:
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
find_package(Zephyr 2.6.0 REQUIRED HINTS $ENV{ZEPHYR_BASE})
find_package(Zephyr 2.6.0 EXACT REQUIRED HINTS $ENV{ZEPHYR_BASE})
when ZEPHYR_BASE is not in environment.

Signed-off-by: Torsten Rasmussen <a7c5b1d5a1f41fce6edfa3f7c2392ae0c59deafe@nordicsemi.no>

--- share/zephyr-package/cmake/ZephyrConfigVersion.cmake
+++ share/zephyr-package/cmake/ZephyrConfigVersion.cmake
@@ -54,8 +54,26 @@
   # ZEPHYR_BASE is to be used regardless of version.
   if (${ZEPHYR_BASE}/share/zephyr-package/cmake STREQUAL ${CMAKE_CURRENT_LIST_DIR})
     # We are the Zephyr to be used
-    set(PACKAGE_VERSION_COMPATIBLE TRUE)
-    set(PACKAGE_VERSION_EXACT TRUE)
+
+    set(NO_PRINT_VERSION True)
+    include(${ZEPHYR_BASE}/cmake/version.cmake)
+    # Zephyr uses project version, but CMake package uses PACKAGE_VERSION
+    set(PACKAGE_VERSION ${PROJECT_VERSION})
+    check_zephyr_version()
+
+    if(IS_INCLUDED)
+      # We are included, so we need to ensure that the version of the top-level
+      # package file is returned. This Zephyr version has already been printed
+      # as part of `check_zephyr_version()`
+      if(NOT ${PACKAGE_VERSION_COMPATIBLE}
+        OR (Zephyr_FIND_VERSION_EXACT AND NOT PACKAGE_VERSION_EXACT)
+      )
+        # When Zephyr base is set and we are checked as an included file
+        # (IS_INCLUDED=True), then we are unable to retrieve the version of the
+        # parent Zephyr, therefore just mark it as ignored.
+        set(PACKAGE_VERSION "ignored (ZEPHYR_BASE is set)")
+      endif()
+    endif()
   elseif ((NOT IS_INCLUDED) AND (DEFINED ZEPHYR_BASE))
     check_zephyr_package(ZEPHYR_BASE ${ZEPHYR_BASE} VERSION_CHECK)
   else()


Enable SSL of the civetweb target.

Enable SSL of the civetweb target.

--- external/External.cmake
+++ external/External.cmake
@@ -648,13 +648,16 @@
                        "-DCIVETWEB_ENABLE_LUA=OFF"
                        "-DCIVETWEB_INSTALL_EXECUTABLE=OFF"
                        "-DCIVETWEB_ALLOW_WARNINGS=ON"
+                       "-DCIVETWEB_ENABLE_SSL_DYNAMIC_LOADING=OFF"
+                       "-DCIVETWEB_ENABLE_SSL=ON"
             #--Output lcivetwebing-------------
             LOG_DOWNLOAD  1
             LOG_UPDATE    1
             LOG_CONFIGURE 1
             LOG_BUILD     0
             LOG_TEST      1
-            LOG_INSTALL   1)
+            LOG_INSTALL   1
+            DEPENDS zlib ressl)
     fake_output_library (civetweb_ext_output civetweb_ext ${civetweb_EXT_LIBRARIES})
 endif ()
 add_custom_target (civetweb DEPENDS ${civetweb_EXT_LIBRARIES})


libtiff: Explicitly disable support for lzma compression.

--- libtiff.cmake
+++ libtiff.cmake
@@ -38,6 +38,8 @@
         --prefix=${BUILDEM_DIR}
         LDFLAGS=${BUILDEM_LDFLAGS}
         CPPFLAGS=-I${BUILDEM_DIR}/include
+        --disable-lzma # Don't accidentally link against system lzma .so files.
+                       # vigra and scikit-image don't support lzma tiff compression, so there's no need for it.
         --disable-jbig
         BUILD_COMMAND       ${BUILDEM_ENV_STRING} $(MAKE)
     BUILD_IN_SOURCE     1


Use yocto toolchain 1.7.1 for PowerPC.

Use yocto toolchain 1.7.1 for PowerPC.

--- linux/cmake/ppc_gcc.cmake
+++ linux/cmake/ppc_gcc.cmake
@@ -2,7 +2,7 @@
 SET(CMAKE_SYSTEM_NAME Linux)
 SET(CMAKE_SYSTEM_PROCESSOR powerpc)

-SET(CJET_TOOLCHAIN_PATH /opt/poky/1.6/sysroots/)
+SET(CJET_TOOLCHAIN_PATH /opt/poky/1.7.1/sysroots/)

 SET(triple powerpc-poky-linux)


Split off 7.10.2

Split off 7.10.2

Signed-off-by: Richard Chapman <5900d56196fe29dba8e3ae556d57eae28e9f0195@hpccsystems.com>


BUG: if opencv_dir is set just search include directory in opencv_dir/../../

--- CMake/FindOpenCV.cmake
+++ CMake/FindOpenCV.cmake
@@ -30,6 +30,8 @@
       opencv_INCLUDE_DIR
       opencv/cv.h
       PATHS "${OPENCV_SEARCH_PATH}"
+      #no additional paths are added to the search if OpenCV_DIR
+      NO_DEFAULT_PATH
       PATH_SUFFIXES "include"
       DOC "The directory where opencv/cv.h is installed")
   endif()
@@ -52,7 +54,7 @@
 set(opencv_core_NAMES opencv_core)
 set(opencv_ml_NAMES opencv_ml)

-if ( opencv_INCLUDE_DIR )
+if (opencv_INCLUDE_DIR)

   set(OPENCV_INCLUDE_DIRS "${opencv_INCLUDE_DIR}")


COMP: fix mismatch in ImportGDAL

COMP: fix mismatch in ImportGDAL

--- CMake/ImportGdal.cmake
+++ CMake/ImportGdal.cmake
@@ -20,7 +20,7 @@
   IF(UNIX)
     IF (NOT GDAL_CONFIG)
       MESSAGE(FATAL_ERROR "Cannot find gdal-config. Set GDAL_CONFIG")
-    ENDIF(NOT GDAL_FOUND)
+    ENDIF(NOT GDAL_CONFIG)

     EXECUTE_PROCESS(COMMAND ${GDAL_CONFIG} --version
                     OUTPUT_VARIABLE GDAL_VERSION


added cygwin specific stuff

added cygwin specific stuff

--- cmake/EigenTesting.cmake
+++ cmake/EigenTesting.cmake
@@ -96,7 +96,11 @@
   endif(${ARGC} GREATER 2)

   if(WIN32)
-    add_test(${testname} "${targetname}")
+    if(CYGWIN)
+      add_test(${testname} "${Eigen_SOURCE_DIR}/test/runtest.sh" "${testname}")
+    else(CYGWIN)
+      add_test(${testname} "${targetname}")
+    endif(CYGWIN)
   else(WIN32)
     add_test(${testname} "${Eigen_SOURCE_DIR}/test/runtest.sh" "${testname}")
   endif(WIN32)


Dropped OpenCVConfig.cmake - we don't use it anymore.

--- cmake/OpenCVConfig.cmake
+++ cmake/OpenCVConfig.cmake
@@ -1,154 +0,0 @@
-# ===================================================================================
-#  The OpenCV CMake configuration file
-#
-#             ** File generated automatically, do not modify **
-#
-#  Usage from an external project:
-#    In your CMakeLists.txt, add these lines:
-#
-#    FIND_PACKAGE(OpenCV REQUIRED)
-#    TARGET_LINK_LIBRARIES(MY_TARGET_NAME ${OpenCV_LIBS})
-#
-#    Or you can search for specific OpenCV modules:
-#
-#    FIND_PACKAGE(OpenCV REQUIRED core highgui)
-#
-#    If the module is found then OPENCV_<MODULE>_FOUND is set to TRUE.
-#
-#    This file will define the following variables:
-#      - OpenCV_LIBS                     : The list of libraries to links against.
-#      - OpenCV_LIB_DIR                  : The directory(es) where lib files are. Calling LINK_DIRECTORIES
-#                                          with this path is NOT needed.
-#      - OpenCV_INCLUDE_DIRS             : The OpenCV include directories.
-#      - OpenCV_COMPUTE_CAPABILITIES     : The version of compute capability
-#      - OpenCV_ANDROID_NATIVE_API_LEVEL : Minimum required level of Android API
-#      - OpenCV_VERSION                  : The version of this OpenCV build. Example: "2.4.0"
-#      - OpenCV_VERSION_MAJOR            : Major version part of OpenCV_VERSION. Example: "2"
-#      - OpenCV_VERSION_MINOR            : Minor version part of OpenCV_VERSION. Example: "4"
-#      - OpenCV_VERSION_PATCH            : Patch version part of OpenCV_VERSION. Example: "0"
-#
-#    Advanced variables:
-#      - OpenCV_SHARED
-#      - OpenCV_CONFIG_PATH
-#      - OpenCV_LIB_COMPONENTS
-#
-# ===================================================================================
-#
-#    Windows pack specific options:
-#      - OpenCV_STATIC
-#      - OpenCV_CUDA
-
-get_property(OpenCV_LANGUAGES GLOBAL PROPERTY ENABLED_LANGUAGES)
-if(NOT ";${OpenCV_LANGUAGES};" MATCHES ";CXX;")
-  enable_language(CXX)
-endif()
-
-if(NOT DEFINED OpenCV_STATIC)
-  # look for global setting
-  if(NOT DEFINED BUILD_SHARED_LIBS OR BUILD_SHARED_LIBS)
-    set(OpenCV_STATIC OFF)
-  else()
-    set(OpenCV_STATIC ON)
-  endif()
-endif()
-
-if(NOT DEFINED OpenCV_CUDA)
-  # if user' app uses CUDA, then it probably wants CUDA-enabled OpenCV binaries
-  if(CUDA_FOUND)
-    set(OpenCV_CUDA ON)
-  endif()
-endif()
-
-if(MSVC)
-  if(CMAKE_CL_64)
-    set(OpenCV_ARCH x64)
-    set(OpenCV_TBB_ARCH intel64)
-  else()
-    set(OpenCV_ARCH x86)
-    set(OpenCV_TBB_ARCH ia32)
-  endif()
-  if(MSVC_VERSION EQUAL 1400)
-    set(OpenCV_RUNTIME vc8)
-  elseif(MSVC_VERSION EQUAL 1500)
-    set(OpenCV_RUNTIME vc9)
-  elseif(MSVC_VERSION EQUAL 1600)
-    set(OpenCV_RUNTIME vc10)
-  elseif(MSVC_VERSION EQUAL 1700)
-    set(OpenCV_RUNTIME vc11)
-  endif()
-elseif(MINGW)
-  set(OpenCV_RUNTIME mingw)
-
-  execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpmachine
-                  OUTPUT_VARIABLE OPENCV_GCC_TARGET_MACHINE
-                  OUTPUT_STRIP_TRAILING_WHITESPACE)
-  if(CMAKE_OPENCV_GCC_TARGET_MACHINE MATCHES "64")
-    set(MINGW64 1)
-    set(OpenCV_ARCH x64)
-  else()
-    set(OpenCV_ARCH x86)
-  endif()
-endif()
-
-unset(OpenCV_CONFIG_PATH CACHE)
-
-get_filename_component(OpenCV_CONFIG_PATH "${CMAKE_CURRENT_LIST_FILE}" PATH CACHE)
-if(OpenCV_RUNTIME AND OpenCV_ARCH)
-  if(OpenCV_STATIC AND EXISTS "${OpenCV_CONFIG_PATH}/${OpenCV_ARCH}/${OpenCV_RUNTIME}/staticlib/OpenCVConfig.cmake")
-    if(OpenCV_CUDA AND EXISTS "${OpenCV_CONFIG_PATH}/gpu/${OpenCV_ARCH}/${OpenCV_RUNTIME}/staticlib/OpenCVConfig.cmake")
-      set(OpenCV_LIB_PATH "${OpenCV_CONFIG_PATH}/gpu/${OpenCV_ARCH}/${OpenCV_RUNTIME}/staticlib")
-    else()
-      set(OpenCV_LIB_PATH "${OpenCV_CONFIG_PATH}/${OpenCV_ARCH}/${OpenCV_RUNTIME}/staticlib")
-    endif()
-  elseif(EXISTS "${OpenCV_CONFIG_PATH}/${OpenCV_ARCH}/${OpenCV_RUNTIME}/lib/OpenCVConfig.cmake")
-    if(OpenCV_CUDA AND EXISTS "${OpenCV_CONFIG_PATH}/gpu/${OpenCV_ARCH}/${OpenCV_RUNTIME}/lib/OpenCVConfig.cmake")
-      set(OpenCV_LIB_PATH "${OpenCV_CONFIG_PATH}/gpu/${OpenCV_ARCH}/${OpenCV_RUNTIME}/lib")
-    else()
-      set(OpenCV_LIB_PATH "${OpenCV_CONFIG_PATH}/${OpenCV_ARCH}/${OpenCV_RUNTIME}/lib")
-    endif()
-  endif()
-endif()
-
-if(OpenCV_LIB_PATH AND EXISTS "${OpenCV_LIB_PATH}/OpenCVConfig.cmake")
-  set(OpenCV_LIB_DIR_OPT "${OpenCV_LIB_PATH}" CACHE PATH "Path where release OpenCV libraries are located" FORCE)
-  set(OpenCV_LIB_DIR_DBG "${OpenCV_LIB_PATH}" CACHE PATH "Path where debug OpenCV libraries are located" FORCE)
-  set(OpenCV_3RDPARTY_LIB_DIR_OPT "${OpenCV_LIB_PATH}" CACHE PATH "Path where release 3rdpaty OpenCV dependencies are located" FORCE)
-  set(OpenCV_3RDPARTY_LIB_DIR_DBG "${OpenCV_LIB_PATH}" CACHE PATH "Path where debug 3rdpaty OpenCV dependencies are located" FORCE)
-
-  include("${OpenCV_LIB_PATH}/OpenCVConfig.cmake")
-
-  if(OpenCV_CUDA)
-    set(_OpenCV_LIBS "")
-    foreach(_lib ${OpenCV_LIBS})
-      string(REPLACE "${OpenCV_CONFIG_PATH}/gpu/${OpenCV_ARCH}/${OpenCV_RUNTIME}" "${OpenCV_CONFIG_PATH}/${OpenCV_ARCH}/${OpenCV_RUNTIME}" _lib2 "${_lib}")
-      if(NOT EXISTS "${_lib}" AND EXISTS "${_lib2}")
-        list(APPEND _OpenCV_LIBS "${_lib2}")
-      else()
-        list(APPEND _OpenCV_LIBS "${_lib}")
-      endif()
-    endforeach()
-    set(OpenCV_LIBS ${_OpenCV_LIBS})
-  endif()
-  set(OpenCV_FOUND TRUE CACHE BOOL "" FORCE)
-  set(OPENCV_FOUND TRUE CACHE BOOL "" FORCE)
-
-  if(NOT OpenCV_FIND_QUIETLY)
-    message(STATUS "Found OpenCV ${OpenCV_VERSION} in ${OpenCV_LIB_PATH}")
-    if(NOT OpenCV_LIB_PATH MATCHES "/staticlib")
-      get_filename_component(_OpenCV_LIB_PATH "${OpenCV_LIB_PATH}/../bin" ABSOLUTE)
-      file(TO_NATIVE_PATH "${_OpenCV_LIB_PATH}" _OpenCV_LIB_PATH)
-      message(STATUS "You might need to add ${_OpenCV_LIB_PATH} to your PATH to be able to run your applications.")
-      if(OpenCV_LIB_PATH MATCHES "/gpu/")
-        string(REPLACE "\\gpu" "" _OpenCV_LIB_PATH2 "${_OpenCV_LIB_PATH}")
-        message(STATUS "GPU support is enabled so you might also need ${_OpenCV_LIB_PATH2} in your PATH (it must go after the ${_OpenCV_LIB_PATH}).")
-      endif()
-    endif()
-  endif()
-else()
-  if(NOT OpenCV_FIND_QUIETLY)
-    message(WARNING "Found OpenCV 2.4.3 Windows Super Pack but it has not binaries compatible with your configuration.
-    You should manually point CMake variable OpenCV_DIR to your build of OpenCV library.")
-  endif()
-  set(OpenCV_FOUND FALSE CACHE BOOL "" FORCE)
-  set(OPENCV_FOUND FALSE CACHE BOOL "" FORCE)
-endif()


Fixed cmake issues

Fixed cmake issues

--- cmake/OpenCVModule.cmake
+++ cmake/OpenCVModule.cmake
@@ -663,7 +663,7 @@
   set(sub_objs "")
   set(sub_links "")
   set(cuda_objs "")
-  if (DEFINED OPENCV_MODULE_${the_module}_CHILDREN)
+  if (OPENCV_MODULE_${the_module}_CHILDREN)
     status("Complex module ${the_module}")
     foreach (m ${OPENCV_MODULE_${the_module}_CHILDREN})
       if (BUILD_${m} AND TARGET ${m}_object) # ambigous?
@@ -765,7 +765,9 @@
   if (TARGET ${the_module}_object)
     # copy COMPILE_DEFINITIONS
     get_target_property(main_defs ${the_module} COMPILE_DEFINITIONS)
-    set_target_properties(${the_module}_object PROPERTIES COMPILE_DEFINITIONS ${main_defs})
+    if (main_defs)
+      set_target_properties(${the_module}_object PROPERTIES COMPILE_DEFINITIONS ${main_defs})
+    endif()
     # use same PCH
     if (TARGET pch_Generate_${the_module})
       add_dependencies(${the_module}_object pch_Generate_${the_module} )


Fix "make test", there are no .shell wrappers in here so don't try to execute them.
However 4 tests fail. Extract:
FAIL!  : MethodTest::checkMediaObjectMethods(currentSourceChanged(const MediaSource&)) 'meta->indexOfSignal(QMetaObject::normalizedSignature(signature.constData())) != -1' returned FALSE. ()
   Loc: [/d/kde/src/t/kdesupport/phonon/phonon/tests/methodtest.cpp(181)]
CCMAIL: kretz@kde.org

svn path=/trunk/kdesupport/phonon/; revision=951797

--- cmake/PhononMacros.cmake
+++ cmake/PhononMacros.cmake
@@ -58,9 +58,9 @@
       set(_executable ${EXECUTABLE_OUTPUT_PATH}/${_test_NAME}.app/Contents/MacOS/${_test_NAME})
    else (Q_WS_MAC AND NOT _nogui)
       # Use .shell wrapper where available, to use uninstalled libs.
-      if (UNIX)
-         set(_executable ${_executable}.shell)
-      endif (UNIX)
+      #if (UNIX)
+      #   set(_executable ${_executable}.shell)
+      #endif (UNIX)
    endif (Q_WS_MAC AND NOT _nogui)

    if (using_qtest AND PHONON_TEST_OUTPUT STREQUAL "xml")


[cmake] make coverage misconfig a fatal error

--- cmake/coverageFunc.cmake
+++ cmake/coverageFunc.cmake
@@ -85,8 +85,7 @@
         set(RADIUM_ENABLE_TESTING "ON")
         set(ENABLE_COVERAGE "ON")
     else()
-        message( WARNING "[Tests] Coverage requested (RADIUM_ENABLE_COVERAGE), but not activated.")
-        message( WARNING "[Tests] Coverage only supported in DEBUG with GCC.")
+        message( FATAL_ERROR "[Tests] Coverage requested (RADIUM_ENABLE_COVERAGE), but not activable, only supported in DEBUG with GCC.")
     endif()
 endmacro()


Add correct -L option to xwin_LINK_FLAGS

svn path=/trunk/; revision=6789

--- cmake/modules/xwin.cmake
+++ cmake/modules/xwin.cmake
@@ -34,7 +34,12 @@
     xwin_COMPILE_FLAGS
     "-I${X11_INCLUDE_DIR}"
     )
-    set(xwin_LINK_FLAGS ${X11_LIBRARIES})
+    # N.B. X11_LIBRARY_DIR is used internally by FindX11.cmake but not
+    # documented for external use so we may have to replace this
+    # some day by the appropriate
+    # "GET_FILENAME_COMPONENT(X11_LIBRARY_DIR ??? PATH)" logic.
+    # But this works for now....
+    set(xwin_LINK_FLAGS "-L${X11_LIBRARY_DIR} ${X11_LIBRARIES}")
     option(HAVE_PTHREAD "use pthreads with the xwin driver" OFF)
     if(HAVE_PTHREAD)
       find_package(Threads)


Only set SSE optimization when compiling an optimized build.

Needed for Debian and Gentoo packaging.

git-svn-id: e7ea667a1d39a4453c4efcc4ba7bca3d620c3f19@4582 a9d63959-f2ad-4865-b262-bf0e56cfafb6

--- cmake/pcl_find_sse.cmake
+++ cmake/pcl_find_sse.cmake
@@ -128,6 +128,7 @@
         endif(HAVE_SSE2_EXTENSIONS)
     endif (NOT APPLE AND NOT MSVC)

-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${SSE_FLAGS}")
+    set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} ${SSE_FLAGS}")
+    set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${SSE_FLAGS}")

 endmacro(PCL_CHECK_FOR_SSE)


cmake: Fix CMP0053 violation.

cmake: Fix CMP0053 violation.

--- cmake/FindDirectX.cmake
+++ cmake/FindDirectX.cmake
@@ -39,8 +39,11 @@
         set (DirectX_ARCHITECTURE x86)
     endif ()

-    if ("$ENV{ProgramFiles(x86)}")
-        set (ProgramFiles "$ENV{ProgramFiles(x86)}")
+    # Can't use "$ENV{ProgramFiles(x86)}" to avoid violating CMP0053.  See
+    # http://public.kitware.com/pipermail/cmake-developers/2014-October/023190.html
+    set (ProgramFiles_x86 "ProgramFiles(x86)")
+    if ("$ENV{${ProgramFiles_x86}}")
+        set (ProgramFiles "$ENV{${ProgramFiles_x86}}")
     else ()
         set (ProgramFiles "$ENV{ProgramFiles}")
     endif ()


Removed non existing Qt Kms support from cmake install

--- cmake/InstallFAST.cmake
+++ cmake/InstallFAST.cmake
@@ -120,26 +120,25 @@
     QtPrintSupport
     QtSerialPort
     QtSql
-		QtSvg
+    QtSvg
     QtTest
     QtThemeSupport
     QtWidgets
     QtXml
     QtZlib)
 if(FAST_MODULE_Plotting)
-	list(APPEND INCLUDE_FOLDERS jkqtplotter jkqtcommon jkqtfastplotter jkqtmathtext)
-endif()
-if(WIN32)
-list(APPEND INCLUDE_FOLDERS
-    ActiveQt
-)
+    list(APPEND INCLUDE_FOLDERS jkqtplotter jkqtcommon jkqtfastplotter jkqtmathtext)
+endif()
+if(WIN32)
+    list(APPEND INCLUDE_FOLDERS
+        ActiveQt
+    )
 else()
-list(APPEND INCLUDE_FOLDERS
-    QtGlxSupport
-		QtServiceSupport
-		QtInputSupport
-		QtKmsSupport
-)
+    list(APPEND INCLUDE_FOLDERS
+        QtGlxSupport
+        QtServiceSupport
+        QtInputSupport
+    )
 endif()
 foreach(INCLUDE_FOLDER ${INCLUDE_FOLDERS})
     install(DIRECTORY ${PROJECT_BINARY_DIR}/include/${INCLUDE_FOLDER}/


Install shaders as well

Install shaders as well

--- cmake/InstallFAST.cmake
+++ cmake/InstallFAST.cmake
@@ -88,6 +88,19 @@
 	FILES_MATCHING PATTERN "*.cl"
 )

+# Install GL shaders
+install(DIRECTORY ${FAST_SOURCE_DIR}
+	DESTINATION fast/kernels/
+	FILES_MATCHING PATTERN "*.vert"
+)
+
+# Install GL shaders
+install(DIRECTORY ${FAST_SOURCE_DIR}
+	DESTINATION fast/kernels/
+	FILES_MATCHING PATTERN "*.frag"
+)
+
+
 # Install CMake files
 install(FILES ${PROJECT_BINARY_DIR}/FASTConfig.cmake ${PROJECT_BINARY_DIR}/FASTUse.cmake
     DESTINATION fast/cmake
@@ -192,4 +205,4 @@
 	install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html
         DESTINATION fast/doc
     )
-endif()+endif()


cmake: fix ocv_check_compiler_flag

cmake: fix ocv_check_compiler_flag

--- cmake/OpenCVUtils.cmake
+++ cmake/OpenCVUtils.cmake
@@ -199,7 +199,7 @@
     "[Uu]nknown option"                         # HP
     "[Ww]arning: [Oo]ption"                     # SunPro
     "command option .* is not recognized"       # XL
-    "not supported in this configuration; ignored"       # AIX
+    "not supported in this configuration, ignored"       # AIX (';' is replaced with ',')
     "File with unknown suffix passed to linker" # PGI
     "WARNING: unknown flag:"                    # Open64
   )
@@ -238,12 +238,25 @@
         COMPILE_DEFINITIONS "${FLAG}"
         OUTPUT_VARIABLE OUTPUT)

-      FOREACH(_regex ${OCV_COMPILER_FAIL_REGEX})
-        IF("${OUTPUT}" MATCHES "${_regex}")
-          SET(${RESULT} 0)
-          break()
-        ENDIF()
-      ENDFOREACH()
+      if(${RESULT})
+        string(REPLACE ";" "," OUTPUT_LINES "${OUTPUT}")
+        string(REPLACE "\n" ";" OUTPUT_LINES "${OUTPUT_LINES}")
+        foreach(_regex ${OCV_COMPILER_FAIL_REGEX})
+          if(NOT ${RESULT})
+            break()
+          endif()
+          foreach(_line ${OUTPUT_LINES})
+            if("${_line}" MATCHES "${_regex}")
+              file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
+                  "Build output check failed:\n"
+                  "    Regex: '${_regex}'\n"
+                  "    Output line: '${_line}'\n")
+              set(${RESULT} 0)
+              break()
+            endif()
+          endforeach()
+        endforeach()
+      endif()

       IF(${RESULT})
         SET(${RESULT} 1 CACHE INTERNAL "Test ${RESULT}")
@@ -251,6 +264,13 @@
       ELSE(${RESULT})
         MESSAGE(STATUS "Performing Test ${RESULT} - Failed")
         SET(${RESULT} "" CACHE INTERNAL "Test ${RESULT}")
+        file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
+            "Compilation failed:\n"
+            "    source file: '${_fname}'\n"
+            "    check option: '${FLAG}'\n"
+            "===== BUILD LOG =====\n"
+            "${OUTPUT}\n"
+            "===== END =====\n\n")
       ENDIF(${RESULT})
     else()
       SET(${RESULT} 0)


statically link to cppunit on mac because dynamic linking is too error prone

--- cmake/findCppUnit.cmake
+++ cmake/findCppUnit.cmake
@@ -41,9 +41,9 @@
 	get_filename_component(CPPUNIT_DYN_LIB_DEBUG ${CPPUNIT_DEBUG_DIR}/msvc${VS_VER}/cppunitd_dll.dll ABSOLUTE)
 else()
 	#Release lib
-	get_filename_component(CPPUNIT_LIBRARIES_RELEASE ${CPPUNIT_RELEASE_DIR}/clang/libcppunit.dylib ABSOLUTE)
+	get_filename_component(CPPUNIT_LIBRARIES_RELEASE ${CPPUNIT_RELEASE_DIR}/clang/libcppunit.a ABSOLUTE)
 	get_filename_component(CPPUNIT_DYN_LIB_RELEASE ${CPPUNIT_RELEASE_DIR}/clang/libcppunit.dylib ABSOLUTE)
 	#Debug lib
-	get_filename_component(CPPUNIT_LIBRARIES_DEBUG ${CPPUNIT_DEBUG_DIR}/clang/libcppunit.dylib ABSOLUTE)
+	get_filename_component(CPPUNIT_LIBRARIES_DEBUG ${CPPUNIT_DEBUG_DIR}/clang/libcppunit.a ABSOLUTE)
 	get_filename_component(CPPUNIT_DYN_LIB_DEBUG ${CPPUNIT_DEBUG_DIR}/clang/libcppunit.dylib ABSOLUTE)
 endif(WIN32)


Implement automatic method for determining HAVE_PDL_GRAPHICS_PLPLOT_40.

svn path=/trunk/; revision=9040

--- cmake/modules/pdl.cmake
+++ cmake/modules/pdl.cmake
@@ -41,6 +41,7 @@
       "-e use PDL; print \"$PDL::VERSION\""
       OUTPUT_VARIABLE PDL_VERSION
       )
+    message("PDL_VERSION = ${PDL_VERSION}")
       transform_version(NUMERICAL_PDL_MINIMUM_VERSION "2.4.1")
       transform_version(NUMERICAL_PDL_VERSION "${PDL_VERSION}")
       if(NUMERICAL_PDL_VERSION LESS "${NUMERICAL_PDL_MINIMUM_VERSION}")
@@ -53,10 +54,25 @@
 	   "Perl and PDL are available and PDL passes version test.\n"
 	"   Enable Perl/PDL examples in tests"
 	)
-	option(HAVE_PDL_GRAPHICS_PLPLOT_40
-	  "PDL-Graphics-PLplot version is 0.40 or higher"
-	  OFF
-	  )
+        execute_process(
+	  COMMAND ${PERL_EXECUTABLE}
+	  -MPDL::Graphics::PLplot "-e print \"$PDL::Graphics::PLplot::VERSION\""
+          OUTPUT_VARIABLE PDL_PLPLOT_VERSION
+          ERROR_VARIABLE PDL_PLPLOT_VERSION
+          )
+        #message("PDL_PLPLOT_VERSION = ${PDL_PLPLOT_VERSION}")
+        transform_version(NUMERICAL_PDL_PLPLOT_MINIMUM_VERSION "0.41.0")
+        transform_version(NUMERICAL_PDL_PLPLOT_VERSION "${PDL_PLPLOT_VERSION}.0")
+	#message("NUMERICAL_PDL_PLPLOT_MINIMUM_VERSION = ${NUMERICAL_PDL_PLPLOT_MINIMUM_VERSION}")
+	#message("NUMERICAL_PDL_PLPLOT_VERSION = ${NUMERICAL_PDL_PLPLOT_VERSION}")
+        if(NUMERICAL_PDL_PLPLOT_VERSION LESS "${NUMERICAL_PDL_PLPLOT_MINIMUM_VERSION}")
+          message(STATUS "WARNING: "
+          "perl PDL PLplot version < 0.41 "
+          "Using more limited set of Perl/PDL examples that work with old versions")
+          set(HAVE_PDL_GRAPHICS_PLPLOT_40 OFF CACHE BOOL "PDL-Graphics-PLplot version is 0.41 or higher" FORCE)
+        else(NUMERICAL_PDL_PLPLOT_VERSION LESS "${NUMERICAL_PDL_PLPLOT_MINIMUM_VERSION}")
+          set(HAVE_PDL_GRAPHICS_PLPLOT_40 ON CACHE BOOL "PDL-Graphics-PLplot version is 0.41 or higher" FORCE)
+        endif(NUMERICAL_PDL_PLPLOT_VERSION LESS "${NUMERICAL_PDL_PLPLOT_MINIMUM_VERSION}")
       endif(NUMERICAL_PDL_VERSION LESS "${NUMERICAL_PDL_MINIMUM_VERSION}")
     else(NOT PDL_RETURNCODE)
       message(STATUS "WARNING: "


Minimum "new" PDL-Graphics-PLplot version bumped to 0.42.

svn path=/trunk/; revision=9041

--- cmake/modules/pdl.cmake
+++ cmake/modules/pdl.cmake
@@ -61,17 +61,17 @@
           ERROR_VARIABLE PDL_PLPLOT_VERSION
           )
         #message("PDL_PLPLOT_VERSION = ${PDL_PLPLOT_VERSION}")
-        transform_version(NUMERICAL_PDL_PLPLOT_MINIMUM_VERSION "0.41.0")
+        transform_version(NUMERICAL_PDL_PLPLOT_MINIMUM_VERSION "0.42.0")
         transform_version(NUMERICAL_PDL_PLPLOT_VERSION "${PDL_PLPLOT_VERSION}.0")
 	#message("NUMERICAL_PDL_PLPLOT_MINIMUM_VERSION = ${NUMERICAL_PDL_PLPLOT_MINIMUM_VERSION}")
 	#message("NUMERICAL_PDL_PLPLOT_VERSION = ${NUMERICAL_PDL_PLPLOT_VERSION}")
         if(NUMERICAL_PDL_PLPLOT_VERSION LESS "${NUMERICAL_PDL_PLPLOT_MINIMUM_VERSION}")
           message(STATUS "WARNING: "
-          "perl PDL PLplot version < 0.41 "
+          "perl PDL PLplot version < 0.42 "
           "Using more limited set of Perl/PDL examples that work with old versions")
-          set(HAVE_PDL_GRAPHICS_PLPLOT_40 OFF CACHE BOOL "PDL-Graphics-PLplot version is 0.41 or higher" FORCE)
+          set(HAVE_PDL_GRAPHICS_PLPLOT_40 OFF CACHE BOOL "PDL-Graphics-PLplot version is 0.42 or higher" FORCE)
         else(NUMERICAL_PDL_PLPLOT_VERSION LESS "${NUMERICAL_PDL_PLPLOT_MINIMUM_VERSION}")
-          set(HAVE_PDL_GRAPHICS_PLPLOT_40 ON CACHE BOOL "PDL-Graphics-PLplot version is 0.41 or higher" FORCE)
+          set(HAVE_PDL_GRAPHICS_PLPLOT_40 ON CACHE BOOL "PDL-Graphics-PLplot version is 0.42 or higher" FORCE)
         endif(NUMERICAL_PDL_PLPLOT_VERSION LESS "${NUMERICAL_PDL_PLPLOT_MINIMUM_VERSION}")
       endif(NUMERICAL_PDL_VERSION LESS "${NUMERICAL_PDL_MINIMUM_VERSION}")
     else(NOT PDL_RETURNCODE)


- make sure it compiles under gcc 4.6

- make sure it compiles under gcc 4.6

git-svn-id: 1af002208e930b4d920e7c2b948d1e98a012c795@716 a9d63959-f2ad-4865-b262-bf0e56cfafb6

--- cmake/pcl_targets.cmake
+++ cmake/pcl_targets.cmake
@@ -82,7 +82,7 @@
     #
     # Only link if needed
     if(UNIX)
-      SET_TARGET_PROPERTIES(${_name} PROPERTIES LINK_FLAGS --as-needed)
+      SET_TARGET_PROPERTIES(${_name} PROPERTIES LINK_FLAGS -Wl,--as-needed)
     elseif(WIN32)
       SET_TARGET_PROPERTIES(${_name} PROPERTIES LINK_FLAGS /OPT:REF)
     endif()
@@ -109,7 +109,7 @@
     #
     # Only link if needed
     if(UNIX)
-      SET_TARGET_PROPERTIES(${_name} PROPERTIES LINK_FLAGS --as-needed)
+      SET_TARGET_PROPERTIES(${_name} PROPERTIES LINK_FLAGS -Wl,--as-needed)
     elseif(WIN32)
       SET_TARGET_PROPERTIES(${_name} PROPERTIES LINK_FLAGS /OPT:REF)
     endif()
@@ -139,7 +139,7 @@
     #
     # Only link if needed
     if(UNIX)
-      SET_TARGET_PROPERTIES(${_exename} PROPERTIES LINK_FLAGS --as-needed)
+      SET_TARGET_PROPERTIES(${_exename} PROPERTIES LINK_FLAGS -Wl,--as-needed)
     elseif(WIN32)
       SET_TARGET_PROPERTIES(${_exename} PROPERTIES LINK_FLAGS /OPT:REF)
     endif()


CMake pcl_targets fix

CMake pcl_targets fix

git-svn-id: 5398946ba177a3e438c2dae55e2cdfc2fb96c905@949 a9d63959-f2ad-4865-b262-bf0e56cfafb6

--- cmake/pcl_targets.cmake
+++ cmake/pcl_targets.cmake
@@ -144,7 +144,7 @@
     #
     # Only link if needed
     if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
-      set_target_properties(${_name} PROPERTIES LINK_FLAGS -Wl)
+      set_target_properties(${_exename} PROPERTIES LINK_FLAGS -Wl)
       target_link_libraries(${_exename} pthread)
     elseif(UNIX)
       set_target_properties(${_exename} PROPERTIES LINK_FLAGS -Wl,--as-needed)


Modify coveralls cmake target to skip wrongly created gcov files

  * problem occured when including libpg_query into cmake build system
  * due to property inheritance, gcov files are created for the library target, but their naming doesn't follow the convention which the coveralls target expects

--- cmake/Modules/CoverallsGenerateGcov.cmake
+++ cmake/Modules/CoverallsGenerateGcov.cmake
@@ -252,22 +252,27 @@
 	# ->
 	# /path/to/project/root/subdir/the_file.c
 	get_source_path_from_gcov_filename(GCOV_SRC_PATH ${GCOV_FILE})
-	file(RELATIVE_PATH GCOV_SRC_REL_PATH "${PROJECT_ROOT}" "${GCOV_SRC_PATH}")
-
-	# Is this in the list of source files?
-	# TODO: We want to match against relative path filenames from the source file root...
-	list(FIND COVERAGE_SRCS ${GCOV_SRC_PATH} WAS_FOUND)
-
-	if (NOT WAS_FOUND EQUAL -1)
-		message("YES: ${GCOV_FILE}")
-		list(APPEND GCOV_FILES ${GCOV_FILE})
-
-		# We remove it from the list, so we don't bother searching for it again.
-		# Also files left in COVERAGE_SRCS_REMAINING after this loop ends should
-		# have coverage data generated from them (no lines are covered).
-		list(REMOVE_ITEM COVERAGE_SRCS_REMAINING ${GCOV_SRC_PATH})
-	else()
-		message("NO:  ${GCOV_FILE}")
+
+	# skip if full path is not present
+	# can happen if files are generated for external libraries
+	if(IS_ABSOLUTE ${GCOV_SRC_PATH})
+		file(RELATIVE_PATH GCOV_SRC_REL_PATH "${PROJECT_ROOT}" "${GCOV_SRC_PATH}")
+
+		# Is this in the list of source files?
+		# TODO: We want to match against relative path filenames from the source file root...
+		list(FIND COVERAGE_SRCS ${GCOV_SRC_PATH} WAS_FOUND)
+
+		if (NOT WAS_FOUND EQUAL -1)
+			message("YES: ${GCOV_FILE}")
+			list(APPEND GCOV_FILES ${GCOV_FILE})
+
+			# We remove it from the list, so we don't bother searching for it again.
+			# Also files left in COVERAGE_SRCS_REMAINING after this loop ends should
+			# have coverage data generated from them (no lines are covered).
+			list(REMOVE_ITEM COVERAGE_SRCS_REMAINING ${GCOV_SRC_PATH})
+		else()
+			message("NO:  ${GCOV_FILE}")
+		endif()
 	endif()
 endforeach()


Fix cmake configure issue introduced by	#1148

add missing RESET_CMAKE_REQUIRED() introduced by #1148 and commit
e02e450.

--- cmake/checks/check_03_compiler_bugs.cmake
+++ cmake/checks/check_03_compiler_bugs.cmake
@@ -420,5 +420,5 @@
     "
     DEAL_II_ICC_SFINAE_BUG
     )
-
-ENDIF()
+  RESET_CMAKE_REQUIRED()
+ENDIF()


Uninstall: Also remove Python byte code

Uninstall: Also remove Python byte code

--- cmake/ElektraUninstall.cmake
+++ cmake/ElektraUninstall.cmake
@@ -27,7 +27,10 @@
 	execute_process (COMMAND ${PYTHON2_EXECUTABLE} -c "${PYTHON_GET_MODULES_DIR_COMMAND}"
 			 OUTPUT_VARIABLE PYTHON2_SITE_PACKAGES
 			 OUTPUT_STRIP_TRAILING_WHITESPACE)
-	string (APPEND files "\n${PYTHON2_SITE_PACKAGES}/elektra_gen-${KDB_VERSION}-py2.7.egg-info")
+	string (APPEND
+		files
+		"\n${PYTHON2_SITE_PACKAGES}/elektra_gen-${KDB_VERSION}-py2.7.egg-info"
+		"\n${PYTHON2_SITE_PACKAGES}/__pycache__/kdb.cpython-27.pyc")
 endif (PYTHON2INTERP_FOUND)

 find_package (PythonInterp 3 QUIET)
@@ -39,7 +42,8 @@
 			 OUTPUT_STRIP_TRAILING_WHITESPACE)
 	string (APPEND
 		files
-		"\n${PYTHON_SITE_PACKAGES}/elektra_gen-${KDB_VERSION}-py${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}.egg-info")
+		"\n${PYTHON_SITE_PACKAGES}/elektra_gen-${KDB_VERSION}-py${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}.egg-info"
+		"\n${PYTHON_SITE_PACKAGES}/__pycache__/kdb.cpython-${PYTHON_VERSION_MAJOR}${PYTHON_VERSION_MINOR}.pyc")
 endif (PYTHONINTERP_FOUND)

 # =========


Remove spurious debug line

Remove spurious debug line

--- cmake/Modules/Coverage.cmake
+++ cmake/Modules/Coverage.cmake
@@ -81,7 +81,6 @@
 	)

 	file( GLOB_RECURSE lcov_files ${CMAKE_CURRENT_SOURCE_DIR}/*.html ${CMAKE_CURRENT_SOURCE_DIR}/*.css ${CMAKE_CURRENT_SOURCE_DIR}/*.png )
-	message( ${lcov_files} )
 	add_custom_target( coverage_clean
 		COMMAND rm ${lcov_files}
 	)


Squashed '3rdparty/github/cmake-utils/' changes from 6aca3dc6c..c219386d7

c219386d7 Specify component for every library type

git-subtree-dir: 3rdparty/github/cmake-utils
git-subtree-split: c219386d72567732aebb128e297393fc3ed59857

--- cmake/MyPackageLibrary.cmake
+++ cmake/MyPackageLibrary.cmake
@@ -84,8 +84,16 @@
       TARGET_INCLUDE_DIRECTORIES(${_target} ${_include_directory_scope} ${_include_directory})
     ENDFOREACH ()
   ENDFOREACH ()
-  INSTALL (TARGETS ${PROJECT_NAME}        RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib COMPONENT DynamicLibraryComponent)
-  INSTALL (TARGETS ${PROJECT_NAME}_static RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib COMPONENT StaticLibraryComponent)
+  INSTALL (TARGETS ${PROJECT_NAME}
+    RUNTIME DESTINATION bin COMPONENT DynamicLibraryComponent
+    LIBRARY DESTINATION lib COMPONENT DynamicLibraryComponent
+    ARCHIVE DESTINATION lib COMPONENT DynamicLibraryComponent
+    )
+  INSTALL (TARGETS ${PROJECT_NAME}_static
+    RUNTIME DESTINATION bin COMPONENT StaticLibraryComponent
+    LIBRARY DESTINATION lib COMPONENT StaticLibraryComponent
+    ARCHIVE DESTINATION lib COMPONENT StaticLibraryComponent
+    )
   SET (_HAVE_DYNAMICLIBRARYCOMPONENT TRUE CACHE INTERNAL "Have DynamicLibraryComponent" FORCE)
   SET (_HAVE_STATICLIBRARYCOMPONENT TRUE CACHE INTERNAL "Have StaticLibraryComponent" FORCE)
   #


Added Turing to the _generations list.

Added Turing to the _generations list.

--- cmake/OpenCVDetectCUDA.cmake
+++ cmake/OpenCVDetectCUDA.cmake
@@ -52,7 +52,7 @@

   message(STATUS "CUDA detected: " ${CUDA_VERSION})

-  set(_generations "Fermi" "Kepler" "Maxwell" "Pascal" "Volta")
+  set(_generations "Fermi" "Kepler" "Maxwell" "Pascal" "Volta" "Turing")
   if(NOT CMAKE_CROSSCOMPILING)
     list(APPEND _generations "Auto")
   endif()


Removing static linking of cuda library

Removing static linking of cuda library

--- cmake/OpenCVDetectCUDA.cmake
+++ cmake/OpenCVDetectCUDA.cmake
@@ -368,7 +368,7 @@
     endif()
   endif()

-  set(OPENCV_LINKER_LIBS ${OPENCV_LINKER_LIBS} ${CUDA_LIBRARIES} ${CUDA_CUDA_LIBRARY} ${CUDA_npp_LIBRARY})
+  set(OPENCV_LINKER_LIBS ${OPENCV_LINKER_LIBS} ${CUDA_LIBRARIES} ${CUDA_npp_LIBRARY})
   if(HAVE_CUBLAS)
     set(OPENCV_LINKER_LIBS ${OPENCV_LINKER_LIBS} ${CUDA_cublas_LIBRARY})
   endif()


Incorporated changes from jgopper/arduino-cmake

--- cmake/Platform/Arduino.cmake
+++ cmake/Platform/Arduino.cmake
@@ -1103,7 +1103,9 @@
         #message("${MAIN_SKETCH}")

         # Find all sketch files
-        file(GLOB SKETCH_SOURCES ${SKETCH_PATH}/*.pde ${SKETCH_PATH}/*.ino)
+        file(GLOB SKETCH_SOURCES ${SKETCH_PATH}/*.h
+                                 ${SKETCH_PATH}/*.pde
+                                 ${SKETCH_PATH}/*.ino)
         list(REMOVE_ITEM SKETCH_SOURCES ${MAIN_SKETCH})
         list(SORT SKETCH_SOURCES)

@@ -1143,19 +1145,18 @@
         set(FIRST_INCLUDE_OFFSET 0)
     endif()
     string(LENGTH "${MAIN_SKETCH}" MAIN_SKETCH_LENGTH)
-    math(EXPR LENGTH_STR1 "${MAIN_SKETCH_LENGTH}-${FIRST_INCLUDE_OFFSET}")
+    math(EXPR LENGTH_STR1 "${MAIN_SKETCH_LENGTH}-(${FIRST_INCLUDE_OFFSET})")
     string(SUBSTRING "${MAIN_SKETCH}" ${FIRST_INCLUDE_OFFSET} ${LENGTH_STR1} STR1)
     #message("STR1:\n${STR1}")

-	string(FIND "${STR1}" "\n" POS2)
-    math(EXPR POS3 "${FIRST_INCLUDE_OFFSET}+${POS2}")
-    string(SUBSTRING "${MAIN_SKETCH}" 0 ${POS3} SKETCH_HEAD)
-    #message(STATUS "SKETCH_HEAD:\n${SKETCH_HEAD}")
+    math(EXPR POS3 "${FIRST_INCLUDE_OFFSET}")
+    string(SUBSTRING "${MAIN_SKETCH}" 0 ${FIRST_INCLUDE_OFFSET} SKETCH_HEAD)
+#    message(STATUS "SKETCH_HEAD:\n${SKETCH_HEAD}")

 	# find the body of the main pde
-    math(EXPR BODY_LENGTH "${MAIN_SKETCH_LENGTH}-${POS3}-1")
-    string(SUBSTRING "${MAIN_SKETCH}" "${POS3}+1" "${BODY_LENGTH}" SKETCH_BODY)
-    #message(STATUS "BODY:\n${SKETCH_BODY}")
+    math(EXPR BODY_LENGTH "${MAIN_SKETCH_LENGTH}-${FIRST_INCLUDE_OFFSET}-1")
+    string(SUBSTRING "${MAIN_SKETCH}" "${FIRST_INCLUDE_OFFSET}+1" "${BODY_LENGTH}" SKETCH_BODY)
+#    #message(STATUS "BODY:\n${SKETCH_BODY}")

 	# write the file head
     file(APPEND ${SKETCH_CPP} "\n")
@@ -1171,17 +1172,17 @@
     foreach(SKETCH_SOURCE_PATH ${SKETCH_SOURCES} ${MAIN_SKETCH_PATH})
         #message(STATUS "Sketch: ${SKETCH_SOURCE_PATH}")
         file(READ ${SKETCH_SOURCE_PATH} SKETCH_SOURCE)
-        string(REGEX MATCHALL "[\n]([a-zA-Z]+[ ])*[_a-zA-Z0-9]+([ ]*[\n][\t]*|[ ])[_a-zA-Z0-9]+[ ]?[\n]?[\t]*[ ]*[(]([\t]*[ ]*[*]?[ ]?[a-zA-Z0-9_](\\[([0-9]+)?\\])*[,]?[ ]*[\n]?)*([,]?[ ]*[\n]?[.][.][.])?[)]([ ]*[\n][\t]*|[ ]|[\n])*{" SKETCH_PROTOTYPES ${SKETCH_SOURCE})
+        string(REGEX MATCHALL "[\n]([a-zA-Z]+[ ])*[_a-zA-Z0-9]+([ ]*[\n][\t]*|[ ])[_a-zA-Z0-9]+[ ]?[\n]?[\t]*[ ]*[(]([\t]*[ ]*[*&]?[ ]?[a-zA-Z0-9_](\\[([0-9]+)?\\])*[,]?[ ]*[\n]?)*([,]?[ ]*[\n]?[.][.][.])?[)]([ ]*[\n][\t]*|[ ]|[\n])*{" SKETCH_PROTOTYPES ${SKETCH_SOURCE})

         # Write function prototypes
         file(APPEND ${SKETCH_CPP} "\n//=== START Forward: ${SKETCH_SOURCE_PATH}\n")
         foreach(SKETCH_PROTOTYPE ${SKETCH_PROTOTYPES})
             string(REPLACE "\n" " " SKETCH_PROTOTYPE "${SKETCH_PROTOTYPE}")
             string(REPLACE "{" " " SKETCH_PROTOTYPE "${SKETCH_PROTOTYPE}")
-            message(STATUS "\tprototype: ${SKETCH_PROTOTYPE};")
-            file(APPEND ${SKETCH_CPP} "\n${SKETCH_PROTOTYPE};")
+#            message(STATUS "\tprototype: ${SKETCH_PROTOTYPE};")
+            file(APPEND ${SKETCH_CPP} "${SKETCH_PROTOTYPE};\n")
 		endforeach()
-        file(APPEND ${SKETCH_CPP} "\n//=== END Forward: ${SKETCH_SOURCE_PATH}\n")
+        file(APPEND ${SKETCH_CPP} "//=== END Forward: ${SKETCH_SOURCE_PATH}\n")
 	endforeach()

@@ -1324,7 +1325,9 @@
         list(APPEND ARDUINO_PATHS arduino-00${VERSION})
     endforeach()

-    file(GLOB SDK_PATH_HINTS /usr/share/arduino*)
+    file(GLOB SDK_PATH_HINTS /usr/share/arduino*
+                             /opt/local/ardiuno*
+                             /usr/local/share/arduino*)
     list(SORT SDK_PATH_HINTS)
     list(REVERSE SDK_PATH_HINTS)


build: avoid re-including system paths

build: avoid re-including system paths

Do not add the (default) system include path as a system include path.
Doing so results in a `-isystem /usr/.../include`.  This changes the
include ordering, resulting in the failure to include headers from the
system when building the standard library.  This breaks compilation on
exherbo which uses a slightly different directory structure
(/usr/include -> /usr/host/include -> /usr/<target>/include).  If the
paths are canonicalised during the build, we would then add
/usr/<target>/include to the CPPFLAGS, resulting in the failure to
include C headers.  Unfortunately, this is insufficient as another site
is also including the path as a SYSTEM include path.  But, this is still
strictly an improvement.

--- cmake/modules/AddSwift.cmake
+++ cmake/modules/AddSwift.cmake
@@ -802,10 +802,14 @@
   _set_target_prefix_and_suffix("${target}" "${libkind}" "${SWIFTLIB_SINGLE_SDK}")

   if(SWIFTLIB_SINGLE_TARGET_LIBRARY)
-    if(NOT "${SWIFT_${SWIFTLIB_SINGLE_SDK}_ICU_UC_INCLUDE}" STREQUAL "")
+    if(NOT "${SWIFT_${SWIFTLIB_SINGLE_SDK}_ICU_UC_INCLUDE}" STREQUAL "" AND
+       NOT "${SWIFT_${SWIFTLIB_SINGLE_SDK}_ICU_UC_INCLUDE}" STREQUAL "/usr/include" AND
+       NOT "${SWIFT_${SWIFTLIB_SINGLE_SDK}_ICU_UC_INCLUDE}" STREQUAL "/usr/${SWIFT_SDK_${SWIFTLIB_SINGLE_SDK}_ARCH_${SWIFTLIB_SINGLE_ARCHITECTURE}_TRIPLE}/include")
       target_include_directories("${target}" SYSTEM PRIVATE "${SWIFT_${SWIFTLIB_SINGLE_SDK}_ICU_UC_INCLUDE}")
     endif()
-    if(NOT "${SWIFT_${SWIFTLIB_SINGLE_SDK}_ICU_I18N_INCLUDE}" STREQUAL "")
+    if(NOT "${SWIFT_${SWIFTLIB_SINGLE_SDK}_ICU_I18N_INCLUDE}" STREQUAL "" AND
+       NOT "${SWIFT_${SWIFTLIB_SINGLE_SDK}_ICU_I18N_INCLUDE}" STREQUAL "/usr/include" AND
+       NOT "${SWIFT_${SWIFTLIB_SINGLE_SDK}_ICU_I18N_INCLUDE}" STREQUAL "/usr/${SWIFT_SDK_${SWIFTLIB_SINGLE_SDK}_ARCH_${SWIFTLIB_SINGLE_ARCHITECTURE}_TRIPLE}/include")
       target_include_directories("${target}" SYSTEM PRIVATE "${SWIFT_${SWIFTLIB_SINGLE_SDK}_ICU_I18N_INCLUDE}")
     endif()
   endif()


build: remove unnecessary `CXX_STANDARD` for Windows

The entire project is now at C++14.  Windows had to adopt C++14 earlier
to support processing the Windows SDK headers.  This is no longer
necessary, adopt the global settings instead.

--- cmake/modules/AddSwift.cmake
+++ cmake/modules/AddSwift.cmake
@@ -517,7 +517,6 @@
     endif()

     set_target_properties(${name} PROPERTIES
-      CXX_STANDARD 14
       NO_SONAME YES)
   endif()


[CMake] Bootstrap stagae 0 also needs the host Swift libraries

--- cmake/modules/AddSwift.cmake
+++ cmake/modules/AddSwift.cmake
@@ -575,7 +575,7 @@
     # For the "end step" of bootstrapping configurations on Darwin, need to be
     # able to fall back to the SDK directory for libswiftCore et al.
     if (BOOTSTRAPPING_MODE MATCHES "BOOTSTRAPPING.*")
-      if (bootstrapping STREQUAL "")
+      if (NOT "${bootstrapping}" STREQUAL "1")
         if(${SWIFT_HOST_VARIANT_SDK} IN_LIST SWIFT_DARWIN_PLATFORMS)
           target_link_directories(${target} PRIVATE "${sdk_dir}")
         endif()


Cppcheck: Enable all checks

Cppcheck: Enable all checks

--- cmake/modules/CppCheck.cmake
+++ cmake/modules/CppCheck.cmake
@@ -20,7 +20,7 @@

     # Set defaults for unprovided arguments
     if(NOT CppCheck_ENABLE)
-        set(CppCheck_ENABLE "warning,performance")
+        set(CppCheck_ENABLE "all")
     endif()

     foreach(dir ${CppCheck_INCLUDEDIRS})


Changed FindGeos to use COMPARE_VERSION_STRINGS macro.

--- cmake_modules/FindGeos.cmake
+++ cmake_modules/FindGeos.cmake
@@ -19,6 +19,7 @@
 #  GEOS_LIBRARIES    - Libraries to link against for the GEOS
 #

+INCLUDE(${CMAKE_SOURCE_DIR}/cmake_modules/CMakeCompareVersionStrings.cmake)

 IF (GEOS_INCLUDE_DIR)
   SET(GEOS_FIND_QUIETLY TRUE)
@@ -70,21 +71,16 @@
 		MESSAGE(STATUS "Found GEOS library ${GEOVERMAJ}.${GEOVERMIN}.${GEOVERREV} -- " ${GEOS_LIBRARY})
 		MESSAGE(STATUS "Found GEOS include path -- " ${GEOS_INCLUDE_DIR})

-	  IF((${GEOVERMAJ} LESS 3) OR
-			 (${GEOVERMAJ} EQUAL 3 AND ${GEOVERMIN} LESS 2) OR
-			 (${GEOVERMAJ} EQUAL 3 AND ${GEOVERMIN} EQUAL 2 AND ${GEOVERREV} LESS 2))
+		COMPARE_VERSION_STRINGS("${GEOVERMAJ}.${GEOVERMIN}.${GEOVERREV}" "3.2.2" GEOVERSIONCOMP)
+	  IF(${GEOVERSIONCOMP} LESS 0)

 			MESSAGE(STATUS "GEOS library ${GEOVERMAJ}.${GEOVERMIN}.${GEOVERREV} is too old. Version 3.2.2 or better 3.3.0 or up is needed. Building Geo module is now disabled.")
-	  ELSE((${GEOVERMAJ} LESS 3) OR
-			 (${GEOVERMAJ} EQUAL 3 AND ${GEOVERMIN} LESS 2) OR
-			 (${GEOVERMAJ} EQUAL 3 AND ${GEOVERMIN} EQUAL 2 AND ${GEOVERREV} LESS 2))
+	  ELSE(${GEOVERSIONCOMP} LESS 0)

 			SET(GEOS_FOUND 1)
 			SET(GEOS_LIBRARIES ${GEOS_LIBRARY})
 			SET(GEOS_INCLUDE_DIRS ${GEOS_INCLUDE_DIR})
-	  ENDIF((${GEOVERMAJ} LESS 3) OR
-			 (${GEOVERMAJ} EQUAL 3 AND ${GEOVERMIN} LESS 2) OR
-			 (${GEOVERMAJ} EQUAL 3 AND ${GEOVERMIN} EQUAL 2 AND ${GEOVERREV} LESS 2))
+	  ENDIF(${GEOVERSIONCOMP} LESS 0)
 	ENDIF(GEOS_VERSION_H)

 ELSE (GEOS_INCLUDE_DIR AND GEOS_LIBRARY)


Updated comment for the bootloader configuration

--- targets/avr/bootloader.cmake
+++ targets/avr/bootloader.cmake
@@ -6,6 +6,7 @@
   ${MCODE_BL_TOP}/main.c
 )

+# Expected HFUSE: 0x9D; 1KB staring 0x7C00
 set ( MCODE_BOOTLOADER_BASE 0x7c00 )

 add_executable( bootloader ${BL_SRC_LIST} )


Only use install prefix on target.

Only use install prefix on target.

--- functions.cmake
+++ functions.cmake
@@ -559,6 +559,6 @@
 endfunction()

 function(install_symlink TARGET LINK)
-    install(CODE "execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink ${CMAKE_INSTALL_PREFIX}/{TARGET} ${CMAKE_INSTALL_PREFIX}/${LINK})")
+    install(CODE "execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink ${CMAKE_INSTALL_PREFIX}/${TARGET} ${LINK})")
 endfunction(install_symlink)


Removed gtest library linking.

Removed gtest library linking.

Updated add_test command to use the log_sink option rather than redirecting output to file.

--- tools/cmake/ANHLibrary.cmake
+++ tools/cmake/ANHLibrary.cmake
@@ -157,7 +157,6 @@

         TARGET_LINK_LIBRARIES(${name}_test
             ${ANHLIB_DEPENDS}
-            ${GTEST_BOTH_LIBRARIES}
             ${GMOCK_LIBRARIES})
         add_dependencies(${name}_test DEPS)

@@ -186,25 +185,13 @@
             # works without any issues.
     	    CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/tools/windows/user_project.vcxproj.in
     	        ${CMAKE_CURRENT_BINARY_DIR}/${name}_tests.vcxproj.user @ONLY)
+        ENDIF()

-            if(ENABLE_TEST_REPORT)
-                foreach(configuration ${CMAKE_CONFIGURATION_TYPES})
-                    add_test(
-                        NAME all_${name}_tests_${configuration}
-                        CONFIGURATIONS ${configuration}
-                        COMMAND ${name}_test "--catch_system_error=yes  --log_level=test_suite --output_format=XML > ${PROJECT_BINARY_DIR}/reports/$<CONFIGURATION>/"
-                        WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${configuration}
-                    )
-                endforeach()
-            endif()
-        ELSE()
-            IF(ENABLE_TEST_REPORT)
-                add_test(
-                    NAME all_${name}_tests
-                    COMMAND ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${name}_test "--catch_system_error=yes  --log_level=test_suite --output_format=XML > ${PROJECT_BINARY_DIR}/reports/$<CONFIGURATION>/"
-                )
-            ENDIF()
-        ENDIF()
+        add_test(
+            NAME all_${name}_tests
+            CONFIGURATIONS ${configuration}
+            COMMAND ${name}_test --catch_system_error=yes --log_level=test_suite --output_format=XML --log_sink=${PROJECT_BINARY_DIR}/all_${name}_tests_$<CONFIGURATION>.xml
+            WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${configuration})
     ENDIF()
 ENDFUNCTION()


don't install the external libs

don't install the external libs

--- topo-volume/ttk-bs/ttk.cmake
+++ topo-volume/ttk-bs/ttk.cmake
@@ -199,9 +199,6 @@
   function(ttk_external_lib project)
     add_library(${project} ${PROJECT_SRC})
     ttk_wrapup_flags(${project})
-    install(
-      TARGETS ${project}
-      DESTINATION ${TTK_BINARY_INSTALL_DIR})
   endfunction(ttk_external_lib)

   function(ttk_wrapup_flags project)


Re-enable incremental linking (#26704)

Re-enable incremental linking (#26704)

This was disabled due to a linker bug that was fixed in 2017. Maybe it's time to re-enable this.

Fixes #13344.

--- configurecompiler.cmake
+++ configurecompiler.cmake
@@ -243,12 +243,6 @@
   set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /DEBUG /PDBCOMPRESS")
   set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /STACK:1572864")

-  # Temporarily disable incremental link due to incremental linking CFG bug crashing crossgen.
-  # See https://github.com/dotnet/coreclr/issues/12592
-  # This has been fixed in VS 2017 Update 5 but we're keeping this around until everyone is off
-  # the versions that have the bug. The bug manifests itself as a bad crash.
-  set(NO_INCREMENTAL_LINKER_FLAGS "/INCREMENTAL:NO")
-
   # Debug build specific flags
   set(CMAKE_SHARED_LINKER_FLAGS_DEBUG "/NOVCFEATURE ${NO_INCREMENTAL_LINKER_FLAGS}")
   set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${NO_INCREMENTAL_LINKER_FLAGS}")


Support multi-config platforms when finding gmock

Summary: This should fix running tests in a vcpkg environment.

Reviewed By: yfeldblum

Differential Revision: D7822368

fbshipit-source-id: a549febeb0bbea7208386cbed8a6ecb316b98661

--- CMake/FindGMock.cmake
+++ CMake/FindGMock.cmake
@@ -13,9 +13,18 @@

 FIND_PATH(LIBGMOCK_INCLUDE_DIR gmock/gmock.h)

-FIND_LIBRARY(LIBGMOCK_MAIN_LIBRARY gmock_main)
-FIND_LIBRARY(LIBGMOCK_LIBRARY gmock)
-FIND_LIBRARY(LIBGTEST_LIBRARY gtest)
+FIND_LIBRARY(LIBGMOCK_MAIN_LIBRARY_DEBUG NAMES gmock_maind)
+FIND_LIBRARY(LIBGMOCK_MAIN_LIBRARY_RELEASE NAMES gmock_main)
+FIND_LIBRARY(LIBGMOCK_LIBRARY_DEBUG NAMES gmockd)
+FIND_LIBRARY(LIBGMOCK_LIBRARY_RELEASE NAMES gmock)
+FIND_LIBRARY(LIBGTEST_LIBRARY_DEBUG NAMES gtestd)
+FIND_LIBRARY(LIBGTEST_LIBRARY_RELEASE NAMES gtest)
+
+INCLUDE(SelectLibraryConfigurations)
+SELECT_LIBRARY_CONFIGURATIONS(LIBGMOCK_MAIN)
+SELECT_LIBRARY_CONFIGURATIONS(LIBGMOCK)
+SELECT_LIBRARY_CONFIGURATIONS(LIBGTEST)
+
 set(LIBGMOCK_LIBRARIES
   ${LIBGMOCK_MAIN_LIBRARY}
   ${LIBGMOCK_LIBRARY}


cmake: Fix OpenSSL detection in non-standard path

This should fix the detection on Windows.

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

--- ConfigureChecks.cmake
+++ ConfigureChecks.cmake
@@ -66,28 +66,28 @@
 endif (WIN32)

 if (OPENSSL_FOUND)
-    set(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIRS})
+    set(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIR})
     check_include_file(openssl/des.h HAVE_OPENSSL_DES_H)
     if (NOT HAVE_OPENSSL_DES_H)
         message(FATAL_ERROR "Could not detect openssl/des.h")
     endif()

-    set(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIRS})
+    set(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIR})
     check_include_file(openssl/aes.h HAVE_OPENSSL_AES_H)
     if (NOT HAVE_OPENSSL_AES_H)
         message(FATAL_ERROR "Could not detect openssl/aes.h")
     endif()

-    set(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIRS})
+    set(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIR})
     check_include_file(openssl/blowfish.h HAVE_OPENSSL_BLOWFISH_H)

-    set(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIRS})
+    set(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIR})
     check_include_file(openssl/ecdh.h HAVE_OPENSSL_ECDH_H)

-    set(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIRS})
+    set(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIR})
     check_include_file(openssl/ec.h HAVE_OPENSSL_EC_H)

-    set(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIRS})
+    set(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIR})
     check_include_file(openssl/ecdsa.h HAVE_OPENSSL_ECDSA_H)
 endif()


Fix typo in build-name

Fix typo in build-name

git-svn-id: ed1ce8e5c168003d808aec37bc6fda77b178f7bb@3412 c330d7e9-fc0c-0410-a5b3-fd85c6f5aa8f

--- trunk/test/openVibeTests.cmake
+++ trunk/test/openVibeTests.cmake
@@ -23,7 +23,7 @@
 endmacro(getuname)

 IF(WIN32)
-	SET(distrib ""})
+	SET(distrib "")
 	SET(distrib-release "")
 ELSE(WIN32)
 	find_program(LSB_RELEASE NAMES lsb_release)


Update bincrafters remote URL

Update bincrafters remote URL

--- CMake/External.cmake
+++ CMake/External.cmake
@@ -11,7 +11,7 @@

   include(${CMAKE_BINARY_DIR}/conan.cmake)

-  conan_add_remote(NAME bincrafters URL https://api.bintray.com/conan/bincrafters/public-conan)
+  conan_add_remote(NAME bincrafters URL https://bincrafters.jfrog.io/artifactory/api/conan/public-conan)
   set(CONAN_DEPENDENCIES catch2/2.11.0 tl-expected/20190710)
   set(CONAN_OPTIONS "")


Clear tables after call to amalgamate (#3271)

--- CMake/CMakeLibs.cmake
+++ CMake/CMakeLibs.cmake
@@ -422,6 +422,7 @@
   )

   set(${OUTPUT} ${AMALGAMATION_FILE_GEN})
+  set_property(GLOBAL PROPERTY AMALGAMATE_TARGETS "")
 endmacro(AMALGAMATE)

 function(JOIN VALUES GLUE OUTPUT)


Bugfix

Bugfix

git-svn-id: fbbf69ba8011aca0e74e1c67904b11cccbdbe66b@26962 0785d39b-7218-0410-832d-ea1e28bc413d

--- deal.II/cmake/macros/macro_configure_feature.cmake
+++ deal.II/cmake/macros/macro_configure_feature.cmake
@@ -261,9 +261,7 @@
               MESSAGE(STATUS
                 "DEAL_II_WITH_${feature} successfully set up with bundled packages."
                 )
-              IF(DEAL_II_FEATURE_AUTODETECTION)
-                SET_CACHED_OPTION(${feature} ON)
-              ENDIF()
+              SET_CACHED_OPTION(${feature} ON)
             ELSE()
               # This should not happen. So give an error
               MESSAGE(FATAL_ERROR


- update lcgdm endpoint url

- update lcgdm endpoint url

git-svn-id: 59214148e3ac47647353bb066875245f1d63170f@7825 4525493e-7705-40b1-a816-d608a930855b

--- test/functional/ctest_functional.cmake
+++ test/functional/ctest_functional.cmake
@@ -9,7 +9,7 @@
 set(http_desy_base "http://sligo.desy.de:2880/pnfs/desy.de/data/dteam")
 set(http_desy_file "${http_desy_base}/fbxtest.txt")

-set(http_lcgdm_base "https://lxfsra04a04.cern.ch/dpm/cern.ch/home/dteam/")
+set(http_lcgdm_base "https://lxfsra10a01.cern.ch/dpm/cern.ch/home/dteam/")

 test_dav_endpoint_ronly( ${http_desy_base} "")
@@ -29,7 +29,7 @@
 test_valid_read_generic("http://google.com" "")
 test_valid_read_generic("http://wikipedia.org" "")
 test_valid_read_generic("https://wikipedia.org" "")
-test_valid_read_generic("http://cnn.com" "")
+test_valid_read_generic("http://www.w3.org/" "")
 test_valid_read_generic("http://cern.ch" "")

 # testwith common SE


Remove TUIO finder, replaced by TUIOConfig.cmake

--- FindTUIO.cmake
+++ FindTUIO.cmake
@@ -1,37 +0,0 @@
-# - Try to find TUIO
-# Once done, this will define
-#
-#  TUIO_FOUND - system has TUIO
-#  TUIO_INCLUDE_DIRS - the TUIO include directories
-#  TUIO_LIBRARIES - link these to use TUIO
-#
-# this file is modeled after http://www.cmake.org/Wiki/CMake:How_To_Find_Libraries
-
-include(LibFindMacros)
-
-# Use pkg-config to get hints about paths
-libfind_pkg_check_modules(TUIO_PKGCONF TUIO)
-
-# Include dir
-find_path(TUIO_INCLUDE_DIR
-  NAMES TUIO/TuioClient.h
-  PATHS ${TUIO_PKGCONF_INCLUDE_DIRS} ${TUIO_ROOT}/include $ENV{TUIO_ROOT}/include
-)
-
-# also add the TUIO/ directory to the include path
-SET(TUIO_INCLUDE_DIR_2 "${TUIO_INCLUDE_DIR}/TUIO")
-
-# also add the oscpack/ directory to the include path
-SET(TUIO_INCLUDE_DIR_3 "${TUIO_INCLUDE_DIR}/oscpack")
-
-# Finally the library itself
-find_library(TUIO_LIBRARY
-  NAMES TUIO
-  PATHS ${TUIO_PKGCONF_LIBRARY_DIRS} ${TUIO_ROOT}/lib $ENV{TUIO_ROOT}/lib
-)
-
-# Set the include dir variables and the libraries and let libfind_process do the rest.
-# NOTE: Singular variables for this library, plural for libraries this this lib depends on.
-set(TUIO_PROCESS_INCLUDES TUIO_INCLUDE_DIR TUIO_INCLUDE_DIR_2 TUIO_INCLUDE_DIR_3)
-set(TUIO_PROCESS_LIBS TUIO_LIBRARY)
-libfind_process(TUIO)


BUG: s/_SB_Boost_LIBRARY_DIR/_SB_BOOST_LIBRARYDIR/g (use correct variable)

--- SuperBuild/CMake/External_boost.cmake
+++ SuperBuild/CMake/External_boost.cmake
@@ -21,7 +21,7 @@
   runtime-link=shared
   --prefix=${SB_INSTALL_PREFIX}
   --includedir=${_SB_Boost_INCLUDE_DIR}
-  --libdir=${_SB_Boost_LIBRARY_DIR}
+  --libdir=${_SB_BOOST_LIBRARYDIR}
   --with-system
   --with-serialization
   --with-filesystem


update geotranz download URL

update geotranz download URL

--- projects/geotranz.cmake
+++ projects/geotranz.cmake
@@ -15,12 +15,7 @@
   GIT_ORIGIN git://github.com/smanders/geotranz.git
   GIT_TAG xp${VER} # what to 'git checkout'
   GIT_REF v${VER} # create patch from this tag to 'git checkout'
-  # no longer available
-  #DLURL ftp://priede.bf.lu.lv/pub/TIS/koordinatas/GEOTRANS/${VER}/master.tgz
-  #DLMD5 15ec0e3ab75fb5ada9a39e97e8c28bf5
-  # no longer valid? 26 B, should be 9.33 MB
-  #DLURL http://geotranz.sourcearchive.com/downloads/${VER}/geotranz_${VER}.orig.tar.gz
-  DLURL http://ftp.de.debian.org/debian/pool/main/g/geotranz/geotranz_${VER}.orig.tar.gz
+  DLURL http://ftp.gnome.org/ubuntu/ubuntu/pool/universe/g/geotranz/geotranz_${VER}.orig.tar.gz
   DLMD5 1d370d5b0daed2a541a9aa14bd3172a8
   PATCH ${PATCH_DIR}/geotranz.patch
   DIFF ${REPO}/compare/


Improved the add macro.

Improved the add macro.


temporarily remove -Werror due to mpi/c++11 warning

--- cdash/nightly.cmake
+++ cdash/nightly.cmake
@@ -104,7 +104,7 @@
 endmacro(setup_repo)

-set(flags "-O2 -g -Wall -Werror")
+set(flags "-O2 -g -Wall")
 SET(CONFIGURE_OPTIONS
   "-DCMAKE_C_COMPILER=mpicc"
   "-DCMAKE_CXX_COMPILER=mpicxx"


Update to kinect sdk 1.5

Update to kinect sdk 1.5

--- Win/projectDef.cmake
+++ Win/projectDef.cmake
@@ -45,7 +45,7 @@
 #    "http://timestamp.verisign.com/scripts/timestamp.dll")

 # add library dependencies here; leave ${PLUGIN_INTERNAL_DEPS} there unless you know what you're doing!
-set(KINECT_SDK_PATH "C:/Program Files/Microsoft SDKs/Kinect/v1.0/")
+set(KINECT_SDK_PATH "C:/Program Files/Microsoft SDKs/Kinect/v1.5/")
 set(WINAPI_PATH "C:/WinDDK/7600.16385.1/inc/")

 include_directories("${KINECT_SDK_PATH}/inc")


fix: (WIP) ios build

fix: (WIP) ios build

--- external/ios_cmake/ios.cmake
+++ external/ios_cmake/ios.cmake
@@ -11,9 +11,9 @@
 #list(REVERSE IOS_SDKS)
 #list(GET IOS_SDKS 0 SDK_ROOT)
 set(SDK_ROOT "${DEV_ROOT}/Platforms/${PLATFORM}.platform/Developer/SDKs/${PLATFORM}.sdk")
-set(CMAKE_C_COMPILER "${DEV_ROOT}/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang")
-set(CMAKE_CXX_COMPILER "${DEV_ROOT}/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++")
-set(CMAKE_AR "${DEV_ROOT}/Toolchains/XcodeDefault.xctoolchain/usr/bin/ar")
-set(CMAKE_RANLIB "${DEV_ROOT}/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib")
+#set(CMAKE_C_COMPILER "${DEV_ROOT}/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang")
+#set(CMAKE_CXX_COMPILER "${DEV_ROOT}/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++")
+#set(CMAKE_AR "${DEV_ROOT}/Toolchains/XcodeDefault.xctoolchain/usr/bin/ar")
+#set(CMAKE_RANLIB "${DEV_ROOT}/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib")

 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -miphoneos-version-min=5.0 -arch ${ARCH} -isysroot ${SDK_ROOT}")


Replace the FindICU module with the WebKit's one

The previous one was not linking the cpsm module against the icu-uc
library, making the python module fail when loaded due to
'u_hasBinaryProperty' being an undefined symbol, breaking CtrlP in the
process.

--- cmake/FindICU.cmake
+++ cmake/FindICU.cmake
@@ -1,314 +1,69 @@
-# This module can find the International Components for Unicode (ICU) Library
+# Finds the International Components for Unicode (ICU) Library
 #
-# Requirements:
-# - CMake >= 2.8.3 (for new version of find_package_handle_standard_args)
-#
-# The following variables will be defined for your use:
-#   - ICU_FOUND             : were all of your specified components found (include dependencies)?
-#   - ICU_INCLUDE_DIRS      : ICU include directory
-#   - ICU_LIBRARIES         : ICU libraries
-#   - ICU_VERSION           : complete version of ICU (x.y.z)
-#   - ICU_MAJOR_VERSION     : major version of ICU
-#   - ICU_MINOR_VERSION     : minor version of ICU
-#   - ICU_PATCH_VERSION     : patch version of ICU
-#   - ICU_<COMPONENT>_FOUND : were <COMPONENT> found? (FALSE for non specified component if it is not a dependency)
-#
-# For windows or non standard installation, define ICU_ROOT variable to point to the root installation of ICU. Two ways:
-#   - run cmake with -DICU_ROOT=<PATH>
-#   - define an environment variable with the same name before running cmake
-# With cmake-gui, before pressing "Configure":
-#   1) Press "Add Entry" button
-#   2) Add a new entry defined as:
-#     - Name: ICU_ROOT
-#     - Type: choose PATH in the selection list
-#     - Press "..." button and select the root installation of ICU
-#
-# Example Usage:
-#
-#   1. Copy this file in the root of your project source directory
-#   2. Then, tell CMake to search this non-standard module in your project directory by adding to your CMakeLists.txt:
-#     set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR})
-#   3. Finally call find_package() once, here are some examples to pick from
-#
-#   Require ICU 4.4 or later
-#     find_package(ICU 4.4 REQUIRED)
-#
-#   if(ICU_FOUND)
-#      include_directories(${ICU_INCLUDE_DIRS})
-#      add_executable(myapp myapp.c)
-#      target_link_libraries(myapp ${ICU_LIBRARIES})
-#   endif(ICU_FOUND)
-
-#=============================================================================
-# Copyright (c) 2011-2013, julp
-#
-# Distributed under the OSI-approved BSD License
-#
-# This software is distributed WITHOUT ANY WARRANTY; without even the
-# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-#=============================================================================
-
-find_package(PkgConfig QUIET)
-
-########## Private ##########
-if(NOT DEFINED ICU_PUBLIC_VAR_NS)
-    set(ICU_PUBLIC_VAR_NS "ICU")                          # Prefix for all ICU relative public variables
-endif(NOT DEFINED ICU_PUBLIC_VAR_NS)
-if(NOT DEFINED ICU_PRIVATE_VAR_NS)
-    set(ICU_PRIVATE_VAR_NS "_${ICU_PUBLIC_VAR_NS}")       # Prefix for all ICU relative internal variables
-endif(NOT DEFINED ICU_PRIVATE_VAR_NS)
-if(NOT DEFINED PC_ICU_PRIVATE_VAR_NS)
-    set(PC_ICU_PRIVATE_VAR_NS "_PC${ICU_PRIVATE_VAR_NS}") # Prefix for all pkg-config relative internal variables
-endif(NOT DEFINED PC_ICU_PRIVATE_VAR_NS)
-
-function(icudebug _VARNAME)
-    if(${ICU_PUBLIC_VAR_NS}_DEBUG)
-        if(DEFINED ${ICU_PUBLIC_VAR_NS}_${_VARNAME})
-            message("${ICU_PUBLIC_VAR_NS}_${_VARNAME} = ${${ICU_PUBLIC_VAR_NS}_${_VARNAME}}")
-        else(DEFINED ${ICU_PUBLIC_VAR_NS}_${_VARNAME})
-            message("${ICU_PUBLIC_VAR_NS}_${_VARNAME} = <UNDEFINED>")
-        endif(DEFINED ${ICU_PUBLIC_VAR_NS}_${_VARNAME})
-    endif(${ICU_PUBLIC_VAR_NS}_DEBUG)
-endfunction(icudebug)
-
-set(${ICU_PRIVATE_VAR_NS}_ROOT "")
-if(DEFINED ENV{ICU_ROOT})
-    set(${ICU_PRIVATE_VAR_NS}_ROOT "$ENV{ICU_ROOT}")
-endif(DEFINED ENV{ICU_ROOT})
-if (DEFINED ICU_ROOT)
-    set(${ICU_PRIVATE_VAR_NS}_ROOT "${ICU_ROOT}")
-endif(DEFINED ICU_ROOT)
-
-set(${ICU_PRIVATE_VAR_NS}_BIN_SUFFIXES )
-set(${ICU_PRIVATE_VAR_NS}_LIB_SUFFIXES )
-if(CMAKE_SIZEOF_VOID_P EQUAL 8)
-    list(APPEND ${ICU_PRIVATE_VAR_NS}_BIN_SUFFIXES "bin64")
-    list(APPEND ${ICU_PRIVATE_VAR_NS}_LIB_SUFFIXES "lib64")
-endif(CMAKE_SIZEOF_VOID_P EQUAL 8)
-list(APPEND ${ICU_PRIVATE_VAR_NS}_BIN_SUFFIXES "bin")
-list(APPEND ${ICU_PRIVATE_VAR_NS}_LIB_SUFFIXES "lib")
-
-set(${ICU_PRIVATE_VAR_NS}_COMPONENTS )
-# <icu component name> <library name 1> ... <library name N>
-macro(icu_declare_component _NAME)
-    list(APPEND ${ICU_PRIVATE_VAR_NS}_COMPONENTS ${_NAME})
-    set("${ICU_PRIVATE_VAR_NS}_COMPONENTS_${_NAME}" ${ARGN})
-endmacro(icu_declare_component)
-
-icu_declare_component(data icudata)
-icu_declare_component(uc   icuuc)         # Common and Data libraries
-icu_declare_component(i18n icui18n icuin) # Internationalization library
-icu_declare_component(io   icuio ustdio)  # Stream and I/O Library
-icu_declare_component(le   icule)         # Layout library
-icu_declare_component(lx   iculx)         # Paragraph Layout library
-
-########## Public ##########
-set(${ICU_PUBLIC_VAR_NS}_FOUND TRUE)
-set(${ICU_PUBLIC_VAR_NS}_LIBRARIES )
-set(${ICU_PUBLIC_VAR_NS}_INCLUDE_DIRS )
-set(${ICU_PUBLIC_VAR_NS}_C_FLAGS "")
-set(${ICU_PUBLIC_VAR_NS}_CXX_FLAGS "")
-set(${ICU_PUBLIC_VAR_NS}_CPP_FLAGS "")
-set(${ICU_PUBLIC_VAR_NS}_C_SHARED_FLAGS "")
-set(${ICU_PUBLIC_VAR_NS}_CXX_SHARED_FLAGS "")
-set(${ICU_PUBLIC_VAR_NS}_CPP_SHARED_FLAGS "")
-foreach(${ICU_PRIVATE_VAR_NS}_COMPONENT ${${ICU_PRIVATE_VAR_NS}_COMPONENTS})
-    string(TOUPPER "${${ICU_PRIVATE_VAR_NS}_COMPONENT}" ${ICU_PRIVATE_VAR_NS}_UPPER_COMPONENT)
-    set("${ICU_PUBLIC_VAR_NS}_${${ICU_PRIVATE_VAR_NS}_UPPER_COMPONENT}_FOUND" FALSE) # may be done in the icu_declare_component macro
-endforeach(${ICU_PRIVATE_VAR_NS}_COMPONENT)
-
-# Check components
-if(NOT ${ICU_PUBLIC_VAR_NS}_FIND_COMPONENTS) # uc required at least
-    set(${ICU_PUBLIC_VAR_NS}_FIND_COMPONENTS uc)
-else(NOT ${ICU_PUBLIC_VAR_NS}_FIND_COMPONENTS)
-    list(APPEND ${ICU_PUBLIC_VAR_NS}_FIND_COMPONENTS uc)
-    list(REMOVE_DUPLICATES ${ICU_PUBLIC_VAR_NS}_FIND_COMPONENTS)
-    foreach(${ICU_PRIVATE_VAR_NS}_COMPONENT ${${ICU_PUBLIC_VAR_NS}_FIND_COMPONENTS})
-        if(NOT DEFINED ${ICU_PRIVATE_VAR_NS}_COMPONENTS_${${ICU_PRIVATE_VAR_NS}_COMPONENT})
-            message(FATAL_ERROR "Unknown ICU component: ${${ICU_PRIVATE_VAR_NS}_COMPONENT}")
-        endif(NOT DEFINED ${ICU_PRIVATE_VAR_NS}_COMPONENTS_${${ICU_PRIVATE_VAR_NS}_COMPONENT})
-    endforeach(${ICU_PRIVATE_VAR_NS}_COMPONENT)
-endif(NOT ${ICU_PUBLIC_VAR_NS}_FIND_COMPONENTS)
-
-# Includes
+#  ICU_FOUND          - True if ICU found.
+#  ICU_I18N_FOUND     - True if ICU's internationalization library found.
+#  ICU_INCLUDE_DIRS   - Directory to include to get ICU headers
+#                       Note: always include ICU headers as, e.g.,
+#                       unicode/utypes.h
+#  ICU_LIBRARIES      - Libraries to link against for the common ICU
+#  ICU_I18N_LIBRARIES - Libraries to link against for ICU internationaliation
+#                       (note: in addition to ICU_LIBRARIES)
+# Look for the header file.
 find_path(
-    ${ICU_PUBLIC_VAR_NS}_INCLUDE_DIRS
-    NAMES unicode/utypes.h utypes.h
-    HINTS ${${ICU_PRIVATE_VAR_NS}_ROOT}
-    PATH_SUFFIXES "include"
-    DOC "Include directories for ICU"
-)
-
-if(${ICU_PUBLIC_VAR_NS}_INCLUDE_DIRS)
-    ########## <part to keep synced with tests/version/CMakeLists.txt> ##########
-    if(EXISTS "${${ICU_PUBLIC_VAR_NS}_INCLUDE_DIRS}/unicode/uvernum.h") # ICU >= 4
-        file(READ "${${ICU_PUBLIC_VAR_NS}_INCLUDE_DIRS}/unicode/uvernum.h" ${ICU_PRIVATE_VAR_NS}_VERSION_HEADER_CONTENTS)
-    elseif(EXISTS "${${ICU_PUBLIC_VAR_NS}_INCLUDE_DIRS}/unicode/uversion.h") # ICU [2;4[
-        file(READ "${${ICU_PUBLIC_VAR_NS}_INCLUDE_DIRS}/unicode/uversion.h" ${ICU_PRIVATE_VAR_NS}_VERSION_HEADER_CONTENTS)
-    elseif(EXISTS "${${ICU_PUBLIC_VAR_NS}_INCLUDE_DIRS}/unicode/utypes.h") # ICU [1.4;2[
-        file(READ "${${ICU_PUBLIC_VAR_NS}_INCLUDE_DIRS}/unicode/utypes.h" ${ICU_PRIVATE_VAR_NS}_VERSION_HEADER_CONTENTS)
-    elseif(EXISTS "${${ICU_PUBLIC_VAR_NS}_INCLUDE_DIRS}/utypes.h") # ICU 1.3
-        file(READ "${${ICU_PUBLIC_VAR_NS}_INCLUDE_DIRS}/utypes.h" ${ICU_PRIVATE_VAR_NS}_VERSION_HEADER_CONTENTS)
-    else()
-        message(FATAL_ERROR "ICU version header not found")
-    endif()
-
-    if(${ICU_PRIVATE_VAR_NS}_VERSION_HEADER_CONTENTS MATCHES ".*# *define *ICU_VERSION *\"([0-9]+)\".*") # ICU 1.3
-        # [1.3;1.4[ as #define ICU_VERSION "3" (no patch version, ie all 1.3.X versions will be detected as 1.3.0)
-        set(${ICU_PUBLIC_VAR_NS}_MAJOR_VERSION "1")
-        set(${ICU_PUBLIC_VAR_NS}_MINOR_VERSION "${CMAKE_MATCH_1}")
-        set(${ICU_PUBLIC_VAR_NS}_PATCH_VERSION "0")
-    elseif(${ICU_PRIVATE_VAR_NS}_VERSION_HEADER_CONTENTS MATCHES ".*# *define *U_ICU_VERSION_MAJOR_NUM *([0-9]+).*")
-        #
-        # Since version 4.9.1, ICU release version numbering was totaly changed, see:
-        # - http://site.icu-project.org/download/49
-        # - http://userguide.icu-project.org/design#TOC-Version-Numbers-in-ICU
-        #
-        set(${ICU_PUBLIC_VAR_NS}_MAJOR_VERSION "${CMAKE_MATCH_1}")
-        string(REGEX REPLACE ".*# *define *U_ICU_VERSION_MINOR_NUM *([0-9]+).*" "\\1" ${ICU_PUBLIC_VAR_NS}_MINOR_VERSION "${${ICU_PRIVATE_VAR_NS}_VERSION_HEADER_CONTENTS}")
-        string(REGEX REPLACE ".*# *define *U_ICU_VERSION_PATCHLEVEL_NUM *([0-9]+).*" "\\1" ${ICU_PUBLIC_VAR_NS}_PATCH_VERSION "${${ICU_PRIVATE_VAR_NS}_VERSION_HEADER_CONTENTS}")
-    elseif(${ICU_PRIVATE_VAR_NS}_VERSION_HEADER_CONTENTS MATCHES ".*# *define *U_ICU_VERSION *\"(([0-9]+)(\\.[0-9]+)*)\".*") # ICU [1.4;1.8[
-        # [1.4;1.8[ as #define U_ICU_VERSION "1.4.1.2" but it seems that some 1.4.1(?:\.\d)? have releasing error and appears as 1.4.0
-        set(${ICU_PRIVATE_VAR_NS}_FULL_VERSION "${CMAKE_MATCH_1}") # copy CMAKE_MATCH_1, no longer valid on the following if
-        if(${ICU_PRIVATE_VAR_NS}_FULL_VERSION MATCHES "^([0-9]+)\\.([0-9]+)$")
-            set(${ICU_PUBLIC_VAR_NS}_MAJOR_VERSION "${CMAKE_MATCH_1}")
-            set(${ICU_PUBLIC_VAR_NS}_MINOR_VERSION "${CMAKE_MATCH_2}")
-            set(${ICU_PUBLIC_VAR_NS}_PATCH_VERSION "0")
-        elseif(${ICU_PRIVATE_VAR_NS}_FULL_VERSION MATCHES "^([0-9]+)\\.([0-9]+)\\.([0-9]+)")
-            set(${ICU_PUBLIC_VAR_NS}_MAJOR_VERSION "${CMAKE_MATCH_1}")
-            set(${ICU_PUBLIC_VAR_NS}_MINOR_VERSION "${CMAKE_MATCH_2}")
-            set(${ICU_PUBLIC_VAR_NS}_PATCH_VERSION "${CMAKE_MATCH_3}")
-        endif()
-    else()
-        message(FATAL_ERROR "failed to detect ICU version")
-    endif()
-    set(${ICU_PUBLIC_VAR_NS}_VERSION "${${ICU_PUBLIC_VAR_NS}_MAJOR_VERSION}.${${ICU_PUBLIC_VAR_NS}_MINOR_VERSION}.${${ICU_PUBLIC_VAR_NS}_PATCH_VERSION}")
-    ########## </part to keep synced with tests/version/CMakeLists.txt> ##########
-
-    # Check dependencies (implies pkg-config)
-    if(PKG_CONFIG_FOUND)
-        set(${ICU_PRIVATE_VAR_NS}_COMPONENTS_DUP ${${ICU_PUBLIC_VAR_NS}_FIND_COMPONENTS})
-        foreach(${ICU_PRIVATE_VAR_NS}_COMPONENT ${${ICU_PRIVATE_VAR_NS}_COMPONENTS_DUP})
-            pkg_check_modules(PC_ICU_PRIVATE_VAR_NS "icu-${${ICU_PRIVATE_VAR_NS}_COMPONENT}" QUIET)
-
-            if(${PC_ICU_PRIVATE_VAR_NS}_FOUND)
-                foreach(${PC_ICU_PRIVATE_VAR_NS}_LIBRARY ${PC_ICU_LIBRARIES})
-                    string(REGEX REPLACE "^icu" "" ${PC_ICU_PRIVATE_VAR_NS}_STRIPPED_LIBRARY ${${PC_ICU_PRIVATE_VAR_NS}_LIBRARY})
-                    list(APPEND ${ICU_PUBLIC_VAR_NS}_FIND_COMPONENTS ${${PC_ICU_PRIVATE_VAR_NS}_STRIPPED_LIBRARY})
-                endforeach(${PC_ICU_PRIVATE_VAR_NS}_LIBRARY)
-            endif(${PC_ICU_PRIVATE_VAR_NS}_FOUND)
-        endforeach(${ICU_PRIVATE_VAR_NS}_COMPONENT)
-        list(REMOVE_DUPLICATES ${ICU_PUBLIC_VAR_NS}_FIND_COMPONENTS)
-    endif(PKG_CONFIG_FOUND)
-
-    # Check libraries
-    foreach(${ICU_PRIVATE_VAR_NS}_COMPONENT ${${ICU_PUBLIC_VAR_NS}_FIND_COMPONENTS})
-        set(${ICU_PRIVATE_VAR_NS}_POSSIBLE_RELEASE_NAMES )
-        set(${ICU_PRIVATE_VAR_NS}_POSSIBLE_DEBUG_NAMES )
-        foreach(${ICU_PRIVATE_VAR_NS}_BASE_NAME ${${ICU_PRIVATE_VAR_NS}_COMPONENTS_${${ICU_PRIVATE_VAR_NS}_COMPONENT}})
-            list(APPEND ${ICU_PRIVATE_VAR_NS}_POSSIBLE_RELEASE_NAMES "${${ICU_PRIVATE_VAR_NS}_BASE_NAME}")
-            list(APPEND ${ICU_PRIVATE_VAR_NS}_POSSIBLE_DEBUG_NAMES "${${ICU_PRIVATE_VAR_NS}_BASE_NAME}d")
-            list(APPEND ${ICU_PRIVATE_VAR_NS}_POSSIBLE_RELEASE_NAMES "${${ICU_PRIVATE_VAR_NS}_BASE_NAME}${ICU_MAJOR_VERSION}${ICU_MINOR_VERSION}")
-            list(APPEND ${ICU_PRIVATE_VAR_NS}_POSSIBLE_DEBUG_NAMES "${${ICU_PRIVATE_VAR_NS}_BASE_NAME}${ICU_MAJOR_VERSION}${ICU_MINOR_VERSION}d")
-        endforeach(${ICU_PRIVATE_VAR_NS}_BASE_NAME)
-
-        find_library(
-            ${ICU_PRIVATE_VAR_NS}_LIB_RELEASE_${${ICU_PRIVATE_VAR_NS}_COMPONENT}
-            NAMES ${${ICU_PRIVATE_VAR_NS}_POSSIBLE_RELEASE_NAMES}
-            HINTS ${${ICU_PRIVATE_VAR_NS}_ROOT}
-            PATH_SUFFIXES ${_ICU_LIB_SUFFIXES}
-            DOC "Release libraries for ICU"
-        )
-        find_library(
-            ${ICU_PRIVATE_VAR_NS}_LIB_DEBUG_${${ICU_PRIVATE_VAR_NS}_COMPONENT}
-            NAMES ${${ICU_PRIVATE_VAR_NS}_POSSIBLE_DEBUG_NAMES}
-            HINTS ${${ICU_PRIVATE_VAR_NS}_ROOT}
-            PATH_SUFFIXES ${_ICU_LIB_SUFFIXES}
-            DOC "Debug libraries for ICU"
-        )
-
-        string(TOUPPER "${${ICU_PRIVATE_VAR_NS}_COMPONENT}" ${ICU_PRIVATE_VAR_NS}_UPPER_COMPONENT)
-        if(NOT ${ICU_PRIVATE_VAR_NS}_LIB_RELEASE_${${ICU_PRIVATE_VAR_NS}_COMPONENT} AND NOT ${ICU_PRIVATE_VAR_NS}_LIB_DEBUG_${${ICU_PRIVATE_VAR_NS}_COMPONENT}) # both not found
-            set("${ICU_PUBLIC_VAR_NS}_${${ICU_PRIVATE_VAR_NS}_UPPER_COMPONENT}_FOUND" FALSE)
-            set("${ICU_PUBLIC_VAR_NS}_FOUND" FALSE)
-        else(NOT ${ICU_PRIVATE_VAR_NS}_LIB_RELEASE_${${ICU_PRIVATE_VAR_NS}_COMPONENT} AND NOT ${ICU_PRIVATE_VAR_NS}_LIB_DEBUG_${${ICU_PRIVATE_VAR_NS}_COMPONENT}) # one or both found
-            set("${ICU_PUBLIC_VAR_NS}_${${ICU_PRIVATE_VAR_NS}_UPPER_COMPONENT}_FOUND" TRUE)
-            if(NOT ${ICU_PRIVATE_VAR_NS}_LIB_RELEASE_${${ICU_PRIVATE_VAR_NS}_COMPONENT}) # release not found => we are in debug
-                set(${ICU_PRIVATE_VAR_NS}_LIB_${${ICU_PRIVATE_VAR_NS}_COMPONENT} "${${ICU_PRIVATE_VAR_NS}_LIB_DEBUG_${${ICU_PRIVATE_VAR_NS}_COMPONENT}}")
-            elseif(NOT ${ICU_PRIVATE_VAR_NS}_LIB_DEBUG_${${ICU_PRIVATE_VAR_NS}_COMPONENT}) # debug not found => we are in release
-                set(${ICU_PRIVATE_VAR_NS}_LIB_${${ICU_PRIVATE_VAR_NS}_COMPONENT} "${${ICU_PRIVATE_VAR_NS}_LIB_RELEASE_${${ICU_PRIVATE_VAR_NS}_COMPONENT}}")
-            else() # both found
-                set(
-                    ${ICU_PRIVATE_VAR_NS}_LIB_${${ICU_PRIVATE_VAR_NS}_COMPONENT}
-                    optimized ${${ICU_PRIVATE_VAR_NS}_LIB_RELEASE_${${ICU_PRIVATE_VAR_NS}_COMPONENT}}
-                    debug ${${ICU_PRIVATE_VAR_NS}_LIB_DEBUG_${${ICU_PRIVATE_VAR_NS}_COMPONENT}}
-                )
-            endif()
-            list(APPEND ${ICU_PUBLIC_VAR_NS}_LIBRARIES ${${ICU_PRIVATE_VAR_NS}_LIB_${${ICU_PRIVATE_VAR_NS}_COMPONENT}})
-        endif(NOT ${ICU_PRIVATE_VAR_NS}_LIB_RELEASE_${${ICU_PRIVATE_VAR_NS}_COMPONENT} AND NOT ${ICU_PRIVATE_VAR_NS}_LIB_DEBUG_${${ICU_PRIVATE_VAR_NS}_COMPONENT})
-    endforeach(${ICU_PRIVATE_VAR_NS}_COMPONENT)
-
-    # Try to find out compiler flags
-    find_program(${ICU_PUBLIC_VAR_NS}_CONFIG_EXECUTABLE icu-config HINTS ${${ICU_PRIVATE_VAR_NS}_ROOT})
-    if(${ICU_PUBLIC_VAR_NS}_CONFIG_EXECUTABLE)
-        execute_process(COMMAND ${${ICU_PUBLIC_VAR_NS}_CONFIG_EXECUTABLE} --cflags OUTPUT_VARIABLE ${ICU_PUBLIC_VAR_NS}_C_FLAGS OUTPUT_STRIP_TRAILING_WHITESPACE)
-        execute_process(COMMAND ${${ICU_PUBLIC_VAR_NS}_CONFIG_EXECUTABLE} --cxxflags OUTPUT_VARIABLE ${ICU_PUBLIC_VAR_NS}_CXX_FLAGS OUTPUT_STRIP_TRAILING_WHITESPACE)
-        execute_process(COMMAND ${${ICU_PUBLIC_VAR_NS}_CONFIG_EXECUTABLE} --cppflags OUTPUT_VARIABLE ${ICU_PUBLIC_VAR_NS}_CPP_FLAGS OUTPUT_STRIP_TRAILING_WHITESPACE)
-
-        execute_process(COMMAND ${${ICU_PUBLIC_VAR_NS}_CONFIG_EXECUTABLE} --cflags-dynamic OUTPUT_VARIABLE ${ICU_PUBLIC_VAR_NS}_C_SHARED_FLAGS OUTPUT_STRIP_TRAILING_WHITESPACE)
-        execute_process(COMMAND ${${ICU_PUBLIC_VAR_NS}_CONFIG_EXECUTABLE} --cxxflags-dynamic OUTPUT_VARIABLE ${ICU_PUBLIC_VAR_NS}_CXX_SHARED_FLAGS OUTPUT_STRIP_TRAILING_WHITESPACE)
-        execute_process(COMMAND ${${ICU_PUBLIC_VAR_NS}_CONFIG_EXECUTABLE} --cppflags-dynamic OUTPUT_VARIABLE ${ICU_PUBLIC_VAR_NS}_CPP_SHARED_FLAGS OUTPUT_STRIP_TRAILING_WHITESPACE)
-    endif(${ICU_PUBLIC_VAR_NS}_CONFIG_EXECUTABLE)
-
-    # Check find_package arguments
-    include(FindPackageHandleStandardArgs)
-    if(${ICU_PUBLIC_VAR_NS}_FIND_REQUIRED AND NOT ${ICU_PUBLIC_VAR_NS}_FIND_QUIETLY)
-        find_package_handle_standard_args(
-            ${ICU_PUBLIC_VAR_NS}
-            REQUIRED_VARS ${ICU_PUBLIC_VAR_NS}_LIBRARIES ${ICU_PUBLIC_VAR_NS}_INCLUDE_DIRS
-            VERSION_VAR ${ICU_PUBLIC_VAR_NS}_VERSION
-        )
-    else(${ICU_PUBLIC_VAR_NS}_FIND_REQUIRED AND NOT ${ICU_PUBLIC_VAR_NS}_FIND_QUIETLY)
-        find_package_handle_standard_args(${ICU_PUBLIC_VAR_NS} "ICU not found" ${ICU_PUBLIC_VAR_NS}_LIBRARIES ${ICU_PUBLIC_VAR_NS}_INCLUDE_DIRS)
-    endif(${ICU_PUBLIC_VAR_NS}_FIND_REQUIRED AND NOT ${ICU_PUBLIC_VAR_NS}_FIND_QUIETLY)
-else(${ICU_PUBLIC_VAR_NS}_INCLUDE_DIRS)
-    set("${ICU_PUBLIC_VAR_NS}_FOUND" FALSE)
-    if(${ICU_PUBLIC_VAR_NS}_FIND_REQUIRED AND NOT ${ICU_PUBLIC_VAR_NS}_FIND_QUIETLY)
-        message(FATAL_ERROR "Could not find ICU include directory")
-    endif(${ICU_PUBLIC_VAR_NS}_FIND_REQUIRED AND NOT ${ICU_PUBLIC_VAR_NS}_FIND_QUIETLY)
-endif(${ICU_PUBLIC_VAR_NS}_INCLUDE_DIRS)
-
-mark_as_advanced(
-    ${ICU_PUBLIC_VAR_NS}_INCLUDE_DIRS
-    ${ICU_PUBLIC_VAR_NS}_LIBRARIES
-)
-
-# IN (args)
-icudebug("FIND_COMPONENTS")
-icudebug("FIND_REQUIRED")
-icudebug("FIND_QUIETLY")
-icudebug("FIND_VERSION")
-# OUT
-# Found
-icudebug("FOUND")
-icudebug("UC_FOUND")
-icudebug("I18N_FOUND")
-icudebug("IO_FOUND")
-icudebug("LE_FOUND")
-icudebug("LX_FOUND")
-icudebug("DATA_FOUND")
-# Flags
-icudebug("C_FLAGS")
-icudebug("CPP_FLAGS")
-icudebug("CXX_FLAGS")
-icudebug("C_SHARED_FLAGS")
-icudebug("CPP_SHARED_FLAGS")
-icudebug("CXX_SHARED_FLAGS")
-# Linking
-icudebug("INCLUDE_DIRS")
-icudebug("LIBRARIES")
-# Version
-icudebug("MAJOR_VERSION")
-icudebug("MINOR_VERSION")
-icudebug("PATCH_VERSION")
-icudebug("VERSION")
+    ICU_INCLUDE_DIR
+    NAMES unicode/utypes.h
+    DOC "Include directory for the ICU library")
+mark_as_advanced(ICU_INCLUDE_DIR)
+# Look for the library.
+find_library(
+    ICU_LIBRARY
+    NAMES icuuc cygicuuc cygicuuc32
+    DOC "Libraries to link against for the common parts of ICU")
+mark_as_advanced(ICU_LIBRARY)
+# Copy the results to the output variables.
+if (ICU_INCLUDE_DIR AND ICU_LIBRARY)
+    set(ICU_FOUND 1)
+    set(ICU_LIBRARIES ${ICU_LIBRARY})
+    set(ICU_INCLUDE_DIRS ${ICU_INCLUDE_DIR})
+    set(ICU_VERSION 0)
+    set(ICU_MAJOR_VERSION 0)
+    set(ICU_MINOR_VERSION 0)
+    file(READ "${ICU_INCLUDE_DIR}/unicode/uversion.h" _ICU_VERSION_CONENTS)
+    string(REGEX REPLACE ".*#define U_ICU_VERSION_MAJOR_NUM ([0-9]+).*" "\\1" ICU_MAJOR_VERSION "${_ICU_VERSION_CONENTS}")
+    string(REGEX REPLACE ".*#define U_ICU_VERSION_MINOR_NUM ([0-9]+).*" "\\1" ICU_MINOR_VERSION "${_ICU_VERSION_CONENTS}")
+    set(ICU_VERSION "${ICU_MAJOR_VERSION}.${ICU_MINOR_VERSION}")
+    # Look for the ICU internationalization libraries
+    find_library(
+        ICU_I18N_LIBRARY
+        NAMES icuin icui18n cygicuin cygicuin32
+        DOC "Libraries to link against for ICU internationalization")
+    mark_as_advanced(ICU_I18N_LIBRARY)
+    if (ICU_I18N_LIBRARY)
+        set(ICU_I18N_FOUND 1)
+        set(ICU_I18N_LIBRARIES ${ICU_I18N_LIBRARY})
+    else ()
+        set(ICU_I18N_FOUND 0)
+        set(ICU_I18N_LIBRARIES)
+    endif ()
+else ()
+    set(ICU_FOUND 0)
+    set(ICU_I18N_FOUND 0)
+    set(ICU_LIBRARIES)
+    set(ICU_I18N_LIBRARIES)
+    set(ICU_INCLUDE_DIRS)
+    set(ICU_VERSION)
+    set(ICU_MAJOR_VERSION)
+    set(ICU_MINOR_VERSION)
+endif ()
+if (ICU_FOUND)
+    if (NOT ICU_FIND_QUIETLY)
+        message(STATUS "Found ICU header files in ${ICU_INCLUDE_DIRS}")
+        message(STATUS "Found ICU libraries: ${ICU_LIBRARIES}")
+    endif ()
+else ()
+    if (ICU_FIND_REQUIRED)
+        message(FATAL_ERROR "Could not find ICU")
+    else ()
+        message(STATUS "Optional package ICU was not found")
+    endif ()
+endif ()


Updated FindOVR.cmake script to work with OVR SDK 0.6.x

--- cmake/FindOVR.cmake
+++ cmake/FindOVR.cmake
@@ -158,11 +158,13 @@
 list(APPEND _ovr_library_names libovr.ax${_ovr_libname_bitsuffix})
 list(APPEND _ovr_library_names ovr)
 list(APPEND _ovr_library_names OVR)
+list(APPEND _ovr_library_names LibOVR)
 list(APPEND _ovr_library_names ovr${_ovr_libname_bitsuffix})
 list(APPEND _ovr_library_names OVRRT${_ovr_libname_bitsuffix})
 list(APPEND _ovr_library_names OVRRT${_ovr_libname_bitsuffix}_0)
 list(APPEND _ovr_library_debug_names ovr)
 list(APPEND _ovr_library_debug_names OVR)
+list(APPEND _ovr_library_debug_names LibOVR)
 list(APPEND _ovr_library_debug_names ovr${_ovr_libname_bitsuffix}d)
 list(APPEND _ovr_library_debug_names OVR${_ovr_libname_bitsuffix}d)
 list(APPEND _ovr_library_debug_names OVRRT${_ovr_libname_bitsuffix})
@@ -217,7 +219,7 @@

 find_path(OVR_SOURCE_DIR
 	NAMES
-	OVR_CAPI.cpp
+	OVR_CAPI.h
 	HINTS
 	"${_libdir}"
 	"${_libdir}/.."


Add Ubuntu Multiarch library paths

Add Ubuntu Multiarch library paths

https://wiki.ubuntu.com/MultiarchSpec

--- cmake/FindRE2.cmake
+++ cmake/FindRE2.cmake
@@ -38,6 +38,10 @@
   /usr/local/re2/lib
   /opt/local/lib
   /usr/lib
+  /lib/i386-linux-gnu
+  /lib/x86_64-linux-gnu
+  /usr/lib/i386-linux-gnu
+  /usr/lib/x86_64-linux-gnu
 )

 if (RE2_INCLUDE_DIR AND RE2_LIBRARY)


Update c_check.cmake

Update c_check.cmake

--- cmake/c_check.cmake
+++ cmake/c_check.cmake
@@ -73,6 +73,10 @@
   set(ARCH x86)
 endif ()

+if (${ARCH} MATCHES "ppc")
+  set(ARCH power)
+endif ()
+
 set(COMPILER_ID ${CMAKE_CXX_COMPILER_ID})
 if (${COMPILER_ID} STREQUAL "GNU")
   set(COMPILER_ID "GCC")


cmake: add SOFA-EXTERNAL_APPLICATION_DIRS option

This option serves a similar purpose as SOFA-EXTERNAL_PLUGIN_DIRS, it
can be set to a ;-separated list of paths to directories that contain
Sofa applications directories.

Former-commit-id: 28e968db10bf0a5be6ba21adf6b6be47bf895581

--- cmake/options.cmake
+++ cmake/options.cmake
@@ -21,6 +21,7 @@
 set(SOFA-EXTERNAL_INCLUDE_DIR ${SOFA-EXTERNAL_INCLUDE_DIR} CACHE PATH "Include path for pre-compiled dependencies outside of the Sofa directory")
 set(SOFA-EXTERNAL_LIBRARY_DIR ${SOFA-EXTERNAL_LIBRARY_DIR} CACHE PATH "Library path for pre-compiled dependencies outside of the Sofa directory")
 set(SOFA-EXTERNAL_PLUGIN_DIRS ${SOFA-EXTERNAL_PLUGIN_DIRS} CACHE STRING "External directories (separated with ;) containing Sofa Plugin folders (but not the path to the plugin it-self !)")
+set(SOFA-EXTERNAL_APPLICATION_DIRS ${SOFA-EXTERNAL_APPLICATION_DIRS} CACHE STRING "External directories (separated with ;) containing Sofa Application directories")

 # extlibs
 ##CGoGN
@@ -502,6 +503,12 @@
     RetrieveDependencies("${extPlugin}" "SOFA-EXTPLUGIN_" "Enable ext plugin" "SOFA_HAVE_EXTPLUGIN_" RECURSIVE)
 endforeach()

+# external applications (auto-search)
+set(SOFA_PROJECT_FOLDER "SofaExternalApplication")
+foreach(extApplication ${SOFA-EXTERNAL_APPLICATION_DIRS})
+    RetrieveDependencies("${extApplication}" "SOFA-EXTAPPLICATION_" "Enable ext application" "SOFA_HAVE_EXTAPPLICATION_" RECURSIVE)
+endforeach()
+
 # projects (auto-search)
 set(SOFA_PROJECT_FOLDER "SofaApplication")
 RetrieveDependencies("${SOFA_APPLICATIONS_PROJECTS_DIR}" "SOFA-APPLICATION_" "Enable application" "SOFA_HAVE_APPLICATION_")


Switch to DragNDrop generator on OSX; fix de-screamification

--- cmake/package.cmake
+++ cmake/package.cmake
@@ -85,7 +85,7 @@
 set(CPACK_PACKAGE_VERSION_MINOR ${OSPRAY_VERSION_MINOR})
 set(CPACK_PACKAGE_VERSION_PATCH ${OSPRAY_VERSION_PATCH})
 set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "OSPRay: A Ray Tracing Based Rendering Engine for High-Fidelity Visualization")
-set(CPACK_PACKAGE_VendOR "Intel Corporation")
+set(CPACK_PACKAGE_VENDOR "Intel Corporation")
 set(CPACK_PACKAGE_CONTACT ospray@googlegroups.com)

 set(CPACK_COMPONENT_LIB_DISPLAY_NAME "Library")
@@ -107,11 +107,11 @@
 set(CPACK_COMPONENT_TEST_DESCRIPTION "Tools for testing the correctness of various aspects of OSPRay.")

 # dependencies between components
-set(CPACK_COMPONENT_DEVEL_DEPendS lib)
-set(CPACK_COMPONENT_APPS_DEPendS lib)
-set(CPACK_COMPONENT_MPI_DEPendS lib)
+set(CPACK_COMPONENT_DEVEL_DEPENDS lib)
+set(CPACK_COMPONENT_APPS_DEPENDS lib)
+set(CPACK_COMPONENT_MPI_DEPENDS lib)
 set(CPACK_COMPONENT_LIB_REQUIRED ON) # always install the libs
-set(CPACK_COMPONENT_TEST_DEPendS lib)
+set(CPACK_COMPONENT_TEST_DEPENDS lib)

 # point to readme and license files
 set(CPACK_RESOURCE_FILE_README ${PROJECT_SOURCE_DIR}/README.md)
@@ -155,13 +155,12 @@
     set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_FILE_NAME}.x86_64.macosx")
   else()
     set(CPACK_PACKAGING_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX})
-    set(CPACK_GENERATOR PackageMaker)
+    set(CPACK_GENERATOR DragNDrop)
     set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_FILE_NAME}.x86_64")
     #set(CPACK_COMPONENTS_ALL lib devel apps)
     set(CPACK_MONOLITHIC_INSTALL ON)
     set(CPACK_PACKAGE_NAME ospray-${OSPRAY_VERSION})
-    set(CPACK_PACKAGE_VendOR "intel") # creates short name com.intel.ospray.xxx in pkgutil
-    set(CPACK_OSX_PACKAGE_VERSION 10.7)
+    set(CPACK_PACKAGE_VENDOR "intel") # creates short name com.intel.ospray.xxx in pkgutil
   endif()


Fix CPack on Mac OS X

Fix CPack on Mac OS X

--- cmake/package.cmake
+++ cmake/package.cmake
@@ -127,7 +127,7 @@
 # MacOSX specific settings
 ELSEIF(APPLE)

-  FILE(COPY {PROJECT_SOURCE_DIR}/README.md DESTINATION ${PROJECT_BINARY_DIR})
+  FILE(COPY ${PROJECT_SOURCE_DIR}/README.md DESTINATION ${PROJECT_BINARY_DIR}/README.txt)
   SET(CPACK_RESOURCE_FILE_README ${PROJECT_BINARY_DIR}/README.txt)

   IF (OSPRAY_ZIP_MODE)


[OGRE-230] Include the unordered folder from boost to fix builds in some situations

--HG--
branch : v1-9

--- CMake/InstallDependencies.cmake
+++ CMake/InstallDependencies.cmake
@@ -206,7 +206,6 @@
       PATTERN "timer" EXCLUDE
       PATTERN "tr1" EXCLUDE
       PATTERN "units" EXCLUDE
-      PATTERN "unordered" EXCLUDE
       PATTERN "uuid" EXCLUDE
       PATTERN "variant" EXCLUDE
       PATTERN "wave" EXCLUDE


Set ENABLE_BITCODE to NO by default (Xcode 7.0, iOS 9.0 feature)

--- os/iphone.cmake
+++ os/iphone.cmake
@@ -125,3 +125,6 @@
 endforeach()
 set(CMAKE_XCODE_ATTRIBUTE_ARCHS[sdk=iphonesimulator*] "${archs}")
 set(CMAKE_XCODE_ATTRIBUTE_VALID_ARCHS[sdk=iphonesimulator*] "${archs}")
+
+# Introduced in iOS 9.0
+set(CMAKE_XCODE_ATTRIBUTE_ENABLE_BITCODE NO)


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

--- Modules/ThirdParty/KWSys/src/KWSys/kwsysDateStamp.cmake
+++ Modules/ThirdParty/KWSys/src/KWSys/kwsysDateStamp.cmake
@@ -18,4 +18,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 05)

 # KWSys version date day component.  Format is DD.
-SET(KWSYS_DATE_STAMP_DAY   25)
+SET(KWSYS_DATE_STAMP_DAY   26)


Add batch include for all executables

Add batch include for all executables

--- CMake/mitkMacroCreateExecutable.cmake
+++ CMake/mitkMacroCreateExecutable.cmake
@@ -80,6 +80,7 @@
     endif()

     # Create batch and VS user files for Windows platforms
+    include(mitkFunctionCreateWindowsBatchScript)
     if(WIN32)
       set(_batch_file_in "${CMAKE_CURRENT_SOURCE_DIR}/${MODULE_TARGET}.bat.in")
       if(NOT EXISTS "${_batch_file_in}")


tiny fix

tiny fix

--- source/ConfigureChecks.cmake
+++ source/ConfigureChecks.cmake
@@ -49,15 +49,6 @@
 FIND_PACKAGE(ilplib REQUIRED)
 FIND_PACKAGE(idmlib REQUIRED)
 FIND_PACKAGE(imllib REQUIRED)
-
-IF( USE_IISE )
-  FIND_PACKAGE(iise REQUIRED)
-  ADD_DEFINITIONS( -DUSE_IISELIB=TRUE )
-ELSE( USE_IISE )
-  SET( iise_LIBRARIES "" )
-  SET( iise_INCLUDE_DIRS "" )
-  SET( iise_LIBRARY_DIRS "" )
-ENDIF( USE_IISE )

 IF( USE_WISEKMA )
   FIND_PACKAGE(wisekma REQUIRED)


Bug fix.

Bug fix.

--- cmake/dsn.cmake
+++ cmake/dsn.cmake
@@ -69,14 +69,13 @@
 			set(${FLAG_VAR} ${${FLAG_VAR}} CACHE STRING "" FORCE)
 		endif()
 	endif()
-	#message(STATUS ${FLAG_VAR} ":" ${${FLAG_VAR}})
 endfunction(ms_link_static_runtime)

 function(ms_replace_compiler_flags REPLACE_OPTION)
 	set(SUFFIXES "")
-	if(CMAKE_CONFIGURATION_TYPES STREQUAL "")
+	if((NOT DEFINED CMAKE_CONFIGURATION_TYPES) OR (CMAKE_CONFIGURATION_TYPES STREQUAL ""))
 		#set(SUFFIXES "_DEBUG" "_RELEASE" "_MINSIZEREL" "_RELWITHDEBINFO")
-		if(NOT (CMAKE_BUILD_TYPE STREQUAL ""))
+		if((DEFINED CMAKE_BUILD_TYPE) AND (NOT (CMAKE_BUILD_TYPE STREQUAL "")))
 			string(TOUPPER ${CMAKE_BUILD_TYPE} SUFFIXES)
 			set(SUFFIXES "_${SUFFIXES}")
 		endif()
@@ -94,6 +93,7 @@
 				ms_link_static_runtime(${FLAG_VAR})
 			endif()
 		endforeach()
+		#message(STATUS ${FLAG_VAR} ":" ${${FLAG_VAR}})
 	endforeach()
 endfunction(ms_replace_compiler_flags REPLACE_OPTION)


fix: Warning when optional module dependency not available [BASIS]

--- CMake/Basis/CommonTools.cmake
+++ CMake/Basis/CommonTools.cmake
@@ -230,15 +230,13 @@
   # ------------------------------------------------------------------------
   # tokenize dependency specification
   basis_tokenize_dependency ("${PACKAGE}" PKG _BFP_VERSIONS _BFP_COMPONENTS)
-  list (APPEND _BFP_ARGN_COMPONENTS ${_BFP_COMPONENTS})
-  unset (_BFP_COMPONENTS)
   list (GET _BFP_ARGN_UNPARSED_ARGUMENTS 0 _BFP_VERSION)
   if (_BFP_VERSION MATCHES "^[0-9]+(\\.[0-9]+)*$")
-    list (REMOVE_AT _BFP_ARGN_UNPARSED_ARGUMENTS 0)
     if (_BFP_VERSIONS)
       message (FATAL_ERROR "Cannot use both version specification as part of "
                            "package name and explicit version argument.")
     endif ()
+    list (REMOVE_AT _BFP_ARGN_UNPARSED_ARGUMENTS 0)
     set (_BFP_VERSIONS "${_BFP_VERSION}")
   endif ()
   list (LENGTH _BFP_VERSIONS _BFP_VERSIONS_COUNT)
@@ -250,6 +248,28 @@
   endif ()
   string (TOLOWER "${PKG}" PKG_L)
   string (TOUPPER "${PKG}" PKG_U)
+  # ------------------------------------------------------------------------
+  # set <PKG>_FIND_REQUIRED_<CMP>
+  foreach (_BFP_CMP IN LISTS _BFP_COMPONENTS)
+    set (${PKG}_FIND_REQUIRED_${_BFP_CMP} ${_BFP_ARGN_REQUIRED})
+  endforeach ()
+  foreach (_BFP_CMP IN LISTS _BFP_ARGN_COMPONENTS)
+    set (${PKG}_FIND_REQUIRED_${_BFP_CMP} TRUE)
+  endforeach ()
+  foreach (_BFP_CMP IN LISTS _BFP_ARGN_OPTIONAL_COMPONENTS)
+    set (${PKG}_FIND_REQUIRED_${_BFP_CMP} FALSE)
+  endforeach ()
+  list (APPEND _BFP_ARGN_COMPONENTS ${_BFP_COMPONENTS})
+  if (_BFP_ARGN_COMPONENTS)
+    list (REMOVE_DUPLICATES _BFP_ARGN_COMPONENTS)
+  endif ()
+  # ------------------------------------------------------------------------
+  # prefix of package variable names set by Find<Pkg> or <Pkg>Config
+  if (PKG MATCHES "^((P|J)ython)Interp$")
+    string (TOUPPER "${CMAKE_MATCH_1}" _BFP_NS)
+  else ()
+    set (_BFP_NS "${PKG}")
+  endif ()
   # ------------------------------------------------------------------------
   # some debugging output
   if (BASIS_DEBUG)
@@ -287,14 +307,6 @@
     unset (_BFP_INFO)
     unset (_BFP_ARGS)
   endif ()
-  # ------------------------------------------------------------------------
-  # set <PKG>_FIND_REQUIRED_<CMP>
-  foreach (_BFP_CMP IN LISTS _BFP_ARGN_COMPONENTS)
-    set (${PKG}_FIND_REQUIRED_${_BFP_CMP} TRUE)
-  endforeach ()
-  foreach (_BFP_CMP IN LISTS _BFP_ARGN_OPTIONAL_COMPONENTS)
-    set (${PKG}_FIND_REQUIRED_${_BFP_CMP} FALSE)
-  endforeach ()
   # ------------------------------------------------------------------------
   # find other modules of same project
   set (_BFP_IS_PROJECT FALSE)
@@ -325,8 +337,8 @@
                   " but module ${_BFP_CMP} is not enabled."
                 )
               elseif (NOT _BFP_ARGN_QUIET)
-                message (WARNING
-                  "Module ${PROJECT_NAME} uses module ${_BFP_CMP} of top-level project ${PKG},"
+                message (STATUS
+                  "Module ${PROJECT_NAME} optionally uses module ${_BFP_CMP} of top-level project ${PKG},"
                   " but module ${_BFP_CMP} is not enabled."
                 )
               endif ()
@@ -363,7 +375,7 @@
               " but module ${_BFP_CMP} is not enabled."
             )
           elseif (NOT _BFP_ARGN_QUIET)
-            message (WARNING
+            message (STATUS
               "Module ${PROJECT_NAME} optionally uses module ${_BFP_CMP} of top-level project ${PKG},"
               " but module ${_BFP_CMP} is not enabled."
             )