[CMake] NFC. Updating documentation on options

The Ninja pool options are only supported with the Ninja generator and
should be called out as such.

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

--- cmake/modules/HandleLLVMOptions.cmake
+++ cmake/modules/HandleLLVMOptions.cmake
@@ -23,7 +23,7 @@
 # Ninja Job Pool support
 # The following only works with the Ninja generator in CMake >= 3.0.
 set(LLVM_PARALLEL_COMPILE_JOBS "" CACHE STRING
-  "Define the maximum number of concurrent compilation jobs.")
+  "Define the maximum number of concurrent compilation jobs (Ninja only).")
 if(LLVM_PARALLEL_COMPILE_JOBS)
   if(NOT CMAKE_MAKE_PROGRAM MATCHES "ninja")
     message(WARNING "Job pooling is only available with Ninja generators.")
@@ -34,7 +34,7 @@
 endif()

 set(LLVM_PARALLEL_LINK_JOBS "" CACHE STRING
-  "Define the maximum number of concurrent link jobs.")
+  "Define the maximum number of concurrent link jobs (Ninja only).")
 if(CMAKE_MAKE_PROGRAM MATCHES "ninja")
   if(NOT LLVM_PARALLEL_LINK_JOBS AND uppercase_LLVM_ENABLE_LTO STREQUAL "THIN")
     message(STATUS "ThinLTO provides its own parallel linking - limiting parallel link jobs to 2.")


Generate PDB files for profiling even in Release build.

This patch enables PDB generation for Release build, which has
slightly different optimize option with RelWithDebInfo on windows.

This helps to know slow part of Release build when profiling.

Patch by Takuto Ikuta
Differential Revision: https://reviews.llvm.org/D42632

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

--- cmake/modules/HandleLLVMOptions.cmake
+++ cmake/modules/HandleLLVMOptions.cmake
@@ -352,6 +352,12 @@
   endif (LLVM_ENABLE_WERROR)

   append("/Zc:inline" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
+
+  # Generate PDB even in release for profiling.
+  if (uppercase_CMAKE_BUILD_TYPE STREQUAL "RELEASE")
+    append("/Zi" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
+    append("/DEBUG" CMAKE_EXE_LINKER_FLAGS CMAKE_MODULE_LINKER_FLAGS CMAKE_SHARED_LINKER_FLAGS)
+  endif (uppercase_CMAKE_BUILD_TYPE STREQUAL "RELEASE")

   # /Zc:strictStrings is incompatible with VS12's (Visual Studio 2013's)
   # debug mode headers. Instead of only enabling them in VS2013's debug mode,


:lipstick: Just de-depthing an if statement

--- cmake/modules/hunter_initialize.cmake
+++ cmake/modules/hunter_initialize.cmake
@@ -46,57 +46,55 @@
     if(NOT _cache_init)
       hunter_internal_error("_gate_done AND NOT _cache_init")
     endif()
-  else()
-    if(_cache_init)
-      set(_flush FALSE)
+  elseif(_cache_init)
+    set(_flush FALSE)

-      string(COMPARE EQUAL "${HUNTER_CACHED_ROOT}" "${HUNTER_GATE_ROOT}" _is_ok)
-      if(NOT _is_ok)
-        hunter_status_debug("HUNTER_ROOT changed:")
-        hunter_status_debug("  ${HUNTER_CACHED_ROOT}")
-        hunter_status_debug("  ${HUNTER_GATE_ROOT}")
-        set(_flush TRUE)
-      endif()
+    string(COMPARE EQUAL "${HUNTER_CACHED_ROOT}" "${HUNTER_GATE_ROOT}" _is_ok)
+    if(NOT _is_ok)
+      hunter_status_debug("HUNTER_ROOT changed:")
+      hunter_status_debug("  ${HUNTER_CACHED_ROOT}")
+      hunter_status_debug("  ${HUNTER_GATE_ROOT}")
+      set(_flush TRUE)
+    endif()

-      string(COMPARE EQUAL "${HUNTER_VERSION}" "${HUNTER_GATE_VERSION}" _is_ok)
-      if(NOT _is_ok)
-        hunter_status_debug("HUNTER_VERSION changed:")
-        hunter_status_debug("  ${HUNTER_VERSION}")
-        hunter_status_debug("  ${HUNTER_GATE_VERSION}")
-        set(_flush TRUE)
-      endif()
+    string(COMPARE EQUAL "${HUNTER_VERSION}" "${HUNTER_GATE_VERSION}" _is_ok)
+    if(NOT _is_ok)
+      hunter_status_debug("HUNTER_VERSION changed:")
+      hunter_status_debug("  ${HUNTER_VERSION}")
+      hunter_status_debug("  ${HUNTER_GATE_VERSION}")
+      set(_flush TRUE)
+    endif()

-      string(COMPARE EQUAL "${HUNTER_SHA1}" "${HUNTER_GATE_SHA1}" _is_ok)
-      if(NOT _is_ok)
-        hunter_status_debug("HUNTER_SHA1 changed:")
-        hunter_status_debug("  ${HUNTER_SHA1}")
-        hunter_status_debug("  ${HUNTER_GATE_SHA1}")
-        set(_flush TRUE)
-      endif()
+    string(COMPARE EQUAL "${HUNTER_SHA1}" "${HUNTER_GATE_SHA1}" _is_ok)
+    if(NOT _is_ok)
+      hunter_status_debug("HUNTER_SHA1 changed:")
+      hunter_status_debug("  ${HUNTER_SHA1}")
+      hunter_status_debug("  ${HUNTER_GATE_SHA1}")
+      set(_flush TRUE)
+    endif()

-      if(_flush)
-        set(HUNTER_CACHED_ROOT "${HUNTER_GATE_ROOT}" CACHE INTERNAL "")
-        set(HUNTER_VERSION "${HUNTER_GATE_VERSION}" CACHE INTERNAL "")
-        set(HUNTER_SHA1 "${HUNTER_GATE_SHA1}" CACHE INTERNAL "")
-
-        hunter_calculate_self(
-            "${HUNTER_CACHED_ROOT}"
-            "${HUNTER_VERSION}"
-            "${HUNTER_SHA1}"
-            HUNTER_SELF
-        )
-
-        hunter_flush_cache_variables("${HUNTER_SELF}")
-
-        set(HUNTER_CONFIG_SHA1 "" CACHE INTERNAL "")
-        set(HUNTER_TOOLCHAIN_SHA1 "" CACHE INTERNAL "")
-        set(HUNTER_CACHED_CONFIGURATION_TYPES "" CACHE INTERNAL "")
-      endif()
-    else()
+    if(_flush)
       set(HUNTER_CACHED_ROOT "${HUNTER_GATE_ROOT}" CACHE INTERNAL "")
       set(HUNTER_VERSION "${HUNTER_GATE_VERSION}" CACHE INTERNAL "")
       set(HUNTER_SHA1 "${HUNTER_GATE_SHA1}" CACHE INTERNAL "")
+
+      hunter_calculate_self(
+          "${HUNTER_CACHED_ROOT}"
+          "${HUNTER_VERSION}"
+          "${HUNTER_SHA1}"
+          HUNTER_SELF
+      )
+
+      hunter_flush_cache_variables("${HUNTER_SELF}")
+
+      set(HUNTER_CONFIG_SHA1 "" CACHE INTERNAL "")
+      set(HUNTER_TOOLCHAIN_SHA1 "" CACHE INTERNAL "")
+      set(HUNTER_CACHED_CONFIGURATION_TYPES "" CACHE INTERNAL "")
     endif()
+  else()
+    set(HUNTER_CACHED_ROOT "${HUNTER_GATE_ROOT}" CACHE INTERNAL "")
+    set(HUNTER_VERSION "${HUNTER_GATE_VERSION}" CACHE INTERNAL "")
+    set(HUNTER_SHA1 "${HUNTER_GATE_SHA1}" CACHE INTERNAL "")
   endif()

   hunter_test_string_not_empty("${HUNTER_CACHED_ROOT}")


[t:4871] disable -Wshadow on osx

[t:4871] disable -Wshadow on osx

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

--- cmake_modules/TokuSetupCompiler.cmake
+++ cmake_modules/TokuSetupCompiler.cmake
@@ -127,8 +127,12 @@
     -Wmissing-declarations
     -Wpointer-arith
     -Wmissing-format-attribute
-    -Wshadow
     )
+  if (CMAKE_SYSTEM_NAME STREQUAL Darwin)
+    message(WARNING "Disabling -Wshadow on osx.  TODO: fix shadowed declarations and re-enable it.")
+  else ()
+    list(APPEND WARN_CFLAGS -Wshadow)
+  endif ()
 endif()

 set_cflags_if_supported(${WARN_CFLAGS})


fix CMake warning

fix CMake warning

--- components/ospcommon/cmake/ispc.cmake
+++ components/ospcommon/cmake/ispc.cmake
@@ -71,7 +71,7 @@
   MARK_AS_ADVANCED(ISPC_EXECUTABLE)
 ENDIF()

-SET(OSPRAY_ISPC_ADDRESSING 32 CACHE INT "32 vs 64 bit addressing in ispc")
+SET(OSPRAY_ISPC_ADDRESSING 32 CACHE STRING "32 vs 64 bit addressing in ispc")
 SET_PROPERTY(CACHE OSPRAY_ISPC_ADDRESSING PROPERTY STRINGS 32 64)
 MARK_AS_ADVANCED(OSPRAY_ISPC_ADDRESSING)


Fix for mac failure in apr shared lib staging (Part of DEV-41724)

--- indra/cmake/Copy3rdPartyLibs.cmake
+++ indra/cmake/Copy3rdPartyLibs.cmake
@@ -154,10 +154,8 @@
     set(release_src_dir "${CMAKE_SOURCE_DIR}/../libraries/universal-darwin/lib_release")
     set(release_files
         libapr-1.0.3.7.dylib
-        libapr-1.0.3.8.dylib
         libapr-1.dylib
         libaprutil-1.0.3.8.dylib
-        libaprutil-1.0.3.9.dylib
         libaprutil-1.dylib
         libexpat.0.5.0.dylib
         libexpat.dylib


Propagates link flags in static libraries

halide_add_aot_library_dependency applied to a static library didn't propagate the flags

--- HalideGenerator.cmake
+++ HalideGenerator.cmake
@@ -150,9 +150,9 @@
         # 4088: "/FORCE used, image may not work"
         # (Note that MSVC apparently considers 4088 too important to allow us to ignore it;
         # I'm nevertheless leaving this here to document that we don't care about it.)
-        set_target_properties("${TARGET}" PROPERTIES LINK_FLAGS "/STACK:8388608,1048576 /FORCE:multiple /ignore:4006 /ignore:4088")
+        target_link_libraries("${TARGET}" INTERFACE "-STACK:8388608,1048576" "-FORCE:multiple" "-ignore:4006" "-ignore:4088")
       else()
-        set_target_properties("${TARGET}" PROPERTIES LINK_FLAGS "-Wl,--allow-multiple-definition")
+        target_link_libraries("${TARGET}" INTERFACE "-Wl,--allow-multiple-definition")
       endif()
     else()
       target_link_libraries("${TARGET}" PRIVATE dl pthread z)


Add comment about Object Library usage

Add comment about Object Library usage

--- HalideGenerator.cmake
+++ HalideGenerator.cmake
@@ -160,6 +160,14 @@
   set(multiValueArgs SRCS STUB_DEPS)
   cmake_parse_arguments(args "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})

+  # We need to generate an "object" library for every generator, so that any
+  # generator that depends on our stub can link in our generator as well.
+  # Unfortunately, an ordinary static library won't do: CMake has no way to
+  # force "alwayslink=1", and a static library with just a self-registering
+  # Generator is almost certain to get optimized away at link time. Using
+  # an "Object Library" lets us dodge this (it basically just groups .o files
+  # together and presents them at the end), at the cost of some decidedly
+  # ugly bits right here.
   set(OBJLIB "${NAME}.objlib")
   add_library("${OBJLIB}" OBJECT ${args_SRCS})
   add_dependencies("${OBJLIB}" Halide)


fix cobertura coverage report

fix cobertura coverage report

--- contrib/CodeCoverage.cmake
+++ contrib/CodeCoverage.cmake
@@ -98,16 +98,19 @@
         IF(NOT GCOVR_PATH)
                 MESSAGE(FATAL_ERROR "gcovr not found! Aborting...")
         ENDIF() # NOT GCOVR_PATH
-
+
         ADD_CUSTOM_TARGET(${_targetname}
-
                 # Run tests
-                ${_testrunner} ${ARGV3}
-
+                COMMAND ${_testrunner} ${ARGV3}
+                WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/tests/
+                COMMENT "Running coverage tests."
+        )
+
+        ADD_CUSTOM_COMMAND(TARGET ${_targetname} POST_BUILD
                 # Running gcovr
-                COMMAND ${GCOVR_PATH} -x -r ${CMAKE_SOURCE_DIR} -e '${CMAKE_SOURCE_DIR}/tests/'  -o ../${_outputname}.xml
-                WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/tests
-                COMMENT "Running gcovr to produce Cobertura code coverage report."
+                COMMAND ${GCOVR_PATH} -x -r ${CMAKE_SOURCE_DIR} -e '${CMAKE_SOURCE_DIR}/tests/'  -o ${_outputname}.xml
+                WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
+                COMMENT "Running gcovr to produce Cobertura code coverage report. ${_testrunner} ${ARGV3}"
         )

         # Show info where to find the report


ENH: Bump TubeTK to v1.1rc01 which is targeted for ITKv5.3rc03

--- Modules/Remote/TubeTK.remote.cmake
+++ Modules/Remote/TubeTK.remote.cmake
@@ -5,8 +5,8 @@
 #-- ## Compliance level 5 star (AKA ITK main modules, or remote modules that could become core modules)
 #--   - [ ] Widespread community dependance
 #--   - [ ] Above 90% code coverage
-#--   - [ ] CI dashboards and testing monitored rigorously
-#--   - [ ] Key API features are exposed in wrapping interface
+#--   - [X] CI dashboards and testing monitored rigorously
+#--   - [X] Key API features are exposed in wrapping interface
 #--   - [ ] All requirements of Levels 4,3,2,1
 #--
 #-- ## Compliance Level 4 star (Very high-quality code, perhaps small community dependance)
@@ -48,5 +48,5 @@
   "http://www.tubetk.org"
   MODULE_COMPLIANCE_LEVEL 3
   GIT_REPOSITORY ${git_protocol}://github.com/InsightSoftwareConsortium/ITKTubeTK.git
-  GIT_TAG cee053ac95743ed6d7a879465ac2d4ddd4beb04f
+  GIT_TAG v1.1rc01
   )


[FIX] Set CMP0054 policy also within SeqAnBuildSystem.cmake for internal build.


ARROW-3211: [C++] Disable gold linker with MinGW-w64

Author: Kouhei Sutou <kou@clear-code.com>

Closes #2537 from kou/cpp-mingw-gold-ld-disable and squashes the following commits:

0b45897f0 <Kouhei Sutou>  Disable gold linker with MinGW-w64

--- cpp/cmake_modules/SetupCxxFlags.cmake
+++ cpp/cmake_modules/SetupCxxFlags.cmake
@@ -246,7 +246,7 @@
 endfunction()

 # Is the compiler hard-wired to use the gold linker?
-if (NOT MSVC AND NOT APPLE)
+if (NOT WIN32 AND NOT APPLE)
   GET_GOLD_VERSION()
   if (GOLD_VERSION)
     set(MUST_USE_GOLD 1)


Added Visual Studio 2005 path.

Added Visual Studio 2005 path.

--- FindFBX.cmake
+++ FindFBX.cmake
@@ -51,7 +51,7 @@
     find_library(${_name}
         NAMES ${_lib}
         HINTS ${FBX_SEARCH_LOCATIONS}
-        PATH_SUFFIXES lib/${fbx_compiler}/ub/${_suffix} lib/vs2013/x64/${_suffix} lib/vs2012/x64/${_suffix} lib/vs2010/x64/${_suffix} lib/vs2008/x64/${_suffix}
+        PATH_SUFFIXES lib/${fbx_compiler}/ub/${_suffix} lib/vs2013/x64/${_suffix} lib/vs2012/x64/${_suffix} lib/vs2010/x64/${_suffix} lib/vs2008/x64/${_suffix} lib/vs2005/x64/${_suffix}
     )
     mark_as_advanced(${_name})
 endfunction()


Remove now useless C++1y flag

Remove now useless C++1y flag

As of D66195 we support C++14 by default.

git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@368890 91177308-0d34-0410-b5e6-96231b3b80d8
(cherry picked from commit 29da3ad1ea9b201edcc0196de5d2b9d567a1ab0a)

--- cmake/modules/HandleLLVMOptions.cmake
+++ cmake/modules/HandleLLVMOptions.cmake
@@ -20,8 +20,6 @@

 set(LLVM_CXX_STD_default "c++14")
 # Preserve behaviour of legacy cache variables
-if (LLVM_ENABLE_CXX1Y)
-  set(LLVM_CXX_STD_default "c++1y")
 elseif (LLVM_ENABLE_CXX1Z)
   set(LLVM_CXX_STD_default "c++1z")
 endif()


From Pere:
small fix for https://savannah.cern.ch/bugs/?98510

git-svn-id: 9d02132d8e1217b86764d694e1605987040d84e5@47488 27541ba8-7e3a-0410-8455-c3a389f83636

--- cmake/modules/RootConfiguration.cmake
+++ cmake/modules/RootConfiguration.cmake
@@ -421,6 +421,8 @@
 configure_file(${CMAKE_SOURCE_DIR}/config/memprobe.in ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/memprobe @ONLY)
 configure_file(${CMAKE_SOURCE_DIR}/config/thisroot.sh ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/thisroot.sh @ONLY)
 configure_file(${CMAKE_SOURCE_DIR}/config/thisroot.csh ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/thisroot.csh @ONLY)
+configure_file(${CMAKE_SOURCE_DIR}/config/setxrd.csh ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/setxrd.csh COPYONLY)
+configure_file(${CMAKE_SOURCE_DIR}/config/setxrd.sh ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/setxrd.sh COPYONLY)
 configure_file(${CMAKE_SOURCE_DIR}/config/genreflex.in ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/genreflex @ONLY)
 configure_file(${CMAKE_SOURCE_DIR}/config/genreflex-rootcint.in ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/genreflex-rootcint @ONLY)
 configure_file(${CMAKE_SOURCE_DIR}/config/proofserv.in ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/proofserv @ONLY)
@@ -436,7 +438,9 @@
               ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/memprobe
               ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/thisroot.sh
               ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/thisroot.csh
-			  ${thisrootbat}
+              ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/setxrd.csh
+              ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/setxrd.sh
+              ${thisrootbat}
               ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/root-config
               ${CMAKE_SOURCE_DIR}/cmake/scripts/setenvwrap.csh
               ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/roots


refs #64 fix clang on linux problems

refs #64 fix clang on linux problems

--- cmake_modules/TokuSetupCompiler.cmake
+++ cmake_modules/TokuSetupCompiler.cmake
@@ -87,6 +87,7 @@
   -Wmissing-format-attribute
   -Wno-error=missing-format-attribute
   -Wno-error=address-of-array-temporary
+  -Wno-error=tautological-constant-out-of-range-compare
   -fno-rtti
   -fno-exceptions
   )
@@ -128,7 +129,7 @@

 ## set extra release flags
 ## need to set flags for RelWithDebInfo as well because we want the MySQL/MariaDB builds to use them
-if (APPLE AND CMAKE_CXX_COMPILER_ID STREQUAL Clang)
+if (CMAKE_CXX_COMPILER_ID STREQUAL Clang)
   # have tried -flto and -O4, both make our statically linked executables break apple's linker
   set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} -g -O3 -UNDEBUG")
   set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -g -O3 -UNDEBUG")


