Alphabetical order for Android components

--- cmake/configs/default.cmake
+++ cmake/configs/default.cmake
@@ -417,34 +417,36 @@
   string(COMPARE EQUAL "${CMAKE_SYSTEM_VERSION}" "19" _is_api_19)
   string(COMPARE EQUAL "${CMAKE_SYSTEM_VERSION}" "16" _is_api_16)

+  set(__HUNTER_LAST_DEFAULT_VERSION_NAME "") # Reset alphabetical order checker
+
   if(_is_api_21)
+    hunter_default_version(Android-ARM-EABI-v7a-System-Image VERSION 21_r04)
     hunter_default_version(Android-Google-APIs VERSION 21_r01)
     hunter_default_version(Android-Google-APIs-Intel-x86-Atom-System-Image VERSION 21_r10)
     hunter_default_version(Android-Intel-x86-Atom-System-Image VERSION 21_r05)
     hunter_default_version(Android-SDK-Platform VERSION 21_r02)
     hunter_default_version(Sources-for-Android-SDK VERSION 21)
-    hunter_default_version(Android-ARM-EABI-v7a-System-Image VERSION 21_r04)
   elseif(_is_api_19)
+    hunter_default_version(Android-ARM-EABI-v7a-System-Image VERSION 19_r05)
     hunter_default_version(Android-Google-APIs VERSION 19_r18)
     hunter_default_version(Android-Intel-x86-Atom-System-Image VERSION 19)
     hunter_default_version(Android-SDK-Platform VERSION 19_r04)
     hunter_default_version(Sources-for-Android-SDK VERSION 19)
-    hunter_default_version(Android-ARM-EABI-v7a-System-Image VERSION 19_r05)
   elseif(_is_api_16)
+    hunter_default_version(Android-ARM-EABI-v7a-System-Image VERSION 16_r04)
     hunter_default_version(Android-Google-APIs VERSION 16_r04)
     hunter_default_version(Android-Intel-x86-Atom-System-Image VERSION 16)
+    hunter_default_version(Android-MIPS-System-Image VERSION 16_r04)
     hunter_default_version(Android-SDK-Platform VERSION 16_r05)
     hunter_default_version(Sources-for-Android-SDK VERSION 16)
-    hunter_default_version(Android-ARM-EABI-v7a-System-Image VERSION 16_r04)
-    hunter_default_version(Android-MIPS-System-Image VERSION 16_r04)
   elseif(_is_api_24)
+    hunter_default_version(Android-ARM-EABI-v7a-System-Image VERSION 24_r07)
+    hunter_default_version(Android-ARM64-v8a-System-Image VERSION 24_r07)
     hunter_default_version(Android-Google-APIs VERSION 24_r1)
     hunter_default_version(Android-Google-APIs-Intel-x86-Atom-System-Image VERSION 24_r20)
     hunter_default_version(Android-Intel-x86-Atom-System-Image VERSION 24_r08)
     hunter_default_version(Android-SDK-Platform VERSION 24_r02)
     hunter_default_version(Sources-for-Android-SDK VERSION 24)
-    hunter_default_version(Android-ARM-EABI-v7a-System-Image VERSION 24_r07)
-    hunter_default_version(Android-ARM64-v8a-System-Image VERSION 24_r07)
   else()
     hunter_user_error(
         "Android API (CMAKE_SYSTEM_VERSION)"


added odb-boost to configs/default

added odb-boost to configs/default

--- cmake/configs/default.cmake
+++ cmake/configs/default.cmake
@@ -99,6 +99,7 @@
 hunter_config(log4cplus VERSION 1.2.0-p0)
 hunter_config(nlohmann-json VERSION 1.0.0-rc1-hunter-3)
 hunter_config(odb VERSION 2.4.0)
+hunter_config(odb-boost VERSION 2.4.0)
 hunter_config(odb-compiler VERSION 2.4.0)
 hunter_config(odb-mysql VERSION 2.4.0)
 hunter_config(odb-pgsql VERSION 2.4.0)


[CMake][NFC] Polish comments in AddLLDB.cmake

git-svn-id: 4c4cc70b1ef44ba2b7963015e681894188cea27e@365650 91177308-0d34-0410-b5e6-96231b3b80d8

--- cmake/modules/AddLLDB.cmake
+++ cmake/modules/AddLLDB.cmake
@@ -176,18 +176,22 @@
   set_target_properties(${target_name} PROPERTIES LINK_FLAGS ${new_link_flags})
 endfunction()

+# The test suite relies on finding LLDB.framework binary resources in the
+# build-tree. Remove them before installing to avoid collisions with their
+# own install targets.
 function(lldb_add_to_buildtree_lldb_framework name subdir)
   # Destination for the copy in the build-tree. While the framework target may
   # not exist yet, it will exist when the generator expression gets expanded.
   set(copy_dest "$<TARGET_FILE_DIR:liblldb>/../../../${subdir}")

-  # Copy into the framework's Resources directory for testing.
+  # Copy into the given subdirectory for testing.
   add_custom_command(TARGET ${name} POST_BUILD
     COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:${name}> ${copy_dest}
     COMMENT "Copy ${name} to ${copy_dest}"
   )
 endfunction()

+# Add extra install steps for dSYM creation and stripping for the given target.
 function(lldb_add_post_install_steps_darwin name install_prefix)
   if(NOT APPLE)
     message(WARNING "Darwin-specific functionality; not currently available on non-Apple platforms.")
@@ -219,7 +223,7 @@
     endif()
   endif()

-  # Generate dSYM in symroot
+  # Generate dSYM
   set(dsym_name ${output_name}.dSYM)
   if(is_framework)
     set(dsym_name ${output_name}.framework.dSYM)


cmake: When adding lit testsuites, ignore Output directories

With in-tree builds we can get Output directories scattered among our
tests. Recursing into those to find tests doesn't make sense.

Thanks to nlewycky for noticing this!

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

--- cmake/modules/AddLLVM.cmake
+++ cmake/modules/AddLLVM.cmake
@@ -1138,7 +1138,8 @@
         continue()
       endif()
       string(FIND ${lit_suite} Inputs is_inputs)
-      if (NOT is_inputs EQUAL -1)
+      string(FIND ${lit_suite} Output is_output)
+      if (NOT (is_inputs EQUAL -1 AND is_output EQUAL -1))
         continue()
       endif()


Logic cleanup for recent commit concerning building the documentation.

I agree with Phil's idea (no platform limits on documentation builds)
motivating the last commit, but the implementation needed a small
cleanup, i.e., I dropped redundant parentheses in the if statement and
made then endif statement be consistent with the if statement to quiet
CMake warnings about that inconsistency.

--- cmake/modules/docbook.cmake
+++ cmake/modules/docbook.cmake
@@ -22,12 +22,12 @@

 option(BUILD_DOC "Enable build of DocBook documentation" OFF)

-if(NOT (PERL_FOUND))
+if(NOT PERL_FOUND)
   set(
   BUILD_DOC OFF CACHE INTERNAL
   "Enable build of DocBook documentation"
   )
-endif(NOT (PERL_FOUND AND (CMAKE_SYSTEM_NAME STREQUAL "Linux" OR CMAKE_SYSTEM_NAME STREQUAL "CYGWIN")))
+endif(NOT PERL_FOUND)

 option(PREBUILT_DOC "Assume documentation is already built and present in doc/docbooks/src, ready to be installed. This option is useful for package maintainers" OFF)


precache results of system tests on Windows

--- cmake/os/WindowsCache.cmake
+++ cmake/os/WindowsCache.cmake
@@ -137,6 +137,7 @@
 SET(HAVE_PCLOSE CACHE  INTERNAL "")
 SET(HAVE_PERROR 1 CACHE  INTERNAL "")
 SET(HAVE_PEERCRED CACHE INTERNAL "")
+SET(HAVE_PAM_APPL_H CACHE INTERNAL "")
 SET(HAVE_POLL_H CACHE  INTERNAL "")
 SET(HAVE_POPEN CACHE  INTERNAL "")
 SET(HAVE_POLL CACHE INTERNAL "")
@@ -248,6 +249,7 @@
 SET(HAVE_STRLCAT CACHE  INTERNAL "")
 SET(HAVE_STRLCPY CACHE  INTERNAL "")
 SET(HAVE_STRNCASECMP CACHE  INTERNAL "")
+SET(HAVE_STRNDUP CACHE  INTERNAL "")
 IF(MSVC_VERSION GREATER 1310)
 SET(HAVE_STRNLEN 1 CACHE  INTERNAL "")
 ENDIF()


Add QT resource functionality

Add QT resource functionality

Change-Id: I51b860d0c2535d233aea41dfea314fcf32b308e9

--- cmake/plugins/Qt5/Qt5.cmake
+++ cmake/plugins/Qt5/Qt5.cmake
@@ -43,6 +43,7 @@

 IF(CONFIG_USE_QT5)
 	ADD_PLUGIN_AFTER_DOIT_HOOK(INTERNAL_CREATE_QT5_TARGET)
+        ADD_PLUGIN_BEFORE_DOIT_HOOK(INTERNAL_QT5_RESOURCES)
 ENDIF()

@@ -60,6 +61,21 @@
 ENDFUNCTION()

+FUNCTION(ACME_QT5_ADD_RESOURCE_FILE resfile)
+        SET(GLOBAL_ACME_QT5_RESFILES ${resfile} ${ARGN} CACHE  INTERNAL "QT5 resfiles of current module")
+ENDFUNCTION()
+
+MACRO(INTERNAL_QT5_RESOURCES)
+        STRING(TOUPPER ${CURRENT_MODULE_NAME} CURRENT_UPPER_MODULE_NAME)
+        FOREACH(ACME_QT_RESFILE ${GLOBAL_ACME_QT5_RESFILES})
+                SET(QT5_RESFILE "${CMAKE_CURRENT_SOURCE_DIR}/${CURRENT_MODULE_NAME}/${ACME_QT_RESFILE}.qrc")
+                IF(EXISTS ${QT5_RESFILE})
+                        qt5_add_resources(ACME_QT_RESFILE_TO_LINK ${QT5_RESFILE})
+                        SET(${CURRENT_UPPER_MODULE_NAME}_MODULE_SOURCE_FILES ${${CURRENT_UPPER_MODULE_NAME}_MODULE_SOURCE_FILES} ${QT5_RESFILE} ${ACME_QT_RESFILE_TO_LINK} CACHE INTERNAL "")
+                ENDIF()
+        ENDFOREACH()
+        SET(GLOBAL_ACME_QT5_RESFILES "" CACHE  INTERNAL "QT5 resfiles of current module")
+ENDMACRO()

 # Must be a macro
 MACRO(INTERNAL_CREATE_QT5_TARGET)
@@ -86,7 +102,7 @@
 	ENDIF()
 	SET(GLOBAL_ACME_QT5_MODULES "" CACHE  INTERNAL "QT5 modules of current module")
 	SET(GLOBAL_ACME_QT5_UIFILES "" CACHE  INTERNAL "QT5 uifiles of current module")
-
+
 ENDMACRO()


Added debug printout.

Added debug printout.

--- cmake_modules/FindVTK.cmake
+++ cmake_modules/FindVTK.cmake
@@ -113,6 +113,8 @@
     get_filename_component(__TMP_DIR "${VTK_LIB_DIR}" PATH)
     get_filename_component(__TMP_DIR "${__TMP_DIR}" PATH)
     set(VTK_INCLUDE_DIRS "${__TMP_DIR}/include/vtk-5.10" CACHE PATH "VTK Headers location.")
+message(STATUS "${VTK_LIB_DIR}")
+message(STATUS "${__TMP_DIR}/include/vtk-5.10")

 else()


Fix the EMSCRIPTEN_ROOT_PATH auto-detection.

--- CMake/Toolchains/Emscripten.cmake
+++ CMake/Toolchains/Emscripten.cmake
@@ -59,8 +59,9 @@
         if (NOT EMSCRIPTEN_ROOT_PATH)
             if (DEFINED ENV{EMSCRIPTEN_ROOT_PATH})
                 file (TO_CMAKE_PATH $ENV{EMSCRIPTEN_ROOT_PATH} EMSCRIPTEN_ROOT_PATH)
-            elseif (DEFINED ENV{EMSCRIPTEN})
-                file (TO_CMAKE_PATH $ENV{EMSCRIPTEN} EMSCRIPTEN_ROOT_PATH)
+            elseif (DEFINED ENV{EM_CONFIG})
+                file (STRINGS $ENV{EM_CONFIG} EMSCRIPTEN_ROOT_PATH REGEX "^EMSCRIPTEN_ROOT = '.*'$")
+                string (REGEX REPLACE "^EMSCRIPTEN_ROOT = '(.*)'$" \\1 EMSCRIPTEN_ROOT_PATH "${EMSCRIPTEN_ROOT_PATH}")    # Stringify to guard against empty variable
             endif ()
         endif ()
         set (EMSCRIPTEN_ROOT_PATH ${EMSCRIPTEN_ROOT_PATH} CACHE STRING "Root path to Emscripten cross-compiler tools (Emscripten only)")


[CMake] Use LLVM_LIBDIR to construct CLANG_RESOURCE_DIR

CLANG_RESOURCE_DIR did not account for LLVM_LIBDIR_SUFFIX.
LLVM_LIBDIR is derived from llvm-config which takes care of this.

--- cmake/LLVM.cmake
+++ cmake/LLVM.cmake
@@ -712,7 +712,7 @@
 endif()

 if(LLVM_OLDER_THAN_5_0)
-  set(CLANG_RESOURCE_DIR "${LLVM_PREFIX}/lib/clang/${LLVM_VERSION_FULL}")
+  set(CLANG_RESOURCE_DIR "${LLVM_LIBDIR}/clang/${LLVM_VERSION_FULL}")
 else()
   execute_process(COMMAND "${CLANG}" "--print-resource-dir" OUTPUT_VARIABLE CLANG_RESOURCE_DIR)
   string(STRIP "${CLANG_RESOURCE_DIR}" CLANG_RESOURCE_DIR)


The -fno-rtti flag is apparently NOT fixed in 3.7

--- cmake/LLVM.cmake
+++ cmake/LLVM.cmake
@@ -193,7 +193,8 @@

 # - '-fno-rtti' is a work-around for llvm bug 14200
 # Which according to bug report has been fixed in llvm 3.7
-if ((LLVM_MINOR LESS 7) AND (NOT MSVC))
+# sadly, that bugreport is mistaken, it's not fixed in 3.7
+if (NOT MSVC)
   set(LLVM_CXXFLAGS "${LLVM_CXXFLAGS} -fno-rtti")
 endif()


spell error

spell error

--- cmake/sdks.cmake
+++ cmake/sdks.cmake
@@ -18,7 +18,7 @@
 if(BUILD_ONLY)
     set(SDK_BUILD_LIST ${BUILD_ONLY})
     # core is a must
-    list(APPEND BUILD_LIST "core")
+    list(APPEND SDK_BUILD_LIST "core")
     foreach(TARGET IN LISTS BUILD_ONLY)
         message(STATUS "Considering ${TARGET}")
         get_dependencies_for_sdk(${TARGET} DEPENDENCY_LIST)


Add targets for parallel testing by the build tool

--- cmake/test.cmake
+++ cmake/test.cmake
@@ -51,6 +51,7 @@
       "--suppressions=${CMAKE_SOURCE_DIR}/tests/valgrind/glibc.supp")
   endif (VISTK_VALGRIND_USE_SUPPRESSIONS)

+  add_custom_target(tests)
   add_custom_target(valgrind)
   add_custom_target(cachegrind)
   add_custom_target(callgrind)
@@ -95,6 +96,8 @@
 function (vistk_declare_test testname)
   if (NOT WIN32)
     add_custom_target(tests-${testname})
+    add_dependencies(tests
+      tests-${testname})
   endif (NOT WIN32)
   if (VALGRIND_EXECUTABLE)
     add_custom_target(valgrind-${testname})


Update utils

Update utils

--- cmake/util.cmake
+++ cmake/util.cmake
@@ -104,24 +104,24 @@
     endif()
 endmacro()

