config.h.cmake: Comment source of KURENTO_MODULES_DIR

--- config.h.cmake
+++ config.h.cmake
@@ -13,7 +13,13 @@
 /* Tests will generate files for manual check if this macro is defined */
 #cmakedefine MANUAL_CHECK

-/* Library installation directory */
+/* Library installation directory
+ * This is set by CMake to the value of
+ * CMAKE_INSTALL_PREFIX/CMAKE_INSTALL_LIBDIR/KURENTO_MODULES_DIR_INSTALL_PREFIX
+ *
+ * Debian packages have "/usr/lib/x86_64-linux-gnu/kurento/modules"
+ * and local builds have "/usr/local/lib/kurento/modules"
+ */
 #cmakedefine KURENTO_MODULES_DIR "@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@/@KURENTO_MODULES_DIR_INSTALL_PREFIX@"

 #cmakedefine HAS_STD_REGEX_REPLACE @HAS_STD_REGEX_REPLACE@


added library suffix for atb find script

--- console/cmake/FindAntTweakBar.cmake
+++ console/cmake/FindAntTweakBar.cmake
@@ -12,7 +12,7 @@
 if(CMAKE_SIZEOF_VOID_P EQUAL 8 AND WIN32)
   set(lib_NAME "AntTweakBar64")
 else()
-  set(lib_NAME "${CMAKE_SHARED_LIBRARY_PREFIX}AntTweakBar")
+  set(lib_NAME "${CMAKE_SHARED_LIBRARY_PREFIX}AntTweakBar${CMAKE_SHARED_LIBRARY_SUFFIX}")
 endif()

 # setup of system search paths


list dependency SCORECapf_zoltan -> ParMETIS

the code does expect the ParMETIS TPL
to be enabled when building under Trilinos

--- zoltan/cmake/Dependencies.cmake
+++ zoltan/cmake/Dependencies.cmake
@@ -1,3 +1,4 @@
 TRIBITS_PACKAGE_DEFINE_DEPENDENCIES(
   LIB_REQUIRED_PACKAGES SCORECapf Zoltan
+  LIB_REQUIRED_TPLS ParMETIS
   )


COMP: ComputeTrainingMask: Remove older name and build if VTK support is ON.

This commit removes occurrence of the older module name originally renamed
in 042412e. It also build ComputeTrainingMask only if VTK support
is enabled. Similarly to what was done for VesselTrainMask in 7a0ee09

--- Applications/TubeTKModules.cmake
+++ Applications/TubeTKModules.cmake
@@ -29,7 +29,6 @@
   ComputeImageSimilarityMetrics
   ComputeImageStatistics
   ComputeSegmentTubesParameters
-  ComputeTrainingMask
   ComputeTubeFlyThroughImage
   ComputeTubeGraphProbability
   ComputeTubeMeasures
@@ -97,9 +96,9 @@
   set( TubeTK_${proj}_VTK_MODULES
     ClipTubes
     ConvertTubesToSurface
+    ComputeTrainingMask
     ComputeTubeTortuosityMeasures
-    RegisterUsingSlidingGeometries
-    VesselTrainMask )
+    RegisterUsingSlidingGeometries )
   list( APPEND TubeTK_${proj}_MODULES
     ${TubeTK_${proj}_VTK_MODULES} )
 endif( TubeTK_USE_VTK )


cmake: fix windows build

cmake: fix windows build

--- cmake/cpp.cmake
+++ cmake/cpp.cmake
@@ -316,7 +316,9 @@
  sat
  util)
   add_subdirectory(ortools/${SUBPROJECT})
-  target_link_libraries(${PROJECT_NAME} PRIVATE ${PROJECT_NAME}_${SUBPROJECT})
+  #target_link_libraries(${PROJECT_NAME} PRIVATE ${PROJECT_NAME}_${SUBPROJECT})
+  target_sources(${PROJECT_NAME} PRIVATE $<TARGET_OBJECTS:${PROJECT_NAME}_${SUBPROJECT}>)
+  add_dependencies(${PROJECT_NAME} ${PROJECT_NAME}_${SUBPROJECT})
 endforeach()

 # Install rules


cmake/dts: Remove import of CONFIG_ prefixed symbols from dts

We don't generate any CONFIG_ prefixed symbols from dts files so we
don't need to try and import them in anymore.

Signed-off-by: Kumar Gala <a5e5248af4cd4f0ed8c515f61d40a6e2db46a66e@linaro.org>

--- cmake/dts.cmake
+++ cmake/dts.cmake
@@ -175,7 +175,6 @@
     message(FATAL_ERROR "command failed with return code: ${ret}")
   endif()

-  import_kconfig(CONFIG_ ${GENERATED_DTS_BOARD_CONF})
   import_kconfig(DT_     ${GENERATED_DTS_BOARD_CONF})

 else()


exporting library build path

exporting library build path

--- cmake/lib.cmake
+++ cmake/lib.cmake
@@ -67,4 +67,6 @@

 set(ETHCRYPTO_INCLUDE_DIRS ${CMAKE_CURRENT_BINARY_DIR}/include ${LIBSCRYPT_INCLUDE_DIRS} ${SECP256K1_INCLUDE_DIRS} ${CRYPTOPP_INCLUDE_DIRS} ${ETHCRYPTO_CONFIG_INCLUDE_DIR} PARENT_SCOPE)
+set(ETHCRYPTO_LIBRARY ethcrypto)
+set(ETHCRYPTO_LIBRARIES ${ETHCRYPTO_LIBRARY})


git-svn-id: https://svn.csail.mit.edu/locomotion/robotlib/trunk@6931 c9849af7-e679-4ec6-a44e-fc146a885bd3

--- cmake/mex.cmake
+++ cmake/mex.cmake
@@ -176,12 +176,12 @@

 find_program(MEX_C_COMPILER ${MEX_CC})
 if (NOT ${CMAKE_C_COMPILER} STREQUAL ${MEX_C_COMPILER})
-   message(FATAL_ERROR "Your cmake C compiler is: ${CMAKE_C_COMPILER} but your mex options were setup for: ${MEX_CC} .  Consider rerunning 'mex -setup' in  Matlab.")
+   message(WARNING "Your cmake C compiler is: ${CMAKE_C_COMPILER} but your mex options were setup for: ${MEX_CC} .  Consider rerunning 'mex -setup' in  Matlab.")
 endif()

 find_program(MEX_CXX_COMPILER ${MEX_CXX})
 if (NOT ${CMAKE_CXX_COMPILER} STREQUAL ${MEX_CXX_COMPILER})
-   message(FATAL_ERROR "Your cmake CXX compiler is: ${CMAKE_CXX_COMPILER} but your mex options were setup for: ${MEX_CXX} .  Consider rerunning 'mex -setup' in Matlab.")
+   message(WARNING "Your cmake CXX compiler is: ${CMAKE_CXX_COMPILER} but your mex options were setup for: ${MEX_CXX} .  Consider rerunning 'mex -setup' in Matlab.")
 endif()

 # NOTE:  would like to check LD also, but it appears to be difficult with cmake  (there is not explicit linker executable variable, only the make rule), and  even my mex code assumes that LD==LDCXX for simplicity.


Build/Clang: suppress useless warnings

Build/Clang: suppress useless warnings

--- modules/acore/cmake/compiler/clang/settings.cmake
+++ modules/acore/cmake/compiler/clang/settings.cmake
@@ -15,6 +15,6 @@
 endif()

 # -Wno-narrowing needed to suppress a warning in g3d
-# -Wno-deprecated-register is needed to suppress 185 gsoap warnings on Unix systems.
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wno-narrowing -Wno-deprecated-register")
+# -Wno-deprecated-register -Wstring-plus-int -Wpointer-bool-conversion are needed to suppress gsoap warnings on Unix systems.
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wno-narrowing -Wno-deprecated-register -Wstring-plus-int -Wpointer-bool-conversion -Wparentheses")
 set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DDEBUG=1")


boards px4/raspberrypi: fix upload AUTOPILOT_HOST

--- boards/px4/raspberrypi/cmake/upload.cmake
+++ boards/px4/raspberrypi/cmake/upload.cmake
@@ -31,7 +31,7 @@
 #
 ############################################################################

-if($ENV{AUTOPILOT_HOST})
+if(DEFINED ENV{AUTOPILOT_HOST})
 	set(AUTOPILOT_HOST $ENV{AUTOPILOT_HOST})
 else()
 	set(AUTOPILOT_HOST "raspberrypi")


cmake: freerdpgdi library has been renamed to gdi

--- cmake/FindFreeRDP.cmake
+++ cmake/FindFreeRDP.cmake
@@ -25,7 +25,7 @@
   freerdp
   freerdpchanman
   freerdpkbd