closes #5928 add fortify source to RelWithDebInfo

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

--- cmake_modules/TokuSetupCompiler.cmake
+++ cmake_modules/TokuSetupCompiler.cmake
@@ -25,6 +25,7 @@
 ## add TOKU_PTHREAD_DEBUG for debug builds
 set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_DEBUG TOKU_PTHREAD_DEBUG=1)
 set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_RELWITHDEBINFO TOKU_PTHREAD_DEBUG=1)
+set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_RELWITHDEBINFO _FORTIFY_SOURCE=2)

 ## coverage
 option(USE_GCOV "Use gcov for test coverage." OFF)


cmake: fix add_subdirectory for Windows

cmake: fix add_subdirectory for Windows

--- autogenerate_plugin_container.cmake
+++ autogenerate_plugin_container.cmake
@@ -66,7 +66,7 @@
         set(header_files "")
         set(impl_header_files "")

-        add_subdirectory(${plugin} ${CMAKE_CURRENT_BINARY_DIR}/${plugin})
+        add_subdirectory(${plugin} ${plugin})
         foreach(source_file ${source_files})
             list(APPEND plugin_source_files "${plugin}/${source_file}")
         endforeach()


Add again suppression of warning for unused function in Vc for latest clang version

--- math/vc/cmake/VcMacros.cmake
+++ math/vc/cmake/VcMacros.cmake
@@ -378,7 +378,11 @@

       if(NOT DEFINED Vc_INSIDE_ROOT)  # ROOT has to set this up
          AddCompilerFlag(-stdlib=libc++)
-      endif()
+      else()
+         # disable this warning appearing from version 3.4 (5.1)
+      	 vc_add_compiler_flag(Vc_DEFINITIONS "-Wno-unused-function")
+      endif()
+
    endif()

    if(NOT Vc_COMPILER_IS_MSVC)


build: require c++17

build: require c++17

--- cmake/Reaper.cmake
+++ cmake/Reaper.cmake
@@ -107,10 +107,10 @@
         # NOTE: it is mutually exclusive with /std:c++14
         target_compile_options(${target} PRIVATE "/MP" "/std:c++latest")
     elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
-        set_target_properties(${target} PROPERTIES CXX_STANDARD 14)
+        set_target_properties(${target} PROPERTIES CXX_STANDARD 17)
         target_compile_options(${target} PRIVATE "-fvisibility=hidden")
     elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
-        set_target_properties(${target} PROPERTIES CXX_STANDARD 14)
+        set_target_properties(${target} PROPERTIES CXX_STANDARD 17)
         target_compile_options(${target} PRIVATE "-fvisibility=hidden")
         add_clang_tidy_flags(${target})
     else()


Addressed the small problem of building OpenCOR on Mac OS X using Qt Creator.

--- cmake/common.cmake
+++ cmake/common.cmake
@@ -36,6 +36,20 @@
     ENDIF()

     # Required packages
+
+    IF(APPLE)
+        # Note #1: the Qt SDK doesn't, by default, make the Qt binaries
+        #          available to the user, hence we must update the user's PATH.
+        #          However, this doesn't work on Mac OS X with Qt Creator, so
+        #          we must hard-code qmake's path so that CMake can find it
+        #          from within Qt Creator...
+        # Note #2: ideally, we would use EXECUTE_PROCESS to retrieve the result
+        #          of 'which qmake', but that CMake command doesn't work from
+        #          within Qt Creator, so we really have no choice but to hard-
+        #          code qmake's path...
+
+        SET(QT_QMAKE_EXECUTABLE /Developer/QtSDK/Desktop/Qt/474/gcc/bin/qmake)
+    ENDIF()

     FIND_PACKAGE(Qt4 4.7.4 REQUIRED)

@@ -107,6 +121,7 @@
     SET(DEFINITIONS)
     SET(OPENCOR_DEPENDENCIES)
     SET(QT_DEPENDENCIES)
+    SET(EXTERNAL_DEPENDENCIES)

     # Analyse the extra parameters

@@ -129,11 +144,13 @@
             SET(TYPE_OF_PARAMETER 7)
         ELSEIF(${PARAMETER} STREQUAL "QT_DEPENDENCIES")
             SET(TYPE_OF_PARAMETER 8)
+        ELSEIF(${PARAMETER} STREQUAL "EXTERNAL_DEPENDENCIES")
+            SET(TYPE_OF_PARAMETER 9)
         ELSEIF(${PARAMETER} STREQUAL "RESOURCE_DIR")
-            SET(TYPE_OF_PARAMETER 9)
+            SET(TYPE_OF_PARAMETER 10)
         ELSE()
             # Not one of the headers, so add the parameter to the corresponding
-            # set
+            # set

             IF(${TYPE_OF_PARAMETER} EQUAL 1)
                 SET(SOURCES ${SOURCES} ${PARAMETER})
@@ -152,6 +169,8 @@
             ELSEIF(${TYPE_OF_PARAMETER} EQUAL 8)
                 SET(QT_DEPENDENCIES ${QT_DEPENDENCIES} ${PARAMETER})
             ELSEIF(${TYPE_OF_PARAMETER} EQUAL 9)
+                SET(EXTERNAL_DEPENDENCIES ${EXTERNAL_DEPENDENCIES} ${PARAMETER})
+            ELSEIF(${TYPE_OF_PARAMETER} EQUAL 10)
                 # Note: we only support ONE resource directory, so...

                 SET(QRC_FILE ${PARAMETER}/${PLUGIN_NAME}.qrc)
@@ -246,6 +265,14 @@

         TARGET_LINK_LIBRARIES(${PROJECT_NAME}
             ${QT_LIBRARY_PATH}
+        )
+    ENDFOREACH()
+
+    # External dependencies
+
+    FOREACH(EXTERNAL_LIBRARY ${EXTERNAL_DEPENDENCIES})
+        TARGET_LINK_LIBRARIES(${PROJECT_NAME}
+            ${EXTERNAL_LIBRARY}
         )
     ENDFOREACH()


Ignore readability-function-cognitive-complexity in clang tidy.

--- cmake/common.cmake
+++ cmake/common.cmake
@@ -187,6 +187,7 @@
       -performance-inefficient-string-concatenation
       readability-*
       -readability-convert-member-functions-to-static
+      -readability-function-cognitive-complexity
       -readability-magic-numbers
       -readability-qualified-auto
       ${_DISABLED_READABILITY_CHECKS}


CMake: moved `clean_cotire` target to cmake project folder

--- cmake/cotire.cmake
+++ cmake/cotire.cmake
@@ -3289,7 +3289,7 @@
         set (COTIRE_UNITY_BUILD_TARGET_SUFFIX "_unity")
     endif()
     if (NOT DEFINED COTIRE_TARGETS_FOLDER)
-        set (COTIRE_TARGETS_FOLDER "ext")
+        set (COTIRE_TARGETS_FOLDER "cmake")
     endif()
     if (NOT DEFINED COTIRE_UNITY_OUTPUT_DIRECTORY)
         if ("${CMAKE_GENERATOR}" MATCHES "Ninja")


Update kernel.cmake

Update kernel.cmake

--- cmake/kernel.cmake
+++ cmake/kernel.cmake
@@ -127,10 +127,10 @@
   set(SHCOPYKERNEL ../arm/copy.c)
   set(SHDOTKERNEL ../arm/dot.c)
   set(SHROTKERNEL ../arm/rot.c)
-  set(SHSCALKERNEL scal.S)
+  set(SHSCALKERNEL ../arm/scal.c)
   set(SHNRM2KERNEL ../arm/nrm2.c)
-  set(SHSUMKERNEL sum.S)
-  set(SHSWAPKERNEL swap.S)
+  set(SHSUMKERNEL ../arm/sum.c)
+  set(SHSWAPKERNEL ../arm/swap.c)
 endmacro ()

 macro(SetDefaultL2)


Remove SwigWin version from path

Remove SwigWin version from path

Having the version to the Superbuild path of the SwigWin creates
un-needed burden on builds which want to use SimpleITK's Swig to know
the version.

--- SuperBuild/External_Swig.cmake
+++ SuperBuild/External_Swig.cmake
@@ -35,13 +35,13 @@

     sitkSourceDownload(SWIGWIN_URL "swigwin-${SWIG_TARGET_VERSION}.zip"  ${SWIGWIN_DOWNLOAD_HASH})

-    set(swig_source_dir ${CMAKE_CURRENT_BINARY_DIR}/swigwin-${SWIG_TARGET_VERSION})
+    set(swig_source_dir "${CMAKE_CURRENT_BINARY_DIR}/swigwin")

     # swig.exe available as pre-built binary on Windows:
     ExternalProject_Add(Swig
       URL "${SWIGWIN_URL}"
       URL_MD5 ${SWIG_DOWNLOAD_WIN_HASH}
-      SOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR}/swigwin-${SWIG_TARGET_VERSION}
+      SOURCE_DIR ${swig_source_dir}
       CONFIGURE_COMMAND ""
       BUILD_COMMAND ""
       INSTALL_COMMAND ""
@@ -49,8 +49,8 @@
       )
     add_dependencies(Swig  "SuperBuildSimpleITKSource")

-    set(SWIG_DIR ${CMAKE_CURRENT_BINARY_DIR}/swigwin-${SWIG_TARGET_VERSION}) # path specified as source in ep
-    set(SWIG_EXECUTABLE ${CMAKE_CURRENT_BINARY_DIR}/swigwin-${SWIG_TARGET_VERSION}/swig.exe)
+    set(SWIG_DIR "${swig_source_dir}") # path specified as source in ep
+    set(SWIG_EXECUTABLE ${SWIG_DIR}/swig.exe)

   else()
     # compiled SWIG for others


Remove include

Remove include

--- Tensile/cmake/TensileConfig.cmake
+++ Tensile/cmake/TensileConfig.cmake
@@ -70,7 +70,7 @@
 endif()

 add_subdirectory("${Tensile_ROOT}/Source" "Tensile")
