[cmake] fix component find

[cmake] fix component find

--- cmake/nd-config.cmake
+++ cmake/nd-config.cmake
@@ -54,8 +54,14 @@
 endif()

 ### Handle components
+# component name and the imported target must be the same
 foreach(package ${ND_FIND_COMPONENTS})
   find_package(${package} CONFIG PATHS .)
+  get_property(plugin TARGET ${package} PROPERTY LOCATION)
+  if(plugin) ## should remove this when I add config files for the plugins?
+    set(ND_${package}_FOUND TRUE)
+  endif()
+  install(FILES ${plugin} DESTINATION bin/plugins)
 endforeach()

 ### Check everything got found
@@ -67,12 +73,43 @@
 )

 ### macro for copying plugins to a target's build Location
-macro(nd_copy_plugins_to_target _target)
-    add_custom_command(TARGET ${_target} POST_BUILD
-      COMMAND ${CMAKE_COMMAND} -E copy_directory
-          ${INSTALL_DIR}/bin/plugins
-          $<TARGET_FILE_DIR:${_target}>/plugins
-          COMMENT "Copying libnd plugins to build path for ${_target}."
-          )
-    add_dependencies(${_target} libnd)
-endmacro()
+# component name and the imported target must be the same
+#
+# plugins should define an "Extras" variable named <plugin>-EXTRAS
+# that has an extra files (eg associated shared libraries) to be copied
+# along side the plugin.
+function(nd_copy_plugins_to_target _target _plugins)
+    list(REMOVE_AT ARGV 0)
+    foreach(package ${ARGV})
+      if(NOT TARGET ${package})
+        find_package(${package} CONFIG PATHS .)
+      endif()
+      if(TARGET ${package})
+        get_property(plugin TARGET ${package} PROPERTY LOCATION)
+        if(plugin)
+          message(STATUS "Configuring ${package} to be copied to build path for ${_target}.")
+          add_custom_command(TARGET ${_target} POST_BUILD
+            COMMAND ${CMAKE_COMMAND} -E make_directory $<TARGET_FILE_DIR:${_target}>/plugins/
+            COMMAND ${CMAKE_COMMAND} -E copy
+                ${plugin}
+                $<TARGET_FILE_DIR:${_target}>/plugins
+                COMMENT "Copying ${package} to build path for ${_target}."
+                )
+          add_dependencies(${_target} ${package})
+          # extras
+          if(${package}-EXTRAS)
+            message(STATUS "Configuring ${package} extras to be copied to build path for ${_target}.")
+            foreach(extra ${${package}-EXTRAS})
+            add_custom_command(TARGET ${_target} POST_BUILD
+                COMMAND ${CMAKE_COMMAND} -E make_directory $<TARGET_FILE_DIR:${_target}>/plugins/
+                COMMAND ${CMAKE_COMMAND} -E copy
+                    ${extra}
+                    $<TARGET_FILE_DIR:${_target}>/plugins
+                    COMMENT "Copying ${extra} to build path for ${_target}."
+                    )
+            endforeach()
+          endif()
+        endif()
+      endif()
+    endforeach()
+endfunction()


[mechanics] fix oce links (runtime : cannot find -lTKDraw and friends, even for recent versions of oce)

--- cmake/oce_setup.cmake
+++ cmake/oce_setup.cmake
@@ -39,10 +39,10 @@
   # For versions of OCE older than 0.18 AND on some specific systems (namely Debian),
   # some toolkits are detected (through OCEConfig.cmake) but the
   # libraries are not available. We must not link them with the component.
-  if(OCE_VERSION VERSION_LESS 0.18)
+  #if(OCE_VERSION VERSION_LESS 0.18)
     set(UNNEEDED_OCE_TOOLKITS "DRAWEXE" "TKDraw" "TKTopTest" "TKViewerTest" "TKXSDRAW" "TKDCAF" "TKXDEDRAW" "TKTObjDRAW" "TKQADraw"   )
     foreach(_T ${UNNEEDED_OCE_TOOLKITS})
       list(REMOVE_ITEM OCE_LIBRARIES  ${_T})
     endforeach()
-  endif()
+  #endif()
 endif()


Remove faulty line from travis CI cmake script

--- cmake/travis-ci.cmake
+++ cmake/travis-ci.cmake
@@ -1,7 +1,6 @@
 set(CTEST_SOURCE_DIRECTORY "$ENV{TRAVIS_BUILD_DIR}")
 set(CTEST_BINARY_DIRECTORY "$ENV{TRAVIS_BUILD_DIR}/_build")

-include(${CTEST_SOURCE_DIRECTORY}/CTestConfig.cmake)
 set(CTEST_SITE Travis)
 set(CTEST_BUILD_NAME "Linux-$ENV{TRAVIS_BRANCH}")
 set(CTEST_CMAKE_GENERATOR "Unix Makefiles")


Fix wrong include path variable in FindLua

--- cmake-modules/FindLua.cmake
+++ cmake-modules/FindLua.cmake
@@ -46,9 +46,9 @@

 	FIND_LIBRARY(LUA_LIBRARY NAMES lua)

-	IF (LUA_INCLUDE_DIR AND LUA_LIBRARY)
+	IF (LUA_INCLUDEDIR AND LUA_LIBRARY)
 	   SET(LUA_FOUND TRUE)
-	ENDIF (LUA_INCLUDE_DIR AND LUA_LIBRARY)
+	ENDIF (LUA_INCLUDEDIR AND LUA_LIBRARY)

 	IF (LUA_FOUND)
 		IF (NOT Lua_FIND_QUIETLY)


Fix value of CMAKE_SYSTEM_PROCESSOR on windows when using CMake < 2.8.11

This commit had a workaround implemented in CMake 2.8.11 (Kitware/CMake@add8d22a)
to ensure the variable is properly set with older version of CMake.

--- cmake/ConfigureChecks.cmake
+++ cmake/ConfigureChecks.cmake
@@ -11,6 +11,19 @@
 include(cmake/CheckTypeExists.cmake)
 include(cmake/PlatformTest.cmake)
 include(TestBigEndian)
+
+# XXX Remove if minimum required CMake >= 2.8.11
+#     See CMake commit add8d22a (properly detect processor architecture on Windows)
+if(CMAKE_HOST_WIN32 AND CMAKE_VERSION VERSION_LESS "2.8.11")
+    if(ENV{PROCESSOR_ARCHITEW6432})
+        set(CMAKE_HOST_SYSTEM_PROCESSOR "$ENV{PROCESSOR_ARCHITEW6432}")
+    else()
+        set(CMAKE_HOST_SYSTEM_PROCESSOR "$ENV{PROCESSOR_ARCHITECTURE}")
+    endif()
+    if(NOT CMAKE_CROSSCOMPILING)
+        set(CMAKE_SYSTEM_PROCESSOR "${CMAKE_HOST_SYSTEM_PROCESSOR}")
+    endif()
+endif()

 message(STATUS "The system name is ${CMAKE_SYSTEM_NAME}")
 message(STATUS "The system processor is ${CMAKE_SYSTEM_PROCESSOR}")


Update FindMyPackage.cmake

Update FindMyPackage.cmake

--- cmake/FindLB/optional.cmake
+++ cmake/FindLB/optional.cmake
@@ -34,6 +34,7 @@
 	elseif(NOT ${_package}_FIND_QUIETLY)
 		message(STATUS "Find ${_package_name}: ${_msg}")
 	endif()
+	set(${_package}_NOT_FOUND_MESSAGE "${_msg}")
 endmacro()

 # Info reporting macro
@@ -63,16 +64,20 @@
 endforeach()
 _fmp_report_debug("########")

+# For CMake GUI
+option(${_package}_PREFER_HIGHEST
+	"Prefer the highest available version even if a lower version has more requested optional components"
+)
+
 # Find where all versions are installed
-if(NOT ${_package}_ROOT)
-	find_path(${_package}_ROOT
-		NAMES
-			${_package}
-	)
-endif()
+find_path(${_package}_ROOT
+	NAMES
+		${_package}
+	DOC "This should be the directory that contains ${_package}"
+)

 # Error out if we could not find the package directory
-if(${${_package}_ROOT} STREQUAL "${_package}_ROOT-NOTFOUND")
+if("${${_package}_ROOT}" STREQUAL "${_package}_ROOT-NOTFOUND")
 	_fmp_report_error("Could not find where versions are stored - please set ${_package}_ROOT")
 	return()
 endif()
@@ -172,35 +177,39 @@
 	return()
 endif()

-# Prefer versions with the most requested optional components
-set(_preferred_versions "")
-set(_preferred_versions_compnum 0)
-foreach(_version ${_candidate_versions})
-	set(_compnum 0)
-	# Count present requested optional components
-	foreach(_component ${${_package}_FIND_COMPONENTS})
-		if(NOT ${_package}_FIND_REQUIRED_${_component})
-			if(EXISTS "${${_package}_VERSIONS_DIRECTORY}/${_version}/cmake/${_package}/${_component}.cmake")
-				math(EXPR _compnum "${_compnum} + 1")
+if(${_package}_PREFER_HIGHEST)
+	set(_preferred_versions "${_candidate_versions}")
+else()
+	# Prefer versions with the most requested optional components
+	set(_preferred_versions "")
+	set(_preferred_versions_compnum 0)
+	foreach(_version ${_candidate_versions})
+		set(_compnum 0)
+		# Count present requested optional components
+		foreach(_component ${${_package}_FIND_COMPONENTS})
+			if(NOT ${_package}_FIND_REQUIRED_${_component})
+				if(EXISTS "${${_package}_VERSIONS_DIRECTORY}/${_version}/cmake/${_package}/${_component}.cmake")
+					math(EXPR _compnum "${_compnum} + 1")
+				endif()
 			endif()
+		endforeach()
+		# Update preferred versions
+		if(_compnum GREATER _preferred_versions_compnum)
+			set(_preferred_versions ${_version})
+			set(_preferred_versions_compnum ${_compnum})
+		elseif(_compnum EQUAL _preferred_versions_compnum)
+			list(APPEND _preferred_versions ${_version})
 		endif()
 	endforeach()
-	# Update preferred versions
-	if(_compnum GREATER _preferred_versions_compnum)
-		set(_preferred_versions ${_version})
-		set(_preferred_versions_compnum ${_compnum})
-	elseif(_compnum EQUAL _preferred_versions_compnum)
-		list(APPEND _preferred_versions ${_version})
-	endif()
-endforeach()
-_fmp_report_debug("_preferred_versions=${_preferred_versions}")
-
-# Error out if we made a mistake in our logic above
-# (worst case should be that _preferred_versions is the same as _candidate_versions)
-list(LENGTH _preferred_versions _num_preferred)
-if(_num_preferred EQUAL 0)
-	message(FATAL_ERROR "Something has gone wrong the code in Find${_package}.cmake")
-	return()
+	_fmp_report_debug("_preferred_versions=${_preferred_versions}")
+
+	# Error out if we made a mistake in our logic above
+	# (worst case should be that _preferred_versions is the same as _candidate_versions)
+	list(LENGTH _preferred_versions _num_preferred)
+	if(_num_preferred EQUAL 0)
+		message(FATAL_ERROR "Something has gone wrong the code in Find${_package}.cmake")
+		return()
+	endif()
 endif()

 # Finally, select the highest version
@@ -211,18 +220,41 @@
 	endif()
 endforeach()
 _fmp_report_debug("_preferred_version=${_preferred_version}")
+set(_ver_path "${${_package}_VERSIONS_DIRECTORY}/${_preferred_version}/cmake")
+
+# Make sure all requirements are met
+include("${_ver_path}/${_package}-requirements.cmake" OPTIONAL)
+foreach(_component ${${_package}_FIND_COMPONENTS})
+	include("${_ver_path}/${_package}/${_component}-requirements.cmake" OPTIONAL)
+endforeach()

 # Load the version and report findings
-include("${${_package}_VERSIONS_DIRECTORY}/${_preferred_version}/cmake/${_package}.cmake")
+include("${_ver_path}/${_package}.cmake")
 set(_components "")
 foreach(_component ${${_package}_FIND_COMPONENTS})
-	set(_comp_path "${${_package}_VERSIONS_DIRECTORY}/${_preferred_version}/cmake/${_package}/${_component}.cmake")
+	set(_comp_path "${_ver_path}/${_package}/${_component}.cmake")
 	if(EXISTS "${_comp_path}")
 		include("${_comp_path}")
 		list(APPEND _components ${_component})
+		set(${_package}_${_component}_FOUND 1)
 	endif()
 endforeach()
 set(${_package}_FOUND 1)
+set(${_package}_VERSION "${_preferred_version}")
+set(${_package}_VERSION_STRING "${_preferred_version}")
+string(REPLACE "." ";" _preferred_version_list "${_preferred_version}")
+list(LENGTH _preferred_version_list _preferred_version_depth)
+list(GET _preferred_version_list 0 ${_package}_VERSION_MAJOR)
+if(_preferred_version_depth GREATER 1)
+	list(GET _preferred_version_list 1 ${_package}_VERSION_MINOR)
+	if(_preferred_version_depth GREATER 2)
+		list(GET _preferred_version_list 2 ${_package}_VERSION_PATCH)
+		if(_preferred_version_depth GREATER 3)
+			list(GET _preferred_version_list 3 ${_package}_VERSION_TWEAK)
+		endif()
+	endif()
+endif()
+set(${_package}_ROOT_DIR "${${_package}_VERSIONS_DIRECTORY}/${_preferred_version}")
 string(REPLACE ";" ", " _components "${_components}")
 if(_components STREQUAL "")
 	_fmp_report_info("Found version ${_preferred_version} with no components")


updating comments in FindSimModSuite

updating comments in FindSimModSuite

--- cmake/FindSimModSuite.cmake
+++ cmake/FindSimModSuite.cmake
@@ -1,10 +1,16 @@
 # - Try to find Simmetrix SimModSuite
 # Once done this will define
 #  SIMMODSUITE_FOUND - System has SimModSuite
-#  SIMMODSUITE_INCLUDE_DIRS - The SimModSuite include directories
-#  SIMMODSUITE_LIBRARIES - The libraries needed to use SimModSuite
-#  SIMMODSUITE_DEFINITIONS - Compiler switches required for using SimModSuite
+#  SIMMODSUITE_INCLUDE_DIR - The SimModSuite include directories
+#  SIMMODSUITE_LIBS - The libraries needed to use SimModSuite
 #  SIMMODSUITE_<library>_FOUND - System has <library>
+#
+# Based on input variables:
+#  SIM_MPI
+#  SIMMETRIX_LIB_DIR
+#  SIMMETRIX_INCLUDE_DIR
+# And environment variable:
+#  CMAKE_PREFIX_PATH
 #
 # This implementation assumes a simmetrix install has the following structure
 # VERSION/


Simplify find_package for qt5

Simplify find_package for qt5

--- cmake/FishDetFindLibs.cmake
+++ cmake/FishDetFindLibs.cmake
@@ -1,30 +1,10 @@
 # --- Qt5 ---
-find_package( Qt5Widgets )
-if( NOT Qt5Widgets_FOUND )
-  message( FATAL_ERROR "Could not find Qt5Widgets.  Build cannot continue." )
+find_package( Qt5 REQUIRED COMPONENTS
+  Core Gui Widgets Network Multimedia PrintSupport )
+if( NOT APPLE )
+  find_package( Qt5DBus REQUIRED )
 endif()
-find_package( Qt5Core )
-if( NOT Qt5Core_FOUND )
-  message( FATAL_ERROR "Could not find Qt5Core.  Build cannot continue." )
-endif()
-find_package( Qt5Gui )
-if( NOT Qt5Gui_FOUND )
-  message( FATAL_ERROR "Could not find Qt5Gui.  Build cannot continue." )
-endif()
-find_package( Qt5PrintSupport )
-if( NOT Qt5PrintSupport_FOUND )
-  message( FATAL_ERROR "Could not find Qt5PrintSupport.  Build cannot continue." )
-endif()
-if( NOT APPLE )
-  find_package( Qt5DBus )
-  if( NOT Qt5DBus_FOUND )
-    message( FATAL_ERROR "Could not find Qt5DBus.  Build cannot continue." )
-  endif()
-endif()
-find_package( Qt5Test )
-if( NOT Qt5Test_FOUND )
-  message( FATAL_ERROR "Could not find Qt5Test.  Build cannot continue." )
-endif()
+find_package( Qt5Test REQUIRED )
 get_target_property(QT5_WIDGETS_LOCATION Qt5::Widgets LOCATION )
 message( STATUS "Found Qt5 at ${QT5_WIDGETS_LOCATION}" )
 if( WIN32 )