-  freerdpgdi)
+  gdi)

 find_path(FREERDP_INCLUDE_DIR
           NAMES freerdp.h


Improve message.

Improve message.

--- cmake/FindJsonCpp.cmake
+++ cmake/FindJsonCpp.cmake
@@ -174,6 +174,7 @@

 	find_package_handle_standard_args(JsonCpp
 		DEFAULT_MSG
+		jsoncpp_DIR
 		JSONCPP_IMPORTED_LIBRARY
 		JSONCPP_IMPORTED_INCLUDE_DIRS)
 endif()


BUG: Allow Visual Studio builds to find the JsonCpp library.

--- cmake/FindJsonCpp.cmake
+++ cmake/FindJsonCpp.cmake
@@ -1,8 +1,8 @@
 ##############################################################################
 #
-# Library:   TubeTK
+# Initially developed for:   TubeTK
 #
-# Copyright 2010 Kitware Inc. 28 Corporate Drive,
+# Copyright 2013 Kitware Inc. 28 Corporate Drive,
 # Clifton Park, NY, 12065, USA.
 #
 # All rights reserved.
@@ -27,7 +27,11 @@
     string( REGEX REPLACE "[^=]+[=]" "" _source_dir "${_source_dir_def}" )
     set( _jsoncpp_include_dir "${_source_dir}/include" )
   endif()
-  set( _jsoncpp_library ${JsonCpp_DIR}/lib )
+  set( _jsoncpp_library ${JsonCpp_DIR}/lib
+    ${JsonCpp_DIR}/lib/Release
+    ${JsonCpp_DIR}/lib/MinSizeRel
+    ${JsonCpp_DIR}/lib/RelWithDebInfo
+    ${JsonCpp_DIR}/lib/Debug )
 endif( JsonCpp_DIR )

 find_path( JsonCpp_INCLUDE_DIR NAMES json/json.h


fix by zecke for bsd

fix by zecke for bsd

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

--- cmake/FindLibXml2.cmake
+++ cmake/FindLibXml2.cmake
@@ -31,6 +31,8 @@
    PATH_SUFFIXES libxml2
    )

+SET(LIBXML2_INCLUDE_DIR ${LIBXML2_INCLUDE_DIR} ${_LibXml2IncDir} )
+
 FIND_LIBRARY(LIBXML2_LIBRARIES NAMES xml2 libxml2
    PATHS
    ${_LibXml2LinkDir}


make signed packages with .changes files for ppa upload

--- cmake/debian-util.cmake
+++ cmake/debian-util.cmake
@@ -6,6 +6,7 @@
   add_custom_target(debs)
 endif()

+set(CATKIN_DPKG_BUILDPACKAGE_FLAGS "-S")
 function(catkin_package PKGNAME)

   stamp(${PROJECT_SOURCE_DIR}/stack.yaml)
@@ -41,8 +42,8 @@

   add_custom_command(TARGET ${PROJECT_NAME}-gendebian
     POST_BUILD
-    COMMAND dpkg-source -b ${PROJECT_SOURCE_DIR}
-    WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
+    COMMAND dpkg-buildpackage ${CATKIN_DPKG_BUILDPACKAGE_FLAGS} # ${PROJECT_SOURCE_DIR}
+    WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
     )

 endfunction()


ENH: Add FACTORY_NAMES parameter to itk_module() declaration

This new parameter allows ITK to be aware any object that needs to be registered
to the ITK factory. Remote modules that offer IO capabilities can be more easily
integrated in ITK.

--- itk-module.cmake
+++ itk-module.cmake
@@ -8,6 +8,8 @@
   TEST_DEPENDS
     ITKTestKernel
   ENABLE_SHARED
+  FACTORY_NAMES
+    ImageIO::OpenSlide
   DESCRIPTION
     "${DOCUMENTATION}"
   EXCLUDE_FROM_DEFAULT


Fixes embedding error.

Fixes embedding error.

--- cnetstring-config.cmake
+++ cnetstring-config.cmake
@@ -19,7 +19,7 @@
   include(FindPackageHandleStandardArgs)
   find_package_handle_standard_args(
     cnetstring DEFAULT_MSG
-    cnetstring_include_dir
+    cnetstring_include_dirs
     cnetstring_libraries
   )


Fix README

Fix README

--- configure.cmake
+++ configure.cmake
@@ -2,7 +2,7 @@
 # directory containing llvm-config executable
 # example of setting LLVM_CONFIG_BIN
 # set(LLVM_CONFIG_BIN "/Users/je23693/Documents/external-code/llvm5.0/build/bin")
-set(LLVM_CONFIG_BIN "/Users/je23693/Documents/external-code/llvm5.0/build/bin")
+set(LLVM_CONFIG_BIN "")

 set(ISL_INCLUDE_DIRECTORY "3rdParty/isl/build/include/")
 set(ISL_LIB_DIRECTORY "3rdParty/isl/build/lib/")
@@ -24,4 +24,4 @@
 #set(MPI_LIB_FLAGS "-lmpi")
 set(MPI_INCLUDE_DIR "")
 set(MPI_LIB_DIR "")
-set(MPI_LIB_FLAGS "")+set(MPI_LIB_FLAGS "")


silence the trigger site error

silence the trigger site error

--- CTestConfig.cmake
+++ CTestConfig.cmake
@@ -2,6 +2,7 @@
 SET(CTEST_DROP_SITE "fairroot.gsi.de")
 SET(CTEST_DROP_LOCATION "/CDash/submit.php?project=VC")
 SET(CTEST_UPDATE_TYPE git)
+SET(CTEST_TRIGGER_SITE "fairroot.gsi.de")

 find_program(GITCOMMAND git)
 mark_as_advanced(GITCOMMAND)


Don't include generated D-Bus interface in the coverage measurement.

--- CTestCustom.cmake
+++ CTestCustom.cmake
@@ -19,4 +19,4 @@
   )

 # No coverage for these files (auto-generated, unit tests, etc)
-set(CTEST_CUSTOM_COVERAGE_EXCLUDE ".moc$" "moc_" "ui_" "/libs/tests" "/server/tests" "qrc_" "adaptor.h$" "adaptor.cpp$")
+set(CTEST_CUSTOM_COVERAGE_EXCLUDE ".moc$" "moc_" "ui_" "/libs/tests" "/server/tests" "qrc_" "adaptor.h$" "adaptor.cpp$" "/server/[^/]+interface\\.")


closes #5340 exclude log_print.cc from coverage report

git-svn-id: b5c078ec0b4d3a50497e9dd3081db18a5b4f16e5@46507 c7de825b-a66e-492c-adef-691d508d4ae1

--- CTestCustom.cmake
+++ CTestCustom.cmake
@@ -185,6 +185,8 @@
   list(APPEND CTEST_CUSTOM_TESTS_IGNORE ${long_running_tests})
 endif()

+## ignore log_print.cc in coverage report
+list(APPEND CTEST_CUSTOM_COVERAGE_EXCLUDE "log_print.cc")

 list(APPEND CTEST_CUSTOM_WARNING_EXCEPTION
   "xz-4.999.9beta/src/liblzma"              # don't complain about warnings in xz source


Backed out changeset e1d04434012c

Backed out changeset e1d04434012c

--- SuperBuild/CMake/External_openjpeg.cmake
+++ SuperBuild/CMake/External_openjpeg.cmake
@@ -31,8 +31,8 @@

   ExternalProject_Add(${proj}
         PREFIX ${proj}
-        URL "http://sourceforge.net/projects/openjpeg.mirror/files/2.1.0/openjpeg-2.1.0.tar.gz/download"
-        URL_MD5 f6419fcc233df84f9a81eb36633c6db6
+        URL "http://sourceforge.net/projects/openjpeg.mirror/files/2.0.0/openjpeg-2.0.0.tar.gz/download"
+        URL_MD5 d9be274bddc0f47f268e484bdcaaa6c5
         BINARY_DIR ${OPENJPEG_SB_BUILD_DIR}
         INSTALL_DIR ${SB_INSTALL_PREFIX}
       DOWNLOAD_DIR ${DOWNLOAD_LOCATION}


More Boost cmake fixes for Windows.

More Boost cmake fixes for Windows.

--- cmake/BALLConfigBoost.cmake
+++ cmake/BALLConfigBoost.cmake
@@ -1,6 +1,7 @@
 SET(BALL_BOOST_COMPONENTS system thread iostreams regex)
 if ( WIN32 )
-	SET(BOOST_ALL_DYN_LINK TRUE)
+	ADD_DEFINITIONS(-DBOOST_ALL_DYN_LINK)
+	ADD_DEFINITIONS(-DBOOST_THREAD_USE_DLL)
 endif()
 SET(Boost_ADDITIONAL_VERSIONS "1.39" "1.39.0" "1.40" "1.40.0" "1.41" "1.41.0"
 	"1.42" "1.42.0" "1.43" "1.43.0" "1.44.0")


FIX: KWStyle must run in the source directory

--- cmake/KWStyle/KWStyle.cmake
+++ cmake/KWStyle/KWStyle.cmake
@@ -103,6 +103,7 @@
   COMMAND ${KWSTYLE_EXECUTABLE}
   ARGS    ${KWSTYLE_ARGUMENTS_CODE}
   COMMENT "Coding Style Checker"
+  WORKING_DIRECTORY ${RTK_SOURCE_DIR}
   )

 add_custom_target(StyleCheckCode DEPENDS ${RTK_BINARY_DIR}/KWStyleCodeReport.txt)


cmake/options: add WITH_FRONTENDS

cmake/options: add WITH_FRONTENDS

so we can decide which frontends to compile


added suppression for python-script-but-no-python-dep

--- cmake/OpenCVPackaging.cmake
+++ cmake/OpenCVPackaging.cmake
@@ -252,7 +252,8 @@

 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
+                                "binary-or-shlib-defines-rpath" # usr/share/OpenCV/bin/opencv_test_ml
+                                "python-script-but-no-python-dep") # usr/share/OpenCV/bin/calchist.py
 else()
     set(TESTS_LINTIAN_OVERRIDES "empty-binary-package") # there is no tests
 endif()


Add info message

Add info message

--- cmake/PeacockPlatform.cmake
+++ cmake/PeacockPlatform.cmake
@@ -10,6 +10,7 @@
 # Normalize host system name:
 # linux, windows, cygwin
 set(host_system_name ${CMAKE_HOST_SYSTEM_NAME})
+message(${CMAKE_HOST_SYSTEM_NAME})
 if(host_system_name STREQUAL "Linux")
     set(host_system_name "linux")
 elseif(host_system_name STREQUAL "Darwin")
@@ -180,8 +181,10 @@
 endif()  # CMAKE_CXX_COMPILER_ID

-message(STATUS "peacock: host_system_name     : " ${host_system_name})
-message(STATUS "peacock: target_system_name   : " ${target_system_name})
+message(STATUS "peacock: host_system_name     : "
+    "${host_system_name} (${CMAKE_HOST_SYSTEM_NAME})")
+message(STATUS "peacock: target_system_name   : "
+    "${target_system_name} (${CMAKE_SYSTEM_NAME})")
 if(peacock_compiler_found)
     message(STATUS "peacock: cross_compiling      : "
         ${peacock_cross_compiling})


Changing URL to nektar.info website

Changing URL to nektar.info website

--- cmake/ThirdPartyMetis.cmake
+++ cmake/ThirdPartyMetis.cmake
@@ -6,8 +6,8 @@
     EXTERNALPROJECT_ADD(
         modmetis-5.1.0
         PREFIX ${TPSRC}
-        URL http://xyloid.org/metis-5.1.0.tar.gz
-        URL_MD5 "c48620f7b5b1cebebc00ccbf73fca5d0"
+        URL http://www.nektar.info/thirdparty/modmetis-5.1.0.tar.bz2
+        URL_MD5 "1519db68141ed79fdd45064375c65e88"
         DOWNLOAD_DIR ${TPSRC}
         CONFIGURE_COMMAND ${CMAKE_COMMAND} -DCMAKE_INSTALL_PREFIX:PATH=${TPSRC}/dist -DCMAKE_C_FLAGS:STRING=-fPIC -DGKLIB_PATH:PATH=${TPSRC}/src/modmetis-5.1.0/GKlib ${TPSRC}/src/modmetis-5.1.0
     )


Support passing defines from top level config makefile

--- cmake/common/px4_base.cmake
+++ cmake/common/px4_base.cmake
@@ -809,9 +809,14 @@

 	string(TOUPPER ${BOARD} board_upper)
 	string(REPLACE "-" "_" board_config ${board_upper})
+	set (added_target_definitions)
+	if (NOT ${target_definitions})
+	    px4_prepend_string(OUT added_target_definitions STR "-D" LIST ${target_definitions})
+	endif()
 	set(added_definitions
 		-DCONFIG_ARCH_BOARD_${board_config}
 		-D__STDC_FORMAT_MACROS
+		${added_target_definitions}
 		)

 	if (NOT (APPLE AND (${CMAKE_C_COMPILER_ID} MATCHES ".*Clang.*")))


CMake fix: look for the right directories on MacOSX (#971)

--- cmake/modules/FindX10.cmake
+++ cmake/modules/FindX10.cmake
@@ -3,7 +3,11 @@
   get_filename_component(_Swift_TOOLCHAIN ${CMAKE_Swift_COMPILER} DIRECTORY)
   get_filename_component(_Swift_TOOLCHAIN ${_Swift_TOOLCHAIN} DIRECTORY)
   get_filename_component(_Swift_TOOLCHAIN ${_Swift_TOOLCHAIN} DIRECTORY)
-  string(TOLOWER ${CMAKE_SYSTEM_NAME} system_lc)
+  if(CMAKE_SYSTEM_NAME STREQUAL Darwin)
+    set(system_lc macosx)
+  else()
+    string(TOLOWER ${CMAKE_SYSTEM_NAME} system_lc)
+  endif()
   file(TO_CMAKE_PATH ${_Swift_TOOLCHAIN}/usr/lib/swift/${system_lc} _Swift_LIBDIR)
 endif()


Fix #421

Fix #421

--- CommonCPack.cmake
+++ CommonCPack.cmake
@@ -8,25 +8,25 @@
   return()
 endif()

+if(NOT CPACK_PROJECT_NAME)
+  set(CPACK_PROJECT_NAME ${PROJECT_NAME})
+endif()
+
+if(NOT CPACK_PACKAGE_NAME)
+  set(CPACK_PACKAGE_NAME ${CPACK_PROJECT_NAME})
+endif()
+
+if(NOT CPACK_PACKAGE_DESCRIPTION_SUMMARY)
+  set(CPACK_PACKAGE_DESCRIPTION_SUMMARY ${${UPPER_PROJECT_NAME}_DESCRIPTION})
+endif()
+
+if(NOT CPACK_PACKAGE_LICENSE)
+  set(CPACK_PACKAGE_LICENSE ${${UPPER_PROJECT_NAME}_LICENSE})
+endif()
 if(NOT CPACK_PACKAGE_LICENSE)
   message(FATAL_ERROR "Missing CPACK_PACKAGE_LICENSE")
 endif()

-if(NOT CPACK_PROJECT_NAME)
-  set(CPACK_PROJECT_NAME ${PROJECT_NAME})
-endif()
-
-if(NOT CPACK_PACKAGE_NAME)
-  set(CPACK_PACKAGE_NAME ${CPACK_PROJECT_NAME})
-endif()
-
-if(NOT CPACK_PACKAGE_DESCRIPTION_SUMMARY)
-  set(CPACK_PACKAGE_DESCRIPTION_SUMMARY ${${UPPER_PROJECT_NAME}_DESCRIPTION})
-endif()
-
-if(NOT CPACK_PACKAGE_LICENSE)
-  set(CPACK_PACKAGE_LICENSE ${${UPPER_PROJECT_NAME}_LICENSE})
-endif()

 if(NOT CPACK_PACKAGE_CONTACT)
   set(CPACK_PACKAGE_CONTACT ${${UPPER_PROJECT_NAME}_MAINTAINER})


Removed an unnecessary include dir in SlaveConfigure.cmake.

This is no longer needed as we already used #include <mesos/mesos.pb.h>
in all places.

--- src/slave/cmake/SlaveConfigure.cmake
+++ src/slave/cmake/SlaveConfigure.cmake
@@ -34,8 +34,6 @@
 set(AGENT_INCLUDE_DIRS
   ${AGENT_INCLUDE_DIRS}
   ${MESOS_PUBLIC_INCLUDE_DIR}
-  # Protobuf headers that depend on mesos.pb.h need this.
-  ${MESOS_PUBLIC_INCLUDE_DIR}/mesos
   # Contains (e.g.) compiled *.pb.h files.
   ${MESOS_BIN_INCLUDE_DIR}
   ${MESOS_BIN_INCLUDE_DIR}/mesos


[cmake] Add an option to prefer public SDK in find_darwin_sdk_dir

Adds a CMake option DARWIN_PREFER_PUBLIC_SDK, off by default. When on, this prefers to use the public SDK, even when an internal one is present. With this, it's easy to emulate a build that the public buildbots are doing.

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

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

--- cmake/Modules/CompilerRTDarwinUtils.cmake
+++ cmake/Modules/CompilerRTDarwinUtils.cmake
@@ -4,14 +4,17 @@
 # set the default Xcode to use. This function finds the SDKs that are present in
 # the current Xcode.
 function(find_darwin_sdk_dir var sdk_name)
-  # Let's first try the internal SDK, otherwise use the public SDK.
-  execute_process(
-    COMMAND xcodebuild -version -sdk ${sdk_name}.internal Path
-    RESULT_VARIABLE result_process
-    OUTPUT_VARIABLE var_internal
-    OUTPUT_STRIP_TRAILING_WHITESPACE
-    ERROR_FILE /dev/null
-  )
+  set(DARWIN_PREFER_PUBLIC_SDK OFF CACHE BOOL "Prefer Darwin public SDK, even when an internal SDK is present.")
+  if(NOT DARWIN_PREFER_PUBLIC_SDK)
+    # Let's first try the internal SDK, otherwise use the public SDK.
+    execute_process(
+      COMMAND xcodebuild -version -sdk ${sdk_name}.internal Path
+      RESULT_VARIABLE result_process
+      OUTPUT_VARIABLE var_internal
+      OUTPUT_STRIP_TRAILING_WHITESPACE
+      ERROR_FILE /dev/null
+    )
+  endif()
   if((NOT result_process EQUAL 0) OR "" STREQUAL "${var_internal}")
     execute_process(
       COMMAND xcodebuild -version -sdk ${sdk_name} Path


Added automatic building of plugins as static when dynamic build is switch off.

--- CMakeModules/OsgMacroUtils.cmake
+++ CMakeModules/OsgMacroUtils.cmake
@@ -114,8 +114,12 @@
     ENDIF(NOT TARGET_LABEL)

 # here we use the command to generate the library
-
-    ADD_LIBRARY(${TARGET_TARGETNAME} MODULE ${TARGET_SRC} ${TARGET_H})
+
+    IF   (DYNAMIC_OPENSCENEGRAPH)
+        ADD_LIBRARY(${TARGET_TARGETNAME} MODULE ${TARGET_SRC} ${TARGET_H})
+    ELSE (DYNAMIC_OPENSCENEGRAPH)
+        ADD_LIBRARY(${TARGET_TARGETNAME} STATIC ${TARGET_SRC} ${TARGET_H})
+    ENDIF(DYNAMIC_OPENSCENEGRAPH)

     #not sure if needed, but for plugins only msvc need the d suffix
     IF(NOT MSVC)


Fix broken openssl.org download link.

Fix broken openssl.org download link.

--- build/cmake/openresty.cmake
+++ build/cmake/openresty.cmake
@@ -39,7 +39,7 @@
 # OpenResty's ssl_certificate_by_lua functionality requires OpenSSL 1.0.2e+
 ExternalProject_Add(
   openssl
-  URL ftp://ftp.openssl.org/source/openssl-${OPENSSL_VERSION}.tar.gz
+  URL https://www.openssl.org/source/openssl-${OPENSSL_VERSION}.tar.gz
   URL_HASH SHA256=${OPENSSL_HASH}
   CONFIGURE_COMMAND ""
   BUILD_COMMAND ""


Simplify common.cmake

Simplify common.cmake

--- common.cmake
+++ common.cmake
@@ -24,14 +24,8 @@

 include_directories( include ${ADDITIONAL_INCLUDE_DIRECTORIES} )

-if(TESTS MATCHES "ON")
-   message(STATUS "Extended test code functions are enabled")
-   file(GLOB PROJECT_INCLUDES "include/*.hpp" "include/tests/*.hpp" "include/*.h" "include/tests/*.h" ${ADDITIONAL_PROJECT_INCLUDES} )
-   file(GLOB PROJECT_SRC "src/*.c" "src/test/*.c" "src/*.cpp" "src/test/*.cpp" ${ADDITIONAL_PROJECT_SRC} )
-else()
-   file(GLOB PROJECT_INCLUDES "include/*.h" "include/*.hpp" ${ADDITIONAL_PROJECT_INCLUDES})
-   file(GLOB PROJECT_SRC "src/*.c" "src/*.cpp" ${ADDITIONAL_PROJECT_SRC} )
-endif()
+file(GLOB PROJECT_INCLUDES "jdkavdecc-c/include/*.h" "jdkavdecc-c/include/*.hpp" "include/*.hpp" "include/tests/*.hpp" "include/*.h" "include/tests/*.h" ${ADDITIONAL_PROJECT_INCLUDES} )
+file(GLOB PROJECT_SRC "src/*.c" "src/test/*.c" "src/*.cpp" "src/test/*.cpp" ${ADDITIONAL_PROJECT_SRC} )

 add_library (${PROJECT} ${PROJECT_SRC} ${PROJECT_INCLUDES})


Add aux module to configure script

Add aux module to configure script

--- glbinding-config.cmake
+++ glbinding-config.cmake
@@ -8,6 +8,7 @@
 # List of modules
 set(MODULE_NAMES
     glbinding
+    glbinding-aux
 )


Use new method for build-dir exports

Use new method for build-dir exports

Use `export(EXPORT` to create exported targets file for the build
directory, instead of listing the targets again. This was added in CMake
3.0, and is much more reliable since it doesn't require trying to
maintain a canonical list of targets.

--- lcm-cmake/install.cmake
+++ lcm-cmake/install.cmake
@@ -38,10 +38,7 @@
 )

 # Exported targets for build directory
-export(TARGETS
-  lcm-coretypes
-  lcm
-  lcm-gen
+export(EXPORT ${PROJECT_NAME}Targets
   FILE ${PROJECT_BINARY_DIR}/${PROJECT_NAME}Targets.cmake
 )


updated common.cmake

updated common.cmake

--- common.cmake
+++ common.cmake
@@ -63,8 +63,12 @@

 include_directories( include  )

-file(GLOB PROJECT_INCLUDES "include/*.h" "include/*.hpp" "include/*/*.h" "include/*/*.hpp" "include/*/*/*.h" "include/*/*/*.hpp")
-file(GLOB PROJECT_SRC "src/*.c" "src/*.cpp" "src/*/*.c" "src/*/*.cpp" "src/*/*/*.c" "src/*/*/*.cpp")
+set(PROJECT_INCLUDES_GLOBS ${PROJECT_INCLUDES_GLOBS} "include/*.h" "include/*.hpp" "include/*/*.h" "include/*/*.hpp" "include/*/*/*.h" "include/*/*/*.hpp")
+
+set(PROJECT_SRC_GLOBS ${PROJECT_SRC_GLOBS} "src/*.c" "src/*.cpp" "src/*/*.c" "src/*/*.cpp" "src/*/*/*.c" "src/*/*/*.cpp")
+
+file(GLOB PROJECT_INCLUDES ${PROJECT_INCLUDES_GLOBS} )
+file(GLOB PROJECT_SRC ${PROJECT_SRC_GLOBS} )

 add_library (${PROJECT} ${PROJECT_SRC} ${PROJECT_INCLUDES})


allows dcmtk 3.5.5 and 3.5.4

allows dcmtk 3.5.5 and 3.5.4

--- itkDataImageReader/FindDCMTK2.cmake
+++ itkDataImageReader/FindDCMTK2.cmake
@@ -163,27 +163,31 @@
     ${DCMTK_dcmimgle_INCLUDE_DIR}
     ${DCMTK_dcmjpeg_INCLUDE_DIR}
   )
-  IF (DCMTK_oflog_LIBRARY)#oflog only in dcmtk>=3.5.5
-    SET( DCMTK_INCLUDE_DIR
-      ${DCMTK_INCLUDE_DIR}
-      ${DCMTK_oflog_INCLUDE_DIR}
-    )
-    SET( DCMTK_LIBRARIES
-      ${DCMTK_oflog_LIBRARY} #must be defined before ofstd
-    )
-  ENDIF (DCMTK_oflog_LIBRARY)
-
   SET( DCMTK_LIBRARIES
-    ${DCMTK_LIBRARIES}
     ${DCMTK_dcmjpeg_LIBRARY}
     ${DCMTK_ijg8_LIBRARY}
     ${DCMTK_ijg12_LIBRARY}
     ${DCMTK_ijg16_LIBRARY}
     ${DCMTK_dcmimgle_LIBRARY}
     ${DCMTK_dcmdata_LIBRARY}
-    ${DCMTK_ofstd_LIBRARY}
-    ${DCMTK_config_LIBRARY}
   )
+  IF ( DCMTK_oflog_LIBRARY )#oflog only in dcmtk>=3.5.5
+    SET( DCMTK_INCLUDE_DIR
+      ${DCMTK_oflog_INCLUDE_DIR}
+      ${DCMTK_INCLUDE_DIR}
+    )
+    SET( DCMTK_LIBRARIES
+      ${DCMTK_LIBRARIES}
+      ${DCMTK_oflog_LIBRARY} #must be defined before ofstd
+    )
+  ENDIF ( DCMTK_oflog_LIBRARY )
+
+  SET( DCMTK_LIBRARIES
+   ${DCMTK_LIBRARIES}
+   ${DCMTK_ofstd_LIBRARY}
+   ${DCMTK_config_LIBRARY}
+  )
+
   IF(NOT WIN32)
     SET( DCMTK_LIBRARIES
     ${DCMTK_LIBRARIES}


Ultime commit.

Ultime commit.

--- DartConfig.cmake
+++ DartConfig.cmake
@@ -1,6 +1,6 @@
 # Dashboard is opened for submissions for a 24 hour period starting at
 # the specified NIGHLY_START_TIME. Time is specified in 24 hour format.
-SET (NIGHTLY_START_TIME "00:10:00 CET")
+SET (NIGHTLY_START_TIME "01:00:00 CET")

 SET (BUILDNAME "${BUILDNAME}${CMAKE_BUILD_TYPE}")


config: Remove bspwm variable references

This confuses lots of people when removing the bspwm module from the
sample config and trying to use the i3 module

--- config.cmake
+++ config.cmake
@@ -144,13 +144,13 @@

 ; focused = Active workspace on focused monitor
 label-focused = %index%
-label-focused-background = ${module/bspwm.label-focused-background}
-label-focused-underline = ${module/bspwm.label-focused-underline}
-label-focused-padding = ${module/bspwm.label-focused-padding}
+label-focused-background = ${colors.background-alt}
+label-focused-underline= ${colors.primary}
+label-focused-padding = 2

 ; unfocused = Inactive workspace on any monitor
 label-unfocused = %index%
-label-unfocused-padding = ${module/bspwm.label-occupied-padding}
+label-unfocused-padding = 2

 ; visible = Active workspace on unfocused monitor
 label-visible = %index%
@@ -160,8 +160,8 @@

 ; urgent = Workspace with urgency hint set
 label-urgent = %index%
-label-urgent-background = ${module/bspwm.label-urgent-background}
-label-urgent-padding = ${module/bspwm.label-urgent-padding}
+label-urgent-background = ${colors.alert}
+label-urgent-padding = 2

 ; Separator in between workspaces
 ; label-separator = |


ditto.

ditto.

--- ModularDeps.cmake
+++ ModularDeps.cmake
@@ -4,7 +4,13 @@

 find_package(Git REQUIRED)

-function(add_dependency DEP_NAME DEP_REPO)
+function(add_dependency)
+  set(options)
+  set(oneValueArgs NAME REPO)
+  cmake_parse_arguments(AD "${options}" "${oneValueArgs}" "" ${ARGN})
+  set(DEP_NAME "${AD_NAME}")
+  set(DEP_REPO "${AD_REPO}")
+
   # Determine if the dependency has already been satisfied.
   if(${DEP_NAME}_DEP_SATISFIED)
     message(STATUS "The dependency '${DEP_NAME}' is already satisfied.")


Incorrect capitalization. Thanks macos.

Incorrect capitalization. Thanks macos.

--- modules/FindCatch.cmake
+++ modules/FindCatch.cmake
@@ -19,17 +19,17 @@
 find_path(CATCH_INCLUDE_DIR catch.hpp PATHS ${EXTERNAL_ROOT}/include)
 if(CATCH_INCLUDE_DIR)
   file(
-    STRINGS ${CATCH_INCLUDE_DIR}/Catch.hpp
+    STRINGS ${CATCH_INCLUDE_DIR}/catch.hpp
     CATCH_VERSION_STRING
     REGEX "[ ]+Catch[ ]+v([0-9]*\\.[0-9]*\\.[0-9]*)"
-    )
+  )
   string(
     REGEX REPLACE
     ".*[ ]+Catch[ ]+v([0-9]*\\.[0-9]*\\.[0-9]*)"
     "\\1"
     CATCH_VERSION_STRING
     "${CATCH_VERSION_STRING}"
-    )
+  )
 endif()

 set(CATCH_INCLUDE_DIRS ${CATCH_INCLUDE_DIR} )


Fix the strigi build when ffmpeg is not installed.

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

--- libstreamanalyzer/cmake/FindFFMPEG.cmake
+++ libstreamanalyzer/cmake/FindFFMPEG.cmake
@@ -54,7 +54,7 @@
     NO_DEFAULT_PATH
   )

-  message("AVCODEC_INCLUDE_DIR = ${AVCODEC_INCLUDE_DIR}")
+  message("AVCODEC_INCLUDE_DIR = ${AVCODEC_INCLUDE_DIR}")

   mark_as_advanced(AVCODEC_INCLUDE_DIR)

@@ -207,19 +207,14 @@
     set(SWSCALE_FOUND TRUE)
   endif (SWSCALE_LIBRARY)

-  set(FFMPEG_INCLUDE_DIRS
-    ${_AVCODEC_INCLUDEDIR}
-    ${AVCODEC_INCLUDE_DIR}
-    ${AVFORMAT_INCLUDE_DIR}
-    ${AVUTIL_INCLUDE_DIR}
-    ${POSTPROC_INCLUDE_DIR}
-    ${SWSCALE_INCLUDE_DIR}
-  )
-
   if (AVCODEC_FOUND)
     set(FFMPEG_LIBRARIES
       ${FFMPEG_LIBRARIES}
       ${AVCODEC_LIBRARY}
+    )
+    set(FFMPEG_INCLUDE_DIRS
+      ${_AVCODEC_INCLUDEDIR}
+      ${AVCODEC_INCLUDE_DIR}
     )
   endif (AVCODEC_FOUND)
   if (AVUTIL_FOUND)
@@ -227,23 +222,39 @@
       ${FFMPEG_LIBRARIES}
       ${AVUTIL_LIBRARY}
     )
+    set(FFMPEG_INCLUDE_DIRS
+      ${AVUTIL_INCLUDE_DIR}
+      ${FFMPEG_INCLUDE_DIRS}
+    )
   endif (AVUTIL_FOUND)
   if (AVFORMAT_FOUND)
     set(FFMPEG_LIBRARIES
       ${FFMPEG_LIBRARIES}
       ${AVFORMAT_LIBRARY}
     )
+    set(FFMPEG_INCLUDE_DIRS
+      ${AVFORMAT_INCLUDE_DIR}
+      ${FFMPEG_INCLUDE_DIRS}
+    )
   endif (AVFORMAT_FOUND)
   if (POSTPROC_FOUND)
     set(FFMPEG_LIBRARIES
       ${FFMPEG_LIBRARIES}
       ${POSTPROC_LIBRARY}
     )
+    set(FFMPEG_INCLUDE_DIRS
+      ${POSTPROC_INCLUDE_DIR}
+      ${FFMPEG_INCLUDE_DIRS}
+    )
   endif (POSTPROC_FOUND)
   if (SWSCALE_FOUND)
     set(FFMPEG_LIBRARIES
       ${FFMPEG_LIBRARIES}
       ${SWSCALE_LIBRARY}
+    )
+    set(FFMPEG_INCLUDE_DIRS
+      ${SWSCALE_INCLUDE_DIR}
+      ${FFMPEG_INCLUDE_DIRS}
     )
   endif (SWSCALE_FOUND)


no need for our own FindCellML any more.

--- cmake/FindCellML.cmake
+++ cmake/FindCellML.cmake
@@ -1,40 +0,0 @@
-FIND_PATH(CELLML_INCLUDE_DIR IfaceCellML_APISPEC.hxx
-    ${CSIM_DEPENDENCY_DIR}/include
-)
-
-FIND_LIBRARY(CELLML_LIBRARY cellml
-    ${CSIM_DEPENDENCY_DIR}/lib
-)
-
-FIND_LIBRARY(CCGS_LIBRARY ccgs
-    ${CSIM_DEPENDENCY_DIR}/lib
-)
-FIND_LIBRARY(ANNO_TOOLS_LIBRARY annotools
-    ${CSIM_DEPENDENCY_DIR}/lib
-)
-FIND_LIBRARY(CEVAS_LIBRARY cevas
-    ${CSIM_DEPENDENCY_DIR}/lib
-)
-FIND_LIBRARY(CUSES_LIBRARY cuses
-    ${CSIM_DEPENDENCY_DIR}/lib
-)
-FIND_LIBRARY(MALAES_LIBRARY malaes
-    ${CSIM_DEPENDENCY_DIR}/lib
-)
-
-IF (CELLML_INCLUDE_DIR AND CELLML_LIBRARY AND CCGS_LIBRARY AND ANNO_TOOLS_LIBRARY AND CEVAS_LIBRARY AND CUSES_LIBRARY AND MALAES_LIBRARY)
-   SET(CELLML_LIBRARIES ${CELLML_LIBRARY} ${CCGS_LIBRARY} ${ANNO_TOOLS_LIBRARY} ${CEVAS_LIBRARY} ${CUSES_LIBRARY} ${MALAES_LIBRARY})
-   SET(CELLML_FOUND TRUE)
-ENDIF ()
-
-IF (CELLML_FOUND)
-   IF (NOT CELLML_FIND_QUIETLY)
-      MESSAGE(STATUS "Found CELLML: ${CELLML_LIBRARIES}")
-   ENDIF ()
-ELSE ()
-   IF (CELLML_FIND_REQUIRED)
-      MESSAGE(FATAL_ERROR "Could not find CellML API")
-   ELSE ()
-      MESSAGE(STATUS "CellML API not found")
-   ENDIF ()
-ENDIF ()


Update HunterGate module

Update HunterGate module

--- cmake/HunterGate.cmake
+++ cmake/HunterGate.cmake
@@ -1,14 +1,40 @@
-# Copyright (c) 2013-2014, Ruslan Baratov
+# Copyright (c) 2013-2015, Ruslan Baratov
 # All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+#
+# * Redistributions of source code must retain the above copyright notice, this
+#   list of conditions and the following disclaimer.
+#
+# * Redistributions in binary form must reproduce the above copyright notice,
+#   this list of conditions and the following disclaimer in the documentation
+#   and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

 # This is a gate file to Hunter package manager.
-# Usage: include this file using `include` command and add package you need:
+# Include this file using `include` command and add package you need, example:
+#
+#     cmake_minimum_required(VERSION 3.0)
 #
 #     include("cmake/HunterGate.cmake")
 #     HunterGate(
 #         URL "https://github.com/path/to/hunter/archive.tar.gz"
 #         SHA1 "798501e983f14b28b10cda16afa4de69eee1da1d"
 #     )
+#
+#     project(MyProject)
+#
 #     hunter_add_package(Foo)
 #     hunter_add_package(Boo COMPONENTS Bar Baz)
 #
@@ -16,184 +42,235 @@
 #     * https://github.com/hunter-packages/gate/
 #     * https://github.com/ruslo/hunter

-cmake_minimum_required(VERSION 3.0)
-include(CMakeParseArguments)
-
-# Set HUNTER_ROOT cmake variable to suitable value.
-# Info about variable can be found in HUNTER_ROOT_INFO.
+cmake_minimum_required(VERSION 3.0) # Minimum for Hunter
+include(CMakeParseArguments) # cmake_parse_arguments
+
+option(HUNTER_ENABLED "Enable Hunter package manager support" ON)
+option(HUNTER_STATUS_PRINT "Print working status" ON)
+option(HUNTER_STATUS_DEBUG "Print a lot info" OFF)
+
+set(HUNTER_WIKI "https://github.com/ruslo/hunter/wiki")
+
+function(hunter_gate_status_print)
+  foreach(print_message ${ARGV})
+    if(HUNTER_STATUS_PRINT OR HUNTER_STATUS_DEBUG)
+      message(STATUS "[hunter] ${print_message}")
+    endif()
+  endforeach()
+endfunction()
+
+function(hunter_gate_status_debug)
+  foreach(print_message ${ARGV})
+    if(HUNTER_STATUS_DEBUG)
+      string(TIMESTAMP timestamp)
+      message(STATUS "[hunter *** DEBUG *** ${timestamp}] ${print_message}")
+    endif()
+  endforeach()
+endfunction()
+
+function(hunter_gate_wiki wiki_page)
+  message("------------------------------ WIKI -------------------------------")
+  message("    ${HUNTER_WIKI}/${wiki_page}")
+  message("-------------------------------------------------------------------")
+  message("")
+  message(FATAL_ERROR "")
+endfunction()
+
+function(hunter_gate_internal_error)
+  message("")
+  foreach(print_message ${ARGV})
+    message("[hunter ** INTERNAL **] ${print_message}")
+  endforeach()
+  message("[hunter ** INTERNAL **] [Directory:${CMAKE_CURRENT_LIST_DIR}]")
+  message("")
+  hunter_gate_wiki("error.internal")
+endfunction()
+
+function(hunter_gate_fatal_error)
+  cmake_parse_arguments(hunter "" "WIKI" "" "${ARGV}")
+  string(COMPARE EQUAL "${hunter_WIKI}" "" have_no_wiki)
+  if(have_no_wiki)
+    hunter_gate_internal_error("Expected wiki")
+  endif()
+  message("")
+  foreach(x ${hunter_UNPARSED_ARGUMENTS})
+    message("[hunter ** FATAL ERROR **] ${x}")
+  endforeach()
+  message("[hunter ** FATAL ERROR **] [Directory:${CMAKE_CURRENT_LIST_DIR}]")
+  message("")
+  hunter_gate_wiki("${hunter_WIKI}")
+endfunction()
+
+function(hunter_gate_user_error)
+  hunter_gate_fatal_error(${ARGV} WIKI "error.incorrect.input.data")
+endfunction()
+
+function(hunter_gate_self root version sha1 result)
+  string(COMPARE EQUAL "${root}" "" is_bad)
+  if(is_bad)
+    hunter_gate_internal_error("root is empty")
+  endif()
+
+  string(COMPARE EQUAL "${version}" "" is_bad)
+  if(is_bad)
+    hunter_gate_internal_error("version is empty")
+  endif()
+
+  string(COMPARE EQUAL "${sha1}" "" is_bad)
+  if(is_bad)
+    hunter_gate_internal_error("sha1 is empty")
+  endif()
+
+  string(SUBSTRING "${sha1}" 0 7 archive_id)
+
+  if(EXISTS "${root}/cmake/Hunter")
+    set(hunter_self "${root}")
+  else()
+    set(
+        hunter_self
+        "${root}/_Base/Download/Hunter/${version}/${archive_id}/Unpacked"
+    )
+  endif()
+
+  set("${result}" "${hunter_self}" PARENT_SCOPE)
+endfunction()
+
+# Set HUNTER_GATE_ROOT cmake variable to suitable value.
 function(hunter_gate_detect_root)
   # Check CMake variable
-  if(HUNTER_ROOT)
-    set(HUNTER_ROOT_INFO "HUNTER_ROOT detected by cmake variable" PARENT_SCOPE)
+  string(COMPARE NOTEQUAL "${HUNTER_ROOT}" "" not_empty)
+  if(not_empty)
+    set(HUNTER_GATE_ROOT "${HUNTER_ROOT}" PARENT_SCOPE)
+    hunter_gate_status_debug("HUNTER_ROOT detected by cmake variable")
     return()
   endif()

   # Check environment variable
   string(COMPARE NOTEQUAL "$ENV{HUNTER_ROOT}" "" not_empty)
   if(not_empty)
-    set(HUNTER_ROOT "$ENV{HUNTER_ROOT}" PARENT_SCOPE)
-    set(
-        HUNTER_ROOT_INFO
-        "HUNTER_ROOT detected by environment variable"
-        PARENT_SCOPE
-    )
+    set(HUNTER_GATE_ROOT "$ENV{HUNTER_ROOT}" PARENT_SCOPE)
+    hunter_gate_status_debug("HUNTER_ROOT detected by environment variable")
     return()
   endif()

   # Check HOME environment variable
   string(COMPARE NOTEQUAL "$ENV{HOME}" "" result)
   if(result)
-    set(HUNTER_ROOT "$ENV{HOME}/HunterPackages" PARENT_SCOPE)
-    set(
-        HUNTER_ROOT_INFO
-        "HUNTER_ROOT set using HOME environment variable"
-        PARENT_SCOPE
-    )
+    set(HUNTER_GATE_ROOT "$ENV{HOME}/.hunter" PARENT_SCOPE)
+    hunter_gate_status_debug("HUNTER_ROOT set using HOME environment variable")
     return()
   endif()

-  # Check PROGRAMFILES environment variable (windows only)
+  # Check SYSTEMDRIVE and USERPROFILE environment variable (windows only)
   if(WIN32)
-    string(COMPARE NOTEQUAL "$ENV{PROGRAMFILES}" "" result)
+    string(COMPARE NOTEQUAL "$ENV{SYSTEMDRIVE}" "" result)
     if(result)
-      set(HUNTER_ROOT "$ENV{PROGRAMFILES}/HunterPackages" PARENT_SCOPE)
-      set(
-          HUNTER_ROOT_INFO
-          "HUNTER_ROOT set using PROGRAMFILES environment variable"
-          PARENT_SCOPE
+      set(HUNTER_GATE_ROOT "$ENV{SYSTEMDRIVE}/.hunter" PARENT_SCOPE)
+      hunter_gate_status_debug(
+          "HUNTER_ROOT set using SYSTEMDRIVE environment variable"
       )
       return()
     endif()
-  endif()
-
-  # Create in project
-  if(NOT PROJECT_SOURCE_DIR)
-     message(FATAL_ERROR "PROJECT_SOURCE_DIR is empty")
-  endif()
-
-  set(HUNTER_ROOT "${PROJECT_SOURCE_DIR}/HunterPackages" PARENT_SCOPE)
-  set(
-      HUNTER_ROOT_INFO
-      "HUNTER_ROOT set by project sources directory"
-      PARENT_SCOPE
-  )
-endfunction()
-
-# If several processes simultaneously try to init base hunter directory
-# this synchronisation helps to do it correctly
-function(hunter_gate_try_lock result)
-  if(NOT HUNTER_LOCK_PATH)
-    message(FATAL_ERROR "Internal error (HUNTER_LOCK_PATH is empty)")
-  endif()
-
-  if(NOT HUNTER_LOCK_INFO)
-    message(FATAL_ERROR "Internal error (HUNTER_LOCK_INFO is empty)")
-  endif()
-
-  if(NOT HUNTER_LOCK_FULL_INFO)
-    message(FATAL_ERROR "Internal error (HUNTER_LOCK_FULL_INFO is empty)")
-  endif()
-
-  if(NOT PROJECT_BINARY_DIR)
-    message(FATAL_ERROR "Internal error (PROJECT_BINARY_DIR is empty)")
-  endif()
-
-  file(TO_NATIVE_PATH "${HUNTER_LOCK_PATH}" lock_path)
-
-  # `cmake -E make_directory` is not fit here because this command succeed
-  # even if directory already exists
-  if(WIN32)
-    if(MINGW)
-      # He-he :)
-      string(REPLACE "/" "\\" lock_path "${lock_path}")
-    endif()
-    execute_process(
-        COMMAND cmd /C mkdir "${lock_path}"
-        RESULT_VARIABLE lock_result
-        OUTPUT_VARIABLE lock_result_info
-        ERROR_VARIABLE lock_result_info
-    )
-  else()
-    execute_process(
-        COMMAND mkdir "${lock_path}"
-        RESULT_VARIABLE lock_result
-        OUTPUT_VARIABLE lock_result_info
-        ERROR_VARIABLE lock_result_info
-    )
-  endif()
-
-  if(NOT lock_result EQUAL 0)
-    message("Lock failed with result: ${lock_result}")
-    message("Reason:  ${lock_result_info}")
-    set(${result} FALSE PARENT_SCOPE)
+
+    string(COMPARE NOTEQUAL "$ENV{USERPROFILE}" "" result)
+    if(result)
+      set(HUNTER_GATE_ROOT "$ENV{USERPROFILE}/.hunter" PARENT_SCOPE)
+      hunter_gate_status_debug(
+          "HUNTER_ROOT set using USERPROFILE environment variable"
+      )
+      return()
+    endif()
+  endif()
+
+  hunter_gate_fatal_error(
+      "Can't detect HUNTER_ROOT"
+      WIKI "error.detect.hunter.root"
+  )
+endfunction()
+
+macro(hunter_gate_lock dir)
+  if(NOT HUNTER_SKIP_LOCK)
+    if("${CMAKE_VERSION}" VERSION_LESS "3.2")
+      hunter_gate_fatal_error(
+          "Can't lock, upgrade to CMake 3.2 or use HUNTER_SKIP_LOCK"
+          WIKI "error.can.not.lock"
+      )
+    endif()
+    hunter_gate_status_debug("Locking directory: ${dir}")
+    file(LOCK "${dir}" DIRECTORY GUARD FUNCTION)
+    hunter_gate_status_debug("Lock done")
+  endif()
+endmacro()
+
+function(hunter_gate_download dir)
+  string(
+      COMPARE
+      NOTEQUAL
+      "$ENV{HUNTER_DISABLE_AUTOINSTALL}"
+      ""
+      disable_autoinstall
+  )
+  if(disable_autoinstall AND NOT HUNTER_RUN_INSTALL)
+    hunter_gate_fatal_error(
+        "Hunter not found in '${dir}'"
+        "Set HUNTER_RUN_INSTALL=ON to auto-install it from '${HUNTER_GATE_URL}'"
+        "Settings:"
+        "  HUNTER_ROOT: ${HUNTER_GATE_ROOT}"
+        "  HUNTER_SHA1: ${HUNTER_GATE_SHA1}"
+        WIKI "error.run.install"
+    )
+  endif()
+  string(COMPARE EQUAL "${dir}" "" is_bad)
+  if(is_bad)
+    hunter_gate_internal_error("Empty 'dir' argument")
+  endif()
+
+  string(COMPARE EQUAL "${HUNTER_GATE_SHA1}" "" is_bad)
+  if(is_bad)
+    hunter_gate_internal_error("HUNTER_GATE_SHA1 empty")
+  endif()
+
+  string(COMPARE EQUAL "${HUNTER_GATE_URL}" "" is_bad)
+  if(is_bad)
+    hunter_gate_internal_error("HUNTER_GATE_URL empty")
+  endif()
+
+  set(done_location "${dir}/DONE")
+  set(sha1_location "${dir}/SHA1")
+
+  set(build_dir "${dir}/Build")
+  set(cmakelists "${dir}/CMakeLists.txt")
+
+  hunter_gate_lock("${dir}")
+  if(EXISTS "${done_location}")
+    # while waiting for lock other instance can do all the job
+    hunter_gate_status_debug("File '${done_location}' found, skip install")
     return()
   endif()

-  file(WRITE "${HUNTER_LOCK_INFO}" "${PROJECT_BINARY_DIR}")
-
-  string(TIMESTAMP time_now)
+  file(REMOVE_RECURSE "${build_dir}")
+  file(REMOVE_RECURSE "${cmakelists}")
+
+  file(MAKE_DIRECTORY "${build_dir}") # check directory permissions
+
+  # Disabling languages speeds up a little bit, reduces noise in the output
+  # and avoids path too long windows error
   file(
       WRITE
-      "${HUNTER_LOCK_FULL_INFO}"
-      "    Project binary directory: ${PROJECT_BINARY_DIR}\n"
-      "    Build start at: ${time_now}"
-  )
-
-  set(${result} TRUE PARENT_SCOPE)
-endfunction()
-
-# Download project to HUNTER_BASE
-function(hunter_gate_do_download)
-  if(NOT HUNTER_BASE)
-    message(FATAL_ERROR "Internal error (HUNTER_BASE is empty)")
-  endif()
-
-  if(NOT HUNTER_GATE_INSTALL_DONE)
-    message(FATAL_ERROR "Internal error (HUNTER_GATE_INSTALL_DONE is empty)")
-  endif()
-
-  if(NOT HUNTER_LOCK_PATH)
-    message(FATAL_ERROR "Internal error (HUNTER_LOCK_PATH is empty)")
-  endif()
-
-  if(NOT PROJECT_BINARY_DIR)
-    message(
-        FATAL_ERROR
-        "PROJECT_BINARY_DIR is empty. "
-        "Move HunterGate file **after** first project command"
-    )
-  endif()
-
-  hunter_gate_try_lock(lock_successful)
-  if(NOT lock_successful)
-    # Return and wait until HUNTER_GATE_INSTALL_DONE created
-    return()
-  endif()
-
-  set(TEMP_DIR "${PROJECT_BINARY_DIR}/_3rdParty/gate")
-  set(TEMP_BUILD "${TEMP_DIR}/_builds")
-
-  message(
-      STATUS
-      "[hunter] Hunter not found, start download to '${HUNTER_BASE}' ..."
-      "(${TEMP_BUILD})"
-  )
-
-  file(
-      WRITE
-      "${TEMP_DIR}/CMakeLists.txt"
-      "cmake_minimum_required(VERSION 2.8.10)\n"
+      "${cmakelists}"
+      "cmake_minimum_required(VERSION 3.0)\n"
+      "project(HunterDownload LANGUAGES NONE)\n"
       "include(ExternalProject)\n"
       "ExternalProject_Add(\n"
       "    Hunter\n"
       "    URL\n"
-      "    \"${HUNTER_URL}\"\n"
+      "    \"${HUNTER_GATE_URL}\"\n"
       "    URL_HASH\n"
-      "    SHA1=${HUNTER_SHA1}\n"
+      "    SHA1=${HUNTER_GATE_SHA1}\n"
       "    DOWNLOAD_DIR\n"
-      "    \"${HUNTER_BASE}/Download\"\n"
+      "    \"${dir}\"\n"
       "    SOURCE_DIR\n"
-      "    \"${HUNTER_BASE}/Self\"\n"
+      "    \"${dir}/Unpacked\"\n"
       "    CONFIGURE_COMMAND\n"
       "    \"\"\n"
       "    BUILD_COMMAND\n"
@@ -203,142 +280,218 @@
       ")\n"
   )

-  # CMAKE_*_COMPILER_WORKS speed up a little bit
-  # and avoid path too long windows error
+  if(HUNTER_STATUS_DEBUG)
+    set(logging_params "")
+  else()
+    set(logging_params OUTPUT_QUIET)
+  endif()
+
+  hunter_gate_status_debug("Run generate")
   execute_process(
-      COMMAND
-          "${CMAKE_COMMAND}"
-          "-H${TEMP_DIR}"
-          "-B${TEMP_BUILD}"
-          -DCMAKE_CXX_COMPILER_WORKS=ON
-          -DCMAKE_C_COMPILER_WORKS=ON
-      WORKING_DIRECTORY "${TEMP_DIR}"
-      RESULT_VARIABLE HUNTER_DOWNLOAD_RESULT
-  )
-
-  if(NOT HUNTER_DOWNLOAD_RESULT EQUAL 0)
-    message(FATAL_ERROR "Configure download project failed")
-  endif()
-
+      COMMAND "${CMAKE_COMMAND}" "-H${dir}" "-B${build_dir}"
+      WORKING_DIRECTORY "${dir}"
+      RESULT_VARIABLE download_result
+      ${logging_params}
+  )
+
+  if(NOT download_result EQUAL 0)
+    hunter_gate_internal_error("Configure project failed")
+  endif()
+
+  hunter_gate_status_print(
+      "Initializing Hunter workspace (${HUNTER_GATE_SHA1})"
+      "  ${HUNTER_GATE_URL}"
+      "  -> ${dir}"
+  )
   execute_process(
-      COMMAND
-      "${CMAKE_COMMAND}" --build "${TEMP_BUILD}"
-      WORKING_DIRECTORY
-      "${TEMP_DIR}"
-      RESULT_VARIABLE
-      HUNTER_DOWNLOAD_RESULT
-  )
-
-  if(NOT HUNTER_DOWNLOAD_RESULT EQUAL 0)
-    message(FATAL_ERROR "Build download project failed")
-  endif()
-
-  file(REMOVE_RECURSE "${HUNTER_LOCK_PATH}")
-  file(WRITE "${HUNTER_GATE_INSTALL_DONE}" "done")
-
-  message(STATUS "[hunter] downloaded to '${HUNTER_BASE}'")
-endfunction()
-
+      COMMAND "${CMAKE_COMMAND}" --build "${build_dir}"
+      WORKING_DIRECTORY "${dir}"
+      RESULT_VARIABLE download_result
+      ${logging_params}
+  )
+
+  if(NOT download_result EQUAL 0)
+    hunter_gate_internal_error("Build project failed")
+  endif()
+
+  file(REMOVE_RECURSE "${build_dir}")
+  file(REMOVE_RECURSE "${cmakelists}")
+
+  file(WRITE "${sha1_location}" "${HUNTER_GATE_SHA1}")
+  file(WRITE "${done_location}" "DONE")
+
+  hunter_gate_status_debug("Finished")
+endfunction()
+
+# Must be a macro so master file 'cmake/Hunter' can
+# apply all variables easily just by 'include' command
+# (otherwise PARENT_SCOPE magic needed)
 macro(HunterGate)