-include("${Tensile_ROOT}/Source/TensileCreateLibrary.cmake")
+#include("${Tensile_ROOT}/Source/TensileCreateLibrary.cmake")

 # Target is created for copying dependencies
 function(TensileCreateCopyTarget


mpv: package mpv.com binary

mpv: package mpv.com binary

--- packages/mpv.cmake
+++ packages/mpv.cmake
@@ -42,13 +42,15 @@
 ExternalProject_Add_Step(mpv strip-binary
     DEPENDEES build
     COMMAND ${EXEC} ${TARGET_ARCH}-strip -s <SOURCE_DIR>/build/mpv.exe
-    COMMENT "Stripping mpv binary"
+    COMMAND ${EXEC} ${TARGET_ARCH}-strip -s <SOURCE_DIR>/build/mpv.com
+    COMMENT "Stripping mpv binaries"
 )

 ExternalProject_Add_Step(mpv copy-binary
     DEPENDEES strip-binary
     COMMAND ${CMAKE_COMMAND} -E copy <SOURCE_DIR>/build/mpv.exe ${CMAKE_CURRENT_BINARY_DIR}/mpv.exe
-    COMMENT "Copying mpv binary"
+    COMMAND ${CMAKE_COMMAND} -E copy <SOURCE_DIR>/build/mpv.com ${CMAKE_CURRENT_BINARY_DIR}/mpv.com
+    COMMENT "Copying mpv binaries"
 )

 ExternalProject_Add_Step(mpv copy-libquvi-scripts
@@ -70,7 +72,7 @@
 ExternalProject_Add_Step(mpv pack-binary
     DEPENDEES copy-binary copy-libquvi-scripts copy-font-stuff
     COMMAND ${CMAKE_COMMAND} -E remove ../mpv-${TARGET_CPU}-${BUILDDATE}.7z
-    COMMAND 7z a -m0=lzma2 -mx=9 -ms=on ../mpv-${TARGET_CPU}-${BUILDDATE}.7z mpv.exe libquvi-scripts mpv fonts
+    COMMAND 7z a -m0=lzma2 -mx=9 -ms=on ../mpv-${TARGET_CPU}-${BUILDDATE}.7z mpv.exe mpv.com libquvi-scripts mpv fonts
     COMMENT "Packing mpv binary"
     LOG 1
 )


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

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

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


Use dlmopen when trying to inject heaptrack_inject.

Some systems use an optimized dlopen symbol (especially embeded linux
modifications), but these don't touch dlmopen, which is more general.

This prevents an "dlopen - symbol not found" error when trying to
inject heaptrack on such systems to a running process.

--- heaptrack.sh.cmake
+++ heaptrack.sh.cmake
@@ -165,7 +165,7 @@
     echo "injecting heaptrack into application via GDB, this might take some time..."
     gdb --batch-silent -n -iex="set auto-solib-add off" -p $pid \
         --eval-command="sharedlibrary libdl" \
-        --eval-command="call (void) dlopen(\"$LIBHEAPTRACK_INJECT\", 0x002)" \
+        --eval-command="call (void) dlmopen(0x00, \"$LIBHEAPTRACK_INJECT\", 0x002)" \
         --eval-command="sharedlibrary libheaptrack_inject" \
         --eval-command="call (void) heaptrack_inject(\"$pipe\")" \
         --eval-command="detach"


- Added support for tbbmalloc_proxy - Search for release build of libraries is now handled correctly.

--- FindTBB.cmake
+++ FindTBB.cmake
@@ -89,11 +89,15 @@
   ##################################

   if(NOT DEFINED TBB_USE_DEBUG_BUILD)
-    if(CMAKE_BUILD_TYPE MATCHES "[Debug|DEBUG|debug|RelWithDebInfo|RELWITHDEBINFO|relwithdebinfo]")
-      set(TBB_USE_DEBUG_BUILD TRUE)
+    if(CMAKE_BUILD_TYPE MATCHES "(Debug|DEBUG|debug|RelWithDebInfo|RELWITHDEBINFO|relwithdebinfo)")
+      set(TBB_BUILD_TYPE DEBUG)
     else()
-      set(TBB_USE_DEBUG_BUILD FALSE)
-    endif()
+      set(TBB_BUILD_TYPE RELEASE)
+    endif()
+  elseif(TBB_USE_DEBUG_BUILD)
+    set(TBB_BUILD_TYPE DEBUG)
+  else()
+    set(TBB_BUILD_TYPE RELEASE)
   endif()

   ##################################
@@ -164,73 +168,81 @@
       HINTS ${TBB_INCLUDE_DIR} ${TBB_SEARCH_DIR}
       PATHS ${TBB_DEFAULT_SEARCH_DIR}
       PATH_SUFFIXES include)
-
-  ##################################
-  # Find TBB components
-  ##################################
-
-  # Find each component
-  foreach(_comp tbb_preview tbbmalloc tbb)
-    # Search for the libraries
-    find_library(TBB_${_comp}_LIBRARY_RELEASE ${_comp}
-        HINTS ${TBB_LIBRARY} ${TBB_SEARCH_DIR}
-        PATHS ${TBB_DEFAULT_SEARCH_DIR}
-        PATH_SUFFIXES ${TBB_LIB_PATH_SUFFIX})
-
-    find_library(TBB_${_comp}_LIBRARY_DEBUG ${_comp}_debug
-        HINTS ${TBB_LIBRARY} ${TBB_SEARCH_DIR}
-        PATHS ${TBB_DEFAULT_SEARCH_DIR} ENV LIBRARY_PATH
-        PATH_SUFFIXES ${TBB_LIB_PATH_SUFFIX})
-
-
-    # Set the library to be used for the component
-    if(NOT TBB_${_comp}_LIBRARY)
-      if(TBB_USE_DEBUG_BUILD AND TBB_${_comp}_LIBRARY_DEBUG)
-        set(TBB_${_comp}_LIBRARY "${TBB_${_comp}_LIBRARY_DEBUG}")
-      elseif(TBB_${_comp}_LIBRARY_RELEASE)
-        set(TBB_${_comp}_LIBRARY "${TBB_${_comp}_LIBRARY_RELEASE}")
-      elseif(TBB_${_comp}_LIBRARY_DEBUG)
-        set(TBB_${_comp}_LIBRARY "${TBB_${_comp}_LIBRARY_DEBUG}")
-      endif()
-    endif()
-
-    # Set the TBB library list and component found variables
-    if(TBB_${_comp}_LIBRARY)
-      list(APPEND TBB_LIBRARIES "${TBB_${_comp}_LIBRARY}")
-      set(TBB_${_comp}_FOUND TRUE)
-    else()
-      set(TBB_${_comp}_FOUND FALSE)
-    endif()
-
-    mark_as_advanced(TBB_${_comp}_LIBRARY_RELEASE)
-    mark_as_advanced(TBB_${_comp}_LIBRARY_DEBUG)
-    mark_as_advanced(TBB_${_comp}_LIBRARY)
-
-  endforeach()
-
-  ##################################
-  # Set compile flags
-  ##################################
-
-  if(TBB_tbb_LIBRARY MATCHES "debug")
-    set(TBB_DEFINITIONS "-DTBB_USE_DEBUG=1")
-  endif()
-
+
   ##################################
   # Set version strings
   ##################################
-
+
   if(TBB_INCLUDE_DIRS)
     file(READ "${TBB_INCLUDE_DIRS}/tbb/tbb_stddef.h" _tbb_version_file)
     string(REGEX REPLACE ".*#define TBB_VERSION_MAJOR ([0-9]+).*" "\\1"
-            TBB_VERSION_MAJOR "${_tbb_version_file}")
+        TBB_VERSION_MAJOR "${_tbb_version_file}")
     string(REGEX REPLACE ".*#define TBB_VERSION_MINOR ([0-9]+).*" "\\1"
-            TBB_VERSION_MINOR "${_tbb_version_file}")
+        TBB_VERSION_MINOR "${_tbb_version_file}")
     string(REGEX REPLACE ".*#define TBB_INTERFACE_VERSION ([0-9]+).*" "\\1"
-            TBB_INTERFACE_VERSION "${_tbb_version_file}")
+        TBB_INTERFACE_VERSION "${_tbb_version_file}")
     set(TBB_VERSION "${TBB_VERSION_MAJOR}.${TBB_VERSION_MINOR}")
   endif()
-
+
+  ##################################
+  # Find TBB components
+  ##################################
+
+  if(TBB_VERSION VERSION_LESS 4.3)
+    set(TBB_SEARCH_COMPOMPONENTS tbb_preview tbbmalloc tbb)
+  else()
+    set(TBB_SEARCH_COMPOMPONENTS tbb_preview tbbmalloc_proxy tbbmalloc tbb)
+  endif()
+
+  # Find each component
+  foreach(_comp ${TBB_SEARCH_COMPOMPONENTS})
+    if(";${TBB_FIND_COMPONENTS};tbb;" MATCHES ";${_comp};")
+
+      # Search for the libraries
+      find_library(TBB_${_comp}_LIBRARY_RELEASE ${_comp}
+          HINTS ${TBB_LIBRARY} ${TBB_SEARCH_DIR}
+          PATHS ${TBB_DEFAULT_SEARCH_DIR} ENV LIBRARY_PATH
+          PATH_SUFFIXES ${TBB_LIB_PATH_SUFFIX})
+
+      find_library(TBB_${_comp}_LIBRARY_DEBUG ${_comp}_debug
+          HINTS ${TBB_LIBRARY} ${TBB_SEARCH_DIR}
+          PATHS ${TBB_DEFAULT_SEARCH_DIR} ENV LIBRARY_PATH
+          PATH_SUFFIXES ${TBB_LIB_PATH_SUFFIX})
+
+      if(TBB_${_comp}_LIBRARY_DEBUG)
+        list(APPEND TBB_LIBRARIES_DEBUG "${TBB_${_comp}_LIBRARY_DEBUG}")
+      endif()
+      if(TBB_${_comp}_LIBRARY_RELEASE)
+        list(APPEND TBB_LIBRARIES_RELEASE "${TBB_${_comp}_LIBRARY_RELEASE}")
+      endif()
+      if(TBB_${_comp}_LIBRARY_${TBB_BUILD_TYPE} AND NOT TBB_${_comp}_LIBRARY)
+        set(TBB_${_comp}_LIBRARY "${TBB_${_comp}_LIBRARY_${TBB_BUILD_TYPE}}")
+      endif()
+
+      if(TBB_${_comp}_LIBRARY AND EXISTS "${TBB_${_comp}_LIBRARY}")
+        set(TBB_${_comp}_FOUND TRUE)
+      else()
+        set(TBB_${_comp}_FOUND FALSE)
+      endif()
+
+      mark_as_advanced(TBB_${_comp}_LIBRARY_RELEASE)
+      mark_as_advanced(TBB_${_comp}_LIBRARY_DEBUG)
+      mark_as_advanced(TBB_${_comp}_LIBRARY)
+
+    endif()
+  endforeach()
+
+  set(TBB_LIBRARIES "${TBB_LIBRARIES_${TBB_BUILD_TYPE}}")
+
+  ##################################
+  # Set compile flags
+  ##################################
+
+  if(TBB_tbb_LIBRARY MATCHES "debug")
+    set(TBB_DEFINITIONS "-DTBB_USE_DEBUG=1")
+  endif()
+
+
   find_package_handle_standard_args(TBB
       REQUIRED_VARS TBB_INCLUDE_DIRS TBB_LIBRARIES
       HANDLE_COMPONENTS
@@ -239,6 +251,7 @@
   mark_as_advanced(TBB_INCLUDE_DIRS TBB_LIBRARIES)

   unset(TBB_ARCHITECTURE)
+  unset(TBB_BUILD_TYPE)
   unset(TBB_LIB_PATH_SUFFIX)
   unset(TBB_DEFAULT_SEARCH_DIR)


Fixed coverage for out-of-source builds

Fixed coverage for out-of-source builds

--- CMake/CodeCoverage.cmake
+++ CMake/CodeCoverage.cmake
@@ -50,7 +50,7 @@

     add_custom_target(${targetname}-cobertura
       COMMAND ${testrunner}
-      COMMAND ${GCOVR_PATH} -x -r ${CMAKE_SOURCE_DIR}/src -o coverage.xml
+      COMMAND ${GCOVR_PATH} -x -r ${CMAKE_SOURCE_DIR}/src ./src -o coverage.xml
       COMMAND echo Code coverage report written to coverage.xml

       WORKING_DIRECTORY ${CMAKE_BINARY_DIR}


Fix Boost detection on OS X when gcc command-line version is not 4.0
We use 4.0 currently so that we can maintain OS X 10.4 compatibility

--HG--
branch : v1-7

--- CMake/Dependencies.cmake
+++ CMake/Dependencies.cmake
@@ -121,6 +121,11 @@
 		# Statically linking boost to a dynamic Ogre build doesn't work on Linux 64bit
 		set(Boost_USE_STATIC_LIBS ${OGRE_STATIC})
 	endif ()
+	if (APPLE)
+	    # Boost tries to detect the gcc compiler version by calling the command-line
+	    # However we build with gcc 4.0 for OS X 10.4 compatibility, command-line default might be different
+		set(Boost_COMPILER "-xgcc40")
+	endif()
 	set(Boost_ADDITIONAL_VERSIONS "1.42" "1.42.0" "1.41.0" "1.41" "1.40.0" "1.40" "1.39.0" "1.39" "1.38.0" "1.38" "1.37.0" "1.37" )
 	# Components that need linking (NB does not include header-only components like bind)
 	set(OGRE_BOOST_COMPONENTS thread date_time)


Fix the link for TBB

Fix the link for TBB

--- CMake/Dependencies.cmake
+++ CMake/Dependencies.cmake
@@ -146,7 +146,7 @@

 # ThreadingBuildingBlocks
 find_package(TBB)
-macro_log_feature(TBB_FOUND "tbb" "Threading Building Blocks" "http://openttb.org/" FALSE "" "")
+macro_log_feature(TBB_FOUND "tbb" "Threading Building Blocks" "http://www.threadingbuildingblocks.org/" FALSE "" "")


ExternalData: Clean up duplicate regex matches with CMAKE_MATCH_<n>

The matches have already been calculated and can simply be taken from
CMAKE_MATCH_n variables. This avoids multiple compilations of the same or very
similar regular expressions.

Change-Id: Ie9d66cc5790475307eaea1c8c934ed16b28ae5f2

--- CMake/ExternalData.cmake
+++ CMake/ExternalData.cmake
@@ -267,8 +267,7 @@
       foreach(piece IN LISTS pieces)
         if("x${piece}" MATCHES "^x${data_regex}$")
           # Replace this DATA{}-piece with a file path.
-          string(REGEX REPLACE "${data_regex}" "\\1" data "${piece}")
-          _ExternalData_arg("${target}" "${piece}" "${data}" file)
+          _ExternalData_arg("${target}" "${piece}" "${CMAKE_MATCH_1}" file)
           set(outArg "${outArg}${file}")
         else()
           # No replacement needed for this piece.
@@ -407,10 +406,9 @@
   set(associated_files "")
   set(associated_regex "")
   foreach(opt ${options})
-    if("x${opt}" MATCHES "^xREGEX:[^:/]+$")
-      # Regular expression to match associated files.
-      string(REGEX REPLACE "^REGEX:" "" regex "${opt}")
-      list(APPEND associated_regex "${regex}")
+    # Regular expression to match associated files.
+    if("x${opt}" MATCHES "^xREGEX:([^:/]+)$")
+      list(APPEND associated_regex "${CMAKE_MATCH_1}")
     elseif(opt STREQUAL ":")
       # Activate series matching.
       set(series_option "${opt}")


Update CTK

Update CTK

--- CMakeExternals/CTK.cmake
+++ CMakeExternals/CTK.cmake
@@ -15,7 +15,7 @@

   if(NOT DEFINED CTK_DIR)

-    set(revision_tag 5bc07082)
+    set(revision_tag bdc8caca)
     #IF(${proj}_REVISION_TAG)
     #  SET(revision_tag ${${proj}_REVISION_TAG})
     #ENDIF()
@@ -81,7 +81,7 @@
       URL ${MITK_THIRDPARTY_DOWNLOAD_PREFIX_URL}/CTK_${revision_tag}.tar.gz
       #GIT_REPOSITORY https://github.com/commontk/CTK.git
       #GIT_TAG origin/master
-      URL_MD5 34b94d196546fa3b2e610a37da1a163d
+      URL_MD5 47fec8ee5eb3259808de435ed335d14d
       UPDATE_COMMAND ""
       INSTALL_COMMAND ""
       CMAKE_GENERATOR ${gen}


Rename r variable to avoid CMP0054 warning

Using "r" as a value an "r" as a variable name confuses CMake
recursive variable evaluation.

Change-Id: I999af7d237cb22c9ca22a3cbae7386bfe2b4f3fd

--- CMake/sitkCheckRequiredFlags.cmake
+++ CMake/sitkCheckRequiredFlags.cmake
@@ -19,8 +19,8 @@
 )

 foreach(f ${cmake_cxx_flags_list})
-  foreach( r ${required_flags_regex_to_test} )
-    string(REGEX MATCH  ${r} _HAS_FLAG ${f} )
+  foreach( _r ${required_flags_regex_to_test} )
+    string(REGEX MATCH  ${_r} _HAS_FLAG ${f} )
     if (_HAS_FLAG )
       string(FIND "${SimpleITK_REQUIRED_CXX_FLAGS}" "${f}" required)
       if(required LESS 0)


Fixed spacing of message

Fixed spacing of message

--- CMakeModules/FindOpenThreads.cmake
+++ CMakeModules/FindOpenThreads.cmake
@@ -60,6 +60,6 @@
 SET(OPENTHREADS_FOUND "NO")
 IF(OPENTHREADS_INCLUDE_DIR AND OPENTHREADS_LIBRARY)
 	SET(OPENTHREADS_FOUND "YES")
-        MESSAGE("---Found OpenThreads: "${OPENTHREADS_LIBRARY})
+        MESSAGE("-- Found OpenThreads: "${OPENTHREADS_LIBRARY})
 ENDIF(OPENTHREADS_INCLUDE_DIR AND OPENTHREADS_LIBRARY)


Added Boost Librabry Suffix

Added Boost Librabry Suffix

--- Cmake/ProjectBoost.cmake
+++ Cmake/ProjectBoost.cmake
@@ -80,7 +80,7 @@

         --with-program_options  # libff wants it, we may need it in future.

-    LOG_BUILD 1
+{BOOST_LIBRARY_SUFFIX})    LOG_BUILD 1

     INSTALL_COMMAND ""