-function(get_prefix prefix)
-  if(BUILD_STATIC_LIBS)
-  set(STATIC_PREFIX "static-")
-    if(ANDROID)
-      set(STATIC_PREFIX "${STATIC_PREFIX}android-${ANDROID_ABI}-")
-    elseif(IOS)
-      set(STATIC_PREFIX "${STATIC_PREFIX}${IOS_PLATFORM}${IOS_ARCH}-${ANDROID_ABI}-")
+function(get_prefix prefix IS_STATIC)
+  if(IS_STATIC)
+    set(STATIC_PREFIX "static-")
+      if(ANDROID)
+        set(STATIC_PREFIX "${STATIC_PREFIX}android-${ANDROID_ABI}-")
+      elseif(IOS)
+        set(STATIC_PREFIX "${STATIC_PREFIX}ios-${IOS_ARCH}-")
+      endif()
     endif()
-  endif()
   set(${prefix} ${STATIC_PREFIX} PARENT_SCOPE)
 endfunction()

 function(get_cpack_filename ver name)
     get_compiler_version(COMPILER)
-    get_prefix(STATIC_PREFIX)
+    get_prefix(STATIC_PREFIX BUILD_STATIC_LIBS)

-    set(${name} ${PACKAGE_NAME}-${ver}-${STATIC_PREFIX}${COMPILER} PARENT_SCOPE)
+    set(${name} ${PROJECT_NAME}-${ver}-${STATIC_PREFIX}${COMPILER} PARENT_SCOPE)
 endfunction()

 function(get_compiler_version ver)


Sync with kdelibs version

Sync with kdelibs version

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

--- cmake/FindExiv2.cmake
+++ cmake/FindExiv2.cmake
@@ -13,13 +13,13 @@
   SET(EXIV2_FOUND TRUE)

 else (EXIV2_INCLUDE_DIR AND EXIV2_LIBRARIES)
-
+  if (NOT WIN32)
   # use pkg-config to get the directories and then use these values
   # in the FIND_PATH() and FIND_LIBRARY() calls
   INCLUDE(UsePkgConfig)

   PKGCONFIG(exiv2 _EXIV2IncDir _EXIV2LinkDir _EXIV2LinkFlags _EXIV2Cflags)
-
+
   if(_EXIV2LinkFlags)
     # query pkg-config asking for a Exiv2 >= 0.12
     EXEC_PROGRAM(${PKGCONFIG_EXECUTABLE} ARGS --atleast-version=0.12 exiv2 RETURN_VALUE _return_VALUE OUTPUT_VARIABLE _pkgconfigDevNull )
@@ -27,9 +27,18 @@
       message(STATUS "Found Exiv2 release >= 0.12")
       set(EXIV2_VERSION_GOOD_FOUND TRUE)
     else(_return_VALUE STREQUAL "0")
-      message(FATAL_ERROR "Found Exiv2 release < 0.12")
+      message(STATUS "Found Exiv2 release < 0.12")
     endif(_return_VALUE STREQUAL "0")
+  else(_EXIV2LinkFlags)
+      set(EXIV2_FOUND FALSE)
+      set(EXIV2_VERSION_GOOD_FOUND FALSE)
+      message(STATUS "Cannot find Exiv2 library!")
   endif(_EXIV2LinkFlags)
+
+  else(NOT WIN32)
+     #Better check
+     set(EXIV2_VERSION_GOOD_FOUND TRUE)
+  endif (NOT WIN32)

   if(EXIV2_VERSION_GOOD_FOUND)
      set(EXIV2_DEFINITIONS ${_EXIV2Cflags})
@@ -38,7 +47,7 @@
        ${_EXIV2IncDir}
      )

-     FIND_LIBRARY(EXIV2_LIBRARIES NAMES exiv2
+     FIND_LIBRARY(EXIV2_LIBRARIES NAMES exiv2 libexiv2
        PATHS
        ${_EXIV2LinkDir}
      )
@@ -46,23 +55,23 @@
      if (EXIV2_INCLUDE_DIR AND EXIV2_LIBRARIES)
         set(EXIV2_FOUND TRUE)
      endif (EXIV2_INCLUDE_DIR AND EXIV2_LIBRARIES)
-
-     if (EXIV2_FOUND)
-        if (NOT Exiv2_FIND_QUIETLY)
-         message(STATUS "Found Exiv2: ${EXIV2_LIBRARIES}")
-        endif (NOT Exiv2_FIND_QUIETLY)
-     else (EXIV2_FOUND)
-       if (Exiv2_FIND_REQUIRED)
-         if (NOT EXIV2_INCLUDE_DIR)
-           message(FATAL_ERROR "Could NOT find Exiv2 header files")
-         endif (NOT EXIV2_INCLUDE_DIR)
-         if (NOT EXIV2_LIBRARIES)
+   endif(EXIV2_VERSION_GOOD_FOUND)
+   if (EXIV2_FOUND)
+      if (NOT Exiv2_FIND_QUIETLY)
+       message(STATUS "Found Exiv2: ${EXIV2_LIBRARIES}")
+      endif (NOT Exiv2_FIND_QUIETLY)
+   else (EXIV2_FOUND)
+     if (Exiv2_FIND_REQUIRED)
+       if (NOT EXIV2_INCLUDE_DIR)
+         message(FATAL_ERROR "Could NOT find Exiv2 header files")
+       endif (NOT EXIV2_INCLUDE_DIR)
+       if (NOT EXIV2_LIBRARIES)
            message(FATAL_ERROR "Could NOT find Exiv2 library")
-         endif (NOT EXIV2_LIBRARIES)
-       endif (Exiv2_FIND_REQUIRED)
-     endif (EXIV2_FOUND)
-  endif(EXIV2_VERSION_GOOD_FOUND)
+       endif (NOT EXIV2_LIBRARIES)
+     endif (Exiv2_FIND_REQUIRED)
+   endif (EXIV2_FOUND)

   MARK_AS_ADVANCED(EXIV2_INCLUDE_DIR EXIV2_LIBRARIES)

 endif (EXIV2_INCLUDE_DIR AND EXIV2_LIBRARIES)
+


Modernize FindFFTW3.cmake in compliance with removed CMake policy CMP0054

--- cmake/FindFFTW3.cmake
+++ cmake/FindFFTW3.cmake
@@ -6,128 +6,129 @@
 #  FFTW3_DEFINITIONS - Compiler switches required for using libsndfile

 if (MSVC)
-	if(NOT DEFINED FFTW3_DIR)
-		if(DEFINED FFTW3_ROOT)
-			set(FFTW3_DIR ${FFTW3_ROOT})
-		elseif(DEFINED ENV{FFTW3_ROOT})
-			set(FFTW3_DIR $ENV{FFTW3_ROOT})
-		else()
-			set(FFTW3_DIR "FFTW3_DIR-NOTFOUND")
-		endif()
-	endif()
-	set(FFTW3_DIR "${FFTW3_DIR}" CACHE PATH "Installation folder of FFTW3")
+    if(NOT DEFINED FFTW3_DIR)
+        if(DEFINED FFTW3_ROOT)
+            set(FFTW3_DIR ${FFTW3_ROOT})
+        elseif(DEFINED ENV{FFTW3_ROOT})
+            set(FFTW3_DIR $ENV{FFTW3_ROOT})
+        else()
+            set(FFTW3_DIR "FFTW3_DIR-NOTFOUND")
+        endif()
+    endif()
+    set(FFTW3_DIR "${FFTW3_DIR}" CACHE PATH "Installation folder of FFTW3")

-	# Parse import library name to get FFTW3 minor version number
-	foreach(_subdir x64 x86 x64/lib x86/lib lib/x64 lib/x86 lib32 lib64 lib "")
-		file(GLOB _matches
-			"${FFTW3_DIR}/${_subdir}/*${CMAKE_IMPORT_LIBRARY_SUFFIX}")
-		foreach(_match ${_matches})
-			get_filename_component(_name ${_match} NAME_WE)
-			if(${_name} MATCHES "^(lib)?fftw3[flq]?-([0-9]+)")
-				set(FFTW3_VERSION_MINOR ${CMAKE_MATCH_2})
-				break()
-			endif()
-		endforeach()
-		if(NOT "${FFTW3_VERSION_MINOR}" STREQUAL "")
-			break()
-		endif()
-	endforeach()
+    # Parse import library name to get FFTW3 minor version number
+    foreach(_subdir x64 x86 x64/lib x86/lib lib/x64 lib/x86 lib32 lib64 lib "")
+        file(GLOB _matches
+            "${FFTW3_DIR}/${_subdir}/*${CMAKE_IMPORT_LIBRARY_SUFFIX}")
+        foreach(_match ${_matches})
+            get_filename_component(_name ${_match} NAME_WE)
+            if(${_name} MATCHES "^(lib)?fftw3[flq]?-([0-9]+)")
+                set(FFTW3_VERSION_MINOR ${CMAKE_MATCH_2})
+                break()
+            endif()
+        endforeach()
+        if(NOT "${FFTW3_VERSION_MINOR}" STREQUAL "")
+            break()
+        endif()
+    endforeach()

-	if (CMAKE_CL_64)
-		set(_subdirs ${FFTW3_DIR}/x64 ${FFTW3_DIR}/x64/lib
-			${FFTW3_DIR}/lib/x64 ${FFTW3_DIR}/lib64 ${FFTW3_DIR}/lib
-			${FFTW3_DIR})
-	else ()
-		set(_subdirs ${FFTW3_DIR}/x86 ${FFTW3_DIR}/x86/lib
-			${FFTW3_DIR}/lib/x86 ${FFTW3_DIR}/lib32 ${FFTW3_DIR}/lib
-			${FFTW3_DIR})
-	endif()
+    if (CMAKE_CL_64)
+        set(_subdirs ${FFTW3_DIR}/x64 ${FFTW3_DIR}/x64/lib
+            ${FFTW3_DIR}/lib/x64 ${FFTW3_DIR}/lib64 ${FFTW3_DIR}/lib
+            ${FFTW3_DIR})
+    else ()
+        set(_subdirs ${FFTW3_DIR}/x86 ${FFTW3_DIR}/x86/lib
+            ${FFTW3_DIR}/lib/x86 ${FFTW3_DIR}/lib32 ${FFTW3_DIR}/lib
+            ${FFTW3_DIR})
+    endif()

-	macro(_fftw3_lib _SUFFIXV _SUFFIXF)
-		find_library("FFTW3${_SUFFIXV}_LIBRARY"
-				NAMES
-					"libfftw3${_SUFFIXF}-${FFTW3_VERSION_MINOR}"
-					"fftw3${_SUFFIXF}-${FFTW3_VERSION_MINOR}"
-				PATHS ${_subdirs})
-		# message(STATUS "FFTW3${_SUFFIXV}_LIBRARY: ${FFTW3${_SUFFIXV}_LIBRARY}")
-		if (FFTW3${_SUFFIXV}_LIBRARY)
-			list(APPEND FFTW3_LIBRARIES "${FFTW3${_SUFFIXV}_LIBRARY}")
-			# message(STATUS "FFTW3_LIBRARIES: ${FFTW3_LIBRARIES}")
-		endif()
-	endmacro()
+    macro(_fftw3_lib _SUFFIXV _SUFFIXF)
+        find_library("FFTW3${_SUFFIXV}_LIBRARY"
+                NAMES
+                    "libfftw3${_SUFFIXF}-${FFTW3_VERSION_MINOR}"
+                    "fftw3${_SUFFIXF}-${FFTW3_VERSION_MINOR}"
+                PATHS ${_subdirs})
+        # message(STATUS "FFTW3${_SUFFIXV}_LIBRARY: ${FFTW3${_SUFFIXV}_LIBRARY}")
+        if (FFTW3${_SUFFIXV}_LIBRARY)
+            list(APPEND FFTW3_LIBRARIES "${FFTW3${_SUFFIXV}_LIBRARY}")
+            # message(STATUS "FFTW3_LIBRARIES: ${FFTW3_LIBRARIES}")
+        endif()
+    endmacro()

-	_fftw3_lib(D "")
-	_fftw3_lib(F f)
-	_fftw3_lib(L l)
-	_fftw3_lib(Q q)
+    _fftw3_lib(D "")
+    _fftw3_lib(F f)
+    _fftw3_lib(L l)
+    _fftw3_lib(Q q)

-	find_path(FFTW3_INCLUDE_DIR fftw3.h
-		PATHS ${_subdirs}
-		PATH_SUFFIXES include)
+    find_path(FFTW3_INCLUDE_DIR fftw3.h
+        PATHS ${_subdirs}
+        PATH_SUFFIXES include)

-	set(FFTW3_VERSION "3.${FFTW3_VERSION_MINOR}")
+    set(FFTW3_VERSION "3.${FFTW3_VERSION_MINOR}")
 else ()
-	set(FFT3_DEFINITIONS "")
-	find_package(PkgConfig)
+    set(FFT3_DEFINITIONS "")
+    find_package(PkgConfig)

-	macro(_fftw3_lib _SUFFIXV _SUFFIXF)
-		set(_stem "FFTW3${_SUFFIXV}")
-		set(_threads_library "${_stem}_THREADS_LIBRARY")
-		set(_library "${_stem}_LIBRARY")
-		set(_fstem "fftw3${_SUFFIXF}")
+    macro(_fftw3_lib _SUFFIXV _SUFFIXF)
+        set(_stem "FFTW3${_SUFFIXV}")
+        set(_threads_library "${_stem}_THREADS_LIBRARY")
+        set(_library "${_stem}_LIBRARY")
+        set(_fstem "fftw3${_SUFFIXF}")

-		if(PkgConfig_FOUND)
-			pkg_check_modules("PC_${_stem}" QUIET ${_fstem})
-		endif()
+        if(PkgConfig_FOUND)
+            pkg_check_modules("PC_${_stem}" QUIET ${_fstem})
+        endif()

-		find_library(${_library}
-			NAMES
-				"${_fstem}"
-				"lib${_fstem}"
-			HINTS "${PC_${_stem}_LIBRARY_DIRS}")
+        find_library(${_library}
+            NAMES
+                "${_fstem}"
+                "lib${_fstem}"
+            HINTS "${PC_${_stem}_LIBRARY_DIRS}")

-		if("${_library}")
+        if(${_library})
 #            message(STATUS "found: ${${_library}}")
-			list(APPEND FFTW3_LIBRARIES "${${_library}}")
+            list(APPEND FFTW3_LIBRARIES "${${_library}}")

-			find_library(${_threads_library}
-				NAMES
-					"${_fstem}_threads"
-					"lib${_fstem}_threads"
-				HINTS "${PC_${_stem}_LIBRARY_DIRS}")
+            find_library(${_threads_library}
+                NAMES
+                    "${_fstem}_threads"
+                    "lib${_fstem}_threads"
+                HINTS "${PC_${_stem}_LIBRARY_DIRS}")

-			if("${_threads_library}")
+            if(${_threads_library})
 #                message(STATUS "found: ${${_threads_library}}")
-				list(APPEND FFTW3_LIBRARIES "${${_threads_library}}")
-			endif()
+                list(APPEND FFTW3_LIBRARIES "${${_threads_library}}")
+            endif()

-			set("${_stem}_DEFINITIONS"
-					"${PC_${_stem}_CFLAGS_OTHER}")
-			list(APPEND FFTW3_DEFINITIONS "${${_stem}_DEFINITIONS}")
-		endif()
-	endmacro()
+            set("${_stem}_DEFINITIONS"
+                    "${PC_${_stem}_CFLAGS_OTHER}")
+            list(APPEND FFTW3_DEFINITIONS "${${_stem}_DEFINITIONS}")
+        endif()
+    endmacro()

-	#    if(FFTW3_FIND_COMPONENTS)
-	#        foreach(_comp ${FFTW3_FIND_COMPONENTS})
-	#            if(_comp STREQUAL "fftw3")
-	#                _fftw3_lib(D "")
+    #    if(FFTW3_FIND_COMPONENTS)
+    #        foreach(_comp ${FFTW3_FIND_COMPONENTS})
+    #            if(_comp STREQUAL "fftw3")
+    #                _fftw3_lib(D "")

-	_fftw3_lib(D "")
-	_fftw3_lib(F f)
-	_fftw3_lib(L l)
-	_fftw3_lib(Q q)
+    _fftw3_lib(D "")
+    _fftw3_lib(F f)
+    _fftw3_lib(L l)
+    _fftw3_lib(Q q)

-	find_path(FFTW3_INCLUDE_DIR fftw3.h
-		HINTS
-			${PC_FFTW3F_INCLUDE_DIRS}
-			${PC_FFTW3D_INCLUDE_DIRS}
-			${PC_FFTW3L_INCLUDE_DIRS}
-			${PC_FFTW3Q_INCLUDE_DIRS})
+    find_path(FFTW3_INCLUDE_DIR fftw3.h
+        HINTS
+            ${PC_FFTW3F_INCLUDE_DIRS}
+            ${PC_FFTW3D_INCLUDE_DIRS}
+            ${PC_FFTW3L_INCLUDE_DIRS}
+            ${PC_FFTW3Q_INCLUDE_DIRS})

-	list(REMOVE_DUPLICATES FFTW3_DEFINITIONS)
-	set(FFTW3_VERSION ${PC_FFTW3D_VERSION})
+    list(REMOVE_DUPLICATES FFTW3_DEFINITIONS)
+    set(FFTW3_VERSION ${PC_FFTW3D_VERSION})
 endif()

+message(STATUS "FFTW3_LIBRARIES: ${FFTW3_LIBRARIES}")
 if(NOT FFTW3_LIBRARIES)
     set(FFTW3_LIBRARIES "FFTW3_LIBRARIES-NOTFOUND")
 endif()
@@ -138,48 +139,48 @@
 # handle the QUIETLY and REQUIRED arguments and set FFTW3_FOUND to TRUE
 # if all listed variables are TRUE
 find_package_handle_standard_args(FFTW3
-	REQUIRED_VARS FFTW3_LIBRARIES FFTW3_INCLUDE_DIRS
-	VERSION_VAR FFTW3_VERSION)
+    REQUIRED_VARS FFTW3_LIBRARIES FFTW3_INCLUDE_DIRS
+    VERSION_VAR FFTW3_VERSION)

 mark_as_advanced(FFTW3_INCLUDE_DIRS FFTW3_LIBRARIES
-	FFTW3F_LIBRARY FFTW3F_THREADS_LIBRARY
-	FFTW3D_LIBRARY FFTW3D_THREADS_LIBRARY
-	FFTW3L_LIBRARY FFTW3L_THREADS_LIBRARY
-	FFTW3Q_LIBRARY FFTW3Q_THREADS_LIBRARY
-	FFTW3_INCLUDE_DIR)
+    FFTW3F_LIBRARY FFTW3F_THREADS_LIBRARY
+    FFTW3D_LIBRARY FFTW3D_THREADS_LIBRARY
+    FFTW3L_LIBRARY FFTW3L_THREADS_LIBRARY
+    FFTW3Q_LIBRARY FFTW3Q_THREADS_LIBRARY
+    FFTW3_INCLUDE_DIR)

 if(FFTW3_FOUND AND NOT TARGET fftw3)
