PKG: keep packaging macros in sync with otb tree

--- CMake/PackageHelper.cmake
+++ CMake/PackageHelper.cmake
@@ -109,6 +109,7 @@
       DEPENDENCIES_INSTALL_DIR
       OTB_APPLICATIONS_DIR
       PKG_STAGE_DIR
+      PACKAGE_SUPPORT_FILES_DIR
       CMAKE_INSTALL_PREFIX
       OTB_INSTALL_DIR
       )
@@ -118,8 +119,25 @@
     set(vars "${vars}  ${req}=[${${req}}]\n")
   endforeach(req)

-  #one for debugging..
-#  install(CODE "message(\"CMake/PackageHelper.cmake:install_common(${outdir})\n${vars}\n\")")
+  # one for debugging..
+  # install(CODE "message(\"CMake/PackageHelper.cmake:install_common(${outdir})\n${vars}\n\")")
+
+  ##################### install environment source ##########################
+  if(WIN32 OR CROSS_COMPILING)
+    set(ENV_SOURCE_FILES
+      "${PACKAGE_SUPPORT_FILES_DIR}/otbenv.cmd"
+      "${PACKAGE_SUPPORT_FILES_DIR}/otbenv.profile"
+      )
+
+  elseif(UNIX)
+    set(ENV_SOURCE_FILES "${PACKAGE_SUPPORT_FILES_DIR}/otbenv.profile")
+  endif()
+
+  foreach(ENV_SOURCE_FILE ${ENV_SOURCE_FILES})
+    if(EXISTS ${ENV_SOURCE_FILE})
+      install(FILES ${ENV_SOURCE_FILE} DESTINATION ${PKG_STAGE_DIR})
+    endif()
+  endforeach()

   ####################### install cli and gui scripts ###########################
   file(GLOB PKG_APP_SCRIPTS
@@ -198,14 +216,6 @@
     set(vars "${vars}  ${req}=[${${req}}]\n")
   endforeach(req)

-  #message("CMake/PackageHelper.cmake:install_common(${stage_dir})\n${vars}\n")
-
-  ##################### install mingw otbenv.cmd ##########################
-  if(EXISTS ${Monteverdi_SOURCE_DIR}/Packaging/Windows/mingw/otbenv.cmd)
-    install(FILES ${Monteverdi_SOURCE_DIR}/Packaging/Windows/mingw/otbenv.cmd
-      DESTINATION ${PKG_STAGE_DIR})
-  endif()
-
   ####################### install mingw qt.conf ##########################
   if(EXISTS ${Monteverdi_SOURCE_DIR}/Packaging/Windows/mingw/qt.conf)
     install(FILES ${Monteverdi_SOURCE_DIR}/Packaging/Windows/mingw/qt.conf
@@ -233,13 +243,12 @@

 endfunction()

-macro(clear_package_staging_directory)
-  message(STATUS "Clearing package staging directory: ${CMAKE_INSTALL_PREFIX}/${PKG_STAGE_DIR}")
+macro(empty_package_staging_directory)
+  message(STATUS "Empty package staging directory: ${CMAKE_INSTALL_PREFIX}/${PKG_STAGE_DIR}")
   execute_process(COMMAND ${CMAKE_COMMAND} -E remove_directory "${CMAKE_INSTALL_PREFIX}/${PKG_STAGE_DIR}")
 endmacro()

 function(configure_package)
-
   set(EXE_EXT "")
   set(LIB_EXT "*so")
   set(SCR_EXT ".sh")
@@ -249,10 +258,33 @@
     set(SCR_EXT ".bat")
   endif()

-  foreach(EXE_FILE
-      monteverdi
+  #This must exist in any OTB Installation minimal or full
+  set(PKG_BINARY_FILES "bin/otbApplicationLauncherCommandLine")
+  set(PKG_PEFILES "${OTB_INSTALL_DIR}/bin/otbApplicationLauncherCommandLine${EXE_EXT}")
+  if(NOT EXISTS "${OTB_INSTALL_DIR}/bin/otbApplicationLauncherCommandLine${EXE_EXT}")
+    message(FATAL_ERROR "${OTB_INSTALL_DIR}/bin/otbApplicationLauncherCommandLine${EXE_EXT} not found.")
+  endif()
+
+  foreach(EXE_FILE otbApplicationLauncherQt
+      iceViewer
+      otbTestDriver)
+    if(EXISTS "${OTB_INSTALL_DIR}/bin/${EXE_FILE}${EXE_EXT}")
+      #see the first comment about PKG_BINARY_FILES
+      set(PKG_BINARY_FILES "${PKG_BINARY_FILES} bin/${EXE_FILE}${EXE_EXT}")
+      list(APPEND PKG_PEFILES
+        "${OTB_INSTALL_DIR}/bin/${EXE_FILE}${EXE_EXT}")
+    endif()
+  endforeach()
+
+  foreach(EXE_FILE monteverdi
       mapla)
     if(EXISTS "${CMAKE_INSTALL_PREFIX}/bin/${EXE_FILE}${EXE_EXT}")
+      #PKG_BINARY_FILES might seem a bit redundant variable if you
+      #consider PKG_PEFILES which also has same content.
+      #But PKG_BINARY_FILES goes into pkgsetup.in for Linux standalone binaries
+      # and other one (PKG_PEFILES) is for dependency resolution in
+      # process_deps() function
+      set(PKG_BINARY_FILES "${PKG_BINARY_FILES} bin/${EXE_FILE}${EXE_EXT}")
       list(APPEND PKG_PEFILES
         "${CMAKE_INSTALL_PREFIX}/bin/${EXE_FILE}${EXE_EXT}")
     endif()
@@ -261,32 +293,30 @@
         install(FILES
           ${Monteverdi_SOURCE_DIR}/Packaging/${EXE_FILE}${SCR_EXT}
           DESTINATION
-          "${PKG_STAGE_DIR}")
-    endif()
-  endif()
-
-  endforeach()
-
-  foreach(EXE_FILE otbApplicationLauncherQt
-      iceViewer
-      otbTestDriver
-      otbApplicationLauncherCommandLine)
-    if(EXISTS "${OTB_INSTALL_DIR}/bin/${EXE_FILE}${EXE_EXT}")
-      list(APPEND PKG_PEFILES
-        "${OTB_INSTALL_DIR}/bin/${EXE_FILE}${EXE_EXT}")
+          "${PKG_STAGE_DIR}/bin")
+      endif()
     endif()
   endforeach()

   file(GLOB OTB_APPS_LIST ${OTB_APPLICATIONS_DIR}/otbapp_${LIB_EXT}) # /lib/otb
+
+  #see the first comment about PKG_BINARY_FILES
+  foreach(OTB_APP_SO ${OTB_APPS_LIST})
+    get_filename_component(OTB_APP_SO_NAME ${OTB_APP_SO} NAME)
+    set(PKG_BINARY_FILES "${PKG_BINARY_FILES} lib/otb/applications/${OTB_APP_SO_NAME}")
+  endforeach()

   set(include_mvd 0)
   if(DEFINED Monteverdi_SOURCE_DIR)
     set(include_mvd 1)
   endif()

+  list(APPEND PKG_PEFILES ${OTB_APPS_LIST})
+
   install_common(${include_mvd})

-  list(APPEND PKG_PEFILES ${OTB_APPS_LIST})
+  execute_process(COMMAND ${CMAKE_COMMAND} -E remove_directory "${CMAKE_BINARY_DIR}/temp_so_names_dir")
+  execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_BINARY_DIR}/temp_so_names_dir")

   set(alldlls)
   set(notfound_dlls)
@@ -301,4 +331,100 @@
     message(FATAL_ERROR "Following dlls were not found: ${notfound_dlls}. Please consider adding their paths to SEARCHDIRS when calling superbuild_package macro.")
   endif()

-endfunction()+  file(GLOB temp_files "${CMAKE_BINARY_DIR}/temp_so_names_dir/*") # /lib/otb
+  foreach(temp_file ${temp_files})
+    get_filename_component(basename_of_temp_file ${temp_file} NAME)
+    set(PKG_BINARY_FILES "${PKG_BINARY_FILES} lib/${basename_of_temp_file}")
+  endforeach()
+
+  #remove this temporary directory
+  execute_process(COMMAND ${CMAKE_COMMAND} -E remove_directory "${CMAKE_BINARY_DIR}/temp_so_names_dir")
+
+  set(PKG_BINARY_FILES "${PKG_BINARY_FILES}" PARENT_SCOPE)
+
+endfunction()
+
+# The below function is modified from GetPrerequisities.cmake
+# which is distributed with CMake.
+function(is_file_a_symbolic_link file result_var1 result_var2)
+  #
+  # A file is not executable until proven otherwise:
+  #
+  set(${result_var1} 0 PARENT_SCOPE)
+  set(${result_var2} "" PARENT_SCOPE)
+
+  get_filename_component(file_full "${file}" ABSOLUTE)
+  string(TOLOWER "${file_full}" file_full_lower)
+
+  # If file name ends in .exe on Windows, *assume* executable:
+  #
+  if(WIN32 AND NOT UNIX)
+    if("${file_full_lower}" MATCHES "\\.lnk$")
+      set(${result_var1} 1 PARENT_SCOPE)
+      #Assuming the file is linked to a file with same name without .lnk extension
+      get_filename_component(name_we_lnk "${file_full_lower}" NAME_WE)
+      set(${result_var2} "${name_we_lnk}" PARENT_SCOPE)
+      return()
+    endif()
+
+    # A clause could be added here that uses output or return value of dumpbin
+    # to determine ${result_var}. In 99%+? practical cases, the exe name
+    # match will be sufficient...
+    #
+  endif()
+
+  # Use the information returned from the Unix shell command "file" to
+  # determine if ${file_full} should be considered an executable file...
+  #
+  # If the file command's output contains "executable" and does *not* contain
+  # "text" then it is likely an executable suitable for prerequisite analysis
+  # via the get_prerequisites macro.
+  #
+  if(UNIX)
+    if(NOT file_cmd)
+      find_program(file_cmd "file")
+      mark_as_advanced(file_cmd)
+    endif()
+
+    if(file_cmd)
+      execute_process(COMMAND "${file_cmd}" "${file_full}"
+        RESULT_VARIABLE file_rv
+        OUTPUT_VARIABLE file_ov
+        ERROR_VARIABLE file_ev
+        OUTPUT_STRIP_TRAILING_WHITESPACE
+        )
+      if(NOT file_rv STREQUAL "0")
+        message(FATAL_ERROR "${file_cmd} failed: ${file_rv}\n${file_ev}")
+      endif()
+
+      # Replace the name of the file in the output with a placeholder token
+      # (the string " _file_full_ ") so that just in case the path name of
+      # the file contains the word "text" or "executable" we are not fooled
+      # into thinking "the wrong thing" because the file name matches the
+      # other 'file' command output we are looking for...
+      #
+      string(REPLACE "${file_full}" " _file_full_ " file_ov "${file_ov}")
+      string(TOLOWER "${file_ov}" file_ov_lower)
+
+      #message(FATAL_ERROR "file_ov='${file_ov}'")
+      if("${file_ov_lower}" MATCHES "symbolic link")
+        #message(STATUS "symbolic link!")
+        set(${result_var1} 1 PARENT_SCOPE)
+        #Now find where the symlink is linked to.
+        #Do a regex replace
+        string(REGEX REPLACE "_file_full_*.*symbolic.link.to.."
+          "" symlinked_to ${file_ov})
+        #Take out last character which is a single quote
+        string(REPLACE "'" "" symlinked_to "${symlinked_to}")
+        #strip for our own sanity
+        string(STRIP ${symlinked_to} symlinked_to)
+        set(${result_var2} "${symlinked_to}" PARENT_SCOPE)
+        #message(FATAL_ERROR "${file_full} is symlinked_to ${symlinked_to}")
+        return()
+      endif()
+
+    else()
+      message(STATUS "warning: No 'file' command, skipping execute_process...")
+    endif()
+  endif()
+endfunction()


[UPD] Should be able to compile BTK with Matlab 6.5

git-svn-id: ed06c97986a68fa016311908f99ed1538fbb9b5d@334 93be6e1e-6fcc-11de-baec-69240fdc299a

--- CMake/FindMatlab.cmake
+++ CMake/FindMatlab.cmake
@@ -2,11 +2,8 @@
 #   used compiler. It determines the right MEX-File extension and add
 #   a macro to help the build of MEX-functions.
 #
-# For Windows, this module detects a Matlab's version between Matlab 7.0
-# (R14) and Matlab 7.9 (r2009b).
-# The Unix part of this module doesn't detect the Matlab version. To use it,
-# it is necessary to set the MATLAB_ROOT with the path of the Matlab
-# installation.
+# This module detects a Matlab's version between Matlab 7.0 (R14)
+# and Matlab 7.9 (r2009b).
 #
 # This module defines:
 #  MATLAB_ROOT: Matlab installation path
@@ -47,7 +44,11 @@
   )
   FIND_PATH(MATLAB_ROOT "license.txt" ${MATLAB_PATHS} NO_DEFAULT_PATH)
   IF (NOT MATLAB_ROOT)
-    FIND_PATH(MATLAB_ROOT "license.txt" "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MathWorks\\MATLAB\\7.0;MATLABROOT]" NO_DEFAULT_PATH)
+    SET(MATLAB_PATHS
+      "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MathWorks\\MATLAB\\7.0;MATLABROOT]"
+      "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MathWorks\\MATLAB\\6.5;MATLABROOT]"
+    )
+    FIND_PATH(MATLAB_ROOT "license.txt" ${MATLAB_PATHS} NO_DEFAULT_PATH)
     IF (MATLAB_ROOT)
       SET(MATLAB_OLD_WIN_MEXFILE_EXT 1 CACHE STRING "Old MEX extension for Windows")
     ENDIF (MATLAB_ROOT)
@@ -58,6 +59,7 @@
   SET(MATLAB_LIBRARIES_PATHS
       "${MATLAB_ROOT}/extern/lib/win64/microsoft"
       "${MATLAB_ROOT}/extern/lib/win32/microsoft"
+      "${MATLAB_ROOT}/extern/lib/win32/microsoft/msvc70"
       "${MATLAB_ROOT}/extern/lib/win32/microsoft/msvc71")
   SET(MATLAB_INCLUDE_PATHS "${MATLAB_ROOT}/extern/include")


Bug #3107: whitespace

Bug #3107: whitespace

--- CMake/SuperBuild.cmake
+++ CMake/SuperBuild.cmake
@@ -36,7 +36,7 @@
     SET(EP_COMMON_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DLINUX_EXTRA")
   ELSE()
     SET(EP_COMMON_C_FLAGS "${CMAKE_C_FLAGS} -fPIC -DLINUX_EXTRA")
-    SET(EP_COMMON_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -DLINUX_EXTRA")
+    SET(EP_COMMON_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -DLINUX_EXTRA")
   ENDIF()
   # These are not relevant for linux but we set them anyway to keep
   # the variable bits below symmetric.
@@ -121,8 +121,8 @@
       -DNIFTYLINK_ADDITIONAL_C_FLAGS:STRING=${NIFTYLINK_ADDITIONAL_C_FLAGS}
       -DNIFTYLINK_ADDITIONAL_CXX_FLAGS:STRING=${NIFTYLINK_ADDITIONAL_CXX_FLAGS}
       -DNIFTYLINK_OIGTLINK_DEV:BOOL=${NIFTYLINK_OIGTLINK_DEV}
-	    -DBUILDNAME:STRING=${BUILDNAME}
-	    -DCTEST_BUILD_NAME:STRING=${CTEST_BUILD_NAME}
+      -DBUILDNAME:STRING=${BUILDNAME}
+      -DCTEST_BUILD_NAME:STRING=${CTEST_BUILD_NAME}
       -DOpenIGTLink_SOURCE_DIR:PATH=${OpenIGTLink_SOURCE_DIR}
       -DOpenIGTLink_DIR:PATH=${OpenIGTLink_DIR}
       -DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}


Fix tests : missing renaming (SICONOS_FRICTION_3D_ONECONTACT_NSN_AC_GP --> SICONOS_FRICTION_3D_ONECONTACT_NSN_GP)

--- numerics/numerics_tests.cmake
+++ numerics/numerics_tests.cmake
@@ -257,7 +257,7 @@
     # --- NSGS on FC3D_DATA_SET ---
     NEW_FC_3D_TEST(${_DAT} SICONOS_FRICTION_3D_NSGS 1e-5 10000)
     NEW_FC_3D_TEST(${_DAT} SICONOS_FRICTION_3D_NSGS 1e-5 10000
-      SICONOS_FRICTION_3D_ONECONTACT_NSN_AC_GP 0 0
+      SICONOS_FRICTION_3D_ONECONTACT_NSN_GP 0 0
       INTERNAL_IPARAM 10 1)

     # --- Nonsmooth Newton on FC3D_DATA_SET ---
@@ -523,9 +523,9 @@
   # --- Test from rock pile simulations using "time of birth" feature ---
   # failure in local solver with line search
   NEW_FC_3D_TEST(RockPile_tob1.dat SICONOS_FRICTION_3D_NSGS 1e-3 100000
-    SICONOS_FRICTION_3D_ONECONTACT_NSN_AC_GP 1e-16 100)
+    SICONOS_FRICTION_3D_ONECONTACT_NSN_GP 1e-16 100)
   NEW_FC_3D_TEST(RockPile_tob1.dat SICONOS_FRICTION_3D_NSGS 1e-3 100000
-    SICONOS_FRICTION_3D_ONECONTACT_NSN_AC_GP 1e-16 1000)
+    SICONOS_FRICTION_3D_ONECONTACT_NSN_GP 1e-16 1000)
   NEW_FC_3D_TEST(RockPile_tob1.dat SICONOS_FRICTION_3D_NSGS 1e-3 100000
     SICONOS_FRICTION_3D_ONECONTACT_NSN_AC 1e-16 100)