@@ -46,6 +26,7 @@
     "${_qt5Widgets_install_prefix}/plugins/imageformats/qwbmp.lib"
     "${_qt5Widgets_install_prefix}/plugins/imageformats/qwebp.lib"
     "${_qt5Widgets_install_prefix}/lib/Qt5Svg.lib"
+    Iphlpapi
     )
 elseif( APPLE )
 elseif( UNIX )
@@ -54,25 +35,16 @@
 # --- Boost ---
 set( Boost_USE_STATIC_LIBS ON )
 set( Boost_USE_STATIC_RUNTIME ON )
-find_package( Boost COMPONENTS filesystem system )
-if( NOT Boost_FOUND )
-  message( FATAL_ERROR "Could not find Boost.  Build cannot continue." )
-endif()
+find_package( Boost REQUIRED COMPONENTS filesystem system )

 # --- OpenCV ---
-find_package( OpenCV )
-if( NOT OpenCV_FOUND )
-  message( FATAL_ERROR "Could not find OpenCV.  Build cannot continue." )
-endif()
+find_package( OpenCV REQUIRED )
 if( WIN32 )
   file( GLOB_RECURSE OpenCV_SHARED_LIBS "${OpenCV_LIB_PATH}/../bin/*.dll" )
 endif()

 # --- OpenGL ---
-find_package( OpenGL )
-if( NOT OPENGL_FOUND )
-  message( FATAL_ERROR "Could not find OpenGL.  Build cannot continue." )
-endif()
+find_package( OpenGL REQUIRED )

 # --- Doxygen ---
 find_package( Doxygen )
@@ -104,10 +76,7 @@
   message( STATUS "Found Carbon at ${CARBON_LIBRARY}" )
   find_library( IOKIT_LIBRARY IOKit )
   message( STATUS "Found IOKit at ${IOKIT_LIBRARY}" )
-  find_package( Cups )
-  if( NOT CUPS_FOUND )
-    message (FATAL_ERROR "Could not find Cups.  Build cannot continue." )
-  endif()
+  find_package( Cups REQUIRED )
   set( APPLE_LIBRARIES
     ${COCOA_LIBRARY}
     ${CARBON_LIBRARY}
@@ -121,10 +90,7 @@
 # --- UNIX ---
 elseif( UNIX )
   find_package( X11 REQUIRED )
-  if( NOT X11_FOUND )
-    message( FATAL_ERROR "Could not find X11. Build cannot continue." )
-  endif()
-  find_package( Threads )
+  find_package( Threads REQUIRED )
   set( UNIX_LIBRARIES
     ${CMAKE_THREAD_LIBS_INIT}
     xcb


added lintian overrides for debian packages

--- cmake/OpenCVPackaging.cmake
+++ cmake/OpenCVPackaging.cmake
@@ -178,6 +178,85 @@
   set(CPACK_DEBIAN_COMPONENT_TESTS_SECTION "misc")
 endif(NOT OPENCV_CUSTOM_PACKAGE_INFO)

+set(CPACK_DEBIAN_COMPONENT_DOCS_ARCHITECTURE "all")
+
+# lintian stuff
+
+#
+# ocv_generate_lintian_overrides_file: generates lintian overrides file for
+#   the specified component (deb-package). It's assumed that <comp>_LINTIAN_OVERRIDES
+#   variable with suppressed tags is defined.
+#
+# Usage: ocv_generate_lintian_overrides_file(<component name>)
+#
+
+function(ocv_generate_lintian_overrides_file comp)
+    string(TOUPPER ${comp} comp_upcase)
+
+    set(package_name ${CPACK_DEBIAN_COMPONENT_${comp_upcase}_NAME})
+    set(suppressions ${${comp_upcase}_LINTIAN_OVERRIDES})
+
+    if(suppressions)
+        if(NOT package_name)
+            message(FATAL_ERROR "Package name for the ${comp} component is not defined")
+        endif()
+
+        # generate content of lintian overrides file
+
+        foreach(suppression ${suppressions})
+            set(line "${package_name}: ${suppression}")
+            if(content)
+                set(content "${content}\n${line}")
+            else()
+                set(content "${line}")
+            endif()
+        endforeach()
+
+        # create file and install it
+        set(cpack_tmp_dir "${CMAKE_BINARY_DIR}/deb-packages-gen/${comp}")
+        set(overrides_filename "${cpack_tmp_dir}/${package_name}")
+
+        file(WRITE "${overrides_filename}" "${content}")
+
+        # install generated file
+        install(FILES "${overrides_filename}"
+            DESTINATION share/lintian/overrides/
+            COMPONENT ${comp})
+
+        unset(content)
+    endif()
+endfunction()
+
+set(LIBS_LINTIAN_OVERRIDES "binary-or-shlib-defines-rpath" # usr/lib/libopencv_core.so.2.4.12
+                           "package-name-doesnt-match-sonames") # libopencv-calib3d2.4 libopencv-contrib2.4
+
+if(HAVE_opencv_python)
+    set(PYTHON_LINTIAN_OVERRIDES "binary-or-shlib-defines-rpath" # usr/lib/python2.7/dist-packages/cv2.so
+                                 "missing-dependency-on-numpy-abi")
+else()
+    set(PYTHON_LINTIAN_OVERRIDES "empty-binary-package") # python module is off
+endif()
+
+if(NOT HAVE_opencv_java)
+    set(JAVA_LINTIAN_OVERRIDES "empty-binary-package") # Java is off
+else()
+    # TODO: add smht here
+endif()
+
+set(DEV_LINTIAN_OVERRIDES "binary-or-shlib-defines-rpath" # usr/bin/opencv_traincascade
+                          "binary-without-manpage") # usr/bin/opencv_traincascade
+
+if(NOT INSTALL_C_EXAMPLES)
+    set(SAMPLES_LINTIAN_OVERRIDES "empty-binary-package") # samples are not installed
+endif()
+
+if(INSTALL_TESTS)
+    set(TESTS_LINTIAN_OVERRIDES "arch-dependent-file-in-usr-share" # usr/share/OpenCV/bin/opencv_test_ml
+                                "binary-or-shlib-defines-rpath") # usr/share/OpenCV/bin/opencv_test_ml
+else()
+    set(TESTS_LINTIAN_OVERRIDES "empty-binary-package") # there is no tests
+endif()
+
 if(CPACK_GENERATOR STREQUAL "DEB")
   find_program(GZIP_TOOL NAMES "gzip" PATHS "/bin" "/usr/bin" "/usr/local/bin")
   if(NOT GZIP_TOOL)
@@ -192,6 +271,7 @@
   set(ALL_COMPONENTS "libs" "dev" "docs" "python" "java" "samples" "tests")
   foreach (comp ${ALL_COMPONENTS})
     string(TOUPPER "${comp}" comp_upcase)
+
     set(DEBIAN_CHANGELOG_OUT_FILE    "${CMAKE_BINARY_DIR}/deb-packages-gen/${comp}/changelog.Debian")
     set(DEBIAN_CHANGELOG_OUT_FILE_GZ "${CMAKE_BINARY_DIR}/deb-packages-gen/${comp}/changelog.Debian.gz")
     set(CHANGELOG_PACKAGE_NAME "${CPACK_DEBIAN_COMPONENT_${comp_upcase}_NAME}")
@@ -223,6 +303,8 @@
                 COMPONENT "${comp}")
     endif()

+    ocv_generate_lintian_overrides_file("${comp}")
+
   endforeach()
 endif()


Use CMake version comparison machinery to [maybe] get Numpy detection right

--- cmake/Packages/Python.cmake
+++ cmake/Packages/Python.cmake
@@ -54,10 +54,13 @@

   IF(PYTHON_FOUND)
     # Search for numpy
-    EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c "import numpy; exit(numpy.__version__ >= 1.7)"
-      RESULT_VARIABLE NUMPY_FOUND)
-    IF(NUMPY_FOUND EQUAL 0)
+    EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c "import numpy; print numpy.__version__"
+      RESULT_VARIABLE NUMPY_FOUND OUTPUT_VARIABLE NUMPY_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
+    IF(NUMPY_FOUND EQUAL 0 AND NOT NUMPY_VERSION VERSION_LESS 1.7)
       SET(NUMPY_FOUND TRUE)
+    ELSEIF(NUMPY_VERSION VERSION_LESS 1.7)
+      SET(NUMPY_FOUND FALSE)
+      MESSAGE (STATUS "  x numpy:    (version ${NUMPY_VERSION} < 1.7 is too old)")
     ELSE()
       SET(NUMPY_FOUND FALSE)
     ENDIF()


Use surrounding quotes to avoid issues when variables are not defined

Former-commit-id: 659ebfc968fa7e9693096427074a33e3466d537b

--- cmake/PrintTargetInfo.cmake
+++ cmake/PrintTargetInfo.cmake
@@ -1,7 +1,7 @@
 cmake_minimum_required(VERSION 3.15)

 if(NOT WIN32)
-    if($ENV{CLICOLOR} OR $ENV{CLICOLOR_FORCE})
+    if("$ENV{CLICOLOR}" OR "$ENV{CLICOLOR_FORCE}")
         string(ASCII 27 Esc)
         set(ColourReset "${Esc}[m")
         set(ColourBold  "${Esc}[1m")


cmake: resolved list issue when parsing shield list

Fixes: #25656

The commit a8e90cbfb30489c24139244dc3218c81c0950224 improved handling of
shields. Unfortunately it pops items from the SHIELD variable which
works well if SHIELD is a CMake ;-separated list, but if the list is
a space separated list, as may be provided by the user, then this
principle fails as reported in #25656.

This is fixed by keeping improved behaviour, while popping from an
alternative SHIELD-NOTFOUND list instead.

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

--- cmake/app/boilerplate.cmake
+++ cmake/app/boilerplate.cmake
@@ -287,6 +287,13 @@
 else()
   set(ARCH_DIR ${ARCH_ROOT}/arch)
 endif()
+
+if(DEFINED SHIELD)
+  string(REPLACE " " ";" SHIELD_AS_LIST "${SHIELD}")
+endif()
+# SHIELD-NOTFOUND is a real CMake list, from which valid shields can be popped.
+# After processing all shields, only invalid shields will be left in this list.
+set(SHIELD-NOTFOUND ${SHIELD_AS_LIST})

 # Use BOARD to search for a '_defconfig' file.
 # e.g. zephyr/boards/arm/96b_carbon_nrf51/96b_carbon_nrf51_defconfig.
@@ -314,9 +321,6 @@
   endif()

   set(shield_dir ${root}/boards/shields)
-  if(DEFINED SHIELD)
-     string(REPLACE " " ";" SHIELD_AS_LIST "${SHIELD}")
-  endif()
   # Match the .overlay files in the shield directories to make sure we are
   # finding shields, e.g. x_nucleo_iks01a1/x_nucleo_iks01a1.overlay
   file(GLOB_RECURSE shields_refs_list
@@ -340,7 +344,7 @@
         continue()
       endif()

-      list(REMOVE_ITEM SHIELD ${s})
+      list(REMOVE_ITEM SHIELD-NOTFOUND ${s})

       list(GET shields_refs_list ${_idx} s_path)
       get_filename_component(s_dir ${s_path} DIRECTORY)
@@ -411,8 +415,8 @@
   message(FATAL_ERROR "Invalid usage")
 endif()

-if(DEFINED SHIELD AND NOT (SHIELD STREQUAL ""))
-  foreach (s ${SHIELD})
+if(DEFINED SHIELD AND NOT (SHIELD-NOTFOUND STREQUAL ""))
+  foreach (s ${SHIELD-NOTFOUND})
     message("No shield named '${s}' found")
   endforeach()
   print_usage()


cmake: manual handling of CMakeCheckCompilerFlag.cmake inclusion

Fixes: #30232

This is a workaround for #30232.

During Zephyr CMake invocation a plain C compiler is used for DTS.
This results in the internal `CheckCompilerFlag.cmake` being included
by CMake

Later, when the full toolchain is configured, then
`CMakeCheckCompilerFlag.cmake` is included.
This overloads the `cmake_check_compiler_flag()` function, thus
causing #30232.

By manualy loading `CMakeCheckCompilerFlag.cmake` then
`CheckCompilerFlag.cmake` will overload the functions (and thus win the
battle), and because `include_guard(GLOBAL)` is used in
`CMakeCheckCompilerFlag.cmake` this file will not be re-included later.

It also prints a warning informing the user of the issue.

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

--- cmake/app/boilerplate.cmake
+++ cmake/app/boilerplate.cmake
@@ -70,6 +70,24 @@
 set(__build_dir ${CMAKE_CURRENT_BINARY_DIR}/zephyr)

 set(PROJECT_BINARY_DIR ${__build_dir})
+
+if(${CMAKE_VERSION} VERSION_EQUAL 3.19.0 OR
+   ${CMAKE_VERSION} VERSION_EQUAL 3.19.1)
+  message(WARNING "CMake 3.19.0/3.19.1 contains a bug regarding Toolchain/compiler "
+          "testing. Consider switching to a different CMake version.\n"
+          "See more here: \n"
+          "- https://github.com/zephyrproject-rtos/zephyr/issues/30232\n"
+          "- https://gitlab.kitware.com/cmake/cmake/-/issues/21497")
+  # This is a workaround for #30232.
+  # During Zephyr CMake invocation a plain C compiler is used for DTS.
+  # This results in the internal `CheckCompilerFlag.cmake` being included by CMake
+  # Later, when the full toolchain is configured, then `CMakeCheckCompilerFlag.cmake` is included.
+  # This overloads the `cmake_check_compiler_flag()` function, thus causing #30232.
+  # By manualy loading `CMakeCheckCompilerFlag.cmake` then `CheckCompilerFlag.cmake` will overload
+  # the functions (and thus win the battle), and because `include_guard(GLOBAL)` is used in
+  # `CMakeCheckCompilerFlag.cmake` this file will not be re-included later.
+  include(${CMAKE_ROOT}/Modules/Internal/CMakeCheckCompilerFlag.cmake)
+endif()

 message(STATUS "Application: ${APPLICATION_SOURCE_DIR}")


Move llvm util dependencies from clang-tools-extra to add_lit_target.

Summary:
Address fixme in r301762. And would simplify the cmake file in
clang-tools-extra.

Reviewers: sammccall

Subscribers: mgorny, llvm-commits, cfe-commits

Differential Revision: https://reviews.llvm.org/D52713

git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@343473 91177308-0d34-0410-b5e6-96231b3b80d8

--- cmake/modules/AddLLVM.cmake
+++ cmake/modules/AddLLVM.cmake
@@ -1367,6 +1367,17 @@
       COMMAND ${CMAKE_COMMAND} -E echo "${target} does nothing, no tools built.")
     message(STATUS "${target} does nothing.")
   endif()
+
+  # Add lit test dependencies.
+  set(llvm_utils_deps
+    FileCheck count not
+  )
+  foreach(dep ${llvm_utils_deps})
+    if (TARGET ${dep})
+      add_dependencies(${target} ${dep})
+    endif()
+  endforeach()
+
   if (ARG_DEPENDS)
     add_dependencies(${target} ${ARG_DEPENDS})
   endif()


cmake: Fix find_package_handle_standard_args warning

--- cmake/modules/FindXcb.cmake
+++ cmake/modules/FindXcb.cmake
@@ -26,6 +26,11 @@
     message(FATAL_ERROR "Unknow component \"${_comp}\" of XCB")
   endif()

+  # Bypass developer warning that the first argument to
+  # find_package_handle_standard_args (Xcb_...) does not match the name of the
+  # calling package (Xcb)
+  # https://cmake.org/cmake/help/v3.17/module/FindPackageHandleStandardArgs.html
+  set(FPHSA_NAME_MISMATCHED TRUE)
   find_package_impl(${XCB_${_comp}_pkg_config} "Xcb_${_comp}" "${XCB_${_comp}_header}")

   if(Xcb_${_comp}_FOUND AND NOT TARGET Xcb::${_comp})


Tweak format, add additional information about system-identification
variables.

svn path=/trunk/; revision=7004

--- cmake/modules/summary.cmake
+++ cmake/modules/summary.cmake
@@ -24,28 +24,33 @@
 Important CMake results:

 CMAKE_SYSTEM_NAME:	${CMAKE_SYSTEM_NAME}
+UNIX:			${UNIX}
+WIN32:			${WIN32}
+APPLE:			${APPLE}
+MINGW:			${MINGW}
+CYGWIN:			${CYGWIN}
+BORLAND:		${BORLAND}
+
 SWIG_FOUND:		${SWIG_FOUND}
 PERL_FOUND:		${PERL_FOUND}
 X11_FOUND:		${X11_FOUND}