-	macro(_fftw3_component_target _SUFFIXV _SUFFIXF)
-		set(_stem "FFTW3${_SUFFIXV}")
-		set(_threads_library "${_stem}_THREADS_LIBRARY")
-		set(_library "${_stem}_LIBRARY")
-		set(_fstem "fftw3${_SUFFIXF}")
+    macro(_fftw3_component_target _SUFFIXV _SUFFIXF)
+        set(_stem "FFTW3${_SUFFIXV}")
+        set(_threads_library "${_stem}_THREADS_LIBRARY")
+        set(_library "${_stem}_LIBRARY")
+        set(_fstem "fftw3${_SUFFIXF}")
 #        message(STATUS "_fftw3_component_target ${_SUFFIX}")
-		if("${_library}")
-			add_library(${_fstem} UNKNOWN IMPORTED)
+        if(${_library})
+            add_library(${_fstem} UNKNOWN IMPORTED)
 #            message(STATUS "add_library(${_fstem})")
-			set_target_properties(${_fstem} PROPERTIES
-					IMPORTED_LINK_INTERFACE_LANGUAGES "C"
-					IMPORTED_LOCATION "${${_library}}"
-					INTERFACE_COMPILE_OPTIONS "${${_stem}_DEFINITIONS}"
-					INTERFACE_INCLUDE_DIRECTORIES ${FFTW3_INCLUDE_DIR})
+            set_target_properties(${_fstem} PROPERTIES
+                    IMPORTED_LINK_INTERFACE_LANGUAGES "C"
+                    IMPORTED_LOCATION "${${_library}}"
+                    INTERFACE_COMPILE_OPTIONS "${${_stem}_DEFINITIONS}"
+                    INTERFACE_INCLUDE_DIRECTORIES ${FFTW3_INCLUDE_DIR})
 #            message(STATUS "IMPORTED_LOCATION ${${_library}}")
 #            message(STATUS "INTERFACE_INCLUDE_DIRECTORIES ${FFTW3_INCLUDE_DIR}")
-			if("${_threads_library}")
-				add_library("${_fstem}_threads" UNKNOWN IMPORTED)
+            if(${_threads_library})
+                add_library("${_fstem}_threads" UNKNOWN IMPORTED)
 #                message(STATUS "add_library(${_fstem}_threads)")
-				set_target_properties("${_fstem}_threads" PROPERTIES
-						IMPORTED_LINK_INTERFACE_LANGUAGES "C"
-						IMPORTED_LOCATION "${${_threads_library}}")
+                set_target_properties("${_fstem}_threads" PROPERTIES
+                        IMPORTED_LINK_INTERFACE_LANGUAGES "C"
+                        IMPORTED_LOCATION "${${_threads_library}}")
 #                message(STATUS "IMPORTED_LOCATION ${${_threads_library}}")
-				set_target_properties(${_fstem} PROPERTIES
-						INTERFACE_LINK_LIBRARIES "${_fstem}_threads")
-			endif()
-		endif()
-	endmacro()
+                set_target_properties(${_fstem} PROPERTIES
+                        INTERFACE_LINK_LIBRARIES "${_fstem}_threads")
+            endif()
+        endif()
+    endmacro()

-	_fftw3_component_target(D "")
-	_fftw3_component_target(F f)
-	_fftw3_component_target(L l)
-	_fftw3_component_target(Q q)
+    _fftw3_component_target(D "")
+    _fftw3_component_target(F f)
+    _fftw3_component_target(L l)
+    _fftw3_component_target(Q q)
 endif()


Update FindMySQL to look for MariaDB 10.6

--- cmake/FindMySQL.cmake
+++ cmake/FindMySQL.cmake
@@ -87,6 +87,7 @@
     "${PROGRAM_FILES_64}/MariaDB 10.3/include/mysql"
     "${PROGRAM_FILES_64}/MariaDB 10.4/include/mysql"
     "${PROGRAM_FILES_64}/MariaDB 10.5/include/mysql"
+    "${PROGRAM_FILES_64}/MariaDB 10.6/include/mysql"
     "C:/MySQL/include"
     "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MySQL AB\\MySQL Server 5.7;Location]/include"
     "$ENV{ProgramFiles}/MySQL/MySQL Server 5.7/include"
@@ -128,6 +129,7 @@
       "${PROGRAM_FILES_64}/MariaDB 10.3/lib"
       "${PROGRAM_FILES_64}/MariaDB 10.4/lib"
       "${PROGRAM_FILES_64}/MariaDB 10.5/lib"
+      "${PROGRAM_FILES_64}/MariaDB 10.6/lib"
       "C:/MySQL/lib/debug"
       "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MySQL AB\\MySQL Server 5.7;Location]/lib"
       "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MySQL AB\\MySQL Server 5.7;Location]/lib/opt"
@@ -183,6 +185,7 @@
         "${PROGRAM_FILES_64}/MariaDB 10.3/bin"
         "${PROGRAM_FILES_64}/MariaDB 10.4/bin"
         "${PROGRAM_FILES_64}/MariaDB 10.5/bin"
+        "${PROGRAM_FILES_64}/MariaDB 10.6/bin"
         "C:/MySQL/bin/debug"
         "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MySQL AB\\MySQL Server 5.7;Location]/bin"
         "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MySQL AB\\MySQL Server 5.7;Location]/bin/opt"


Fixed naming scheme for python modules.

Fixed naming scheme for python modules.

--- cmake/SIPMacros.cmake
+++ cmake/SIPMacros.cmake
@@ -101,7 +101,8 @@
     ADD_LIBRARY(${OUTPUT_BASENAME} SHARED ${_sip_output_files} ${SIP_EXTRA_SOURCES})
     TARGET_LINK_LIBRARIES(${OUTPUT_BASENAME} ${PYTHON_LIBRARY})
     TARGET_LINK_LIBRARIES(${OUTPUT_BASENAME} ${EXTRA_LINK_LIBRARIES})
-    SET_TARGET_PROPERTIES(${OUTPUT_BASENAME} PROPERTIES PREFIX "" OUTPUT_NAME ${OUTPUT_BASENAME})
+    SET_TARGET_PROPERTIES(${OUTPUT_BASENAME} PROPERTIES PREFIX "" OUTPUT_NAME ${MODULE_NAME})
+    SET_TARGET_PROPERTIES(${OUTPUT_BASENAME} PROPERTIES IMPORT_PREFIX "pythonModule_")
     INCLUDE_DIRECTORIES(${SIP_MODULE_BINARY_DIR})

     IF (WIN32)


[axl_cmake] added axl_is_excluded_from_build macro

--- cmake/axl_utils.cmake
+++ cmake/axl_utils.cmake
@@ -852,6 +852,19 @@
 endmacro ()

 macro (
+axl_is_excluded_from_build
+	_RESULT
+	_FILE_NAME
+	)
+
+	get_source_file_property (
+		${_RESULT}
+		${_FILE_NAME}
+		HEADER_FILE_ONLY
+		)
+endmacro ()
+
+macro (
 axl_exclude_from_build
 	# ...
 	)


[CMake] When disabling PIC, also pass -fno-pie when linking if it is supported.

Building clang with -fno-pie generates slightly faster code. In my not-very-rigorous testing I saw about a 4% speed up using the clang test-suite sources.

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

--- cmake/config-ix.cmake
+++ cmake/config-ix.cmake
@@ -299,6 +299,10 @@
   set(ENABLE_PIC 1)
 else()
   set(ENABLE_PIC 0)
+  check_cxx_compiler_flag("-fno-pie" SUPPORTS_NO_PIE_FLAG)
+  if(SUPPORTS_NO_PIE_FLAG)
+    list(APPEND CMAKE_EXE_LINKER_FLAGS "-fno-pie")
+  endif()
 endif()

 check_cxx_compiler_flag("-Wno-variadic-macros" SUPPORTS_NO_VARIADIC_MACROS_FLAG)


[brief] Fixes #8.

[brief] Fixes #8.

[detailed]
- Minor syntax error in compiler config file.

--- config/Compiler.cmake
+++ config/Compiler.cmake
@@ -33,7 +33,7 @@
     set(CMAKE_CXX_FLAGS_DEBUG "-g")
     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -std=gnu++14")

-    if (APPLE or WIN32)
+    if (APPLE OR WIN32)
         if (ATLAS_COMPILER_CLANG)
             set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
         endif()


TEST: Remove confidence image test for shark k-means.

shark k-means do not provide confidence map (for now).