@@ -685,12 +685,12 @@
   SET(test-GMP-REDUCED0_3D_ONECONTACT_QUARTIC-GMP6_PROPERTIES WILL_FAIL TRUE)
   NEW_GMP_TEST(SICONOS_FRICTION_3D_ONECONTACT_QUARTIC GMP6.dat)

-  NEW_GMP_TEST(SICONOS_FRICTION_3D_ONECONTACT_NSN_AC_GP GMP0.dat)
-  NEW_GMP_TEST(SICONOS_FRICTION_3D_ONECONTACT_NSN_AC_GP GMP1.dat)
-  NEW_GMP_TEST(SICONOS_FRICTION_3D_ONECONTACT_NSN_AC_GP GMP2.dat)
-  NEW_GMP_TEST(SICONOS_FRICTION_3D_ONECONTACT_NSN_AC_GP GMP3.dat)
-  NEW_GMP_TEST(SICONOS_FRICTION_3D_ONECONTACT_NSN_AC_GP GMP4.dat)
-  NEW_GMP_TEST(SICONOS_FRICTION_3D_ONECONTACT_NSN_AC_GP GMP5.dat)
+  NEW_GMP_TEST(SICONOS_FRICTION_3D_ONECONTACT_NSN_GP GMP0.dat)
+  NEW_GMP_TEST(SICONOS_FRICTION_3D_ONECONTACT_NSN_GP GMP1.dat)
+  NEW_GMP_TEST(SICONOS_FRICTION_3D_ONECONTACT_NSN_GP GMP2.dat)
+  NEW_GMP_TEST(SICONOS_FRICTION_3D_ONECONTACT_NSN_GP GMP3.dat)
+  NEW_GMP_TEST(SICONOS_FRICTION_3D_ONECONTACT_NSN_GP GMP4.dat)
+  NEW_GMP_TEST(SICONOS_FRICTION_3D_ONECONTACT_NSN_GP GMP5.dat)

   NEW_GMP_TEST(SICONOS_FRICTION_3D_ONECONTACT_NSN_AC GMP4.dat)
   NEW_GMP_TEST(SICONOS_FRICTION_3D_ONECONTACT_NSN_AC GMP5.dat)
@@ -723,9 +723,9 @@
   NEW_GMP_TEST(SICONOS_FRICTION_3D_ONECONTACT_QUARTIC GMP3.dat 0 0 0 0 0 3)
   NEW_GMP_TEST(SICONOS_FRICTION_3D_ONECONTACT_QUARTIC GMP6.dat 0 0 0 0 0 3)

-  NEW_GMP_TEST(SICONOS_FRICTION_3D_ONECONTACT_NSN_AC_GP GMP4.dat 0 0 0 0 0 2)
-  NEW_GMP_TEST(SICONOS_FRICTION_3D_ONECONTACT_NSN_AC_GP GMP5.dat 0 0 0 0 0 2)
-  NEW_GMP_TEST(SICONOS_FRICTION_3D_ONECONTACT_NSN_AC_GP GMP6.dat 0 0 0 0 0 2)
+  NEW_GMP_TEST(SICONOS_FRICTION_3D_ONECONTACT_NSN_GP GMP4.dat 0 0 0 0 0 2)
+  NEW_GMP_TEST(SICONOS_FRICTION_3D_ONECONTACT_NSN_GP GMP5.dat 0 0 0 0 0 2)
+  NEW_GMP_TEST(SICONOS_FRICTION_3D_ONECONTACT_NSN_GP GMP6.dat 0 0 0 0 0 2)

   NEW_GMP_TEST(SICONOS_FRICTION_3D_ONECONTACT_NSN_AC GMP4.dat 0 0 0 0 0 2)
   NEW_GMP_TEST(SICONOS_FRICTION_3D_ONECONTACT_NSN_AC GMP5.dat 0 0 0 0 0 2)


flips dx11, opengl, and sdl2 on by default now that those are no longer experimental. also seperates out the dedicated flag for compilation on windows

--- Tools/CMake/torque3d.cmake
+++ Tools/CMake/torque3d.cmake
@@ -64,32 +64,29 @@
 mark_as_advanced(TORQUE_HIFI)
 option(TORQUE_EXTENDED_MOVE "Extended move support" OFF)
 mark_as_advanced(TORQUE_EXTENDED_MOVE)
-if(WIN32)
-	option(TORQUE_SDL "Use SDL for window and input" OFF)
+
+if(WIN32)
+	option(TORQUE_SDL "Use SDL for window and input" ON)
 else()
 	set(TORQUE_SDL ON) # we need sdl to work on Linux/Mac
 endif()
-if(WIN32)
-	option(TORQUE_OPENGL "Allow OpenGL render" OFF)
+
+if(WIN32)
+	option(TORQUE_OPENGL "Allow OpenGL render" ON)
 	#mark_as_advanced(TORQUE_OPENGL)
 else()
 	set(TORQUE_OPENGL ON) # we need OpenGL to render on Linux/Mac
 endif()

 if(WIN32)
-	option(TORQUE_OPENGL "Allow OpenGL render" OFF)
-	#mark_as_advanced(TORQUE_OPENGL)
-else()
-	set(TORQUE_OPENGL ON) # we need OpenGL to render on Linux/Mac
-	option(TORQUE_DEDICATED "Torque dedicated" OFF)
-endif()
-
-if(WIN32)
-	option(TORQUE_D3D11 "Allow Direct3D 11 render" OFF)
+	option(TORQUE_D3D11 "Allow Direct3D 11 render" ON)
 endif()

 option(TORQUE_EXPERIMENTAL_EC "Experimental Entity/Component systems" OFF)
 mark_as_advanced(TORQUE_EXPERIMENTAL_EC)
+
+option(TORQUE_DEDICATED "Torque dedicated" OFF)
+mark_as_advanced(TORQUE_DEDICATED)

 ###############################################################################
 # options


fix itk url

fix itk url

--- version_config.cmake
+++ version_config.cmake
@@ -115,8 +115,8 @@
 set(glog_TAG v0.3.5)

 ## ITK
-set(ITK_URL https://itk.org/ITK.git)
-set(ITK_TAG v4.13.1)
+set(DEFAULT_ITK_URL https://github.com/InsightSoftwareConsortium/ITK.git)
+set(DEFAULT_ITK_TAG v4.13.1)

 ## NIFTYREG
 set(DEFAULT_NIFTYREG_URL https://github.com/KCL-BMEIS/niftyreg.git )
@@ -270,6 +270,9 @@
 set(SIRF-Contribs_URL ${DEFAULT_SIRF-Contribs_URL} CACHE STRING ON)
 set(SIRF-Contribs_TAG ${DEFAULT_SIRF-Contribs_TAG} CACHE STRING ON)

+set(ITK_URL ${DEFAULT_ITK_URL} CACHE STRING ON)
+set(ITK_TAG ${DEFAULT_ITK_TAG} CACHE STRING ON)
+
 mark_as_advanced(SIRF_URL SIRF_TAG STIR_URL STIR_TAG
   Gadgetron_URL Gadgetron_TAG
   siemens_to_ismrmrd_URL siemens_to_ismrmrd_TAG
@@ -282,4 +285,5 @@
   CCPi-Regularisation-Toolkit_URL CCPi-Regularisation-Toolkit_TAG
   NIFTYPET_URL NIFTYPET_TAG
   SIRF-Contribs_URL SIRF-Contribs_TAG
+  ITK_URL ITK_TAG
 )


sirf contribs can just be master

sirf contribs can just be master

--- version_config.cmake
+++ version_config.cmake
@@ -145,7 +145,7 @@

 ## SIRF-Contribs
 set(DEFAULT_SIRF-Contribs_URL https://github.com/CCPPETMR/SIRF-Contribs )
-set(DEFAULT_SIRF-Contribs_TAG 29ab88bb5a0032daa464c2617a49ba6881813902 )
+set(DEFAULT_SIRF-Contribs_TAG origin/master )

 option (DEVEL_BUILD "Developer Build" OFF)
 mark_as_advanced(DEVEL_BUILD)


cmake: dts: pass EXTRA_GEN_DEFINES_ARGS to gen_defines.py

Users can now set this CMake variable to pass additional arguments to
gen_defines.py.

Signed-off-by: Martí Bolívar <9d90ac4c7bf6a305f6bfd81a23c7859bc883380e@nordicsemi.no>

--- cmake/dts.cmake
+++ cmake/dts.cmake
@@ -220,6 +220,7 @@
   --device-header-out ${DEVICE_EXTERN_H}
   --dts-out ${ZEPHYR_DTS} # As a debugging aid
   --edt-pickle-out ${EDT_PICKLE}
+  ${EXTRA_GEN_DEFINES_ARGS}
   )

   execute_process(


SuperBuild: use a sourceforge download mirror to avoid redirection

--- SuperBuild/CMake/External_opencv.cmake
+++ SuperBuild/CMake/External_opencv.cmake
@@ -14,7 +14,7 @@

 ExternalProject_Add(OPENCV
   PREFIX OPENCV
-  URL "http://sourceforge.net/projects/opencvlibrary/files/opencv-unix/2.4.11/opencv-2.4.11.zip/download"
+  URL "http://downloads.sourceforge.net/project/opencvlibrary/opencv-unix/2.4.11/opencv-2.4.11.zip"
   URL_MD5 32f498451bff1817a60e1aabc2939575
   BINARY_DIR ${OPENCV_SB_BUILD_DIR}
   INSTALL_DIR ${SB_INSTALL_PREFIX}


Add install_symlink funciton.

Add install_symlink funciton.

--- functions.cmake
+++ functions.cmake
@@ -1,5 +1,6 @@
 # Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
 # @author Vegard Sjonfjell
+# @author Arnstein Ressem

 function(vespa_add_module_dependency OTHER_TARGET_OR_LIB)
     if (TARGET ${OTHER_TARGET_OR_LIB})
@@ -557,4 +558,7 @@
     endif()
 endfunction()

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


Need trailing slash

Need trailing slash

--- functions.cmake
+++ functions.cmake
@@ -644,7 +644,7 @@
 endfunction()

 function(install_config_definitions)
-    install(DIRECTORY ${ARGV0} DESTINATION share/vespa/configdefinitions)
+    install(DIRECTORY ${ARGV0}/ DESTINATION share/vespa/configdefinitions)
 endfunction()

 function(install_java_artifact NAME)


Restart all services on upgrade

Restart all services on upgrade

--- build/rpm/flexisip.spec.cmake
+++ build/rpm/flexisip.spec.cmake
@@ -164,7 +164,7 @@
 %systemd_preun %flexisip_services

 %postun
-%systemd_postun %flexisip_services
+%systemd_postun_with_restart %flexisip_services

 %files
 %defattr(-,root,root,-)


Cleanup libLAS URL

Cleanup libLAS URL

--- Superbuild/versions.cmake
+++ Superbuild/versions.cmake
@@ -57,5 +57,5 @@
 #  GIT_REPOSITORY git://github.com/libLAS/libLAS
 #  GIT_TAG 6e8657336ba445fcec3c9e70c2ebcd2e25af40b9)
 add_revision(liblas
-  GIT_REPOSITORY git://github.com/mwoehlke-kitware/libLAS
+  GIT_REPOSITORY git://github.com/mwoehlke-kitware/libLAS.git
   GIT_TAG fix-windows-stdint)


fixed: define typo (leading _ missing), thanks to Johannes Brunen for the report

git-svn-id: 6c7e10cdde2c115f53707ba8ec4efe535f92d362@2053 4683daeb-ad0f-0410-a623-93161e962ae5

--- CMake/UpdateCompiler.cmake
+++ CMake/UpdateCompiler.cmake
@@ -62,7 +62,7 @@

 IF(MSVC)
   IF(OSG_DISABLE_MICROSOFT_SECURE_CXXX)
-    ADD_DEFINITIONS("-DCRT_SECURE_NO_DEPRECATE")
+    ADD_DEFINITIONS("-D_CRT_SECURE_NO_DEPRECATE")
     ADD_DEFINITIONS("-D_CRT_SECURE_NO_WARNINGS")
     ADD_DEFINITIONS("-D_CRT_NONSTDC_NO_DEPRECATE")
     ADD_DEFINITIONS("-D_SECURE_SCL=0")


Update FAQ url to read the docs

Update FAQ url to read the docs

--- CMake/sitkCheckCXX11.cmake
+++ CMake/sitkCheckCXX11.cmake
@@ -95,5 +95,5 @@
     "SimpleITK requires usage of C++11 or C++ Technical Report 1 (TR1).\n"
     "It may be available as an optional download for your compiler or difference CXX_FLAGS."
     "Please see the FAQs for details."
-    "https://www.itk.org/Wiki/SimpleITK/FAQ#Do_I_need_to_download_an_option_package_for_TR1_support.3F\n" )
+    "http://simpleitk.readthedocs.io/en/master/Documentation/docs/source/faq.html#do-i-need-to-download-an-option-package-for-tr1-support\n")
 endif ( )


BUGFIX: set cmake policy for CMP0054 to OLD

--- CMakeModules/Version.cmake
+++ CMakeModules/Version.cmake
@@ -1,12 +1,19 @@
 #
 # Make a version file that includes the Forge version and git revision
 #
+CMAKE_POLICY(PUSH)
+
+IF("${CMAKE_VERSION}" VERSION_GREATER "3.1" OR "${CMAKE_VERSION}" VERSION_EQUAL "3.1")
+    CMAKE_POLICY(SET CMP0054 OLD)
+ENDIF()
+
 SET(FG_VERSION_MAJOR "1")
 SET(FG_VERSION_MINOR "0")
 SET(FG_VERSION_PATCH "beta")

 SET(FG_VERSION "${FG_VERSION_MAJOR}.${FG_VERSION_MINOR}.${FG_VERSION_PATCH}")
 SET(FG_API_VERSION_CURRENT ${FG_VERSION_MAJOR}${FG_VERSION_MINOR})
+

 # From CMake 3.0.0 CMAKE_<LANG>_COMPILER_ID is AppleClang for OSX machines
 # that use clang for compilations
@@ -36,3 +43,5 @@
     ${CMAKE_MODULE_PATH}/version.h.in
     ${CMAKE_SOURCE_DIR}/include/fg/version.h
 )
+
+CMAKE_POLICY(POP)


Move to newer tooling-cmake-util version

--- FindCPPCheck.cmake
+++ FindCPPCheck.cmake
@@ -16,7 +16,11 @@
 #
 # See LICENCE.md for Copyright info

-include (${CMAKE_CURRENT_LIST_DIR}/tooling-find-package-cmake-util/ToolingFindPackageUtil.cmake)
+set (CMAKE_MODULE_PATH
+     ${CMAKE_MODULE_PATH}
+     ${CMAKE_CURRENT_LIST_DIR}/tooling-find-package-cmake-util)
+
+include (ToolingFindPackageUtil)

 function (_find_cppcheck)

@@ -43,55 +47,42 @@
                                        VERSION_ARG --version
                                        VERSION_HEADER "Cppcheck "
                                        VERSION_END_TOKEN " ")
-        psq_check_and_report_tool_version (CPPCheck
-                                           ${CPPCHECK_VERSION}
-                                           FOUND_APPROPRIATE_VERSION)

         # Check the version of cppcheck. If it is < 1.58 output a warning about
         # detecting the language of header files
         if (${CPPCHECK_VERSION} VERSION_LESS 1.58)

-            psq_print_if_not_quiet (CPPCheck "Only cppcheck versions >= 1.58"
-                                             "support specifying a language for"
-                                             "analysis. You may encounter false"
-                                             "positives when scanning header"
-                                             "files if cppcheck is unable to"
-                                             "determine their source language."
-                                             "Consider upgrading to a newer"
-                                             "version of cppcheck, such that"
-                                             "this script can specify the"
-                                             "language of your header files"
-                                             "after detecting them")
+            psq_print_if_not_quiet (CPPCheck
+                                    MSG "Only cppcheck versions >= 1.58"
+                                         "support specifying a language for"
+                                         "analysis. You may encounter false"
+                                         "positives when scanning header"
+                                         "files if cppcheck is unable to"
+                                         "determine their source language."
+                                         "Consider upgrading to a newer"
+                                         "version of cppcheck, such that"
+                                         "this script can specify the"
+                                         "language of your header files"
+                                         "after detecting them")

         endif (${CPPCHECK_VERSION} VERSION_LESS 1.58)

-        # If we found all the paths set CPPCheck_FOUND and other related variables
-        if (FOUND_APPROPRIATE_VERSION)
-
-            set (CPPCheck_FOUND TRUE)
-            set (CPPCHECK_FOUND TRUE PARENT_SCOPE)
-            set (CPPCHECK_EXECUTABLE ${CPPCHECK_EXECUTABLE} PARENT_SCOPE)
-            set (CPPCHECK_VERSION ${CPPCHECK_VERSION} PARENT_SCOPE)
-
-            psq_print_if_not_quiet (CPPCheck "CPPCheck version"
-                                             "${CPPCHECK_VERSION} found at"
-                                             "${CPPCHECK_EXECUTABLE}")
-
-        else (FOUND_APPROPRIATE_VERSION)
-
-            set (CPPCheck_FOUND FALSE)
-
-        endif (FOUND_APPROPRIATE_VERSION)
-
     endif (CPPCHECK_EXECUTABLE)

+    psq_check_and_report_tool_version (CPPCheck
+                                       "${CPPCHECK_VERSION}"
+                                       REQUIRED_VARS
+                                       CPPCHECK_EXECUTABLE
+                                       CPPCHECK_VERSION)
+
+    psq_print_if_not_quiet (CPPCheck
+                            MSG "CPPCheck version"
+                                "${CPPCHECK_VERSION} found at"
+                                "${CPPCHECK_EXECUTABLE}"
+                            DEPENDS CPPCHECK_VERSION
+                                    CPPCHECK_EXECUTABLE)
+
     set (CPPCheck_FOUND ${CPPCheck_FOUND} PARENT_SCOPE)
-
-    if (NOT CPPCheck_FOUND)
-
-        psq_report_tool_not_found (CPPCheck "CPPCheck was not found")
-
-    endif (NOT CPPCheck_FOUND)

 endfunction (_find_cppcheck)


Disable verbose cuda building.

Disable verbose cuda building.

--- add_dependencies.cmake
+++ add_dependencies.cmake
@@ -10,7 +10,7 @@

 find_package(CUDA 7.0 REQUIRED)
 set(CUDA_SEPARABLE_COMPILATION ON)
-set(CUDA_VERBOSE_BUILD ON)
+set(CUDA_VERBOSE_BUILD OFF)
 set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS};-O3;-std=c++11;-gencode arch=compute_30,code=sm_30)
 SET(CUDA_PROPAGATE_HOST_FLAGS OFF)
 add_definitions(-DUSECUDA)