-  # HUNTER_SHA1 may already be defined by other project
-  if(NOT HUNTER_SHA1)
-    cmake_parse_arguments(HUNTER "" "URL;SHA1" "" ${ARGV})
-    if(HUNTER_UNPARSED_ARGUMENTS)
-      message(FATAL_ERROR "HunterGate unparsed arguments")
-    endif()
-  endif()
-
-  hunter_gate_detect_root() # set HUNTER_ROOT and HUNTER_ROOT_INFO
-
-  if(NOT HUNTER_ROOT)
-    message(FATAL_ERROR "Internal error: HUNTER_ROOT is not set")
-  endif()
-
-  # Beautify path, fix probable problems with windows path slashes
-  get_filename_component(HUNTER_ROOT "${HUNTER_ROOT}" ABSOLUTE)
-
-  if(EXISTS "${HUNTER_ROOT}/cmake/Hunter")
-    # hunter installed manually
-    set(HUNTER_SHA1 "")
-    set(HUNTER_URL "")
-    set(HUNTER_BASE "${HUNTER_ROOT}")
-    set(HUNTER_SELF "${HUNTER_ROOT}")
-    set(HUNTER_GATE_INSTALL_DONE "${HUNTER_BASE}")
+  if(HUNTER_GATE_DONE)
+    # variable HUNTER_GATE_DONE set explicitly for external project
+    # (see `hunter_download`)
+    set_property(GLOBAL PROPERTY HUNTER_GATE_DONE YES)
+  endif()
+
+  # First HunterGate command will init Hunter, others will be ignored
+  get_property(_hunter_gate_done GLOBAL PROPERTY HUNTER_GATE_DONE SET)
+
+  if(NOT HUNTER_ENABLED)
+    # Empty function to avoid error "unknown function"
+    function(hunter_add_package)
+    endfunction()
+  elseif(_hunter_gate_done)
+    hunter_gate_status_debug("Secondary HunterGate (use old settings)")
+    hunter_gate_self(
+        "${HUNTER_CACHED_ROOT}"
+        "${HUNTER_VERSION}"
+        "${HUNTER_SHA1}"
+        _hunter_self
+    )
+    include("${_hunter_self}/cmake/Hunter")
   else()