@@ -130,7 +130,7 @@

 add_library(Boost::Filesystem STATIC IMPORTED)

-set_property(TARGET Boost::Filesystem PROPERTY IMPORTED_LOCATION ${BOOST_LIBRARY_DIR}/libboost_filesystem$
+set_property(TARGET Boost::Filesystem PROPERTY IMPORTED_LOCATION ${BOOST_LIBRARY_DIR}/libboost_filesystem${BOOST_LIBRARY_SUFFIX})

 set_property(TARGET Boost::Filesystem PROPERTY INTERFACE_LINK_LIBRARIES Boost::System)


Synchronize adm files

Synchronize adm files

--- adm_local_without_kernel/cmake_files/SalomeMacros.cmake
+++ adm_local_without_kernel/cmake_files/SalomeMacros.cmake
@@ -485,8 +485,12 @@
   ENDIF()

   # Otherwise try the standard way (module mode, with the standard CMake Find*** macro):
-  # We do it quietly to produce our own error message:
-  SALOME_FIND_PACKAGE("Salome${pkg}" ${pkg} MODULE TRUE)
+  # We do it quietly to produce our own error message, except if we are in debug mode:
+  IF(SALOME_CMAKE_DEBUG)
+    SALOME_FIND_PACKAGE("Salome${pkg}" ${pkg} MODULE FALSE)
+  ELSE()
+    SALOME_FIND_PACKAGE("Salome${pkg}" ${pkg} MODULE TRUE)
+  ENDIF()

   # Set the "FOUND" variable for the SALOME wrapper:
   IF(${pkg_UC}_FOUND OR ${pkg}_FOUND)
@@ -496,10 +500,12 @@
     IF(NOT Salome${pkg}_FIND_QUIETLY)
       IF(Salome${pkg}_FIND_REQUIRED)
          MESSAGE(FATAL_ERROR "Package ${pkg} couldn't be found - did you set the corresponing root dir correctly? "
-         "It currently contains ${pkg_UC}_ROOT_DIR=${${pkg_UC}_ROOT_DIR}")
+         "It currently contains ${pkg_UC}_ROOT_DIR=${${pkg_UC}_ROOT_DIR}  "
+         "Append -DSALOME_CMAKE_DEBUG=ON on the command line if you want to see the original CMake error.")
       ELSE()
          MESSAGE(WARNING "Package ${pkg} couldn't be found - did you set the corresponing root dir correctly? "
-         "It currently contains ${pkg_UC}_ROOT_DIR=${${pkg_UC}_ROOT_DIR}")
+         "It currently contains ${pkg_UC}_ROOT_DIR=${${pkg_UC}_ROOT_DIR}  "
+         "Append -DSALOME_CMAKE_DEBUG=ON on the command line if you want to see the original CMake error.")
       ENDIF()
     ENDIF()
   ENDIF()
@@ -509,10 +515,10 @@
     ## from the given reference path. The variable "referenceVariable" may be a list.
     ## In this case we take its first element.

-    # First test if the variable exists and is not empty:
-    IF((NOT DEFINED ${referenceVariable}) OR ("${${referenceVariable}}" STREQUAL ""))
+    # First test if the variable exists, warn otherwise:
+    IF(NOT DEFINED ${referenceVariable})
       MESSAGE(WARNING "${pkg}: the reference variable '${referenceVariable}' used when calling the macro "
-      "SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS() does not exist or is empty.")
+      "SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS() is not defined.")
     ENDIF()

     LIST(LENGTH ${referenceVariable} _tmp_len)
@@ -522,9 +528,8 @@
        #  Note the double de-reference of "referenceVariable":
        SET(_tmp_ROOT_DIR "${${referenceVariable}}")
     ENDIF()
-    IF(${upCount})
-      MATH(EXPR _rge "${upCount}-1")
-      FOREACH(_unused RANGE ${_rge})
+    IF(${upCount})
+      FOREACH(_unused RANGE 1 ${upCount})
         GET_FILENAME_COMPONENT(_tmp_ROOT_DIR "${_tmp_ROOT_DIR}" PATH)
       ENDFOREACH()
     ENDIF()


ENH: Update Hippo Darwin version

ENH: Update Hippo Darwin version

--- Hippo_Kitware_TubeTK_Nightly.cmake
+++ Hippo_Kitware_TubeTK_Nightly.cmake
@@ -27,7 +27,7 @@
 #   the TubeTK source directory.
 #
 set( SITE_NAME "Hippo.Kitware" )
-set( SITE_PLATFORM "apple-darwin12.3.0-clang-x86_64" )
+set( SITE_PLATFORM "apple-darwin12.4.0-clang-x86_64" )
 set( SITE_BUILD_TYPE "RelWithDebInfo" )
 set( SITE_CTEST_MODE "Nightly" )
 set( SITE_CMAKE_GENERATOR "Unix Makefiles" )


cmake: FindGSL.cmake, fixed a bug on OpenSuse

--- CMakeModules/FindGSL.cmake
+++ CMakeModules/FindGSL.cmake
@@ -27,33 +27,33 @@
 find_library(GSL_LIBRARY NAMES gsl HINTS ${PC_GSL_LIBRARY_DIRS} )

 #added gsl depends
-#BUG in OpenSuse (missing libgslcblas.so link libgsl.so)
+#BUG in OpenSuse (missing libgslcblas.so link in libgsl.so)
 #if (NOT BUILD_SHARED_LIBS and PC_GSL_LIBRARIES)
-if (PC_GSL_LIBRARIES AND NOT GSL_LIBRARY)
+if (PC_GSL_LIBRARIES AND NOT GSL_DEP_LIBRARY)
   list(REMOVE_ITEM PC_GSL_LIBRARIES gsl)
   foreach (LIB ${PC_GSL_LIBRARIES})
     find_library(GSL_${LIB} NAMES ${LIB} HINTS ${PC_GSL_LIBRARY_DIRS} )
-    list(APPEND GSL_LIBRARY ${GSL_${LIB}})
+    list(APPEND GSL_DEP_LIBRARY ${GSL_${LIB}})
     unset(GSL_${LIB} CACHE)
   endforeach(LIB)
-  set(GSL_LIBRARY "${GSL_LIBRARY}" CACHE FILEPATH "lib GSL and its deps" FORCE)
-endif (PC_GSL_LIBRARIES AND NOT GSL_LIBRARY)
+  set(GSL_DEP_LIBRARY "${GSL_DEP_LIBRARY}" CACHE FILEPATH "GSL dep libs" FORCE)
+endif (PC_GSL_LIBRARIES AND NOT GSL_DEP_LIBRARY)
 #endif (NOT BUILD_SHARED_LIBS and PC_GSL_LIBRARIES)

 include(FindPackageHandleStandardArgs)
 # handle the QUIETLY and REQUIRED arguments and set GSL_FOUND to TRUE
 # if all listed variables are TRUE
-find_package_handle_standard_args(GSL DEFAULT_MSG GSL_LIBRARY GSL_INCLUDE_DIR )
+find_package_handle_standard_args(GSL DEFAULT_MSG GSL_LIBRARY GSL_INCLUDE_DIR GSL_DEP_LIBRARY )
+
+set(GSL_LIBRARIES "${GSL_LIBRARY};${GSL_DEP_LIBRARY}")
+set(GSL_INCLUDE_DIRS ${GSL_INCLUDE_DIR} )

 if (GSL_FOUND)
   include(CheckLibraryExists)
-  check_library_exists("${GSL_LIBRARY}" gsl_linalg_QR_decomp "" FOUND_QR_DECOMP)
+  check_library_exists("${GSL_LIBRARIES}" gsl_linalg_QR_decomp "" FOUND_QR_DECOMP)
   if(NOT FOUND_QR_DECOMP)
-    message(FATAL_ERROR "Could not find gsl_linalg_QR_decompx in ${GSL_LIBRARY}, take a look at the error message in ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log to find out what was going wrong. If you don't have pkg-config installed you will most likely have to set GSL_LIBRARY by hand and include libgslcblas and libm in there (i.e. -DGSL_LIBRARY='/path/to/libgsl.so;/path/to/libgslcblas.so;/path/to/libm.so') !")
+    message(FATAL_ERROR "Could not find gsl_linalg_QR_decompx in ${GSL_LIBRARIES}, take a look at the error message in ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log to find out what was going wrong. If you don't have pkg-config installed you will most likely have to set GSL_LIBRARY by hand and include libgslcblas and libm in there (i.e. -DGSL_LIBRARY='/path/to/libgsl.so;/path/to/libgslcblas.so;/path/to/libm.so') !")
   endif(NOT FOUND_QR_DECOMP)
 endif (GSL_FOUND)

-set(GSL_LIBRARIES ${GSL_LIBRARY} )
-set(GSL_INCLUDE_DIRS ${GSL_INCLUDE_DIR} )
-
 mark_as_advanced(GSL_INCLUDE_DIR GSL_LIBRARY)


Renamed -DMPI as it conflicts with MPI header.

git-svn-id: b7791fb0f5d07d96612766859ad70a13be88ea96@2907 305cdda6-5ce1-45b3-a98d-dfc68c8b3305

--- library/NektarCommon.cmake
+++ library/NektarCommon.cmake
@@ -93,7 +93,7 @@
     IF (MPI_SYNC)
         ADD_DEFINITIONS(-DMPI_SYNC)
     ENDIF (MPI_SYNC)
-    ADD_DEFINITIONS(-DMPI)
+    ADD_DEFINITIONS(-DNEKTAR_USE_MPI)
 ENDIF( NEKTAR_USE_MPI )

 IF( NEKTAR_USE_MKL )


New version: 0.3.9

New version: 0.3.9

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


Bumping version for 1.1 development

Bumping version for 1.1 development

--- Version.cmake
+++ Version.cmake
@@ -9,7 +9,7 @@
 # Version info

 set(SimpleITK_VERSION_MAJOR 1)
-set(SimpleITK_VERSION_MINOR 0)
+set(SimpleITK_VERSION_MINOR 1)
 set(SimpleITK_VERSION_PATCH 0)
 #set(SimpleITK_VERSION_TWEAK "")


Working LDFLAGS

Working LDFLAGS

--- SuperBuild/CMake/External_gdal.cmake
+++ SuperBuild/CMake/External_gdal.cmake
@@ -52,7 +52,7 @@
   #we don't do any framework build on osx. So let's be sure on case of gdal
   if(APPLE)
     list(APPEND GDAL_SB_CONFIG "--with-macosx-framework=no")
-    list(APPEND GDAL_SB_CONFIG "LDFLAGS=-headerpad")
+    list(APPEND GDAL_SB_CONFIG "LDFLAGS=-headerpad_max_install_names")
   endif()

   # PATCH_COMMAND ${CMAKE_COMMAND} -E touch ${GDAL_SB_SRC}/config.rpath


ice40: Optimising chipdb builds

ice40: Optimising chipdb builds

Signed-off-by: David Shah <4be9b043912c80de45ffb490ebd07e45bc0fcd34@gmail.com>

--- ice40/family.cmake
+++ ice40/family.cmake
@@ -10,6 +10,7 @@
 set(DB_PY ${CMAKE_CURRENT_SOURCE_DIR}/ice40/chipdb.py)
 file(MAKE_DIRECTORY ice40/chipdbs/)
 add_library(ice40_chipdb OBJECT ice40/chipdbs/)
+target_compile_options(ice40_chipdb PRIVATE -g0 -O0 -w)
 target_include_directories(ice40_chipdb PRIVATE ${family}/)
 foreach (dev ${devices})
     set(DEV_TXT_DB /usr/local/share/icebox/chipdb-${dev}.txt)


fixed cmake when run from outside olxrootdir

--- CMakeOlxCommon.cmake
+++ CMakeOlxCommon.cmake
@@ -228,7 +228,7 @@
 ELSE(WIN32)
 	ADD_DEFINITIONS(-Wall)

-	EXEC_PROGRAM(sh ARGS ${OLXROOTDIR}/get_version.sh OUTPUT_VARIABLE OLXVER)
+	EXEC_PROGRAM(sh ARGS ${CMAKE_CURRENT_SOURCE_DIR}/get_version.sh OUTPUT_VARIABLE OLXVER)
 	string(REGEX REPLACE "[\r\n]" " " OLXVER "${OLXVER}")
 	MESSAGE( "OLX_VERSION = ${OLXVER}" )


Added missing scrip to rpm spec.

Added missing scrip to rpm spec.

--- install_java.cmake
+++ install_java.cmake
@@ -24,6 +24,7 @@
 install_fat_java_artifact(simplemetrics)
 install_fat_java_artifact(vespaclient-container-plugin)

+vespa_install_script(standalone-container/src/main/sh/jdisc_container_start bin)
 vespa_install_script(jdisc_core/src/main/perl/jdisc_logfmt bin)
 install(FILES jdisc_core/src/main/perl/jdisc_logfmt.1 DESTINATION man/man1)


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/kwsys/kwsysDateStamp.cmake
@@ -7,4 +7,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 09)

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/kwsys/kwsysDateStamp.cmake
@@ -7,4 +7,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 01)

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/kwsys/kwsysDateStamp.cmake
@@ -18,4 +18,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 12)

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/kwsys/kwsysDateStamp.cmake
@@ -7,4 +7,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 03)

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/kwsys/kwsysDateStamp.cmake
@@ -7,4 +7,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 04)

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/kwsys/kwsysDateStamp.cmake
@@ -18,4 +18,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 09)

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/kwsys/kwsysDateStamp.cmake
@@ -18,4 +18,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 05)

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/kwsys/kwsysDateStamp.cmake
@@ -7,4 +7,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 09)

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/kwsys/kwsysDateStamp.cmake
@@ -18,4 +18,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 03)

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/kwsys/kwsysDateStamp.cmake
@@ -18,4 +18,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 09)

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


treat all warnings as errors for GCC (-Werror)

--- googletest/cmake/internal_utils.cmake
+++ googletest/cmake/internal_utils.cmake
@@ -94,7 +94,7 @@
     set(cxx_no_exception_flags "-D_HAS_EXCEPTIONS=0")
     set(cxx_no_rtti_flags "-GR-")
   elseif (CMAKE_COMPILER_IS_GNUCXX)
-    set(cxx_base_flags "-Wall -Wshadow")
+    set(cxx_base_flags "-Wall -Wshadow -Werror")
     set(cxx_exception_flags "-fexceptions")
     set(cxx_no_exception_flags "-fno-exceptions")
     # Until version 4.3.2, GCC doesn't define a macro to indicate


Update Eq/Co version map

Update Eq/Co version map

--- FindEqualizer.cmake
+++ FindEqualizer.cmake
@@ -198,6 +198,7 @@
   find_package_handle_standard_args(Equalizer DEFAULT_MSG
                                     _eq_LIBRARY _eq_INCLUDE_DIR)
   # Matching Collage versions
+  set(_eq_coVersion_1.3.2 "0.5.2")
   set(_eq_coVersion_1.3.1 "0.5.1")
   set(_eq_coVersion_1.3.0 "0.5.0")
   set(_eq_coVersion_1.2.1 "0.4.8")


Add recursion depth argument

Add recursion depth argument

--- cmake/DevBaseLinkcheckerMacro.cmake
+++ cmake/DevBaseLinkcheckerMacro.cmake
@@ -36,7 +36,11 @@

         add_custom_command(
             OUTPUT ${destination_pathname}
-            COMMAND ${LINKCHECKER_EXECUTABLE} ${source_pathname}
+            COMMAND ${LINKCHECKER_EXECUTABLE}
+                # We are only interested in the links in the current file,
+                # not in the links in linked files.
+                --recursion-level=1
+                ${source_pathname}
             COMMAND ${CMAKE_COMMAND} -E touch ${destination_pathname}
             DEPENDS ${source_pathname}
         )