--- Modules/Learning/Unsupervised/test/tests-shark.cmake
+++ Modules/Learning/Unsupervised/test/tests-shark.cmake
@@ -32,11 +32,9 @@

 otb_add_test(NAME leTvImageClassificationFilterSharkKMeans COMMAND  otbUnsupervisedTestDriver
-  --compare-n-images ${NOTOL} 2
+  --compare-n-images ${NOTOL} 1
   ${BASELINE}/leSharkUnsupervisedImageClassificationFilterOutput.tif
   ${TEMP}/leSharkUnsupervisedImageClassificationFilterOutput.tif
-  ${BASELINE}/leSharkUnsupervisedImageClassificationFilterConfidence.tif
-  ${TEMP}/leSharkUnsupervisedImageClassificationFilterConfidence.tif
   otbSharkUnsupervisedImageClassificationFilter
   ${INPUTDATA}/Classification/QB_1_ortho.tif
   ${TEMP}/leSharkUnsupervisedImageClassificationFilterOutput.tif
@@ -47,11 +45,9 @@

 otb_add_test(NAME leTvImageClassificationFilterSharkKMeansMask COMMAND  otbUnsupervisedTestDriver
-  --compare-n-images ${NOTOL} 2
+  --compare-n-images ${NOTOL} 1
   ${BASELINE}/leSharkUnsupervisedImageClassificationFilterWithMaskOutput.tif
   ${TEMP}/leSharkUnsupervisedImageClassificationFilterWithMaskOutput.tif
-  ${BASELINE}/leSharkUnsupervisedImageClassificationFilterWithMaskConfidence.tif
-  ${TEMP}/leSharkUnsupervisedImageClassificationFilterWithMaskConfidence.tif
   otbSharkUnsupervisedImageClassificationFilter
   ${INPUTDATA}/Classification/QB_1_ortho.tif
   ${TEMP}/leSharkUnsupervisedImageClassificationFilterWithMaskOutput.tif


SVN_SILENT made messages (.desktop file)

--- xine/xine.desktop.cmake
+++ xine/xine.desktop.cmake
@@ -11,6 +11,7 @@

 Name=Xine
 Name[bg]=Xine
+Name[bs]=Xine
 Name[ca]=Xine
 Name[ca@valencia]=Xine
 Name[cs]=Xine


clang-cl.exe support

clang-cl.exe support

--- CMake/cotire.cmake
+++ CMake/cotire.cmake
@@ -43,7 +43,7 @@
 endif()

 set (COTIRE_CMAKE_MODULE_FILE "${CMAKE_CURRENT_LIST_FILE}")
-set (COTIRE_CMAKE_MODULE_VERSION "1.7.11")
+set (COTIRE_CMAKE_MODULE_VERSION "1.8.0")

 # activate select policies
 if (POLICY CMP0025)
@@ -1545,16 +1545,36 @@
 			endif()
 		endif()
 	elseif (_compilerID MATCHES "Clang")
-		# Clang options used
-		# -H print the name of each header file used
-		# -E invoke preprocessor
-		# -fno-color-diagnostics don't prints diagnostics in color
-		if (_flags)
-			# append to list
-			list (APPEND _flags -H -E -fno-color-diagnostics)
-		else()
-			# return as a flag string
-			set (_flags "-H -E -fno-color-diagnostics")
+		if (UNIX)
+			# Clang options used
+			# -H print the name of each header file used
+			# -E invoke preprocessor
+			# -fno-color-diagnostics do not print diagnostics in color
+			# -Eonly just run preprocessor, no output
+			if (_flags)
+				# append to list
+				list (APPEND _flags -H -E -fno-color-diagnostics -Xclang -Eonly)
+			else()
+				# return as a flag string
+				set (_flags "-H -E -fno-color-diagnostics -Xclang -Eonly")
+			endif()
+		elseif (WIN32)
+			# Clang-cl.exe options used
+			# /TC treat all files named on the command line as C source files
+			# /TP treat all files named on the command line as C++ source files
+			# /EP preprocess to stdout without #line directives
+			# -H print the name of each header file used
+			# -fno-color-diagnostics do not print diagnostics in color
+			# -Eonly just run preprocessor, no output
+			set (_sourceFileTypeC "/TC")
+			set (_sourceFileTypeCXX "/TP")
+			if (_flags)
+				# append to list
+				list (APPEND _flags "${_sourceFileType${_language}}" /EP -fno-color-diagnostics -Xclang -H -Xclang -Eonly)
+			else()
+				# return as a flag string
+				set (_flags "${_sourceFileType${_language}} /EP -fno-color-diagnostics -Xclang -H -Xclang -Eonly")
+			endif()
 		endif()
 	elseif (_compilerID MATCHES "Intel")
 		if (WIN32)
@@ -1628,8 +1648,8 @@
 				set (_flags "${_flags} /Zm${COTIRE_PCH_MEMORY_SCALING_FACTOR}")
 			endif()
 		endif()
-	elseif (_compilerID MATCHES "GNU|Clang")
-		# GCC / Clang options used
+	elseif (_compilerID MATCHES "GNU")
+		# GCC options used
 		# -x specify the source language
 		# -c compile but do not link
 		# -o place output in file
@@ -1639,10 +1659,51 @@
 		set (_xLanguage_CXX "c++-header")
 		if (_flags)
 			# append to list
-			list (APPEND _flags "-x" "${_xLanguage_${_language}}" "-c" "${_prefixFile}" -o "${_pchFile}")
+			list (APPEND _flags -x "${_xLanguage_${_language}}" -c "${_prefixFile}" -o "${_pchFile}")
 		else()
 			# return as a flag string
 			set (_flags "-x ${_xLanguage_${_language}} -c \"${_prefixFile}\" -o \"${_pchFile}\"")
+		endif()
+	elseif (_compilerID MATCHES "Clang")
+		if (UNIX)
+			# Clang options used
+			# -x specify the source language
+			# -c compile but do not link
+			# -o place output in file
+			# -fno-pch-timestamp disable inclusion of timestamp in precompiled headers (clang 4.0.0+)
+			set (_xLanguage_C "c-header")
+			set (_xLanguage_CXX "c++-header")
+			if (_flags)
+				# append to list
+				list (APPEND _flags -x "${_xLanguage_${_language}}" -c "${_prefixFile}" -o "${_pchFile}")
+				if (NOT "${_compilerVersion}" VERSION_LESS "4.0.0")
+					list (APPEND _flags -Xclang -fno-pch-timestamp)
+				endif()
+			else()
+				# return as a flag string
+				set (_flags "-x ${_xLanguage_${_language}} -c \"${_prefixFile}\" -o \"${_pchFile}\"")
+				if (NOT "${_compilerVersion}" VERSION_LESS "4.0.0")
+					set (_flags "${_flags} -Xclang -fno-pch-timestamp")
+				endif()
+			endif()
+		elseif (WIN32)
+			# Clang-cl.exe options used
+			# /Yc creates a precompiled header file
+			# /Fp specifies precompiled header binary file name
+			# /FI forces inclusion of file
+			# /Zs syntax check only
+			# /TC treat all files named on the command line as C source files
+			# /TP treat all files named on the command line as C++ source files
+			set (_sourceFileTypeC "/TC")
+			set (_sourceFileTypeCXX "/TP")
+			if (_flags)
+				# append to list
+				list (APPEND _flags "${_sourceFileType${_language}}"
+						"/Yc${_prefixFile}" "/Fp${_pchFile}" "/FI${_prefixFile}" /Zs "${_hostFile}")
+			else()
+				# return as a flag string
+				set (_flags "/Yc\"${_prefixFile}\" /Fp\"${_pchFile}\" /FI\"${_prefixFile}\"")
+			endif()
 		endif()
 	elseif (_compilerID MATCHES "Intel")
 		if (WIN32)
@@ -1763,17 +1824,40 @@
 			set (_flags "-Winvalid-pch -include \"${_prefixFile}\"")
 		endif()
 	elseif (_compilerID MATCHES "Clang")
-		# Clang options used
-		# -include process include file as the first line of the primary source file
-		# -include-pch include precompiled header file
-		# -Qunused-arguments don't emit warning for unused driver arguments
-		# note: ccache requires the -include flag to be used in order to process precompiled header correctly
-		if (_flags)
-			# append to list
-			list (APPEND _flags "-Qunused-arguments" "-include" "${_prefixFile}")
-		else()
-			# return as a flag string
-			set (_flags "-Qunused-arguments -include \"${_prefixFile}\"")
+		if (UNIX)
+			# Clang options used
+			# -include process include file as the first line of the primary source file
+			# note: ccache requires the -include flag to be used in order to process precompiled header correctly
+			if (_flags)
+				# append to list
+				list (APPEND -include "${_prefixFile}")
+			else()
+				# return as a flag string
+				set (_flags "-include \"${_prefixFile}\"")
+			endif()
+		elseif (WIN32)
+			# Clang-cl.exe options used
+			# /Yu uses a precompiled header file during build
+			# /Fp specifies precompiled header binary file name
+			# /FI forces inclusion of file
+			if (_pchFile)
+				if (_flags)
+					# append to list
+					list (APPEND _flags "/Yu${_prefixFile}" "/Fp${_pchFile}" "/FI${_prefixFile}")
+				else()
+					# return as a flag string
+					set (_flags "/Yu\"${_prefixFile}\" /Fp\"${_pchFile}\" /FI\"${_prefixFile}\"")
+				endif()
+			else()
+				# no precompiled header, force inclusion of prefix header
+				if (_flags)
+					# append to list
+					list (APPEND _flags "/FI${_prefixFile}")
+				else()
+					# return as a flag string
+					set (_flags "/FI\"${_prefixFile}\"")
+				endif()
+			endif()
 		endif()
 	elseif (_compilerID MATCHES "Intel")
 		if (WIN32)
@@ -1883,7 +1967,7 @@
 	if (MSVC_IDE OR _option_COMPILER_ID MATCHES "MSVC")
 		# cl.exe messes with the output streams unless the environment variable VS_UNICODE_OUTPUT is cleared
 		unset (ENV{VS_UNICODE_OUTPUT})
-	elseif (_option_COMPILER_ID MATCHES "GNU|Clang")
+	elseif (_option_COMPILER_ID MATCHES "Clang" AND _option_COMPILER_VERSION VERSION_LESS "4.0.0")
 		if (_option_COMPILER_LAUNCHER MATCHES "ccache" OR
 			_option_COMPILER_EXECUTABLE MATCHES "ccache")
 			# Newer versions of Clang embed a compilation timestamp into the precompiled header binary,
@@ -1916,8 +2000,16 @@
 			set (${_msgVar} "" PARENT_SCOPE)
 		endif()
 	elseif (CMAKE_${_language}_COMPILER_ID MATCHES "Clang")
-		# all Clang versions have PCH support
-		set (${_msgVar} "" PARENT_SCOPE)
+		if (UNIX)
+			# all Unix Clang versions have PCH support
+			set (${_msgVar} "" PARENT_SCOPE)
+		elseif (WIN32)
+			# only clang-cl is supported under Windows
+			get_filename_component(_compilerName "${CMAKE_${_language}_COMPILER}" NAME_WE)
+			if (NOT _compilerName MATCHES "cl$")
+				set (${_msgVar} "${_unsupportedCompiler} version ${CMAKE_${_language}_COMPILER_VERSION}. Use clang-cl instead." PARENT_SCOPE)
+			endif()
+		endif()
 	elseif (CMAKE_${_language}_COMPILER_ID MATCHES "Intel")
 		# Intel PCH support requires version >= 8.0.0
 		if ("${CMAKE_${_language}_COMPILER_VERSION}" VERSION_LESS "8.0.0")
@@ -2283,8 +2375,9 @@

 function (cotire_setup_pch_file_compilation _language _target _targetScript _prefixFile _pchFile _hostFile)
 	set (_sourceFiles ${ARGN})
-	if (CMAKE_${_language}_COMPILER_ID MATCHES "MSVC|Intel")
-		# for Visual Studio and Intel, we attach the precompiled header compilation to the host file
+	if (CMAKE_${_language}_COMPILER_ID MATCHES "MSVC|Intel" OR
+		(WIN32 AND CMAKE_${_language}_COMPILER_ID MATCHES "Clang"))
+		# for MSVC, Intel and Clang-cl, we attach the precompiled header compilation to the host file
 		# the remaining files include the precompiled header, see cotire_setup_pch_file_inclusion
 		if (_sourceFiles)
 			set (_flags "")
@@ -2329,8 +2422,9 @@
 endfunction()

 function (cotire_setup_pch_file_inclusion _language _target _wholeTarget _prefixFile _pchFile _hostFile)
-	if (CMAKE_${_language}_COMPILER_ID MATCHES "MSVC|Intel")
-		# for Visual Studio and Intel, we include the precompiled header in all but the host file
+	if (CMAKE_${_language}_COMPILER_ID MATCHES "MSVC|Intel" OR
+		(WIN32 AND CMAKE_${_language}_COMPILER_ID MATCHES "Clang"))
+		# for MSVC, Intel and clang-cl, we include the precompiled header in all but the host file
 		# the host file does the precompiled header compilation, see cotire_setup_pch_file_compilation
 		set (_sourceFiles ${ARGN})
 		list (LENGTH _sourceFiles _numberOfSourceFiles)
@@ -2476,9 +2570,10 @@
 		# if this is a single-language target without any excluded files
 		if (_wholeTarget)
 			set (_language "${_languages}")
-			# for Visual Studio and Intel, precompiled header inclusion is always done on the source file level
+			# for MSVC, Intel and clang-cl, precompiled header inclusion is always done on the source file level
 			# see cotire_setup_pch_file_inclusion
-			if (NOT CMAKE_${_language}_COMPILER_ID MATCHES "MSVC|Intel")
+			if (NOT CMAKE_${_language}_COMPILER_ID MATCHES "MSVC|Intel" AND NOT
+				(WIN32 AND CMAKE_${_language}_COMPILER_ID MATCHES "Clang"))
 				get_property(_prefixFile TARGET ${_target} PROPERTY COTIRE_${_language}_PREFIX_HEADER)
 				if (_prefixFile)
 					get_property(_pchFile TARGET ${_target} PROPERTY COTIRE_${_language}_PRECOMPILED_HEADER)
@@ -2949,8 +3044,9 @@
 		set (_dependsFiles "")
 		foreach (_language ${_languages})
 			set (_props COTIRE_${_language}_PREFIX_HEADER COTIRE_${_language}_UNITY_SOURCE)
-			if (NOT CMAKE_${_language}_COMPILER_ID MATCHES "MSVC|Intel")
-				# Visual Studio and Intel only create precompiled header as a side effect
+			if (NOT CMAKE_${_language}_COMPILER_ID MATCHES "MSVC|Intel" AND NOT
+				(WIN32 AND CMAKE_${_language}_COMPILER_ID MATCHES "Clang"))
+				# MSVC, Intel and clang-cl only create precompiled header as a side effect
 				list (INSERT _props 0 COTIRE_${_language}_PRECOMPILED_HEADER)
 			endif()
 			cotire_get_first_set_property_value(_dependsFile TARGET ${_target} ${_props})


Add NOCAPTURE option to ament_add_pytest_test (#393)

This lets the user pass the '-s' option to pytest so we can see all test process output in the console.

Signed-off-by: Jacob Perron <f862f167b85d41b225785c70d70808bc7337c1fe@openrobotics.org>

--- ament_cmake_pytest/cmake/ament_add_pytest_test.cmake
+++ ament_cmake_pytest/cmake/ament_add_pytest_test.cmake
@@ -20,6 +20,9 @@
 # :param path: the path to a file or folder where ``pytest`` should be invoked
 #   on
 # :type path: string
+# :param NOCAPTURE: disable pytest output capturing.
+#   Sets the pytest option '-s'.
+# :type NOCAPTURE: option
 # :param SKIP_TEST: if set mark the test as being skipped
 # :type SKIP_TEST: option
 # :param PYTHON_EXECUTABLE: Python executable used to run the test.
@@ -48,7 +51,7 @@
 #
 function(ament_add_pytest_test testname path)
   cmake_parse_arguments(ARG
-    "SKIP_TEST"
+    "NOCAPTURE;SKIP_TEST"
     "PYTHON_EXECUTABLE;RUNNER;TIMEOUT;WERROR;WORKING_DIRECTORY"
     "APPEND_ENV;APPEND_LIBRARY_DIRS;ENV"
     ${ARGN})
@@ -95,6 +98,11 @@
     "--junit-xml=${result_file}"
     "--junit-prefix=${PROJECT_NAME}"
   )
+
+  if(ARG_NOCAPTURE)
+    # disable output capturing
+    list(APPEND cmd "-s")
+  endif()

   if(ARG_WERROR)
     # treat warnings as errors


r9323/sofa : UPDATE: [CMake build] extlibs/LML and extlibs/PML are built only if OPTION_PML is enabled. extlibs/qwt is built only if a Qt GUI option is on

Former-commit-id: 27dcfc218e0cc0ba8a812706e62adaa06008e2e9

--- sofa-dependencies.cmake
+++ sofa-dependencies.cmake
@@ -3,8 +3,6 @@
 # extlibs
 add_subdirectory("${SOFA_EXTLIBS_DIR}/ARTrack")
 add_subdirectory("${SOFA_EXTLIBS_DIR}/newmat")
-add_subdirectory("${SOFA_EXTLIBS_DIR}/LML")
-add_subdirectory("${SOFA_EXTLIBS_DIR}/PML")
 add_subdirectory("${SOFA_EXTLIBS_DIR}/tinyxml")
 if(EXTERNAL_HAVE_CSPARSE)
 	add_subdirectory("${SOFA_EXTLIBS_DIR}/csparse")
@@ -18,7 +16,6 @@
 if(GUI_USE_QGLVIEWER)
 	add_subdirectory("${SOFA_EXTLIBS_DIR}/libQGLViewer-2.3.3/QGLViewer")
 endif()
-add_subdirectory("${SOFA_EXTLIBS_DIR}/qwt-6.0.1/src")

 ## google test
 if(UNIT-TESTS_BUILD_GTEST)
@@ -34,6 +31,8 @@
 add_subdirectory("${SOFA_MODULES_DIR}/sofa/simulation")
 add_subdirectory("${SOFA_MODULES_DIR}/sofa/component")
 if(OPTION_PML)
+    add_subdirectory("${SOFA_EXTLIBS_DIR}/LML")
+    add_subdirectory("${SOFA_EXTLIBS_DIR}/PML")
     add_subdirectory("${SOFA_MODULES_DIR}/sofa/filemanager/sofapml")
 endif()
 if(OPTION_GPU_OPENCL)
@@ -58,6 +57,7 @@
 add_subdirectory("${SOFA_APPLICATIONS_DIR}/projects/sofaBatch")          #may need to add RC_FILE
 if(GUI_USE_QTVIEWER OR GUI_USE_QGLVIEWER OR GUI_USE_QTOGREVIEWER)	#GUI_USE_QTOGREVIEWER not defined yet... relicate of qmake script
 	#add_subdirectory("${SOFA_APPLICATIONS_DIR}/projects/sofaConfiguration") "# not yet converted" commenbt in the qmake scripts...
+    add_subdirectory("${SOFA_EXTLIBS_DIR}/qwt-6.0.1/src")
 	add_subdirectory("${SOFA_APPLICATIONS_DIR}/projects/Modeler/lib")
 	add_subdirectory("${SOFA_APPLICATIONS_DIR}/projects/Modeler/exec")
 endif()
@@ -70,7 +70,7 @@
     add_subdirectory("${SOFA_APPLICATIONS_DIR}/projects/sofaOPENCL")         #may need to add RC_FILE
 endif()
 #add_subdirectory("${SOFA_APPLICATIONS_DIR}/projects/SofaPhysicsAPI")    #Not sure how to have it add only when ! SOFA_NO_OPENGL
-add_subdirectory("${SOFA_APPLICATIONS_DIR}/projects/sofaProjectExample")
+#add_subdirectory("${SOFA_APPLICATIONS_DIR}/projects/sofaProjectExample")
 add_subdirectory("${SOFA_APPLICATIONS_DIR}/projects/sofaVerification")
 #add_subdirectory("${SOFA_APPLICATIONS_DIR}/projects/xmlconvert-displayflags")  #not actually declared in sofa-dependencies.prf
 if(UNIT-TESTS_USE)


Find GLEW

Find GLEW


Remove PHP_VERSION_MAJOR/MINOR from REQUIRED_VARS

The version variables may be `0', which is evaluated by CMake as
missing.

--- src/cmake/FindPHP.cmake
+++ src/cmake/FindPHP.cmake
@@ -135,8 +135,6 @@
     PHP_EXTENSIONS_INCLUDE_DIR
     PHP_INCLUDE_DIRS
     PHP_VERSION_STRING
-    PHP_VERSION_MAJOR
-    PHP_VERSION_MINOR
   VERSION_VAR PHP_VERSION_STRING
   HANDLE_COMPONENTS
 )


Use master branch of lutefisk3d since it was merged wit qui_branch

--- 3rd_party/ExternalProject_Lutefisk3D.cmake
+++ 3rd_party/ExternalProject_Lutefisk3D.cmake
@@ -3,7 +3,6 @@
    l3d_BUILD
    GIT_REPOSITORY https://github.com/Lutefisk3D/lutefisk3d
    GIT_SHALLOW 1
-   GIT_TAG qui_switchover
    UPDATE_COMMAND ""
    INSTALL_DIR ${ThirdParty_Install_Dir}
    CMAKE_ARGS -DQt5_DIR:PATH=${Qt5_DIR} -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} -DCMAKE_STAGING_PREFIX:PATH=${ThirdParty_Install_Dir} -DCMAKE_INSTALL_PREFIX:PATH=${ThirdParty_Install_Dir}


-bump version target

-bump version target

--- src/bindings/java/compile-native-files.cmake
+++ src/bindings/java/compile-native-files.cmake
@@ -55,8 +55,8 @@
 # compile files
 execute_process(
 	COMMAND "${Java_JAVAC_EXECUTABLE}"
-		 -source 1.5
-		 -target 1.5
+		 -source 1.6
+		 -target 1.6
 		 -d java-files
 		 ${NATIVE_FILES}
 	WORKING_DIRECTORY "${BIN_DIRECTORY}"


Updated build paths on windows

Updated build paths on windows

--- CMakeModules/KrisLibraryDependencies.cmake
+++ CMakeModules/KrisLibraryDependencies.cmake
@@ -17,7 +17,7 @@
 SET(KRISLIBRARY_DEFINITIONS "")

 #First check CMAKE_COMPILER -
-#MESSAGE(${CMAKE_CXX_COMPILER})
+MESSAGE(STATUS "Using compiler ${CMAKE_CXX_COMPILER}")

 if(CMAKE_VERSION VERSION_LESS "3.1.0")
   MESSAGE("Old version of CMAKE - can't check compiler")


fix bug: add CUDA include directory

fix bug: add CUDA include directory

--- cmake/Dependencies.cmake
+++ cmake/Dependencies.cmake
@@ -23,6 +23,7 @@
   find_package(CUDA QUIET)
   if (CUDA_FOUND)
     set(CUDA_NVCC_FLAGS "-gencode arch=compute_30,code=\"compute_30,sm_30\"")
+    include_directories(SYSTEM ${CUDA_TOOLKIT_INCLUDE})
     list(APPEND Shadow_LINKER_LIBS ${CUDA_CUDART_LIBRARY} ${CUDA_cublas_LIBRARY})
     add_definitions(-DUSE_CUDA)
   else ()
@@ -31,7 +32,7 @@
 elseif (${USE_CL} STREQUAL "ON")
   find_package(OpenCL QUIET)
   if (OpenCL_FOUND)
-    include_directories("external/EasyCL/dist/include/easycl")
+    include_directories(SYSTEM "external/EasyCL/dist/include/easycl")
     include_directories(SYSTEM ${OpenCL_INCLUDE_DIRS})
     list(APPEND Shadow_LINKER_LIBS ${OpenCL_LIBRARIES} clew EasyCL clBLAS)
     add_definitions(-DUSE_CL)


Fixed issue with linking with python on windows using the limited api

--- cmake/ModulePython.cmake
+++ cmake/ModulePython.cmake
@@ -50,7 +50,9 @@
     set(CMAKE_SWIG_OUTDIR ${PROJECT_BINARY_DIR}/python/fast/)
     file(MAKE_DIRECTORY ${CMAKE_SWIG_OUTDIR})
     swig_add_library(fast LANGUAGE python SOURCES ${PYFAST_FILE})
-    swig_link_libraries(fast ${PYTHON_LIBRARIES} FAST)
+    get_filename_component(PYTHON_LIBRARY_DIR ${PYTHON_LIBRARIES} DIRECTORY)
+    target_link_directories(_fast PRIVATE ${PYTHON_LIBRARY_DIR})
+    swig_link_libraries(fast python3 FAST)
     set_property(TARGET _fast PROPERTY SWIG_COMPILE_OPTIONS -py3 -doxygen -py3-stable-abi) # Enable Python 3 specific features and doxygen comment translation in SWIG
     set_target_properties(_fast PROPERTIES INSTALL_RPATH "$ORIGIN/../lib")
     target_include_directories(_fast PRIVATE ${PYTHON_NUMPY_INCLUDE_DIR})


Whitespace: fix unreadably-long lines

Whitespace: fix unreadably-long lines

--- cmake/OpenCogGuile.cmake
+++ cmake/OpenCogGuile.cmake
@@ -31,29 +31,33 @@

 SET(GUILE_BIN_DIR "${CMAKE_BINARY_DIR}/opencog/scm")

-# ----------------------------------------------------------------------------
-# This configures the install and binary paths for each file, passed to it,
-# based on the value of the variables MODULE_NAME, MODULE_FILE_DIR_PATH and
-# MODULE_DIR_PATH in the PARENT_SCOPE.
+# -------------------------------------------------------------------
+# This configures the install and binary paths for each file,
+# passed to it, based on the value of the variables MODULE_NAME,
+# MODULE_FILE_DIR_PATH and MODULE_DIR_PATH in the PARENT_SCOPE.
 FUNCTION(PROCESS_MODULE_STRUCTURE FILE_NAME DIR_PATH)
-    # Copy files into build directory mirroring the install path structure,
-    # and also set the install path.
+    # Copy files into build directory mirroring the install path
+    # structure, and also set the install path.
     IF ("${MODULE_NAME}.scm" STREQUAL "${FILE_NAME}")
         EXECUTE_PROCESS(
-            COMMAND ${CMAKE_COMMAND} -E make_directory ${GUILE_BIN_DIR}/${MODULE_FILE_DIR_PATH}
+            COMMAND ${CMAKE_COMMAND} -E make_directory
+                 ${GUILE_BIN_DIR}/${MODULE_FILE_DIR_PATH}
         )
         ADD_CUSTOM_COMMAND(TARGET ${TARGET_NAME} PRE_BUILD
-            COMMAND ${CMAKE_COMMAND} -E copy "${DIR_PATH}/${FILE_NAME}" "${GUILE_BIN_DIR}/${MODULE_FILE_DIR_PATH}/${FILE_NAME}"
+            COMMAND ${CMAKE_COMMAND} -E copy "${DIR_PATH}/${FILE_NAME}"
+                 "${GUILE_BIN_DIR}/${MODULE_FILE_DIR_PATH}/${FILE_NAME}"
         )
         SET(FILE_INSTALL_PATH "${GUILE_SITE_DIR}/${MODULE_FILE_DIR_PATH}"
             PARENT_SCOPE
         )
     ELSE()
         EXECUTE_PROCESS(
-            COMMAND ${CMAKE_COMMAND} -E make_directory ${GUILE_BIN_DIR}/${MODULE_DIR_PATH}
+            COMMAND ${CMAKE_COMMAND} -E make_directory
+                   ${GUILE_BIN_DIR}/${MODULE_DIR_PATH}
         )
         ADD_CUSTOM_COMMAND(TARGET ${TARGET_NAME} PRE_BUILD
-            COMMAND ${CMAKE_COMMAND} -E copy "${DIR_PATH}/${FILE_NAME}" "${GUILE_BIN_DIR}/${MODULE_DIR_PATH}/${FILE_NAME}"
+            COMMAND ${CMAKE_COMMAND} -E copy "${DIR_PATH}/${FILE_NAME}"
+                   "${GUILE_BIN_DIR}/${MODULE_DIR_PATH}/${FILE_NAME}"
         )
         SET(FILE_INSTALL_PATH "${GUILE_SITE_DIR}/${MODULE_DIR_PATH}"
             PARENT_SCOPE
@@ -61,25 +65,30 @@
     ENDIF()
 ENDFUNCTION(PROCESS_MODULE_STRUCTURE)

-# ----------------------------------------------------------------------------
+# ---------------------------------------------------------------------
 # When building, all files specifed are are copied to
-# '${CMAKE_BINARY_DIR}/opencog/scm' following the file tree structure created
-# when installing to /usr/local/share/opencog/scm. It has three keyword arguments
+# '${CMAKE_BINARY_DIR}/opencog/scm' following the file tree structure
+# created when installing to /usr/local/share/opencog/scm.
+# XXX FIXME: the above install path is no longer used!! !?!?!?!?
+#
+# It has three keyword arguments
 #
 # FILES: List of files to be installed/copied
 #
 # MODULE_DESTINATION: The absolute path where the files associated
 #   with the module are installed, with the exception of the
 #   MODULE_FILE(see definition at top of this file). The path for
-#   MODULE_FILE, is inferred from this argument, even if it is the only file to
-#   be installed.
-#
-# DEPENDS: The name of a target that generates a scheme file that is to be
-# installed. This is an optional argument only required for generated files.
+#   MODULE_FILE, is inferred from this argument, even if it is the
+#   only file to be installed.
+#
+# DEPENDS: The name of a target that generates a scheme file that is
+# to be installed. This is an optional argument only required for
+# generated files.
 FUNCTION(ADD_GUILE_MODULE)
-  # Define the target that will be used to copy scheme files in the current
-  # source directory to the build directory. This is done so as to be able to
-  # run scheme unit-tests without having to run 'make install'.
+  # Define the target that will be used to copy scheme files in the
+  # current source directory to the build directory. This is done so
+  # as to be able to run scheme unit-tests without having to run
+  # 'make install'.
   STRING(REPLACE "/" "_" _TARGET_NAME_SUFFIX ${CMAKE_CURRENT_SOURCE_DIR})
   SET(TARGET_NAME "COPY_TO_LOAD_PATH_IN_BUILD_DIR_FROM_${_TARGET_NAME_SUFFIX}")
   IF (NOT (TARGET ${TARGET_NAME}))
@@ -99,7 +108,8 @@
         # FILE_PATH is used for variable name because files in
         # sub-directories may be passed.
         FOREACH(FILE_PATH ${SCM_FILES})
-            GET_PROPERTY(FILE_GENERATED SOURCE ${FILE_PATH} PROPERTY GENERATED SET)
+            GET_PROPERTY(FILE_GENERATED SOURCE ${FILE_PATH}
+                PROPERTY GENERATED SET)
             GET_FILENAME_COMPONENT(DIR_PATH ${FILE_PATH} DIRECTORY)
             GET_FILENAME_COMPONENT(FILE_NAME ${FILE_PATH} NAME)

@@ -127,22 +137,24 @@
                 "^(${PREFIX_DIR_PATH})([_a-z0-9/-]+)*/([_a-z0-9-]+)" ""
                 ${SCM_MODULE_DESTINATION})

-            # MODULE_NAME: it is equal to the MODULE_DESTINATION directory name
-            # MODULE_FILE_DIR_PATH: the directory path where the MODULE_FILE is
-            #   installed.
-            # MODULE_DIR_PATH: the directory path where the files associated
-            #   with the module are installed at and copied to, with the exception
-            #   of the MODULE_FILE.
+            # MODULE_NAME: it is equal to the MODULE_DESTINATION
+            #              directory name
+            # MODULE_FILE_DIR_PATH: the directory path where the
+            #              MODULE_FILE is installed.
+            # MODULE_DIR_PATH: the directory path where the files
+            #              associated with the module are installed
+            #              at and copied to, with the exception
+            #              of the MODULE_FILE.
             SET(MODULE_NAME ${CMAKE_MATCH_3})
             SET(MODULE_FILE_DIR_PATH ${CMAKE_MATCH_2})
             SET(MODULE_DIR_PATH ${CMAKE_MATCH_2}/${CMAKE_MATCH_3})
             PROCESS_MODULE_STRUCTURE(${FILE_NAME} ${FULL_DIR_PATH})

             # NOTE: The install configuration isn't part of
-            # PROCESS_MODULE_STRUCTURE function so as to avoid "Command
-            # INSTALL() is not scriptable" error, when using it in copying
-            # scheme files during code-generation by the OPENCOG_ADD_ATOM_TYPES
-            # macro.
+            # PROCESS_MODULE_STRUCTURE function so as to avoid
+            # "Command INSTALL() is not scriptable" error, when using
+            # it in copying scheme files during code-generation by
+            # the OPENCOG_ADD_ATOM_TYPES macro.
             INSTALL (FILES
                 ${FILE_PATH}
                 DESTINATION ${FILE_INSTALL_PATH}
@@ -176,42 +188,49 @@
                       --use-srfi=64 ${FILE_PATH}
             WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
         IF (GUILE_LOAD_PATH)
-            SET_PROPERTY(TEST ${TEST_NAME} PROPERTY ENVIRONMENT "GUILE_LOAD_PATH=${GUILE_LOAD_PATH}")
+            SET_PROPERTY(TEST ${TEST_NAME} PROPERTY
+                ENVIRONMENT "GUILE_LOAD_PATH=${GUILE_LOAD_PATH}")
         ENDIF(GUILE_LOAD_PATH)
     ENDIF()
 ENDFUNCTION(ADD_GUILE_TEST)

 # ----------------------------------------------------------------------------
-# Declare a new dummy target representing path configuration for Guile extensions.
-# This must be called, before calling ADD_GUILE_EXTENSION and WRITE_GUILE_CONFIG.
+# Declare a new dummy target representing path configuration for Guile
+# extensions.  This must be called, before calling ADD_GUILE_EXTENSION
+# and WRITE_GUILE_CONFIG.
 #
 # CONFIG_TARGET: The new target name
 #
-# MODULE_NAME: A space separated string representing the full guile module.
-# e.g. "opencog as-config". This is passed to (define-module ...) and is used
-# for importing extension paths.
-#
-# TEST_ENV_VAR: An environment variable name. This env var will be checked at run time,
-# and if true, it will force the process to exit if the config is loaded from the system
-# path. This is to ensure that when testing a local build, the system path is not
-# inadvertently taking precendence.
+# MODULE_NAME: A space separated string representing the full guile
+# module, e.g. "opencog as-config". This is passed to (define-module ...)
+# and is used for importing extension paths.
+#
+# TEST_ENV_VAR: An environment variable name. This env var will be
+# checked at run time, and if true, it will force the process to exit
+# if the config is loaded from the system path. This is to ensure that
+# when testing a local build, the system path is not inadvertently
+# taking precedence.
 #
 FUNCTION(DECLARE_GUILE_CONFIG_TARGET CONFIG_TARGET MODULE_NAME TEST_ENV_VAR)
     ADD_CUSTOM_TARGET(${CONFIG_TARGET} ALL)
-    SET_TARGET_PROPERTIES(${CONFIG_TARGET} PROPERTIES MODULE_NAME "${MODULE_NAME}")
-    SET_TARGET_PROPERTIES(${CONFIG_TARGET} PROPERTIES TEST_ENV_VAR "${TEST_ENV_VAR}")
+    SET_TARGET_PROPERTIES(${CONFIG_TARGET}
+        PROPERTIES MODULE_NAME "${MODULE_NAME}")
+    SET_TARGET_PROPERTIES(${CONFIG_TARGET}
+        PROPERTIES TEST_ENV_VAR "${TEST_ENV_VAR}")
 ENDFUNCTION(DECLARE_GUILE_CONFIG_TARGET)

 # ----------------------------------------------------------------------------
 # Link a compiled guile extension to the config target
 #
 # CONFIG_TARGET: The target previously declared with DECLARE_GUILE_CONFIG
-#
-# EXTENSION_TARGET: A shared library target that can be loaded as a guile extension.
-#
-# SYMBOL_NAME: The guile symbol to use to define the path to the extension library.
-# In the build directory, this will point to the exact path. When installed this will
-# point to OpenCog's shared library install dir.
+#
+# EXTENSION_TARGET: A shared library target that can be loaded as a
+# guile extension.
+#
+# SYMBOL_NAME: The guile symbol to use to define the path to the
+# extension library.  In the build directory, this will point to the
+# exact path. When installed this will point to OpenCog's shared library
+# install dir.
 #
 FUNCTION(ADD_GUILE_EXTENSION CONFIG_TARGET EXTENSION_TARGET SYMBOL_NAME)
     GET_TARGET_PROPERTY(EXT_LIB_PATH ${EXTENSION_TARGET} BINARY_DIR)
@@ -225,14 +244,15 @@
 ENDFUNCTION(ADD_GUILE_EXTENSION)

 # ----------------------------------------------------------------------------
-# Write out a config module, based on all extensions linked to the config target.
+# Write out a config module, based on all extensions linked to the config
+# target.
 #
 # OUTPUT_FILE: Where to write the file
 #
 # CONFIG_TARGET: The target previously declared with DECLARE_GUILE_CONFIG
 #
-# SCM_IN_BUILD_DIR: Whether to generate a config file for the build dir or for
-# installing to a system dir.
+# SCM_IN_BUILD_DIR: Whether to generate a config file for the build dir
+# or for installing to a system dir.
 #
 FUNCTION(WRITE_GUILE_CONFIG OUTPUT_FILE CONFIG_TARGET SCM_IN_BUILD_DIR)
     set(SCM_BUILD_PATHS "")
@@ -244,14 +264,14 @@
         string(REPLACE "|" ";" SYMBOL_AND_PATH ${PATH_PAIR})
         list(GET SYMBOL_AND_PATH 0 SYMBOL)
         list(GET SYMBOL_AND_PATH 1 LIBPATH)
-
+
         set(SCM_PATHS "${SCM_PATHS}(define-public ${SYMBOL} \"${LIBPATH}/\")")
         if(WIN32)
             set(SCM_PATHS "${SCM_PATHS}\r\n")
         else()
             set(SCM_PATHS "${SCM_PATHS}\n")
         endif()
-
+
         set(INSTALL_PATHS "${INSTALL_PATHS}        (set! ${SYMBOL} install-location)")
         if(WIN32)
             set(INSTALL_PATHS "${INSTALL_PATHS}\r\n")
@@ -282,14 +302,14 @@
             (if (eq? is-testing \"1\")
                 (exit)
             ))
-
+
         ; When installed, all the modules have the same path
 ${INSTALL_PATHS}
-
+
     )
 )
 ")
-
+
     FILE(WRITE "${OUTPUT_FILE}" "${CONFIG_SRC}")
-
-ENDFUNCTION(WRITE_GUILE_CONFIG)+
+ENDFUNCTION(WRITE_GUILE_CONFIG)


[Examples] make test : fix build-dir option

--- Numerics/cmake/CMakeListsForExamples.cmake
+++ Numerics/cmake/CMakeListsForExamples.cmake
@@ -3,9 +3,9 @@
 SET(CROSSCOMPILING_LINUX_TO_WINDOWS @CROSSCOMPILING_LINUX_TO_WINDOWS@)

 IF (CMAKE_TOOLCHAIN_FILE)
-  SET(CMAKE_SICONOS_COMPILE_OBJECT "${SiconosKernel_EXE_DIR}/siconos --noexec <SOURCE> --build_dir build -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}")
+  SET(CMAKE_SICONOS_COMPILE_OBJECT "${SiconosKernel_EXE_DIR}/siconos --noexec <SOURCE> --build-dir build -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}")
 ELSE(CMAKE_TOOLCHAIN_FILE)
-  SET(CMAKE_SICONOS_COMPILE_OBJECT "${SiconosKernel_EXE_DIR}/siconos --noexec <SOURCE> --build_dir build")
+  SET(CMAKE_SICONOS_COMPILE_OBJECT "${SiconosKernel_EXE_DIR}/siconos --noexec <SOURCE> --build-dir build")
 ENDIF(CMAKE_TOOLCHAIN_FILE)
 SET(CMAKE_SICONOS_LINK_EXECUTABLE "")


Fix googletest build on other cmake build types

When compiling with gtest the library was not installed to a
subdirectory for the RelWithDebInfo or MinSizeRel build types.  This
makes those install to the same location as Release.

--- common/build_gtest.cmake
+++ common/build_gtest.cmake
@@ -43,6 +43,8 @@
     CMAKE_ARGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
                -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG:PATH=DebugLibs
                -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE:PATH=ReleaseLibs
+               -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELWITHDEBINFO:PATH=ReleaseLibs
+               -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY_MINSIZEREL:PATH=ReleaseLibs
                -Dgtest_force_shared_crt=ON
                -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
                -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS}


Removed myself from copyright notice to avoid lint_cmake error

--- rosidl_generator_java/cmake/rosidl_generator_java_get_typesupports.cmake
+++ rosidl_generator_java/cmake/rosidl_generator_java_get_typesupports.cmake
@@ -1,5 +1,4 @@
 # Copyright 2016 Open Source Robotics Foundation, Inc.
-# Copyright 2016 Esteve Fernandez <esteve@apache.org>
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.


[GLES2] Improve PowerVR SDK discovery on Windows and add support for the paths in the 3.0 sdk.

--HG--
branch : v1-9

--- CMake/Packages/FindOpenGLES2.cmake
+++ CMake/Packages/FindOpenGLES2.cmake
@@ -30,27 +30,27 @@
     IF(BORLAND)
       SET (OPENGLES2_gl_LIBRARY import32 CACHE STRING "OpenGL ES 2.x library for win32")
     ELSE(BORLAND)
-		#MS compiler - todo - fix the following line:
-		SET (OPENGLES2_gl_LIBRARY ${OGRE_DEPENDENCIES_DIR}/lib/release/libGLESv2.lib CACHE STRING "OpenGL ES 2.x library for win32")
-		SET (EGL_egl_LIBRARY      ${OGRE_DEPENDENCIES_DIR}/lib/release/libEGL.lib CACHE STRING "EGL library for win32")
-
-		SET(POWERVR_SDK_PATH "C:/Imagination Technologies/PowerVR Insider SDK/OGLES2_WINDOWS_X86EMULATION_2.10/Builds/OGLES2")
+		SET(POWERVR_SDK_PATH "C:/Imagination/PowerVR/GraphicsSDK/SDK_3.0/Builds/OGLES2")
 		FIND_PATH(OPENGLES2_INCLUDE_DIR GLES2/gl2.h
 			${POWERVR_SDK_PATH}/Include
-		)
-
+            "C:/Imagination Technologies/PowerVR Insider SDK/OGLES2_WINDOWS_X86EMULATION_2.10/Builds/OGLES2/Include"
+		)
+
 	    FIND_PATH(EGL_INCLUDE_DIR EGL/egl.h
-			${POWERVR_SDK_PATH}/Include
+			${POWERVR_SDK_PATH}/Include
+            "C:/Imagination Technologies/PowerVR Insider SDK/OGLES2_WINDOWS_X86EMULATION_2.10/Builds/OGLES2/Include"
 		)
-
+
 		FIND_LIBRARY(OPENGLES2_gl_LIBRARY
-			NAMES GLESv2
-			PATHS ${POWERVR_SDK_PATH}/WindowsX86/Lib
+			NAMES libGLESv2
+			PATHS ${POWERVR_SDK_PATH}/Windows_x86_32/Lib
+            "C:/Imagination Technologies/PowerVR Insider SDK/OGLES2_WINDOWS_X86EMULATION_2.10/Builds/OGLES2/WindowsX86/Lib"
 		)
-
+
 		FIND_LIBRARY(EGL_egl_LIBRARY
-			NAMES EGL
-			PATHS ${POWERVR_SDK_PATH}/WindowsX86/Lib
+			NAMES libEGL
+			PATHS ${POWERVR_SDK_PATH}/Windows_x86_32/Lib
+            "C:/Imagination Technologies/PowerVR Insider SDK/OGLES2_WINDOWS_X86EMULATION_2.10/Builds/OGLES2/WindowsX86/Lib"
 		)
     ENDIF(BORLAND)


Fix package dependencies in case of MITK_USE_QT = OFF.

--- CMake/mitkFunctionUseModules.cmake
+++ CMake/mitkFunctionUseModules.cmake
@@ -24,13 +24,18 @@
       set(${_package_name}_REQUIRED_COMPONENTS )
       # Special filter for exclusive OR Qt4 / Qt5 dependency
       if(_package_name STREQUAL "Qt4")
-        if(MITK_USE_Qt4)
+        if(MITK_USE_Qt4 OR NOT MITK_USE_Qt5)
+          # MITK_USE_Qt4 is ON or both MITK_USE_Qt4 and MITK_USE_Qt5
+          # are OFF. So list Qt4 as a dependency.
           list(APPEND package_names_normalized ${_package_name})
         elseif(MITK_USE_Qt5 AND _has_qt5_dep EQUAL -1)
-          list(APPEND package_names_normalized ${_package_name})
+            # List Qt4 as a dependency only if there is no Qt5 dependency
+            # so the module will not be build because of the missing
+            # MITK_USE_Qt4
+            list(APPEND package_names_normalized ${_package_name})
         endif()
       elseif(_package_name STREQUAL "Qt5")
-        if(MITK_USE_Qt5)
+        if(MITK_USE_Qt5 OR NOT MITK_USE_Qt4)
           list(APPEND package_names_normalized ${_package_name})
         elseif(MITK_USE_Qt4 AND _has_qt4_dep EQUAL -1)
           list(APPEND package_names_normalized ${_package_name})


BUG: adding quotes around string to ensure empty string is passed

Change-Id: I041fa613c1962d38150d3f51a283d16ed34992a4

--- CMake/sitkCheckRequiredFlags.cmake
+++ CMake/sitkCheckRequiredFlags.cmake
@@ -10,7 +10,7 @@
 # SimpleITK_REQUIRED_CXX_FLAGS variable.
 #

-string(REPLACE " " ";" cmake_cxx_flags_list ${CMAKE_CXX_FLAGS})
+string(REPLACE " " ";" cmake_cxx_flags_list "${CMAKE_CXX_FLAGS}")

 # list of regular expressions flags that are to be required flags for SimpleITK
 set(required_flags_regex_to_test


Set SimpleITK_MAX_DIMENSION to 5 by default

--- CMake/sitkMaxDimensionOption.cmake
+++ CMake/sitkMaxDimensionOption.cmake
@@ -4,7 +4,7 @@
 #

-set(SimpleITK_MAX_DIMENSION_DEFAULT 4)
+set(SimpleITK_MAX_DIMENSION_DEFAULT 5)
 # 1900 = VS 14.0 (Visual Studio 2015)
 if(MSVC AND MSVC_VERSION VERSION_LESS 1900)
   set( SimpleITK_MAX_DIMENSION_DEFAULT 3 )


Fix LTO message

Fix LTO message

--- cmake/LTO.cmake
+++ cmake/LTO.cmake
@@ -218,7 +218,7 @@
           # Optional IPO. Do not use IPO if it's not supported by compiler.
           check_ipo_supported(RESULT __IPO_SUPPORTED OUTPUT output)
           if(NOT __IPO_SUPPORTED)
-            message(status "IPO is not supported or broken.")
+            message(STATUS "IPO is not supported or broken.")
           else()
             message(STATUS "IPO is supported !")
           endif()


More refactoring, this time actually tested

--- HalideGenerator.cmake
+++ HalideGenerator.cmake
@@ -20,6 +20,24 @@
   endif()
 endfunction()

+function(halide_generator_add_exec_generator_target EXEC_TARGET)
+  set(options )
+  set(oneValueArgs GENERATOR_TARGET GENFILES_DIR)
+  set(multiValueArgs OUTPUTS GENERATOR_ARGS)
+  cmake_parse_arguments(args "" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
+
+  halide_generator_get_exec_path(${args_GENERATOR_TARGET} EXEC_PATH)
+
+  add_custom_command(
+    OUTPUT ${args_OUTPUTS}
+    DEPENDS ${args_GENERATOR_TARGET}
+    COMMAND ${EXEC_PATH} ${args_GENERATOR_ARGS}
+    WORKING_DIRECTORY ${args_GENFILES_DIR}
+  )
+
+  add_custom_target(${EXEC_TARGET} DEPENDS ${args_OUTPUTS})
+  set_target_properties(${EXEC_TARGET} PROPERTIES FOLDER "generator")
+endfunction()

 # This function adds custom build steps to invoke a Halide generator exectuable
 # and produce a static library containing the generated code.
@@ -79,26 +97,13 @@
   # GENERATOR_ARGS always come last
   list(APPEND GENERATOR_EXEC_ARGS ${args_GENERATOR_ARGS})

-  halide_generator_get_exec_path(${args_GENERATOR_TARGET} GENERATOR_EXEC_PATH)
-
-  # Add a custom target to invoke the GENERATOR_TARGET and output the Halide
-  # generated library.
-  add_custom_command(
-    OUTPUT "${GENFILES_DIR}/${FILTER_LIB}" "${GENFILES_DIR}/${FILTER_HDR}"
-    DEPENDS "${args_GENERATOR_TARGET}"
-    COMMAND "${GENERATOR_EXEC_PATH}" ${GENERATOR_EXEC_ARGS}
-    WORKING_DIRECTORY "${GENFILES_DIR}"
+  halide_generator_add_exec_generator_target(
+    "${AOT_LIBRARY_TARGET}.exec_generator"
+    GENERATOR_TARGET ${args_GENERATOR_TARGET}
+    GENERATOR_ARGS   "${GENERATOR_EXEC_ARGS}"
+    GENFILES_DIR     ${GENFILES_DIR}
+    OUTPUTS          "${GENFILES_DIR}/${FILTER_LIB}" "${GENFILES_DIR}/${FILTER_HDR}"
   )
-
-  # Use a custom target to force it to run the generator before the
-  # object file for the runner.
-  set(EXEC_GENERATOR_TARGET "${AOT_LIBRARY_TARGET}.exec_generator")
-  add_custom_target(${EXEC_GENERATOR_TARGET}
-                    DEPENDS "${GENFILES_DIR}/${FILTER_LIB}" "${GENFILES_DIR}/${FILTER_HDR}")
-
-  # Place the target in a special folder in IDEs
-  set_target_properties(${EXEC_GENERATOR_TARGET} PROPERTIES FOLDER "generator")
-
 endfunction(halide_add_aot_library)

 # Usage:
@@ -106,11 +111,9 @@
 function(halide_add_aot_library_dependency TARGET AOT_LIBRARY_TARGET)
     halide_generator_genfiles_dir(${AOT_LIBRARY_TARGET} GENFILES_DIR)

+    add_dependencies("${TARGET}" "${AOT_LIBRARY_TARGET}.exec_generator")
+
     set(FILTER_LIB "${AOT_LIBRARY_TARGET}${CMAKE_STATIC_LIBRARY_SUFFIX}")
-
-    set(EXEC_GENERATOR_TARGET "${AOT_LIBRARY_TARGET}.exec_generator")
-    add_dependencies("${TARGET}" "${EXEC_GENERATOR_TARGET}")
-
     target_link_libraries("${TARGET}" PRIVATE "${GENFILES_DIR}/${FILTER_LIB}")
     target_include_directories("${TARGET}" PRIVATE "${GENFILES_DIR}")

@@ -124,7 +127,6 @@
     else()
       target_link_libraries("${TARGET}" PRIVATE dl pthread z)
     endif()
-
 endfunction(halide_add_aot_library_dependency)

 function(halide_add_generator NAME)


Enable branch coverage reports generation

Change-Id: Ia2aef6b920659b315a03e9390fab54105ecc1714

--- CodeCoverage.cmake
+++ CodeCoverage.cmake
@@ -112,9 +112,9 @@
         COMMAND ${_testrunner} ${ARGV3}

         # Capturing lcov counters and generating report
-        COMMAND ${LCOV_PATH} --directory . --capture --output-file ${_outputname}.info
-        COMMAND ${LCOV_PATH} --remove ${_outputname}.info 'tests/*' '/usr/*' --output-file ${_outputname}.info.cleaned
-        COMMAND ${GENHTML_PATH} -o ${_outputname} ${_outputname}.info.cleaned
+        COMMAND ${LCOV_PATH} --rc lcov_branch_coverage=1 --directory . --capture --output-file ${_outputname}.info
+        COMMAND ${LCOV_PATH} --rc lcov_branch_coverage=1 --remove ${_outputname}.info 'tests/*' '/usr/*' --output-file ${_outputname}.info.cleaned
+        COMMAND ${GENHTML_PATH} --rc lcov_branch_coverage=1 -o ${_outputname} ${_outputname}.info.cleaned
         COMMAND ${CMAKE_COMMAND} -E remove ${_outputname}.info ${_outputname}.info.cleaned

         WORKING_DIRECTORY ${CMAKE_BINARY_DIR}


Fix variable errors in script to auto-fetch SML.

--- Dependencies.cmake
+++ Dependencies.cmake
@@ -5,14 +5,14 @@
 # Include script to build external library with CMake.
 include(ExternalProject)

-if(NOT FORCE_DEPENDENCIES_BUILD)
+if(NOT BUILD_DEPENDENCIES)
   find_package(SML)
-endif(NOT FORCE_DEPENDENCIES_BUILD)
+endif(NOT BUILD_DEPENDENCIES)

 if(NOT SML_FOUND)
   message(STATUS "SML will be downloaded when ${CMAKE_PROJECT_NAME} is built")
   ExternalProject_Add(sml-lib
-    PREFIX ${MYEXT_PATH}/SML
+    PREFIX ${EXTERNAL_PATH}/SML
     #--Download step--------------
     URL https://github.com/kartikkumar/sml/archive/master.zip
     TIMEOUT 30


PROTON-1374: update the .so version to 11 on master for 0.17.0

--- proton-c/soversion.cmake
+++ proton-c/soversion.cmake
@@ -1,2 +1,2 @@
-set (PN_LIB_SOMAJOR 10)
+set (PN_LIB_SOMAJOR 11)
 set (PN_LIB_SOMINOR "0.0")


PROTON-1323: update the .so major version to 10 for 0.16.0 on master

--- proton-c/soversion.cmake
+++ proton-c/soversion.cmake
@@ -1,2 +1,2 @@
-set (PN_LIB_SOMAJOR 9)
+set (PN_LIB_SOMAJOR 10)
 set (PN_LIB_SOMINOR "0.0")


Add STM32_CHIP to the cache if it's specified.

Fixes re-cmakes later on.

--- cmake/gcc_stm32.cmake
+++ cmake/gcc_stm32.cmake
@@ -2,6 +2,9 @@
 SET(CMAKE_MODULE_PATH ${STM32_CMAKE_DIR} ${CMAKE_MODULE_PATH})

 SET(STM32_SUPPORTED_FAMILIES L0 F0 F1 F2 F3 F4 F7 CACHE INTERNAL "stm32 supported families")
+IF(STM32_CHIP)
+	 SET(STM32_CHIP "${STM32_CHIP}" CACHE STRING "STM32 chip to build for")
+ENDIF()

 IF(NOT TOOLCHAIN_PREFIX)
      SET(TOOLCHAIN_PREFIX "/usr")


ENH: Tcl/Tk 8.5

ENH: Tcl/Tk 8.5

--- CMake/FindTCL.cmake
+++ CMake/FindTCL.cmake
@@ -134,6 +134,7 @@
   "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.3;Root]/include"
   "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.2;Root]/include"
   "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.0;Root]/include"
+  ${TCL_FRAMEWORK_INCLUDES}
   "$ENV{ProgramFiles}/Tcl/include"
   "C:/Program Files/Tcl/include"
   "C:/Tcl/include"
@@ -148,11 +149,17 @@
 )

 FIND_PATH(TCL_INCLUDE_PATH tcl.h
-  ${TCL_FRAMEWORK_INCLUDES} ${TCLTK_POSSIBLE_INCLUDE_PATHS}
+  ${TCLTK_POSSIBLE_INCLUDE_PATHS} NO_DEFAULT_PATH
+)
+FIND_PATH(TCL_INCLUDE_PATH tcl.h
+  ${TCLTK_POSSIBLE_INCLUDE_PATHS}
 )

 FIND_PATH(TK_INCLUDE_PATH tk.h
-  ${TK_FRAMEWORK_INCLUDES} ${TCLTK_POSSIBLE_INCLUDE_PATHS}
+  ${TCLTK_POSSIBLE_INCLUDE_PATHS} NO_DEFAULT_PATH
+)
+FIND_PATH(TK_INCLUDE_PATH tk.h
+  ${TCLTK_POSSIBLE_INCLUDE_PATHS}
 )

 MARK_AS_ADVANCED(


Fix build error when disabling RTTI when compiling with VS2017 (#178)

--- CMake/utility.cmake
+++ CMake/utility.cmake
@@ -416,9 +416,9 @@
           CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO)
     if(${flag_var} MATCHES ${_OLD_OPTION})
       # the whitespace after_OLD_OPTION is necessary to really match only the flag and not some sub flag (/MD should match by /MDd)
-      string(REGEX REPLACE "${_OLD_OPTION} " "${_NEW_OPTION}" ${flag_var} "${${flag_var}}")
-    else()
-      set(${flag_var} "${${flag_var}} ${_NEW_OPTION}")
+      string(REGEX REPLACE "${_OLD_OPTION} " "${_NEW_OPTION} " ${flag_var} "${${flag_var}}")
+    else()
+      set(${flag_var} "${${flag_var}} ${_NEW_OPTION} ")
     endif()
    set(${flag_var} ${${flag_var}} PARENT_SCOPE)
   endforeach()
@@ -449,7 +449,7 @@
     replace_compiler_option("${disable_rtti_opt}" "${enable_rtti_opt}")
   else()
     message(STATUS "Disabled: use of RTTI")
-    replace_compiler_option(${enable_rtti_opt} ${disable_rtti_opt})
+    replace_compiler_option("${enable_rtti_opt}" "${disable_rtti_opt}")
   endif()
 endmacro()


updates vigra plugin to use more up-to-date configuration file

--- vigra.cmake
+++ vigra.cmake
@@ -31,7 +31,7 @@
 include (nose)

 # select the desired VIGRA commit
-set(DEFAULT_VIGRA_VERSION "fb83cf8a595a36285980bd563c90e5d666bce388") # from 2014-06-23
+set(DEFAULT_VIGRA_VERSION "f090543e1b5db148d40156667a888a10f24fed61") # from 2014-08-04
 IF(NOT DEFINED VIGRA_VERSION)
     SET(VIGRA_VERSION "${DEFAULT_VIGRA_VERSION}")
 ENDIF()


Specify the Python 2 interpreter directly for the Macs.

--- build/cmake/CondorConfigure.cmake
+++ build/cmake/CondorConfigure.cmake
@@ -100,7 +100,10 @@
         # This will be easier in cmake 3

         if(DARWIN)
-            find_program(PYTHON_EXECUTABLE python2.7)
+            # This is a glorious hack, but it's the right thing to do
+            # for our machines.  [FIXME: TimT, should we pass this in as
+            # a command-line argument to CMake in BaTLab?]
+        	set(PYTHON_EXECUTABLE /usr/bin/python)
         else()
             find_program(PYTHON_EXECUTABLE python2)
         endif()


HTCONDOR-1337 Add -Wconversion to CFLAGS, but comment out

Because it generates way too much noise now.

--- build/cmake/CondorConfigure.cmake
+++ build/cmake/CondorConfigure.cmake
@@ -1082,6 +1082,14 @@
 		set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall")
 	endif(c_Wall)

+	# This generates a million warnings, some of which represent
+	# serious bugs.  At your leisure, uncomment and fix some
+	# of them.
+	#check_c_compiler_flag(-Wconversion c_Wconversion)
+	#if (c_Wconversion)
+	#	set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wconversion")
+	#endif(c_Wconversion)
+
 	# GGT tested compiling  condor_history with -flto, it ran less than one tenth of one percent faster
     # and took more than 3 times longer to compile.  Try again later.


In which our hero worked on the makefile


Move to MKLDNN v0.13

Move to MKLDNN v0.13


[CMake] Refactor add_llvm_tool_symlink for reuse

The old implementation of add_llvm_tool_symlink could fail in odd ways when building out of tree. This version solves that problem by not using the LLVM_* variables, and instead reaeding the target's properties.

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


cmake: Add support for Address Sanitizer

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

--- cmake/Modules/AddCMockaTest.cmake
+++ cmake/Modules/AddCMockaTest.cmake
@@ -10,10 +10,17 @@
 include(CTest)

 if(CMAKE_COMPILER_IS_GNUCC AND NOT MINGW)
+    # Profiling
     set(CMAKE_C_FLAGS_PROFILING "-g -O0 -Wall -W -Wshadow -Wunused-variable -Wunused-parameter -Wunused-function -Wunused -Wno-system-headers -Wwrite-strings -fprofile-arcs -ftest-coverage" CACHE STRING "Profiling Compiler Flags")
     set(CMAKE_SHARED_LINKER_FLAGS_PROFILING " -fprofile-arcs -ftest-coverage" CACHE STRING "Profiling Linker Flags")
     set(CMAKE_MODULE_LINKER_FLAGS_PROFILING " -fprofile-arcs -ftest-coverage" CACHE STRING "Profiling Linker Flags")
     set(CMAKE_EXEC_LINKER_FLAGS_PROFILING " -fprofile-arcs -ftest-coverage" CACHE STRING "Profiling Linker Flags")
+
+    # Address Sanitizer
+    set(CMAKE_C_FLAGS_ADDRESSSANITIZER "-g -O1 -fsanitize=address -fno-omit-frame-pointer" CACHE STRING "Address sanitizer compiler flags")
+    set(CMAKE_SHARED_LINKER_FLAGS_ADDRESSSANITIZER "-fsanitize=address" CACHE STRING "Address sanitizer shared linker flags")
+    set(CMAKE_MODULE_LINKER_FLAGS_ADDRESSSANITIZER "-fsanitize=address" CACHE STRING "Address sanitizer module linker flags")
+    set(CMAKE_EXEC_LINKER_FLAGS_ADDRESSSANITIZER "-fsanitize=address" CACHE STRING "Address sanitizer executable linker flags")
 endif(CMAKE_COMPILER_IS_GNUCC AND NOT MINGW)

 function (ADD_CMOCKA_TEST _testName _testSource)


Remove a VS 2012 workaround, we require 2015 now.

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

--- cmake/Modules/AddCompilerRT.cmake
+++ cmake/Modules/AddCompilerRT.cmake
@@ -269,12 +269,6 @@

   # gtest use a lot of stuff marked as deprecated on Windows.
   list(APPEND COMPILER_RT_GTEST_CFLAGS -Wno-deprecated-declarations)
-
-  # Visual Studio 2012 only supports up to 8 template parameters in
-  # std::tr1::tuple by default, but gtest requires 10
-  if(MSVC_VERSION EQUAL 1700)
-    list(APPEND COMPILER_RT_GTEST_CFLAGS -D_VARIADIC_MAX=10)
-  endif()
 endif()

 # Link objects into a single executable with COMPILER_RT_TEST_COMPILER,


Build libcvmfs.a and libcvmfs_cache.a by default on macOS, too

--- cmake/Modules/cvmfs_options.cmake
+++ cmake/Modules/cvmfs_options.cmake
@@ -4,16 +4,14 @@

 option (BUILD_CVMFS             "Build the CernVM-FS FUSE module"                                  ON)
 if (MACOSX)
-  option (BUILD_LIBCVMFS        "Build the CernVM-FS client library"                               OFF)
-  option (BUILD_LIBCVMFS_CACHE  "Build the cache plugin library"                                   OFF)
   option (BUILD_SERVER          "Build writer's end programs"                                      OFF)
   option (BUILD_RECEIVER        "Build the receiver program used with the gateway services"        OFF)
 else (MACOSX)
-  option (BUILD_LIBCVMFS        "Build the CernVM-FS client library"                               ON)
-  option (BUILD_LIBCVMFS_CACHE  "Build the cache plugin library"                                   ON)
   option (BUILD_SERVER          "Build writer's end programs"                                      ON)
   option (BUILD_RECEIVER        "Build the receiver program used with the gateway services"        ON)
 endif(MACOSX)
+option (BUILD_LIBCVMFS          "Build the CernVM-FS client library"                               ON)
+option (BUILD_LIBCVMFS_CACHE    "Build the cache plugin library"                                   ON)
 option (BUILD_PRELOADER         "Build the alien cache pre-loader"                                 OFF)
 option (BUILD_OCTOPUS           "Build the octopus REST server"                                    OFF)
 option (BUILD_SERVER_DEBUG      "Build writer's end programs with debug symbols and debug outputs" OFF)


Added platform specification macro

Added platform specification macro

--- cmake/PSPLArtPipelineMacros.cmake
+++ cmake/PSPLArtPipelineMacros.cmake
@@ -1,4 +1,18 @@
 cmake_minimum_required(VERSION 2.8)
+
+
+# Platform List
+set(PSPL_TARGET_PLATFORMS "" CACHE INTERNAL "" FORCE)
+
+# Specify which platform(s) should be targeted
+macro(set_pspl_platforms)
+  unset(plats)
+  foreach(plat ${ARGN})
+    list(APPEND plats -T${plat})
+  endforeach(plat)
+  set(PSPL_TARGET_PLATFORMS ${plats} CACHE INTERNAL "" FORCE)
+endmacro(set_pspl_platforms)
+

 # Target list
 set(PSPL_PACKAGE_TARGETS "" CACHE INTERNAL "" FORCE)
@@ -27,7 +41,7 @@
           include(${CMAKE_CURRENT_BINARY_DIR}/${base}.psplg)
         endif()
         add_custom_command(OUTPUT ${base}.psplc COMMAND ${PSPL_BINARY_LOC} ARGS
-                           -c -o ${base}.psplc -G ${base}.psplg -S ${CMAKE_BINARY_DIR} ${path}
+                           -c -o ${base}.psplc -G ${base}.psplg -S ${CMAKE_BINARY_DIR} ${PSPL_TARGET_PLATFORMS} ${path}
                            DEPENDS ${PSPL_REFLIST})
         list(APPEND objects ${base}.psplc)
       else()
@@ -37,7 +51,7 @@

     # Package rule
     add_custom_command(OUTPUT ${target_name}.psplp COMMAND ${PSPL_BINARY_LOC} ARGS
-                       -o ${target_name}.psplp -S ${CMAKE_BINARY_DIR} ${objects}
+                       -o ${target_name}.psplp -S ${CMAKE_BINARY_DIR} ${PSPL_TARGET_PLATFORMS} ${objects}
                        DEPENDS ${objects})
     add_custom_target(${target_name} ALL DEPENDS ${target_name}.psplp)


[CMake][Fuchsia] Drop -DNDEBUG, re-enable modules

-DNDEBUG is no longer needed now that we don't enable assertions,
modules should improve build times for the second stage.

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

git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@351709 91177308-0d34-0410-b5e6-96231b3b80d8

--- cmake/caches/Fuchsia-stage2.cmake
+++ cmake/caches/Fuchsia-stage2.cmake
@@ -9,6 +9,7 @@
   set(LLVM_ENABLE_LLD ON CACHE BOOL "")
 endif()
 set(LLVM_ENABLE_LTO ON CACHE BOOL "")
+set(LLVM_ENABLE_MODULES ON CACHE BOOL "")
 set(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR ON CACHE BOOL "")
 set(LLVM_ENABLE_TERMINFO OFF CACHE BOOL "")
 set(LLVM_ENABLE_ZLIB ON CACHE BOOL "")
@@ -28,8 +29,8 @@
 set(ENABLE_X86_RELAX_RELOCATIONS ON CACHE BOOL "")

 set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "")
-set(CMAKE_C_FLAGS_RELWITHDEBINFO "-O3 -gline-tables-only -DNDEBUG" CACHE STRING "")
-set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O3 -gline-tables-only -DNDEBUG" CACHE STRING "")
+set(CMAKE_C_FLAGS_RELWITHDEBINFO "-O3 -gline-tables-only" CACHE STRING "")
+set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O3 -gline-tables-only" CACHE STRING "")

 if(APPLE)
   list(APPEND BUILTIN_TARGETS "default")


[cmake][NFC] Fix case in include

[cmake][NFC] Fix case in include

CMake does not care, but humans and search tools sometimes do.

--- cmake/modules/CheckCompiler.cmake
+++ cmake/modules/CheckCompiler.cmake
@@ -200,7 +200,7 @@
 elseif(APPLE)
   include(SetUpMacOS)
 elseif(WIN32)
-  include(SetupWindows)
+  include(SetUpWindows)
 endif()

 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_THREAD_FLAG}")


Fix for Windows CMake/nmake (ROOT-5560)

Fix for Windows CMake/nmake (ROOT-5560)

--- cmake/modules/RootNewMacros.cmake
+++ cmake/modules/RootNewMacros.cmake
@@ -288,7 +288,7 @@
           string (REPLACE ${CMAKE_CURRENT_SOURCE_DIR} "" src2 ${src1})
           string (REPLACE ${CMAKE_CURRENT_BINARY_DIR} "" src3 ${src2})
           string (REPLACE ".." "__" src ${src3})
-          get_filename_component(name ${src} NAME_WE)
+          get_filename_component(name ${src} NAME)
           get_filename_component(path ${src} PATH)
           set(lib_objs ${lib_objs} ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${library}.dir/${path}/${name}.obj)
         endif()


remove comments

remove comments

--- utils.cmake
+++ utils.cmake
@@ -135,16 +135,7 @@
 	COMMONS_FLAGS()
 	ADD_EXECUTABLE(${TESTNAME} ${TESTNAME}.cpp)
 	target_link_libraries(${TESTNAME} ${TESTDEPENDS})
-
-	# if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
-	# 	ADD_TEST(NAME ${TESTNAME}
-	# 		COMMAND ${CMAKE_SOURCE_DIR}/cmaki/run_test.sh ${TESTNAME}
-	# 				WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
-	# else()
-		ADD_TEST(NAME ${TESTNAME}
-			COMMAND ${TESTNAME}
-					WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
-	# endif()
+	ADD_TEST(NAME ${TESTNAME} COMMAND ${TESTNAME} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
 endmacro()

 macro(GET_SYSTEM_INFO)


do not force a boost thread version

do not force a boost thread version

fixes #99

--- CMake/Dependencies.cmake
+++ CMake/Dependencies.cmake
@@ -270,11 +270,6 @@
     find_package(Boost COMPONENTS ${OGRE_BOOST_COMPONENTS} QUIET)
 endif()

-if(Boost_VERSION GREATER 105200)
-	# Use boost threading version 4 for boost 1.53 and above
-	add_definitions( -DBOOST_THREAD_VERSION=4 )
-endif()
-
 if(Boost_FOUND AND NOT WIN32)
   list(REMOVE_DUPLICATES Boost_LIBRARIES)
 endif()


add docker-compose file to miscFiles

add docker-compose file to miscFiles

* add .git* to cover .git, .gitattributes, .gitmodules, and .gitignore
* also move .codereview files into single utility project
* .devcontainer files also part of single utility project
* issue https://github.com/smanders/externpro/issues/294

--- modules/xpfunmac.cmake
+++ modules/xpfunmac.cmake
@@ -1034,9 +1034,10 @@
     endforeach()
   endif()
   file(GLOB miscFiles LIST_DIRECTORIES false
-    ${_dir}/.git ${_dir}/.gitattributes ${_dir}/.gitmodules
+    ${_dir}/.git*
     ${_dir}/*clang-format
     ${_dir}/.crtoolrc
+    ${_dir}/docker-compose.*
     ${_dir}/README.md
     ${_dir}/version.cmake
     )
@@ -1045,17 +1046,17 @@
     file(RELATIVE_PATH relPath ${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
     string(REPLACE "/" "" custTgt .CMake${relPath})
     if(NOT TARGET ${custTgt})
-      add_custom_target(${custTgt} SOURCES ${miscFiles}) # creates utility project in MSVC
-      set_property(TARGET ${custTgt} PROPERTY FOLDER ${folder})
-    endif()
-  endif()
-  if(EXISTS ${_dir}/.codereview)
-    file(RELATIVE_PATH relPath ${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
-    string(REPLACE "/" "" custTgt .codereview${relPath})
-    if(NOT TARGET ${custTgt})
-      file(GLOB crFiles "${_dir}/.codereview/*")
-      list(APPEND masterSrcList ${crFiles})
-      add_custom_target(${custTgt} SOURCES ${crFiles}) # creates utility project in MSVC
+      if(EXISTS ${_dir}/.codereview)
+        file(GLOB crFiles "${_dir}/.codereview/*")
+        source_group(".codereview" FILES ${crFiles})
+        list(APPEND masterSrcList ${crFiles})
+      endif()
+      if(EXISTS ${_dir}/.devcontainer)
+        file(GLOB dcFiles "${_dir}/.devcontainer/*")
+        source_group(".devcontainer" FILES ${dcFiles})
+        list(APPEND masterSrcList ${dcFiles})
+      endif()
+      add_custom_target(${custTgt} SOURCES ${miscFiles} ${crFiles} ${dcFiles})
       set_property(TARGET ${custTgt} PROPERTY FOLDER ${folder})
     endif()
   endif()


Fix linux configure problem

Fix linux configure problem

Properly set the QT_INSTALL_LIB_DIR to point to MSVTK install lib dir.

--- CMake/msvInstallQt.cmake
+++ CMake/msvInstallQt.cmake
@@ -1,7 +1,7 @@
 # -------------------------------------------------------------------------
 # Find and install Qt
 # -------------------------------------------------------------------------
-set(QT_INSTALL_LIB_DIR ${Slicer_INSTALL_LIB_DIR})
+set(QT_INSTALL_LIB_DIR ${MSVTK_INSTALL_LIB_DIR})

 set(QTLIBLIST QTCORE QTGUI QTNETWORK QTXML QTTEST QTSCRIPT QTSQL QTSVG QTOPENGL QTWEBKIT PHONON QTXMLPATTERNS)
 if(UNIX OR APPLE)


BUG: use copy if different for writting input files to cmake, or cmake will go into an infinite loop

--- CMake/vtkExportKit.cmake
+++ CMake/vtkExportKit.cmake
@@ -18,7 +18,7 @@
   STRING(ASCII 35 POUND)
   STRING(ASCII 36 DOLLAR)
   STRING(ASCII 64 AT)
-  WRITE_FILE(${CMAKE_CURRENT_BINARY_DIR}/vtk${kit}Kit.cmake.in
+  WRITE_FILE(${CMAKE_CURRENT_BINARY_DIR}/vtk${kit}Kit.cmake.in.tmp
     "${POUND} Directory containing class headers.\n"
     "SET(VTK_${ukit}_HEADER_DIR \"${AT}VTK_${ukit}_HEADER_DIR${AT}\")\n"
     "\n"
@@ -42,6 +42,10 @@
     "  SET(VTK_CLASS_WRAP_EXCLUDE_${DOLLAR}{class} 1)\n"
     "ENDFOREACH(class)\n"
     )
+  EXEC_PROGRAM(${CMAKE_COMMAND} ARGS -E copy_if_different
+    ${CMAKE_CURRENT_BINARY_DIR}/vtk${kit}Kit.cmake.in.tmp
+    ${CMAKE_CURRENT_BINARY_DIR}/vtk${kit}Kit.cmake.in OUTPUT_VARIABLE OUT)
+
   SET(VTK_${ukit}_HEADER_DIR ${CMAKE_INSTALL_PREFIX}/include/vtk)
   CONFIGURE_FILE(${CMAKE_CURRENT_BINARY_DIR}/vtk${kit}Kit.cmake.in
                  ${VTK_BINARY_DIR}/Utilities/InstallOnly/vtk${kit}Kit.cmake


Turn off some warnings-as-errors
Update ITK 4.13 to latest snapshot

Summary: Fix gcc 10 build

Test Plan: CI, current setup and future Fedora 32 client

Reviewers: O1 MITK Reviewer Group I, kislinsk

Reviewed By: O1 MITK Reviewer Group I, kislinsk

Subscribers: kislinsk

Differential Revision: https://phabricator.mitk.org/D304

--- CMakeExternals/ITK.cmake
+++ CMakeExternals/ITK.cmake
@@ -52,9 +52,9 @@
   ExternalProject_Add(${proj}
      LIST_SEPARATOR ${sep}
      UPDATE_COMMAND ""
-     # ITK 4.13.2 + GCC9 patch
-     URL ${MITK_THIRDPARTY_DOWNLOAD_PREFIX_URL}/ITK_a092294.tar.gz
-     URL_MD5 5e3f39105917d992d5079be473994bc6
+     # ITK 4.13 release branch snapshot
+     URL https://github.com/InsightSoftwareConsortium/ITK/archive/e53d1d94.tar.gz
+     URL_MD5 977f77cb299cf3d722d13dd5408bcde5
      CMAKE_GENERATOR ${gen}
      CMAKE_GENERATOR_PLATFORM ${gen_platform}
      CMAKE_ARGS


Specify CMAKE_INSTALL_NAME_DIR for macOS

Suggested by Ben Boeckel in ParaView issue #18597 to resolve the rpath
bundle fix up issues seen during packaging for Tomviz.

Signed-off-by: Marcus D. Hanwell <cf7042e2e8eee958b5bcde1ae2cbefef82efc184@kitware.com>

--- projects/paraview.cmake
+++ projects/paraview.cmake
@@ -69,9 +69,10 @@

     ${paraview_extra_cmake_args}

-    # specify the apple app install prefix. No harm in specifying it for all
-    # platforms.
+    # Specify the apple app install prefix. No harm in specifying it for all
+    # platforms but will only affect macOS, same with install name dir.
     -DMACOSX_APP_INSTALL_PREFIX:PATH=<INSTALL_DIR>/Applications
+    -DCMAKE_INSTALL_NAME_DIR=<INSTALL_DIR>/lib

   LIST_SEPARATOR +
 )


Fix paraview plugin name so it is correctly disabled

--- projects/paraview.cmake
+++ projects/paraview.cmake
@@ -40,7 +40,7 @@
     -DPARAVIEW_BUILD_PLUGIN_AdiosReader:BOOL=FALSE
     -DPARAVIEW_BUILD_PLUGIN_AnalyzeNIfTIIO:BOOL=FALSE
     -DPARAVIEW_BUILD_PLUGIN_ArrowGlyph:BOOL=FALSE
-    -DPARAVIEW_BUILD_PLUGIN_CatalystScriptGenerator:BOOL=FALSE
+    -DPARAVIEW_BUILD_PLUGIN_CatalystScriptGeneratorPlugin:BOOL=FALSE
     -DPARAVIEW_BUILD_PLUGIN_EyeDomeLighting:BOOL=FALSE
     -DPARAVIEW_BUILD_PLUGIN_ForceTime:BOOL=FALSE
     -DPARAVIEW_BUILD_PLUGIN_GMVReader:BOOL=FALSE


vigra.cmake: Use master vigra git repo, and use today's sha-1 as the tag to download.

--- vigra.cmake
+++ vigra.cmake
@@ -21,8 +21,9 @@
 include (numpy)

 external_git_repo (vigra
-    flyem-1.9.0.b
-    http://github.com/janelia-flyem/vigra)
+	#fd5d9bf7a5197a79dfe83cf6d241dd1233c9a47d
+    fd5d9bf7
+    http://github.com/ukoethe/vigra)

 message ("Installing ${vigra_NAME} into FlyEM build area: ${BUILDEM_DIR} ...")
 ExternalProject_Add(${vigra_NAME}
@@ -30,6 +31,7 @@
                         ${hdf5_NAME} ${python_NAME} ${boost_NAME} ${numpy_NAME}
     PREFIX              ${BUILDEM_DIR}
     GIT_REPOSITORY      ${vigra_URL}
+    GIT_TAG             ${vigra_TAG}
     #URL                 ${vigra_URL}
     #URL_MD5             ${vigra_MD5}
     UPDATE_COMMAND      ""


forwarding headers: use symlinks where available, and real forwarding headers as a fallback

--- PurpleForwardHeaders.cmake
+++ PurpleForwardHeaders.cmake
@@ -1,50 +1,62 @@
 ##
-# Copyright (c) 2010 Daniel Pfeifer, All rights reserved.
+# Copyright (c) 2010-2010 Daniel Pfeifer, All rights reserved.
 #
 # This file is freely distributable without licensing fees and
 # is provided without guarantee or warrantee expressed or implied.
 # This file is -not- in the public domain.
 ##

+# On Windows, symlinks are available since Vista, but they require the
+# /Create Symbolic Link/ privilege, which only administrators have by default.
+if(CMAKE_HOST_WIN32 AND NOT DEFINED MKLINK_WORKING)
+  set(test_file ${CMAKE_CURRENT_BINARY_DIR}/symlinktest)
+  file(TO_NATIVE_PATH ${CMAKE_CURRENT_LIST_DIR} file)
+  file(TO_NATIVE_PATH ${test_file} target)
+  execute_process(COMMAND cmd /C mklink ${target} ${file})
+  if(EXISTS ${test_file})
+    set(MKLINK_WORKING TRUE CACHE INTERNAL "")
+  else(EXISTS ${test_file})
+    set(MKLINK_WORKING FALSE CACHE INTERNAL "")
+    message(STATUS "Symlinks are NOT supported.")
+  endif(EXISTS ${test_file})
+endif(CMAKE_HOST_WIN32 AND NOT DEFINED MKLINK_WORKING)
+
+# Make a header file available from another path.
+#
+#   purple_forward_file(<file> <target>)
+#
+# Where <file> is a path to an existing file that you want to include as if
+# it were located at <target>.
+#
+# This function creates symlinks where available. As a fallback it simply creates
+# a file at the target position that [c++] `#include`s the appropriate file.
+function(purple_forward_file file target)
+  if(EXISTS "${target}")
+    return()
+  endif()
+
+  get_filename_component(directory "${target}" PATH)
+  file(MAKE_DIRECTORY "${directory}")
+
+  if(NOT CMAKE_HOST_WIN32)
+    execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink "${file}" "${target}")
+  elseif(MKLINK_WORKING)
+    file(TO_NATIVE_PATH "${file}" file)
+    file(TO_NATIVE_PATH "${target}" target)
+    execute_process(COMMAND cmd /C mklink "${target}" "${file}")
+  else()
+    # create forwarding header
+    file(WRITE "${target}" "#include \"${file}\"\n")
+  endif()
+endfunction(purple_forward_file)
+
 # create forwarding headers
 function(PURPLE_FORWARD_HEADERS PREFIX)
   set(FWD_PREFIX "${CMAKE_BINARY_DIR}/include/${PREFIX}")
-  foreach(FILE ${ARGN})
-    get_filename_component(ABSOLUTE ${FILE} ABSOLUTE)
-    file(RELATIVE_PATH RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${ABSOLUTE})
-    set(FWDFILE "${FWD_PREFIX}${RELATIVE}")
-    if(NOT EXISTS ${FWDFILE})
-      get_filename_component(PATH ${RELATIVE} PATH)
-      get_filename_component(FWD_ABSOLUTE "${FWD_PREFIX}${PATH}" ABSOLUTE)
-      file(RELATIVE_PATH INCLUDE "${FWD_ABSOLUTE}" ${ABSOLUTE})
-      file(WRITE ${FWDFILE} "#include \"${INCLUDE}\"\n")
-    endif(NOT EXISTS ${FWDFILE})
-  endforeach(FILE ${ARGN})
-endfunction(PURPLE_FORWARD_HEADERS PREFIX)
-
-# create 'include all' header
-function(PURPLE_INCLUDE_ALL_HEADER FILE PREFIX)
-  set(ALL_FILE ${CMAKE_BINARY_DIR}/include/${FILE})
-
-  string(TOUPPER ${FILE} UPPER)
-  string(REGEX REPLACE "[./]" "_" INCLUDE_GUARD ${UPPER})
-
-  file(WRITE ${ALL_FILE}.in
-    "/* This file simply includes all \"${PREFIX}\" headers */\n\n"
-    "#ifndef ${INCLUDE_GUARD}\n"
-    "#define ${INCLUDE_GUARD}\n\n"
-    )
-
-  foreach(FILE ${ARGN})
-    if(FILE MATCHES "[.]hp*$")
-      file(APPEND ${ALL_FILE}.in "#include <${PREFIX}${FILE}>\n")
-    endif(FILE MATCHES "[.]hp*$")
-  endforeach(FILE ${ARGN})
-
-  file(APPEND ${ALL_FILE}.in "\n#endif /* ${INCLUDE_GUARD} */\n")
-
-  configure_file(${ALL_FILE}.in ${ALL_FILE} COPYONLY)
-  string(REGEX MATCH "(.*)[/\\]" DIR ${ALL_FILE})
-  string(REGEX MATCH "^[a-z]+" SHORT_NAME ${PREFIX})
-  install(FILES ${ALL_FILE} DESTINATION ${DIR} COMPONENT ${SHORT_NAME}dev)
-endfunction(PURPLE_INCLUDE_ALL_HEADER FILE PREFIX)
+  foreach(file ${ARGN})
+    get_filename_component(absolute "${file}" ABSOLUTE)
+    file(RELATIVE_PATH relative "${CMAKE_CURRENT_SOURCE_DIR}" "${absolute}")
+    set(fwdfile "${FWD_PREFIX}${relative}")
+    purple_forward_file("${absolute}" "${fwdfile}")
+  endforeach(file)
+endfunction(PURPLE_FORWARD_HEADERS)