-    set(HUNTER_BASE "${HUNTER_ROOT}/_Base/${HUNTER_SHA1}")
-    set(HUNTER_SELF "${HUNTER_BASE}/Self")
-    set(HUNTER_GATE_INSTALL_DONE "${HUNTER_BASE}/install-gate-done")
-  endif()
-
-  set(HUNTER_URL "${HUNTER_URL}" CACHE STRING "Hunter archive URL")
-  set(HUNTER_SHA1 "${HUNTER_SHA1}" CACHE STRING "Hunter archive SHA1 hash")
-
-  # Beautify path, fix probable problems with windows path slashes
-  get_filename_component(HUNTER_BASE "${HUNTER_BASE}" ABSOLUTE)
-  get_filename_component(HUNTER_SELF "${HUNTER_SELF}" ABSOLUTE)
-
-  set(HUNTER_ROOT "${HUNTER_ROOT}" CACHE PATH "Hunter root directory")
-  set(HUNTER_BASE "${HUNTER_BASE}" CACHE PATH "Hunter base directory")
-  set(HUNTER_SELF "${HUNTER_SELF}" CACHE PATH "Hunter self directory")
-
-  set(HUNTER_LOCK_PATH "${HUNTER_BASE}/directory-lock")
-  set(HUNTER_LOCK_INFO "${HUNTER_LOCK_PATH}/info")
-  set(HUNTER_LOCK_FULL_INFO "${HUNTER_LOCK_PATH}/fullinfo")
-
-  if(NOT EXISTS "${HUNTER_BASE}")
-    file(MAKE_DIRECTORY "${HUNTER_BASE}")
-    if(NOT EXISTS "${HUNTER_BASE}")
-      message(
-          FATAL_ERROR
-          "Can't create directory `${HUNTER_BASE}`"
-          "(probably no permissions)"
+    set(HUNTER_GATE_LOCATION "${CMAKE_CURRENT_LIST_DIR}")
+
+    string(COMPARE NOTEQUAL "${PROJECT_NAME}" "" _have_project_name)
+    if(_have_project_name)
+      hunter_gate_fatal_error(
+          "Please set HunterGate *before* 'project' command. "
+          "Detected project: ${PROJECT_NAME}"
+          WIKI "error.huntergate.before.project"
       )
     endif()
-    hunter_gate_do_download()
-  endif()
-
-  while(NOT EXISTS "${HUNTER_GATE_INSTALL_DONE}")
-    # Directory already created, but installation is not finished yet
-    if(EXISTS "${HUNTER_LOCK_FULL_INFO}")
-      file(READ "${HUNTER_LOCK_FULL_INFO}" _fullinfo)
+
+    cmake_parse_arguments(
+        HUNTER_GATE "LOCAL" "URL;SHA1;GLOBAL;FILEPATH" "" ${ARGV}
+    )
+
+    string(COMPARE EQUAL "${HUNTER_GATE_SHA1}" "" _empty_sha1)
+    string(COMPARE EQUAL "${HUNTER_GATE_URL}" "" _empty_url)
+    string(
+        COMPARE
+        NOTEQUAL
+        "${HUNTER_GATE_UNPARSED_ARGUMENTS}"
+        ""
+        _have_unparsed
+    )
+    string(COMPARE NOTEQUAL "${HUNTER_GATE_GLOBAL}" "" _have_global)
+    string(COMPARE NOTEQUAL "${HUNTER_GATE_FILEPATH}" "" _have_filepath)
+
+    if(_empty_sha1)
+      hunter_gate_user_error("SHA1 suboption of HunterGate is mandatory")
+    endif()
+    if(_empty_url)
+      hunter_gate_user_error("URL suboption of HunterGate is mandatory")
+    endif()
+    if(_have_unparsed)
+      hunter_gate_user_error(
+          "HunterGate unparsed arguments: ${HUNTER_GATE_UNPARSED_ARGUMENTS}"
+      )
+    endif()
+    if(_have_global)
+      if(HUNTER_GATE_LOCAL)
+        hunter_gate_user_error("Unexpected LOCAL (already has GLOBAL)")
+      endif()
+      if(_have_filepath)
+        hunter_gate_user_error("Unexpected FILEPATH (already has GLOBAL)")
+      endif()
+    endif()
+    if(HUNTER_GATE_LOCAL)
+      if(_have_global)
+        hunter_gate_user_error("Unexpected GLOBAL (already has LOCAL)")
+      endif()
+      if(_have_filepath)
+        hunter_gate_user_error("Unexpected FILEPATH (already has LOCAL)")
+      endif()
+    endif()
+    if(_have_filepath)
+      if(_have_global)
+        hunter_gate_user_error("Unexpected GLOBAL (already has FILEPATH)")
+      endif()
+      if(HUNTER_GATE_LOCAL)
+        hunter_gate_user_error("Unexpected LOCAL (already has FILEPATH)")
+      endif()
+    endif()
+
+    hunter_gate_detect_root() # set HUNTER_GATE_ROOT
+
+    # Beautify path, fix probable problems with windows path slashes
+    get_filename_component(
+        HUNTER_GATE_ROOT "${HUNTER_GATE_ROOT}" ABSOLUTE
+    )
+    hunter_gate_status_debug("HUNTER_ROOT: ${HUNTER_GATE_ROOT}")
+    if(NOT HUNTER_ALLOW_SPACES_IN_PATH)
+      string(FIND "${HUNTER_GATE_ROOT}" " " _contain_spaces)
+      if(NOT _contain_spaces EQUAL -1)
+        hunter_gate_fatal_error(
+            "HUNTER_ROOT (${HUNTER_GATE_ROOT}) contains spaces."
+            "Set HUNTER_ALLOW_SPACES_IN_PATH=ON to skip this error"
+            "(Use at your own risk!)"
+            WIKI "error.spaces.in.hunter.root"
+        )
+      endif()
+    endif()
+
+    string(
+        REGEX
+        MATCH
+        "[0-9]+\\.[0-9]+\\.[0-9]+[-_a-z0-9]*"
+        HUNTER_GATE_VERSION
+        "${HUNTER_GATE_URL}"
+    )
+    string(COMPARE EQUAL "${HUNTER_GATE_VERSION}" "" _is_empty)
+    if(_is_empty)
+      set(HUNTER_GATE_VERSION "unknown")
+    endif()
+
+    hunter_gate_self(
+        "${HUNTER_GATE_ROOT}"
+        "${HUNTER_GATE_VERSION}"
+        "${HUNTER_GATE_SHA1}"
+        _hunter_self
+    )
+
+    set(_master_location "${_hunter_self}/cmake/Hunter")
+    if(EXISTS "${HUNTER_GATE_ROOT}/cmake/Hunter")
+      # Hunter downloaded manually (e.g. by 'git clone')
+      set(_unused "xxxxxxxxxx")
+      set(HUNTER_GATE_SHA1 "${_unused}")
+      set(HUNTER_GATE_VERSION "${_unused}")
     else()
-      set(_fullinfo "????")
-    endif()
-    string(TIMESTAMP _time_now)
-    message(
-        "[${_time_now}] Install already triggered, waiting for:\n${_fullinfo}\n"
-        "If that build cancelled (interrupted by user or some other reason), "
-        "please remove this directory manually:\n\n"
-        "    ${HUNTER_LOCK_PATH}\n\n"
-        "then run CMake again."
-    )
-    # Some sanity checks
-    if(EXISTS "${HUNTER_LOCK_INFO}")
-      file(READ "${HUNTER_LOCK_INFO}" _info)
-      string(COMPARE EQUAL "${_info}" "${PROJECT_BINARY_DIR}" incorrect)
-      if(incorrect)
-        message(FATAL_ERROR "Waiting for self")
-      endif()
-      if(NOT EXISTS "${_info}")
-        # Do not crash here, this may happens (checking/reading is not atomic)
-        message("Waiting for deleted directory!")
-      endif()
-    endif()
-    execute_process(COMMAND "${CMAKE_COMMAND}" -E sleep 1)
-  endwhile()
-
-  if(NOT EXISTS "${HUNTER_SELF}/cmake/Hunter")
-    message(
-        FATAL_ERROR
-        "Internal error can't find master file in directory `${HUNTER_BASE}`"
-    )
-  endif()
-
-  # HUNTER_BASE found or downloaded if not exists, i.e. can be used now
-  include("${HUNTER_SELF}/cmake/Hunter")
-
-  include(hunter_status_debug)
-  hunter_status_debug("${HUNTER_ROOT_INFO}")
-
-  include(hunter_add_package)
+      get_filename_component(_archive_id_location "${_hunter_self}/.." ABSOLUTE)
+      set(_done_location "${_archive_id_location}/DONE")
+      set(_sha1_location "${_archive_id_location}/SHA1")
+
+      # Check Hunter already downloaded by HunterGate
+      if(NOT EXISTS "${_done_location}")
+        hunter_gate_download("${_archive_id_location}")
+      endif()
+
+      if(NOT EXISTS "${_done_location}")
+        hunter_gate_internal_error("hunter_gate_download failed")
+      endif()
+
+      if(NOT EXISTS "${_sha1_location}")
+        hunter_gate_internal_error("${_sha1_location} not found")
+      endif()
+      file(READ "${_sha1_location}" _sha1_value)
+      string(COMPARE EQUAL "${_sha1_value}" "${HUNTER_GATE_SHA1}" _is_equal)
+      if(NOT _is_equal)
+        hunter_gate_internal_error(
+            "Short SHA1 collision:"
+            "  ${_sha1_value} (from ${_sha1_location})"
+            "  ${HUNTER_GATE_SHA1} (HunterGate)"
+        )
+      endif()
+      if(NOT EXISTS "${_master_location}")
+        hunter_gate_user_error(
+            "Master file not found:"
+            "  ${_master_location}"
+            "try to update Hunter/HunterGate"
+        )
+      endif()
+    endif()
+    include("${_master_location}")
+    set_property(GLOBAL PROPERTY HUNTER_GATE_DONE YES)
+  endif()
 endmacro()


Updated RapaFindQt.cmake

Updated RapaFindQt.cmake

--- cmake/RapaFindQt.cmake
+++ cmake/RapaFindQt.cmake
@@ -28,23 +28,21 @@
 			GET_TARGET_PROPERTY( RAPA_QT_CORE_DEBUG_DLL Qt5::Core LOCATION_DEBUG )
 			SET( RAPA_QT_ROOT_DIR "${RAPA_QT_CORE_DEBUG_DLL}/../.." )
 			GET_FILENAME_COMPONENT( RAPA_QT_ROOT_DIR ${RAPA_QT_ROOT_DIR} ABSOLUTE)
+
+			FILE( GLOB RAPA_QT_ICU_DLLS "${RAPA_QT_ROOT_DIR}/bin/icu*.dll")		# Find ICU DLLs
 			SET( RAPA_QT_DEBUG_DLLS
-				${RAPA_QT_ROOT_DIR}/bin/icudt53.dll
-				${RAPA_QT_ROOT_DIR}/bin/icuin53.dll
-				${RAPA_QT_ROOT_DIR}/bin/icuuc53.dll
 				${RAPA_QT_ROOT_DIR}/bin/Qt5Cored.dll
 				${RAPA_QT_ROOT_DIR}/bin/Qt5Guid.dll
 				${RAPA_QT_ROOT_DIR}/bin/Qt5Widgetsd.dll )
+			SET( RAPA_QT_DEBUG_DLLS ${RAPA_QT_DEBUG_DLLS} ${RAPA_QT_ICU_DLLS} )
 			SET( RAPA_QT_DEBUG_PLATFORMS_DLLS
 				${RAPA_QT_ROOT_DIR}/plugins/platforms/qwindowsd.dll )

 			SET( RAPA_QT_RELEASE_DLLS
-				${RAPA_QT_ROOT_DIR}/bin/icudt53.dll
-				${RAPA_QT_ROOT_DIR}/bin/icuin53.dll
-				${RAPA_QT_ROOT_DIR}/bin/icuuc53.dll
 				${RAPA_QT_ROOT_DIR}/bin/Qt5Core.dll
 				${RAPA_QT_ROOT_DIR}/bin/Qt5Gui.dll
 				${RAPA_QT_ROOT_DIR}/bin/Qt5Widgets.dll )
+			SET( RAPA_QT_RELEASE_DLLS ${RAPA_QT_RELEASE_DLLS} ${RAPA_QT_ICU_DLLS} )
 			SET( RAPA_QT_RELEASE_PLATFORMS_DLLS
 				${RAPA_QT_ROOT_DIR}/plugins/platforms/qwindows.dll )
 		ENDIF()


Keep clear distinction between device and device driver in self documentation.

svn path=/trunk/; revision=6856

--- cmake/modules/gd.cmake
+++ cmake/modules/gd.cmake
@@ -24,9 +24,9 @@
 # PLD_png             - ON means the png device is enabled
 # PLD_jpeg            - ON means the jpeg device is enabled
 # PLD_gif             - ON means the gif device is enabled
-# gd_COMPILE_FLAGS    - individual COMPILE_FLAGS required to compile gd device.
-# gd_LINK_FLAGS       - individual LINK_FLAGS for dynamic gd device.
-# DRIVERS_LINK_FLAGS  - list of LINK_FLAGS for all static devices.
+# gd_COMPILE_FLAGS    - COMPILE_FLAGS required to compile gd device driver.
+# gd_LINK_FLAGS       - LINK_FLAGS for dynamic gd device driver.
+# DRIVERS_LINK_FLAGS  - list of LINK_FLAGS for all static device drivers.
 #
 # Include file searches use FindPath. To add extra search directories to
 # set the environment variable CMAKE_INCLUDE_PATH or the CMake variable


Windows, compiling : Remove _DEBUG preprocessor constant, to fix
debug build with older cmake.

The constant is implicitely defined by VS when chosen C runtime is Debug
(/MTd, MDd).

CMake does not define it since https://public.kitware.com/Bug/view.php?id=15777
was fixed.

We remove it from compile flags, to be able to build Debug with /MT runtime
using older cmakes.

--- cmake/os/Windows.cmake
+++ cmake/os/Windows.cmake
@@ -97,6 +97,10 @@
   #     information for use with the debugger. The symbolic debugging
   #     information includes the names and types of variables, as well as
   #     functions and line numbers. No .pdb file is produced by the compiler.
+  #
+  # - Remove preprocessor flag _DEBUG that older cmakes use with Config=Debug,
+  #   it is as defined by Debug runtimes itself (/MTd /MDd)
+
   FOREACH(lang C CXX)
     SET(CMAKE_${lang}_FLAGS_RELEASE "${CMAKE_${lang}_FLAGS_RELEASE} /Z7")
   ENDFOREACH()
@@ -106,6 +110,7 @@
    CMAKE_CXX_FLAGS_RELEASE  CMAKE_CXX_FLAGS_RELWITHDEBINFO
    CMAKE_CXX_FLAGS_DEBUG    CMAKE_CXX_FLAGS_DEBUG_INIT)
    STRING(REGEX REPLACE "/M[TD][d]?"  "${MSVC_CRT_TYPE}" "${flag}"  "${${flag}}" )