Open64 supports -msse4.1 but does not have smmintrin.h - work around such issues generically in the buildsystem

--- cmake/OptimizeForArchitecture.cmake
+++ cmake/OptimizeForArchitecture.cmake
@@ -1,5 +1,6 @@
 get_filename_component(_currentDir "${CMAKE_CURRENT_LIST_FILE}" PATH)
 include("${_currentDir}/AddCompilerFlag.cmake")
+include(CheckIncludeFile)

 macro(_my_find _list _value _ret)
    list(FIND ${_list} "${_value}" _found)
@@ -340,7 +341,42 @@
             endif(_good)
          endforeach(_flag)
          foreach(_flag ${_enable_vector_unit_list})
-            AddCompilerFlag("-m${_flag}" CXX_FLAGS Vc_ARCHITECTURE_FLAGS)
+            AddCompilerFlag("-m${_flag}" CXX_RESULT _result)
+            if(_result)
+               set(_header FALSE)
+               if(_flag STREQUAL "sse3")
+                  set(_header "pmmintrin.h")
+               elseif(_flag STREQUAL "ssse3")
+                  set(_header "tmmintrin.h")
+               elseif(_flag STREQUAL "sse4.1")
+                  set(_header "smmintrin.h")
+               elseif(_flag STREQUAL "sse4.2")
+                  set(_header "smmintrin.h")
+               elseif(_flag STREQUAL "sse4a")
+                  set(_header "ammintrin.h")
+               elseif(_flag STREQUAL "avx")
+                  set(_header "immintrin.h")
+               elseif(_flag STREQUAL "fma4")
+                  set(_header "fma4intrin.h")
+               elseif(_flag STREQUAL "xop")
+                  set(_header "xopintrin.h")
+               endif()
+               set(_resultVar "HAVE_${_header}")
+               string(REPLACE "." "_" _resultVar "${_resultVar}")
+               if(_header)
+                  CHECK_INCLUDE_FILE("${_header}" ${_resultVar} "-m${_flag}")
+                  if(NOT ${_resultVar})
+                     set(_useVar "USE_${_flag}")
+                     string(TOUPPER "${_useVar}" _useVar)
+                     string(REPLACE "." "_" _useVar "${_useVar}")
+                     message(STATUS "disabling ${_useVar} because ${_header} is missing")
+                     set(${_useVar} FALSE)
+                  endif()
+               endif()
+               if(NOT _header OR ${_resultVar})
+                  set(Vc_ARCHITECTURE_FLAGS "${Vc_ARCHITECTURE_FLAGS} -m${_flag}")
+               endif()
+            endif()
          endforeach(_flag)
          foreach(_flag ${_disable_vector_unit_list})
             AddCompilerFlag("-mno-${_flag}" CXX_FLAGS Vc_ARCHITECTURE_FLAGS)


cmake: Detect FMA and BMI2 and set relevant cmake variables

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

--- cmake/OptimizeForArchitecture.cmake
+++ cmake/OptimizeForArchitecture.cmake
@@ -308,9 +308,12 @@
          set(AVX_FOUND false)
          set(XOP_FOUND false)
          set(FMA4_FOUND false)
+         set(FMA_FOUND false)
          set(AVX2_FOUND false)
+         set(BMI2_FOUND false)
       else()
          _my_find(_available_vector_units_list "avx" AVX_FOUND)
+         _my_find(_available_vector_units_list "fma" FMA_FOUND)
          if(DEFINED Vc_FMA4_INTRINSICS_BROKEN AND Vc_FMA4_INTRINSICS_BROKEN)
             UserWarning("FMA4 disabled per default because of old/broken compiler")
             set(FMA4_FOUND false)
@@ -329,6 +332,7 @@
          else()
             _my_find(_available_vector_units_list "avx2" AVX2_FOUND)
          endif()
+         _my_find(_available_vector_units_list "bmi2" BMI2_FOUND)
       endif()
       set(USE_SSE2   ${SSE2_FOUND}   CACHE BOOL "Use SSE2. If SSE2 instructions are not enabled the SSE implementation will be disabled." ${_force})
       set(USE_SSE3   ${SSE3_FOUND}   CACHE BOOL "Use SSE3. If SSE3 instructions are not enabled they will be emulated." ${_force})
@@ -336,11 +340,13 @@
       set(USE_SSE4_1 ${SSE4_1_FOUND} CACHE BOOL "Use SSE4.1. If SSE4.1 instructions are not enabled they will be emulated." ${_force})
       set(USE_SSE4_2 ${SSE4_2_FOUND} CACHE BOOL "Use SSE4.2. If SSE4.2 instructions are not enabled they will be emulated." ${_force})
       set(USE_SSE4a  ${SSE4a_FOUND}  CACHE BOOL "Use SSE4a. If SSE4a instructions are not enabled they will be emulated." ${_force})
-      set(USE_AVX    ${AVX_FOUND}    CACHE BOOL "Use AVX. This will double some of the vector sizes relative to SSE." ${_force})
+      set(USE_AVX    ${AVX_FOUND}    CACHE BOOL "Use AVX. This will all floating-point vector sizes relative to SSE." ${_force})
       set(USE_AVX2   ${AVX2_FOUND}   CACHE BOOL "Use AVX2. This will double all of the vector sizes relative to SSE." ${_force})
       set(USE_XOP    ${XOP_FOUND}    CACHE BOOL "Use XOP." ${_force})
+      set(USE_FMA    ${FMA_FOUND}    CACHE BOOL "Use FMA." ${_force})
       set(USE_FMA4   ${FMA4_FOUND}   CACHE BOOL "Use FMA4." ${_force})
-      mark_as_advanced(USE_SSE2 USE_SSE3 USE_SSSE3 USE_SSE4_1 USE_SSE4_2 USE_SSE4a USE_AVX USE_AVX2 USE_XOP USE_FMA4)
+      set(USE_BMI2   ${BMI2_FOUND}   CACHE BOOL "Use BMI2." ${_force})
+      mark_as_advanced(USE_SSE2 USE_SSE3 USE_SSSE3 USE_SSE4_1 USE_SSE4_2 USE_SSE4a USE_AVX USE_AVX2 USE_XOP USE_FMA USE_FMA4 USE_BMI2)
       if(USE_SSE2)
          list(APPEND _enable_vector_unit_list "sse2")
       else(USE_SSE2)
@@ -385,6 +391,11 @@
       else()
          list(APPEND _disable_vector_unit_list "xop")
       endif()
+      if(USE_FMA)
+         list(APPEND _enable_vector_unit_list "fma")
+      else()
+         list(APPEND _disable_vector_unit_list "fma")
+      endif()
       if(USE_FMA4)
          list(APPEND _enable_vector_unit_list "fma4")
       else()
@@ -394,6 +405,11 @@
          list(APPEND _enable_vector_unit_list "avx2")
       else()
          list(APPEND _disable_vector_unit_list "avx2")
+      endif()
+      if(USE_BMI2)
+         list(APPEND _enable_vector_unit_list "bmi2")
+      else()
+         list(APPEND _disable_vector_unit_list "bmi2")
       endif()
       if(MSVC)
          # MSVC on 32 bit can select /arch:SSE2 (since 2010 also /arch:AVX)


adding use of global glfw again

adding use of global glfw again

--- cmake/mtao_fetch_dependencies.cmake
+++ cmake/mtao_fetch_dependencies.cmake
@@ -28,7 +28,7 @@
         find_package(Eigen3 REQUIRED)
 ENDIF()
 if(MTAO_USE_OPENGL)
-    #find_package(GLFW)
+    find_package(GLFW)
     if(GLFW_FOUND)
     message(STATUS "GLFW exists!")
     else()


Improve PackageConfig output

Improve PackageConfig output

--- PackageConfig.cmake
+++ PackageConfig.cmake
@@ -122,8 +122,8 @@
   "      if(\${_LIBRARYNAME}_LIBRARY MATCHES \"\${_LIBRARYNAME}_LIBRARY-NOTFOUND\")\n"
   "        set(_fail \"\${_libraryname} not found\")\n"
   "        if(_out)\n"
-  "          message(\${_output_type} \"   Missing the ${CMAKE_PROJECT_NAME} \"\n"
-  "            \"library in \${${CMAKE_PROJECT_NAME}_PREFIX_DIR}/lib.\")\n"
+  "          message(\${_output_type}\n"
+  "            \"   Missing \${_libraryname} in \${${CMAKE_PROJECT_NAME}_PREFIX_DIR}/lib\")\n"
   "        endif()\n"
   "      else()\n"
   "        list(APPEND ${UPPER_PROJECT_NAME}_LIBRARIES \${\${_LIBRARYNAME}_LIBRARY})\n"


replace tab with 4-space

replace tab with 4-space

--- bin/dsn.cmake
+++ bin/dsn.cmake
@@ -1,14 +1,14 @@
 function(ms_add_project PROJ_LANG PROJ_TYPE PROJ_NAME PROJ_SRC PROJ_INC_PATH PROJ_LIBS PROJ_LIB_PATH PROJ_BINPLACES DO_INSTALL)
-	if(DEFINED DSN_DEBUG_CMAKE)
+    if(DEFINED DSN_DEBUG_CMAKE)
         message(STATUS "PROJ_LANG = ${PROJ_LANG}")
         message(STATUS "PROJ_TYPE = ${PROJ_TYPE}")
-    	message(STATUS "PROJ_NAME = ${PROJ_NAME}")
-    	message(STATUS "PROJ_SRC = ${PROJ_SRC}")
-    	message(STATUS "PROJ_INC_PATH = ${PROJ_INC_PATH}")
-    	message(STATUS "PROJ_LIBS = ${PROJ_LIBS}")
-    	message(STATUS "PROJ_LIB_PATH = ${PROJ_LIB_PATH}")
-    	message(STATUS "PROJ_BINPLACES = ${PROJ_BINPLACES}")
-    	message(STATUS "DO_INSTALL = ${DO_INSTALL}")
+        message(STATUS "PROJ_NAME = ${PROJ_NAME}")
+        message(STATUS "PROJ_SRC = ${PROJ_SRC}")
+        message(STATUS "PROJ_INC_PATH = ${PROJ_INC_PATH}")
+        message(STATUS "PROJ_LIBS = ${PROJ_LIBS}")
+        message(STATUS "PROJ_LIB_PATH = ${PROJ_LIB_PATH}")
+        message(STATUS "PROJ_BINPLACES = ${PROJ_BINPLACES}")
+        message(STATUS "DO_INSTALL = ${DO_INSTALL}")
     endif()

     if(PROJ_LANG STREQUAL "")
@@ -28,16 +28,16 @@
         message(FATAL_ERROR "No source files.")
     endif()

-	set(INSTALL_DIR "lib")
-	if(PROJ_TYPE STREQUAL "EXECUTABLE")
-		set(INSTALL_DIR "bin/${PROJ_NAME}")
-		set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${PROJ_NAME}")
-		set(OUTPUT_DIRECTORY "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}")
-	elseif(PROJ_TYPE STREQUAL "STATIC")
-		set(OUTPUT_DIRECTORY "${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}")
-	elseif(PROJ_TYPE STREQUAL "SHARED")
-		set(OUTPUT_DIRECTORY "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}")
-	endif()
+    set(INSTALL_DIR "lib")
+    if(PROJ_TYPE STREQUAL "EXECUTABLE")
+        set(INSTALL_DIR "bin/${PROJ_NAME}")
+        set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${PROJ_NAME}")
+        set(OUTPUT_DIRECTORY "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}")
+    elseif(PROJ_TYPE STREQUAL "STATIC")
+        set(OUTPUT_DIRECTORY "${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}")
+    elseif(PROJ_TYPE STREQUAL "SHARED")
+        set(OUTPUT_DIRECTORY "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}")
+    endif()

     if(DEFINED DSN_DEBUG_CMAKE)
         message(STATUS "OUTPUT_DIRECTORY = ${OUTPUT_DIRECTORY}")
@@ -67,7 +67,7 @@

         if((PROJ_TYPE STREQUAL "SHARED") OR (PROJ_TYPE STREQUAL "EXECUTABLE"))
             if(PROJ_TYPE STREQUAL "SHARED")
-    		    set(LINK_MODE PRIVATE)
+                set(LINK_MODE PRIVATE)
             else()
                 set(LINK_MODE PUBLIC)
             endif()
@@ -80,18 +80,18 @@
     endif()

     if(PROJ_LANG STREQUAL "CS")