Uncommented CMAKE_Fortran_COMPILER_ID hack since CMake doesn't set that variable.

--- cmake/ConfigureCompiler.cmake
+++ cmake/ConfigureCompiler.cmake
@@ -53,9 +53,9 @@
                         CACHE STRING "Flags used by the compiler during release with debug info builds." FORCE)
       set(CMAKE_C_FLAGS_MINSIZEREL "-DNDEBUG -Os -ipo -fast"
                         CACHE STRING "Flags used by the compiler during release minsize builds." FORCE)
-###
-###      # Hack because CMake does not set this flag for intel fortran compiler
-###      set(CMAKE_Fortran_COMPILER_ID "Intel")
+
+      # Hack because CMake does not set this flag for intel fortran compiler
+      set(CMAKE_Fortran_COMPILER_ID "Intel")
     endif()
   endif()
   if(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
@@ -129,9 +129,9 @@
                       CACHE STRING "Flags used by the compiler during release with debug info builds." FORCE)
     set(CMAKE_C_FLAGS_MINSIZEREL "-DNDEBUG -Os"
                       CACHE STRING "Flags used by the compiler during release minsize builds." FORCE)
-###
-###    # Hack because CMake does not set this flag for GNU fortran compiler
-###    set(CMAKE_Fortran_COMPILER_ID "GNU")
+
+    # Hack because CMake does not set this flag for GNU fortran compiler
+    set(CMAKE_Fortran_COMPILER_ID "GNU")
   endif()
   if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
     set(CONFIGURE_COMPILER_SET_CXX_COMPILER_FLAGS ON)
@@ -189,9 +189,9 @@
                       CACHE STRING "Flags used by the compiler during release with debug info builds." FORCE)
     set(CMAKE_C_FLAGS_MINSIZEREL "-DNDEBUG -Os"
                       CACHE STRING "Flags used by the compiler during release minsize builds." FORCE)
-###
-###    # Hack because CMake does not set this flag for Clang fortran compiler
-###    set(CMAKE_Fortran_COMPILER_ID "Clang")
+
+    # Hack because CMake does not set this flag for Clang fortran compiler
+    set(CMAKE_Fortran_COMPILER_ID "Clang")
   endif()
   if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
     set(CONFIGURE_COMPILER_SET_CXX_COMPILER_FLAGS ON)
@@ -207,10 +207,12 @@
     set(CMAKE_CXX_FLAGS_DEBUG "-DDEBUG -O0 -g"
                         CACHE STRING "Flags used by the compiler during debug builds." FORCE)
     # FIX: SET SOURCE FILE PROPERTIES ON AFFECTED FILES INSTEAD OF THIS
+    #      (1) Try and figure out problem and fix code
+    #      (2) SET_SOURCE_FILES_PROPERTIES(${file} PROPERTIES COMPILE_FLAGS -O1)
     #      Clang 3.3 and lower produces wrong answer for mutilsimpsontestsuite hangs for -O2 or -O3
-    set(CMAKE_CXX_FLAGS_RELEASE "-DNDEBUG -O1"
-                        CACHE STRING "Flags used by the compiler during release builds." FORCE)
-    set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-DDEBUG -O1 -g"
+    set(CMAKE_CXX_FLAGS_RELEASE "-DNDEBUG -O3"
+                        CACHE STRING "Flags used by the compiler during release builds." FORCE)
+    set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-DDEBUG -O3 -g"
                         CACHE STRING "Flags used by the compiler during release with debug info builds." FORCE)
       set(CMAKE_CXX_FLAGS_MINSIZEREL "/DNDEBUG /Os /ipo /fast"
                         CACHE STRING "Flags used by the compiler during release minsize builds." FORCE)
@@ -221,9 +223,9 @@
                       CACHE STRING "Flags used by the compiler during all build types." FORCE)
     set(CMAKE_Fortran_FLAGS_DEBUG "-DDEBUG -O0 -g"
                       CACHE STRING "Flags used by the compiler during debug builds." FORCE)