+   STRING(REGEX REPLACE "/D[ ]?_DEBUG"  "" "${flag}" "${${flag}}")
    STRING(REPLACE "/Zi"  "/Z7" "${flag}" "${${flag}}")
   ENDFOREACH()


Merging develop into master

Merging develop into master

--- zoltan/cmake/Dependencies.cmake
+++ zoltan/cmake/Dependencies.cmake
@@ -1,3 +1,4 @@
 TRIBITS_PACKAGE_DEFINE_DEPENDENCIES(
   LIB_REQUIRED_PACKAGES SCORECapf Zoltan
+  LIB_REQUIRED_TPLS ParMETIS
   )


Fix include path for luajit

Fix include path for luajit

--- cmake/Modules/FindLua.cmake
+++ cmake/Modules/FindLua.cmake
@@ -64,21 +64,28 @@
       PATHS ${LUA_DIR}/../lib
       ${LUA_DIR}
       NO_DEFAULT_PATH)
+    FIND_PATH(LUA_INCLUDE_DIR lua.h
+      ${LUA_DIR}/../include/lua-5.1
+      ${LUA_DIR}/../include/lua51
+      ${LUA_DIR}/../include/lua
+      ${LUA_DIR}/../include
+      NO_DEFAULT_PATH)
   ELSE()
     FIND_LIBRARY(LUA_LIBRARIES
       NAMES luajit libluajit luajit-5.1 libluajit-5.1
       PATHS ${LUA_DIR}/../lib
       ${LUA_DIR}
       NO_DEFAULT_PATH)
+    FIND_PATH(LUA_INCLUDE_DIR lua.h
+      ${LUA_DIR}/../include/luajit-2.0
+      ${LUA_DIR}/../include/lua-5.1
+      ${LUA_DIR}/../include/lua51
+      ${LUA_DIR}/../include/lua
+      ${LUA_DIR}/../include
+      NO_DEFAULT_PATH)
   ENDIF()
   MESSAGE(STATUS "Lua library: ${LUA_LIBRARIES}")

-  FIND_PATH(LUA_INCLUDE_DIR lua.h
-    ${LUA_DIR}/../include/lua-5.1
-    ${LUA_DIR}/../include/lua51
-    ${LUA_DIR}/../include/lua
-    ${LUA_DIR}/../include
-    NO_DEFAULT_PATH)

   MESSAGE(STATUS "Lua include directory: ${LUA_INCLUDE_DIR}")


libssh on NetBSD and FreeBSD exists in /usr/lib - prefer ports/pkgsrc

--- cmake/Modules/FindSSH.cmake
+++ cmake/Modules/FindSSH.cmake
@@ -4,7 +4,11 @@

 find_path( LIBSSH_INCLUDE_DIR libssh/libssh.h )

-find_library( LIBSSH_LIBRARY NAMES ssh )
+find_library( LIBSSH_LIBRARY
+		NAMES ssh
+		PATHS /usr/local/lib /usr/pkg/lib /opt/lib /usr/lib /lib
+		NO_DEFAULT_PATH
+)

 include( FindPackageHandleStandardArgs )
 find_package_handle_standard_args( LibSSH DEFAULT_MSG LIBSSH_INCLUDE_DIR LIBSSH_LIBRARY )


disable the weak-vtables warning as it is masking other more important issues

--- cmake/clang_4_0_flags.cmake
+++ cmake/clang_4_0_flags.cmake
@@ -18,7 +18,7 @@
 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Weverything")
 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-c++98-compat")
 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-c++98-compat-pedantic")
-# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-weak-vtables")
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-weak-vtables")
 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-global-constructors")
 # set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-switch-enum")
 # set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-gnu-zero-variadic-macro-arguments")


Don't build mkl-dnn if user manually provides mkl-dnn. (#1018)

If user manully provide MKLDNN_INCLUDE_DIR and MKLDNN_LIB_DIR, don't
build mkl-dnn and just add a dummy external project "ext-_mkldnn" to
satisfy target dependency for the rest of the build.

--- cmake/external_mkldnn.cmake
+++ cmake/external_mkldnn.cmake
@@ -21,6 +21,18 @@
 #----------------------------------------------------------------------------------------------------------

 if(NGRAPH_CPU_ENABLE)