-		set(MY_PROJ_SRC "${PROJ_SRC}")
-		set(MY_OUTPUT_DIRECTORY "${OUTPUT_DIRECTORY}")
-		set(MY_CURRENT_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
-		if(MSVC)
-			file(TO_NATIVE_PATH "${MY_PROJ_SRC}" MY_PROJ_SRC)
-			file(TO_NATIVE_PATH "${MY_OUTPUT_DIRECTORY}" MY_OUTPUT_DIRECTORY)
-			file(TO_NATIVE_PATH "${MY_CURRENT_SOURCE_DIR}" MY_CURRENT_SOURCE_DIR)
-		endif()
+        set(MY_PROJ_SRC "${PROJ_SRC}")
+        set(MY_OUTPUT_DIRECTORY "${OUTPUT_DIRECTORY}")
+        set(MY_CURRENT_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
+        if(MSVC)
+            file(TO_NATIVE_PATH "${MY_PROJ_SRC}" MY_PROJ_SRC)
+            file(TO_NATIVE_PATH "${MY_OUTPUT_DIRECTORY}" MY_OUTPUT_DIRECTORY)
+            file(TO_NATIVE_PATH "${MY_CURRENT_SOURCE_DIR}" MY_CURRENT_SOURCE_DIR)
+        endif()
         configure_file("${PROJ_NAME}.csproj.template" "${PROJ_NAME}.csproj")
         include_external_msproject(
             "${PROJ_NAME}"
-			"${CMAKE_CURRENT_BINARY_DIR}/${PROJ_NAME}.csproj"
+            "${CMAKE_CURRENT_BINARY_DIR}/${PROJ_NAME}.csproj"
             TYPE FAE04EC0-301F-11D3-BF4B-00C04F79EFBC
             )
         if(MSVC)
@@ -202,51 +202,51 @@
 endfunction(ms_check_cxx11_support)

 macro(ms_find_source_files LANG SOURCE_DIR GLOB_OPTION PROJ_SRC)
-	set(TEMP_PROJ_SRC "")
+    set(TEMP_PROJ_SRC "")
     if(${LANG} STREQUAL "CXX")
         file(${GLOB_OPTION}
             TEMP_PROJ_SRC
             "${SOURCE_DIR}/*.cpp"
-		    "${SOURCE_DIR}/*.cc"
-		    "${SOURCE_DIR}/*.c"
-		    "${SOURCE_DIR}/*.h"
-		    "${SOURCE_DIR}/*.hpp"
+            "${SOURCE_DIR}/*.cc"
+            "${SOURCE_DIR}/*.c"
+            "${SOURCE_DIR}/*.h"
+            "${SOURCE_DIR}/*.hpp"
             )
-	elseif(${LANG} STREQUAL "CS")
+    elseif(${LANG} STREQUAL "CS")
         file(${GLOB_OPTION}
             TEMP_PROJ_SRC
             "${SOURCE_DIR}/*.cs"
-			)
-	endif()
-
-	if(DEFINED DSN_DEBUG_CMAKE)
-		message(STATUS "LANG = ${LANG}")
-		message(STATUS "SOURCE_DIR = ${SOURCE_DIR}")
-		message(STATUS "GLOB_OPTION = ${GLOB_OPTION}")
-		message(STATUS "PROJ_SRC = ${${PROJ_SRC}}")
-	endif()
-
-	set(${PROJ_SRC} ${${PROJ_SRC}} ${TEMP_PROJ_SRC})
+            )
+    endif()
+
+    if(DEFINED DSN_DEBUG_CMAKE)
+        message(STATUS "LANG = ${LANG}")
+        message(STATUS "SOURCE_DIR = ${SOURCE_DIR}")
+        message(STATUS "GLOB_OPTION = ${GLOB_OPTION}")
+        message(STATUS "PROJ_SRC = ${${PROJ_SRC}}")
+    endif()
+
+    set(${PROJ_SRC} ${${PROJ_SRC}} ${TEMP_PROJ_SRC})
 endmacro(ms_find_source_files)

 function(dsn_add_project)
-	if((NOT DEFINED MY_PROJ_LANG) OR (MY_PROJ_LANG STREQUAL ""))
-		message(FATAL_ERROR "MY_PROJ_LANG is empty.")
-    endif()
-	if((NOT DEFINED MY_PROJ_TYPE) OR (MY_PROJ_TYPE STREQUAL ""))
-		message(FATAL_ERROR "MY_PROJ_TYPE is empty.")
-    endif()
-	if((NOT DEFINED MY_PROJ_NAME) OR (MY_PROJ_NAME STREQUAL ""))
+    if((NOT DEFINED MY_PROJ_LANG) OR (MY_PROJ_LANG STREQUAL ""))
+        message(FATAL_ERROR "MY_PROJ_LANG is empty.")
+    endif()
+    if((NOT DEFINED MY_PROJ_TYPE) OR (MY_PROJ_TYPE STREQUAL ""))
+        message(FATAL_ERROR "MY_PROJ_TYPE is empty.")
+    endif()
+    if((NOT DEFINED MY_PROJ_NAME) OR (MY_PROJ_NAME STREQUAL ""))
         message(FATAL_ERROR "MY_PROJ_NAME is empty.")
     endif()
-	if(NOT DEFINED MY_SRC_SEARCH_MODE)
-		set(MY_SRC_SEARCH_MODE "GLOB")
-	endif()
+    if(NOT DEFINED MY_SRC_SEARCH_MODE)
+        set(MY_SRC_SEARCH_MODE "GLOB")
+    endif()
     if(NOT DEFINED MY_PROJ_SRC)
         set(MY_PROJ_SRC "")
     endif()
     set(TEMP_SRC "")
-	ms_find_source_files("${MY_PROJ_LANG}" "${CMAKE_CURRENT_SOURCE_DIR}" ${MY_SRC_SEARCH_MODE} TEMP_SRC)
+    ms_find_source_files("${MY_PROJ_LANG}" "${CMAKE_CURRENT_SOURCE_DIR}" ${MY_SRC_SEARCH_MODE} TEMP_SRC)
     set(MY_PROJ_SRC ${TEMP_SRC} ${MY_PROJ_SRC})
     if(NOT DEFINED MY_PROJ_INC_PATH)
         set(MY_PROJ_INC_PATH "")
@@ -263,15 +263,15 @@
     if(NOT DEFINED MY_BOOST_PACKAGES)
         set(MY_BOOST_PACKAGES "")
     endif()
-	if(NOT DEFINED MY_DO_INSTALL)
-		if(DSN_BUILD_RUNTIME AND (MY_PROJ_TYPE STREQUAL "EXECUTABLE"))
-			set(MY_DO_INSTALL FALSE)
-		else()
-			set(MY_DO_INSTALL TRUE)
-		endif()
-	endif()
-
-	if(MY_PROJ_LANG STREQUAL "CXX")
+    if(NOT DEFINED MY_DO_INSTALL)
+        if(DSN_BUILD_RUNTIME AND (MY_PROJ_TYPE STREQUAL "EXECUTABLE"))
+            set(MY_DO_INSTALL FALSE)
+        else()
+            set(MY_DO_INSTALL TRUE)
+        endif()
+    endif()
+
+    if(MY_PROJ_LANG STREQUAL "CXX")
         set(MY_BOOST_LIBS "")
         if(NOT (MY_BOOST_PACKAGES STREQUAL ""))
             ms_setup_boost(TRUE "${MY_BOOST_PACKAGES}" MY_BOOST_LIBS)
@@ -284,20 +284,20 @@
                 set(TEMP_LIBS dsn.dev.cpp dsn.core)
             endif()
             set(MY_PROJ_LIBS ${MY_PROJ_LIBS} ${MY_BOOST_LIBS} ${TEMP_LIBS})
-			#message(STATUS "MY_PROJ_LIBS = ${MY_PROJ_LIBS}")
+            #message(STATUS "MY_PROJ_LIBS = ${MY_PROJ_LIBS}")
         endif()
      endif()

     if(DEFINED DSN_DEBUG_CMAKE)
-    	message(STATUS "MY_PROJ_TYPE = ${MY_PROJ_TYPE}")
-    	message(STATUS "MY_PROJ_NAME = ${MY_PROJ_NAME}")
-    	message(STATUS "MY_PROJ_SRC = ${MY_PROJ_SRC}")
-		message(STATUS "MY_SRC_SEARCH_MODE = ${MY_SRC_SEARCH_MODE}")
-    	message(STATUS "MY_PROJ_INC_PATH = ${MY_PROJ_INC_PATH}")
-    	message(STATUS "MY_PROJ_LIBS = ${MY_PROJ_LIBS}")
-    	message(STATUS "MY_PROJ_LIB_PATH = ${MY_PROJ_LIB_PATH}")
-    	message(STATUS "MY_PROJ_BINPLACES = ${MY_PROJ_BINPLACES}")
-    	message(STATUS "MY_DO_INSTALL = ${MY_DO_INSTALL}")
+        message(STATUS "MY_PROJ_TYPE = ${MY_PROJ_TYPE}")
+        message(STATUS "MY_PROJ_NAME = ${MY_PROJ_NAME}")
+        message(STATUS "MY_PROJ_SRC = ${MY_PROJ_SRC}")
+        message(STATUS "MY_SRC_SEARCH_MODE = ${MY_SRC_SEARCH_MODE}")
+        message(STATUS "MY_PROJ_INC_PATH = ${MY_PROJ_INC_PATH}")
+        message(STATUS "MY_PROJ_LIBS = ${MY_PROJ_LIBS}")
+        message(STATUS "MY_PROJ_LIB_PATH = ${MY_PROJ_LIB_PATH}")
+        message(STATUS "MY_PROJ_BINPLACES = ${MY_PROJ_BINPLACES}")
+        message(STATUS "MY_DO_INSTALL = ${MY_DO_INSTALL}")
         message(STATUS "MY_BOOST_PACKAGES = ${MY_BOOST_PACKAGES}")
         message(STATUS "MY_BOOST_LIBS = ${MY_BOOST_LIBS}")
     endif()
@@ -306,32 +306,32 @@
 endfunction(dsn_add_project)

 function(dsn_add_cs_shared_library)
-	set(MY_PROJ_LANG "CS")
-	set(MY_PROJ_TYPE "SHARED")
+    set(MY_PROJ_LANG "CS")
+    set(MY_PROJ_TYPE "SHARED")
     dsn_add_project()
 endfunction(dsn_add_cs_shared_library)

 function(dsn_add_cs_executable)
-	set(MY_PROJ_LANG "CS")
-	set(MY_PROJ_TYPE "EXECUTABLE")
+    set(MY_PROJ_LANG "CS")
+    set(MY_PROJ_TYPE "EXECUTABLE")
     dsn_add_project()
 endfunction(dsn_add_cs_executable)

 function(dsn_add_static_library)
-	set(MY_PROJ_LANG "CXX")
-	set(MY_PROJ_TYPE "STATIC")
+    set(MY_PROJ_LANG "CXX")
+    set(MY_PROJ_TYPE "STATIC")
     dsn_add_project()
 endfunction(dsn_add_static_library)

 function(dsn_add_shared_library)
-	set(MY_PROJ_LANG "CXX")
-	set(MY_PROJ_TYPE "SHARED")
+    set(MY_PROJ_LANG "CXX")
+    set(MY_PROJ_TYPE "SHARED")
     dsn_add_project()
 endfunction(dsn_add_shared_library)

 function(dsn_add_executable)
-	set(MY_PROJ_LANG "CXX")
-	set(MY_PROJ_TYPE "EXECUTABLE")
+    set(MY_PROJ_LANG "CXX")
+    set(MY_PROJ_TYPE "EXECUTABLE")
     dsn_add_project()
 endfunction(dsn_add_executable)

@@ -357,7 +357,7 @@
         add_definitions(-D_WIN32_WINNT=0x0501)
         add_definitions(-D_UNICODE)
         add_definitions(-DUNICODE)
-		add_compile_options(-MP)
+        add_compile_options(-MP)
         if(DEFINED DSN_PEDANTIC)
             add_compile_options(-WX)
         endif()
@@ -396,24 +396,24 @@
     find_package(Threads REQUIRED)

     set(DSN_SYSTEM_LIBS "")
-	if(FALSE)
+    if(FALSE)
     if(UNIX AND (NOT APPLE))
-		find_library(DSN_LIB_RT NAMES librt.a rt)
-		if(DSN_LIB_RT STREQUAL "")
-			message(WARNING "Cannot find library rt.")
-			set(DSN_LIB_RT rt)
-		endif()
-		set(DSN_LIB_RT rt)
-		set(DSN_SYSTEM_LIBS ${DSN_SYSTEM_LIBS} ${DSN_LIB_RT})
-    endif()
-	if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
-		find_library(DSN_LIB_AIO NAMES libaio.a aio)
-		if(DSN_LIB_AIO STREQUAL "")
-			message(WARNING "Cannot find library aio.")
-			set(DSN_LIB_AIO aio)
-		endif()
-		set(DSN_LIB_AIO aio)
-		set(DSN_SYSTEM_LIBS ${DSN_SYSTEM_LIBS} ${DSN_LIB_AIO})
+        find_library(DSN_LIB_RT NAMES librt.a rt)
+        if(DSN_LIB_RT STREQUAL "")
+            message(WARNING "Cannot find library rt.")
+            set(DSN_LIB_RT rt)
+        endif()
+        set(DSN_LIB_RT rt)
+        set(DSN_SYSTEM_LIBS ${DSN_SYSTEM_LIBS} ${DSN_LIB_RT})
+    endif()
+    if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
+        find_library(DSN_LIB_AIO NAMES libaio.a aio)
+        if(DSN_LIB_AIO STREQUAL "")
+            message(WARNING "Cannot find library aio.")
+            set(DSN_LIB_AIO aio)
+        endif()
+        set(DSN_LIB_AIO aio)
+        set(DSN_SYSTEM_LIBS ${DSN_SYSTEM_LIBS} ${DSN_LIB_AIO})
     endif()
     endif()

@@ -494,14 +494,14 @@
     if(NOT DEFINED DSN_BUILD_RUNTIME)
         set(DSN_BUILD_RUNTIME FALSE)
     endif()
-
-	message (STATUS "Installation directory: CMAKE_INSTALL_PREFIX = " ${CMAKE_INSTALL_PREFIX})
-	set(DSN_ROOT2 "$ENV{DSN_ROOT}")
-	if((EXISTS "${DSN_ROOT2}/"))
-		set(CMAKE_INSTALL_PREFIX ${DSN_ROOT2} CACHE STRING "" FORCE)
-		message (STATUS "Installation directory redefined w/ ENV{DSN_ROOT}: " ${CMAKE_INSTALL_PREFIX})
-	endif()
-
+
+    message (STATUS "Installation directory: CMAKE_INSTALL_PREFIX = " ${CMAKE_INSTALL_PREFIX})
+    set(DSN_ROOT2 "$ENV{DSN_ROOT}")
+    if((EXISTS "${DSN_ROOT2}/"))
+        set(CMAKE_INSTALL_PREFIX ${DSN_ROOT2} CACHE STRING "" FORCE)
+        message (STATUS "Installation directory redefined w/ ENV{DSN_ROOT}: " ${CMAKE_INSTALL_PREFIX})
+    endif()
+
     set(BUILD_SHARED_LIBS OFF)
     dsn_setup_version()
     ms_check_cxx11_support()


Better Architecture detection strategy if compiling on Apple Silicon

--- Tools/CMake/torque3d.cmake
+++ Tools/CMake/torque3d.cmake
@@ -745,14 +745,13 @@
     set(ARCHITECTURE_STRING_APPLE "x86_64;arm64")
     set(DEPLOYMENT_TARGET_APPLE "10.13")
   else()
-    check_c_compiler_flag("-arch arm64" armSupportedApple)
-    if(armSupportedApple)
+    if (CMAKE_SYSTEM_PROCESSOR MATCHES "arm64")
       set(ARCHITECTURE_STRING_APPLE "arm64")
       set(DEPLOYMENT_TARGET_APPLE "11.0")
     else()
       set(ARCHITECTURE_STRING_APPLE "x86_64")
       set(DEPLOYMENT_TARGET_APPLE "10.9")
-    endif()
+    endif()
   endif()

   set(CMAKE_OSX_ARCHITECTURES ${ARCHITECTURE_STRING_APPLE} CACHE STRING "OSX Architecture" FORCE)


fix infovis tests

fix infovis tests

Tests segfault when vtkTextMapper::New() returned a NULL pointer.

vtkTextMapper it turns out is an interface class for which
vtkOpenGLFreeTypeTextMapper is, for now, the only implementation. There could
be other implementations, so making a hard module dependency which cmake would
resolve automatically isn't the right solution. Instead, unfortunately you
have to manually provide a dependency to Rendering/FreeTypeOpenGL.

Change-Id: I0cf1e81bd14e226d09df07b2fcddae3f3df1404e

--- Views/Infovis/module.cmake
+++ Views/Infovis/module.cmake
@@ -5,7 +5,6 @@
     vtkRenderingContext2D
     vtkViewsCore
     vtkRenderingLabel
-    vtkRenderingFreeTypeOpenGL
     vtkInfovisLayout
     vtkInteractionStyle
     vtkFiltersModeling
@@ -14,4 +13,5 @@
     vtkTestingRendering
     vtkIOInfovis
     vtkIOSQL
+    vtkRenderingFreeTypeOpenGL
   )


Disabling webkit in qt on win32

Disabling webkit in qt on win32

--- Superbuild/Projects/win32/qt.cmake
+++ Superbuild/Projects/win32/qt.cmake
@@ -21,7 +21,7 @@
                     -nomake tests
                     -qt-libjpeg
                     -qt-libtiff
-                    -webkit
+                    #-webkit
                     -xmlpatterns
                     -I <INSTALL_DIR>/include
                     -L <INSTALL_DIR>/lib


fmu-v5_optimized: disable esc_calib

fmu-v5_optimized: disable esc_calib

--- boards/px4/fmu-v5/optimized.cmake
+++ boards/px4/fmu-v5/optimized.cmake
@@ -89,7 +89,7 @@
 		config
 		dmesg
 		dumpfile
-		esc_calib
+		#esc_calib
 		hardfault_log
 		i2cdetect
 		led_control


Pushed common behavior up

Pushed common behavior up

--- cmake/modules/hunter_autotools_project.cmake
+++ cmake/modules/hunter_autotools_project.cmake
@@ -37,18 +37,29 @@
 # )

 include(ExternalProject) # ExternalProject_Add
+include(CMakeParseArguments) # cmake_parse_arguments

 include(hunter_fatal_error)
 include(hunter_status_debug)
 include(hunter_test_string_not_empty)

-include(CMakeParseArguments) # cmake_parse_arguments
-
 function(hunter_autotools_project target_name)
+
   set(optional_params)
-  set(one_value_params HUNTER_SELF URL URL_HASH DOWNLOAD_DIR SOURCE_DIR INSTALL_DIR PARALLEL_JOBS CPPFLAGS CFLAGS CXXFLAGS LDFLAGS)
+  set(one_value_params
+      HUNTER_SELF
+      URL
+      URL_HASH
+      DOWNLOAD_DIR
+      SOURCE_DIR
+      INSTALL_DIR
+      PARALLEL_JOBS
+      CPPFLAGS
+      CFLAGS
+      CXXFLAGS
+      LDFLAGS
+  )
   set(multi_value_params EXTRA_FLAGS)