-    set(CMAKE_Fortran_FLAGS_RELEASE "-DNDEBUG -O1"
+    set(CMAKE_Fortran_FLAGS_RELEASE "-DNDEBUG -O3"
                       CACHE STRING "Flags used by the compiler during release builds." FORCE)
-    set(CMAKE_Fortran_FLAGS_RELWITHDEBINFO "-DDEBUG -O1 -g"
+    set(CMAKE_Fortran_FLAGS_RELWITHDEBINFO "-DDEBUG -O3 -g"
                       CACHE STRING "Flags used by the compiler during release with debug info builds." FORCE)
       set(CMAKE_Fortran_FLAGS_MINSIZEREL "/DNDEBUG /Os /ipo /fast"
                       CACHE STRING "Flags used by the compiler during release minsize builds." FORCE)


Detect the number of cores on the host system, use that

The arbitrary 5 is far too few for many modern systems, detect this
dynamically and use it.

--- cmake/PVExternalProject.cmake
+++ cmake/PVExternalProject.cmake
@@ -10,7 +10,14 @@
 # Because of the wrapped and nested way that "make" needs to get called, it's
 # not able to utilize the top level make jobserver so it's -j level must be
 # manually controlled.
-set(PV_MAKE_NCPUS 5 CACHE STRING "Number of make jobs to use for compiling ParaView itself")
+include(ProcessorCount)
+ProcessorCount(N)
+set(_NCPUS 8)
+if(NOT N EQUAL 0)
+  set(_NCPUS ${N})
+endif()
+set(PV_MAKE_NCPUS ${_NCPUS} CACHE STRING
+    "Number of make jobs to use for compiling ParaView itself")
 mark_as_advanced(PV_MAKE_NCPUS)

 string(REPLACE ")" "|PROCESS_ENVIRONMENT)"


Update GIT_TAG of protobuf library.

Update GIT_TAG of protobuf library.

--- cmake/external/protobuf.cmake
+++ cmake/external/protobuf.cmake
@@ -47,7 +47,7 @@
 ExternalProject_Add(${PROTOBUF_TARGET}
     PREFIX ${PROTOBUF_TARGET}
     GIT_REPOSITORY https://github.com/google/protobuf.git
-    GIT_TAG 32886f1f
+    GIT_TAG 008ff033
     UPDATE_COMMAND ""
     CONFIGURE_COMMAND ${CMAKE_COMMAND} ${PROTOFUB_INSTALL_DIR}/src/${PROTOBUF_TARGET}/cmake
         -G${CMAKE_GENERATOR}


Update protobuf to v3.17.3

Update protobuf to v3.17.3

--- cmake/external/protobuf.cmake
+++ cmake/external/protobuf.cmake
@@ -63,7 +63,7 @@
 ExternalProject_Add(${PROTOBUF_TARGET}
     PREFIX ${PROTOBUF_TARGET}
     GIT_REPOSITORY https://github.com/google/protobuf.git
-    GIT_TAG 214c77e1b76e63e512bd675d1c300c80438642b6
+    GIT_TAG v3.17.3
     UPDATE_COMMAND ""
     CONFIGURE_COMMAND ${CMAKE_COMMAND} ${PROTOBUF_INSTALL_DIR}/src/${PROTOBUF_TARGET}/cmake
         -G${CMAKE_GENERATOR}


blacklist boost version 1.58

blacklist boost version 1.58

addresses #1591

--- cmake/modules/FindBOOST.cmake
+++ cmake/modules/FindBOOST.cmake
@@ -58,6 +58,21 @@
   LIST(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules/)
 ENDIF()

+
+#
+# Blacklist version 1.58 because we get serialization errors with it. At least
+# version 1.56 and 1.59 are known to work.
+#
+IF(Boost_FOUND)
+  IF("${Boost_MAJOR_VERSION}" STREQUAL "1" AND "${Boost_MINOR_VERSION}" STREQUAL "58")
+    MESSAGE("-- Boost version 1.58 is not compatible with deal.II!")
+    UNSET(Boost_FOUND)
+    UNSET(Boost_INCLUDE_DIRS)
+    UNSET(Boost_LIBRARIES)
+  ENDIF()
+ENDIF()
+
+
 IF(Boost_FOUND)
   #
   # Remove "pthread" from Boost_LIBRARIES. Threading, if necessary, is


Fix typo in variable activating secure transport

--- cmake/modules/buildCurl.cmake
+++ cmake/modules/buildCurl.cmake
@@ -3,7 +3,7 @@

   set(SECURE_TRANSPORT_FLAGS "")
   if(APPLE)
-    set(SECURE_TRANSPORT_FLAG "--with-secure-transport")
+    set(SECURE_TRANSPORT_FLAGS "--with-secure-transport")
   endif()

   ExternalProject_Add(BuildCurlBundled


fix build problem with path

fix build problem with path


Remove debug message.

Remove debug message.

--- CPM.cmake
+++ CPM.cmake
@@ -819,7 +819,6 @@

     # Add any includes the module wants to expose in the parent's scope.
     if(DEFINED CPM_ADDITIONAL_INCLUDE_DIRS)
-      message("Additional dir: ${CPM_ADDITIONAL_INCLUDE_DIRS}")
       set(CPM_INCLUDE_DIRS ${CPM_INCLUDE_DIRS} ${CPM_ADDITIONAL_INCLUDE_DIRS})
     endif()


Added more informative error message.

Added more informative error message.

--- CPM.cmake
+++ CPM.cmake
@@ -422,6 +422,7 @@
   # Ensure the parent function knows what we decided to name ourselves.
   # This name will correspond to our module's namespace directives.
   if (NOT CPM_HIERARCHY_LEVEL EQUAL 0)
+    message("Setting HIERARCHY level")
     set(CPM_LAST_MODULE_NAME ${name} PARENT_SCOPE)
   endif()

@@ -774,7 +775,7 @@
   if (DEFINED CPM_LAST_MODULE_NAME)
     _cpm_check_and_add_preproc(${name} ${CPM_LAST_MODULE_NAME} ${__CPM_FULL_UNID})
   else()
-    message(FATAL_ERROR "A ${CPM_LAST_MODULE_NAME} module (${__CPM_MODULE_SOURCE_DIR}) failed to define its name!")
+    message(FATAL_ERROR "A module (${name}) failed to define its name!")
   endif()

   # Set the appropriate preprocessor definition for this module and populate


pw_build: Alter CMake's pw_add_test API contract

Changes the CMake pw_add_test function to always produce a new
{NAME}.bin target. In addition, the {NAME} target is changed to
depend on the ${NAME}.run target if pw_unit_test_AUTOMATIC_RUNNER
is set and otherwise to depend on ${NAME}.bin to only build the
tests.

pw_add_test_to_groups is updated to only provide the run target
if pw_unit_test_AUTOMATIC_RUNNER is provided.

Change-Id: I4a0cab53373cf3e8ee34c4c97970bd4b026f3c75
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/116575
Pigweed-Auto-Submit: Ewout van Bekkum <638f134dbc68778d6b859fb04a64baea2b00b021@google.com>
Commit-Queue: Ewout van Bekkum <638f134dbc68778d6b859fb04a64baea2b00b021@google.com>
Reviewed-by: Wyatt Hepler <cca3bedb37979eacd157a9bceb473582df8aea1e@google.com>

--- pw_build/pigweed.cmake
+++ pw_build/pigweed.cmake
@@ -662,9 +662,11 @@

 # Using pw_add_test, it creates the following targets:
 #
+#   {NAME} depends on ${NAME}.run if pw_unit_test_AUTOMATIC_RUNNER is set, else
+#          it depends on ${NAME}.bin
 #   {NAME}.lib contains the provided test sources as a library target, which can
 #              then be linked into a test executable.
-#   {NAME} is a standalone executable which contains only the test sources
+#   {NAME}.bin is a standalone executable which contains only the test sources
 #          specified in the pw_unit_test_template.
 #   {NAME}.run which runs the unit test executable after building it if
 #              pw_unit_test_AUTOMATIC_RUNNER is set, else it fails to build.
@@ -731,17 +733,21 @@
   # TODO(ewout, hepler): Enable the use of pw_unit_test_EXECUTABLE_TARGET_TYPE &
   # pw_unit_test_EXECUTABLE_TARGET_TYPE_FILE for stamping out unit test
   # executables where we only pass the name and the lib target as args.
-  add_executable("${NAME}" EXCLUDE_FROM_ALL)
-  target_link_libraries("${NAME}" PRIVATE "${NAME}.lib")
-
+  add_executable("${NAME}.bin" EXCLUDE_FROM_ALL)
+  target_link_libraries("${NAME}.bin" PRIVATE "${NAME}.lib")
+
+  add_custom_target("${NAME}")
   if("${pw_unit_test_AUTOMATIC_RUNNER}" STREQUAL "")
+    # Test runner is not provided, only build the executable.
+    add_dependencies("${NAME}" "${NAME}.bin")
+
     pw_add_error_target("${NAME}.run"
       MESSAGE
         "Attempted to build ${NAME}.run which is not available because "
         "pw_unit_test_AUTOMATIC_RUNNER has not been configured. "
         "See https://pigweed.dev/pw_unit_test."
     )
-  else()
+  else()  # pw_unit_test_AUTOMATIC_RUNNER is provided.
     # Define a target for running the test. The target creates a stamp file to
     # indicate successful test completion. This allows running tests in parallel
     # with Ninja's full dependency resolution.
@@ -756,17 +762,18 @@
       COMMAND
         python3 -m pw_unit_test.test_runner
         --runner "${pw_unit_test_AUTOMATIC_RUNNER}"
-        --test "$<TARGET_FILE:${NAME}>"
+        --test "$<TARGET_FILE:${NAME}.bin>"
         ${optional_timeout_arg}
         ${optional_runner_args}
       COMMAND
         "${CMAKE_COMMAND}" -E touch "${NAME}.stamp"
       DEPENDS
-        "${NAME}"
+        "${NAME}.bin"
       OUTPUT
         "${NAME}.stamp"
     )
     add_custom_target("${NAME}.run" DEPENDS "${NAME}.stamp")
+    add_dependencies("${NAME}" "${NAME}.run")
   endif()

   # Always add tests to the "all" group. If no groups are provided, add the
@@ -791,7 +798,7 @@
       add_custom_target("pw_run_tests.${group}")
     endif()

-    add_dependencies("pw_tests.${group}" "${TEST_NAME}")
+    add_dependencies("pw_tests.${group}" "${TEST_NAME}.bin")
     add_dependencies("pw_run_tests.${group}" "${TEST_NAME}.run")
   endforeach()
 endfunction(pw_add_test_to_groups)


binding.gyp.cmake: Fix npm builds for node 0.12.x

Signed-off-by: Brendan Le Foll <3e0e8c4069934e8b47d99704927a85c66c0ceb33@intel.com>

--- src/javascript/binding.gyp.cmake
+++ src/javascript/binding.gyp.cmake
@@ -10,7 +10,7 @@
 @mraa_LIB_INCLUDE_DIRS_GYP@
                       ],
       'variables': {
-          "v8_version%": "<!(node -e 'console.log(process.versions.v8)' | sed 's/\.//g')",
+          "v8_version%": "<!(node -e 'console.log(process.versions.v8)' | sed 's/\.//g' | cut -c 1-5)",
           "arch%": "<!(node -e 'console.log(process.arch)')"
       },
       'cflags_cc!': [ '-fno-rtti', '-fno-exceptions' ],


Fix paths for use_package_kNet.

Fix paths for use_package_kNet.

--- cmake/ConfigurePackages.cmake
+++ cmake/ConfigurePackages.cmake
@@ -205,28 +205,21 @@
 macro(use_package_knet)
     message ("** Configuring KNET")

-    # Use KNET_DIR_QT47 if there, fallback to TUNDRA_DEP_PATH
-    if ("${ENV_KNET_DIR_QT47}" STREQUAL "")
-        set (KNET_DIR ${ENV_TUNDRA_DEP_PATH}/include)
-    else ()
-        message (STATUS "-- Using from env variable KNET_DIR_QT47")
-        set (KNET_DIR ${ENV_KNET_DIR_QT47})
-    endif ()
-
-    # Report findings
+    set(KNET_DIR ${ENV_KNET_DIR_QT47})
+
+    # If KNET_DIR_QT47 was not specified, use kNet from TUNDRA_DEP_PATH.
+    if ("${KNET_DIR}" STREQUAL "")
+        if (MSVC)
+            set(KNET_DIR ${ENV_TUNDRA_DEP_PATH}/kNet)
+        else()
+            set(KNET_DIR ${ENV_TUNDRA_DEP_PATH})
+        endif()
+    endif()
+
     include_directories (${KNET_DIR}/include)
-    message (STATUS "-- Include Directories:")
-    message (STATUS "       " ${KNET_DIR}/include)
     link_directories (${KNET_DIR}/lib)
-    message (STATUS "-- Library Directories:")
-    message (STATUS "       " ${KNET_DIR}/lib)
-    message (STATUS "-- Libraries:")
-    message (STATUS "       kNet")
-    message ("")
-
-    if (UNIX)
-        add_definitions (-DUNIX)
-    endif()
+
+    message (STATUS "Using kNet from $(KNET_DIR)")
 endmacro()

 macro(link_package_knet)


build: bump MSVC warning level to 2

build: bump MSVC warning level to 2

--- cmake/ExtraWarningFlags.cmake
+++ cmake/ExtraWarningFlags.cmake
@@ -5,7 +5,7 @@

 if (MSVC)
   set (EXTRA_WARNING_FLAGS
-    /W1)
+    /W2)
 else ()
   set (EXTRA_WARNING_FLAGS
     -Wall


cmake: fix CUDA flags generation

cmake: fix CUDA flags generation

VTK uses parentheses in defines, so generated code is wrong:
set(nvcc_flags -m64;-D__OPENCV_BUILD=1;-DvtkRenderingContext2D_AUTOINIT=1(vtkRenderingContextOpenGL);...)

--- cmake/FindCUDA/run_nvcc.cmake
+++ cmake/FindCUDA/run_nvcc.cmake
@@ -72,7 +72,7 @@
 set(CUDA_NVCC_EXECUTABLE "@CUDA_NVCC_EXECUTABLE@") # path
 set(CUDA_NVCC_FLAGS @CUDA_NVCC_FLAGS@ ;; @CUDA_WRAP_OPTION_NVCC_FLAGS@) # list
 @CUDA_NVCC_FLAGS_CONFIG@
-set(nvcc_flags @nvcc_flags@) # list
+set(nvcc_flags "@nvcc_flags@") # list
 set(CUDA_NVCC_INCLUDE_ARGS "@CUDA_NVCC_INCLUDE_ARGS@") # list (needs to be in quotes to handle spaces properly).
 set(format_flag "@format_flag@") # string


highgui: fixed build GTK2+OpenGL

highgui: fixed build GTK2+OpenGL

--- cmake/OpenCVFindLibsGUI.cmake
+++ cmake/OpenCVFindLibsGUI.cmake
@@ -64,7 +64,7 @@
   if(WITH_OPENGL AND NOT HAVE_GTK3)
     ocv_check_modules(GTKGLEXT gtkglext-1.0)
     if(HAVE_GTKGLEXT)
-      ocv_append_build_options(GTKGLEXT GTHREAD)
+      ocv_append_build_options(HIGHGUI GTKGLEXT)
     endif()
   endif()
 endif()


compiler-warnings: lower stack/frame size warning down to 8K (2 page)

I'd probably prefer 4K, but that currently results in some
more warnings on OSX.

--- cmake/compiler-warnings.cmake
+++ cmake/compiler-warnings.cmake
@@ -26,7 +26,8 @@
 CHECK_CXX_COMPILER_FLAG_AND_ENABLE_IT(-Wno-error=shadow)

 # should be < 64Kb
-math(EXPR MAX_MEANINGFUL_SIZE 16*1024)
+# FIXME: 4K
+math(EXPR MAX_MEANINGFUL_SIZE 8*1024)
 CHECK_CXX_COMPILER_FLAG_AND_ENABLE_IT(-Wframe-larger-than=${MAX_MEANINGFUL_SIZE})
 CHECK_CXX_COMPILER_FLAG_AND_ENABLE_IT(-Wstack-usage=${MAX_MEANINGFUL_SIZE})


Temporarily disable Clang-Tidy (it slows the build quite a bit).

--- cmake/environmentchecks.cmake
+++ cmake/environmentchecks.cmake
@@ -18,8 +18,9 @@

 find_package(Python ${PREFERRED_PYTHON_VERSION} COMPONENTS Interpreter Development)

+#ISSUE359 -- Re-enable Clang-Tidy below...
 find_program(CLANG_FORMAT_EXE NAMES ${PREFERRED_CLANG_FORMAT_NAMES} clang-format)
-find_program(CLANG_TIDY_EXE NAMES ${PREFERRED_CLANG_TIDY_NAMES} clang-tidy)
+#find_program(CLANG_TIDY_EXE NAMES ${PREFERRED_CLANG_TIDY_NAMES} clang-tidy)
 find_program(FIND_EXE NAMES ${PREFERRED_FIND_NAMES} find)
 find_program(GCOV_EXE NAMES ${PREFERRED_GCOV_NAMES} gcov)
 find_program(GIT_EXE NAMES ${PRFERRED_GIT_NAMES} git)


sdk: require Zephyr SDK 0.9.4

sdk: require Zephyr SDK 0.9.4

Due to changes to Qemu and DTC, we do require at least SDK version 0.9.4
now.

Signed-off-by: Anas Nashif <0d9952ec84ac43c159f6b7e7ed99a9080c00dd6e@intel.com>

--- cmake/host-tools-zephyr.cmake
+++ cmake/host-tools-zephyr.cmake
@@ -15,7 +15,7 @@
   return()
 endif()

-set(REQUIRED_SDK_VER 0.9.3)
+set(REQUIRED_SDK_VER 0.9.5)
 set(TOOLCHAIN_VENDOR zephyr)
 set(TOOLCHAIN_ARCH x86_64)


Made a branch to add support for gcc-4.2. Tried to fix LPSCommon.cmake to support tr1 unordered_map and unordered_set.  Does not work.  Need Jim's help.

--- cmake_modules/LPSCommon.cmake
+++ cmake_modules/LPSCommon.cmake
@@ -124,9 +124,6 @@
     check_include_file_cxx(forward_list HAVE_FORWARD_LIST)
     check_include_file_cxx(fstream HAVE_FSTREAM)
     check_include_file_cxx(forward_list HAVE_FORWARD_LIST)
-    if(NOT HAVE_FORWARD_LIST)
-        message(FATAL_ERROR "ERROR: ${CMAKE_CXX_COMPILER} does not appear to support forward_list. Configure phase aborted")
-    endif()
     check_include_file_cxx(functional HAVE_FUNCTIONAL)
     check_include_file_cxx(iomanip HAVE_IOMANIP)
     check_include_file_cxx(ios HAVE_IOS)
@@ -151,11 +148,19 @@
     check_include_file_cxx(string HAVE_STRING)
     check_include_file_cxx(unordered_map HAVE_UNORDERED_MAP)
      if(NOT HAVE_UNORDERED_MAP)
-        message(FATAL_ERROR "ERROR: ${CMAKE_CXX_COMPILER} does not appear to support unordered_map. Configure phase aborted")
+        check_include_file_cxx(tr1/unordered_map HAVE_TR1_UNORDERED_MAP)
+
+        if(NOT HAVE_TR1_UNORDERED_MAP)
+            message(FATAL_ERROR "ERROR: ${CMAKE_CXX_COMPILER} does not appear to support unordered_map. Configure phase aborted")
+        endif()
     endif()
     check_include_file_cxx(unordered_set HAVE_UNORDERED_SET)
-     if(NOT HAVE_UNORDERED_SET)
-        message(FATAL_ERROR "ERROR: ${CMAKE_CXX_COMPILER} does not appear to support unordered_set. Configure phase aborted")
+    if(NOT HAVE_UNORDERED_SET)
+        check_include_file_cxx(tr1/unordered_set HAVE_TR1_UNORDERED_SET)
+
+        if(NOT HAVE_TR1_UNORDERED_SET)
+            message(FATAL_ERROR "ERROR: ${CMAKE_CXX_COMPILER} does not appear to support unordered_set. Configure phase aborted")
+        endif()
     endif()
     check_include_file_cxx(typeinfo HAVE_TYPEINFO)
     check_include_file_cxx(utility HAVE_UTILITY)


automatically find c++ include directories (without having a hard path)

--- backends/cmake/arm-none-eabi-gcc.cmake
+++ backends/cmake/arm-none-eabi-gcc.cmake
@@ -7,6 +7,8 @@
 if (NOT EXISTS ${CROSS_COMPIL_TOOLS})
 	message (FATAL_ERROR "Can't find cross compilation tool chain")
 endif()
+
+

 SET(CPREF				${CROSS_COMPIL_TOOLS}/arm-none-eabi)
 SET(CMAKE_C_COMPILER	${CPREF}-gcc CACHE STRING "arm-none-eabi-gcc" FORCE)
@@ -28,10 +30,12 @@
 SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "")
 SET(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "")

+
 # here is the target environment is located
 SET(CMAKE_FIND_ROOT_PATH	${CROSS_COMPIL_TOOLS})
 include_directories(${CROSS_COMPIL_TOOLS}/../arm-none-eabi/include/)
-include_directories(${CROSS_COMPIL_TOOLS}/../arm-none-eabi/include/c++/4.8.4)
+file(GLOB _CPP_INCLUDE_DIR_ ${CROSS_COMPIL_TOOLS}/../arm-none-eabi/include/c++/*)
+include_directories(${_CPP_INCLUDE_DIR_})

 if (NOT OPTIM_LEVEL)
 	set (OPTIM_LEVEL "3")


Prevent configuration error if !OGRE_BUILD_PLUGIN_CG and ${Cg_BINARY_DBG} is empty

--- CMake/InstallDependencies.cmake
+++ CMake/InstallDependencies.cmake
@@ -223,22 +223,24 @@
 		endif()
 	endif()

-    if (OGRE_BUILD_PLUGIN_CG AND EXISTS ${Cg_BINARY_DBG} AND EXISTS ${Cg_BINARY_REL})
-      # if MinGW or NMake, the release/debug cg.dll's would conflict, so just pick one
-      if (MINGW OR (CMAKE_GENERATOR STREQUAL "NMake Makefiles"))
-        if (CMAKE_BUILD_TYPE STREQUAL "Debug")
-          file(COPY ${Cg_BINARY_DBG} DESTINATION ${OGRE_BINARY_DIR}/bin/debug)
+    if (OGRE_BUILD_PLUGIN_CG)
+      if (EXISTS ${Cg_BINARY_DBG} AND EXISTS ${Cg_BINARY_REL})
+        # if MinGW or NMake, the release/debug cg.dll's would conflict, so just pick one
+        if (MINGW OR (CMAKE_GENERATOR STREQUAL "NMake Makefiles"))
+          if (CMAKE_BUILD_TYPE STREQUAL "Debug")
+            file(COPY ${Cg_BINARY_DBG} DESTINATION ${OGRE_BINARY_DIR}/bin/debug)
+          else ()
+            file(COPY ${Cg_BINARY_REL} DESTINATION ${OGRE_BINARY_DIR}/bin/release)
+      			file(COPY ${Cg_BINARY_REL} DESTINATION ${OGRE_BINARY_DIR}/bin/relwithdebinfo)
+      			file(COPY ${Cg_BINARY_REL} DESTINATION ${OGRE_BINARY_DIR}/bin/minsizerel)
+          endif ()
         else ()
-          file(COPY ${Cg_BINARY_REL} DESTINATION ${OGRE_BINARY_DIR}/bin/release)
-    			file(COPY ${Cg_BINARY_REL} DESTINATION ${OGRE_BINARY_DIR}/bin/relwithdebinfo)
-    			file(COPY ${Cg_BINARY_REL} DESTINATION ${OGRE_BINARY_DIR}/bin/minsizerel)
+            file(COPY ${Cg_BINARY_DBG} DESTINATION ${OGRE_BINARY_DIR}/bin/debug)
+      		file(COPY ${Cg_BINARY_REL} DESTINATION ${OGRE_BINARY_DIR}/bin/release)
+      		file(COPY ${Cg_BINARY_REL} DESTINATION ${OGRE_BINARY_DIR}/bin/relwithdebinfo)
+      		file(COPY ${Cg_BINARY_REL} DESTINATION ${OGRE_BINARY_DIR}/bin/minsizerel)
         endif ()
-      else ()
-            file(COPY ${Cg_BINARY_DBG} DESTINATION ${OGRE_BINARY_DIR}/bin/debug)
-    		file(COPY ${Cg_BINARY_REL} DESTINATION ${OGRE_BINARY_DIR}/bin/release)
-    		file(COPY ${Cg_BINARY_REL} DESTINATION ${OGRE_BINARY_DIR}/bin/relwithdebinfo)
-    		file(COPY ${Cg_BINARY_REL} DESTINATION ${OGRE_BINARY_DIR}/bin/minsizerel)
-      endif ()
+      endif()
     endif()

     if (OGRE_BUILD_RENDERSYSTEM_GLES)


[OS X] Remove unnecessary dependency lib copies. Resolves strange errors during CMake configuration.

--HG--
branch : v1-9

--- CMake/InstallDependencies.cmake
+++ CMake/InstallDependencies.cmake
@@ -114,13 +114,6 @@
 		install(FILES ${OIS_LIBRARY_REL} DESTINATION lib/release CONFIGURATIONS Release)
 		install(FILES ${OIS_LIBRARY_REL} DESTINATION lib/minsizerel CONFIGURATIONS MinSizeRel)
 	  endif ()
-	elseif(APPLE)
-#        install(FILES
-#          ${OGRE_DEP_DIR}/lib/$(PLATFORM_NAME)/$(CONFIGURATION)/libOIS.a
-#          DESTINATION lib/$(PLATFORM_NAME)/$(CONFIGURATION)
-#        )
-      install_debug(libOIS.a)
-      install_release(libOIS.a)
 	endif ()
 	  endif ()

@@ -155,15 +148,6 @@
     if (OGRE_BUILD_RENDERSYSTEM_GLES2)
       install_debug(libGLESv2.dll)
 	  install_release(libEGL.dll)
-    endif ()
-  elseif(APPLE)
-    # copy the dependency libs to the right places
-    install_debug(libOIS.a)
-    install_release(libOIS.a)
-
-    if (OGRE_BUILD_PLUGIN_CG)
-      install_debug(Cg.framework)
-      install_release(Cg.framework)
     endif ()
   endif ()

@@ -284,16 +268,6 @@
       copy_release(libEGL.dll)
       copy_release(libGLESv2.dll)
     endif ()
-
-  elseif(APPLE AND NOT OGRE_BUILD_PLATFORM_APPLE_IOS)
-    # copy the required libs and frameworks to the build directory (configure_file is the only copy-like op I found in CMake)
-    copy_debug(libOIS.a)
-    copy_release(libOIS.a)
-
-    if (OGRE_BUILD_PLUGIN_CG)
-      copy_debug(Cg.framework)
-      copy_release(Cg.framework)
-    endif ()
   endif ()

 endif ()


CMake: Disable profiling and C# with MinGW.

--- CMake/Modules/UrhoOptions.cmake
+++ CMake/Modules/UrhoOptions.cmake
@@ -77,14 +77,14 @@
 option                (URHO3D_NAVIGATION         "Navigation subsystem enabled"                          ${URHO3D_ENABLE_ALL})
 cmake_dependent_option(URHO3D_NETWORK            "Networking subsystem enabled"                          ${URHO3D_ENABLE_ALL} "NOT WEB"                       OFF)
 option                (URHO3D_PHYSICS            "Physics subsystem enabled"                             ${URHO3D_ENABLE_ALL})
-cmake_dependent_option(URHO3D_PROFILING          "Profiler support enabled"                              ${URHO3D_ENABLE_ALL} "NOT WEB"                       OFF)
+cmake_dependent_option(URHO3D_PROFILING          "Profiler support enabled"                              ${URHO3D_ENABLE_ALL} "NOT WEB;NOT MINGW"             OFF)
 cmake_dependent_option(URHO3D_PROFILING_SYSTRACE "Profiler systrace support enabled"                     OFF                  "URHO3D_PROFILING"              OFF)
 option                (URHO3D_SYSTEMUI           "Build SystemUI subsystem"                              ${URHO3D_ENABLE_ALL})
 option                (URHO3D_URHO2D             "2D subsystem enabled"                                  ${URHO3D_ENABLE_ALL})
 option                (URHO3D_RMLUI              "HTML subset UIs via RmlUI middleware"                  ${URHO3D_ENABLE_ALL})

 # Features
-cmake_dependent_option(URHO3D_CSHARP             "Enable C# support"                                     OFF                  "BUILD_SHARED_LIBS"             OFF)
+cmake_dependent_option(URHO3D_CSHARP             "Enable C# support"                                     OFF                  "BUILD_SHARED_LIBS;NOT MINGW"   OFF)
 # Valid values at https://docs.microsoft.com/en-us/dotnet/standard/frameworks
 set(URHO3D_NETFX net471 CACHE STRING "TargetFramework value for .NET projects")
 set_property(CACHE URHO3D_NETFX PROPERTY STRINGS net46 net461 net462 net47 net471 net472 net48)


Always add the plugin root dir to the list of include dirs.

--- CMake/ctkMacroBuildPlugin.cmake
+++ CMake/ctkMacroBuildPlugin.cmake
@@ -107,21 +107,18 @@
     FOREACH(_suffix ${MY_EXPORTED_INCLUDE_SUFFIXES})
       LIST(APPEND my_includes ${CMAKE_CURRENT_SOURCE_DIR}/${_suffix})
     ENDFOREACH()
-
-    LIST(APPEND my_includes
-         ${CMAKE_CURRENT_BINARY_DIR}
-         ${MY_INCLUDE_DIRECTORIES}
-         )
   ELSE()
-    SET(${lib_name}_INCLUDE_SUFFIXES ${MY_EXPORTED_INCLUDE_SUFFIXES}  ""
+    SET(${lib_name}_INCLUDE_SUFFIXES ""
         CACHE INTERNAL "List of exported plugin include dirs")

-    SET(my_includes
-        ${CMAKE_CURRENT_SOURCE_DIR}
-        ${CMAKE_CURRENT_BINARY_DIR}
-        ${MY_INCLUDE_DIRECTORIES}
-        )
-  ENDIF()
+    SET(my_includes )
+  ENDIF()
+
+  LIST(APPEND my_includes
+      ${CMAKE_CURRENT_SOURCE_DIR}
+      ${CMAKE_CURRENT_BINARY_DIR}
+      ${MY_INCLUDE_DIRECTORIES}
+      )

   # Add the include directories from the plugin dependencies
   # and external dependencies


update math detection

update math detection

--- cmake/downloaded/autocmake_math_libs.cmake
+++ cmake/downloaded/autocmake_math_libs.cmake
@@ -332,34 +332,6 @@
 endmacro()

 macro(config_math_service _SERVICE)
-    if(EXISTS $ENV{MATH_ROOT})
-        if("${${_SERVICE}_ROOT}" STREQUAL "")
-            set(${_SERVICE}_ROOT $ENV{MATH_ROOT})
-            message("-- ${_SERVICE} will be searched for based on MATH_ROOT=${${_SERVICE}_ROOT} ")
-        endif()
-    endif()
-
-    if(EXISTS $ENV{${_SERVICE}_ROOT})
-        if("${${_SERVICE}_ROOT}" STREQUAL "")
-            set(${_SERVICE}_ROOT $ENV{${_SERVICE}_ROOT})
-            message("-- ${_SERVICE} will be searched for based on ${_SERVICE}_ROOT=${${_SERVICE}_ROOT}")
-        endif()
-    endif()
-
-    if(EXISTS $ENV{MKL_ROOT})
-        if("${${_SERVICE}_ROOT}" STREQUAL "")
-            set(${_SERVICE}_ROOT $ENV{MKL_ROOT})
-            message("-- ${_SERVICE} will be searched for based on MKL_ROOT=${${_SERVICE}_ROOT}")
-        endif()
-    endif()
-
-    if(EXISTS $ENV{MKLROOT})
-        if("${${_SERVICE}_ROOT}" STREQUAL "")
-            set(${_SERVICE}_ROOT $ENV{MKLROOT})
-            message("-- ${_SERVICE} will be searched for based on MKLROOT=${${_SERVICE}_ROOT}")
-        endif()
-    endif()
-
     if(${_SERVICE}_INCLUDE_DIRS AND ${_SERVICE}_LIBRARIES)
         set(${_SERVICE}_FIND_QUIETLY TRUE)
     endif()
@@ -397,11 +369,6 @@
         find_package_message(${_SERVICE}
             "Found ${_SERVICE}: ${${_SERVICE}_TYPE} (${${_SERVICE}_LIBRARIES})"
             "[${${_SERVICE}_LIBRARIES}]"
-            )
-
-        set(MATH_LIBS
-            ${MATH_LIBS}
-            ${${_SERVICE}_LIBRARIES}
             )
     else()
         add_definitions(-DUSE_BUILTIN_${_SERVICE})
@@ -446,8 +413,6 @@
         message(FATAL_ERROR "Invalid ${_service} library linker language: ${${_service}_LANG}")
     endif()
 endforeach()
-
-set(MATH_LIBS)

 if(NOT MKL_FLAG STREQUAL "off")
     set(EXTERNAL_LIBS ${EXTERNAL_LIBS} -mkl=${MKL_FLAG})
@@ -459,17 +424,57 @@
     add_definitions(-DHAVE_MKL_LAPACK)
     set(BLAS_FOUND TRUE)
     set(LAPACK_FOUND TRUE)
-endif()
-
-if(ENABLE_BLAS STREQUAL "auto" OR ENABLE_LAPACK STREQUAL "auto" AND NOT ${_service}_FOUND)
-    message(STATUS "Math lib search order is ${MATH_LIB_SEARCH_ORDER}")
-endif()
-
-foreach(_service BLAS LAPACK)
-    if(ENABLE_${_service} STREQUAL "auto" AND NOT ${_service}_FOUND)
-        config_math_service(${_service})
-        if(${_service}_FOUND)
-            include_directories(${${_service}_INCLUDE_DIRS})
-        endif()
-    endif()
-endforeach()
+
+    # workaround to avoid warning for unused vars
+    set(_unused ${ENABLE_BLAS})
+    set(_unused ${ENABLE_LAPACK})
+    set(_unused ${MATH_LIB_SEARCH_ORDER})
+    unset(_unused)
+endif()
+
+if("${MATH_LIBS}" STREQUAL "" AND "${MKL_FLAG}" STREQUAL "off")
+    foreach(_service BLAS LAPACK)
+        if(ENABLE_${_service} STREQUAL "auto")
+            if(EXISTS $ENV{MATH_ROOT})
+                if("${${_service}_ROOT}" STREQUAL "")
+                    set(${_service}_ROOT $ENV{MATH_ROOT})
+                    message(STATUS "${_service} will be searched for based on MATH_ROOT=${${_service}_ROOT} ")
+                endif()
+            endif()
+
+            if(EXISTS $ENV{${_service}_ROOT})
+                if("${${_service}_ROOT}" STREQUAL "")
+                    set(${_service}_ROOT $ENV{${_service}_ROOT})
+                    message(STATUS "${_service} will be searched for based on ${_service}_ROOT=${${_service}_ROOT}")
+                endif()
+            endif()
+
+            if(EXISTS $ENV{MKL_ROOT})
+                if("${${_service}_ROOT}" STREQUAL "")
+                    set(${_service}_ROOT $ENV{MKL_ROOT})
+                    message(STATUS "${_service} will be searched for based on MKL_ROOT=${${_service}_ROOT}")
+                endif()
+            endif()
+
+            if(EXISTS $ENV{MKLROOT})
+                if("${${_service}_ROOT}" STREQUAL "")
+                    set(${_service}_ROOT $ENV{MKLROOT})
+                    message(STATUS "${_service} will be searched for based on MKLROOT=${${_service}_ROOT}")
+                endif()
+            endif()
+
+            message(STATUS "Searching for ${_service} using search order ${MATH_LIB_SEARCH_ORDER}")
+            config_math_service(${_service})
+            if(${_service}_FOUND)
+                include_directories(${${_service}_INCLUDE_DIRS})
+            endif()
+        endif()
+    endforeach()
+endif()
+
+set(MATH_LIBS
+    ${MATH_LIBS}
+    ${BLAS_LIBRARIES}
+    ${LAPACK_LIBRARIES}
+    CACHE STRING "Math libraries"
+    )


remove manually specified settings from auto list

--- conan.cmake
+++ conan.cmake
@@ -229,6 +229,13 @@
                                    compiler.runtime compiler.libcxx compiler.toolset)
     endif()

+    # remove any manually specified settings from the autodetected settings
+    foreach(ARG ${ARGUMENTS_SETTINGS})
+        string(REGEX MATCH "[^=]*" MANUAL_SETTING "${ARG}")
+        message(STATUS "Conan: ${MANUAL_SETTING} was added as an argument. Not using the autodetected one.")
+        list(REMOVE_ITEM ARGUMENTS_PROFILE_AUTO "${MANUAL_SETTING}")
+    endforeach()
+
     # Automatic from CMake
     foreach(ARG ${ARGUMENTS_PROFILE_AUTO})
         string(TOUPPER ${ARG} _arg_name)


test=develop

test=develop

--- cmake/flags.cmake
+++ cmake/flags.cmake
@@ -157,7 +157,7 @@
         # On Mac OS X build fat binaries with x86_64 architectures by default.
         set (CMAKE_OSX_ARCHITECTURES "x86_64" CACHE STRING "Build architectures for OSX" FORCE)
     endif()
-    # On Mac OS X register class specifier is deprecated and will cause warning error on latest clang
+    # On Mac OS X register class specifier is deprecated and will cause warning error on latest clang 10.0.0
     set (COMMON_FLAGS -Wno-deprecated-register)
 endif(APPLE)


added download_test_data

added download_test_data

--- cmake/tests.cmake
+++ cmake/tests.cmake
@@ -189,3 +189,14 @@

   append_test_to_cache(catkin-tests "${_chdir_prefix}${rostest_exe} ${_file_name}${_chdir_suffix}")
 endfunction()
+
+# Function to download data on the tests target
+function(download_test_data _url _filename _md5)
+  # Create a legal target name, in case the target name has slashes in it
+  string(REPLACE "/" "_" _testname download_data_${_filename})
+  add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/${_filename}
+                     COMMAND ${catkin_EXTRAS_DIR}/test/download_checkmd5.py ${_url} ${PROJECT_BINARY_DIR}/${_filename} ${_md5}
+                     VERBATIM)
+  add_custom_target(${_testname} DEPENDS ${PROJECT_BINARY_DIR}/${_filename})
+  add_dependencies(tests ${_testname})
+endfunction()


Use CAPTURE_CMAKE_ERROR to (hopefully) correctly capture inferior command status

Use it in ctest_configure(), ctest_build) and ctest_test().

--- scripts/test.cmake
+++ scripts/test.cmake
@@ -146,11 +146,12 @@
 IF (EMBREE_TESTING_INTENSITY GREATER 0)
   update_test_models()
 ENDIF()
-ctest_configure()
+ctest_configure(CAPTURE_CMAKE_ERROR capture_configure_error)

 ctest_build(RETURN_VALUE retval
             NUMBER_ERRORS build_errors
-            NUMBER_WARNINGS build_warnings)
+            NUMBER_WARNINGS build_warnings
+	    CAPTURE_CMAKE_ERROR capture_build_error)
 message("test.cmake: ctest_build return value = ${retval}")
 message("test.cmake: ctest_build #errors = ${build_errors}")
 message("test.cmake: ctest_build #warnings = ${build_warnings}")
@@ -159,7 +160,8 @@
 ENDIF()

 IF (EMBREE_TESTING_INTENSITY GREATER 0 OR EMBREE_TESTING_KLOCWORK)
-  ctest_test(RETURN_VALUE retval)
+  ctest_test(RETURN_VALUE retval
+             CAPTURE_CMAKE_ERROR capture_test_error)
   message("test.cmake: ctest_test return value = ${retval}")
   IF (NOT retval EQUAL 0)
     message(FATAL_ERROR "test.cmake: some tests failed")


Install ressources according to OGRE_LIB_DIRECTORY .

--- CMake/InstallResources.cmake
+++ CMake/InstallResources.cmake
@@ -46,10 +46,10 @@
   set(OGRE_MEDIA_PATH "share/OGRE/media")
   set(OGRE_MEDIA_DIR_REL "${CMAKE_INSTALL_PREFIX}/${OGRE_MEDIA_PATH}")
   set(OGRE_MEDIA_DIR_DBG "${CMAKE_INSTALL_PREFIX}/${OGRE_MEDIA_PATH}")
-  set(OGRE_PLUGIN_DIR_REL "${CMAKE_INSTALL_PREFIX}/lib/OGRE")
-  set(OGRE_PLUGIN_DIR_DBG "${CMAKE_INSTALL_PREFIX}/lib/OGRE")
-  set(OGRE_SAMPLES_DIR_REL "${CMAKE_INSTALL_PREFIX}/lib/OGRE/Samples")
-  set(OGRE_SAMPLES_DIR_DBG "${CMAKE_INSTALL_PREFIX}/lib/OGRE/Samples")
+  set(OGRE_PLUGIN_DIR_REL "${CMAKE_INSTALL_PREFIX}/${OGRE_LIB_DIRECTORY}/OGRE")
+  set(OGRE_PLUGIN_DIR_DBG "${CMAKE_INSTALL_PREFIX}/${OGRE_LIB_DIRECTORY}/OGRE")
+  set(OGRE_SAMPLES_DIR_REL "${CMAKE_INSTALL_PREFIX}/${OGRE_LIB_DIRECTORY}/OGRE/Samples")
+  set(OGRE_SAMPLES_DIR_DBG "${CMAKE_INSTALL_PREFIX}/${OGRE_LIB_DIRECTORY}/OGRE/Samples")
   set(OGRE_CFG_INSTALL_PATH "share/OGRE")
 endif ()


CMake: mbed_greentea: Remove trailing whitespace

--- tools/cmake/mbed_greentea.cmake
+++ tools/cmake/mbed_greentea.cmake
@@ -11,7 +11,7 @@
 # TEST_INCLUDE_DIRS - Test suite include directories for the test
 # TEST_SOURCES - Test suite sources
 # TEST_REQUIRED_LIBS - Test suite required libraries
-#
+#
 # calling the macro:
 # mbed_greentea_add_test(
 #    TEST_NAME mbed-platform-system-reset
@@ -59,7 +59,7 @@
     # For example:
     #  - To select mbed-os library, use cmake with -DMBED_TEST_LINK_LIBRARIES=mbed-os
     #  - To select baremetal library, use cmake with -DMBED_TEST_LINK_LIBRARIES=mbed-baremetal
-    #  - To select baremetal with extra external error logging library to the test, use cmake with
+    #  - To select baremetal with extra external error logging library to the test, use cmake with
     #    -D "MBED_TEST_LINK_LIBRARIES=mbed-baremetal ext-errorlogging"
     if (DEFINED MBED_TEST_LINK_LIBRARIES)
         separate_arguments(MBED_TEST_LINK_LIBRARIES)


ADD (#1145): predicate that allows determining, wether a node is in the top level of the hirarchy

--- Core/DataStructures/files.cmake
+++ Core/DataStructures/files.cmake
@@ -41,6 +41,7 @@
   mitkDataStorage/mitkNodePredicateOR.cpp
   mitkDataStorage/mitkNodePredicateProperty.cpp
   mitkDataStorage/mitkNodePredicateSource.cpp
+  mitkDataStorage/mitkNodePredicateFirstLevel.cpp
   mitkDataTree.cpp
   mitkDataTreeFilter.cpp
   mitkDataTreeFilterFunctions.cpp


Update to CMake module (FindEigen3.cmake).

git-svn-id: 4d207786bcfdcf18f314dcbc6ac3fbe5f8a98c88@211 ac7aa084-b6da-11df-bf42-7fac39f0224f

--- External/CMake/FindEigen3.cmake
+++ External/CMake/FindEigen3.cmake
@@ -63,6 +63,7 @@

   find_path(EIGEN3_INCLUDE_DIR NAMES signature_of_eigen3_matrix_library
       PATHS
+      ${PROJECT_SOURCE_DIR}/External
       ${CMAKE_INSTALL_PREFIX}/include
       ${KDE4_INCLUDE_DIR}
       PATH_SUFFIXES eigen3 eigen


google/benchmark master branch doesn't exist anymore (#458)

--- cmake/OpenCensusDeps.cmake
+++ cmake/OpenCensusDeps.cmake
@@ -29,7 +29,7 @@
 FetchContent_Declare(
   benchmark
   GIT_REPOSITORY https://github.com/google/benchmark
-  GIT_TAG master)
+  GIT_TAG main)

 FetchContent_GetProperties(googletest)
 if(BUILD_TESTING)


Revert changes - don't need target_link_libraries

--- cmake/SketchUpAPICpp.cmake
+++ cmake/SketchUpAPICpp.cmake
@@ -6,7 +6,6 @@
 file(GLOB_RECURSE CPP_API_SOURCES ${CPP_API_SOURCE_PATH}/*.cpp)

 add_library(SketchUpAPICpp STATIC ${CPP_API_HEADERS} ${CPP_API_SOURCES})
-target_link_libraries(SketchUpAPICpp LINK_PUBLIC SLAPI_LIB)

 # https://stackoverflow.com/a/14235055/486990
 if ( MSVC )


we need the numgrid fortran interface

we need the numgrid fortran interface

--- cmake/custom/numgrid.cmake
+++ cmake/custom/numgrid.cmake
@@ -11,6 +11,7 @@
     -DCMAKE_Fortran_COMPILER=${CMAKE_Fortran_COMPILER}
     -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
     -DENABLE_UNIT_TESTS=OFF
+    -DENABLE_FC_SUPPORT=ON
   )

 include(GNUInstallDirs)


vita.cmake: Pass VERBATIM option to add_custom_command when generating SFO

This fixes a failure when NAME contains special characters, such as parenthesis.

--- cmake_toolchain/vita.cmake
+++ cmake_toolchain/vita.cmake
@@ -259,6 +259,7 @@
     COMMAND ${VITA_MKSFOEX} ${VITA_MKSFOEX_FLAGS} ${vita_create_vpk_NAME} ${CMAKE_CURRENT_BINARY_DIR}/${target}_param.sfo
     DEPENDS ${sourcepath}
     COMMENT "Generating param.sfo for ${target}"
+    VERBATIM
   )

   set(vpk_outfile ${CMAKE_CURRENT_BINARY_DIR}/${target}.out)


fixing toolchain file for cross-compilation: forcing static link for all libraries (and more specifically libwinpthread-1.dll)

--- cmake/toolchain-i686-w64-mingw32.cmake
+++ cmake/toolchain-i686-w64-mingw32.cmake
@@ -6,7 +6,7 @@
 SET(CMAKE_RC_COMPILER    "i686-w64-mingw32-windres")
 SET(CMAKE_RANLIB         "i686-w64-mingw32-ranlib")

-SET(CMAKE_EXE_LINKER_FLAGS "-static-libgcc -static-libstdc++ -s" CACHE INTERNAL "exe link flags")
+SET(CMAKE_EXE_LINKER_FLAGS "-static-libgcc -static-libstdc++ -static -s" CACHE STRING "exe link flags")

 # Configure the behaviour of the find commands
 SET(CMAKE_FIND_ROOT_PATH "/usr/i686-w64-mingw32")


torque3d.cmake: changed default build type to "Release"

--- Tools/CMake/torque3d.cmake
+++ Tools/CMake/torque3d.cmake
@@ -157,7 +157,7 @@
 # options
 ###############################################################################
 if(NOT MSVC AND NOT APPLE) # handle single-configuration generator
-    set(TORQUE_BUILD_TYPE "Debug" CACHE STRING "Select one of Debug, Release and RelWithDebInfo")
+    set(TORQUE_BUILD_TYPE "Release" CACHE STRING "Select one of Debug, Release and RelWithDebInfo")
     set_property(CACHE TORQUE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "RelWithDebInfo")

     set(TORQUE_ADDITIONAL_LINKER_FLAGS "" CACHE STRING "Additional linker flags")


[Config][CMake] Migrated to new FindPython3 (from deprecated FindPythonLibs)

--- config/project_config_embeddable.cmake
+++ config/project_config_embeddable.cmake
@@ -479,48 +479,36 @@
   unset (_required_version)
   if (${ARGC} GREATER 0)
     set (_required_version ${ARGV0})
-    message (STATUS "Requires PythonLibs-${_required_version}")
+    message (STATUS "Requires Python with version ${_required_version}; however just Python3 is considered here")
   else (${ARGC} GREATER 0)
-    message (STATUS "Requires PythonLibs without specifying any version")
+    message (STATUS "Requires Python3; any version will do")
   endif (${ARGC} GREATER 0)

   # The first check searches for the libraries and include paths.
   # However, on some older versions (e.g., on RedHat/CentOS 5.x),
   # only the static library is searched.
-  find_package (PythonLibs ${_required_version} REQUIRED)
+  find_package (Python3 COMPONENTS Interpreter Development REQUIRED)

   # The second check is to get the dynamic library for sure.
-  find_package (PythonLibsWrapper ${_required_version} REQUIRED)
-
-  if (PYTHONLIBS_FOUND)
-	# Derive the version of Python (for whatever reason, FindPythonLibs
-	# does not seem to provide that version variable.
-	get_filename_component (PYTHONLIBS_LIB_FILENAME ${PYTHON_LIBRARIES} NAME)
-	string (REGEX REPLACE "^libpython([0-9]+.[0-9]+).*$" "\\1"
-	  PYTHONLIBS_VERSION "${PYTHONLIBS_LIB_FILENAME}")
-
-	if (${PYTHONLIBS_VERSION_STRING} MATCHES "([0-9]).([0-9]).([0-9])")
-	  set (PY_MAJOR_VERSION "${CMAKE_MATCH_1}")
-	  set (PY_MINOR_VERSION "${CMAKE_MATCH_2}")
-	  set (PY_PATCH_VERSION "${CMAKE_MATCH_3}")
-	endif (${PYTHONLIBS_VERSION_STRING} MATCHES "([0-9]).([0-9]).([0-9])")
-
-	message (STATUS "Found PythonLibs ${PYTHONLIBS_VERSION} (${PYTHONLIBS_VERSION_STRING} / ${PY_MAJOR_VERSION}.${PY_MINOR_VERSION}.${PY_PATCH_VERSION})")
-
-	# Set the Python installation directory
-	set (INSTALL_PY_LIB_DIR
-	  ${INSTALL_LIB_DIR}/python${PYTHONLIBS_VERSION}/site-packages/py${PROJECT_NAME}
-	  CACHE PATH "Installation directory for Python libraries")
-
-	# Update the list of include directories for the project
-    include_directories (${PYTHON_INCLUDE_DIRS})
+  #find_package (PythonLibsWrapper ${_required_version} REQUIRED)
+
+  if (Python3_FOUND)
+    message (STATUS "Found Python3 ${Python3_VERSION} (${Python3_VERSION_MAJOR}.${Python3_VERSION_MINOR}.${Python3_VERSION_PATCH})")
+
+    # Set the Python installation directory
+    set (INSTALL_PY_LIB_DIR
+      ${INSTALL_LIB_DIR}/python${Python3_VERSION_MAJOR}${Python3_VERSION_MINOR}/site-packages/py${PROJECT_NAME}
+      CACHE PATH "Installation directory for Python libraries")
+
+    # Update the list of include directories for the project
+    include_directories (${Python3_INCLUDE_DIRS})

     # Update the list of dependencies for the project
-    list (APPEND PROJ_DEP_LIBS_FOR_LIB ${PYTHON_LIBRARIES})
-
-  else (PYTHONLIBS_FOUND)
+    list (APPEND PROJ_DEP_LIBS_FOR_LIB ${Python3_LIBRARIES})
+
+  else (Python3_FOUND)
 	message (FATAL_ERROR "Python libraries are missing. Please install them (e.g., 'python-devel' for the Fedora/RedHat package)")
-  endif (PYTHONLIBS_FOUND)
+  endif (Python3_FOUND)

 endmacro (get_python)

@@ -618,8 +606,8 @@
   #         On some platform/Boost version combinations, the Python version
   #         may be just the major version (2 or 3 as of 2019) or the major
   #         and minor versions (e.g., 27, 28, 34, 36, 37 as of 2019)
-  set (python_cpt_name1 "python${PY_MAJOR_VERSION}")
-  set (python_cpt_name2 "python${PY_MAJOR_VERSION}${PY_MINOR_VERSION}")
+  set (python_cpt_name1 "python${Python3_VERSION_MAJOR}")
+  set (python_cpt_name2 "python${Python3_VERSION_MAJOR}${Python3_VERSION_MINOR}")
   set (Boost_USE_STATIC_LIBS OFF)
   set (Boost_USE_MULTITHREADED ON)
   set (Boost_USE_STATIC_RUNTIME OFF)
@@ -1473,7 +1461,7 @@
   set (exec_prefix   ${prefix})
   set (bindir        ${exec_prefix}/bin)
   set (libdir        ${exec_prefix}/${LIBDIR})
-  set (pylibdir	     ${libdir}/python${PYTHONLIBS_VERSION}/site-packages/py${PACKAGE})
+  set (pylibdir	     ${libdir}/python${Python3_VERSION_MAJOR}${Python3_VERSION_MINOR}/site-packages/py${PACKAGE})
   set (libexecdir    ${exec_prefix}/libexec)
   set (sbindir       ${exec_prefix}/sbin)
   set (sysconfdir    ${prefix}/etc)
@@ -2555,27 +2543,26 @@

 # Python
 macro (display_python)
-  if (PYTHONLIBS_FOUND)
+  if (Python3_FOUND)
     message (STATUS)
-	message (STATUS "* Python:")
-	message (STATUS "  - PYTHONLIBS_VERSION ............ : ${PYTHONLIBS_VERSION}")
-	message (STATUS "  - PY_{MAJOR,MINOR,PATCH}_VERSION  : ${PY_MAJOR_VERSION}.${PY_MINOR_VERSION}.${PY_PATCH_VERSION}")
-	message (STATUS "  - PYTHON_LIBRARIES .............. : ${PYTHON_LIBRARIES}")
-	message (STATUS "  - PYTHON_INCLUDE_PATH ........... : ${PYTHON_INCLUDE_PATH}")
-	message (STATUS "  - PYTHON_INCLUDE_DIRS ........... : ${PYTHON_INCLUDE_DIRS}")
-	message (STATUS "  - PYTHON_DEBUG_LIBRARIES ........ : ${PYTHON_DEBUG_LIBRARIES}")
-	message (STATUS "  - Python_ADDITIONAL_VERSIONS .... : ${Python_ADDITIONAL_VERSIONS}")
-  endif (PYTHONLIBS_FOUND)
+    message (STATUS "* Python:")
+    message (STATUS "  - Python3_VERSION ............... : ${Python3_VERSION}")
+    message (STATUS "  - Python3_VERSION_{MJR,MNR,PTCH}  : ${Python3_VERSION_MAJOR}.${Python3_VERSION_MINOR}.${Python3_VERSION_PATCH}")
+    message (STATUS "  - Python3_INCLUDE_DIRS .......... : ${Python3_INCLUDE_DIRS}")
+    message (STATUS "  - Python3_LIBRARIES ............. : ${Python3_LIBRARIES}")
+    message (STATUS "  - Python3_LIBRARY_DIRS .......... : ${Python3_LIBRARY_DIRS}")
+    message (STATUS "  - Python3_RUNTIME_LIBRARY_DIRS .. : ${Python3_RUNTIME_LIBRARY_DIRS}")
+  endif (Python3_FOUND)
 endmacro (display_python)

 # ICU
 macro (display_icu)
   if (ICU_FOUND)
     message (STATUS)
-	message (STATUS "* ICU:")
-	message (STATUS "  - ICU_VERSION ................... : ${ICU_VERSION}")
-	message (STATUS "  - ICU_LIBRARIES ................. : ${ICU_LIBRARIES}")
-	message (STATUS "  - ICU_INCLUDE_DIRS .............. : ${ICU_INCLUDE_DIR}")
+    message (STATUS "* ICU:")
+    message (STATUS "  - ICU_VERSION ................... : ${ICU_VERSION}")
+    message (STATUS "  - ICU_LIBRARIES ................. : ${ICU_LIBRARIES}")
+    message (STATUS "  - ICU_INCLUDE_DIRS .............. : ${ICU_INCLUDE_DIR}")
   endif (ICU_FOUND)
 endmacro (display_icu)


[Build] Added a dependency on Boost::RegEx.

--- config/project_config_embeddable.cmake
+++ config/project_config_embeddable.cmake
@@ -108,6 +108,11 @@
       set (${var} "${CMAKE_INSTALL_PREFIX}/${${var}}")
     endif ()
   endforeach (_path_type)
+
+  # Define STDAIR_SAMPLE_DIR if the project is STDAIR
+  if ("${PROJECT_NAME}" STREQUAL "stdair")
+    set (STDAIR_SAMPLE_DIR ${INSTALL_SAMPLE_DIR})
+  endif ("${PROJECT_NAME}" STREQUAL "stdair")

   ##
   # Basic documentation (i.e., AUTHORS, NEWS, README, INSTALL)
@@ -378,7 +383,7 @@
   set (Boost_USE_MULTITHREADED ON)
   set (Boost_USE_STATIC_RUNTIME OFF)
   set (BOOST_REQUIRED_COMPONENTS
-    program_options date_time iostreams serialization filesystem
+    regex program_options date_time iostreams serialization filesystem
     unit_test_framework python)

   # The first check is for the required components.
@@ -395,18 +400,19 @@

     # Update the list of dependencies for the project
     list (APPEND PROJ_DEP_LIBS_FOR_LIB
-      ${Boost_IOSTREAMS_LIBRARY} ${Boost_SERIALIZATION_LIBRARY}
-      ${Boost_FILESYSTEM_LIBRARY} ${Boost_DATE_TIME_LIBRARY}
-      ${Boost_PYTHON_LIBRARY})
-    list (APPEND PROJ_DEP_LIBS_FOR_BIN ${Boost_PROGRAM_OPTIONS_LIBRARY})
+      ${Boost_REGEX_LIBRARY} ${Boost_IOSTREAMS_LIBRARY}
+	  ${Boost_SERIALIZATION_LIBRARY} ${Boost_FILESYSTEM_LIBRARY}
+	  ${Boost_DATE_TIME_LIBRARY} ${Boost_PYTHON_LIBRARY})
+    list (APPEND PROJ_DEP_LIBS_FOR_BIN
+	  ${Boost_REGEX_LIBRARY} ${Boost_PROGRAM_OPTIONS_LIBRARY})
     list (APPEND PROJ_DEP_LIBS_FOR_TST ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})

     # For display purposes
     set (BOOST_REQUIRED_LIBS
-      ${Boost_IOSTREAMS_LIBRARY} ${Boost_SERIALIZATION_LIBRARY}
-      ${Boost_FILESYSTEM_LIBRARY} ${Boost_DATE_TIME_LIBRARY}
-      ${Boost_PROGRAM_OPTIONS_LIBRARY} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}
-      ${Boost_PYTHON_LIBRARY})
+      ${Boost_REGEX_LIBRARY} ${Boost_IOSTREAMS_LIBRARY}
+	  ${Boost_SERIALIZATION_LIBRARY} ${Boost_FILESYSTEM_LIBRARY}
+	  ${Boost_DATE_TIME_LIBRARY} ${Boost_PROGRAM_OPTIONS_LIBRARY}
+	  ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY} ${Boost_PYTHON_LIBRARY})
   endif (Boost_FOUND)

 endmacro (get_boost)
@@ -600,7 +606,8 @@
   set (pkgdatadir    ${datarootdir}/${PACKAGE})
   set (sampledir     ${STDAIR_SAMPLE_DIR})
   set (docdir        ${datarootdir}/doc/${PACKAGE}-${PACKAGE_VERSION})
-  set (htmldir       ${docdir})
+  set (htmldir       ${docdir}/html)
+  set (pdfdir        ${htmldir})
   set (mandir        ${datarootdir}/man)
   set (infodir       ${datarootdir}/info)
   set (pkgincludedir ${includedir}/stdair)


Fix typo: Gazebo -> DART

Fix typo: Gazebo -> DART

--- cmake/DARTMacros.cmake
+++ cmake/DARTMacros.cmake
@@ -73,7 +73,7 @@
 macro(dt_issue_303 _name _output_name)
   if (FILESYSTEM_CASE_SENSITIVE)
     if (${DART_VERSION} VERSION_GREATER 4.3)
-      message(WARNING "Installing deprecated ${_name}.hh. This should be removed after Gazebo 4.3")
+      message(WARNING "Installing deprecated ${_name}.hh. This should be removed after DART 4.3")
     endif()
     set(generated_file "${CMAKE_CURRENT_BINARY_DIR}/${_name}.h")
     execute_process(


FindARPACK: prefer user-specified ARPACK.

--- cmake/FindARPACK.cmake
+++ cmake/FindARPACK.cmake
@@ -1,8 +1,10 @@
 SET(ARPACK_SEARCH_PATHS ${ARPACK_DIR})

-FIND_LIBRARY(ARPACK_LIB NAMES arpack PATHS ${ARPACK_SEARCH_PATHS})
+FIND_LIBRARY(ARPACK_LIB NAMES arpack PATHS ${ARPACK_SEARCH_PATHS} NO_DEFAULT_PATH)
+FIND_LIBRARY(ARPACK_LIB NAMES arpack ${ARPACK_SEARCH_PATHS})

 if(USE_MPI)
+  FIND_LIBRARY(PARPACK_LIB NAMES parpack PATHS ${ARPACK_SEARCH_PATHS} NO_DEFAULT_PATH)
   FIND_LIBRARY(PARPACK_LIB NAMES parpack PATHS ${ARPACK_SEARCH_PATHS})
 endif (USE_MPI)

@@ -26,4 +28,4 @@
     IF (ARPACK_LIB_FIND_REQUIRED)
         MESSAGE(FATAL_ERROR "Could not find Arpack")
     ENDIF (ARPACK_LIB_FIND_REQUIRED)
-ENDIF (ARPACK_FOUND)+ENDIF (ARPACK_FOUND)


Added cmake support for the libtorch3-dev ubuntu package

Cmake will try to setup the correct include path for compilation
against the libtorch3-dev package if all else fails.

--- cmake/FindTorch3.cmake
+++ cmake/FindTorch3.cmake
@@ -36,3 +36,14 @@
       )
   endif (EXISTS "${TORCH3_DIR}")
 endif (NOT TORCH3_FOUND)
+
+# We can now try the default install on ubuntu
+if (NOT TORCH3_FOUND)
+  if (EXISTS "/usr/include/torch/")
+    message(STATUS "Using system install Torch library")
+    set(TORCH3_FOUND 1)
+    set(TORCH3_INCLUDE_DIRS /usr/include/torch)
+    set(TORCH3_LIBRARY_DIRS /usr/lib)
+    set(TORCH3_LIBRARIES torch )
+  endif (EXISTS "/usr/include/torch/")
+endif (NOT TORCH3_FOUND)


cmake: Update FindXPRESS (#3252)

cmake: Update FindXPRESS (#3252)

--- cmake/FindXPRESS.cmake
+++ cmake/FindXPRESS.cmake
@@ -62,13 +62,11 @@

 if(XPRESS_FOUND AND NOT TARGET XPRESS::XPRESS)
   add_library(XPRESS::XPRESS UNKNOWN IMPORTED)
-
   if(UNIX)
-    set_target_properties(XPRESS::XPRESS PROPERTIES
-      INTERFACE_INCLUDE_DIRECTORIES "${XPRESS_ROOT}/include")
+    target_include_directories(XPRESS::XPRESS SYSTEM INTERFACE "${XPRESS_ROOT}/include")
   endif()

-  if(APPLE)
+  if(APPLE) # be aware that `UNIX` is `TRUE` on OS X, so this check must be first
     set_target_properties(XPRESS::XPRESS PROPERTIES
       #INSTALL_RPATH_USE_LINK_PATH TRUE
       #BUILD_WITH_INSTALL_RPATH TRUE
@@ -83,5 +81,7 @@
     set_target_properties(XPRESS::XPRESS PROPERTIES
       INTERFACE_INCLUDE_DIRECTORIES "${XPRESS_ROOT}\\include"
       IMPORTED_LOCATION "${XPRESS_ROOT}\\lib\\xprs.lib")
+  else()
+    message(FATAL_ERROR "XPRESS not supported for ${CMAKE_SYSTEM}")
   endif()
 endif()


Added dependency on OpenCV to all modules.

--- cmake/ROCSMacros.cmake
+++ cmake/ROCSMacros.cmake
@@ -70,6 +70,9 @@
 		endforeach(I)
 	endif(NOT "${ARG_LINK_MODULES}" STREQUAL "")

+	# Add dependency on OpenCV
+	target_link_libraries(rocs_${ARG_NAME} {OPENCV_LIBRARIES})
+
 	# Install
 	install(TARGETS rocs_${ARG_NAME} LIBRARY DESTINATION ${ROCS_DIR}/lib ARCHIVE DESTINATION lib)
 	install(FILES cpp/rocs/${ARG_NAME}.h DESTINATION ${ROCS_DIR}/include/rocs)


cmake: extensions: support list arguments to set_ifndef()

I keep tripping over not being able to use set_ifndef to set a value
to a list, like this:

set_ifndef(VARIABLE value1 value2 value3...)

Allow that to work without changing its existing behavior when called
with one argument.

Signed-off-by: Marti Bolivar <fd5da480b758a78208111e6ae5c6806e1f887137@opensourcefoundries.com>

--- cmake/extensions.cmake
+++ cmake/extensions.cmake
@@ -680,7 +680,7 @@
 # See 3.1 *_ifdef
 function(set_ifndef variable value)
   if(NOT ${variable})
-    set(${variable} ${value} PARENT_SCOPE)
+    set(${variable} ${value} ${ARGN} PARENT_SCOPE)
   endif()
 endfunction()


cmake: Invoke west topdir only with version >= 0.7.1

West version 0.7.0 introduced `west topdir` command.
Unfortunately version 0.7.0 would print the path in windows path style
when executed in Windows.

This commit ensure that `west topdir` is only used if west >= 0.7.1.

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

--- cmake/host-tools.cmake
+++ cmake/host-tools.cmake
@@ -38,7 +38,7 @@
   # even after output is one line.
   message(STATUS "Found west: ${WEST} (found suitable version \"${west_version}\", minimum required is \"${MIN_WEST_VERSION}\")")

-  if (${west_version} VERSION_GREATER_EQUAL "0.7.0")
+  if (${west_version} VERSION_GREATER_EQUAL "0.7.1")
     execute_process(
       COMMAND ${WEST}  topdir
       OUTPUT_VARIABLE  WEST_TOPDIR


[axl_cmake] fix: addition of PATH_SUFFIXES broke build on Arch

turns out, PATH_SUFFIXES are examined before the parent dir; so on Arch
LUA_INC_DIR resolved to /usr/include/lua5.2 and it conflicted with the symbolic
link liblua.so -> liblua.so.5.3

maybe, remove default (non-versioned) lua names completely?

--- cmake/import_lua.cmake
+++ cmake/import_lua.cmake
@@ -25,7 +25,7 @@
 	axl_find_inc_dir (
 		LUA_INC_DIR
 		lua.h
-		PATH_SUFFIXES ${_LUA_NAME_LIST}
+		PATH_SUFFIXES . ${_LUA_NAME_LIST}
 		)
 endif ()


use system variable instead of custom one

--- cmake/FindEigen2.cmake
+++ cmake/FindEigen2.cmake
@@ -1,4 +1,9 @@
 # - Try to find Eigen2 lib
+#
+# This module supports requiring a minimum version, e.g. you can do
+#   find_package(Eigen2 2.0.3)
+# to require version 2.0.3 to newer of Eigen2.
+#
 # Once done this will define
 #
 #  EIGEN2_FOUND - system has eigen lib with correct version
@@ -9,7 +14,7 @@
 # Copyright (c) 2008, 2009 Gael Guennebaud, <g.gael@free.fr>
 # Redistribution and use is allowed according to the terms of the BSD license.

-if(NOT EIGEN2_MIN_VERSION)
+if(NOT Eigen2_FIND_VERSION)
   if(NOT Eigen2_FIND_VERSION_MAJOR)
     set(Eigen2_FIND_VERSION_MAJOR 2)
   endif(NOT Eigen2_FIND_VERSION_MAJOR)
@@ -20,8 +25,8 @@
     set(Eigen2_FIND_VERSION_PATCH 0)
   endif(NOT Eigen2_FIND_VERSION_PATCH)

-  set(EIGEN2_MIN_VERSION "${Eigen2_FIND_VERSION_MAJOR}.${Eigen2_FIND_VERSION_MINOR}.${Eigen2_FIND_VERSION_PATCH}")
-endif(NOT EIGEN2_MIN_VERSION)
+  set(Eigen2_FIND_VERSION "${Eigen2_FIND_VERSION_MAJOR}.${Eigen2_FIND_VERSION_MINOR}.${Eigen2_FIND_VERSION_PATCH}")
+endif(NOT Eigen2_FIND_VERSION)

 macro(_eigen2_check_version)
   file(READ "${EIGEN2_INCLUDE_DIR}/Eigen/src/Core/util/Macros.h" _eigen2_version_header LIMIT 5000 OFFSET 1000)
@@ -34,16 +39,16 @@
   set(EIGEN2_MINOR_VERSION "${CMAKE_MATCH_1}")

   set(EIGEN2_VERSION ${EIGEN2_WORLD_VERSION}.${EIGEN2_MAJOR_VERSION}.${EIGEN2_MINOR_VERSION})
-  if(${EIGEN2_VERSION} VERSION_LESS ${EIGEN2_MIN_VERSION})
+  if(${EIGEN2_VERSION} VERSION_LESS ${Eigen2_FIND_VERSION})
     set(EIGEN2_VERSION_OK FALSE)
-  else(${EIGEN2_VERSION} VERSION_LESS ${EIGEN2_MIN_VERSION})
+  else(${EIGEN2_VERSION} VERSION_LESS ${Eigen2_FIND_VERSION})
     set(EIGEN2_VERSION_OK TRUE)
-  endif(${EIGEN2_VERSION} VERSION_LESS ${EIGEN2_MIN_VERSION})
+  endif(${EIGEN2_VERSION} VERSION_LESS ${Eigen2_FIND_VERSION})

   if(NOT EIGEN2_VERSION_OK)

     message(STATUS "Eigen2 version ${EIGEN2_VERSION} found in ${EIGEN2_INCLUDE_DIR}, "
-                   "but at least version ${EIGEN2_MIN_VERSION} is required")
+                   "but at least version ${Eigen2_FIND_VERSION} is required")
   endif(NOT EIGEN2_VERSION_OK)
 endmacro(_eigen2_check_version)


Remove unneccessary debug output from CMake

--- cmake/FindEigen3.cmake
+++ cmake/FindEigen3.cmake
@@ -73,7 +73,6 @@
 		find_file(EIGEN3_INCLUDE_DIR NAMES src/Core/EigenBase.h
 			PATHS ${CMAKE_FIND_ROOT_PATH}
 			PATH_SUFFIXES include Eigen include/Eigen)
-		MESSAGE(STATUS ${EIGEN3_INCLUDE_DIR})
 		IF (EIGEN3_INCLUDE_DIR)
 			STRING(REGEX REPLACE /Eigen/src/Core/EigenBase.h / EIGEN3_INCLUDE_DIR ${EIGEN3_INCLUDE_DIR})
 		ENDIF ()


cmake: Simplify FindWaffle.cmake.

cmake: Simplify FindWaffle.cmake.

--- cmake/FindWaffle.cmake
+++ cmake/FindWaffle.cmake
@@ -22,10 +22,6 @@
 		DOC "The directory where libwaffle-1 resides"
 		NO_CMAKE_FIND_ROOT_PATH NO_DEFAULT_PATH
 		)
-
-	if (Waffle_INCLUDE_DIRS AND Waffle_LIBRARIES)
-		set (Waffle_FOUND 1)
-	endif (Waffle_INCLUDE_DIRS AND Waffle_LIBRARIES)
 else ()
 	find_package (PkgConfig)
 	if (PKG_CONFIG_FOUND)
@@ -33,11 +29,5 @@
 	endif ()
 endif ()

-mark_as_advanced (
-	Waffle_INCLUDE_DIRS
-	Waffle_LIBRARIES
-)
-
-mark_as_advanced (
-	Waffle_FOUND
-)
+include (FindPackageHandleStandardArgs)
+find_package_handle_standard_args (Waffle DEFAULT_MSG Waffle_LIBRARIES Waffle_INCLUDE_DIRS)


Handle Visual Studio Debug/Release binary paths (Note it depends on configuration settings)

--- cmake/thirdparty.cmake
+++ cmake/thirdparty.cmake
@@ -203,6 +203,10 @@
         get_filename_component(fileext  "${libfile}" EXT)
         set(libfile "${filename}${COMPONENT_LIBRARY_SUFFIX}${fileext}")

+        if(MSVC)
+            set(libfile "${CMAKE_BUILD_TYPE}/${libfile}")
+        endif()
+
         if(COMPONENT_BINARY_DIR)
             set(COMPONENT_BINARY "${COMPONENT_BINARY_DIR}/${libfile}")
         else()


ENH: Use http drop method by default

ENH: Use http drop method by default

--- DartConfig.cmake
+++ DartConfig.cmake
@@ -3,6 +3,9 @@
 SET (NIGHTLY_START_TIME "23:00:00 EDT")

 # Dart server to submit results (used by client)
+IF(NOT DROP_METHOD)
+  SET(DROP_METHOD http)
+ENDIF(NOT DROP_METHOD)
 IF(DROP_METHOD MATCHES http)
   SET (DROP_SITE "public.kitware.com")
   SET (DROP_LOCATION "/cgi-bin/HTTPUploadDartFile.cgi")


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 04)

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


Remove code referencing unexisting variable. See #449

--- CMake/ctkMacroWrapPythonQt.cmake
+++ CMake/ctkMacroWrapPythonQt.cmake
@@ -271,7 +271,6 @@
       ${wrap_int_dir}${wrapper_module_init_cpp_filename}
       ${extra_files}
     DEPENDS
-      ${pythonqtgenerator_executable_depends}
       ${SOURCES_TO_WRAP}
       ${CTK_CMAKE_DIR}/ctkScriptWrapPythonQt_${wrap_type}.cmake
       ${CTK_CMAKE_DIR}/ctkMacroWrapPythonQtModuleInit.cpp.in


build: Update cub to 1.4.1

build: Update cub to 1.4.1

The new commit pointer points at a pull request that fixes a compiler warning.

--- contrib/cub.cmake
+++ contrib/cub.cmake
@@ -1,12 +1,13 @@
 set(cub_PREFIX ${CMAKE_BINARY_DIR}/contrib/cub-prefix)
 ExternalProject_Add(cub
     PREFIX ${cub_PREFIX}
-    GIT_REPOSITORY "https://github.com/nvlabs/cub.git"
-    GIT_TAG "62d7334d15b27765d6d503f342c80aee9560bf8f"
+    GIT_REPOSITORY "https://github.com/nsubtil/cub.git"
+    # 1.4.1 + warning fixes
+    GIT_TAG "fix-signedness-warning"
     CONFIGURE_COMMAND ""
     BUILD_COMMAND ""
     INSTALL_COMMAND ""
-    LOG_DOWNLOAD 1
+    LOG_DOWNLOAD 0
     )

 include_directories(${cub_PREFIX}/src/cub)


HADOOP-12727. Minor cleanups needed for CMake 3.X (Alan Burlison via aw)

--- hadoop-common-project/hadoop-common/HadoopCommon.cmake
+++ hadoop-common-project/hadoop-common/HadoopCommon.cmake
@@ -48,11 +48,10 @@
     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${FLAGS}")
 endmacro()

-# Add flags to all the CMake linker variables
+# Add flags to all the CMake linker variables.
 macro(hadoop_add_linker_flags FLAGS)
     set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${FLAGS}")
     set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${FLAGS}")
-    set(CMAKE_STATIC_LINKER_FLAGS "${CMAKE_STATIC_LINKER_FLAGS} ${FLAGS}")
 endmacro()

 # Compile a library with both shared and static variants.
@@ -188,7 +187,9 @@
 #
 elseif(CMAKE_SYSTEM_NAME STREQUAL "SunOS")
     # Solaris flags. 64-bit compilation is mandatory, and is checked earlier.
-    hadoop_add_compiler_flags("-m64 -D__EXTENSIONS__ -D_POSIX_PTHREAD_SEMANTICS -D_XOPEN_SOURCE=500")
+    hadoop_add_compiler_flags("-m64 -D_POSIX_C_SOURCE=200112L -D__EXTENSIONS__ -D_POSIX_PTHREAD_SEMANTICS")
+    set(CMAKE_C_FLAGS "-std=gnu99 ${CMAKE_C_FLAGS}")
+    set(CMAKE_CXX_FLAGS "-std=gnu++98 ${CMAKE_CXX_FLAGS}")
     hadoop_add_linker_flags("-m64")

     # CMAKE_SYSTEM_PROCESSOR is set to the output of 'uname -p', which on Solaris is
@@ -199,7 +200,7 @@
         set(CMAKE_SYSTEM_PROCESSOR "amd64")
         set(CMAKE_LIBRARY_ARCHITECTURE "amd64")
     elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "sparc")
-        set(CMAKE_SYSTEM_PROCESSOR STREQUAL "sparcv9")
+        set(CMAKE_SYSTEM_PROCESSOR "sparcv9")
         set(CMAKE_LIBRARY_ARCHITECTURE "sparcv9")
     else()
         message(FATAL_ERROR "Unrecognised CMAKE_SYSTEM_PROCESSOR ${CMAKE_SYSTEM_PROCESSOR}")


remove LIB_LIST appends

remove LIB_LIST appends

--- deps/zlib.cmake
+++ deps/zlib.cmake
@@ -6,7 +6,6 @@

   include_directories(${ZLIB_INCLUDE_DIR})
   link_directories(${ZLIB_ROOT_DIR}/lib)
-  list(APPEND LIB_LIST ${ZLIB_LIBRARIES})
 else (WithSharedZLIB)
   message("Enabling Static ZLIB")
   add_subdirectory(deps/zlib)


qibuild: fix_shared_libs: small optimization

Setting stuff in cache in 'script mode' (when called with -P)
does not work, so we have to create file instead ...

Not that CMAKE_SOURCE_DIR is in fact the build directory when
using -P ...

--- cmake/qibuild/internal/fix_shared_libs.cmake
+++ cmake/qibuild/internal/fix_shared_libs.cmake
@@ -6,7 +6,7 @@
 # This function needs to run only once, but *after* every target
 # has been built.
 function(_qi_fix_shared_libs)
-  if(DEFINED _QI_SHARED_LIBS_FIXED)
+  if(EXISTS "${CMAKE_SOURCE_DIR}/shared_libs_fixed")
     return()
   endif()

@@ -87,6 +87,6 @@
     file(COPY ${_dlls} DESTINATION "${_dest}")
   endif()

-  qi_set_global(_QI_SHARED_LIBS_FIXED)
+  file(WRITE "${CMAKE_SOURCE_DIR}/shared_libs_fixed" "")

 endfunction()


[cmake] Ignore required explicit availability in Swift stdlib

--- stdlib/cmake/modules/SwiftSource.cmake
+++ stdlib/cmake/modules/SwiftSource.cmake
@@ -483,7 +483,8 @@
   # The standard library and overlays are built resiliently when SWIFT_STDLIB_STABLE_ABI=On.
   if(SWIFTFILE_IS_STDLIB AND SWIFT_STDLIB_STABLE_ABI)
     list(APPEND swift_flags "-enable-library-evolution")
-    list(APPEND swift_flags "-Xfrontend" "-library-level"  "-Xfrontend" "api")
+    list(APPEND swift_flags "-library-level" "api")
+    list(APPEND swift_flags "-Xfrontend" "-require-explicit-availability=ignore")
   endif()

   if("${SWIFT_SDK_${SWIFTFILE_SDK}_THREADING_PACKAGE}" STREQUAL "none")


BUG: Reduce number of targets with MSVC

BUG: Reduce number of targets with MSVC

Having a large number of target slows down the MSVC GUI, to unusable
speeds. By default we reduce the number of header tests to give a good
GUI experience.

Change-Id: I61ebe1dd346b495f900583c4cb0e6f55588514c3

--- CMake/ITKModuleHeaderTest.cmake
+++ CMake/ITKModuleHeaderTest.cmake
@@ -8,11 +8,16 @@
 # The tests will simply not be run if python is unavailable.
 find_package(PythonInterp)

+# Improve performance of MSVC GUI, by reducing number of header tests.
+set( MAXIMUM_NUMBER_OF_HEADERS_default 35 )
+if( MSVC )
+  set( MAXIMUM_NUMBER_OF_HEADERS_default 9999 )
+endif()
+
 # The maximum number of headers in a test.  This helps limit memory issues,
 # and the cppcheck tests.  However, if this is not unity, there is a slight
 # chance that problems may be hidden.  For a complete header check, set to "1".
-set( MAXIMUM_NUMBER_OF_HEADERS 35
-  CACHE STRING "The number of headers in a HeaderTest code." )
+set( MAXIMUM_NUMBER_OF_HEADERS ${MAXIMUM_NUMBER_OF_HEADERS_default} CACHE STRING "The number of headers in a HeaderTest code." )
 mark_as_advanced( MAXIMUM_NUMBER_OF_HEADERS )

 add_custom_target( ITKHeaderTests


Need to still define OGRE_DEP_DIR in InstallDependencies.cmake, but derive it a different way

--HG--
branch : v1-7

--- CMake/InstallDependencies.cmake
+++ CMake/InstallDependencies.cmake
@@ -12,6 +12,12 @@
 #####################################################
 if ((NOT APPLE) AND (NOT WIN32))
   return()
+endif()
+
+if (OGRE_DEPENDENCIES_DIR)
+	set(OGRE_DEP_DIR ${OGRE_DEPENDENCIES_DIR})
+else()
+	set(OGRE_DEP_DIR "${OGRE_SOURCE_DIR}/Dependencies")
 endif()

 option(OGRE_INSTALL_DEPENDENCIES "Install dependency libs needed for samples" TRUE)


Use hidden symbol visibility for all plug-ins.

This ensures that plug-ins from external projects, which are build
by invoking this macro will use hidden visibility with gcc.

--- CMake/ctkMacroBuildPlugin.cmake
+++ CMake/ctkMacroBuildPlugin.cmake
@@ -276,9 +276,15 @@
     SET(library_output_dir "${CMAKE_CURRENT_BINARY_DIR}/${output_dir_suffix}")
   ENDIF()

+  SET(plugin_compile_flags "-DQT_PLUGIN")
+  # MinGW does not export all symbols automatically, so no need to set flags
+  IF(CMAKE_COMPILER_IS_GNUCXX AND NOT MINGW)
+    SET(plugin_compile_flags "${plugin_compile_flags} -fvisibility=hidden -fvisibility-inlines-hidden")
+  ENDIF()
+
   # Apply properties to the library target.
   SET_TARGET_PROPERTIES(${lib_name} PROPERTIES
-    COMPILE_FLAGS "-DQT_PLUGIN"
+    COMPILE_FLAGS "${plugin_compile_flags}"
     RUNTIME_OUTPUT_DIRECTORY ${runtime_output_dir}
     LIBRARY_OUTPUT_DIRECTORY ${library_output_dir}
     PREFIX "lib"


CMAKE_OSX variables are now passed to subprojects during superbuild

--- SuperBuild.cmake
+++ SuperBuild.cmake
@@ -215,6 +215,15 @@
   -DCMAKE_SHARED_LINKER_FLAGS:STRING=${CMAKE_SHARED_LINKER_FLAGS}
   -DCMAKE_MODULE_LINKER_FLAGS:STRING=${CMAKE_MODULE_LINKER_FLAGS}
 )
+
+if(APPLE)
+  set(ep_common_args
+       -DCMAKE_OSX_ARCHITECTURES:PATH=${CMAKE_OSX_ARCHITECTURES}
+       -DCMAKE_OSX_DEPLOYMENT_TARGET:PATH=${CMAKE_OSX_DEPLOYMENT_TARGET}
+       -DCMAKE_OSX_SYSROOT:PATH=${CMAKE_OSX_SYSROOT}
+       ${ep_common_args}
+      )
+endif()

 # Include external projects
 foreach(p ${external_projects})


USE_OpenCL variable now passed from superbuild to MITK-build


Use INCLUDE_DIR instead of INCLUDE_PATH. Fixes issue 102.

git-svn-id: bd2008fbba0f7d30fd6598b54f2cd88503fdd2e4@1137 95f4ed2b-212e-0410-8b90-d31948207fce

--- cmake/FindCg.cmake
+++ cmake/FindCg.cmake
@@ -3,7 +3,7 @@
 # Once done this will define
 #
 # CG_FOUND =system has NVIDIA Cg and it can be used.
-# CG_INCLUDE_PATH = directory where cg.h resides
+# CG_INCLUDE_DIR = directory where cg.h resides
 # CG_LIBRARY = full path to libCg.so (Cg.DLL on win32)
 # CG_GL_LIBRARY = full path to libCgGL.so (CgGL.dll on win32)
 # CG_COMPILER = full path to cgc (cgc.exe on win32)
@@ -21,7 +21,7 @@
     ENDFOREACH(dir)

     # Find the include  dir
-    FIND_PATH(CG_INCLUDE_PATH cg.h
+    FIND_PATH(CG_INCLUDE_DIR cg.h
       ${CG_FRAMEWORK_INCLUDES}
       )

@@ -63,7 +63,7 @@
       SET (CG_COMPILER_DIR .)
       SET (CG_COMPILER_SUPER_DIR ..)
     ENDIF (CG_COMPILER)
-    FIND_PATH( CG_INCLUDE_PATH Cg/cg.h
+    FIND_PATH( CG_INCLUDE_DIR Cg/cg.h
       $ENV{CG_INC_PATH}
       $ENV{PROGRAMFILES}/NVIDIA\ Corporation/Cg/include
       $ENV{PROGRAMFILES}/Cg
@@ -133,7 +133,7 @@
       )
     GET_FILENAME_COMPONENT(CG_COMPILER_DIR "${CG_COMPILER}" PATH)
     GET_FILENAME_COMPONENT(CG_COMPILER_SUPER_DIR "${CG_COMPILER_DIR}" PATH)
-    FIND_PATH( CG_INCLUDE_PATH Cg/cg.h
+    FIND_PATH( CG_INCLUDE_DIR Cg/cg.h
       /usr/include
       /usr/local/include
       ${CG_COMPILER_SUPER_DIR}/include
@@ -163,10 +163,10 @@
   ENDIF (WIN32)
 ENDIF (APPLE)

-IF (CG_INCLUDE_PATH)
+IF (CG_INCLUDE_DIR)
   SET( CG_FOUND 1 CACHE STRING "Set to 1 if CG is found, 0 otherwise")
-ELSE (CG_INCLUDE_PATH)
+ELSE (CG_INCLUDE_DIR)
   SET( CG_FOUND 0 CACHE STRING "Set to 1 if CG is found, 0 otherwise")
-ENDIF (CG_INCLUDE_PATH)
+ENDIF (CG_INCLUDE_DIR)

 MARK_AS_ADVANCED( CG_FOUND )


Some minor cleaning up.

Some minor cleaning up.

--- cmake/common.cmake
+++ cmake/common.cmake
@@ -89,8 +89,6 @@
       -Wno-missing-prototypes
       -Wno-padded
       -Wno-reserved-id-macro
-      -Wno-unused-macros
-      -Wno-used-but-marked-unused
     )

   if(NOT "${_TARGET}" STREQUAL "cellml")


temporary solution to link test executables to gsl

--- cmake/macros.cmake
+++ cmake/macros.cmake
@@ -10,5 +10,6 @@
     TARGET_LINK_LIBRARIES(${TEST_NAME}.exe cap)
     TARGET_LINK_LIBRARIES(${TEST_NAME}.exe deal_II)
     TARGET_LINK_LIBRARIES(${TEST_NAME}.exe ${Boost_LIBRARIES})
+    TARGET_LINK_LIBRARIES(${TEST_NAME}.exe ${GSL_LIBRARIES})
     ADD_TEST(${TEST_NAME} ${TEST_NAME}.exe)
 ENDFUNCTION()


Fix syntax error (missing quote).

Fix syntax error (missing quote).

--- cmake/os/AIX.cmake
+++ cmake/os/AIX.cmake
@@ -28,6 +28,6 @@
 # The following is required to export all symbols
 # (also with leading underscore)
 STRING(REPLACE  "-bexpall" "-bexpfull" CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS
-  ${CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS}")
+  "${CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS}")
 STRING(REPLACE  "-bexpall" "-bexpfull" CMAKE_SHARED_LIBRARY_LINK_C_FLAGS
-  "${CMAKE_SHARED_LIBRARY_LINK_C_FLAGS}")+  "${CMAKE_SHARED_LIBRARY_LINK_C_FLAGS}")


Use -dumpversion with gcc only

Use -dumpversion with gcc only

--- cmake/system.cmake
+++ cmake/system.cmake
@@ -42,15 +42,19 @@
 endif ()

 if (DEFINED TARGET)
-if (${TARGET} STREQUAL "SKYLAKEX" AND NOT NO_AVX512)
-  set (KERNEL_DEFINITIONS "${KERNEL_DEFINITIONS} -march=skylake-avx512")
-endif()
-if (${TARGET} STREQUAL "HASWELL" AND NOT NO_AVX2)
-   execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION)
-   if (${GCC_VERSION} VERSION_GREATER 4.7 OR ${GCC_VERSION} VERSION_EQUAL 4.7)
-     set (KERNEL_DEFINITIONS "${KERNEL_DEFINITIONS} -mavx2")
-   endif()
-endif()
+  if (${TARGET} STREQUAL "SKYLAKEX" AND NOT NO_AVX512)
+    set (KERNEL_DEFINITIONS "${KERNEL_DEFINITIONS} -march=skylake-avx512")
+  endif()
+  if (${TARGET} STREQUAL "HASWELL" AND NOT NO_AVX2)
+    if (${CMAKE_C_COMPILER_ID} STREQUAL "GNU")
+      execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION)
+      if (${GCC_VERSION} VERSION_GREATER 4.7 OR ${GCC_VERSION} VERSION_EQUAL 4.7)
+        set (KERNEL_DEFINITIONS "${KERNEL_DEFINITIONS} -mavx2")
+      endif()
+    elseif (${CMAKE_C_COMPILER_ID} STREQUAL "CLANG")
+      set (KERNEL_DEFINITIONS "${KERNEL_DEFINITIONS} -mavx2")
+    endif()
+  endif()
 endif()

 if (DEFINED TARGET)