+    # User provided mkl-dnn
+    if(MKLDNN_INCLUDE_DIR AND MKLDNN_LIB_DIR)
+        ExternalProject_Add(
+            ext_mkldnn
+            DOWNLOAD_COMMAND ""
+            UPDATE_COMMAND ""
+            CONFIGURE_COMMAND ""
+            BUILD_COMMAND ""
+            INSTALL_COMMAND ""
+            )
+        return()
+    endif()

     set(MKLDNN_GIT_REPO_URL https://github.com/intel/mkl-dnn)
     set(MKLDNN_GIT_TAG "0e7ca73")


[cmake] update vulkan rules (#5777)

[cmake] update vulkan rules (#5777)

--- cmake/util/FindVulkan.cmake
+++ cmake/util/FindVulkan.cmake
@@ -62,7 +62,7 @@
   if(Vulkan_FOUND)
     get_filename_component(VULKAN_LIBRARY_PATH ${Vulkan_LIBRARY} DIRECTORY)
     find_library(Vulkan_SPIRV_TOOLS_LIBRARY SPIRV-Tools
-        HINTS ${VULKAN_LIBRARY_PATH} ${VULKAN_LIBRARY_PATH}/spirv-tools)
+        HINTS ${VULKAN_LIBRARY_PATH} ${VULKAN_LIBRARY_PATH}/spirv-tools ${VULKAN_SDK}/lib)

     find_path(_libspirv libspirv.h HINTS ${Vulkan_INCLUDE_DIRS} PATH_SUFFIXES vulkan spirv-tools)
     find_path(_spirv spirv.hpp HINTS ${Vulkan_INCLUDE_DIRS} PATH_SUFFIXES vulkan SPIRV spirv/unified1)


Testing gitignore

Testing gitignore

--- src/monot-vision/src/CMakeFiles/Makefile.cmake
+++ src/monot-vision/src/CMakeFiles/Makefile.cmake
@@ -21,6 +21,7 @@
   "/usr/share/cmake-2.8/Modules/CMakeCommonLanguageInclude.cmake"
   "/usr/share/cmake-2.8/Modules/CMakeGenericSystem.cmake"
   "/usr/share/cmake-2.8/Modules/CMakeSystemSpecificInformation.cmake"
+  "/usr/share/cmake-2.8/Modules/CMakeUnixFindMake.cmake"
   "/usr/share/cmake-2.8/Modules/Compiler/GNU-C.cmake"
   "/usr/share/cmake-2.8/Modules/Compiler/GNU-CXX.cmake"
   "/usr/share/cmake-2.8/Modules/Compiler/GNU.cmake"


Remove -lrt & -lnsl linker flags.

Remove -lrt & -lnsl linker flags.

--- dep/uv.cmake
+++ dep/uv.cmake
@@ -20,10 +20,7 @@

 set (TBAG_DEP_UV_DEPENDENCIES "")
 if (UNIX)
-    list (APPEND TBAG_DEP_UV_DEPENDENCIES -lpthread)
-    if (NOT APPLE)
-        list (APPEND TBAG_DEP_UV_DEPENDENCIES -lrt -lnsl -ldl)
-    endif ()
+    list (APPEND TBAG_DEP_UV_DEPENDENCIES -lpthread -ldl)
 endif ()

 set (TBAG_DEP_UV_LIBRARIES ${TBAG_DEP_UV_ARCHIVES}


Changed find_package to capital Git instead of lowercase git. Might make a difference for travis build failing...

--- src/cmake/git-download.cmake
+++ src/cmake/git-download.cmake
@@ -1,4 +1,4 @@
-find_package(git REQUIRED)
+find_package(Git REQUIRED)

 function(execute_git)
     set(options "")


COMP: Add BSplineGradient module as a dependency

For itkBSplineApproximationGradientImageFilter.h

--- itk-module.cmake
+++ itk-module.cmake
@@ -17,6 +17,7 @@
     ${_fft_depends}
   COMPILE_DEPENDS
     SplitComponents
+    BSplineGradient
   PRIVATE_DEPENDS
     ITKHDF5
   TEST_DEPENDS


Modernize add_unit_test stuff

Modernize add_unit_test stuff

--- cmake/DevBaseMacro.cmake
+++ cmake/DevBaseMacro.cmake
@@ -174,6 +174,7 @@
     set(ONE_VALUE_ARGUMENTS SCOPE NAME)
     set(MULTI_VALUE_ARGUMENTS
         SUPPORT_NAMES
+        INCLUDE_DIRS
         OBJECT_LIBRARIES
         LINK_LIBRARIES
         DEPENDENCIES
@@ -191,14 +192,23 @@

     set(TEST_MODULE_NAME ${ADD_UNIT_TEST_NAME})
     set(TEST_EXE_NAME ${ADD_UNIT_TEST_SCOPE}_${TEST_MODULE_NAME})
+    string(REPLACE "/" "_" TEST_EXE_NAME ${TEST_EXE_NAME})

     add_executable(${TEST_EXE_NAME} ${TEST_MODULE_NAME}
         ${ADD_UNIT_TEST_SUPPORT_NAMES}
         ${ADD_UNIT_TEST_OBJECT_LIBRARIES})
-
+    target_compile_definitions(${TEST_EXE_NAME}
+        PRIVATE
+            BOOST_ALL_DYN_LINK
+    )
+    target_include_directories(${TEST_EXE_NAME}
+        PRIVATE
+            ${ADD_UNIT_TEST_INCLUDE_DIRS}
+            ${Boost_INCLUDE_DIRS})
     target_link_libraries(${TEST_EXE_NAME}
-        ${ADD_UNIT_TEST_LINK_LIBRARIES}
-        ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
+        PRIVATE
+            ${ADD_UNIT_TEST_LINK_LIBRARIES}
+            Boost::unit_test_framework)

     add_test(NAME ${TEST_EXE_NAME}
         # catch_system_errors: Prevent UTF to detect system errors. This
@@ -233,6 +243,7 @@
     set(MULTI_VALUE_ARGUMENTS
         NAMES
         SUPPORT_NAMES
+        INCLUDE_DIRS
         OBJECT_LIBRARIES
         LINK_LIBRARIES
         DEPENDENCIES
@@ -253,6 +264,7 @@
             SCOPE ${ADD_UNIT_TESTS_SCOPE}
             NAME ${NAME}
             SUPPORT_NAMES ${ADD_UNIT_TESTS_SUPPORT_NAMES}
+            INCLUDE_DIRS ${ADD_UNIT_TESTS_INCLUDE_DIRS}
             OBJECT_LIBRARIES ${ADD_UNIT_TESTS_OBJECT_LIBRARIES}
             LINK_LIBRARIES ${ADD_UNIT_TESTS_LINK_LIBRARIES})
         set(target_name ${ADD_UNIT_TESTS_SCOPE}_${NAME})


[CMake] fix export plugin file naming

[CMake] fix export plugin file naming

--- cmake/MapnikExport.cmake
+++ cmake/MapnikExport.cmake
@@ -42,15 +42,16 @@
 # some package managers are using different paths per configuration.
 string(TOLOWER "${CMAKE_BUILD_TYPE}" _build_type)
 string(TOUPPER "${CMAKE_BUILD_TYPE}" _build_type_l)
-file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/mapnikPlugins-${_build_type}.cmake.in "set(MAPNIK_PLUGINS_DIR_${_build_type_l} \"@PACKAGE_PLUGINS_INSTALL_DIR@\" CACHE STRING \"\")\n")
+set(_mapnik_plugin_file_name "mapnikPlugins-${_build_type}")
+file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/${_mapnik_plugin_file_name}.cmake.in "set(MAPNIK_PLUGINS_DIR_${_build_type_l} \"@PACKAGE_PLUGINS_INSTALL_DIR@\" CACHE STRING \"\")\n")
 include(CMakePackageConfigHelpers)
 configure_package_config_file(
-  ${CMAKE_CURRENT_BINARY_DIR}/mapnikPlugins-${_build_type}.cmake.in
-  ${CMAKE_CURRENT_BINARY_DIR}/mapnikPlugins-${_build_type}.cmake
+  ${CMAKE_CURRENT_BINARY_DIR}/${_mapnik_plugin_file_name}.cmake.in
+  ${CMAKE_CURRENT_BINARY_DIR}/${_mapnik_plugin_file_name}.cmake
   PATH_VARS PLUGINS_INSTALL_DIR
   INSTALL_DESTINATION ${MAPNIK_CMAKE_DIR}
 )
 install(
-  FILES ${CMAKE_CURRENT_BINARY_DIR}/MapnikPlugins-${_build_type}.cmake
+  FILES ${CMAKE_CURRENT_BINARY_DIR}/${_mapnik_plugin_file_name}.cmake
   DESTINATION ${MAPNIK_CMAKE_DIR}
 )


cmake: fix Ninja generator warning about pylintrc

CMake generated files is a part of target depends list.
Details: `cmake --help-policy CMP0058`

--- cmake/OpenCVPylint.cmake
+++ cmake/OpenCVPylint.cmake
@@ -97,7 +97,11 @@
     return()
   endif()

-  file(COPY "${CMAKE_SOURCE_DIR}/platforms/scripts/pylintrc" DESTINATION "${CMAKE_BINARY_DIR}")
+  add_custom_command(
+      OUTPUT "${CMAKE_BINARY_DIR}/pylintrc"
+      COMMAND ${CMAKE_COMMAND} -E copy_if_different "${CMAKE_SOURCE_DIR}/platforms/scripts/pylintrc" "${CMAKE_BINARY_DIR}/pylintrc"
+      DEPENDS "${CMAKE_SOURCE_DIR}/platforms/scripts/pylintrc"
+  )

   set(PYLINT_CONFIG_SCRIPT "")
   ocv_cmake_script_append_var(PYLINT_CONFIG_SCRIPT


update kunlun xdnn (#41657)

update kunlun xdnn (#41657)

--- cmake/external/xpu.cmake
+++ cmake/external/xpu.cmake
@@ -36,14 +36,14 @@

 if(NOT DEFINED XPU_BASE_URL)
   SET(XPU_BASE_URL_WITHOUT_DATE "https://baidu-kunlun-product.cdn.bcebos.com/KL-SDK/klsdk-dev")
-  SET(XPU_BASE_URL "${XPU_BASE_URL_WITHOUT_DATE}/20220408")
+  SET(XPU_BASE_URL "${XPU_BASE_URL_WITHOUT_DATE}/20220411")
 else()
   SET(XPU_BASE_URL "${XPU_BASE_URL}")
 endif()

 SET(XPU_XRE_URL  "${XPU_BASE_URL}/${XPU_XRE_DIR_NAME}.tar.gz" CACHE STRING "" FORCE)
 SET(XPU_XDNN_URL "${XPU_BASE_URL}/${XPU_XDNN_DIR_NAME}.tar.gz" CACHE STRING "" FORCE)
-SET(XPU_XCCL_URL "${XPU_BASE_URL_WITHOUT_DATE}/20210623/${XPU_XCCL_DIR_NAME}.tar.gz" CACHE STRING "" FORCE)
+SET(XPU_XCCL_URL "${XPU_BASE_URL_WITHOUT_DATE}/20220411/${XPU_XCCL_DIR_NAME}.tar.gz" CACHE STRING "" FORCE)
 SET(XPU_PACK_DEPENCE_URL "https://baidu-kunlun-public.su.bcebos.com/paddle_depence/pack_paddle_depence.sh" CACHE STRING "" FORCE)

 SET(SNAPPY_PREFIX_DIR              "${THIRD_PARTY_PATH}/xpu")


fix in previous commit to support cmake versions before 3.14

--- cmake/fips_private.cmake
+++ cmake/fips_private.cmake
@@ -225,7 +225,8 @@
         else()
             set(cur_file ${new_file})
         endif()
-        get_filename_component(f_ext ${cur_file} LAST_EXT)
+        # NOTE: this should be LAST_EXT, but that's only supported since cmake 3.14
+        get_filename_component(f_ext ${cur_file} EXT)

         # determine source group name and
         # add to current source group


CMake: Print error if path to external modules is not a path. AND . Removing whitespace before and after an external path since it will not be treated as a path of it starts with a whitespace

--- cmake/globalmacros.cmake
+++ cmake/globalmacros.cmake
@@ -304,12 +304,13 @@
             list(APPEND paths "\"${IVW_ROOT_DIR}/modules\":")
             set(count 1)
             foreach(dir ${IVW_EXTERNAL_MODULES})
+                string(STRIP ${dir} dir)
                 if(IS_DIRECTORY ${dir})
                     list(APPEND paths ", :")
                     list(APPEND paths "\"${dir}\":")
                     MATH(EXPR count "${count}+1")
                 else()
-                    MESSAGE(FATAL_ERROR "Path to external module is not a directory (${dir})")
+                    ivw_message("Path to external module is not a directory (${dir})")
                 endif()
             endforeach()
             list(APPEND paths "}; //Paths")
@@ -517,6 +518,7 @@
 # Add all external modules specified in cmake string IVW_EXTERNAL_MODULES
 macro(add_external_modules)
     foreach(module_root_path ${IVW_EXTERNAL_MODULES})
+        string(STRIP ${module_root_path} module_root_path)
         #Generate module options
         generate_unset_mod_options_and_depend_sort(${module_root_path} IVW_EXTERNAL_SORTED_MODULES)

@@ -534,6 +536,7 @@
 # Add all external modules specified in cmake string IVW_EXTERNAL_MODULES
 macro(add_external_projects)
     foreach(project_root_path ${IVW_EXTERNAL_PROJECTS})
+        string(STRIP ${project_root_path} project_root_path)
         get_filename_component(FOLDER_NAME ${project_root_path} NAME)
         add_subdirectory(${project_root_path} ${CMAKE_CURRENT_BINARY_DIR}/ext_${FOLDER_NAME})
     endforeach()


installutils.cmake comment spell correction

--- cmake/installutils.cmake
+++ cmake/installutils.cmake
@@ -147,7 +147,7 @@
 #--------------------------------------------------------------------
 # Make package (with configure file etc)
 macro(ivw_make_package package_name target)
- # Will uncomment in the future, this is for when we what to ship
+ # Will uncomment in the future, this is for when we want to ship
  # a version that also includes header files, so one can build modules
  # without having to build all of inviwo. So far this is just work in progress
  #   include(CMakePackageConfigHelpers)


USE_ROS OFF by default

USE_ROS OFF by default

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

--- cmake/pcl_find_ros.cmake
+++ cmake/pcl_find_ros.cmake
@@ -23,7 +23,7 @@

 if(ENV{ROS_ROOT})
-    option(USE_ROS "Integrate with ROS rather than using native files" ON)
+    option(USE_ROS "Integrate with ROS rather than using native files" OFF)
     message(STATUS "Found ROS; USE_ROS is ${USE_ROS}")
     if(USE_ROS)
         set(_ros_pkgs std_msgs sensor_msgs roscpp_serialization cpp_common rostime


change include dir in FindWamcpp

change include dir in FindWamcpp

--- wamp_cpp/CMakeModules/FindWampcpp.cmake
+++ wamp_cpp/CMakeModules/FindWampcpp.cmake
@@ -21,7 +21,7 @@
  # only look in default directories
 find_path(
   WAMPCPP_INCLUDE_DIR
-  NAMES wamp_cpp/WAMPServer.h
+  NAMES WAMPServer.h
   PATHS ${WAMPCPPLIB_ROOT_DIR}/include
   DOC "wamp_cpp include dir"
  )


Enable transition to .gitexternals for doc repos

--- Doxygit.cmake
+++ Doxygit.cmake
@@ -1,9 +1,13 @@
 # used by DoxygenRule.cmake, don't use directly

+# The next two lines are deprecated, remove when all doc projects use
+# .gitexternals
 list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/CMake)
 list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/CMake/oss)
+list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/CMake/common)
+list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/CMake/common/oss)
+
 find_package(Git)
-
 if(NOT GIT_EXECUTABLE)
   return()
 endif()


mark clang tools as advanced cmake options

--- tools/cmake/FindClangTools.cmake
+++ tools/cmake/FindClangTools.cmake
@@ -7,9 +7,11 @@
 #  CLANG_FORMAT_FOUND, Whether clang format was found

 find_program(CLANG_TIDY_PROGRAM
-  NAMES clang-tidy-3.9 clang-tidy-3.8 clang-tidy-3.7 clang-tidy-3.6  clang-tidy
+  NAMES clang-tidy-3.9 clang-tidy-3.8 clang-tidy-3.7 clang-tidy-3.6 clang-tidy
   PATHS $ENV{CLANG_TOOLS_PATH} /usr/local/bin /usr/bin
   NO_DEFAULT_PATH)
+
+mark_as_advanced(CLANG_TIDY_PROGRAM)

 if("${CLANG_TIDY_PROGRAM}" STREQUAL "CLANG_TIDY_PROGRAM-NOTFOUND")
   set(CLANG_TIDY_FOUND 0)
@@ -18,9 +20,11 @@
 endif()

 find_program(CLANG_FORMAT_PROGRAM
-  NAMES clang-format 3.9 clang-format-3.8 clang-format-3.7 clang-format-3.6  clang-format
+  NAMES clang-format 3.9 clang-format-3.8 clang-format-3.7 clang-format-3.6 clang-format
   PATHS $ENV{CLANG_TOOLS_PATH} /usr/local/bin /usr/bin
   NO_DEFAULT_PATH)
+
+mark_as_advanced(CLANG_FORMAT_PROGRAM)

 if("${CLANG_FORMAT_PROGRAM}" STREQUAL "CLANG_FORMAT_PROGRAM-NOTFOUND")
   set(CLANG_FORMAT_FOUND 0)


if pkg-config is available and is aware of icu, append the output of pkg-config icu-<component> --variable=prefix (variable ${PC_ICU_PRIVATE_VAR_NS}_PREFIX) to HINTS of all find_*

--- FindICU.cmake
+++ FindICU.cmake
@@ -56,23 +56,23 @@
     set(PC_ICU_PRIVATE_VAR_NS "_PC${ICU_PRIVATE_VAR_NS}") # Prefix for all pkg-config relative internal variables
 endif(NOT DEFINED PC_ICU_PRIVATE_VAR_NS)

-set(${ICU_PRIVATE_VAR_NS}_ROOT "")
+set(${ICU_PRIVATE_VAR_NS}_HINTS )
 # <deprecated>
 # for future removal
 if(DEFINED ENV{ICU_ROOT})
-    set(${ICU_PRIVATE_VAR_NS}_ROOT "$ENV{ICU_ROOT}")
-    message(AUTHOR_WARNING "ICU_ROOT is deprecated in favor of ICU_ROOT_DIR")
+    list(APPEND ${ICU_PRIVATE_VAR_NS}_HINTS "$ENV{ICU_ROOT}")
+    message(AUTHOR_WARNING "ENV{ICU_ROOT} is deprecated in favor of ENV{ICU_ROOT_DIR}")
 endif(DEFINED ENV{ICU_ROOT})
 if (DEFINED ICU_ROOT)
-    set(${ICU_PRIVATE_VAR_NS}_ROOT "${ICU_ROOT}")
+    list(APPEND ${ICU_PRIVATE_VAR_NS}_HINTS "${ICU_ROOT}")
     message(AUTHOR_WARNING "ICU_ROOT is deprecated in favor of ICU_ROOT_DIR")
 endif(DEFINED ICU_ROOT)
 # </deprecated>
 if(DEFINED ENV{ICU_ROOT_DIR})
-    set(${ICU_PRIVATE_VAR_NS}_ROOT "$ENV{ICU_ROOT_DIR}")
+    list(APPEND ${ICU_PRIVATE_VAR_NS}_HINTS "$ENV{ICU_ROOT_DIR}")
 endif(DEFINED ENV{ICU_ROOT_DIR})
 if (DEFINED ICU_ROOT_DIR)
-    set(${ICU_PRIVATE_VAR_NS}_ROOT "${ICU_ROOT_DIR}")
+    list(APPEND ${ICU_PRIVATE_VAR_NS}_HINTS "${ICU_ROOT_DIR}")
 endif(DEFINED ICU_ROOT_DIR)

 set(${ICU_PRIVATE_VAR_NS}_COMPONENTS )
@@ -118,20 +118,44 @@
     endforeach(${ICU_PRIVATE_VAR_NS}_COMPONENT)
 endif(NOT ${ICU_PUBLIC_VAR_NS}_FIND_COMPONENTS)

+# if pkg-config is available check components dependencies and append `pkg-config icu-<component> --variable=prefix` to hints
+if(PKG_CONFIG_FOUND)
+    set(${ICU_PRIVATE_VAR_NS}_COMPONENTS_DUP ${${ICU_PUBLIC_VAR_NS}_FIND_COMPONENTS})
+    foreach(${ICU_PRIVATE_VAR_NS}_COMPONENT ${${ICU_PRIVATE_VAR_NS}_COMPONENTS_DUP})
+        pkg_check_modules(${PC_ICU_PRIVATE_VAR_NS} "icu-${${ICU_PRIVATE_VAR_NS}_COMPONENT}" QUIET)
+
+        if(${PC_ICU_PRIVATE_VAR_NS}_FOUND)
+            list(APPEND ${ICU_PRIVATE_VAR_NS}_HINTS ${${PC_ICU_PRIVATE_VAR_NS}_PREFIX})
+            foreach(${PC_ICU_PRIVATE_VAR_NS}_LIBRARY ${${PC_ICU_PRIVATE_VAR_NS}_LIBRARIES})
+                string(REGEX REPLACE "^icu" "" ${PC_ICU_PRIVATE_VAR_NS}_STRIPPED_LIBRARY ${${PC_ICU_PRIVATE_VAR_NS}_LIBRARY})
+                if(NOT ${PC_ICU_PRIVATE_VAR_NS}_STRIPPED_LIBRARY STREQUAL "data")
+                    list(FIND ${ICU_PUBLIC_VAR_NS}_FIND_COMPONENTS ${${PC_ICU_PRIVATE_VAR_NS}_STRIPPED_LIBRARY} ${ICU_PRIVATE_VAR_NS}_COMPONENT_INDEX)
+                    if(${ICU_PRIVATE_VAR_NS}_COMPONENT_INDEX EQUAL -1)
+                        message(WARNING "Missing component dependency: ${${PC_ICU_PRIVATE_VAR_NS}_STRIPPED_LIBRARY}. Add it to your find_package(ICU) line as COMPONENTS to fix this warning.")
+                        list(APPEND ${ICU_PUBLIC_VAR_NS}_FIND_COMPONENTS ${${PC_ICU_PRIVATE_VAR_NS}_STRIPPED_LIBRARY})
+                    endif(${ICU_PRIVATE_VAR_NS}_COMPONENT_INDEX EQUAL -1)
+                endif(NOT ${PC_ICU_PRIVATE_VAR_NS}_STRIPPED_LIBRARY STREQUAL "data")
+            endforeach(${PC_ICU_PRIVATE_VAR_NS}_LIBRARY)
+        endif(${PC_ICU_PRIVATE_VAR_NS}_FOUND)
+    endforeach(${ICU_PRIVATE_VAR_NS}_COMPONENT)
+endif(PKG_CONFIG_FOUND)
+# list(APPEND ${ICU_PRIVATE_VAR_NS}_HINTS ENV ICU_ROOT_DIR)
+# message("${ICU_PRIVATE_VAR_NS}_HINTS = ${${ICU_PRIVATE_VAR_NS}_HINTS}")
+
 # Includes
 find_path(
     ${ICU_PUBLIC_VAR_NS}_INCLUDE_DIR
     NAMES unicode/utypes.h utypes.h
-    HINTS ${${ICU_PRIVATE_VAR_NS}_ROOT}
+    HINTS ${${ICU_PRIVATE_VAR_NS}_HINTS}
     PATH_SUFFIXES "include"
     DOC "Include directories for ICU"
 )

 if(${ICU_PUBLIC_VAR_NS}_INCLUDE_DIR)
     ########## <part to keep synced with tests/version/CMakeLists.txt> ##########
-    if(EXISTS "${${ICU_PUBLIC_VAR_NS}_INCLUDE_DIR}/unicode/uvernum.h") # ICU >= 4
+    if(EXISTS "${${ICU_PUBLIC_VAR_NS}_INCLUDE_DIR}/unicode/uvernum.h") # ICU >= 4.4
         file(READ "${${ICU_PUBLIC_VAR_NS}_INCLUDE_DIR}/unicode/uvernum.h" ${ICU_PRIVATE_VAR_NS}_VERSION_HEADER_CONTENTS)
-    elseif(EXISTS "${${ICU_PUBLIC_VAR_NS}_INCLUDE_DIR}/unicode/uversion.h") # ICU [2;4[
+    elseif(EXISTS "${${ICU_PUBLIC_VAR_NS}_INCLUDE_DIR}/unicode/uversion.h") # ICU [2;4.4[
         file(READ "${${ICU_PUBLIC_VAR_NS}_INCLUDE_DIR}/unicode/uversion.h" ${ICU_PRIVATE_VAR_NS}_VERSION_HEADER_CONTENTS)
     elseif(EXISTS "${${ICU_PUBLIC_VAR_NS}_INCLUDE_DIR}/unicode/utypes.h") # ICU [1.4;2[
         file(READ "${${ICU_PUBLIC_VAR_NS}_INCLUDE_DIR}/unicode/utypes.h" ${ICU_PRIVATE_VAR_NS}_VERSION_HEADER_CONTENTS)
@@ -156,7 +180,7 @@
         string(REGEX REPLACE ".*# *define *U_ICU_VERSION_MINOR_NUM *([0-9]+).*" "\\1" ${ICU_PUBLIC_VAR_NS}_VERSION_MINOR "${${ICU_PRIVATE_VAR_NS}_VERSION_HEADER_CONTENTS}")
         string(REGEX REPLACE ".*# *define *U_ICU_VERSION_PATCHLEVEL_NUM *([0-9]+).*" "\\1" ${ICU_PUBLIC_VAR_NS}_VERSION_PATCH "${${ICU_PRIVATE_VAR_NS}_VERSION_HEADER_CONTENTS}")
     elseif(${ICU_PRIVATE_VAR_NS}_VERSION_HEADER_CONTENTS MATCHES ".*# *define *U_ICU_VERSION *\"(([0-9]+)(\\.[0-9]+)*)\".*") # ICU [1.4;1.8[
-        # [1.4;1.8[ as #define U_ICU_VERSION "1.4.1.2" but it seems that some 1.4.1(?:\.\d)? have releasing error and appears as 1.4.0
+        # [1.4;1.8[ as #define U_ICU_VERSION "1.4.1.2" but it seems that some 1.4.[12](?:\.\d)? have releasing error and appears as 1.4.0
         set(${ICU_PRIVATE_VAR_NS}_FULL_VERSION "${CMAKE_MATCH_1}") # copy CMAKE_MATCH_1, no longer valid on the following if
         if(${ICU_PRIVATE_VAR_NS}_FULL_VERSION MATCHES "^([0-9]+)\\.([0-9]+)$")
             set(${ICU_PUBLIC_VAR_NS}_VERSION_MAJOR "${CMAKE_MATCH_1}")
@@ -174,27 +198,6 @@
     ########## </part to keep synced with tests/version/CMakeLists.txt> ##########
 endif(${ICU_PUBLIC_VAR_NS}_INCLUDE_DIR)

-# if pkg-config is available check components dependencies
-if(PKG_CONFIG_FOUND)
-    set(${ICU_PRIVATE_VAR_NS}_COMPONENTS_DUP ${${ICU_PUBLIC_VAR_NS}_FIND_COMPONENTS})
-    foreach(${ICU_PRIVATE_VAR_NS}_COMPONENT ${${ICU_PRIVATE_VAR_NS}_COMPONENTS_DUP})
-        pkg_check_modules(${PC_ICU_PRIVATE_VAR_NS} "icu-${${ICU_PRIVATE_VAR_NS}_COMPONENT}" QUIET)
-
-        if(${PC_ICU_PRIVATE_VAR_NS}_FOUND)
-            foreach(${PC_ICU_PRIVATE_VAR_NS}_LIBRARY ${${PC_ICU_PRIVATE_VAR_NS}_LIBRARIES})
-                string(REGEX REPLACE "^icu" "" ${PC_ICU_PRIVATE_VAR_NS}_STRIPPED_LIBRARY ${${PC_ICU_PRIVATE_VAR_NS}_LIBRARY})
-                if(NOT ${PC_ICU_PRIVATE_VAR_NS}_STRIPPED_LIBRARY STREQUAL "data")
-                    list(FIND ${ICU_PUBLIC_VAR_NS}_FIND_COMPONENTS ${${PC_ICU_PRIVATE_VAR_NS}_STRIPPED_LIBRARY} ${ICU_PRIVATE_VAR_NS}_COMPONENT_INDEX)
-                    if(${ICU_PRIVATE_VAR_NS}_COMPONENT_INDEX EQUAL -1)
-                        message(WARNING "Missing component dependency: ${${PC_ICU_PRIVATE_VAR_NS}_STRIPPED_LIBRARY}. Add it to your find_package(ICU) line as COMPONENTS to fix this warning.")
-                        list(APPEND ${ICU_PUBLIC_VAR_NS}_FIND_COMPONENTS ${${PC_ICU_PRIVATE_VAR_NS}_STRIPPED_LIBRARY})
-                    endif(${ICU_PRIVATE_VAR_NS}_COMPONENT_INDEX EQUAL -1)
-                endif(NOT ${PC_ICU_PRIVATE_VAR_NS}_STRIPPED_LIBRARY STREQUAL "data")
-            endforeach(${PC_ICU_PRIVATE_VAR_NS}_LIBRARY)
-        endif(${PC_ICU_PRIVATE_VAR_NS}_FOUND)
-    endforeach(${ICU_PRIVATE_VAR_NS}_COMPONENT)
-endif(PKG_CONFIG_FOUND)
-
 # Check libraries
 if(MSVC)
     include(SelectLibraryConfigurations)
@@ -214,13 +217,13 @@
         find_library(
             ${ICU_PUBLIC_VAR_NS}_${${ICU_PRIVATE_VAR_NS}_UPPER_COMPONENT}_LIBRARY_RELEASE
             NAMES ${${ICU_PRIVATE_VAR_NS}_POSSIBLE_RELEASE_NAMES}
-            HINTS ${${ICU_PRIVATE_VAR_NS}_ROOT}
+            HINTS ${${ICU_PRIVATE_VAR_NS}_HINTS}
             DOC "Release library for ICU ${${ICU_PRIVATE_VAR_NS}_COMPONENT} component"
         )
         find_library(
             ${ICU_PUBLIC_VAR_NS}_${${ICU_PRIVATE_VAR_NS}_UPPER_COMPONENT}_LIBRARY_DEBUG
             NAMES ${${ICU_PRIVATE_VAR_NS}_POSSIBLE_DEBUG_NAMES}
-            HINTS ${${ICU_PRIVATE_VAR_NS}_ROOT}
+            HINTS ${${ICU_PRIVATE_VAR_NS}_HINTS}
             DOC "Debug library for ICU ${${ICU_PRIVATE_VAR_NS}_COMPONENT} component"
         )

@@ -230,7 +233,7 @@
         find_library(
             ${ICU_PUBLIC_VAR_NS}_${${ICU_PRIVATE_VAR_NS}_UPPER_COMPONENT}_LIBRARY
             NAMES ${${ICU_PRIVATE_VAR_NS}_COMPONENTS_${${ICU_PRIVATE_VAR_NS}_COMPONENT}}
-            HINTS ${${ICU_PRIVATE_VAR_NS}_ROOT}
+            PATHS ${${ICU_PRIVATE_VAR_NS}_HINTS}
             DOC "Library for ICU ${${ICU_PRIVATE_VAR_NS}_COMPONENT} component"
         )

@@ -242,7 +245,7 @@
 endforeach(${ICU_PRIVATE_VAR_NS}_COMPONENT)

 # Try to find out compiler flags
-find_program(${ICU_PUBLIC_VAR_NS}_CONFIG_EXECUTABLE icu-config HINTS ${${ICU_PRIVATE_VAR_NS}_ROOT})
+find_program(${ICU_PUBLIC_VAR_NS}_CONFIG_EXECUTABLE icu-config HINTS ${${ICU_PRIVATE_VAR_NS}_HINTS})
 if(${ICU_PUBLIC_VAR_NS}_CONFIG_EXECUTABLE)
     execute_process(COMMAND ${${ICU_PUBLIC_VAR_NS}_CONFIG_EXECUTABLE} --cflags OUTPUT_VARIABLE ${ICU_PUBLIC_VAR_NS}_C_FLAGS OUTPUT_STRIP_TRAILING_WHITESPACE)
     execute_process(COMMAND ${${ICU_PUBLIC_VAR_NS}_CONFIG_EXECUTABLE} --cxxflags OUTPUT_VARIABLE ${ICU_PUBLIC_VAR_NS}_CXX_FLAGS OUTPUT_STRIP_TRAILING_WHITESPACE)
@@ -319,8 +322,8 @@
 endfunction(_icu_extract_locale_from_rb)

 ########## Public ##########
-find_program(${ICU_PUBLIC_VAR_NS}_GENRB_EXECUTABLE genrb HINTS ${${ICU_PRIVATE_VAR_NS}_ROOT})
-find_program(${ICU_PUBLIC_VAR_NS}_PKGDATA_EXECUTABLE pkgdata HINTS ${${ICU_PRIVATE_VAR_NS}_ROOT})
+find_program(${ICU_PUBLIC_VAR_NS}_GENRB_EXECUTABLE genrb HINTS ${${ICU_PRIVATE_VAR_NS}_HINTS})
+find_program(${ICU_PUBLIC_VAR_NS}_PKGDATA_EXECUTABLE pkgdata HINTS ${${ICU_PRIVATE_VAR_NS}_HINTS})

 if(NOT ${ICU_PUBLIC_VAR_NS}_GENRB_EXECUTABLE)
     message(FATAL_ERROR "genrb not found")


Add option for directive specific language

--- test/module_test.cmake
+++ test/module_test.cmake
@@ -30,7 +30,7 @@
 # Execute the CLAW compiler for CPU target
 add_custom_command(
   OUTPUT  ${OUTPUT_FILE_CPU}
-  COMMAND ${CLAWFC} ${OPTIONAL_FLAGS} --target=cpu ${DEBUG_FLAG} -J ${XMOD_DIR} -o ${OUTPUT_FILE_CPU} ${ORIGINAL_FILE}
+  COMMAND ${CLAWFC} ${OPTIONAL_FLAGS} --target=cpu ${DIRECTIVE_CPU} ${DEBUG_FLAG} -J ${XMOD_DIR} -o ${OUTPUT_FILE_CPU} ${ORIGINAL_FILE}
   WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
   DEPENDS ${ORIGINAL_FILE}
   COMMENT "Translating CLAW directive with ${CLAWFC} for CPU target"
@@ -39,7 +39,7 @@
 # Execute the CLAW compiler for GPU target
 add_custom_command(
   OUTPUT  ${OUTPUT_FILE_GPU}
-  COMMAND ${CLAWFC} ${OPTIONAL_FLAGS} --target=gpu ${DEBUG_FLAG} -J ${XMOD_DIR} -o ${OUTPUT_FILE_GPU} ${ORIGINAL_FILE}
+  COMMAND ${CLAWFC} ${OPTIONAL_FLAGS} --target=gpu ${DIRECTIVE_GPU} ${DEBUG_FLAG} -J ${XMOD_DIR} -o ${OUTPUT_FILE_GPU} ${ORIGINAL_FILE}
   WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
   DEPENDS ${ORIGINAL_FILE}
   COMMENT "Translating CLAW directive with ${CLAWFC} for GPU target"


Added the word Version to the version string.

--- CMake/GetVersion.cmake
+++ CMake/GetVersion.cmake
@@ -12,7 +12,7 @@
 endif( GIT_FOUND )
 message( STATUS "Version: ${BUILD_VERSION}" )

-set( VERSION_STRING "const static std::string Version = \"${BUILD_VERSION}\"\;\n")
+set( VERSION_STRING "const static std::string Version = \"Version ${BUILD_VERSION}\"\;\n")

 file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/${VERSION_FILE_NAME}.tmp ${VERSION_STRING} )
 execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_BINARY_DIR}/${VERSION_FILE_NAME}.tmp ${CMAKE_CURRENT_BINARY_DIR}/${VERSION_FILE_NAME} )


COMP: no need for checking  {GDAL_INCLUDE_DIR}, the cmake var GDAL_INCLUDE_DIR is mandatory anyway

--- CMake/ImportGdal.cmake
+++ CMake/ImportGdal.cmake
@@ -64,7 +64,7 @@
   MATH(EXPR GDAL_NUM_VERSION "((${GDAL_VERSION_MAJOR})*100+${GDAL_VERSION_MINOR})*100+${GDAL_VERSION_PATCH}")

   # Find geotiff headers
-  FIND_PATH(GEOTIFF_INCLUDE_DIRS geotiff.h $ENV{GDAL_INCLUDE_DIR} ${GDAL_INCLUDE_DIR} ${OSGEO4W_INCLUDE} /usr/include/geotiff /usr/include/libgeotiff)
+  FIND_PATH(GEOTIFF_INCLUDE_DIRS geotiff.h ${GDAL_INCLUDE_DIR} ${OSGEO4W_INCLUDE} /usr/include/geotiff /usr/include/libgeotiff)
   MARK_AS_ADVANCED(GEOTIFF_INCLUDE_DIRS)
   IF (NOT GEOTIFF_INCLUDE_DIRS)
   MESSAGE(FATAL_ERROR
@@ -72,7 +72,7 @@
   ENDIF (NOT GEOTIFF_INCLUDE_DIRS)

   # Find tiff headers
-  FIND_PATH(TIFF_INCLUDE_DIRS tiffio.h $ENV{GDAL_INCLUDE_DIR} ${GDAL_INCLUDE_DIR} ${OSGEO4W_INCLUDE} /usr/include)
+  FIND_PATH(TIFF_INCLUDE_DIRS tiffio.h ${GDAL_INCLUDE_DIR} ${OSGEO4W_INCLUDE} /usr/include)
   MARK_AS_ADVANCED(TIFF_INCLUDE_DIRS)
   IF (NOT TIFF_INCLUDE_DIRS)
   MESSAGE(FATAL_ERROR
@@ -80,7 +80,7 @@
   ENDIF (NOT TIFF_INCLUDE_DIRS)

   # Find jpeg headers
-  FIND_PATH(JPEG_INCLUDE_DIRS jpeglib.h $ENV{GDAL_INCLUDE_DIR} ${GDAL_INCLUDE_DIR} ${OSGEO4W_INCLUDE} /usr/include)
+  FIND_PATH(JPEG_INCLUDE_DIRS jpeglib.h ${GDAL_INCLUDE_DIR} ${OSGEO4W_INCLUDE} /usr/include)
   MARK_AS_ADVANCED(JPEG_INCLUDE_DIRS)
   IF (NOT JPEG_INCLUDE_DIRS)
   MESSAGE(FATAL_ERROR
@@ -89,7 +89,7 @@
   INCLUDE_DIRECTORIES(${JPEG_INCLUDE_DIRS})

   # Find ogr headers
-  FIND_PATH(OGR_INCLUDE_DIRS ogrsf_frmts.h  $ENV{GDAL_INCLUDE_DIR} ${GDAL_INCLUDE_DIR} ${OSGEO4W_INCLUDE} /usr/include)
+  FIND_PATH(OGR_INCLUDE_DIRS ogrsf_frmts.h ${GDAL_INCLUDE_DIR} ${OSGEO4W_INCLUDE} /usr/include)
   MARK_AS_ADVANCED(OGR_INCLUDE_DIRS)
   IF (NOT OGR_INCLUDE_DIRS)
   MESSAGE(FATAL_ERROR


Try to fix patching by reverting to git repos in download steps

Patching does not remove or rename files.

--- deps/deps-windows.cmake
+++ deps/deps-windows.cmake
@@ -303,8 +303,10 @@

 ExternalProject_Add(dep_blosc
     EXCLUDE_FROM_ALL 1
-    URL https://github.com/Blosc/c-blosc/archive/v1.17.0.zip
-    URL_HASH SHA256=7463a1df566704f212263312717ab2c36b45d45cba6cd0dccebf91b2cc4b4da9
+    #URL https://github.com/Blosc/c-blosc/archive/v1.17.0.zip
+    #URL_HASH SHA256=7463a1df566704f212263312717ab2c36b45d45cba6cd0dccebf91b2cc4b4da9
+    GIT_REPOSITORY https://github.com/Blosc/c-blosc.git
+    GIT_TAG v1.17.0
     DEPENDS dep_zlib
     CMAKE_GENERATOR "${DEP_MSVC_GEN}"
     CMAKE_GENERATOR_PLATFORM "${DEP_PLATFORM}"
@@ -318,7 +320,8 @@
         -DBUILD_TESTS=OFF
         -DBUILD_BENCHMARKS=OFF
         -DPREFER_EXTERNAL_ZLIB=ON
-        -DBLOSC_IS_SUBPROJECT=OFF
+        -DBLOSC_IS_SUBPROJECT:BOOL=ON
+        -DBLOSC_INSTALL:BOOL=ON
     PATCH_COMMAND ${GIT_EXECUTABLE} apply --whitespace=fix ${CMAKE_CURRENT_SOURCE_DIR}/blosc-mods.patch
     BUILD_COMMAND msbuild /m /P:Configuration=Release INSTALL.vcxproj
     INSTALL_COMMAND ""
@@ -349,8 +352,10 @@

 ExternalProject_Add(dep_openvdb
     EXCLUDE_FROM_ALL 1
-    URL https://github.com/AcademySoftwareFoundation/openvdb/archive/v6.2.1.zip
-    URL_HASH SHA256=dc337399dce8e1c9f21f20e97b1ce7e4933cb0a63bb3b8b734d8fcc464aa0c48
+    #URL https://github.com/AcademySoftwareFoundation/openvdb/archive/v6.2.1.zip
+    #URL_HASH SHA256=dc337399dce8e1c9f21f20e97b1ce7e4933cb0a63bb3b8b734d8fcc464aa0c48
+    GIT_REPOSITORY https://github.com/AcademySoftwareFoundation/openvdb.git
+    GIT_TAG v6.2.1
     DEPENDS dep_blosc dep_openexr dep_tbb dep_boost
     CMAKE_GENERATOR "${DEP_MSVC_GEN}"
     CMAKE_GENERATOR_PLATFORM "${DEP_PLATFORM}"


Fix precompiled headers in release build

--- CMakeModules/Gch.cmake
+++ CMakeModules/Gch.cmake
@@ -15,6 +15,8 @@
   STRING(TOUPPER ${CMAKE_BUILD_TYPE} BUILD_TYPE)
   IF(QT4_FOUND AND ${BUILD_TYPE} STREQUAL "DEBUG")
     LIST(APPEND DEFS -DQT_DEBUG)
+  ELSE(QT4_FOUND AND ${BUILD_TYPE} STREQUAL "DEBUG")
+    LIST(APPEND DEFS -DQT_NO_DEBUG)
   ENDIF(QT4_FOUND AND ${BUILD_TYPE} STREQUAL "DEBUG")

   SET(PCH_FLAGS


Bump version: 0.2.9

Bump version: 0.2.9

--- VERSION.cmake
+++ VERSION.cmake
@@ -1,3 +1,3 @@
 SET(HAWKEY_MAJOR "0")
 SET(HAWKEY_MINOR "2")
-SET(HAWKEY_PATCH "8")
+SET(HAWKEY_PATCH "9")


Comment CMake debug line

Comment CMake debug line

- Is causing issues with ESP32 build (anyway is not meant to be uncomment for CI build)

Signed-off-by: José Simões <1616ff7a83d123f98f8f38fa2524eab406644781@eclo.solutions>

--- CMake/Modules/FindNF_Networking.cmake
+++ CMake/Modules/FindNF_Networking.cmake
@@ -75,7 +75,7 @@

         CMAKE_FIND_ROOT_PATH_BOTH
     )
-    message("${SRC_FILE} >> ${NF_Networking_SRC_FILE}") # debug helper
+    # message("${SRC_FILE} >> ${NF_Networking_SRC_FILE}") # debug helper
     list(APPEND NF_Networking_SOURCES ${NF_Networking_SRC_FILE})
 endforeach()

@@ -96,7 +96,7 @@

         CMAKE_FIND_ROOT_PATH_BOTH
     )
-    message("${SRC_FILE} >> ${NF_Networking_SRC_FILE}") # debug helper
+    # message("${SRC_FILE} >> ${NF_Networking_SRC_FILE}") # debug helper
     list(APPEND NF_Networking_SOURCES ${NF_Networking_SRC_FILE})
 endforeach()


Fix a misnamed variable in AddPBJTarget.

--- build/modules/AddPBJTarget.cmake
+++ build/modules/AddPBJTarget.cmake
@@ -46,7 +46,7 @@
     SET(PBJ_GenFile ${CMAKE_CURRENT_BINARY_DIR}/protobuf_${PBJ_PLUGINNAME}.txt)
     IF(PBJ_CPP_HEADER)
         FILE(WRITE ${PBJ_GenFile}
-             ${CPP_HEADER})
+             ${PBJ_CPP_HEADER})
     ENDIF()
   ENDIF()
   SET(PBJ_PLUGINNAME_UNDERSCORE)


Adapt cmake for file name change

Adapt cmake for file name change

Signed-off-by: falkTX <d7e5958cbb080ba57e41fb602ade747e1a2da17c@falktx.com>

--- cmake/DPF-plugin.cmake
+++ cmake/DPF-plugin.cmake
@@ -596,13 +596,6 @@
 #
 function(dpf__add_plugin_target_definition NAME TARGET)
   string(TOUPPER "${TARGET}" _upperTarget)
-
-  # resolve the alias into the proper name
-  # the name "vst2" is new, "vst" is legacy
-  if(_upperTarget STREQUAL "VST2")
-    set(_upperTarget "VST")
-  endif()
-
   target_compile_definitions("${NAME}" PRIVATE "DISTRHO_PLUGIN_TARGET_${_upperTarget}")
 endfunction()


fix typo

fix typo

--- cmake/FindOpenCL.cmake
+++ cmake/FindOpenCL.cmake
@@ -14,7 +14,7 @@
 #
 # The following variables are set
 #
-# OPENCl_FOUND          - TRUE if OpenCL headers and libraries are found
+# OPENCL_FOUND          - TRUE if OpenCL headers and libraries are found
 #                         But it is untested by real OpenCL programs
 # OpenCL_INCLUDE_DIR    - The directory containing OpenCL headers
 # OpenCL_LINK_LIBRARIES - OpenCL libraries that shall be linked to


message

message

--- cmake/Findembree.cmake
+++ cmake/Findembree.cmake
@@ -35,6 +35,8 @@
         /opt/local/lib
         ${CMAKE_CURRENT_SOURCE_DIR}/external/lib)

+message("CMake lib dir: ${CMAKE_CURRENT_SOURCE_DIR}/external/lib")
+
 FIND_LIBRARY(EMBREE_LIBRARY_MIC NAMES embree_xeonphi PATHS
         /usr/lib
         /usr/lib64


Fix indentation

Fix indentation

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

--- cmake/pcl_openmp.cmake
+++ cmake/pcl_openmp.cmake
@@ -29,7 +29,7 @@
             if(OPENMP_FLAGS_${_flag})
                 set(OPENMP_FLAGS ${_flag})
                 message(STATUS "Found OpenMP flags: ${OPENMP_FLAGS}")
-								set(OPENMP_FLAGS_FOUND true)
+                set(OPENMP_FLAGS_FOUND true)
             endif(OPENMP_FLAGS_${_flag})
         endif(NOT OPENMP_FLAGS_FOUND)
     endforeach(_flag)


Fix python finder

Fix python finder

--- 3rd_party/python_env/python_env.cmake
+++ 3rd_party/python_env/python_env.cmake
@@ -19,7 +19,7 @@
         find_package(Python3 COMPONENTS Interpreter)
     endif ()
 endif()
-if (NOT Python_Interpreter_FOUND)
+if (NOT Python3_Interpreter_FOUND)
     message(FATAL_ERROR "Python is required but not found")
 endif()


Versioning tweaks

Versioning tweaks

[ ] May break build
[ ] May break existing applications (see CHANGES.txt)
[ ] Bugfix
[ ] New Feature
[x] Cleanup
[ ] Optimization
[ ] Documentation

--- CPackConfig.cmake
+++ CPackConfig.cmake
@@ -58,7 +58,15 @@

 set(CPACK_RPM_PACKAGE_LICENSE "LGPL, BSD")
 set(CPACK_RPM_PACKAGE_GROUP "Development/Libraries/Parallel")
+set(CPACK_RPM_PACKAGE_VERSION ${SHORT_VERSION})
+
+if(NOT CPACK_DEBIAN_PACKAGE_MAINTAINER)
+  set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Stefan Eilemann <eile@eyescale.ch>")
+endif()
+set(CPACK_DEBIAN_PACKAGE_SECTION "Development")
 set(CPACK_DEBIAN_PACKAGE_DEPENDS "libboost-system-dev, libboost-regex-dev, libboost-date-time-dev, bison, flex, libx11-dev")
+
+set(CPACK_OSX_PACKAGE_VERSION "10.5")

 if(EQ_REVISION)
   set(CPACK_RPM_PACKAGE_RELEASE ${EQ_REVISION})


Fixed sources.cmake in source/ENERGY.

Fixed sources.cmake in source/ENERGY.

--- source/ENERGY/sources.cmake
+++ source/ENERGY/sources.cmake
@@ -10,14 +10,4 @@
 	energyProcessor.C
 )

-### add path to the filenames ###
-SET(SOURCES)
-FOREACH(i ${SOURCES_LIST})
-	LIST(APPEND SOURCES ${DIRECTORY}/${i})
-ENDFOREACH()
-
-### pass source file list to the upper instance ###
-SET(BALL_sources ${BALL_sources} ${SOURCES})
-
-### source group definition ###
-SOURCE_GROUP("Source Files\\ENERGY" FILES ${SOURCE})
+ADD_BALL_SOURCES("ENERGY" "${SOURCES_LIST}")


COMP: Fix typo in ITKPlatformSpecificChecks module

Change-Id: I271e53e7b61305b128aab6d08f85710b64ac93ea
Suggested-by: Otmane Lahlou <0758555b1cf3e18aef1c16114d99a438d11eff6d@c-s.fr>

--- CMake/ITKPlatformSpecificChecks.cmake
+++ CMake/ITKPlatformSpecificChecks.cmake
@@ -46,7 +46,7 @@
 #-----------------------------------------------------------------------------
 #ITK requires special compiler flags on some platforms.
 if(CMAKE_COMPILER_IS_GNUCXX)
- set(ITK_REQUIRED_C_FLAGS "${ITK_REQUIRED_C_FLAGS} -Wall -Wno-uninitialized -Wn o-unused-parameter")
+ set(ITK_REQUIRED_C_FLAGS "${ITK_REQUIRED_C_FLAGS} -Wall -Wno-uninitialized -Wno-unused-parameter")
  set(ITK_REQUIRED_CXX_FLAGS "${ITK_REQUIRED_CXX_FLAGS} -ftemplate-depth-50 -Wall")
  include(${ITK_SOURCE_DIR}/CMake/itkCheckCXXAcceptsFlags.cmake)
  itkCHECK_CXX_ACCEPTS_FLAGS("-Wno-deprecated" CXX_HAS_DEPRECATED_FLAG)


Install java artifact dependencies directly to lib/jars directory.

--- functions.cmake
+++ functions.cmake
@@ -550,8 +550,7 @@
 endfunction()

 function(install_java_artifact_dependencies NAME)
-    install(DIRECTORY "target/dependency/" DESTINATION lib/jars/${NAME} FILES_MATCHING PATTERN "*.jar")
-    install(CODE "execute_process(COMMAND bash -c \"cd \$ENV{DESTDIR}/${CMAKE_INSTALL_PREFIX}/lib/jars && if [ -d ${NAME} ]; then ln -sf ${NAME}/*.jar . ; fi\")")
+    install(DIRECTORY "target/dependency/" DESTINATION lib/jars FILES_MATCHING PATTERN "*.jar")
 endfunction()

 function(install_fat_java_artifact NAME)


updating FindEigen2.cmake for proper search order

--HG--
extra : convert_revision : svn%3A283d02a7-25f6-0310-bc7c-ecb5cbfe19da/trunk/kdesupport/eigen2%40909446

--- bench/btl/cmake/FindEigen2.cmake
+++ bench/btl/cmake/FindEigen2.cmake
@@ -16,10 +16,10 @@
 else (EIGEN2_INCLUDE_DIR)

 find_path(EIGEN2_INCLUDE_DIR NAMES Eigen/Core
-     PATHS
+     PATH_SUFFIXES eigen2
+     HINTS
      ${INCLUDE_INSTALL_DIR}
      ${KDE4_INCLUDE_DIR}
-     PATH_SUFFIXES eigen2
    )

 include(FindPackageHandleStandardArgs)


rolling forward revision of multisense

rolling forward revision of multisense

--- software/externals/cmake/externals.cmake
+++ software/externals/cmake/externals.cmake
@@ -148,7 +148,7 @@
   )

 set(multisense-lcm_url http://github.com/mitdrc/multisense-lcm.git)
-set(multisense-lcm_revision 623bc10577f76e3dfdf061578918e2abacc8c587)
+set(multisense-lcm_revision 70738692bfdc598a0452ae3dd831465c26e7299e)
 set(multisense-lcm_depends libmultisense)