-
   cmake_parse_arguments(
       PARAM
       "${optional_params}"
@@ -56,31 +67,12 @@
       "${multi_value_params}"
       ${ARGN}
   )
+
   if(PARAM_UNPARSED_ARGUMENTS)
     hunter_fatal_error(
         "Invalid arguments passed to hunter_autotools_configure:"
         " ${PARAM_UNPARSED_ARGUMENTS}"
     )
-  endif()
-
-  set(configure_opts)
-  set(_ldflags)
-  string(COMPARE NOTEQUAL "${ANDROID}" "" is_android)
-  string(COMPARE NOTEQUAL "${IOS}" "" is_ios)
-  string(COMPARE NOTEQUAL "${CROSS_COMPILE_TOOLCHAIN_PREFIX}" "" is_cross_compile)
-  if(is_android)
-    hunter_test_string_not_empty("${CMAKE_C_FLAGS}")
-    hunter_test_string_not_empty("${CMAKE_CXX_FLAGS}")
-    #AWP: in theory, lots of other checks should be in place.
-    #  let RaspberryPi support mature so we get a better idea
-    #  of where to put them.
-    hunter_test_string_not_empty("${ANDROID_TOOLCHAIN_MACHINE_NAME}")
-    list(APPEND configure_opts --host=${ANDROID_TOOLCHAIN_MACHINE_NAME})
-    set(_ldflags "${_ldflags} ${__libstl}")
-  elseif(is_ios)
-      hunter_fatal_error("Autotools for iOS not yet supported")
-  elseif(is_cross_compile)
-    list(APPEND configure_opts --host=${CROSS_COMPILE_TOOLCHAIN_PREFIX})
   endif()

   # Sets the toolchain binaries
@@ -96,113 +88,126 @@
   #   CC=${CMAKE_C_COMPILER}
   #   CXX=${CMAKE_CXX_COMPILER}
   #
-  set(_toolchain_binaries)
+  set(toolchain_binaries)
   if(CMAKE_AR)
-    list(APPEND _toolchain_binaries AR=${CMAKE_AR})
+    list(APPEND toolchain_binaries AR=${CMAKE_AR})
   endif()
   if(CMAKE_ASM_COMPILER)
-    list(APPEND _toolchain_binaries AS=${CMAKE_ASM_COMPILER})
+    list(APPEND toolchain_binaries AS=${CMAKE_ASM_COMPILER})
   endif()
   if(CMAKE_LINKER)
-    list(APPEND _toolchain_binaries LD=${CMAKE_LINKER})
+    list(APPEND toolchain_binaries LD=${CMAKE_LINKER})
   endif()
   if(CMAKE_NM)
-    list(APPEND _toolchain_binaries NM=${CMAKE_NM})
+    list(APPEND toolchain_binaries NM=${CMAKE_NM})
   endif()
   if(CMAKE_OBJCOPY)
-    list(APPEND _toolchain_binaries OBJCOPY=${CMAKE_OBJCOPY})
+    list(APPEND toolchain_binaries OBJCOPY=${CMAKE_OBJCOPY})
   endif()
   if(CMAKE_OBJDUMP)
-    list(APPEND _toolchain_binaries OBJDUMP=${CMAKE_OBJDUMP})
+    list(APPEND toolchain_binaries OBJDUMP=${CMAKE_OBJDUMP})
   endif()
   if(CMAKE_RANLIB)
-    list(APPEND _toolchain_binaries RANLIB=${CMAKE_RANLIB})
+    list(APPEND toolchain_binaries RANLIB=${CMAKE_RANLIB})
   endif()
   if(CMAKE_STRIP)
-    list(APPEND _toolchain_binaries STRIP=${CMAKE_STRIP})
+    list(APPEND toolchain_binaries STRIP=${CMAKE_STRIP})
   endif()
   if(CMAKE_C_PREPROCESSOR)
-    list(APPEND _toolchain_binaries CPP=${CMAKE_C_PREPROCESSOR})
+    list(APPEND toolchain_binaries CPP=${CMAKE_C_PREPROCESSOR})
   endif()
   if(CMAKE_C_COMPILER)
-    list(APPEND _toolchain_binaries CC=${CMAKE_C_COMPILER})
+    list(APPEND toolchain_binaries CC=${CMAKE_C_COMPILER})
   endif()
   if(CMAKE_CXX_COMPILER)
-    list(APPEND _toolchain_binaries CXX=${CMAKE_CXX_COMPILER})
-  endif()
-
-  string(STRIP "${_toolchain_binaries}" _toolchain_binaries)
+    list(APPEND toolchain_binaries CXX=${CMAKE_CXX_COMPILER})
+  endif()
+
+  string(STRIP "${toolchain_binaries}" toolchain_binaries)
   if(HUNTER_STATUS_DEBUG)
     string(
-        REPLACE ";" "\n" _toolchain_binaries_new_line "${_toolchain_binaries}"
+        REPLACE ";" "\n" toolchain_binaries_new_line "${toolchain_binaries}"
     )
     hunter_status_debug("Toolchain Binaries:")
-    foreach(x ${_toolchain_binaries})
+    foreach(x ${toolchain_binaries})
       hunter_status_debug("  ${x}")
     endforeach()
-  endif()
-  string(COMPARE NOTEQUAL "${_toolchain_binaries}" "" has_changes)
-  if(has_changes)
-    list(APPEND configure_opts ${_toolchain_binaries})
   endif()

   # CPPFLAGS=${PARAM_CPPFLAGS} [-D${COMPILE_DEFINITIONS}]
   #          [-I${INCLUDE_DIRECTORIES}]
   #
   # C Preprocessor flags
-  set(_cppflags)
+  set(cppflags)
   get_directory_property(defs COMPILE_DEFINITIONS)
   foreach(def ${defs})
-    set(_cppflags "${_cppflags} -D${def}")
+    set(cppflags "${cppflags} -D${def}")
   endforeach()

   get_directory_property(include_dirs INCLUDE_DIRECTORIES)
   foreach(include_dir ${include_dirs})
-    set(
-        _cppflags
-        "${_cppflags} ${CMAKE_INCLUDE_SYSTEM_FLAG_CXX} ${include_dir}"
+    set(cppflags
+        "${cppflags} ${CMAKE_INCLUDE_SYSTEM_FLAG_CXX} ${include_dir}"
     )
   endforeach()

-  set(_cppflags "${_cppflags} ${PARAM_CPPFLAGS}")
-  string(STRIP "${_cppflags}" cppflags)
-  hunter_status_debug("CPPFLAGS=${_cppflags}")
-  string(COMPARE NOTEQUAL "${_cppflags}" "" has_cppflags)
-  if(has_cppflags)
-    list(APPEND configure_opts CPPFLAGS=${_cppflags})
-  endif()
+  set(cppflags "${cppflags} ${PARAM_CPPFLAGS}")
+  string(STRIP "${cppflags}" cppflags)
+  hunter_status_debug("CPPFLAGS=${cppflags}")

   # CFLAGS=${cflags} ${CMAKE_C_FLAGS}
   #
   # C Compiler Flags (defines or include directories should not be needed here)
-  set(_cflags "${CMAKE_C_FLAGS} ${PARAM_CFLAGS}")
-  string(STRIP "${_cflags}" _cflags)
-  hunter_status_debug("CFLAGS=${_cflags}")
-  string(COMPARE NOTEQUAL "${_cflags}" "" has_cflags)
-  if(has_cflags)
-    list(APPEND configure_opts CFLAGS=${_cflags})
-  endif()
+  set(cflags "${CMAKE_C_FLAGS} ${PARAM_CFLAGS}")
+  string(STRIP "${cflags}" cflags)
+  hunter_status_debug("CFLAGS=${cflags}")

   # CXXFLAGS=${cxxflags} ${CMAKE_CXX_FLAGS}
   #
   # C++ Compiler flags (defines or include directories should not be needed here)
-  set(_cxxflags "${cxxflags} ${CMAKE_CXX_FLAGS}")
-  hunter_status_debug("CXXFLAGS=${_cxxflags}")
-  string(STRIP "${_cxxflags}" _cxxflags)
-  string(COMPARE NOTEQUAL "${_cxxflags}" "" has_cxxflags)
-  if(has_cxxflags)
-    list(APPEND configure_opts CXXFLAGS=${_cxxflags})
-  endif()
+  set(cxxflags "${CMAKE_CXX_FLAGS} ${PARAM_CXXFLAGS}")
+  string(STRIP "${cxxflags}" cxxflags)
+  hunter_status_debug("CXXFLAGS=${cxxflags}")

   # LDFLAGS=${ldflags}
   #
   # Linker flags
-  set(_ldflags "${_ldflags} ${CMAKE_EXE_LINKER_FLAGS} ${PARAM_LDFLAGS}")
-  string(STRIP "${_ldflags}" _ldflags)
-  hunter_status_debug("LDFLAGS=${_ldflags}")
-  string(COMPARE NOTEQUAL "${_ldflags}" "" has_ldflags)
-  if(has_ldflags)
-    list(APPEND configure_opts LDFLAGS=${_ldflags})
+  set(ldflags "${CMAKE_EXE_LINKER_FLAGS} ${PARAM_LDFLAGS}")
+  string(STRIP "${ldflags}" ldflags)
+  hunter_status_debug("LDFLAGS=${ldflags}")
+
+  set(configure_host)
+  string(COMPARE NOTEQUAL "${ANDROID}" "" is_android)
+  string(COMPARE NOTEQUAL "${IPHONEOS_ARCHS}${IPHONESIMULATOR_ARCHS}" "" is_ios)
+  string(COMPARE NOTEQUAL "${CROSS_COMPILE_TOOLCHAIN_PREFIX}" "" is_cross_compile)
+  if(is_android)
+    # AWP: the checks below should also be done for the Raspberry Pi
+    #      how could we do it without repetition?
+    hunter_test_string_not_empty("${CMAKE_C_FLAGS}")
+    hunter_test_string_not_empty("${CMAKE_CXX_FLAGS}")
+    hunter_test_string_not_empty("${CMAKE_AR}")
+    hunter_test_string_not_empty("${CMAKE_C_PREPROCESSOR}")
+    hunter_test_string_not_empty("${CMAKE_C_COMPILER}")
+    hunter_test_string_not_empty("${CMAKE_CXX_COMPILER}")
+    hunter_test_string_not_empty("${CMAKE_LINKER}")
+    hunter_test_string_not_empty("${CMAKE_NM}")
+    hunter_test_string_not_empty("${CMAKE_OBJCOPY}")
+    hunter_test_string_not_empty("${CMAKE_OBJDUMP}")
+    hunter_test_string_not_empty("${CMAKE_RANLIB}")
+    hunter_test_string_not_empty("${CMAKE_STRIP}")
+
+    hunter_test_string_not_empty("${ANDROID_TOOLCHAIN_MACHINE_NAME}")
+    set(configure_host --host=${ANDROID_TOOLCHAIN_MACHINE_NAME})
+    set(ldflags "${ldflags} ${__libstl}")
+  elseif(is_ios)
+    hunter_status_debug("Autotools iOS IPHONEOS_ARCHS: ${IPHONEOS_ARCHS} IPHONESIMULATOR_ARCHS: ${IPHONESIMULATOR_ARCHS}")
+    if(BUILD_SHARED_LIBS)
+      hunter_fatal_error("Autotools: building iOS libraries as shared is not supported")
+    endif()
+    set(ios_architectures)
+    list(APPEND ios_architectures ${IPHONEOS_ARCHS} ${IPHONESIMULATOR_ARCHS})
+  elseif(is_cross_compile)
+    set(configure_host --host=${CROSS_COMPILE_TOOLCHAIN_PREFIX})
   endif()

   # Hunter builds static libraries by default
@@ -212,51 +217,194 @@
     list(APPEND PARAM_EXTRA_FLAGS --disable-shared --enable-static)
   endif()

-
-  if(PARAM_EXTRA_FLAGS)
-    list(APPEND configure_opts ${PARAM_EXTRA_FLAGS})
-  endif()
-
   if(HUNTER_STATUS_DEBUG)
-    string(REPLACE ";" " " _extra_flags "${PARAM_EXTRA_FLAGS}")
-    hunter_status_debug("EXTRA_FLAGS=${_extra_flags}")
-  endif()
-
-  set(configure_command "./configure")
-  set(configure_command
-      . "${PARAM_HUNTER_SELF}/scripts/clear-all.sh" && "${configure_command}"
-  )
+    string(REPLACE ";" " " extra_flags "${PARAM_EXTRA_FLAGS}")
+    hunter_status_debug("EXTRA_FLAGS=${extra_flags}")
+  endif()
+
+  # Build command and options
   set(build_command . "${PARAM_HUNTER_SELF}/scripts/clear-all.sh" && make)
-
   set(build_opts)
   string(COMPARE NOTEQUAL "${PARAM_PARALLEL_JOBS}" "" have_jobs)
   if(have_jobs)
     list(APPEND build_opts "-j" "${PARAM_PARALLEL_JOBS}")
   endif()

-  ExternalProject_Add(
-      ${target_name}
-      URL
-      ${PARAM_URL}
-      URL_HASH
-      ${PARAM_URL_HASH}
-      DOWNLOAD_DIR
-      ${PARAM_DOWNLOAD_DIR}
-      SOURCE_DIR
-      ${PARAM_SOURCE_DIR}
-      INSTALL_DIR
-      ${PARAM_INSTALL_DIR}
+  set(configure_command "./configure")
+  set(configure_command
+    . "${PARAM_HUNTER_SELF}/scripts/clear-all.sh" && AR=${CMAKE_AR} "${configure_command}"
+  )
+
+  # Build the configure command line options
+  set(configure_opts)
+  string(COMPARE NOTEQUAL "${configure_host}" "" has_configure_host)
+  if(has_configure_host)
+    list(APPEND configure_opts ${configure_host})
+  endif()
+
+  string(COMPARE NOTEQUAL "${toolchain_binaries}" "" has_changes)
+  if(has_changes)
+    list(APPEND configure_opts ${toolchain_binaries})
+  endif()
+
+  string(COMPARE NOTEQUAL "${cppflags}" "" has_cppflags)
+  if(has_cppflags)
+    list(APPEND configure_opts CPPFLAGS=${cppflags})
+  endif()
+
+  string(COMPARE NOTEQUAL "${cflags}" "" has_cflags)
+  if(has_cflags)
+    list(APPEND configure_opts CFLAGS=${cflags})
+  endif()
+
+  string(COMPARE NOTEQUAL "${cxxflags}" "" has_cxxflags)
+  if(has_cxxflags)
+    list(APPEND configure_opts CXXFLAGS=${cxxflags})
+  endif()
+
+  string(COMPARE NOTEQUAL "${ldflags}" "" hasldflags)
+  if(hasldflags)
+    list(APPEND configure_opts LDFLAGS=${ldflags})
+  endif()
+
+  if(PARAM_EXTRA_FLAGS)
+    list(APPEND configure_opts ${PARAM_EXTRA_FLAGS})
+  endif()
+
+  if(NOT is_ios)
+    hunter_status_debug("Autotools configure_opts: ${configure_opts} ")
+    ExternalProject_Add(${target_name}
+        URL
+          ${PARAM_URL}
+        URL_HASH
+          ${PARAM_URL_HASH}
+        DOWNLOAD_DIR
+          ${PARAM_DOWNLOAD_DIR}
+        SOURCE_DIR
+          ${PARAM_SOURCE_DIR}
+        INSTALL_DIR
+          ${PARAM_INSTALL_DIR}
           # not used, just avoid creating Install/<name> empty directory
-      CONFIGURE_COMMAND
-      ${configure_command}
-      ${configure_opts}
-      "--prefix=${PARAM_INSTALL_DIR}"
-      BUILD_COMMAND
-      ${build_command}
-      ${build_opts}
-      BUILD_IN_SOURCE
-      1
-      INSTALL_COMMAND
-      make install
-  )
+        CONFIGURE_COMMAND
+          ${configure_command}
+          ${configure_opts}
+          "--prefix=${PARAM_INSTALL_DIR}"
+        BUILD_COMMAND
+          ${build_command}
+          ${build_opts}
+        BUILD_IN_SOURCE
+          1
+        INSTALL_COMMAND
+          make install
+    )
+  else()
+    set(ios_universal_target ${target_name}-universal)
+    set(merge_lipo_script "autotools-merge-lipo.cmake")
+    ExternalProject_Add(${ios_universal_target}
+        DOWNLOAD_COMMAND
+          ""
+        SOURCE_DIR
+          ${PARAM_SOURCE_DIR}/universal
+        INSTALL_DIR
+          ${PARAM_INSTALL_DIR}
+          # not used, just avoid creating Install/<name> empty directory
+        CONFIGURE_COMMAND
+          ""
+        BUILD_COMMAND
+          ""
+        BUILD_IN_SOURCE
+          1
+        INSTALL_COMMAND
+        ${CMAKE_COMMAND}
+        -P
+        "${PARAM_SOURCE_DIR}/universal/${merge_lipo_script}"
+    )
+    set(ios_built_arch_roots)
+    set(multi_arch_install_root ${PARAM_INSTALL_DIR}/multi-arch)
+    foreach(ios_architecture ${ios_architectures})
+      hunter_status_debug("Autotools: building for iOS architecture ${ios_architecture}")
+
+      #clear the conf options
+      set(is_simulator FALSE)
+      if(${ios_architecture} STREQUAL "armv7"
+          OR ${ios_architecture} STREQUAL "armv7s")
+        set(configure_host "arm-apple-darwin")
+      elseif(${ios_architecture} STREQUAL "arm64")
+        set(configure_host "aarch64-apple-darwin")
+      elseif(${ios_architecture} STREQUAL "i386")
+        set(configure_host "i386-apple-darwin")
+        set(is_simulator TRUE)
+      elseif(${ios_architecture} STREQUAL "x86_64")
+        set(configure_host "x86_64-apple-darwin")
+        set(is_simulator TRUE)
+      else()
+        hunter_fatal_error("iOS architecture: ${ios_architecture} not supported")
+      endif()
+
+      set(arch_flags)
+      set(configure_opts)
+      # Extra space at the end of the arch_flags is needed below when appending
+      # to configure_opts, please do not remove!
+      if(is_simulator)
+        set(arch_flags "-arch ${ios_architecture} -isysroot ${IPHONESIMULATOR_SDK_ROOT} -miphoneos-version-min=${IOS_SDK_VERSION} ")
+      else()
+        set(arch_flags "-arch ${ios_architecture} -isysroot ${IPHONEOS_SDK_ROOT} -miphoneos-version-min=${IOS_SDK_VERSION} ")
+      endif()
+      list(APPEND configure_opts --host=${configure_host})
+      list(APPEND configure_opts ${toolchain_binaries})
+      list(APPEND configure_opts CPPFLAGS=${arch_flags}${cppflags})
+      list(APPEND configure_opts CFLAGS=${arch_flags}${cflags})
+      list(APPEND configure_opts CXXFLAGS=${arch_flags}${cxxflags})
+      list(APPEND configure_opts LDFLAGS=${arch_flags}${ldflags})
+      list(APPEND configure_opts ${PARAM_EXTRA_FLAGS})
+
+      # architecture specific source dir
+      set(arch_source_dir
+          ${PARAM_SOURCE_DIR}/multi-arch-build/${ios_architecture}
+      )
+      set(arch_target
+          ${target_name}-${ios_architecture}
+      )
+      set(arch_install_dir
+          ${multi_arch_install_root}/${ios_architecture}
+      )
+      ExternalProject_Add(${arch_target}
+          URL
+            ${PARAM_URL}
+          URL_HASH
+            ${PARAM_URL_HASH}
+          DOWNLOAD_DIR
+            ${PARAM_DOWNLOAD_DIR}
+          SOURCE_DIR
+            ${arch_source_dir}
+          INSTALL_DIR
+            ${arch_install_dir}
+            # not used, just avoid creating Install/<name> empty directory
+          CONFIGURE_COMMAND
+            ${configure_command}
+            ${configure_opts}
+            "--prefix=${arch_install_dir}"
+          BUILD_COMMAND
+            ${build_command}
+            ${build_opts}
+          BUILD_IN_SOURCE
+            1
+          INSTALL_COMMAND
+            make install
+      )
+
+      list(APPEND ios_built_arch_roots ${arch_install_dir})
+      add_dependencies(
+        "${ios_universal_target}"
+        "${arch_target}"
+      )
+    endforeach()
+
+    set(HUNTER_PACKAGE_INSTALL_PREFIX ${PARAM_INSTALL_DIR})
+    configure_file(
+        "${PARAM_HUNTER_SELF}/scripts/${merge_lipo_script}.in"
+        "${PARAM_SOURCE_DIR}/universal/${merge_lipo_script}"
+        @ONLY
+    )
+  endif()
 endfunction()


Fix status message I meant to remove earlier

Signed-off-by: Larry Gritz <f0a1ce6f80112d72f7276457fd261d671b827567@larrygritz.com>

--- src/cmake/modules/Findpugixml.cmake
+++ src/cmake/modules/Findpugixml.cmake
@@ -35,12 +35,10 @@
                NAMES pugixml.hpp
                #HINTS ${OpenImageIO_INCLUDE_DIR}/detail/pugixml
                PATH_SUFFIXES pugixml-1.8 pugixml-1.9 pugixml-1.10)