+
 CMAKE_INSTALL_PREFIX:	${CMAKE_INSTALL_PREFIX}
 CMAKE_BUILD_TYPE:	${CMAKE_BUILD_TYPE}
-CMAKE_C_COMPILER CMAKE_C_FLAGS:			${CMAKE_C_COMPILER} ${CMAKE_C_FLAGS}
-")
+CMAKE_C_COMPILER CMAKE_C_FLAGS:			${CMAKE_C_COMPILER} ${CMAKE_C_FLAGS}")

 if(ENABLE_cxx)
 set(
 _output_results
 "${_output_results}
-CMAKE_CXX_COMPILER CMAKE_CXX_FLAGS:		${CMAKE_CXX_COMPILER} ${CMAKE_CXX_FLAGS}
-")
+CMAKE_CXX_COMPILER CMAKE_CXX_FLAGS:		${CMAKE_CXX_COMPILER} ${CMAKE_CXX_FLAGS}")
 endif(ENABLE_cxx)

 if(ENABLE_f77 OR ENABLE_f95)
 set(
 _output_results
 "${_output_results}
-CMAKE_Fortran_COMPILER CMAKE_Fortran_FLAGS:	${CMAKE_Fortran_COMPILER} ${CMAKE_Fortran_FLAGS}
-")
+CMAKE_Fortran_COMPILER CMAKE_Fortran_FLAGS:	${CMAKE_Fortran_COMPILER} ${CMAKE_Fortran_FLAGS}")
 endif(ENABLE_f77 OR ENABLE_f95)

 set(


STYLE: change test name

STYLE: change test name

--- Modules/MPI/MPITiffWriter/otb-module.cmake
+++ Modules/MPI/MPITiffWriter/otb-module.cmake
@@ -1,4 +1,4 @@
-set(DOCUMENTATION "This module contains MPI sources and mappers")
+set(DOCUMENTATION "This module contains MPI tiff writer")

 otb_module(OTBMPITiffWriter
   DEPENDS


cmake: fix manpage dependencies

cmake: fix manpage dependencies

fixes #289

--- CMake/Manpage.cmake
+++ CMake/Manpage.cmake
@@ -4,7 +4,7 @@

 function(add_manpage name section)
 	add_custom_command(
-		OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${name}.${section}
+		OUTPUT ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${name}.${section}
 		COMMAND ${A2X_COMMAND}
 				--no-xmllint
 				--doctype manpage
@@ -17,7 +17,7 @@

 	add_custom_target(man-${name}.${section}
 		DEPENDS
-			${CMAKE_CURRENT_BINARY_DIR}/${name}.${section}
+			${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${name}.${section}
 	)
 	add_dependencies(man
 		man-${name}.${section}


Version bump

Version bump

--- CMake/version.cmake
+++ CMake/version.cmake
@@ -1,3 +1,3 @@
 set (VV_VERSION_MAJOR 3)
 set (VV_VERSION_MINOR 0)
-set (VV_VERSION_PATCH 4)
+set (VV_VERSION_PATCH 5)


Enable warning for mismatched tags (i.e. struct vs. class).

--- build_settings.cmake
+++ build_settings.cmake
@@ -60,7 +60,7 @@
     endif()
   endif()
 else()
-  set(CXX_SPECIFIC_WARN_OPTS "-Wnoexcept -Wsuggest-override -Wnon-virtual-dtor -Wformat-security")
+  set(CXX_SPECIFIC_WARN_OPTS "-Wnoexcept -Wsuggest-override -Wnon-virtual-dtor -Wformat-security -Wmismatched-tags")
   set(VESPA_GCC_LIB "gcc")
   set(VESPA_STDCXX_FS_LIB "stdc++fs")
 endif()


Make TurboJpeg finding more informative

Make TurboJpeg finding more informative

--- LibFindMacros.cmake
+++ LibFindMacros.cmake
@@ -64,7 +64,7 @@
     # Print message and/or exit on fatal error
     if (${PREFIX}_FOUND)
       if (NOT ${PREFIX}_FIND_QUIETLY)
-        message (STATUS "Found ${PREFIX} ${${PREFIX}_VERSION}")
+        message (STATUS "Found ${PREFIX} ${${PREFIX}_VERSION} in ${${PREFIX}_INCLUDE_DIRS};${${PREFIX}_LIBRARIES}")
       endif (NOT ${PREFIX}_FIND_QUIETLY)
     else (${PREFIX}_FOUND)
       if (${PREFIX}_FIND_REQUIRED)


Use the compiler flag constructions from OpenFlipper

git-svn-id: b66b41e514ff40863ef1aa95df2dbf63dd8d6be1@605 fdac6126-5c0c-442c-9429-916003d36597

--- cmake/ACGCompiler.cmake
+++ cmake/ACGCompiler.cmake
@@ -1,6 +1,45 @@
 ################################################################################
 # Custom settings for compiler flags and similar
 ################################################################################
+
+if ( WIN32 )
+  ################################################################################
+  # Windows large memory support
+  ################################################################################
+  if ( NOT DEFINED WINDOWS_LARGE_MEMORY_SUPPORT )
+    set( WINDOWS_LARGE_MEMORY_SUPPORT true CACHE BOOL "Enable or disable binary support for large memory" )
+  endif()
+
+  set( ADDITIONAL_CMAKE_EXE_LINKER_FLAGS )
+  set( ADDITIONAL_CMAKE_SHARED_LINKER_FLAGS )
+  set( ADDITIONAL_CMAKE_MODULE_LINKER_FLAGS )
+
+  if ( WINDOWS_LARGE_MEMORY_SUPPORT )
+	list(APPEND ADDITIONAL_CMAKE_EXE_LINKER_FLAGS       "/LARGEADDRESSAWARE" )
+	list(APPEND ADDITIONAL_CMAKE_SHARED_LINKER_FLAGS    "/LARGEADDRESSAWARE" )
+	list(APPEND ADDITIONAL_CMAKE_MODULE_LINKER_FLAGS    "/LARGEADDRESSAWARE" )
+  endif()
+
+
+  foreach( flag ${ADDITIONAL_CMAKE_EXE_LINKER_FLAGS} )
+    if( NOT CMAKE_EXE_LINKER_FLAGS MATCHES "${flag}" )
+      set( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${flag} ")
+    endif()
+  endforeach()
+
+  foreach( flag ${ADDITIONAL_CMAKE_SHARED_LINKER_FLAGS} )
+    if( NOT CMAKE_SHARED_LINKER_FLAGS MATCHES "${flag}" )
+      set( CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${flag} ")
+    endif()
+  endforeach()
+
+  foreach( flag ${ADDITIONAL_CMAKE_MODULE_LINKER_FLAGS} )
+    if( NOT CMAKE_MODULE_LINKER_FLAGS MATCHES "${flag}" )
+      set( CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${flag} ")
+    endif()
+  endforeach()
+
+endif( WIN32 )

 if (UNIX)

@@ -57,22 +96,28 @@
   ################################################################################
   # Warnings
   ################################################################################
-
-  IF( NOT CMAKE_SYSTEM MATCHES "SunOS*")
-    list(APPEND ADDITIONAL_CXX_DEBUG_FLAGS          "-W" "-Wall" "-Wno-unused" )
-    list(APPEND ADDITIONAL_CXX_RELEASE_FLAGS        "-W" "-Wall" "-Wno-unused" )
-    list(APPEND ADDITIONAL_CXX_RELWITHDEBINFO_FLAGS "-W" "-Wall" "-Wno-unused" )
+
+  # Add the standard compiler warnings
+  if ( NOT COMPILER_WARNINGS )
+
+    IF ( APPLE  )
+      # Skip unused parameters as it has to be used for the documentation via doxygen and the interfaces
+      set ( COMPILER_WARNINGS "-W" "-Wall" "-Wno-unused" "-Wextra" "-Wno-non-virtual-dtor" "-Wno-unused-parameter" CACHE STRINGLIST "This list contains the warning flags used during compilation " )
+    ELSEIF ( CMAKE_SYSTEM MATCHES "SunOS*" )
+      set ( COMPILER_WARNINGS "" CACHE STRINGLIST "This list contains the warning flags used during compilation " )
+    ELSE ()
+      set ( COMPILER_WARNINGS "-W" "-Wall" "-Wno-unused" "-Wextra" CACHE STRINGLIST "This list contains the warning flags used during compilation " )
+    ENDIF()
+
+  endif ( NOT COMPILER_WARNINGS )
+
+  list(APPEND ADDITIONAL_CXX_DEBUG_FLAGS          ${COMPILER_WARNINGS} )
+  list(APPEND ADDITIONAL_CXX_RELEASE_FLAGS        ${COMPILER_WARNINGS} )
+  list(APPEND ADDITIONAL_CXX_RELWITHDEBINFO_FLAGS ${COMPILER_WARNINGS} )

-    list(APPEND ADDITIONAL_C_DEBUG_FLAGS            "-W" "-Wall" "-Wno-unused" )
-    list(APPEND ADDITIONAL_C_RELEASE_FLAGS          "-W" "-Wall" "-Wno-unused" )
-    list(APPEND ADDITIONAL_C_RELWITHDEBINFO_FLAGS   "-W" "-Wall" "-Wno-unused" )
-  ENDIF()
-
-  if (APPLE)
-    list(APPEND ADDITIONAL_CXX_DEBUG_FLAGS          "-Wno-non-virtual-dtor" )
-    list(APPEND ADDITIONAL_CXX_RELEASE_FLAGS        "-Wno-non-virtual-dtor" )
-    list(APPEND ADDITIONAL_CXX_RELWITHDEBINFO_FLAGS "-Wno-non-virtual-dtor" )
-  endif ()
+  list(APPEND ADDITIONAL_C_DEBUG_FLAGS            ${COMPILER_WARNINGS} )
+  list(APPEND ADDITIONAL_C_RELEASE_FLAGS          ${COMPILER_WARNINGS} )
+  list(APPEND ADDITIONAL_C_RELWITHDEBINFO_FLAGS   ${COMPILER_WARNINGS} )

   ################################################################################
   # STL Vector checks


Don't use "SOVERSION" with Android - Android doesn't support shared libraries not ending with ".so".

--HG--
branch : android

--- cmake/CEGUIMacros.cmake
+++ cmake/CEGUIMacros.cmake
@@ -250,7 +250,7 @@
     # Do not version modules, since we dlopen these directly and need to know
     # the name is what we think it will be (and not rely on symlinks which will
     # not be installed always, but usually only as part of *-dev packages).
-    if (NOT ${_IS_MODULE})
+    if (NOT ${_IS_MODULE} AND NOT ANDROID)
         if (NOT APPLE OR CEGUI_APPLE_DYLIB_SET_VERSION_INFO)
             set_target_properties(${_LIB_NAME} PROPERTIES
                 VERSION ${CEGUI_ABI_VERSION}


Fix the CMP0022 policy on CMake 2.8.12+

Fix the CMP0022 policy on CMake 2.8.12+

--HG--
branch : v0-8

--- cmake/CEGUIMacros.cmake
+++ cmake/CEGUIMacros.cmake
@@ -204,9 +204,16 @@
     set_target_properties(${_LIB_NAME} PROPERTIES DEFINE_SYMBOL ${_CEGUI_EXPORT_DEFINE})

     if (NOT CEGUI_BUILD_SHARED_LIBS_WITH_STATIC_DEPENDENCIES)
-        set_target_properties(${_LIB_NAME} PROPERTIES
-            LINK_INTERFACE_LIBRARIES ""
-        )
+        # Starting with CMake 2.8.12 LINK_INTERFACE_LIBRARIES was renamed to INTERFACE_LINK_LIBRARIES
+        if (${CMAKE_VERSION} VERSION_GREATER 2.8.12 OR ${CMAKE_VERSION} VERSION_EQUAL 2.8.12)
+            set_target_properties(${_LIB_NAME} PROPERTIES
+                INTERFACE_LINK_LIBRARIES ""
+            )
+        else()
+            set_target_properties(${_LIB_NAME} PROPERTIES
+                LINK_INTERFACE_LIBRARIES ""
+            )
+        endif()
     endif()

     if (APPLE)


Remove dependencies: chanman, kbd, gdi

Remove dependencies: chanman, kbd, gdi

--- cmake/FindFreeRDP.cmake
+++ cmake/FindFreeRDP.cmake
@@ -22,10 +22,7 @@
 endmacro()

 set(FREERDP_REQUIRED_LIBRARIES
-  freerdp
-  freerdpchanman
-  freerdpkbd
-  gdi)
+  freerdp)

 find_path(FREERDP_INCLUDE_DIR
           NAMES freerdp.h


Bump version to 1.2.1

Bump version to 1.2.1

Signed-off-by: Gopal, Puunithaaraj <10308ab826b56f8bbce1ec0c10bd609cace363da@intel.com>

--- cmake/ProjectInfo.cmake
+++ cmake/ProjectInfo.cmake
@@ -1,6 +1,6 @@
 set(GstMfx_VERSION_MAJOR   1)
 set(GstMfx_VERSION_MINOR   2)
-set(GstMfx_VERSION_PATCH   0)
+set(GstMfx_VERSION_PATCH   1)
 set(GstMfx_PACKAGE         "gstmfx")
 set(GstMfx_PACKAGE_NAME    "GStreamer Media SDK")
 set(GstMfx_PACKAGE_TARNAME "gstreamer-msdk")


enabled klocwork check again

enabled klocwork check again

--- common/cmake/test.cmake
+++ common/cmake/test.cmake
@@ -144,9 +144,9 @@
 # add klocwork test
 IF (EMBREE_TESTING_KLOCWORK)
   ADD_TEST(NAME Klocwork-Build WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND ${PROJECT_SOURCE_DIR}/scripts/klocwork_build.sh)
-#  ADD_TEST(NAME Klocwork-Check WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND ${PROJECT_SOURCE_DIR}/scripts/klocwork_check.sh)
+  ADD_TEST(NAME Klocwork-Check WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND ${PROJECT_SOURCE_DIR}/scripts/klocwork_check.sh)
   SET_TESTS_PROPERTIES(Klocwork-Build PROPERTIES TIMEOUT 2400)
-#  SET_TESTS_PROPERTIES(Klocwork-Check PROPERTIES TIMEOUT 300)
+  SET_TESTS_PROPERTIES(Klocwork-Check PROPERTIES TIMEOUT 300)
 ENDIF()

 # add valgrind test


STY: remove debug trace

STY: remove debug trace

--- CMake/FindOpenCV.cmake
+++ CMake/FindOpenCV.cmake
@@ -104,7 +104,7 @@

 if(NOT OPENCV_SEARCH_PATH)
   get_filename_component(OPENCV_SEARCH_PATH "${opencv_INCLUDE_DIR}" PATH)
-  # include dir is include/opencv4 in v4
+  # include dir is include/opencv4 in v4 UNIX
   if(UNIX AND OpenCV_VERSION_MAJOR EQUAL 4)
     get_filename_component(OPENCV_SEARCH_PATH "${OPENCV_SEARCH_PATH}" PATH)
   endif()
@@ -136,8 +136,6 @@
   set(OpenCV_FOUND TRUE)
   set(OPENCV_VERSION ${OpenCV_VERSION}) #for compatility
 endif()
-message("OpenCV_VERSION")
-message("${OpenCV_VERSION} ${OPENCV_ml_LIBRARY} ${OPENCV_core_LIBRARY} ${opencv_INCLUDE_DIR} ${OPENCV_SEARCH_PATH}")

 include(${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake)
 find_package_handle_standard_args(OpenCV


Wrap python defines.

Wrap python defines.

--- Superbuild/UseBoost.cmake
+++ Superbuild/UseBoost.cmake
@@ -1,7 +1,15 @@

 include_directories(${SCI_BOOST_INCLUDE})
 link_directories(${SCI_BOOST_LIBRARY_DIR})
-add_definitions(-DBOOST_ALL_NO_LIB -DBOOST_PYTHON_STATIC_LIB -DBOOST_PYTHON_STATIC_MODULE)
+add_definitions(-DBOOST_ALL_NO_LIB)
+if(BUILD_WITH_PYTHON)
+  add_definitions(-DBOOST_PYTHON_STATIC_LIB -DBOOST_PYTHON_STATIC_MODULE)
+endif()
+
+if(UNIX)
+  add_definitions(-DBOOST_NO_CXX11_ALLOCATOR)
+endif()
+

 # TODO: if static runtime link is supported, then ABI tag postfix must include s
 # see:


Tag needs to be in "tag" variable otherwise not picked up by update macro

--- cmake/externals/projects_modules/VTK.cmake
+++ cmake/externals/projects_modules/VTK.cmake
@@ -52,7 +52,7 @@
 if (NOT DEFINED ${ep}_SOURCE_DIR)
     set(location GIT_REPOSITORY "git://vtk.org/VTK.git")
     # Set GIT_TAG to latest commit of origin/release-5.10 known to work
-    set(branch GIT_TAG d3b66526624ba8e55addcddb0ec28c40982473ac)
+    set(tag GIT_TAG d3b66526624ba8e55addcddb0ec28c40982473ac)
 endif()

@@ -109,7 +109,7 @@
 ExternalProject_Add(${ep}
   ${ep_dirs}
   ${location}
-  ${branch}
+  ${tag}
   UPDATE_COMMAND ""
   ${VTK_PATCH_COMMAND}
   CMAKE_GENERATOR ${gen}


[cmake] Remove support for invoking llvm-config.

I already removed the one invocation of llvm-config. This code is just dead.

rdar://26154980

--- cmake/modules/SwiftSharedCMakeConfig.cmake
+++ cmake/modules/SwiftSharedCMakeConfig.cmake
@@ -11,93 +11,6 @@
 else()
   set(cmake_3_2_USES_TERMINAL USES_TERMINAL)
 endif()
-
-# Invokes llvm_config to get various configuration information needed to compile
-# programs which use llvm.
-#
-# Optional output parameters:
-#   [ENABLE_ASSERTIONS enableAssertions]
-#     If assertions are enabled.
-#
-#   [TOOLS_BINARY_DIR toolsBinaryDir]
-#     Path to llvm tools bin directory.
-#
-#   [LIBRARY_DIR toolsLibDir]
-#     Path to llvm tools lib directory.
-#
-#   [INCLUDE_DIR includeDir]
-#     Path to llvm include directory.
-#
-#   [OBJ_ROOT_DIR objRootDir]
-#     Path to llvm build tree.
-#
-#   [SOURCE_DIR srcDir]
-#     Path to llvm source tree.
-function(_swift_llvm_config_info)
-  # Parse the arguments we were given.
-  set(onevalueargs ENABLE_ASSERTIONS TOOLS_BINARY_DIR LIBRARY_DIR INCLUDE_DIR OBJ_ROOT_DIR SOURCE_DIR)
-  cmake_parse_arguments(
-    SWIFTLLVM
-    "" # options
-    "${onevalueargs}"
-    "" # multi-value args
-    ${ARGN})
-
-  find_program(LLVM_CONFIG "llvm-config")
-  if(NOT LLVM_CONFIG)
-    message(FATAL_ERROR "llvm-config not found -- ${LLVM_CONFIG}")
-  endif()
-
-  set(CONFIG_OUTPUT)
-  message(STATUS "Found LLVM_CONFIG as ${LLVM_CONFIG}")
-  set(CONFIG_COMMAND ${LLVM_CONFIG}
-      "--assertion-mode"
-      "--bindir"
-      "--libdir"
-      "--includedir"
-      "--prefix"
-      "--src-root")
-  execute_process(
-    COMMAND ${CONFIG_COMMAND}
-    RESULT_VARIABLE HAD_ERROR
-    OUTPUT_VARIABLE CONFIG_OUTPUT
-    )
-  if(NOT HAD_ERROR)
-    string(REGEX REPLACE
-    "[ \t]*[\r\n]+[ \t]*" ";"
-    CONFIG_OUTPUT ${CONFIG_OUTPUT})
-  else()
-    string(REPLACE ";" " " CONFIG_COMMAND_STR "${CONFIG_COMMAND}")
-    message(STATUS "${CONFIG_COMMAND_STR}")
-    message(FATAL_ERROR "llvm-config failed with status ${HAD_ERROR}")
-  endif()
-
-  list(GET CONFIG_OUTPUT 0 ENABLE_ASSERTIONS)
-  list(GET CONFIG_OUTPUT 1 TOOLS_BINARY_DIR)
-  list(GET CONFIG_OUTPUT 2 LIBRARY_DIR)
-  list(GET CONFIG_OUTPUT 3 INCLUDE_DIR)
-  list(GET CONFIG_OUTPUT 4 LLVM_OBJ_ROOT)
-  list(GET CONFIG_OUTPUT 5 MAIN_SRC_DIR)
-
-  if(SWIFTLLVM_ENABLE_ASSERTIONS)
-    set("${SWIFTLLVM_ENABLE_ASSERTIONS}" "${ENABLE_ASSERTIONS}" PARENT_SCOPE)
-  endif()
-  if(SWIFTLLVM_TOOLS_BINARY_DIR)
-    set("${SWIFTLLVM_TOOLS_BINARY_DIR}" "${TOOLS_BINARY_DIR}" PARENT_SCOPE)
-  endif()
-  if(SWIFTLLVM_LIBRARY_DIR)
-    set("${SWIFTLLVM_LIBRARY_DIR}" "${LIBRARY_DIR}" PARENT_SCOPE)
-  endif()
-  if(SWIFTLLVM_INCLUDE_DIR)
-    set("${SWIFTLLVM_INCLUDE_DIR}" "${INCLUDE_DIR}" PARENT_SCOPE)
-  endif()
-  if(SWIFTLLVM_OBJ_ROOT_DIR)
-    set("${SWIFTLLVM_OBJ_ROOT_DIR}" "${LLVM_OBJ_ROOT}" PARENT_SCOPE)
-  endif()
-  if(SWIFTLLVM_SOURCE_DIR)
-    set("${SWIFTLLVM_SOURCE_DIR}" "${MAIN_SRC_DIR}" PARENT_SCOPE)
-  endif()
-endfunction()

 # Common cmake project config for standalone builds.
 #


CSharp: Install *CSharp.dll files to sdk.

--- CMake/Modules/UrhoCommon.cmake
+++ CMake/Modules/UrhoCommon.cmake
@@ -462,7 +462,9 @@
     endif ()
     if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${BIND_MANAGED_TARGET}.csproj")
         add_target_csharp(${BIND_MANAGED_TARGET} ${CMAKE_CURRENT_SOURCE_DIR}/${BIND_MANAGED_TARGET}.csproj ${CSHARP_LIBRARY_NAME})
-        install (FILES ${NET_OUTPUT_DIRECTORY}/${BIND_MANAGED_TARGET}.dll DESTINATION ${DEST_LIBRARY_DIR})
+        install (FILES ${NET_OUTPUT_DIRECTORY}/${BIND_MANAGED_TARGET}.dll $<TARGET_FILE:${CSHARP_LIBRARY_NAME}>
+            DESTINATION ${DEST_LIBRARY_DIR}
+        )
     endif ()

     file (GLOB_RECURSE EXTRA_NATIVE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/Native/*.h ${CMAKE_CURRENT_SOURCE_DIR}/Native/*.cpp)


CMake: A bit of flexibility for create_pak().

--- CMake/Modules/UrhoCommon.cmake
+++ CMake/Modules/UrhoCommon.cmake
@@ -522,11 +522,24 @@
     target_sources(${CSHARP_LIBRARY_NAME} PRIVATE ${EXTRA_NATIVE_FILES})
 endmacro ()

-function (create_pak SOURCE_DIR OUTPUT_FILE)
-    get_filename_component(NAME "${OUTPUT_FILE}" NAME)
+function (create_pak PAK_DIR PAK_FILE)
+    cmake_parse_arguments(PARSE_ARGV 2 PAK "NO_COMPRESS" "" "DEPENDS")
+
+    get_filename_component(NAME "${PAK_FILE}" NAME)
+    if (CMAKE_CROSSCOMPILING)
+        set (DEPENDENCY Urho3D-Native)
+    else ()
+        set (DEPENDENCY PackageTool)
+    endif ()
+
+    if (NOT PAK_NO_COMPRESS)
+        set (PAK_FLAGS "${PAK_FLAGS} -c")
+    endif ()
+
     add_custom_command(
-        OUTPUT "${OUTPUT_FILE}"
-        COMMAND "${PACKAGE_TOOL}" "${SOURCE_DIR}" "${OUTPUT_FILE}" -q -c
+        OUTPUT "${PAK_FILE}"
+        COMMAND "${PACKAGE_TOOL}" "${PAK_DIR}" "${PAK_FILE}" -q ${PAK_FLAGS}
+        DEPENDS ${DEPENDENCY} ${PAK_DEPENDS}
         COMMENT "Packaging ${NAME}"
     )
 endfunction ()


Reverted change in build configuration file that broke it.

--- CMake/TBTKConfigTemplate.cmake
+++ CMake/TBTKConfigTemplate.cmake
@@ -113,7 +113,6 @@
 #	SET(TBTK_LIBRARIES "${TBTK_LIBRARIES} ${wxWidgets_LIBRARIES}")
 	LIST(APPEND TBTK_LIBRARIES ${wxWidgets_LIBRARIES})
 	LINK_DIRECTORIES(${wxWidgets_LIBRARY_DIRS})
-	ADD_DEFINITIONS(${wxWidgets_DEFINITIONS})
 ELSE(wxWidgets_FOUND)
 	MESSAGE("[ ] wxWidgets")
 ENDIF(wxWidgets_FOUND)


make msg-gen-only target work

make msg-gen-only target work

--HG--
extra : convert_revision : svn%3Aeb33c2ac-9c88-4c90-87e0-44a10359b0c3/stacks/driver_common/trunk%4036540

--- dynamic_reconfigure/cmake/rosbuild2.cmake
+++ dynamic_reconfigure/cmake/rosbuild2.cmake
@@ -51,7 +51,7 @@
       COMMENT "Generating dynamic reconfigure stuff from ${_cfg}: ${_output_cpp} ${_output_py}"
       )

-    list(APPEND ${PROJECT_NAME}_generated
+    list(APPEND ${PROJECT_NAME}_generated_cpp
       ${_output_cpp} ${_output_py}
       )


Also link with boost::iostreams.

Also link with boost::iostreams.

git-svn-id: 31d9d2f6432a47c86a3640814024c107794ea77c@32067 0785d39b-7218-0410-832d-ea1e28bc413d

--- deal.II/cmake/configure/configure_boost.cmake
+++ deal.II/cmake/configure/configure_boost.cmake
@@ -48,9 +48,9 @@
   ENDIF()

   IF(DEAL_II_WITH_THREADS)
-    SET(_boost_components serialization system thread)
+    SET(_boost_components iostreams serialization system thread)
   ELSE()
-    SET(_boost_components serialization system)
+    SET(_boost_components iostreams serialization system)
   ENDIF()

   #


Replace obsolete Copyright: by License: (Sylvain)

--- cmake/ALICE_CMake.cmake
+++ cmake/ALICE_CMake.cmake
@@ -527,7 +527,7 @@
     set(CPACK_RPM_PACKAGE_NAME "alimdc")
     set(CPACK_RPM_PACKAGE_VERSION "${ALIMDCVERSION}")
     set(CPACK_RPM_PACKAGE_RELEASE "${ALIMDCRELEASE}")
-    set(CPACK_RPM_PACKAGE_LICENSE "Copyright: CERN ALICE Off-line Group")
+    set(CPACK_RPM_PACKAGE_LICENSE "License: CERN ALICE Off-line Group")
     set(CPACK_RPM_PACKAGE_VENDOR "ALICE Core Off-line Group")
     set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "AliMDC static libraries")
     set(CPACK_RPM_PACKAGE_GROUP "Applications/Alice")


Fix FindOpenEXR cmake script. Fixes issue 97.

--- cmake/FindOpenEXR.cmake
+++ cmake/FindOpenEXR.cmake
@@ -53,11 +53,7 @@
 IF (OPENEXR_INCLUDE_PATH AND OPENEXR_IMATH_LIBRARY AND OPENEXR_ILMIMF_LIBRARY AND OPENEXR_IEX_LIBRARY AND OPENEXR_HALF_LIBRARY)
 	SET(OPENEXR_FOUND TRUE)
 	SET(OPENEXR_INCLUDE_PATHS ${OPENEXR_INCLUDE_PATH} CACHE STRING "The include paths needed to use OpenEXR")
-	SET(OPENEXR_LIBRARIES ${OPENEXR_IMATH_LIBRARY} ${OPENEXR_ILMIMF_LIBRARY} ${OPENEXR_IEX_LIBRARY} ${OPENEXR_HALF_LIBRARY} ${ZLIB_LIBRARY} CACHE STRING "The libraries needed to use OpenEXR")
-
-	IF(OPENEXR_ILMTHREAD_LIBRARY)
-		SET(OPENEXR_LIBRARIES ${OPENEXR_LIBRARIES} ${OPENEXR_ILMTHREAD_LIBRARY})
-	ENDIF(OPENEXR_ILMTHREAD_LIBRARY)
+	SET(OPENEXR_LIBRARIES ${OPENEXR_IMATH_LIBRARY} ${OPENEXR_ILMIMF_LIBRARY} ${OPENEXR_IEX_LIBRARY} ${OPENEXR_HALF_LIBRARY} ${OPENEXR_ILMTHREAD_LIBRARY} ${ZLIB_LIBRARY} CACHE STRING "The libraries needed to use OpenEXR")
 ENDIF (OPENEXR_INCLUDE_PATH AND OPENEXR_IMATH_LIBRARY AND OPENEXR_ILMIMF_LIBRARY AND OPENEXR_IEX_LIBRARY AND OPENEXR_HALF_LIBRARY)

 IF(OPENEXR_FOUND)


Make CMake logic consistent with improved visibility logic for libharu.

svn path=/trunk/; revision=12400

--- cmake/modules/pdf.cmake
+++ cmake/modules/pdf.cmake
@@ -32,11 +32,13 @@
   find_package(hpdf)
   if(hpdf_FOUND)
     message(STATUS "Looking for haru pdf header and library - found")
-    if(WIN32)
+    if(WIN32 AND NOT CMAKE_COMPILER_IS_GNUCC)
       set(pdf_COMPILE_FLAGS "-I${hpdf_INCLUDE_DIRS} -DHPDF_DLL")
-    else(WIN32)
+    elseif(WIN32 AND CMAKE_COMPILER_IS_GNUCC)
+      set(pdf_COMPILE_FLAGS "-I${hpdf_INCLUDE_DIRS} -DHPDF_DLL_CDECL")
+    else(WIN32 AND NOT CMAKE_COMPILER_IS_GNUCC)
       set(pdf_COMPILE_FLAGS "-I${hpdf_INCLUDE_DIRS}")
-    endif(WIN32)
+    endif(WIN32 AND NOT CMAKE_COMPILER_IS_GNUCC)
     set(pdf_LINK_FLAGS "${hpdf_LIBRARIES}")
     set(pdf_RPATH ${hpdf_LIBRARY_DIRS})
     filter_rpath(pdf_RPATH)


On Linux, install the SVBony SDK libSVBCameraSDK.so to /usr/lib/phd2/. This is required because PHD2 is statically linked with this library. Fix #1010 (#1011)

--- thirdparty/thirdparty.cmake
+++ thirdparty/thirdparty.cmake
@@ -1421,6 +1421,7 @@
       message(STATUS "Found SVBCameraSDK lib ${SVBCameraSDK}")
       add_definitions(-DHAVE_SVB_CAMERA=1)
       set(PHD_LINK_EXTERNAL ${PHD_LINK_EXTERNAL} ${SVBCameraSDK})
+      set(PHD_INSTALL_LIBS ${PHD_INSTALL_LIBS} ${SVBCameraSDK})

       if(IS_DIRECTORY ${PHD_PROJECT_ROOT_DIR}/cameras/qhyccdlibs/linux/${qhyarch})
         add_definitions(-DHAVE_QHY_CAMERA=1)


CMake: build DLLs in the right directory and include them in the 'install' target (PR21719)

When CMake builds a dynamic library on Windows, the .dll file's location is
determined by the RUNTIME_OUTPUT_DIRECTORY, which we were previously not
setting.

This means for example that clang_rt.asan_dynamic-i386.dll will get built
and installed in the same directory as the corresponding .lib file,
instead of being built in the bin/ directory and not installed at all.

Differential Revision: http://reviews.llvm.org/D6508

git-svn-id: c199f293c43da69278bea8e88f92242bf3aa95f7@223387 91177308-0d34-0410-b5e6-96231b3b80d8

--- cmake/Modules/AddCompilerRT.cmake
+++ cmake/Modules/AddCompilerRT.cmake
@@ -59,7 +59,8 @@
     # Setup correct output directory in the build tree.
     set_target_properties(${name} PROPERTIES
       ARCHIVE_OUTPUT_DIRECTORY ${COMPILER_RT_LIBRARY_OUTPUT_DIR}
-      LIBRARY_OUTPUT_DIRECTORY ${COMPILER_RT_LIBRARY_OUTPUT_DIR})
+      LIBRARY_OUTPUT_DIRECTORY ${COMPILER_RT_LIBRARY_OUTPUT_DIR}
+      RUNTIME_OUTPUT_DIRECTORY ${COMPILER_RT_LIBRARY_OUTPUT_DIR})
     if ("${LIB_OUTPUT_NAME}" STREQUAL "")
       set_target_properties(${name} PROPERTIES
         OUTPUT_NAME ${name}${COMPILER_RT_OS_SUFFIX})
@@ -70,7 +71,8 @@
     # Add installation command.
     install(TARGETS ${name}
       ARCHIVE DESTINATION ${COMPILER_RT_LIBRARY_INSTALL_DIR}
-      LIBRARY DESTINATION ${COMPILER_RT_LIBRARY_INSTALL_DIR})
+      LIBRARY DESTINATION ${COMPILER_RT_LIBRARY_INSTALL_DIR}
+      RUNTIME DESTINATION ${COMPILER_RT_LIBRARY_INSTALL_DIR})
   else()
     message(FATAL_ERROR "Archtecture ${arch} can't be targeted")
   endif()


CELIX-335: Move deploy timestamp file to CMAKE_CURRENT_BINARY_DIR. Update run.sh to reuse existing (DY)LD_LIBRARY_PATH

--- cmake/cmake_celix/Packaging.cmake
+++ cmake/cmake_celix/Packaging.cmake
@@ -464,13 +464,15 @@

     ###### Setup deploy custom target and config.properties file
+    set(TIMESTAMP_FILE "${CMAKE_CURRENT_BINARY_DIR}/${DEPLOY_TARGET}-timestamp")
+
     add_custom_target(${DEPLOY_TARGET}
-        DEPENDS  "${DEPLOY_LOCATION}/timestamp"
+        DEPENDS ${TIMESTAMP_FILE}
     )
     add_dependencies(deploy ${DEPLOY_TARGET})

-    add_custom_command(OUTPUT ${DEPLOY_LOCATION}/timestamp
-        COMMAND ${CMAKE_COMMAND} -E touch ${DEPLOY_LOCATION}/timestamp
+    add_custom_command(OUTPUT "${TIMESTAMP_FILE}"
+        COMMAND ${CMAKE_COMMAND} -E touch ${TIMESTAMP_FILE}
         DEPENDS  "$<TARGET_PROPERTY:${DEPLOY_TARGET},DEPLOY_TARGET_DEPS>" "${DEPLOY_LOCATION}/config.properties" "${DEPLOY_LOCATION}/run.sh"
         WORKING_DIRECTORY "${DEPLOY_LOCATION}"
         COMMENT "Deploying ${DEPLOY_PRINT_NAME}" VERBATIM
@@ -501,14 +503,14 @@
     if(APPLE)
         file(GENERATE
             OUTPUT ${DEPLOY_LOCATION}/run.sh
-            CONTENT "export DYLD_LIBRARY_PATH=$<TARGET_FILE_DIR:celix_framework>:$<TARGET_FILE_DIR:celix_utils>:$<TARGET_FILE_DIR:celix_dfi>
+            CONTENT "export DYLD_LIBRARY_PATH=$<TARGET_FILE_DIR:celix_framework>:$<TARGET_FILE_DIR:celix_utils>:$<TARGET_FILE_DIR:celix_dfi>:\${DYLD_LIBRARY_PATH}
 $<TARGET_FILE:celix> $@
 "
     )
     else()
         file(GENERATE
             OUTPUT ${DEPLOY_LOCATION}/run.sh
-            CONTENT "export LD_LIBRARY_PATH=$<TARGET_FILE_DIR:celix_framework>:$<TARGET_FILE_DIR:celix_utils>:$<TARGET_FILE_DIR:celix_dfi>
+            CONTENT "export LD_LIBRARY_PATH=$<TARGET_FILE_DIR:celix_framework>:$<TARGET_FILE_DIR:celix_utils>:$<TARGET_FILE_DIR:celix_dfi>:\${LD_LIBRARY_PATH}
 $<TARGET_FILE:celix> $@
 "
     )


- add the ability to specify the directory where cmake finds the subversion libraries and headers - switch to build against subversion libraries with apache 2.2 bindings.

--- cmakemodules/FindSubversion.cmake
+++ cmakemodules/FindSubversion.cmake
@@ -95,107 +95,133 @@

   # search for pathes
   FIND_PATH (SUBVERSION_BIN_DIR svn.exe
+    "$ENV{SubversionDir}/bin"
     "$ENV{ProgramFiles}/Subversion/bin"
   )

   FIND_PATH (SUBVERSION_INCLUDE_DIR svn_client.h
+    "$ENV{SubversionDir}/include"
     "$ENV{ProgramFiles}/Subversion/include"
   )

   FIND_PATH(APR_INCLUDE_DIR apr.h
+    "$ENV{SubversionDir}/include/apr"
     "$ENV{ProgramFiles}/Subversion/include/apr"
   )

   FIND_PATH(APU_INCLUDE_DIR apu.h
+    "$ENV{SubversionDir}/include/apr-util"
     "$ENV{ProgramFiles}/Subversion/include/apr-util"
   )

   # search for libraries
-  FIND_LIBRARY(APR_LIB libapr
+  FIND_LIBRARY(APR_LIB libapr-1
+    "$ENV{SubversionDir}/lib/apr"
     "$ENV{ProgramFiles}/Subversion/lib/apr"
   )

-  FIND_LIBRARY(APRICONV_LIB libapriconv
+  FIND_LIBRARY(APRICONV_LIB libapriconv-1
+    "$ENV{SubversionDir}/lib/apr-iconv"
     "$ENV{ProgramFiles}/Subversion/lib/apr-iconv"
   )

-  FIND_LIBRARY(APU_LIB libaprutil
+  FIND_LIBRARY(APU_LIB libaprutil-1
+    "$ENV{SubversionDir}/lib/apr-util"
     "$ENV{ProgramFiles}/Subversion/lib/apr-util"
   )

   FIND_LIBRARY(APU_XMLLIB xml
+    "$ENV{SubversionDir}/lib/apr-util"
     "$ENV{ProgramFiles}/Subversion/lib/apr-util"
   )

   FIND_LIBRARY(NEON_LIB libneon
+    "$ENV{SubversionDir}/lib/neon"
     "$ENV{ProgramFiles}/Subversion/lib/neon"
   )

   FIND_LIBRARY(NEON_ZLIBSTATLIB zlibstat
+    "$ENV{SubversionDir}/lib/neon"
     "$ENV{ProgramFiles}/Subversion/lib/neon"
   )

   FIND_LIBRARY(INTL3LIB intl3_svn
+    "$ENV{SubversionDir}/lib"
     "$ENV{ProgramFiles}/Subversion/lib"
   )

   FIND_LIBRARY(DB44_LIB libdb44
+    "$ENV{SubversionDir}/lib"
     "$ENV{ProgramFiles}/Subversion/lib"
   )

   FIND_LIBRARY(SUBVERSION_CLIENTLIB libsvn_client-1
+    "$ENV{SubversionDir}/lib"
     "$ENV{ProgramFiles}/Subversion/lib"
   )

   FIND_LIBRARY(SUBVERSION_DELTALIB libsvn_delta-1
+    "$ENV{SubversionDir}/lib"
     "$ENV{ProgramFiles}/Subversion/lib"
   )

   FIND_LIBRARY(SUBVERSION_DIFFLIB libsvn_diff-1
+    "$ENV{SubversionDir}/lib"
     "$ENV{ProgramFiles}/Subversion/lib"
   )

   FIND_LIBRARY(SUBVERSION_FSBASELIB libsvn_fs_base-1
+    "$ENV{SubversionDir}/lib"
     "$ENV{ProgramFiles}/Subversion/lib"
   )

   FIND_LIBRARY(SUBVERSION_FSFSLIB libsvn_fs_fs-1
+    "$ENV{SubversionDir}/lib"
     "$ENV{ProgramFiles}/Subversion/lib"
   )

   FIND_LIBRARY(SUBVERSION_FSUTILLIB libsvn_fs_util-1
+    "$ENV{SubversionDir}/lib"
     "$ENV{ProgramFiles}/Subversion/lib"
   )

   FIND_LIBRARY(SUBVERSION_FSLIB libsvn_fs-1
+    "$ENV{SubversionDir}/lib"
     "$ENV{ProgramFiles}/Subversion/lib"
   )

   FIND_LIBRARY(SUBVERSION_RALOCALLIB libsvn_ra_local-1
+    "$ENV{SubversionDir}/lib"
     "$ENV{ProgramFiles}/Subversion/lib"
   )

   FIND_LIBRARY(SUBVERSION_RANEONLIB libsvn_ra_neon-1
+    "$ENV{SubversionDir}/lib"
     "$ENV{ProgramFiles}/Subversion/lib"
   )

   FIND_LIBRARY(SUBVERSION_RASVNLIB libsvn_ra_svn-1
+    "$ENV{SubversionDir}/lib"
     "$ENV{ProgramFiles}/Subversion/lib"
   )

   FIND_LIBRARY(SUBVERSION_RALIB libsvn_ra-1
+    "$ENV{SubversionDir}/lib"
     "$ENV{ProgramFiles}/Subversion/lib"
   )

   FIND_LIBRARY(SUBVERSION_REPOSITORYLIB libsvn_repos-1
+    "$ENV{SubversionDir}/lib"
     "$ENV{ProgramFiles}/Subversion/lib"
   )

   FIND_LIBRARY(SUBVERSION_SUBRLIB libsvn_subr-1
+    "$ENV{SubversionDir}/lib"
     "$ENV{ProgramFiles}/Subversion/lib"
   )

   FIND_LIBRARY(SUBVERSION_WCLIB libsvn_wc-1
+    "$ENV{SubversionDir}/lib"
     "$ENV{ProgramFiles}/Subversion/lib"
   )


temporarily turned off PCH support for GCC 4.1, since it causes "undefined main" error

--- OpenCVPCHSupport.cmake
+++ OpenCVPCHSupport.cmake
@@ -19,23 +19,23 @@
         ARGS 	${CMAKE_CXX_COMPILER_ARG1} -dumpversion
         OUTPUT_VARIABLE gcc_compiler_version)
     #MESSAGE("GCC Version: ${gcc_compiler_version}")
-    IF(gcc_compiler_version MATCHES "4\\.[0-9]\\.[0-9]")
+    IF(gcc_compiler_version MATCHES "4\\.[0,2-9]\\.[0-9]")
         SET(PCHSupport_FOUND TRUE)
-    ELSE(gcc_compiler_version MATCHES "4\\.[0-9]\\.[0-9]")
+    ELSE()
         IF(gcc_compiler_version MATCHES "3\\.4\\.[0-9]")
             SET(PCHSupport_FOUND TRUE)
-        ENDIF(gcc_compiler_version MATCHES "3\\.4\\.[0-9]")
-    ENDIF(gcc_compiler_version MATCHES "4\\.[0-9]\\.[0-9]")
+        ENDIF()
+    ENDIF()

 	SET(_PCH_include_prefix "-I")

-ELSE(CMAKE_COMPILER_IS_GNUCXX)
+ELSE()
 	IF(WIN32)
 		SET(PCHSupport_FOUND TRUE) # for experimental msvc support
 		SET(_PCH_include_prefix "/I")
-	ELSE(WIN32)
+	ELSE()
 		SET(PCHSupport_FOUND FALSE)
-	ENDIF(WIN32)
+	ENDIF()
 ENDIF(CMAKE_COMPILER_IS_GNUCXX)

@@ -52,9 +52,9 @@
     	LIST(APPEND ${_out_compile_flags} "${${_out_compile_flags}} -fPIC")
     ENDIF()

-  ELSE(CMAKE_COMPILER_IS_GNUCXX)
+  ELSE()
     ## TODO ... ? or does it work out of the box
-  ENDIF(CMAKE_COMPILER_IS_GNUCXX)
+  ENDIF()

   GET_DIRECTORY_PROPERTY(DIRINC INCLUDE_DIRECTORIES )
   FOREACH(item ${DIRINC})


changed file attributes

changed file attributes


Enable C++11 and later warnings based on CMAKE_CXX_STANDARD too.

--- cmake/Modules/CppUTestWarningFlags.cmake
+++ cmake/Modules/CppUTestWarningFlags.cmake
@@ -63,7 +63,7 @@
         Wno-old-style-cast
         )

-    if (C++11)
+    if (C++11 OR (DEFINED CMAKE_CXX_STANDARD AND NOT CMAKE_CXX_STANDARD EQUAL 98))
         set(WARNING_CXX_FLAGS
            ${WARNING_CXX_FLAGS}
            Wno-c++98-compat
@@ -71,7 +71,7 @@
            Wno-c++14-compat
            Wno-inconsistent-missing-destructor-override
            )
-    endif (C++11)
+    endif ()

     check_and_append_c_warning_flags(${WARNING_C_FLAGS})
     check_and_append_c_warning_flags(${WARNING_C_ONLY_FLAGS})


fix the path for documentation

fix the path for documentation

--- Doxyfile.cmake
+++ Doxyfile.cmake
@@ -171,7 +171,7 @@
 # specify the list of include paths that are normally passed to the compiler
 # using the -I flag.

-STRIP_FROM_INC_PATH    = @CMAKE_SOURCE_DIR@/template
+STRIP_FROM_INC_PATH    = @CMAKE_SOURCE_DIR@

 # If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but
 # less readable) file names. This can be useful is your file systems doesn't
@@ -763,7 +763,7 @@
 # spaces.
 # Note: If this tag is empty the current directory is searched.

-INPUT                  = @CMAKE_SOURCE_DIR@/template/game
+INPUT                  = @CMAKE_SOURCE_DIR@/game

 # This tag can be used to specify the character encoding of the source files
 # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses


Implement QUIET for FindOFED

Implement QUIET for FindOFED

--- FindOFED.cmake
+++ FindOFED.cmake
@@ -11,13 +11,13 @@
   PATHS /usr/lib /usr/local/lib /opt/local/lib)

 include(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(OFED DEFAULT_MSG
+find_package_handle_standard_args(OFED DEFAULT_MSG
   _ofed_INCLUDE_DIR _rdma_LIBRARY _ibverbs_LIBRARY)

 set(OFED_INCLUDE_DIRS ${_ofed_INCLUDE_DIR})
 set(OFED_LIBRARIES ${_rdma_LIBRARY})
 list(APPEND OFED_LIBRARIES ${_ibverbs_LIBRARY})

-if(OFED_FOUND)
+if(OFED_FOUND AND NOT OFED_FIND_QUIETLY)
   message(STATUS "Found OFED in ${OFED_INCLUDE_DIRS};${OFED_LIBRARIES}")
 endif()


Add "fix try_compile" variables back

Add "fix try_compile" variables back

--- ios-10-0-arm64-dep-8-0-hid-sections.cmake
+++ ios-10-0-arm64-dep-8-0-hid-sections.cmake
@@ -27,6 +27,11 @@

 include(polly_fatal_error)

+# Fix try_compile
+set(MACOSX_BUNDLE_GUI_IDENTIFIER com.example)
+set(CMAKE_MACOSX_BUNDLE YES)
+set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "iPhone Developer")
+
 set(IPHONEOS_ARCHS arm64)
 set(IPHONESIMULATOR_ARCHS "")


Fix build breakage. Trouble was due to CMake 2.6 usage which not available in CMake 2.4.x

--- make/FindONCRPC.cmake
+++ make/FindONCRPC.cmake
@@ -113,10 +113,10 @@
    ${RPC_GENERATED_FILE_PREFIX}.h)

  #inhibit compiler warning for generated files
- IF (CMAKE_COMPILER_IS_GNUCC)
-     SET_SOURCE_FILES_PROPERTIES(${${RPC_PREFIX}_RPCGEN_OUTPUT_CLNT}
+ IF (CMAKE_COMPILER_IS_GNUCC AND CMAKE_MINOR_VERSION GREATER 5)
+    SET_SOURCE_FILES_PROPERTIES(${${RPC_PREFIX}_RPCGEN_OUTPUT_CLNT}
 	                            PROPERTIES COMPILE_FLAGS "-w")
- ENDIF(CMAKE_COMPILER_IS_GNUCC)
+ ENDIF(CMAKE_COMPILER_IS_GNUCC AND CMAKE_MINOR_VERSION GREATER 5)

  SET(${RPC_PREFIX}_RPCGEN_OUTPUT_SVC
    ${RPC_GENERATED_FILE_PREFIX}_svc.c
@@ -124,10 +124,10 @@
    ${RPC_GENERATED_FILE_PREFIX}.h)

  #inhibit compiler warning for generated files
- IF (CMAKE_COMPILER_IS_GNUCC)
+ IF (CMAKE_COMPILER_IS_GNUCC AND CMAKE_MINOR_VERSION GREATER 5)
      SET_SOURCE_FILES_PROPERTIES(${${RPC_PREFIX}_RPCGEN_OUTPUT_SVC}
 	                            PROPERTIES COMPILE_FLAGS "-w")
- ENDIF(CMAKE_COMPILER_IS_GNUCC)
+ ENDIF(CMAKE_COMPILER_IS_GNUCC AND CMAKE_MINOR_VERSION GREATER 5)

  ADD_CUSTOM_TARGET(${RPC_PREFIX}_rpcgen_exec_svc
    DEPENDS ${${RPC_PREFIX}_RPCGEN_OUTPUT_SVC}


Updated InstallRequiredSystemLibraries from cmake upstream

Fixes warnings with cmake 3

--- cmake/InstallRequiredSystemLibraries.cmake
+++ cmake/InstallRequiredSystemLibraries.cmake
@@ -1,31 +1,34 @@
+#.rst:
+# InstallRequiredSystemLibraries
+# ------------------------------
+#
+#
+#
 # By including this file, all library files listed in the variable
 # CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS will be installed with
-# install(PROGRAMS ...) into bin for WIN32 and lib
-# for non-WIN32. If CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP is set to TRUE
-# before including this file, then the INSTALL command is not called.
-# The user can use the variable CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS to use a
-# custom install command and install them however they want.
-# If it is the MSVC compiler, then the microsoft run
-# time libraries will be found and automatically added to the
-# CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS, and installed.
-# If CMAKE_INSTALL_DEBUG_LIBRARIES is set and it is the MSVC
-# compiler, then the debug libraries are installed when available.
-# If CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY is set then only the debug
-# libraries are installed when both debug and release are available.
-# If CMAKE_INSTALL_MFC_LIBRARIES is set then the MFC run time
-# libraries are installed as well as the CRT run time libraries.
-# If CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION is set then the libraries are
-# installed to that directory rather than the default.
-# If CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS is NOT set, then this file
-# warns about required files that do not exist. You can set this variable to
-# ON before including this file to avoid the warning. For example, the Visual
-# Studio Express editions do not include the redistributable files, so if you
-# include this file on a machine with only VS Express installed, you'll get
-# the warning.
-
-# Extension by DLR:
-# If CMAKE_INSTALL_OPENMP_LIBRARIES is set then the OpenMP run time
-# libraries are installed as well as the CRT run time libraries.
+# install(PROGRAMS ...) into bin for WIN32 and lib for non-WIN32.  If
+# CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP is set to TRUE before including
+# this file, then the INSTALL command is not called.  The user can use
+# the variable CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS to use a custom install
+# command and install them however they want.  If it is the MSVC
+# compiler, then the microsoft run time libraries will be found and
+# automatically added to the CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS, and
+# installed.  If CMAKE_INSTALL_DEBUG_LIBRARIES is set and it is the MSVC
+# compiler, then the debug libraries are installed when available.  If
+# CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY is set then only the debug
+# libraries are installed when both debug and release are available.  If
+# CMAKE_INSTALL_MFC_LIBRARIES is set then the MFC run time libraries are
+# installed as well as the CRT run time libraries.  If
+# CMAKE_INSTALL_OPENMP_LIBRARIES is set then the OpenMP run time libraries
+# are installed as well.  If
+# CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION is set then the libraries are
+# installed to that directory rather than the default.  If
+# CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS is NOT set, then this
+# file warns about required files that do not exist.  You can set this
+# variable to ON before including this file to avoid the warning.  For
+# example, the Visual Studio Express editions do not include the
+# redistributable files, so if you include this file on a machine with
+# only VS Express installed, you'll get the warning.

 #=============================================================================
 # Copyright 2006-2009 Kitware, Inc.
@@ -39,6 +42,7 @@
 #=============================================================================
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
+
 if(MSVC)
   file(TO_CMAKE_PATH "$ENV{SYSTEMROOT}" SYSTEMROOT)

@@ -92,6 +96,8 @@
         "${MSVC80_CRT_DIR}/msvcp80.dll"
         "${MSVC80_CRT_DIR}/msvcr80.dll"
         )
+    else()
+      set(__install__libs)
     endif()

     if(CMAKE_INSTALL_DEBUG_LIBRARIES)
@@ -130,6 +136,8 @@
         "${MSVC90_CRT_DIR}/msvcp90.dll"
         "${MSVC90_CRT_DIR}/msvcr90.dll"
         )
+    else()
+      set(__install__libs)
     endif()

     if(CMAKE_INSTALL_DEBUG_LIBRARIES)
@@ -155,40 +163,28 @@
         "${msvc_install_dir}/../../VC/redist"
         "${base_dir}/VC/redist"
         "$ENV{ProgramFiles}/Microsoft Visual Studio ${v}.0/VC/redist"
-        "$ENV{ProgramFiles(x86)}/Microsoft Visual Studio ${v}.0/VC/redist"
+        set(programfilesx86 "ProgramFiles(x86)")
+        "$ENV{${programfilesx86}}/Microsoft Visual Studio ${v}.0/VC/redist"
       )
     mark_as_advanced(MSVC${v}_REDIST_DIR)
     set(MSVC${v}_CRT_DIR "${MSVC${v}_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC${v}0.CRT")
-    set(MSVC${v}_OMP_DIR "${MSVC${v}_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC${v}0.OPENMP")

     if(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
       set(__install__libs
         "${MSVC${v}_CRT_DIR}/msvcp${v}0.dll"
         "${MSVC${v}_CRT_DIR}/msvcr${v}0.dll"
         )
-      if (CMAKE_INSTALL_OPENMP_LIBRARIES)
-        set(__install__libs
-          ${__install__libs}
-           "${MSVC${v}_OMP_DIR}/vcomp${v}0.dll"
-        )
-      endif()
+    else()
+      set(__install__libs)
     endif()

     if(CMAKE_INSTALL_DEBUG_LIBRARIES)
       set(MSVC${v}_CRT_DIR
         "${MSVC${v}_REDIST_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.VC${v}0.DebugCRT")
-      set(MSVC${v}_OMP_DIR
-        "${MSVC${v}_REDIST_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.VC${v}0.DebugOpenMP")
       set(__install__libs ${__install__libs}
         "${MSVC${v}_CRT_DIR}/msvcp${v}0d.dll"
         "${MSVC${v}_CRT_DIR}/msvcr${v}0d.dll"
         )
-      if (CMAKE_INSTALL_OPENMP_LIBRARIES)
-        set(__install__libs
-          ${__install__libs}
-           "${MSVC${v}_OMP_DIR}/vcomp${v}0d.dll"
-        )
-      endif()
     endif()
   endmacro()

@@ -202,6 +198,10 @@

   if(MSVC12)
     MSVCRT_FILES_FOR_VERSION(12)
+  endif()
+
+  if(MSVC14)
+    MSVCRT_FILES_FOR_VERSION(14)
   endif()

   if(CMAKE_INSTALL_MFC_LIBRARIES)
@@ -308,25 +308,42 @@
     macro(MFC_FILES_FOR_VERSION version)
       set(v "${version}")

+      # Multi-Byte Character Set versions of MFC are available as optional
+      # addon since Visual Studio 12.  So for version 12 or higher, check
+      # whether they are available and exclude them if they are not.
+      if("${v}" LESS 12 OR EXISTS "${MSVC${v}_MFC_DIR}/mfc${v}0d.dll")
+        set(mbcs ON)
+      else()
+        set(mbcs OFF)
+      endif()
+
       if(CMAKE_INSTALL_DEBUG_LIBRARIES)
         set(MSVC${v}_MFC_DIR
           "${MSVC${v}_REDIST_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.VC${v}0.DebugMFC")
         set(__install__libs ${__install__libs}
-          "${MSVC${v}_MFC_DIR}/mfc${v}0d.dll"
           "${MSVC${v}_MFC_DIR}/mfc${v}0ud.dll"
-          "${MSVC${v}_MFC_DIR}/mfcm${v}0d.dll"
           "${MSVC${v}_MFC_DIR}/mfcm${v}0ud.dll"
           )
+        if(mbcs)
+          set(__install__libs ${__install__libs}
+            "${MSVC${v}_MFC_DIR}/mfc${v}0d.dll"
+            "${MSVC${v}_MFC_DIR}/mfcm${v}0d.dll"
+          )
+        endif()
       endif()

       set(MSVC${v}_MFC_DIR "${MSVC${v}_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC${v}0.MFC")
       if(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
         set(__install__libs ${__install__libs}
-          "${MSVC${v}_MFC_DIR}/mfc${v}0.dll"
           "${MSVC${v}_MFC_DIR}/mfc${v}0u.dll"
-          "${MSVC${v}_MFC_DIR}/mfcm${v}0.dll"
           "${MSVC${v}_MFC_DIR}/mfcm${v}0u.dll"
           )
+        if(mbcs)
+          set(__install__libs ${__install__libs}
+            "${MSVC${v}_MFC_DIR}/mfc${v}0.dll"
+            "${MSVC${v}_MFC_DIR}/mfcm${v}0.dll"
+          )
+        endif()
       endif()

       # include the language dll's as well as the actuall dll's
@@ -356,6 +373,44 @@
     if(MSVC12)
       MFC_FILES_FOR_VERSION(12)
     endif()
+
+    if(MSVC14)
+      MFC_FILES_FOR_VERSION(14)
+    endif()
+  endif()
+
+  # MSVC 8 was the first version with OpenMP
+  # Furthermore, there is no debug version of this
+  if(CMAKE_INSTALL_OPENMP_LIBRARIES)
+    macro(OPENMP_FILES_FOR_VERSION version_a version_b)
+      set(va "${version_a}")
+      set(vb "${version_b}")
+      set(MSVC${va}_OPENMP_DIR "${MSVC${va}_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC${vb}.OPENMP")
+
+      if(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
+        set(__install__libs ${__install__libs}
+          "${MSVC${va}_OPENMP_DIR}/vcomp${vb}.dll")
+      endif()
+    endmacro()
+
+    if(MSVC80)
+      OPENMP_FILES_FOR_VERSION(80 80)
+    endif()
+    if(MSVC90)
+      OPENMP_FILES_FOR_VERSION(90 90)
+    endif()
+    if(MSVC10)
+      OPENMP_FILES_FOR_VERSION(10 100)
+    endif()
+    if(MSVC11)
+      OPENMP_FILES_FOR_VERSION(11 110)
+    endif()
+    if(MSVC12)
+      OPENMP_FILES_FOR_VERSION(12 120)
+    endif()
+    if(MSVC14)
+      OPENMP_FILES_FOR_VERSION(14 140)
+    endif()
   endif()

   foreach(lib
@@ -379,18 +434,18 @@

 if(WATCOM)
   get_filename_component( CompilerPath ${CMAKE_C_COMPILER} PATH )
-  if(WATCOM17)
-     set( __install__libs ${CompilerPath}/clbr17.dll
-       ${CompilerPath}/mt7r17.dll ${CompilerPath}/plbr17.dll )
-  endif()
-  if(WATCOM18)
-     set( __install__libs ${CompilerPath}/clbr18.dll
-       ${CompilerPath}/mt7r18.dll ${CompilerPath}/plbr18.dll )
-  endif()
-  if(WATCOM19)
-     set( __install__libs ${CompilerPath}/clbr19.dll
-       ${CompilerPath}/mt7r19.dll ${CompilerPath}/plbr19.dll )
-  endif()
+  if(CMAKE_C_COMPILER_VERSION)
+    set(_compiler_version ${CMAKE_C_COMPILER_VERSION})
+  else()
+    set(_compiler_version ${CMAKE_CXX_COMPILER_VERSION})
+  endif()
+  string(REGEX MATCHALL "[0-9]+" _watcom_version_list "${_compiler_version}")
+  list(GET _watcom_version_list 0 _watcom_major)
+  list(GET _watcom_version_list 1 _watcom_minor)
+  set( __install__libs
+    ${CompilerPath}/clbr${_watcom_major}${_watcom_minor}.dll
+    ${CompilerPath}/mt7r${_watcom_major}${_watcom_minor}.dll
+    ${CompilerPath}/plbr${_watcom_major}${_watcom_minor}.dll )
   foreach(lib
       ${__install__libs}
       )


cmake: fix finding pthread on windows

cmake: fix finding pthread on windows

--- cmake/qibuild/modules/pthread-config.cmake
+++ cmake/qibuild/modules/pthread-config.cmake
@@ -5,6 +5,6 @@
 if (UNIX AND NOT APPLE)
   set(PTHREAD_LIBRARIES "-lpthread"  CACHE STRING "" FORCE)
 else()
-  flib(PTHREAD "pthread" SYSTEM)
+  flib(PTHREAD pthread pthreadVCE2)
 endif()
 export_lib(PTHREAD)


Fix GSL path variable in FindGSL CMake module

--- modules/FindGSL.cmake
+++ modules/FindGSL.cmake
@@ -72,6 +72,7 @@
  "$ENV{GSL_DIR}"
  "$ENV{GSL_HOME}/bin"
  "$ENV{GSL_HOME}"
+ "$ENV{GSL}/bin"
  CACHE STRING "preferred path to GSL (gsl-config)")
 FIND_PROGRAM(GSL_CONFIG gsl-config
  ${GSL_CONFIG_PREFER_PATH}


Set target iOS version for framework to 9.3

Matches deployment target for Mapzen iOS SDK

--- toolchains/iOS.framework.cmake
+++ toolchains/iOS.framework.cmake
@@ -2,7 +2,7 @@

 set(FRAMEWORK_VERSION "0.8.2-dev")

-set(IOS_TARGET_VERSION "10.0")
+set(IOS_TARGET_VERSION "9.3")

 message(STATUS "Build for iOS archs " ${IOS_ARCH})


Add Uranium to PYTHONPATH for testing

Add Uranium to PYTHONPATH for testing

This 'assumes' you have Uranium as a sister-directory next to Cura. This is how it's always been. We should probably change that to a CMake variable some day.

--- cmake/CuraTests.cmake
+++ cmake/CuraTests.cmake
@@ -35,6 +35,6 @@
     get_filename_component(_plugin_directory ${_plugin} DIRECTORY)
     if(EXISTS ${_plugin_directory}/tests)
         get_filename_component(_plugin_name ${_plugin_directory} NAME)
-        cura_add_test(NAME pytest-${_plugin_name} DIRECTORY ${_plugin_directory} PYTHONPATH "${CMAKE_SOURCE_DIR}:${_plugin_directory}")
+        cura_add_test(NAME pytest-${_plugin_name} DIRECTORY ${_plugin_directory} PYTHONPATH "${CMAKE_SOURCE_DIR}/../Uranium:${CMAKE_SOURCE_DIR}:${_plugin_directory}")
     endif()
 endforeach()


Not needed

Not needed

--- cmake/FindClang.cmake
+++ cmake/FindClang.cmake
@@ -44,11 +44,6 @@
 # endif()

 set(Clang_FOUND FALSE)
-
-if(NOT TARGET llvm-config)
-  message(STATUS "LLVM was not found -> cannot find clang")
-  return()
-endif()

 set(CLANG_LIBRARY_DIR ${LLVM_LIBRARY_DIRS})
 set(CLANG_INCLUDE_DIR ${LLVM_INCLUDE_DIRS})


Fix the incorrect detection of ICONV_LIBRARY_PATH

This is introduced in rL308711.
Check for c library is incorrect here just because libc will be found always
and it does not mean that iconv is presented.

Thank to Andrew Krasny for narrowing down the root cause.

Reviewers: ecbeckmann
Reviewed By: ecbeckmann
Subscribers: mgorny, llvm-commits
Differential Revision: https://reviews.llvm.org/D38875

git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@316064 91177308-0d34-0410-b5e6-96231b3b80d8

--- cmake/config-ix.cmake
+++ cmake/config-ix.cmake
@@ -157,7 +157,7 @@
     set(HAVE_TERMINFO 0)
   endif()

-  find_library(ICONV_LIBRARY_PATH NAMES iconv libiconv libiconv-2 c)
+  find_library(ICONV_LIBRARY_PATH NAMES iconv libiconv libiconv-2)
   set(LLVM_LIBXML2_ENABLED 0)
   set(LIBXML2_FOUND 0)
   if((LLVM_ENABLE_LIBXML2) AND ((CMAKE_SYSTEM_NAME MATCHES "Linux") AND (ICONV_LIBRARY_PATH) OR APPLE))


cpack: Apply existing Linux package conventions (#5770)

--- cmake/packaging.cmake
+++ cmake/packaging.cmake
@@ -121,9 +121,9 @@

   if(DEFINED PLATFORM_LINUX)
     # .
-    if("${PACKAGING_SYSTEM}"  STREQUAL "DEB")
+    if("${PACKAGING_SYSTEM}" STREQUAL "DEB")
       file(COPY "${CMAKE_SOURCE_DIR}/tools/deployment/linux_postinstall.sh" DESTINATION "${CMAKE_BINARY_DIR}/package/deb")
-      install(FILES "${CMAKE_BINARY_DIR}/package/deb/linux_postinstall.sh" DESTINATION . RENAME postinst)
+      file(RENAME "${CMAKE_BINARY_DIR}/package/deb/linux_postinstall.sh" "${CMAKE_BINARY_DIR}/package/deb/postinst")
     endif()

     # bin
@@ -238,6 +238,8 @@
 list(GET OSQUERY_VERSION_COMPONENTS 2 CPACK_PACKAGE_VERSION_PATCH)

 set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "osquery is an operating system instrumentation toolchain.")
+set(CPACK_PACKAGE_NAME "osquery")
+set(CPACK_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
 set(CPACK_PACKAGE_VENDOR "osquery")
 set(CPACK_PACKAGE_CONTACT "osquery@osquery.io")
 set(CPACK_PACKAGE_HOMEPAGE_URL "https://osquery.io")
@@ -250,12 +252,22 @@
 set(CPACK_GENERATOR "${PACKAGING_SYSTEM}")

 if(DEFINED PLATFORM_LINUX)
+  set(CPACK_STRIP_FILES ON)
+  set(CPACK_SET_DESTDIR ON)
+
+  if(CPACK_GENERATOR STREQUAL "TGZ")
+    set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}_1.linux.x86_64")
+    set(CPACK_INCLUDE_TOPLEVEL_DIRECTORY 0)
+  endif()
+
   if(CPACK_GENERATOR STREQUAL "DEB")
+    set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}_${CPACK_PACKAGE_VERSION}_1.linux.amd64")
     set(CPACK_DEBIAN_PACKAGE_PRIORITY "extra")
     set(CPACK_DEBIAN_PACKAGE_SECTION "default")
     set(CPACK_DEBIAN_PACKAGE_DEPENDS "libc6 (>=2.12), zlib1g")

   elseif(CPACK_GENERATOR STREQUAL "RPM")
+    set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-1.linux.x86_64")
     set(CPACK_RPM_PACKAGE_DESCRIPTION "osquery is an operating system instrumentation toolchain.")
     set(CPACK_RPM_PACKAGE_GROUP "default")
     set(CPACK_RPM_PACKAGE_LICENSE "BSD")


ENH: add netlib for new vnl

ENH: add netlib for new vnl

--- itkCMakeOptions.cmake
+++ itkCMakeOptions.cmake
@@ -28,6 +28,7 @@
 IF(VXL_FROM_UTILITIES)
  INCLUDE_DIRECTORIES(${ITK_SOURCE_DIR}/Utilities/vxl/vcl
                       ${ITK_BINARY_DIR}/Utilities/vxl/vcl
+                      ${ITK_SOURCE_DIR}/Utilities/vxl/v3p/netlib
                       ${ITK_BINARY_DIR}/Utilities/vxl
                       ${ITK_SOURCE_DIR}/Utilities/vxl)
   IF(WIN32)


update CTestConfig file for my.cdash.org

--- CTestConfig.cmake
+++ CTestConfig.cmake
@@ -3,11 +3,11 @@
 ## project to incorporate the testing dashboard.
 ## # The following are required to uses Dart and the Cdash dashboard
 ##   ENABLE_TESTING()
-##   INCLUDE(Dart)
+##   INCLUDE(CTest)
 set(CTEST_PROJECT_NAME "Eigen")
 set(CTEST_NIGHTLY_START_TIME "05:00:00 UTC")

 set(CTEST_DROP_METHOD "http")
-set(CTEST_DROP_SITE "www.cdash.org")
-set(CTEST_DROP_LOCATION "/CDashPublic/submit.php?project=Eigen")
+set(CTEST_DROP_SITE "my.cdash.org")
+set(CTEST_DROP_LOCATION "/submit.php?project=Eigen")
 set(CTEST_DROP_SITE_CDASH TRUE)


fixed conflict

fixed conflict

--- externals/CMakeExternals.cmake
+++ externals/CMakeExternals.cmake
@@ -847,15 +847,7 @@
       set(VTKM_WORKLET_LIB "${CMAKE_INSTALL_LIBDIR}/libvtkm_worklet-${VTKM_VER}.a")
     endif()

-<<<<<<< HEAD
-    #option(vtkm_ENABLE_CUDA "Option to build vtkm with cuda enabled" OFF)
-
     add_external_project(vtkm STATIC
-=======
-    option(vtkm_ENABLE_CUDA "Option to build vtkm with cuda enabled" OFF)
-
-    add_external_project(vtkm
->>>>>>> upstream/master
       GIT_REPOSITORY https://gitlab.kitware.com/vtk/vtk-m.git
       GIT_TAG "v${VTKM_VER}.0"
       BUILD_BYPRODUCTS


Install all cmake files in same directory.

I.e. sync with how CMakeLists.txt does it.

--- CMake/InstallResources.cmake
+++ CMake/InstallResources.cmake
@@ -245,12 +245,11 @@
 # Create the CMake package files
 include(CMakePackageConfigHelpers)

-if (WIN32)
-   set(OGRE_CMAKE_DIR CMake)
-elseif (UNIX)
-   set(OGRE_CMAKE_DIR lib/OGRE/cmake)
-elseif (APPLE)
-endif ()
+if(WIN32 OR APPLE)
+  set(OGRE_CMAKE_DIR "CMake")
+else()
+  set(OGRE_CMAKE_DIR "${OGRE_LIB_DIRECTORY}/OGRE/cmake")
+endif()
 configure_package_config_file(${OGRE_TEMPLATES_DIR}/OGREConfig.cmake.in ${OGRE_BINARY_DIR}/cmake/OGREConfig.cmake
     INSTALL_DESTINATION ${OGRE_CMAKE_DIR}
     PATH_VARS CMAKE_INSTALL_PREFIX)


Fix packaged auto-load modules on Linux

Fix packaged auto-load modules on Linux

--- CMake/mitkInstallRules.cmake
+++ CMake/mitkInstallRules.cmake
@@ -38,9 +38,13 @@
             if(NOT CMAKE_CFG_INTDIR STREQUAL ".")
               set(_target_location "${_target_location}/Release")
             endif()
-            set(_mitk_autoload_target_location "${_target_location}/${_prefix}${_mitk_autoload_target}${_ext}")
+            set(_mitk_autoload_target_filename "${_prefix}${_mitk_autoload_target}${_ext}")
+            set(_mitk_autoload_target_filepath "${_target_location}/${_mitk_autoload_target_filename}")
             set(_install_DESTINATION "${_mitk_autoload_directory}")
-            MITK_INSTALL(FILES ${_mitk_autoload_target_location})
+            MITK_INSTALL(FILES ${_mitk_autoload_target_filepath})
+            if(UNIX AND NOT APPLE)
+              install(CODE "file(RPATH_REMOVE FILE \"\${CMAKE_INSTALL_PREFIX}/bin/${_mitk_autoload_directory}/${_mitk_autoload_target_filename}\")")
+            endif()
           endif()
         endforeach()
       endif()


Add Kitware's Girder as alternate download site for SHA512 data

--- CMake/sitkExternalData.cmake
+++ CMake/sitkExternalData.cmake
@@ -41,6 +41,9 @@
     # Data published on GitHub Pages
     "https://simpleitk.github.io/SimpleITKExternalData/%(algo)/%(hash)"

+    # Data published on Girder
+    "https://data.kitware.com:443/api/v1/file/hashsum/%(algo)/%(hash)/download"
+
     # Data published by MIDAS
     "https://midas3.kitware.com/midas/api/rest?method=midas.bitstream.download&checksum=%(hash)&algorithm=%(algo)"


add_dependency(): changed NAME into positional argument

--- ModularDeps.cmake
+++ ModularDeps.cmake
@@ -4,15 +4,12 @@

 find_package(Git REQUIRED)

-function(add_dependency)
+function(add_dependency AD_NAME)
   # Parse the options.
   set(options)
-  set(oneValueArgs NAME REPO BRANCH COMMIT)
+  set(oneValueArgs REPO BRANCH COMMIT)
   cmake_parse_arguments(AD "${options}" "${oneValueArgs}" "" ${ARGN})
-  # The dep name must always be there.
-  if(NOT AD_NAME)
-    message(FATAL_ERROR "At least the name of a dependency must be specified when using add_dependency().")
-  endif()
+
   # Repo could come from cache variables, or from function option. Cached variable overrides the
   # function argument.
   if(DEPENDENCY_${AD_NAME}_REPO)


Add missing X-Plasma-MainScript into new applet's .desktop file

--- plasma/plasma-applet-kscreen.desktop.cmake
+++ plasma/plasma-applet-kscreen.desktop.cmake
@@ -56,6 +56,8 @@
 Type=Service
 X-KDE-ServiceTypes=Plasma/Applet,Plasma/PopupApplet

+X-Plasma-API=declarativeappletscript
+X-Plasma-MainScript=ui/displayconfiguration.qml
 X-Plasma-DefaultSize=290,150
 X-Plasma-NotificationArea=true
 X-Plasma-ConfigPlugins=kscreen


fix missing ${ARGN} for find_package_plus_no_import

Change-Id: I3433315dfb56aea1a4b4600b5d4b9ab21ade59cc

--- VigraAddDep.cmake
+++ VigraAddDep.cmake
@@ -275,7 +275,7 @@
 # will take care of exporting as global variables the variables defined by the builtin find_package(), and to make
 # the imported targets defined by the builtin find_package() global.
 function(find_package_plus _VAD_NAME)
-  find_package_plus_no_import(${_VAD_NAME})
+  find_package_plus_no_import(${_VAD_NAME} ${ARGN})

   # Now take care of turning any IMPORTED non-GLOBAL target defined by a find_package() call into a GLOBAL one.
   make_imported_targets_global()


plugins/browser: Changed companyName to English to avoid accented characters

git-svn-id: af919ac7fdf0be26aaa017563ec94cac29b44150@2508 0d7e1ef0-d974-fc83-f0b3-ccc071561e0e

--- PluginConfig.cmake
+++ PluginConfig.cmake
@@ -30,10 +30,10 @@
 set(MOZILLA_PLUGINID "id.eesti.ee/esteid")

 # strings
-set(FBSTRING_CompanyName "Riigi Infosüsteemide Arenduskeskus")
+set(FBSTRING_CompanyName "Estonian Informatics Centre")
 set(FBSTRING_FileDescription "Estonian ID-Card Plugin")
 set(FBSTRING_PLUGIN_VERSION "1.0.0")
-set(FBSTRING_LegalCopyright "Copyright 2010 Riigi Infosüsteemide Arenduskeskus")
+set(FBSTRING_LegalCopyright "Copyright 2010 Estonian Informatics Centre")
 set(FBSTRING_PluginFileName "np${PLUGIN_NAME}.dll")
 set(FBSTRING_ProductName "esteid")
 set(FBSTRING_FileExtents "")


ctkMacroCompilePythonScripts - Associate python script to RuntimeLibraries Component

--- CMake/ctkMacroCompilePythonScript.cmake
+++ CMake/ctkMacroCompilePythonScript.cmake
@@ -143,7 +143,7 @@

   # Install python module / resources directory
   INSTALL(DIRECTORY "${MY_DIRECTORY_TO_INSTALL}"
-    DESTINATION "${MY_INSTALL_DIR}" COMPONENT Runtime
+    DESTINATION "${MY_INSTALL_DIR}" COMPONENT RuntimeLibraries
     USE_SOURCE_PERMISSIONS)

 ENDMACRO()


Parallel statistics tests depend on MPI

Parallel statistics tests depend on MPI

Change-Id: I312e401bb64bc762fbc33020200ec991b94a8273

--- Filters/ParallelStatistics/module.cmake
+++ Filters/ParallelStatistics/module.cmake
@@ -8,4 +8,6 @@
     vtkalglib
     vtkFiltersStatistics
     vtkParallelCore
+  TEST_DEPENDS
+    vtkParallelMPI
   )


macro to check for different input and output file and if needed replace output file


tolerate an empty library

tolerate an empty library

git-svn-id: de9bbed4c30e0eb58fe8e7d66f5c80b71699a07c@2771 bf01a9d7-0df3-0310-8ad4-b1c94d9ae2d5

--- Numerics/cmake/LibraryProjectSetup.cmake
+++ Numerics/cmake/LibraryProjectSetup.cmake
@@ -118,111 +118,114 @@
     ENDIF(FORTRAN_COMPILER_LIB_DIRECTORIES)
   ENDIF(APPLE)

-  IF(BUILD_STATIC_LIBS)
-    ADD_LIBRARY(${PROJECT_NAME}_static  STATIC ${_ALL_FILES})
-  ENDIF(BUILD_STATIC_LIBS)
-
-  IF(BUILD_SHARED_LIBS)
-    ADD_LIBRARY(${PROJECT_NAME}_shared  SHARED ${_ALL_FILES})
-  ENDIF(BUILD_SHARED_LIBS)
-
-  IF(APPLE)
-    IF(FORTRAN_LIBRARIES)
-     IF(BUILD_STATIC_LIBS)
-       TARGET_LINK_LIBRARIES(${PROJECT_NAME}_static ${FORTRAN_LIBRARIES})
-     ENDIF(BUILD_STATIC_LIBS)
-     IF(BUILD_SHARED_LIBS)
-        TARGET_LINK_LIBRARIES(${PROJECT_NAME}_shared ${FORTRAN_LIBRARIES})
-      ENDIF(BUILD_SHARED_LIBS)
-    ENDIF(FORTRAN_LIBRARIES)
-  ENDIF(APPLE)
-
-  APPEND_Fortran_FLAGS("-w")
-
-  IF(BUILD_STATIC_LIBS)
-  SET_TARGET_PROPERTIES(${PROJECT_NAME}_static PROPERTIES
-    OUTPUT_NAME "${PROJECT_NAME}"
-    VERSION "${${PROJECT_NAME}_VERSION}"
-    CLEAN_DIRECT_OUTPUT 1 # no clobbering
-    LINKER_LANGUAGE ${${PROJECT_NAME}_LINKER_LANGUAGE})
-   ENDIF(BUILD_STATIC_LIBS)
-
-  IF(BUILD_SHARED_LIBS)
-    SET_TARGET_PROPERTIES(${PROJECT_NAME}_shared PROPERTIES
-      OUTPUT_NAME "${PROJECT_NAME}"
-      VERSION "${${PROJECT_NAME}_VERSION}"
-      CLEAN_DIRECT_OUTPUT 1
-      LINKER_LANGUAGE ${${PROJECT_NAME}_LINKER_LANGUAGE})
-  ENDIF(BUILD_SHARED_LIBS)
-
-  IF(BUILD_STATIC_LIBS)
-   TARGET_LINK_LIBRARIES(${PROJECT_NAME}_static ${${PROJECT_NAME}_LINK_LIBRARIES})
-   # output in ${PROJECT_NAME}_STATIC|SHARED_LIB the path of the libraries
-   GET_TARGET_PROPERTY(${PROJECT_NAME}_STATIC_LIB ${PROJECT_NAME}_static LOCATION)
-  ENDIF(BUILD_STATIC_LIBS)
-
-  IF(BUILD_SHARED_LIBS)
-    MESSAGE(STATUS "Link directories : ${${PROJECT_NAME}_LINK_DIRECTORIES}")
-    MESSAGE(STATUS "Link libraries : ${${PROJECT_NAME}_LINK_LIBRARIES}")
-    TARGET_LINK_LIBRARIES(${PROJECT_NAME}_shared ${${PROJECT_NAME}_LINK_LIBRARIES})
-    GET_TARGET_PROPERTY(${PROJECT_NAME}_SHARED_LIB ${PROJECT_NAME}_shared LOCATION)
-    IF (${PROJECT_NAME}_LIBS_NAME)
-     SET_TARGET_PROPERTIES(${PROJECT_NAME}_shared
-                           PROPERTIES OUTPUT_NAME  ${${PROJECT_NAME}_LIBS_NAME})
-    ENDIF(${PROJECT_NAME}_LIBS_NAME)
-  ENDIF(BUILD_SHARED_LIBS)
-
-  IF(BUILD_STATIC_LIBS)
-    GET_FILENAME_COMPONENT(${PROJECT_NAME}_STATIC_LIB_NAME ${${PROJECT_NAME}_STATIC_LIB} NAME)
-    IF (${PROJECT_NAME}_LIBS_NAME)
-      SET_TARGET_PROPERTIES(${PROJECT_NAME}_static
-                           PROPERTIES OUTPUT_NAME  ${${PROJECT_NAME}_LIBS_NAME})
-    ENDIF(${PROJECT_NAME}_LIBS_NAME)
-  ENDIF(BUILD_STATIC_LIBS)
-
-  IF(BUILD_SHARED_LIBS)
-    GET_FILENAME_COMPONENT(${PROJECT_NAME}_SHARED_LIB_NAME ${${PROJECT_NAME}_SHARED_LIB} NAME)
-  ENDIF(BUILD_SHARED_LIBS)
-
-  # Installation
-  IF(${PROJECT_NAME}_INSTALL_LIB_DIR)
-    SET(_install_lib ${${PROJECT_NAME}_INSTALL_LIB_DIR})
-  ELSE(${PROJECT_NAME}_INSTALL_LIB_DIR)
-    SET(_install_lib lib)
-    SET(${PROJECT_NAME}_INSTALL_LIB_DIR ${_install_lib})
-  ENDIF(${PROJECT_NAME}_INSTALL_LIB_DIR)
-
-  IF(${PROJECT_NAME}_INSTALL_INCLUDE_DIR)
-    SET(_install_include ${${PROJECT_NAME}_INSTALL_INCLUDE_DIR})
-  ELSE(${PROJECT_NAME}_INSTALL_INCLUDE_DIR)
-    SET(_install_include include)
-    SET(${PROJECT_NAME}_INSTALL_INCLUDE_DIR ${_install_include})
-  ENDIF(${PROJECT_NAME}_INSTALL_INCLUDE_DIR)
-
-  INSTALL(FILES ${${PROJECT_NAME}_HDRS} DESTINATION ${_install_include})
-
-  IF(BUILD_SHARED_LIBS AND BUILD_STATIC_LIBS)
-    INSTALL(TARGETS
-      ${PROJECT_NAME}_static ${PROJECT_NAME}_shared
-      ARCHIVE DESTINATION ${_install_lib}
-      LIBRARY DESTINATION ${_install_lib})
-  ELSEIF(BUILD_SHARED_LIBS)
-    INSTALL(TARGETS
-      ${PROJECT_NAME}_shared
-      ARCHIVE DESTINATION ${_install_lib}
-      LIBRARY DESTINATION ${_install_lib})
-  ELSEIF(BUILD_STATIC_LIBS)
-    INSTALL(TARGETS
-      ${PROJECT_NAME}_static
-      ARCHIVE DESTINATION ${_install_lib}
-      LIBRARY DESTINATION ${_install_lib})
-  ELSE(BUILD_STATIC_LIBS)
-    MESSAGE("ERROR:: BUILD_SHARED_LIBS and/or BUILD_SHARED_LIBS must be set")
-  ENDIF(BUILD_SHARED_LIBS AND BUILD_STATIC_LIBS)
+  IF(_ALL_FILES)
+    IF(BUILD_STATIC_LIBS)
+      ADD_LIBRARY(${PROJECT_NAME}_static  STATIC ${_ALL_FILES})
+    ENDIF(BUILD_STATIC_LIBS)
+
+    IF(BUILD_SHARED_LIBS)
+      ADD_LIBRARY(${PROJECT_NAME}_shared  SHARED ${_ALL_FILES})
+    ENDIF(BUILD_SHARED_LIBS)
+
+    IF(APPLE)
+      IF(FORTRAN_LIBRARIES)
+        IF(BUILD_STATIC_LIBS)
+          TARGET_LINK_LIBRARIES(${PROJECT_NAME}_static ${FORTRAN_LIBRARIES})
+        ENDIF(BUILD_STATIC_LIBS)
+        IF(BUILD_SHARED_LIBS)
+          TARGET_LINK_LIBRARIES(${PROJECT_NAME}_shared ${FORTRAN_LIBRARIES})
+        ENDIF(BUILD_SHARED_LIBS)
+      ENDIF(FORTRAN_LIBRARIES)
+    ENDIF(APPLE)
+
+    APPEND_Fortran_FLAGS("-w")
+
+    IF(BUILD_STATIC_LIBS)
+      SET_TARGET_PROPERTIES(${PROJECT_NAME}_static PROPERTIES
+        OUTPUT_NAME "${PROJECT_NAME}"
+        VERSION "${${PROJECT_NAME}_VERSION}"
+        CLEAN_DIRECT_OUTPUT 1 # no clobbering
+        LINKER_LANGUAGE ${${PROJECT_NAME}_LINKER_LANGUAGE})
+    ENDIF(BUILD_STATIC_LIBS)
+
+    IF(BUILD_SHARED_LIBS)
+      SET_TARGET_PROPERTIES(${PROJECT_NAME}_shared PROPERTIES
+        OUTPUT_NAME "${PROJECT_NAME}"
+        VERSION "${${PROJECT_NAME}_VERSION}"
+        CLEAN_DIRECT_OUTPUT 1
+        #      LINKER_LANGUAGE ${${PROJECT_NAME}_LINKER_LANGUAGE}
+        )
+    ENDIF(BUILD_SHARED_LIBS)
+
+    IF(BUILD_STATIC_LIBS)
+      TARGET_LINK_LIBRARIES(${PROJECT_NAME}_static ${${PROJECT_NAME}_LINK_LIBRARIES})
+      # output in ${PROJECT_NAME}_STATIC|SHARED_LIB the path of the libraries
+      GET_TARGET_PROPERTY(${PROJECT_NAME}_STATIC_LIB ${PROJECT_NAME}_static LOCATION)
+    ENDIF(BUILD_STATIC_LIBS)
+
+    IF(BUILD_SHARED_LIBS)
+      MESSAGE(STATUS "Link directories : ${${PROJECT_NAME}_LINK_DIRECTORIES}")
+      MESSAGE(STATUS "Link libraries : ${${PROJECT_NAME}_LINK_LIBRARIES}")
+      TARGET_LINK_LIBRARIES(${PROJECT_NAME}_shared ${${PROJECT_NAME}_LINK_LIBRARIES})
+      GET_TARGET_PROPERTY(${PROJECT_NAME}_SHARED_LIB ${PROJECT_NAME}_shared LOCATION)
+      IF (${PROJECT_NAME}_LIBS_NAME)
+        SET_TARGET_PROPERTIES(${PROJECT_NAME}_shared
+          PROPERTIES OUTPUT_NAME  ${${PROJECT_NAME}_LIBS_NAME})
+      ENDIF(${PROJECT_NAME}_LIBS_NAME)
+    ENDIF(BUILD_SHARED_LIBS)
+
+    IF(BUILD_STATIC_LIBS)
+      GET_FILENAME_COMPONENT(${PROJECT_NAME}_STATIC_LIB_NAME ${${PROJECT_NAME}_STATIC_LIB} NAME)
+      IF (${PROJECT_NAME}_LIBS_NAME)
+        SET_TARGET_PROPERTIES(${PROJECT_NAME}_static
+          PROPERTIES OUTPUT_NAME  ${${PROJECT_NAME}_LIBS_NAME})
+      ENDIF(${PROJECT_NAME}_LIBS_NAME)
+    ENDIF(BUILD_STATIC_LIBS)
+
+    IF(BUILD_SHARED_LIBS)
+      GET_FILENAME_COMPONENT(${PROJECT_NAME}_SHARED_LIB_NAME ${${PROJECT_NAME}_SHARED_LIB} NAME)
+    ENDIF(BUILD_SHARED_LIBS)
+
+    # Installation
+    IF(${PROJECT_NAME}_INSTALL_LIB_DIR)
+      SET(_install_lib ${${PROJECT_NAME}_INSTALL_LIB_DIR})
+    ELSE(${PROJECT_NAME}_INSTALL_LIB_DIR)
+      SET(_install_lib lib)
+      SET(${PROJECT_NAME}_INSTALL_LIB_DIR ${_install_lib})
+    ENDIF(${PROJECT_NAME}_INSTALL_LIB_DIR)
+
+    IF(${PROJECT_NAME}_INSTALL_INCLUDE_DIR)
+      SET(_install_include ${${PROJECT_NAME}_INSTALL_INCLUDE_DIR})
+    ELSE(${PROJECT_NAME}_INSTALL_INCLUDE_DIR)
+      SET(_install_include include)
+      SET(${PROJECT_NAME}_INSTALL_INCLUDE_DIR ${_install_include})
+    ENDIF(${PROJECT_NAME}_INSTALL_INCLUDE_DIR)
+
+    INSTALL(FILES ${${PROJECT_NAME}_HDRS} DESTINATION ${_install_include})
+
+    IF(BUILD_SHARED_LIBS AND BUILD_STATIC_LIBS)
+      INSTALL(TARGETS
+        ${PROJECT_NAME}_static ${PROJECT_NAME}_shared
+        ARCHIVE DESTINATION ${_install_lib}
+        LIBRARY DESTINATION ${_install_lib})
+    ELSEIF(BUILD_SHARED_LIBS)
+      INSTALL(TARGETS
+        ${PROJECT_NAME}_shared
+        ARCHIVE DESTINATION ${_install_lib}
+        LIBRARY DESTINATION ${_install_lib})
+    ELSEIF(BUILD_STATIC_LIBS)
+      INSTALL(TARGETS
+        ${PROJECT_NAME}_static
+        ARCHIVE DESTINATION ${_install_lib}
+        LIBRARY DESTINATION ${_install_lib})
+    ELSE(BUILD_STATIC_LIBS)
+      MESSAGE("ERROR:: BUILD_SHARED_LIBS and/or BUILD_SHARED_LIBS must be set")
+    ENDIF(BUILD_SHARED_LIBS AND BUILD_STATIC_LIBS)

-  MESSAGE(STATUS "${PROJECT_NAME} library setup done")
-  MESSAGE(STATUS "")
-
+    MESSAGE(STATUS "${PROJECT_NAME} library setup done")
+    MESSAGE(STATUS "")
+
+  ENDIF(_ALL_FILES)
 ENDMACRO(LIBRARY_PROJECT_SETUP)


SWD-46 better doc

SWD-46 better doc

git-svn-id: 609522d7d408cfa97e9ff3bac4923f7fa96011fc@101 3149698f-976c-419d-aa71-eec1decff2c2

--- extensions/FindMatlab.cmake
+++ extensions/FindMatlab.cmake
@@ -8,19 +8,19 @@
 # to be able to compile Matlab extensions (mex files). It can also be used to run unit test on these mex extensions,
 # and run Matlab.
 #
-# The variable MATLAB_ROOT can be specified in order to give the path of the desired Matlab version.
+# The variable ``MATLAB_ROOT`` may be specified in order to give the path of the desired Matlab version. Also,
+# additionnal information is provided when ``MATLAB_FIND_DEBUG`` is set.
 # Otherwise, the behaviour is platform dependant:
 #
-# - on Windows, it looks for all installed versions of Matlab according to the entries in the registry
-# - on Mac, it looks for all installed versions of Matlab in /Application path
-# - on Unix, not tested yet.
+# - on Windows, the installed versions of Matlab are retrieved from the Windows registry
+# - on Mac, the installed versions of Matlab are given by the MATLAB pathes in /Application
+# - on Unix, the desired Matlab should be accessible from the PATH.
 #
 # When a Matlab binary is found and the ``MATLAB_VERSION`` is not given, then the
-# version of the Matlab installation is queried from Matlab directly. On Windows, it can make
-# a Window running Matlab appear, which should be avoided in some situations.
-#
-# The mapping of the release names and the version of Matlab is not trivial. The variable ``MATLAB_ADDITIONAL_VERSIONS``
-# can be provided by the user in order to handle additional versions, in the following form:
+# version is queried from Matlab directly. On Windows, it can make a window running Matlab appear.
+#
+# The mapping of the release names and the version of Matlab is performed by defining pairs (name, version).
+# The variable ``MATLAB_ADDITIONAL_VERSIONS`` may be provided in order to handle additional versions, in the following form:
 #
 # ::
 #
@@ -44,13 +44,13 @@
 # * ``MATLAB_FOUND`` true if the Matlab installation is found.
 # * ``MATLAB_ROOT`` the root of the Matlab installation
 # * ``MATLAB_VERSION`` the version of the Matlab installation
-# * ``MATLAB_PROGRAM`` the Matlab binary program. Available only if the component "MAIN_PROGRAM" is asked
+# * ``MATLAB_PROGRAM`` the Matlab binary program. Available only if the component ``MAIN_PROGRAM`` is asked
 # * ``MATLAB_INCLUDE_DIR`` the path of the Matlab libraries headers
 # * ``MATLAB_MEX_LIBRARY`` library for mex
-# * ``MATLAB_MX_LIBRARY`` mx library of Matlab (arrays). Available only if the component "MX_LIBRARY" is asked
-# * ``MATLAB_ENG_LIBRARY`` Matlab engine library. Available only if the component "ENG_LIBRARY" is asked
+# * ``MATLAB_MX_LIBRARY`` mx library of Matlab (arrays). Available only if the component ``MX_LIBRARY`` is asked
+# * ``MATLAB_ENG_LIBRARY`` Matlab engine library. Available only if the component ``ENG_LIBRARY`` is asked
 # * ``MATLAB_LIBRARIES`` the whole set of libraries of Matlab
-# * ``MATLAB_MEX_COMPILER`` the mex compiler of Matlab. Currently not used internally. Available only if the component "MEX_COMPILER" is asked
+# * ``MATLAB_MEX_COMPILER`` the mex compiler of Matlab. Currently not used internally. Available only if the component ``MEX_COMPILER`` is asked
 #
 #
 # Defined macros
@@ -64,11 +64,9 @@
 # * ``matlab_get_version_from_matlab_run`` returns the version of Matlab, given the full directory of the Matlab program.
 #
 #
-# todo
-# ----
+# Future work
+# -----------
 # - win32:an additional variable telling that the registry is x86 or x64, maybe depending on the target build.
-# - add a verbosity level for the info messages
-# - for determining the version, add a fall-back in case Matlab cannot be launched, like "MATLAB_VERSION=no".
 # - add a unit test method for Matlab versions >= 8.1 (R2013+)

 #=============================================================================


Tests: link with `-static` on MinGW

Tests: link with `-static` on MinGW

--- extras/CompileOptions.cmake
+++ extras/CompileOptions.cmake
@@ -92,3 +92,9 @@
 		)
 	endif()
 endif()
+
+if(MINGW)
+  # Static link on MinGW to avoid linking with the wrong DLLs when multiple
+	# versions are installed.
+	add_link_options(-static)
+endif()


Fixed huc path resolution.

Fixed huc path resolution.

--- example/cmake/huc-toolchain.cmake
+++ example/cmake/huc-toolchain.cmake
@@ -2,7 +2,11 @@

 list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}")

-get_filename_component(HUC_TOOLCHAIN_PATH "${HUC_PATH}" REALPATH)
+if(IS_ABSOLUTE ${HUC_PATH})
+    set(HUC_TOOLCHAIN_PATH ${HUC_PATH})
+else()
+    get_filename_component(HUC_TOOLCHAIN_PATH "${CMAKE_BINARY_DIR}/${HUC_PATH}" REALPATH)
+endif()

 set(CMAKE_C_COMPILER_WORKS 1)


CMake generator fix for when no modules are selected

--- support/cmake/support_macros.cmake
+++ support/cmake/support_macros.cmake
@@ -434,8 +434,13 @@
         endif ()
     endforeach ()

-    string(REPLACE ";" "" MODULE_HEADERS ${MODULE_HEADERS})
-    string(REPLACE ";" "" MODULE_CLASSES ${MODULE_CLASSES})
+    if (NOT "${MODULE_HEADERS}" STREQUAL "")
+        string(REPLACE ";" "" MODULE_HEADERS ${MODULE_HEADERS})
+    endif ()
+
+    if (NOT "${MODULE_CLASSES}" STREQUAL "")
+        string(REPLACE ";" "" MODULE_CLASSES ${MODULE_CLASSES})
+    endif ()

     configure_file(
         ${OPENSPACE_CMAKE_EXT_DIR}/module_registration.template