-    message(STATUS "1 PUGIXML_INCLUDE_DIR ${PUGIXML_INCLUDE_DIR}")
     set (pugixml_required_vars PUGIXML_INCLUDE_DIR)
     find_library (PUGIXML_LIBRARY
                   NAMES pugixml
                   PATH_SUFFIXES pugixml-1.8 pugixml-1.9 pugixml-1.10)
-    message(STATUS "1 PUGIXML_LIBRARY ${PUGIXML_LIBRARY}")

     if (PUGIXML_INCLUDE_DIR)
         file (STRINGS "${PUGIXML_INCLUDE_DIR}/pugixml.hpp" TMP REGEX "define PUGIXML_VERSION .*$")


update

update

--- modules/zlib.cmake
+++ modules/zlib.cmake
@@ -21,9 +21,6 @@
   # Add module subdirectory
   add_subdirectory("zlib")

-  # Put zconf.h to the root project binary directory
-  file(COPY "${CMAKE_CURRENT_BINARY_DIR}/zlib/zconf.h" DESTINATION "${PROJECT_BINARY_DIR}")
-
   # Add missing target sources
   if(MSVC AND AMD64)
     target_sources(zlib PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/zlib/contrib/masmx64/inffas8664.c")


emscripten: remove BINARYEN_METHOD (no longer supported by emscripten), and OUTLINING_LIMIT

--- cmake-toolchains/emscripten.toolchain.cmake
+++ cmake-toolchains/emscripten.toolchain.cmake
@@ -61,7 +61,6 @@
 option(FIPS_EMSCRIPTEN_USE_WASM_TRAP_MODE_CLAMP "emscripten: use trap-mode clamp for wasm" ON)
 set(FIPS_EMSCRIPTEN_TOTAL_MEMORY 134217728 CACHE STRING "emscripten: total heap size in bytes")
 set(FIPS_EMSCRIPTEN_LTO_LEVEL 1 CACHE STRING "emscripten: Link-time-optimization level (0..3)")
-set(FIPS_EMSCRIPTEN_OUTLINING_LIMIT 60000 CACHE STRING "emscripten: outlining limit")
 set(FIPS_EMSCRIPTEN_MEM_INIT_METHOD 1 CACHE STRING "emscripten: how to represent initial memory content (0..2)")
 set(FIPS_EMSCRIPTEN_SHELL_HTML "${EMSCRIPTEN_ROOT_PATH}/src/shell_minimal.html" CACHE STRING "emscripten: path to shell html file")
 set(EMSCRIPTEN_TOTAL_MEMORY_WORKER 16777216)
@@ -139,10 +138,10 @@
 endif()
 set(EMSC_LINKER_FLAGS_RELEASE "${EMSC_LINKER_FLAGS_RELEASE} --llvm-lto ${FIPS_EMSCRIPTEN_LTO_LEVEL}")
 if (FIPS_EMSCRIPTEN_USE_WASM)
-    set(EMSC_LINKER_FLAGS "${EMSC_LINKER_FLAGS} -s WASM=1 -s \"BINARYEN_METHOD='native-wasm'\"")
+    set(EMSC_LINKER_FLAGS "${EMSC_LINKER_FLAGS} -s WASM=1")
 else()
     set(EMSC_LINKER_FLAGS "${EMSC_LINKER_FLAGS} -s WASM=0")
-    set(EMSC_LINKER_FLAGS_RELEASE "${EMSC_LINKER_FLAGS_RELEASE} -s OUTLINING_LIMIT=${FIPS_EMSCRIPTEN_OUTLINING_LIMIT}")
+    set(EMSC_LINKER_FLAGS_RELEASE "${EMSC_LINKER_FLAGS_RELEASE}")
 endif()
 if (FIPS_EMSCRIPTEN_USE_CLOSURE)
     set(EMSC_LINKER_FLAGS_RELEASE "${EMSC_LINKER_FLAGS_RELEASE} --closure 1")


- minor change in define installation path, correct a root prefix issue with cmake

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

--- cmake/modules/DefineInstallationPaths.cmake
+++ cmake/modules/DefineInstallationPaths.cmake
@@ -15,33 +15,43 @@
 		SET (PKG_ARCH "x86_64")
 	ENDIF (CMAKE_SIZEOF_VOID_P EQUAL 4)

+#  correct cmake netpath issue with cmake 2.8
+  IF("${CMAKE_INSTALL_PREFIX}" STREQUAL "/")
+	SET(INTERNAL_BASE_PREFIX "")
+  ELSE("${CMAKE_INSTALL_PREFIX}" STREQUAL "/")
+ 	SET(INTERNAL_BASE_PREFIX "${CMAKE_INSTALL_PREFIX}")
+  ENDIF("${CMAKE_INSTALL_PREFIX}" STREQUAL "/")
+
   SET(EXEC_INSTALL_PREFIX
     "${CMAKE_INSTALL_PREFIX}"
     CACHE PATH  "Base directory for executables and libraries"
   )
+
+
+
   SET(SHARE_INSTALL_PREFIX
-    "${CMAKE_INSTALL_PREFIX}/share"
+    "${INTERNAL_BASE_PREFIX}/share"
     CACHE PATH "Base directory for files which go to share/"
   )
   SET(DATA_INSTALL_PREFIX
-    "${SHARE_INSTALL_PREFIX}/${APPLICATION_NAME}"
+    "${INTERNAL_BASE_PREFIX}/${APPLICATION_NAME}"
     CACHE PATH "The parent directory where applications can install their data")

   # The following are directories where stuff will be installed to
   SET(BIN_INSTALL_DIR
-    "${EXEC_INSTALL_PREFIX}/bin"
+    "${INTERNAL_BASE_PREFIX}/bin"
     CACHE PATH "The ${APPLICATION_NAME} binary install dir (default prefix/bin)"
   )
   SET(SBIN_INSTALL_DIR
-    "${EXEC_INSTALL_PREFIX}/sbin"
+    "${INTERNAL_BASE_PREFIX}/sbin"
     CACHE PATH "The ${APPLICATION_NAME} sbin install dir (default prefix/sbin)"
   )
   SET(LIB_INSTALL_DIR
-    "${EXEC_INSTALL_PREFIX}/lib${LIB_SUFFIX}"
+    "${INTERNAL_BASE_PREFIX}/lib${LIB_SUFFIX}"
     CACHE PATH "The subdirectory relative to the install prefix where libraries will be installed (default is prefix/lib)"
   )
   SET(LIBEXEC_INSTALL_DIR
-    "${EXEC_INSTALL_PREFIX}/libexec"
+    "${INTERNAL_BASE_PREFIX}/libexec"
     CACHE PATH "The subdirectory relative to the install prefix where libraries will be installed (default is prefix/libexec)"
   )

@@ -55,7 +65,7 @@
     CACHE PATH "The subdirectory relative to the install prefix where plugins will be installed (default is prefix/lib/${APPLICATION_NAME})"
   )
   SET(INCLUDE_INSTALL_DIR
-    "${CMAKE_INSTALL_PREFIX}/include"
+    "${INTERNAL_BASE_PREFIX}/include"
     CACHE PATH "The subdirectory to the header prefix (default prefix/include)"
   )


Fixed a typo in the setup of the ROOT_ATOMIC_LIBS variable.

Obviously I didn't update the code correctly when I re-wrote it
for the pull request... :-(

--- cmake/modules/SearchInstalledSoftware.cmake
+++ cmake/modules/SearchInstalledSoftware.cmake
@@ -1722,7 +1722,7 @@
   DOC "Path to the atomic library to use during the build")
 mark_as_advanced(ROOT_ATOMIC_LIB)
 if(ROOT_ATOMIC_LIB)
-  set(ROOT_ATOMIC_LIBS ${ROOT_ATOMIC_LIBRARY})
+  set(ROOT_ATOMIC_LIBS ${ROOT_ATOMIC_LIB})
 else()
   set(ROOT_ATOMIC_LIBS)
 endif()


Update builtin version of XRootD to 4.9.1

--- cmake/modules/SearchInstalledSoftware.cmake
+++ cmake/modules/SearchInstalledSoftware.cmake
@@ -753,9 +753,10 @@
     endif()
   endif()
 endif()
+
 if(builtin_xrootd)
-  set(XROOTD_VERSION 4.8.5)
-  set(XROOTD_VERSIONNUM 400060001)
+  set(XROOTD_VERSION 4.9.1)
+  set(XROOTD_VERSIONNUM 400090001)
   set(XROOTD_SRC_URI ${lcgpackages}/xrootd-${XROOTD_VERSION}.tar.gz)
   set(XROOTD_DESTDIR ${CMAKE_BINARY_DIR})
   set(XROOTD_ROOTDIR ${XROOTD_DESTDIR})
@@ -770,7 +771,7 @@
   ExternalProject_Add(
     XROOTD
     URL ${XROOTD_SRC_URI}
-    URL_HASH SHA256=42e4d2cc6f8b442135f09bcc12c7be38b1a0c623a005cb5e69ff3d27997bdf73
+    URL_HASH SHA256=de47160348d52a655f8d601520ad9146b9ee76eb5d2352cdf232a6fafce27adb
     INSTALL_DIR ${XROOTD_ROOTDIR}
     CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
                -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}


Removed debug message from cmake config

Removed debug message from cmake config

--- cmakemodules/find_or_download_package.cmake
+++ cmakemodules/find_or_download_package.cmake
@@ -2,9 +2,9 @@
     find_package(${package} ${ARGN})

     if(${package_found_prefix}_FOUND)
-        message(STATUS "${package} found, no need to build locally")
+        message(STATUS "${package} found")
     else()
-        message(STATUS "${package} not found, will download and build locally")
+        message(STATUS "${package} not found, will use locally downloaded and build one")
         include(Download${package})
     endif()

@@ -14,7 +14,7 @@
         get_filename_component(LIB_NAME ${sublib} NAME_WE)
         set(sublib_target ${package}_cmake_dep_${LIB_NAME})

-        message(STATUS ${sublib} "  " ${sublib_target})
+        #message(STATUS ${sublib} "  " ${sublib_target})

         # Detect wether this is a shared or a static library
         # NB: This might not work on windows
@@ -26,7 +26,7 @@
         endif()

         foreach(sublib_target_dep ${${package_found_prefix}_CMAKE_DEP})
-            message(STATUS "sublib target dep: " ${sublib_target_dep})
+            #message(STATUS "sublib target dep: " ${sublib_target_dep})
             add_dependencies(${sublib_target} ${sublib_target_dep})
         endforeach()