KAA-1319: Fix FindAvro.cmake

KAA-1319: Fix FindAvro.cmake

--- client/client-multi/client-cpp/Modules/FindAvro.cmake
+++ client/client-multi/client-cpp/Modules/FindAvro.cmake
@@ -19,59 +19,44 @@
 #
 #  find_package(Avro)
 #
-# Variables used by this module, they can change the default behaviour and need
-# to be set before calling find_package:
-#
-#  AVRO_ROOT  Set this variable to the root installation of
-#                 Avro C++ if the module has problems finding
-#                 the proper installation path.
-#
 # Variables defined by this module:
 #
 #  AVRO_FOUND              System has Avro C++ libs/headers
 #  AVRO_LIBRARIES          The Avro C++ libraries
 #  AVRO_INCLUDE_DIRS       The location of Avro C++ headers

-message ("\nLooking for Avro C++ headers and libraries")
+message("\nLooking for Avro C++ headers and libraries")

-if (NOT "$ENV{AVRO_ROOT}" STREQUAL "")
-    set(AVRO_ROOT "$ENV{AVRO_ROOT}")
-endif(NOT "$ENV{AVRO_ROOT}" STREQUAL "")
-
-if (AVRO_ROOT)
-    message (STATUS "Root dir: ${AVRO_ROOT}")
-endif ()
-
-if (NOT WIN32)
+if(NOT WIN32)
   include(FindPkgConfig)
-  if ( PKG_CONFIG_FOUND )
+  if(PKG_CONFIG_FOUND)

 	pkg_check_modules(PC_AVRO avro-cpp)
 	set(AVRO_DEFINITIONS ${PC_AVRO_CFLAGS_OTHER})

   endif(PKG_CONFIG_FOUND)
-endif (NOT WIN32)
+endif(NOT WIN32)

 find_path(AVRO_INCLUDE_DIR
      avro/Encoder.hh
      HINTS
-     ${AVRO_ROOT}/include
+     ${CMAKE_FIND_ROOT_PATH}/include
      ${PC_AVRO_INCLUDEDIR}
      ${PC_AVRO_INCLUDE_DIRS}
      ${CMAKE_INCLUDE_PATH}
 )

-if (Avro_USE_STATIC_LIBS)
-    set (AVRO_LOOK_FOR_LIB_NAMES avrocpp_s)
-else ()
-    set (AVRO_LOOK_FOR_LIB_NAMES avrocpp)
-endif ()
+if(Avro_USE_STATIC_LIBS)
+    set(AVRO_LOOK_FOR_LIB_NAMES avrocpp_s)
+else()
+    set(AVRO_LOOK_FOR_LIB_NAMES avrocpp)
+endif()

 find_library(AVRO_LIBRARY
     NAMES
     ${AVRO_LOOK_FOR_LIB_NAMES}
     PATHS
-    ${AVRO_ROOT}/lib
+    ${CMAKE_FIND_ROOT_PATH}/lib
     ${PC_AVRO_LIBDIR}
     ${PC_AVRO_LIBRARY_DIRS}
 )
@@ -88,7 +73,7 @@

 mark_as_advanced(AVRO_INCLUDE_DIR AVRO_LIBRARY)

-if (AVRO_FOUND)
+if(AVRO_FOUND)
     set(AVRO_LIBRARIES ${AVRO_LIBRARY})
     set(AVRO_INCLUDE_DIRS ${AVRO_INCLUDE_DIR})

@@ -97,6 +82,6 @@

     mark_as_advanced(AVRO_LIBRARY_DIR AVRO_LIBRARY_NAME)

-    message (STATUS "Include directories: ${AVRO_INCLUDE_DIRS}")
-    message (STATUS "Libraries: ${AVRO_LIBRARIES}")
-endif ()
+    message(STATUS "Include directories: ${AVRO_INCLUDE_DIRS}")
+    message(STATUS "Libraries: ${AVRO_LIBRARIES}")
+endif()


Remove debugging printf around -flto option in cmake

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

-	# Added to help make resulting libcondor_utils smaller.
-	#check_c_compiler_flag(-fno-exceptions no_exceptions)
-	#if (no_exceptions)
-	#	set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-exceptions")
-	#	set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fno-exceptions")
-	#endif(no_exceptions)
-	#check_c_compiler_flag(-Os c_Os)
-	#if (c_Os)
-	#	set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Os")
-	#	set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Os")
-	#endif(c_Os)
-
-	dprint("TSTCLAIR - DISABLING -flto b/c of gcc failure in koji try again later")
-	#if (CMAKE_C_COMPILER_VERSION STRGREATER "4.7.0" OR CMAKE_C_COMPILER_VERSION STREQUAL "4.7.0")
-	#
+	# GGT tested compiling  condor_history with -flto, it ran less than one tenth of one percent faster
+    # and took more than 3 times longer to compile.  Try again later.
+
 	#  check_c_compiler_flag(-flto c_lto)
 	#  if (c_lto)
 	#	  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -flto")
 	#	  set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -flto")
 	#  endif(c_lto)
-	#else()
-	#  dprint("skipping c_lto flag check")
-	#endif()

 	check_c_compiler_flag(-W c_W)
 	if (c_W)


Some modifs from Roger/Humans : <PROJECT_NAME>_SRCS [optional] and multiples setup in the same dir

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

--- Numerics/cmake/LibraryProjectSetup.cmake
+++ Numerics/cmake/LibraryProjectSetup.cmake
@@ -3,6 +3,7 @@
 #
 # input:
 #
+# <PROJECT_NAME>_SRCS : [optional] Project SRCS on per files basis
 # <PROJECT_NAME>_DIRS : sources directories
 # <PROJECT_NAME>_Unstable_SRCS : built only if -DUNSTABLE=ON
 # <PROJECT_NAME>_VERSION : version of the library
@@ -17,6 +18,8 @@
   MESSAGE(STATUS "")
   MESSAGE(STATUS "Setting up ${PROJECT_NAME} library build")

+  #+RPG add a reset of _ALL_EXTS
+  SET(_ALL_EXTS)
   SET(_ALL_DIRS ${${PROJECT_NAME}_DIRS})
   IF(NOT ${PROJECT_NAME}_SOURCE_FILE_EXTENSIONS)
     # all extensions we know (should be done only with the project languages)
@@ -32,24 +35,39 @@
   ENDIF(NOT ${PROJECT_NAME}_SOURCE_FILE_EXTENSIONS)

   SET(_ALL_FILES)
-  FOREACH(_DIR ${_ALL_DIRS})
-    SET(_DIR_FILES)
-    FOREACH(_EXT ${_ALL_EXTS})
-      FILE(GLOB _DIR_FILES_EXT ${_DIR}/${_EXT})
-      IF(_DIR_FILES_EXT)
-        LIST(APPEND _DIR_FILES ${_DIR_FILES_EXT})
-      ENDIF(_DIR_FILES_EXT)
-    ENDFOREACH(_EXT ${_ALL_EXTS})
-    IF(_DIR_FILES)
-      FOREACH(_F ${_DIR_FILES})
-        IF(NOT ${_F}_T)
-          SET(${_F}_T T)
-          LIST(APPEND _ALL_FILES ${_F})
-        ENDIF(NOT ${_F}_T)
-      ENDFOREACH(_F ${_DIR_FILES})
-    ENDIF(_DIR_FILES)
-  ENDFOREACH(_DIR ${_ALL_DIRS})

+  #+++RPG add the possiblity to add files with PROJECT_NAME_SRCS and not automatically
+  IF(${PROJECT_NAME}_SRCS)
+    MESSAGE(STATUS "Sources files manually with var PROJECT_NAME_SRCS")
+    FOREACH(_FILE ${${PROJECT_NAME}_SRCS})
+      FILE(GLOB _GFILE ${_FILE})
+      IF(_GFILE)
+        LIST(APPEND _ALL_FILES ${_GFILE})
+      ELSE(_GFILE)
+        MESSAGE(STATUS "WARNING : file NOT FOUND : ${_FILE}")
+      ENDIF(_GFILE)
+    ENDFOREACH(_FILE ${${PROJECT_NAME}_SRCS})
+  ELSE(${PROJECT_NAME}_SRCS)
+
+
+    FOREACH(_DIR ${_ALL_DIRS})
+      SET(_DIR_FILES)
+      FOREACH(_EXT ${_ALL_EXTS})
+        FILE(GLOB _DIR_FILES_EXT ${_DIR}/${_EXT})
+        IF(_DIR_FILES_EXT)
+          LIST(APPEND _DIR_FILES ${_DIR_FILES_EXT})
+        ENDIF(_DIR_FILES_EXT)
+      ENDFOREACH(_EXT ${_ALL_EXTS})
+      IF(_DIR_FILES)
+        FOREACH(_F ${_DIR_FILES})
+          IF(NOT ${_F}_T)
+            SET(${_F}_T T)
+            LIST(APPEND _ALL_FILES ${_F})
+          ENDIF(NOT ${_F}_T)
+        ENDFOREACH(_F ${_DIR_FILES})
+      ENDIF(_DIR_FILES)
+    ENDFOREACH(_DIR ${_ALL_DIRS})
+  ENDIF(${PROJECT_NAME}_SRCS)
   #
   # headers
   #


Put comments in FindCuDNN.cmake

Put comments in FindCuDNN.cmake

--- chainerx_cc/cmake/FindCuDNN.cmake
+++ chainerx_cc/cmake/FindCuDNN.cmake
@@ -14,12 +14,14 @@

 include(FindPackageHandleStandardArgs)

+# Determine CUDNN_ROOT_DIR
 if(DEFINED ENV{CUDNN_ROOT_DIR})
   set(CUDNN_ROOT_DIR $ENV{CUDNN_ROOT_DIR})
 else()
   set(CUDNN_ROOT_DIR "" CACHE PATH "Folder contains NVIDIA cuDNN")
 endif()

+# Determine CUDNN_INCLUDE_DIR
 if(DEFINED ENV{CUDNN_INCLUDE_DIR})
   set(CUDNN_INCLUDE_DIR $ENV{CUDNN_INCLUDE_DIR})
 else()
@@ -28,10 +30,12 @@
     PATH_SUFFIXES cuda/include include)
 endif()

+# Determine CUDNN_LIB_DIR
 if(DEFINED ENV{CUDNN_LIB_DIR})
   set(CUDNN_LIB_DIR $ENV{CUDNN_LIB_DIR})
 endif()

+# Determine CUDNN_LIBNAME
 if(DEFINED ENV{CUDNN_LIBNAME})
   # libname from envvar
   set(CUDNN_LIBNAME $ENV{CUDNN_LIBNAME})
@@ -44,6 +48,7 @@
   set(CUDNN_LIBNAME "cudnn")
 endif()

+# Determine CUDNN_LIBRARY
 if(DEFINED ENV{CUDNN_LIBRARY})
   SET(CUDNN_LIBRARY $ENV{CUDNN_LIBRARY})
 else()
@@ -52,8 +57,9 @@
     PATH_SUFFIXES lib lib64 cuda/lib cuda/lib64 lib/x64)
 endif()

+# Misc.
 if(CUDNN_INCLUDE_DIR AND CUDNN_LIBRARY)
-    # get cuDNN version
+  # Find cudnn.h and determine CUDNN_VERSION
   file(READ ${CUDNN_INCLUDE_DIR}/cudnn.h CUDNN_HEADER_CONTENTS)
     string(REGEX MATCH "define CUDNN_MAJOR * +([0-9]+)"
                  CUDNN_VERSION_MAJOR "${CUDNN_HEADER_CONTENTS}")
@@ -80,6 +86,7 @@
   mark_as_advanced(CUDNN_ROOT_DIR CUDNN_LIBRARY CUDNN_INCLUDE_DIR)
 endif()

+# Find and load cuDNN settings
 find_package_handle_standard_args(
     CuDNN
     VERSION_VAR CUDNN_VERSION


cmake: add missing L prefix to wchar literal

--- config.h.cmake
+++ config.h.cmake
@@ -35,7 +35,7 @@
 #define GRN_PLUGINS_DIR      "${GRN_PLUGINS_DIR}"
 #define GRN_PLUGIN_SUFFIX    "${GRN_PLUGIN_SUFFIX}"

-#define GRN_DLL_FILENAME     "${GRN_DLL_FILENAME}"
+#define GRN_DLL_FILENAME     L"${GRN_DLL_FILENAME}"

 /* build switches */
 #cmakedefine USE_MEMORY_DEBUG


Get rid of unused macros.

Get rid of unused macros.

svn path=/trunk/; revision=6944

--- config.h.cmake
+++ config.h.cmake
@@ -40,9 +40,6 @@
 /* Define if finite is available */
 #cmakedefine HAVE_FINITE

-/* Define to 1 if you have the `fork' function. */
-#cmakedefine HAVE_FORK 1
-
 /* Define if [freetype] is available */
 #cmakedefine HAVE_FREETYPE

@@ -151,32 +148,11 @@
 /* Define to 1 if you have the <vfork.h> header file. */
 #cmakedefine HAVE_VFORK_H 1

-/* Define to 1 if `fork' works. */
-#cmakedefine HAVE_WORKING_FORK 1
-
-/* Define to 1 if `vfork' works. */
-#cmakedefine HAVE_WORKING_VFORK 1
-
 /* Include sys/type.h if needed */
 #cmakedefine NEED_SYS_TYPE_H

 /* Name of package */
 #define PACKAGE "${PACKAGE}"
-
-/* Define to the address where bug reports for this package should be sent. */
-#cmakedefine PACKAGE_BUGREPORT
-
-/* Define to the full name of this package. */
-#cmakedefine PACKAGE_NAME
-
-/* Define to the full name and version of this package. */
-#cmakedefine PACKAGE_STRING
-
-/* Define to the one symbol short name of this package. */
-#cmakedefine PACKAGE_TARNAME
-
-/* Define to the version of this package. */
-#cmakedefine PACKAGE_VERSION

 /* Define if aqt driver is present */
 #cmakedefine PLD_aqt
@@ -407,9 +383,6 @@
 /* Define if csa is desired */
 #cmakedefine WITH_CSA

-/* Define to 1 if the X Window System is missing or not being used. */
-#cmakedefine X_DISPLAY_MISSING 1
-
 /* Define to `char *' if <sys/types.h> does not define. */
 #cmakedefine caddr_t


incompressible: remove broken restart comparison

--- phSolver/incompressible/test/testing.cmake
+++ phSolver/incompressible/test/testing.cmake
@@ -19,12 +19,6 @@
     valgrind --leak-check=yes --log-file=icSyncValgrind.%p
     ${PHASTA_BINARY_DIR}/bin/phastaIC.exe)
 endif(HAS_VALGRIND)
-set(compareArgs
-  ${CDIR}/4-procs_case-SyncIO-2/
-  ${CDIR}/4-procs_case-SyncIO-2_ref/
-  2 1e-6)
-ic_parallel_test(compare-sync 4 ${CDIR}
-  ${PHASTA_BINARY_DIR}/bin/checkphasta ${compareArgs})

 add_test(NAME ${testLabel}_restart-sync
   COMMAND ${CMAKE_COMMAND}
@@ -38,8 +32,6 @@
   -DNUMPROCS=4
   -P ${CMAKE_CURRENT_SOURCE_DIR}/runphasta.cmake
   )
-ic_parallel_test(compareRestart-sync 4 ${CDIR}
-  ${PHASTA_BINARY_DIR}/bin/checkphasta ${compareArgs})

 add_test(NAME ${testLabel}_posix
   COMMAND ${CMAKE_COMMAND}
@@ -63,13 +55,6 @@
     ${PHASTA_BINARY_DIR}/bin/phastaIC.exe)
 endif(HAS_VALGRIND)

-set(compareArgs
-  ${CDIR}/4-procs_case-Posix/
-  ${CDIR}/4-procs_case-Posix_ref/
-  0 1e-6)
-ic_parallel_test(compare-posix 4 ${CDIR}
-  ${PHASTA_BINARY_DIR}/bin/checkphasta ${compareArgs})
-
 add_test(NAME ${testLabel}_restart-posix
   COMMAND ${CMAKE_COMMAND}
   -DNAME=${casename}
@@ -82,5 +67,3 @@
   -DNUMPROCS=4
   -P ${CMAKE_CURRENT_SOURCE_DIR}/runphasta.cmake
   )
-ic_parallel_test(compareRestart-posix 4 ${CDIR}
-  ${PHASTA_BINARY_DIR}/bin/checkphasta ${compareArgs})


ASan: RPATH enhancements

ASan: RPATH enhancements

--- flags/sanitize_address.cmake
+++ flags/sanitize_address.cmake
@@ -66,4 +66,16 @@

   polly_add_cache_flag(CMAKE_EXE_LINKER_FLAGS "${_xcode_asan_lib}")
   polly_add_cache_flag(CMAKE_SHARED_LINKER_FLAGS "${_xcode_asan_lib}")
+
+  # FIXME: http://www.mail-archive.com/cmake-developers@cmake.org/msg17290.html {
+  polly_add_cache_flag(CMAKE_EXE_LINKER_FLAGS "-Wl,-rpath,${_xcode_asan_lib_dir}")
+  polly_add_cache_flag(CMAKE_SHARED_LINKER_FLAGS "-Wl,-rpath,${_xcode_asan_lib_dir}")
+  # }
+
+  # Hunter copying rules {
+  set_property(GLOBAL APPEND PROPERTY HUNTER_COPY_FILES "${_xcode_asan_lib}")
+  set_property(
+      SOURCE "${_xcode_asan_lib}" PROPERTY HUNTER_DST_RELATIVE_DIR "lib"
+  )
+  # }
 endif()


[cmake] [compiler-rt] Remove duplicate CMAKE_CXX_FLAGS.

`set_target_compile_flags()` ultimately sets COMPILE_FLAGS which is
added to CMAKE_CXX_FLAGS in the compile rule, so passing
CMAKE_CXX_FLAGS causes them to be duplicated.

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

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

--- cmake/Modules/AddCompilerRT.cmake
+++ cmake/Modules/AddCompilerRT.cmake
@@ -64,7 +64,7 @@
     endif()

     set_target_compile_flags(${libname}
-      ${CMAKE_CXX_FLAGS} ${extra_cflags_${libname}} ${target_flags})
+      ${extra_cflags_${libname}} ${target_flags})
     set_property(TARGET ${libname} APPEND PROPERTY
       COMPILE_DEFINITIONS ${LIB_DEFS})
     set_target_properties(${libname} PROPERTIES FOLDER "Compiler-RT Libraries")


fixed issue that cmake complained about

fixed issue that cmake complained about

--- cmake/Modules/WrapResources.cmake
+++ cmake/Modules/WrapResources.cmake
@@ -82,8 +82,7 @@
 "    }\n"
 "\n"
 "    return 0\;\n"
-"}\n"
-""\; )
+"}\n" )

 FILE(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/buildtools" )
 FILE(WRITE "${CMAKE_BINARY_DIR}/buildtools/txt2cpp.cpp" ${txt2cpp_source})


[CMake] Use hidden visibility for static libc++ in Fuchsia

This is enables the use of libc++ in contexts such as device drivers.

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

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

--- cmake/caches/Fuchsia-stage2.cmake
+++ cmake/caches/Fuchsia-stage2.cmake
@@ -119,6 +119,7 @@
     set(RUNTIMES_${target}-fuchsia_LIBCXX_USE_COMPILER_RT ON CACHE BOOL "")
     set(RUNTIMES_${target}-fuchsia_LIBCXX_ENABLE_STATIC_ABI_LIBRARY ON CACHE BOOL "")
     set(RUNTIMES_${target}-fuchsia_LIBCXX_STATICALLY_LINK_ABI_IN_SHARED_LIBRARY OFF CACHE BOOL "")
+    set(RUNTIMES_${target}-fuchsia_LIBCXX_HERMETIC_STATIC_LIBRARY ON CACHE BOOL "")
     set(RUNTIMES_${target}-fuchsia_LIBCXX_ABI_VERSION 2 CACHE STRING "")
   endforeach()


Fix typo, NEPOMUK_FOUND is all uppercase.
Please verify that compiling KMail still works.

svn path=/trunk/KDE/kdepim/; revision=906465

--- kmail/config-kmail.h.cmake
+++ kmail/config-kmail.h.cmake
@@ -9,6 +9,6 @@

 #cmakedefine HAVE_SYS_INOTIFY_H 1

-#cmakedefine Nepomuk_FOUND 1
+#cmakedefine NEPOMUK_FOUND 1

 #cmakedefine HAVE_MMAP 1


BUG: fix find shark to search shark_dir if exists

--- CMake/FindShark.cmake
+++ CMake/FindShark.cmake
@@ -1,56 +1,74 @@
-# - Find Shark
-# Find the Shark includes and library
-#
-#   SHARK_FOUND       - True if Shark found.
-#   SHARK_INCLUDE_DIR - where to find Core/shark.h
-#   SHARK_LIBRARIES   - List of libraries required for shark.
-#
-
-if( SHARK_INCLUDE_DIR )
-    # Already in cache, be silent
-   set( Shark_FIND_QUIETLY TRUE )
-endif()
-
-find_path( SHARK_INCLUDE_DIR shark/Core/shark.h PATH_SUFFIXES shark )
-
-find_library( SHARK_LIBRARY NAMES shark )
-
-mark_as_advanced( SHARK_INCLUDE_DIR
-                  SHARK_LIBRARY )
-find_package(
-	Boost 1.48.0 REQUIRED QUIET COMPONENTS
-	system date_time filesystem
-	program_options serialization thread
-	unit_test_framework
-)
-
-if(NOT Boost_FOUND)
-	message(FATAL_ERROR "Please make sure Boost 1.48.0 is installed on your system")
-endif()
-
-find_file(SHARK_CONFIG_FILE SharkConfig.cmake PATH_SUFFIXES lib/cmake/Shark share/Shark)
-if(SHARK_CONFIG_FILE)
-  file(STRINGS "${SHARK_CONFIG_FILE}" SHARK_CONFIG_FILE_CONTENTS)
-  string(REGEX REPLACE
-      ".*set.*\\(SHARK_VERSION_MAJOR..([0-9]+)\"\\).*" "\\1"
-       SHARK_VERSION_MAJOR "${SHARK_CONFIG_FILE_CONTENTS}")
-  string(REGEX REPLACE
-      ".*set.*\\(SHARK_VERSION_MINOR..([0-9]+)\"\\).*" "\\1"
-       SHARK_VERSION_MINOR "${SHARK_CONFIG_FILE_CONTENTS}")
-  string(REGEX REPLACE
-      ".*set.*\\(SHARK_VERSION_PATCH..([0-9]+)\"\\).*" "\\1"
-       SHARK_VERSION_PATCH "${SHARK_CONFIG_FILE_CONTENTS}")
-
-  set(SHARK_VERSION_STRING
-  "${SHARK_VERSION_MAJOR}.${SHARK_VERSION_MINOR}.${SHARK_VERSION_PATCH}")
-
-endif()
-
-INCLUDE(${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(Shark
-                                  REQUIRED_VARS SHARK_LIBRARY SHARK_INCLUDE_DIR
-                                  VERSION_VAR SHARK_VERSION_STRING)
-if(SHARK_FOUND)
-  set(SHARK_INCLUDE_DIRS ${SHARK_INCLUDE_DIR} ${Boost_INCLUDE_DIR} )
-  set(SHARK_LIBRARIES ${SHARK_LIBRARY} ${Boost_LIBRARIES} )
-endif()
+# - Find Shark
+# Find the Shark includes and library
+#
+#   SHARK_FOUND       - True if Shark found.
+#   SHARK_INCLUDE_DIR - where to find Core/shark.h
+#   SHARK_LIBRARIES   - List of libraries required for shark.
+#
+
+set(SHARK_SEARCH_PATH)
+
+set(SHARK_CONFIG_FILE)
+
+if(Shark_DIR)
+  get_filename_component(SHARK_SEARCH_PATH "${Shark_DIR}" PATH)
+  get_filename_component(SHARK_SEARCH_PATH "${SHARK_SEARCH_PATH}" PATH)
+  get_filename_component(SHARK_SEARCH_PATH "${SHARK_SEARCH_PATH}" PATH)
+
+  if(EXISTS "${Shark_DIR}/SharkConfig.cmake")
+    set(SHARK_CONFIG_FILE ${Shark_DIR}/SharkConfig.cmake)
+  endif()
+
+endif() #if(Shark_DIR)
+
+find_path( SHARK_INCLUDE_DIR shark/Core/Shark.h
+  PATHS "${SHARK_SEARCH_PATH}"
+  PATH_SUFFIXES include include/shark shark)
+
+find_library( SHARK_LIBRARY
+  NAMES shark
+  PATHS "${SHARK_SEARCH_PATH}"
+  PATH_SUFFIXES lib
+  )
+
+mark_as_advanced( SHARK_INCLUDE_DIR
+                  SHARK_LIBRARY )
+find_package(
+	Boost 1.48.0 REQUIRED QUIET COMPONENTS
+	system date_time filesystem
+	program_options serialization thread
+	unit_test_framework
+)
+
+if(NOT Boost_FOUND)
+  message(FATAL_ERROR "Please make sure Boost 1.48.0 is installed on your system")
+endif()
+
+if(NOT SHARK_CONFIG_FILE)
+  find_file(SHARK_CONFIG_FILE SharkConfig.cmake PATH_SUFFIXES lib/cmake/Shark share/Shark)
+endif()
+if(SHARK_CONFIG_FILE)
+  file(STRINGS "${SHARK_CONFIG_FILE}" SHARK_CONFIG_FILE_CONTENTS)
+  string(REGEX REPLACE
+      ".*set.*\\(SHARK_VERSION_MAJOR..([0-9]+)\"\\).*" "\\1"
+       SHARK_VERSION_MAJOR "${SHARK_CONFIG_FILE_CONTENTS}")
+  string(REGEX REPLACE
+      ".*set.*\\(SHARK_VERSION_MINOR..([0-9]+)\"\\).*" "\\1"
+       SHARK_VERSION_MINOR "${SHARK_CONFIG_FILE_CONTENTS}")
+  string(REGEX REPLACE
+      ".*set.*\\(SHARK_VERSION_PATCH..([0-9]+)\"\\).*" "\\1"
+       SHARK_VERSION_PATCH "${SHARK_CONFIG_FILE_CONTENTS}")
+
+  set(SHARK_VERSION_STRING
+  "${SHARK_VERSION_MAJOR}.${SHARK_VERSION_MINOR}.${SHARK_VERSION_PATCH}")
+
+endif()
+
+INCLUDE(${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(Shark
+                                  REQUIRED_VARS SHARK_LIBRARY SHARK_INCLUDE_DIR
+                                  VERSION_VAR SHARK_VERSION_STRING)
+if(SHARK_FOUND)
+  set(SHARK_INCLUDE_DIRS ${SHARK_INCLUDE_DIR} ${Boost_INCLUDE_DIR} )
+  set(SHARK_LIBRARIES ${SHARK_LIBRARY} ${Boost_LIBRARIES} )
+endif()


Remove AGL.framework from OS X OPENGL_LIBRARIES.

The AGL framework for Carbon is deprecated by VTK and by OS X itself.
Linking to it causes forward compatibility problems because Apple has
removed it from the Xcode 10.10 SDK. This framework is added to the
OPENGL_LIBRARIES by FindOpenGL.cmake for CMake 3.4 and earlier, and
must be removed by vtkOpenGL.cmake.

--- CMake/vtkOpenGL.cmake
+++ CMake/vtkOpenGL.cmake
@@ -64,6 +64,21 @@
 else()
   find_package(OpenGL REQUIRED)
   include_directories(SYSTEM ${OPENGL_INCLUDE_DIR})
+  if(APPLE)
+    # Remove the deprecated AGL framework found by FindOpenGL.cmake
+    # (this is only required for CMake 3.4.1 and earlier)
+    set(_new_libs)
+    foreach(_lib ${OPENGL_LIBRARIES})
+      get_filename_component(_name "${_lib}" NAME)
+      string(TOLOWER "${_name}" _name)
+      if(NOT "${_name}" STREQUAL "agl.framework")
+        list(APPEND _new_libs ${_lib})
+      endif()
+    endforeach()
+    set(OPENGL_LIBRARIES ${_new_libs})
+    unset(_new_libs)
+    unset(_name)
+  endif()
 endif()

 # Function to link a VTK target to the necessary OpenGL libraries.


Use global property

Use global property

--- flags/sanitize_address.cmake
+++ flags/sanitize_address.cmake
@@ -74,8 +74,7 @@

   # Hunter copying rules {
   set_property(GLOBAL APPEND PROPERTY HUNTER_COPY_FILES "${_xcode_asan_lib}")
-  set_property(
-      SOURCE "${_xcode_asan_lib}" PROPERTY HUNTER_DST_RELATIVE_DIR "lib"
-  )
+  # Do not use SOURCE property because it's visible only for current directory
+  set_property(GLOBAL PROPERTY "HUNTER_DST_RELATIVE_DIR_${_xcode_asan_lib}" "lib")
   # }
 endif()


Remove unused includes from ConfigureChecks.cmake.

--- ConfigureChecks.cmake
+++ ConfigureChecks.cmake
@@ -1,7 +1,3 @@
-include(CheckIncludeFile)
-include(CheckIncludeFiles)
-include(CheckSymbolExists)
-include(CheckFunctionExists)
 include(CheckLibraryExists)
 include(CheckTypeSize)
 include(CheckCXXSourceCompiles)


Don't set options again.

Don't set options again.

git-svn-id: b1dee0d48e635e16c3b356ce77271b225d4db9f7@619 7dcaeef0-15fb-0310-b436-a5af3365683c

--- ConfigureChecks.cmake
+++ ConfigureChecks.cmake
@@ -50,18 +50,6 @@
 endif (Z_LIBRARY)

 # OPTIONS
-if (WITH_LIBZ)
-  set(WITH_LIBZ 1)
-endif (WITH_LIBZ)
-
-if (WITH_SSH1)
-  set(WITH_SSH1 1)
-endif (WITH_SSH1)
-
-if (WITH_SERVER)
-  set(WITH_SERVER 1)
-endif (WITH_SERVER)
-
 if (WITH_DEBUG_CRYPTO)
   set(DEBUG_CRYPTO 1)
 endif (WITH_DEBUG_CRYPTO)


cmake: Detect network function correctly on Windows

Signed-off-by: Andreas Schneider <5be00ddc76278cf6077f5047ca3384a88460c671@cryptomilk.org>
(cherry picked from commit 195f25cfbd4a13d16bd14c657c993a979215402a)

--- ConfigureChecks.cmake
+++ ConfigureChecks.cmake
@@ -99,11 +99,6 @@
 check_function_exists(strncpy HAVE_STRNCPY)
 check_function_exists(vsnprintf HAVE_VSNPRINTF)
 check_function_exists(snprintf HAVE_SNPRINTF)
-check_function_exists(poll HAVE_POLL)
-check_function_exists(select HAVE_SELECT)
-check_function_exists(getaddrinfo HAVE_GETADDRINFO)
-check_symbol_exists(ntohll arpa/inet.h HAVE_NTOHLL)
-check_symbol_exists(htonll arpa/inet.h HAVE_HTONLL)

 if (WIN32)
     check_function_exists(_strtoui64 HAVE__STRTOUI64)
@@ -114,16 +109,27 @@
     check_function_exists(_snprintf_s HAVE__SNPRINTF_S)

     if (HAVE_WSPIAPI_H OR HAVE_WS2TCPIP_H)
-        set(HAVE_GETADDRINFO TRUE)
-        set(HAVE_GETHOSTBYNAME TRUE)
-        if (MSVC)
-            set(HAVE_NTOHLL TRUE)
-            set(HAVE_HTONLL TRUE)
-        endif (MSVC)
+        check_symbol_exists(ntohll winsock2.h HAVE_NTOHLL)
+        check_symbol_exists(htonll winsock2.h HAVE_HTONLL)
+
+        set(CMAKE_REQUIRED_LIBRARIES ws2_32)
+        check_symbol_exists(select "winsock2.h;ws2tcpip.h" HAVE_SELECT)
+        check_symbol_exists(poll "winsock2.h;ws2tcpip.h" HAVE_SELECT)
+        # The getaddrinfo function is defined to the WspiapiGetAddrInfo inline function
+        check_symbol_exists(getaddrinfo "winsock2.h;ws2tcpip.h" HAVE_GETADDRINFO)
+        set(CMAKE_REQUIRED_LIBRARIES)
     endif (HAVE_WSPIAPI_H OR HAVE_WS2TCPIP_H)

     set(HAVE_SELECT TRUE)
+else (WIN32)
+    check_function_exists(poll HAVE_POLL)
+    check_function_exists(select HAVE_SELECT)
+    check_function_exists(getaddrinfo HAVE_GETADDRINFO)
+
+    check_symbol_exists(ntohll arpa/inet.h HAVE_NTOHLL)
+    check_symbol_exists(htonll arpa/inet.h HAVE_HTONLL)
 endif (WIN32)
+

 if (UNIX)
     if (NOT LINUX)


Use gcc10-gcc and gcc10-g++ on Amazon Linux 2.

--- default_build_settings.cmake
+++ default_build_settings.cmake
@@ -83,6 +83,13 @@
   message("-- Setting up default build settings for fedora 35")
   set(DEFAULT_EXTRA_INCLUDE_DIRECTORY "${VESPA_DEPS}/include" "/usr/include/openblas" PARENT_SCOPE)
   set(DEFAULT_VESPA_LLVM_VERSION "12" PARENT_SCOPE)
+endfunction()
+
+function(setup_vespa_default_build_settings_amzn_2)
+  message("-- Setting up default build settings for amzn 2")
+  set(DEFAULT_EXTRA_LINK_DIRECTORY "${VESPA_DEPS}/lib64" "/usr/lib64/llvm7.0/lib" PARENT_SCOPE)
+  set(DEFAULT_EXTRA_INCLUDE_DIRECTORY "${VESPA_DEPS}/include" "/usr/include/llvm7.0" "/usr/include/openblas" PARENT_SCOPE)
+  set(DEFAULT_VESPA_LLVM_VERSION "7" PARENT_SCOPE)
 endfunction()

 function(setup_vespa_default_build_settings_ubuntu)
@@ -194,6 +201,8 @@
     setup_vespa_default_build_settings_fedora_34()
   elseif(VESPA_OS_DISTRO_COMBINED STREQUAL "fedora 35")
     setup_vespa_default_build_settings_fedora_35()
+  elseif(VESPA_OS_DISTRO_COMBINED STREQUAL "amzn 2")
+    setup_vespa_default_build_settings_amzn_2()
   elseif(VESPA_OS_DISTRO STREQUAL "ubuntu")
     setup_vespa_default_build_settings_ubuntu()
   elseif(VESPA_OS_DISTRO STREQUAL "debian")
@@ -295,6 +304,9 @@
     if(APPLE)
       set(DEFAULT_CMAKE_C_COMPILER "/usr/local/bin/gcc-10")
       set(DEFAULT_CMAKE_CXX_COMPILER "/usr/local/bin/g++-10")
+    elseif(VESPA_OS_DISTRO_COMBINED STREQUAL "amzn 2")
+      set(DEFAULT_CMAKE_C_COMPILER "/usr/bin/gcc10-gcc")
+      set(DEFAULT_CMAKE_CXX_COMPILER "/usr/bin/gcc10-g++")
     endif()
   elseif(VESPA_COMPILER_VARIANT STREQUAL "clang")
     if(APPLE)


[deps] deps now depends only on Java runtime

--- deps/deps-lib/DepsInit.cmake
+++ deps/deps-lib/DepsInit.cmake
@@ -19,7 +19,7 @@

 cmake_minimum_required(VERSION 3.2)

-find_package(Java REQUIRED)
+find_package(Java 1.8 REQUIRED COMPONENTS Runtime )

 # Set flag, to signal that deps is enabled
 set(DEPS_ENABLED 1)


Add "--gen-suppressions=all" to valgrind option

--- src/CTestConfig.cmake
+++ src/CTestConfig.cmake
@@ -14,8 +14,8 @@
 # Note: We turn off "--show-reachable=yes" option.
 #set(MEMORYCHECK_SUPPRESSIONS_FILE ${CMAKE_SOURCE_DIR}/memcheck.supp)
 file(TO_CMAKE_PATH "${CMAKE_SOURCE_DIR}/memcheck.supp"  MEMORYCHECK_SUPPRESSIONS_FILE)
-set(VALGRIND_COMMAND_OPTIONS "-q --tool=memcheck --leak-check=yes --workaround-gcc296-bugs=yes --num-callers=50 --trace-children=yes --leak-check=full --track-origins=yes")
-set(MEMORYCHECK_COMMAND_OPTIONS "-q --tool=memcheck --leak-check=yes --workaround-gcc296-bugs=yes --num-callers=50 --trace-children=yes --leak-check=full --track-origins=yes")
+set(VALGRIND_COMMAND_OPTIONS "-q --tool=memcheck --leak-check=yes --workaround-gcc296-bugs=yes --num-callers=50 --trace-children=yes --leak-check=full --track-origins=yes --gen-suppressions=all")
+set(MEMORYCHECK_COMMAND_OPTIONS "-q --tool=memcheck --leak-check=yes --workaround-gcc296-bugs=yes --num-callers=50 --trace-children=yes --leak-check=full --track-origins=yes --get-suppressions=all")

 set(CTEST_DROP_METHOD "http")
 set(CTEST_DROP_SITE "cmacslab2.modck.cs.cmu.edu")


Fix win32 scipy wheel abi tag

Fix win32 scipy wheel abi tag

The windows scipy wheel abi tag should be "cp37m" rather than
"none" (see [here](https://pypi.org/project/scipy/1.2.1/#files)).

This looks like it should be the last one. I should have noticed
and changed it with #281 (oops).

Signed-off-by: Patrick Avery <743342299f279e7a8c3ff5eb40671fce3e95f13a@kitware.com>

--- projects/win32/scipy.cmake
+++ projects/win32/scipy.cmake
@@ -1,3 +1,3 @@
-set(scipy_platform_string "cp37-none-win_amd64")
+set(scipy_platform_string "cp37-cp37m-win_amd64")

 include(scipy.common)


MSVC: download binaries from sourceforge

--- CMake/External_boost.cmake
+++ CMake/External_boost.cmake
@@ -14,20 +14,81 @@
   set(BOOST_SB_BUILD_DIR ${CMAKE_BINARY_DIR}/${proj}/build)
   set(BOOST_SB_SRC ${CMAKE_BINARY_DIR}/${proj}/src/${proj})

-  ExternalProject_Add(${proj}
-    PREFIX ${proj}
-    URL "http://sourceforge.net/projects/boost/files/boost/1.57.0/boost_1_57_0.tar.gz/download"
-    URL_MD5 25f9a8ac28beeb5ab84aa98510305299
-    BINARY_DIR ${BOOST_SB_BUILD_DIR}
-    INSTALL_DIR ${CMAKE_INSTALL_PREFIX}
-    CMAKE_CACHE_ARGS
-      -DCMAKE_INSTALL_PREFIX:STRING=${CMAKE_INSTALL_PREFIX}
-      -DCMAKE_BUILD_TYPE:STRING=Release
-      -DBUILD_SHARED_LIBS:BOOL=ON
-    PATCH_COMMAND ${CMAKE_COMMAND} -E copy
-      ${CMAKE_SOURCE_DIR}/patches/${proj}/CMakeLists.txt
-      ${BOOST_SB_SRC}
+  if(UNIX)
+    ExternalProject_Add(${proj}
+        PREFIX ${proj}
+        URL "http://sourceforge.net/projects/boost/files/boost/1.57.0/boost_1_57_0.tar.gz/download"
+        URL_MD5 25f9a8ac28beeb5ab84aa98510305299
+        BINARY_DIR ${BOOST_SB_BUILD_DIR}
+        INSTALL_DIR ${CMAKE_INSTALL_PREFIX}
+        CMAKE_CACHE_ARGS
+        -DCMAKE_INSTALL_PREFIX:STRING=${CMAKE_INSTALL_PREFIX}
+        -DCMAKE_BUILD_TYPE:STRING=Release
+        -DBUILD_SHARED_LIBS:BOOL=ON
+        PATCH_COMMAND ${CMAKE_COMMAND} -E copy
+        ${CMAKE_SOURCE_DIR}/patches/${proj}/CMakeLists.txt
+        ${BOOST_SB_SRC}
     )
+  else(MSVC)
+    #TODO: find hash for archives properly
+    set(BOOST_HEADERS_URL_HASH 1605dc6085cb2dc778ef5ab6c0e59083)
+    set(BOOST_GRAPH_URL_HASH c246516ca84a3c79ae8a0b22fceb0344)
+    set(BOOST_UTF_URL_HASH 75971963a74c76d32e01974a8e48be11)
+
+   if(MSVC10)
+    set(BOOST_HEADERS_URL_HASH 1605dc6085cb2dc778ef5ab6c0e59083)
+    set(BOOST_GRAPH_URL_HASH c246516ca84a3c79ae8a0b22fceb0344)
+    set(BOOST_UTF_URL_HASH 75971963a74c76d32e01974a8e48be11)
+   else(MSVC80)
+
+   else(CMAKE_COMPILER_2005)
+
+   endif()
+
+
+
+    set(BOOST_HEADERS_URL "http://sourceforge.net/projects/boost/files/boost-binaries/1.50.0/boost_1_50_headers.zip/download")
+    set(BOOST_GRAPH_URL "http://sourceforge.net/projects/boost/files/boost-binaries/1.50.0/libboost_graph-vc100-mt-1_50.zip/download")
+    set(BOOST_UTF_URL "http://sourceforge.net/projects/boost/files/boost-binaries/1.50.0/boost_unit_test_framework-vc100-mt-1_50.zip/download")
+    set(BOOST_REGEX_URL "http://sourceforge.net/projects/boost/files/boost-binaries/1.50.0/libboost_regex-vc100-mt-1_50.zip/download")
+
+    ExternalProject_Add(${proj}_HEADERS
+        PREFIX ${proj}/_HEADERS
+        URL ${BOOST_HEADERS_URL}
+        URL_MD5 ${BOOST_HEADERS_URL_HASH}
+        SOURCE_DIR ${BOOST_SB_SRC}/include/boost
+        CONFIGURE_COMMAND ""
+        BUILD_COMMAND ""
+        INSTALL_COMMAND ${CMAKE_COMMAND} -E copy_directory ${BOOST_SB_SRC}/include/ ${CMAKE_INSTALL_PREFIX}/include/
+     )
+    set(BOOSTLIBS)
+    foreach(BOOSTLIB "REGEX" "GRAPH" "UTF")
+        ExternalProject_Add(${proj}_${BOOSTLIB}
+            PREFIX ${proj}/_${BOOSTLIB}
+            URL ${BOOST_${BOOSTLIB}_URL}
+            URL_MD5 ${BOOST_${BOOSTLIB}_URL_HASH}
+            SOURCE_DIR ${BOOST_SB_SRC}/lib
+            DEPENDS ${proj}_HEADERS
+            CONFIGURE_COMMAND ""
+            BUILD_COMMAND ""
+            INSTALL_COMMAND ${CMAKE_COMMAND} -E copy_directory ${BOOST_SB_SRC}/lib ${CMAKE_INSTALL_PREFIX}/lib
+        )
+    list(APPEND BOOSTLIBS ${proj}_${BOOSTLIB})
+    endforeach()
+
+        ExternalProject_Add(${proj}
+        PREFIX ${proj}
+        DOWNLOAD_COMMAND ""
+        SOURCE_DIR ${BOOST_SB_SRC}
+        DEPENDS ${BOOSTLIBS}
+        CONFIGURE_COMMAND ""
+        BUILD_COMMAND ""
+        INSTALL_COMMAND ""
+     )
+
+  endif()

+  list(APPEND OTB_DEPS ${proj})
   message(STATUS "  Using Boost SuperBuild version")
+
 endif()


ENH: Added new VTK_ABI_CXX_FLAGS to kits to support GCC visibility.

--- CMake/KitCommonBlock.cmake
+++ CMake/KitCommonBlock.cmake
@@ -6,6 +6,10 @@

 ADD_LIBRARY(vtk${KIT} ${Kit_SRCS} ${Kit_EXTRA_SRCS} ${KitInstantiator_SRCS})
 SET(KIT_LIBRARY_TARGETS ${KIT_LIBRARY_TARGETS} vtk${KIT})
+# Add target specific compile flags for ABI setttings
+IF(VTK_ABI_CXX_FLAGS)
+  SET_PROPERTY(TARGET APPEND PROPERTY COMPILE_FLAGS "${VTK_ABI_CXX_FLAGS}")
+ENDIF(VTK_ABI_CXX_FLAGS)

 # Allow the user to customize their build with some local options
 #


Update DCMTK to post-3.6.2 to fix MSVC compilation

--- CMakeExternals/DCMTK.cmake
+++ CMakeExternals/DCMTK.cmake
@@ -28,8 +28,9 @@

     ExternalProject_Add(${proj}
       LIST_SEPARATOR ${sep}
-      URL ${MITK_THIRDPARTY_DOWNLOAD_PREFIX_URL}/dcmtk-3.6.2.tar.gz
-      URL_MD5 d219a4152772985191c9b89d75302d12
+      # specific version post-3.6.2 but before an API change which breaks DCMQI
+      URL ${MITK_THIRDPARTY_DOWNLOAD_PREFIX_URL}/dcmtk_065a4b1f.tar.gz
+      URL_MD5 9362231aba67812deed65b35308de8bd
       CMAKE_GENERATOR ${gen}
       CMAKE_ARGS
          ${ep_common_args}


cmake: fixed a typo

cmake: fixed a typo

--- CMakeModules/FindGSL.cmake
+++ CMakeModules/FindGSL.cmake
@@ -32,7 +32,7 @@
   foreach (LIB ${PC_GSL_LIBRARIES})
     find_library(GSL_${LIB} NAMES ${LIB} HINTS ${PC_GSL_LIBRARY_DIRS} )
     list(APPEND GSL_LIBRARY ${GSL_${LIB}})
-    unset(${GSL_${LIB}} CACHE)
+    unset(GSL_${LIB} CACHE)
   endforeach(LIB)
 endif (NOT BUILD_SHARED_LIBS)


Fix indentation in FindMKL cmake module

Fix indentation in FindMKL cmake module

--- CMakeModules/FindMKL.cmake
+++ CMakeModules/FindMKL.cmake
@@ -261,47 +261,47 @@
         IntelSWTools/compilers_and_libraries/windows/compiler/lib/intel64
         IntelSWTools/compilers_and_libraries/windows/tbb/lib/intel64/${msvc_dir}
         )
-      if(MKL_${mkl_args_NAME}_STATIC_LINK_LIBRARY)
-        if (CMAKE_VERSION VERSION_GREATER 3.14)
-          message(VERBOSE "MKL_${mkl_args_NAME}_STATIC_LINK_LIBRARY: ${MKL_${mkl_args_NAME}_STATIC_LINK_LIBRARY}")
-        endif()
+    if(MKL_${mkl_args_NAME}_STATIC_LINK_LIBRARY)
+      if(CMAKE_VERSION VERSION_GREATER 3.14)
+        message(VERBOSE "MKL_${mkl_args_NAME}_STATIC_LINK_LIBRARY: ${MKL_${mkl_args_NAME}_STATIC_LINK_LIBRARY}")
       endif()
-      mark_as_advanced(MKL_${mkl_args_NAME}_STATIC_LINK_LIBRARY)
     endif()
+    mark_as_advanced(MKL_${mkl_args_NAME}_STATIC_LINK_LIBRARY)
+  endif()
+
+  set_target_properties(MKL::${mkl_args_NAME}
+    PROPERTIES
+      INTERFACE_INCLUDE_DIRECTORIES "${MKL_INCLUDE_DIR}"
+      IMPORTED_LOCATION "${MKL_${mkl_args_NAME}_LINK_LIBRARY}"
+      IMPORTED_NO_SONAME TRUE)
+
+  set_target_properties(MKL::${mkl_args_NAME}_STATIC
+      PROPERTIES
+      INTERFACE_INCLUDE_DIRECTORIES "${MKL_INCLUDE_DIR}"
+      IMPORTED_LOCATION "${MKL_${mkl_args_NAME}_STATIC_LINK_LIBRARY}"
+      IMPORTED_NO_SONAME TRUE)
+
+  if(WIN32)
+    find_file(MKL_${mkl_args_NAME}_DLL_LIBRARY
+      NAMES
+        ${CMAKE_SHARED_LIBRARY_PREFIX}${mkl_args_LIBRARY_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}
+        ${CMAKE_SHARED_LIBRARY_PREFIX}${mkl_args_LIBRARY_NAME}${md_suffix}${CMAKE_SHARED_LIBRARY_SUFFIX}
+        lib${mkl_args_LIBRARY_NAME}${md_suffix}${CMAKE_SHARED_LIBRARY_SUFFIX}
+        $ENV{LIB}
+        $ENV{LIBRARY_PATH}
+      PATH_SUFFIXES
+        IntelSWTools/compilers_and_libraries/windows/redist/intel64/mkl
+        IntelSWTools/compilers_and_libraries/windows/redist/intel64/compiler
+        IntelSWTools/compilers_and_libraries/windows/redist/intel64/tbb/${msvc_dir}
+      NO_SYSTEM_ENVIRONMENT_PATH)

     set_target_properties(MKL::${mkl_args_NAME}
       PROPERTIES
-        INTERFACE_INCLUDE_DIRECTORIES "${MKL_INCLUDE_DIR}"
-        IMPORTED_LOCATION "${MKL_${mkl_args_NAME}_LINK_LIBRARY}"
-        IMPORTED_NO_SONAME TRUE)
-
-    set_target_properties(MKL::${mkl_args_NAME}_STATIC
-        PROPERTIES
-        INTERFACE_INCLUDE_DIRECTORIES "${MKL_INCLUDE_DIR}"
-        IMPORTED_LOCATION "${MKL_${mkl_args_NAME}_STATIC_LINK_LIBRARY}"
-        IMPORTED_NO_SONAME TRUE)
-
-    if(WIN32)
-      find_file(MKL_${mkl_args_NAME}_DLL_LIBRARY
-        NAMES
-          ${CMAKE_SHARED_LIBRARY_PREFIX}${mkl_args_LIBRARY_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}
-          ${CMAKE_SHARED_LIBRARY_PREFIX}${mkl_args_LIBRARY_NAME}${md_suffix}${CMAKE_SHARED_LIBRARY_SUFFIX}
-          lib${mkl_args_LIBRARY_NAME}${md_suffix}${CMAKE_SHARED_LIBRARY_SUFFIX}
-          $ENV{LIB}
-          $ENV{LIBRARY_PATH}
-        PATH_SUFFIXES
-          IntelSWTools/compilers_and_libraries/windows/redist/intel64/mkl
-          IntelSWTools/compilers_and_libraries/windows/redist/intel64/compiler
-          IntelSWTools/compilers_and_libraries/windows/redist/intel64/tbb/${msvc_dir}
-        NO_SYSTEM_ENVIRONMENT_PATH)
-
-      set_target_properties(MKL::${mkl_args_NAME}
-        PROPERTIES
-          IMPORTED_LOCATION "${MKL_${mkl_args_NAME}_DLL_LIBRARY}"
-          IMPORTED_IMPLIB "${MKL_${mkl_args_NAME}_LINK_LIBRARY}")
-
-      mark_as_advanced(MKL_${mkl_args_NAME}_DLL_LIBRARY)
-    endif()
+        IMPORTED_LOCATION "${MKL_${mkl_args_NAME}_DLL_LIBRARY}"
+        IMPORTED_IMPLIB "${MKL_${mkl_args_NAME}_LINK_LIBRARY}")
+
+    mark_as_advanced(MKL_${mkl_args_NAME}_DLL_LIBRARY)
+  endif()
 endfunction()


Fix issue #7 of Scality's cloudmig repo (Cmake FindDot re-runs find_program).

The patch was proposed by trombonehero(github)

--- CMakeScripts/FindDot.cmake
+++ CMakeScripts/FindDot.cmake
@@ -49,5 +49,6 @@
   IF (DOT_EXECUTABLE)
     SET (DOT_EXECUTABLE_FOUND TRUE)
     MESSAGE(STATUS "Dot executable found : ${DOT_EXECUTABLE}")
+    SET (DOT_EXECUTABLE ${DOT_EXECUTABLE} CACHE FILEPATH "'dot' location")
   ENDIF (DOT_EXECUTABLE)
 ENDIF (NOT DOT_EXECUTABLE_FOUND)


Remove HAVE_IOS and HAVE_IOS_H macros from the installed version of oce-config.h

This was a false positive - grep matched the pattern HAVE_IOS to HAVE_IOSTREAM.
I only checked for this in inc/, it may be possible to do away with it for
building OCE as well.

--- oce_install_config.h.cmake
+++ oce_install_config.h.cmake
@@ -14,9 +14,6 @@
 #cmakedefine HAVE_IOMANIP 1
 #cmakedefine HAVE_IOMANIP_H 1

-#cmakedefine HAVE_IOS 1
-#cmakedefine HAVE_IOS_H 1
-
 #cmakedefine HAVE_FSTREAM 1
 #cmakedefine HAVE_FSTREAM_H 1


CMake: use -O3 as default

CMake: use -O3 as default

--- CommonCompilerConfig.cmake
+++ CommonCompilerConfig.cmake
@@ -208,9 +208,8 @@
 # try compiling without them.
 #
 if(NOT ${CMAKE_CXX_COMPILER_ID} STREQUAL "MSVC")
-  set(optimization_flags_cc "${optimization_flags_cc} -O2")
-  set(optimization_flags_cc "-pipe ${optimization_flags_cc}") #TODO use -Ofast instead of -O3
-  set(optimization_flags_lt "-O2 ${optimization_flags_lt}")
+  set(optimization_flags_cc "-pipe ${optimization_flags_cc} -O3") #TODO use -Ofast instead of -O3
+  set(optimization_flags_lt "-O3 ${optimization_flags_lt}")

   if(NOT ${CMAKE_SYSTEM_PROCESSOR} STREQUAL "armv7l")
     set(optimization_flags_cc "${optimization_flags_cc} -mtune=generic")


COMP: HDF5 fails to compile on mingw

COMP: HDF5 fails to compile on mingw

The file H5Omtime.c failed to compile under Mingw because the variable
timezone was not defined. The config check set H5_HAVE_TIMEZONE to 1
for all Windows platforms. This patch excludes that set for MINGW.

There is a bit of mystery however. The VTK hdf5 library does compile
properly on mingw and the VTK ConfigureChecks.cmake file is virtually
the same as the ITK version. This indicates there is some other config
difference between VTK and ITK.

Change-Id: I85b2d3c56e9c6a3b3abd6a4b97be63e4166e3b58

--- Modules/ThirdParty/HDF5/src/itkhdf5/ConfigureChecks.cmake
+++ Modules/ThirdParty/HDF5/src/itkhdf5/ConfigureChecks.cmake
@@ -484,7 +484,9 @@
 # Check a bunch of other functions
 #-----------------------------------------------------------------------------
 IF (WINDOWS)
-  SET (H5_HAVE_TIMEZONE 1)
+  IF (NOT MINGW)
+    SET (H5_HAVE_TIMEZONE 1)
+  ENDIF (NOT MINGW)
   SET (H5_HAVE_FUNCTION 1)
 ELSE (WINDOWS)
   FOREACH (test
@@ -495,7 +497,6 @@
       HAVE_ATTRIBUTE
       HAVE_FUNCTION
       HAVE_TM_GMTOFF
-      HAVE_TIMEZONE
       HAVE_STRUCT_TIMEZONE
       HAVE_STAT_ST_BLOCKS
       HAVE_FUNCTION
@@ -511,6 +512,10 @@
   )
     HDF5_FUNCTION_TEST (${test})
   ENDFOREACH (test)
+
+  IF(NOT CYGWIN)
+    HDF5_FUNCTION_TEST (HAVE_TIMEZONE)
+  ENDIF()
 ENDIF (WINDOWS)

 #-----------------------------------------------------------------------------
@@ -601,6 +606,7 @@
 ENDIF (HDF5_ENABLE_HSIZET)
 IF (CYGWIN)
   SET (H5_HAVE_LSEEK64 0)
+  SET (H5_CYGWIN_ULLONG_TO_LDOUBLE_ROUND_PROBLEM 1)
 ENDIF (CYGWIN)

 #-----------------------------------------------------------------------------


Set VTK_PYTHON_VERSION to 3

Set VTK_PYTHON_VERSION to 3

--- projects/paraview.cmake
+++ projects/paraview.cmake
@@ -31,6 +31,7 @@
     -DVTK_CUSTOM_LIBRARY_SUFFIX:STRING=
     -DVTK_PYTHON_FULL_THREADSAFE:BOOL=ON
     -DVTK_NO_PYTHON_THREADS:BOOL=OFF
+    -DVTK_PYTHON_VERSION:STRING=3
     -DPARAVIEW_QT_VERSION:STRING=5
     -DPARAVIEW_BUILD_QT_GUI:BOOL=ON
     -DPARAVIEW_ENABLE_PYTHON:BOOL=ON


fixed typo in build config

fixed typo in build config

--- plugins/vtkSpaceCraftInfoFilter/install_CDAwebTK.cmake
+++ plugins/vtkSpaceCraftInfoFilter/install_CDAwebTK.cmake
@@ -24,24 +24,19 @@
   execute_process(
       COMMAND ${PV_SUPERBUILD_LIST_DIR}/apple/fixup_plugin.py
             # The directory containing the plugin dylibs or the plugin itself.
-            ${TMP_DIR}/CDAwebTK//${SHARED_LIBRARY_PREFIX}CDAwebTK${SHARED_LIBRARY_SUFFIX}
+            ${TMP_DIR}/CDAwebTK/${SHARED_LIBRARY_PREFIX}CDAwebTK${SHARED_LIBRARY_SUFFIX}
             # names to replace (in order)
             "${PARAVIEW_BINARY_DIR}/lib/=@executable_path/../Libraries/"
-            "${QT_LIBRARY_DIR}/Qt=@executable_path/../Frameworks/Qt/"
+            "${QT_LIBRARY_DIR}/Qt=@executable_path/../Frameworks/Qt"
             "${QT_LIBRARY_DIR}/=@executable_path/../Libraries/"
             "libhdf5.7.3.0.dylib=@executable_path/../Libraries/libhdf5.1.8.9.dylib"
             "libhdf5_hl.7.3.0.dylib=@executable_path/../Libraries/libhdf5.1.8.9.dylib"
             )
 endif()

-message(STATUS "COMMAND: ${PV_SUPERBUILD_LIST_DIR}/apple/fixup_plugin.py
-            ${TMP_DIR}/CDAwebTK//${SHARED_LIBRARY_PREFIX}CDAwebTK${SHARED_LIBRARY_SUFFIX}
-            "${PARAVIEW_BINARY_DIR}/lib/=@executable_path/../Libraries/"
-            "${QT_LIBRARY_DIR}/Qt=@executable_path/../Frameworks/Qt/"
-            "${QT_LIBRARY_DIR}/=@executable_path/../Libraries/"
-            "libhdf5.7.3.0.dylib=@executable_path/../Libraries/libhdf5.1.8.9.dylib"
-            "libhdf5_hl.7.3.0.dylib=@executable_path/../Libraries/libhdf5.1.8.9.dylib"")
-
 execute_process(
   COMMAND ${CMAKE_COMMAND} -E tar cvfz ${bundle_name} CDAwebTK
   WORKING_DIRECTORY ${TMP_DIR})
+
+message(STATUS "Archive Created in ${bundle_name}")
+message(STATUS "FIXUP IS NOW COMPLETE")


Add log message

Add log message

--- cmake/modules/hunter_pack_git_self.cmake
+++ cmake/modules/hunter_pack_git_self.cmake
@@ -54,6 +54,10 @@
   endif()

   set(cmd "${git_executable}" status --porcelain)
+  hunter_status_debug(
+      "Run command '${cmd}' in '${top_git_directory}' directory"
+  )
+  hunter_status_debug("HUNTER_GATE_LOCATION: ${HUNTER_GATE_LOCATION}")
   execute_process(
       COMMAND ${cmd}
       WORKING_DIRECTORY "${top_git_directory}"


[exotica_core] Do not warn for maybe-unitialized

--- exotica_core/cmake/exotica.cmake
+++ exotica_core/cmake/exotica.cmake
@@ -1,7 +1,7 @@
 cmake_minimum_required(VERSION 2.8.3)

 message(STATUS "Compiling using c++ 11 (required by EXOTica)")
-add_compile_options(-std=c++11 -Wfloat-conversion -Wall)
+add_compile_options(-std=c++11 -Wfloat-conversion -Wall -Wno-maybe-uninitialized)
 # add_compile_options(-Werror)

 # MoveIt Core Robot Model isnt aligned :'(


[pch] add support for generator expressions in include_dirs and compile_definitions

However, single generator expression containing multiple elements is still
not supported because it breaks the foreach loop.

--- pch.cmake
+++ pch.cmake
@@ -44,7 +44,7 @@
 # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 # SOFTWARE.

-macro(get_all_compile_flags target compileFlags visited)
+macro(get_dependencies_compile_options target compileOptions compileDefinitions includeDirectories systemIncludeDirectories visited)
     get_target_property(dependencies ${target} INTERFACE_LINK_LIBRARIES)
     foreach(dep ${dependencies})
         if(TARGET ${dep} )
@@ -54,45 +54,61 @@
             if(${pos} EQUAL -1)
                 get_target_property(flags ${dep} INTERFACE_COMPILE_OPTIONS)
                 if(flags)
-                    list(APPEND ${compileFlags} ${flags})
+                    list(APPEND ${compileOptions} ${flags})
                 endif()

                 get_target_property(def ${dep} INTERFACE_COMPILE_DEFINITIONS)
                 if(def)
-                    foreach(d ${def})
-                        string(FIND ${d} "\$<" POS)
-                        if(POS EQUAL -1)
-                            list(APPEND ${compileFlags} "-D${d}")
-                        endif()
-                    endforeach()
+                    list( APPEND ${compileDefinitions} ${def} )
                 endif()

                 get_target_property(inc ${dep} INTERFACE_INCLUDE_DIRECTORIES)
                 if(inc)
-                    foreach(i ${inc})
-                        string(FIND ${i} "\$<" POS)
-                        if(POS EQUAL -1)
-                            list(APPEND ${compileFlags} "-I${i}")
-                        endif()
-                    endforeach()
+                    list( APPEND ${includeDirectories} ${inc} )
                 endif()

                 get_target_property(incSys ${dep} INTERFACE_SYSTEM_INCLUDE_DIRECTORIES)
                 if(incSys)
-                    foreach(i ${incSys})
-                        list(APPEND ${compileFlags} "-isystem ${i}")
-                    endforeach()
+                    list( APPEND ${systemIncludeDirectories} )
                 endif()

                 list(APPEND ${visited} ${dep})

-                get_all_compile_flags(${dep} ${compileFlags} ${visited})
-            endif()
-
+                get_dependencies_compile_options(${dep} ${compileOptions} ${compileDefinitions} ${includeDirectories} ${systemIncludeDirectories} ${visited})
+            endif()
         endif()
     endforeach()
-
 endmacro()
+
+function( filter_item filtered_item item )
+    set(append_item true)
+    if( ${item} MATCHES ".*COMPILE_LANGUAGE.*" )
+        if( ${item} MATCHES ".*\\\$<\\\$<COMPILE_LANGUAGE:CXX>.*")
+            string( REPLACE ":" ";" item ${item} )
+            list( GET item 2 item ) # 0 is COMPILE_LANGUAGE, 1 is CXX, 2 is value
+            string( REPLACE ">" "" item ${item} )
+        else()
+            set(append_item false)
+        endif()
+    endif()
+    if( ${item} MATCHES ".*(INSTALL_INTERFACE|BUILD_INTERFACE).*" )
+        set(append_item false)
+    endif()
+    # Adding CONFIG:DEBUG flags in Release and vice versa produces empty quotes to compiler command line
+    # which confuses GCC.
+    string( TOUPPER ${item} upper_item )
+    if(
+        ( ${upper_item} MATCHES ".*CONFIG:RELEASE.*" AND ${CMAKE_BUILD_TYPE} STREQUAL "Debug" ) OR
+        ( ${upper_item} MATCHES ".*CONFIG:DEBUG.*" AND ${CMAKE_BUILD_TYPE} STREQUAL "Release" )
+    )
+        set(append_item false)
+    endif()
+    if( ${append_item} )
+        set( ${filtered_item} ${item} PARENT_SCOPE )
+    else()
+        unset( ${filtered_item} PARENT_SCOPE )
+    endif()
+endfunction()

 MACRO(ADD_PRECOMPILED_HEADER _targetName _input)
   GET_FILENAME_COMPONENT(_inputWe ${_input} NAME_WE)
@@ -151,52 +167,48 @@
             SET(_compiler_FLAGS ${${_flags_var_name}})
             # obtain all other flags
             list(APPEND _compiler_FLAGS ${CMAKE_CXX_FLAGS})
-            # Obtain target specific flags (recursively)
-            set(visited "")
-            set(targetCompileFlags "")
-            get_all_compile_flags(${_targetName} targetCompileFlags visited)
+
+            # Obtain target dependencies flags (recursively)
+            set( visited "" )
+            set( depsCompileOptions "" )
+            set( depsCompileDefinitions "" )
+            set( depsIncludeDirectories "" )
+            set( depsSystemIncludeDirectories "" )
+            get_dependencies_compile_options( ${_targetName} depsCompileOptions depsCompileDefinitions depsIncludeDirectories depsSystemIncludeDirectories visited )
     #        message("Additional compile flags for ${_targetName}: ${targetCompileFlags}")
-            list(APPEND _compiler_FLAGS ${targetCompileFlags})

             get_directory_property( _directory_flags INCLUDE_DIRECTORIES )
             get_target_property( _target_include_dirs ${_targetName} INCLUDE_DIRECTORIES )
-            foreach( item ${_directory_flags} ${_target_include_dirs} )
-              list( APPEND _compiler_FLAGS "-I${item}" )
+            foreach( item ${_directory_flags} ${_target_include_dirs} ${depsIncludeDirectories} )
+                filter_item( filtered_item ${item} )
+                if( filtered_item )
+                    list( APPEND _compiler_FLAGS "-I${filtered_item}" )
+                endif()
+            endforeach()
+
+            get_target_property( _target_system_include_dirs ${_targetName} INTERFACE_SYSTEM_INCLUDE_DIRECTORIES )
+            foreach( item ${_target_system_include_dirs} ${depsSystemIncludeDirectories} )
+                filter_item( filtered_item ${item} )
+                if( filtered_item )
+                    list( APPEND _compiler_FLAGS "-isystem ${filtered_item}" )
+                endif()
             endforeach()

             get_directory_property( _directory_flags COMPILE_DEFINITIONS )
             get_target_property( _target_compile_definitions ${_targetName} COMPILE_DEFINITIONS )
-            foreach( def ${_directory_flags} ${_target_compile_definitions} )
-                list( APPEND _compiler_FLAGS "-D${def}" )
+            foreach( def ${_directory_flags} ${_target_compile_definitions} ${depsCompileDefinitions} )
+                filter_item( filtered_item ${def} )
+                if( filtered_item )
+                    list( APPEND _compiler_FLAGS "-D${filtered_item}" )
+                endif()
             endforeach()

             get_directory_property( _compile_options COMPILE_OPTIONS )
             get_target_property( _target_compile_options ${_targetName} COMPILE_OPTIONS )
-            foreach( option ${_compile_options} ${_target_compile_options} )
-                # message( "Target: ${_targetName} Option: ${option}" )
-                # COMPILE_LANGUAGE generator expression cannot be evaluated in this context
-                set(append_option true)
-                if(${option} MATCHES ".*COMPILE_LANGUAGE.*")
-                    if( ${option} MATCHES ".*\\\$<\\\$<COMPILE_LANGUAGE:CXX>.*")
-                        string( REPLACE ":" ";" option ${option} )
-                        list( GET option 2 option ) # 0 is COMPILE_LANGUAGE, 1 is CXX, 2 is value
-                        string( REPLACE ">" "" option ${option} )
-                    else()
-                        set(append_option false)
-                    endif()
-                endif()
-                # Adding CONFIG:DEBUG flags in Release and vice versa produces empty quotes to compiler command line
-                # which confuses GCC.
-                string( TOUPPER ${option} upper_option )
-                if(
-                    ( ${upper_option} MATCHES ".*CONFIG:RELEASE.*" AND ${CMAKE_BUILD_TYPE} STREQUAL "Debug" ) OR
-                    ( ${upper_option} MATCHES ".*CONFIG:DEBUG.*" AND ${CMAKE_BUILD_TYPE} STREQUAL "Release" )
-                )
-                    set(append_option false)
-                endif()
-
-                if( ${append_option} )
-                    list(APPEND _compiler_FLAGS ${option})
+            foreach( option ${_compile_options} ${_target_compile_options} ${depsCompileOptions} )
+                filter_item( filtered_item ${option} )
+                if( filtered_item )
+                    list(APPEND _compiler_FLAGS ${filtered_item})
                 endif()
             endforeach()


Properly handle generated files

Properly handle generated files

git-svn-id: 83559b207731e135ec6ad229651e5404538d7ebe@378 041b043f-8d7c-46b2-b46e-ef0dd855326e

--- share/FindLustre.cmake
+++ share/FindLustre.cmake
@@ -82,25 +82,34 @@
   endif()

   file(MAKE_DIRECTORY ${LUSTRE_OUTPUT_DIR})
-  set(GLOBAL_LUSTRE_GENERATED_FILES)
+  set(GLOBAL_LUSTRE_GENERATED_C_FILES "")
+  # create list of generated C files in parent scope
+  set(LUSTRE_GENERATED_C_FILES_${LUS_LIBNAME} "" PARENT_SCOPE)
   foreach(LFILE IN LISTS LUS_LUS_FILES)
     get_filename_component(L ${LFILE} NAME_WE)
-    set(LUSTRE_GENERATED_FILES ${LUSTRE_OUTPUT_DIR}/${L}.h ${LUSTRE_OUTPUT_DIR}/${L}.c)
-    list(APPEND GLOBAL_LUSTRE_GENERATED_FILES ${LUSTRE_GENERATED_FILES})
+    get_filename_component(E ${LFILE} EXT)
+    if ("${E}" STREQUAL ".lus")
+      set(LUSTRE_GENERATED_FILES ${LUSTRE_OUTPUT_DIR}/${L}.h ${LUSTRE_OUTPUT_DIR}/${L}.c ${LUSTRE_OUTPUT_DIR}/${L}_alloc.h)
+    elseif("${E}" STREQUAL ".lusi")
+      set(LUSTRE_GENERATED_FILES ${LUSTRE_OUTPUT_DIR}/${L}.h)
+    endif()
+    list(APPEND GLOBAL_LUSTRE_GENERATED_C_FILES ${LUSTRE_GENERATED_FILES})
+    set(LUSTRE_GENERATED_FILES ${LUSTRE_GENERATED_FILES} ${LUSTRE_OUTPUT_DIR}/${L}.lusic)
     add_custom_command(
       OUTPUT ${LUSTRE_GENERATED_FILES}
       COMMAND ${LUSTRE_COMPILER} ${LUSTRE_NODE_OPT} -d ${LUSTRE_OUTPUT_DIR} ${LFILE}
       DEPENDS ${LFILE}
       WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
-      COMMENT "Compile Lustre source(s): ${LFILE}."
+      COMMENT "Compile Lustre source(s): ${LFILE} (generates: ${LUSTRE_GENERATED_FILES})."
       )
     set_source_files_properties(${LUSTRE_GENERATED_FILES} PROPERTIES GENERATED TRUE)
   endforeach()

   include_directories(${LUSTRE_INCLUDE_DIR} ${CMAKE_CURRENT_SOURCE_DIR} ${LUSTRE_OUTPUT_DIR})
   add_library(${LUS_LIBNAME} SHARED
-              ${GLOBAL_LUSTRE_GENERATED_FILES} ${LUS_USER_C_FILES}
-             )
+              ${GLOBAL_LUSTRE_GENERATED_C_FILES} ${LUS_USER_C_FILES}
+              )
+  set(LUSTRE_GENERATED_C_FILES_${LUS_LIBNAME} "${GLOBAL_LUSTRE_GENERATED_C_FILES}" PARENT_SCOPE)
   message(STATUS "Lustre: Added rule for building lustre library: ${LUS_LIBNAME}")
 endfunction(Lustre_Compile)


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

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

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

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


BUG: COMP: added OpenMP flags for ElastixComponent

--- Modules/Components/ElastixComponent/ModuleElastixComponent.cmake
+++ Modules/Components/ElastixComponent/ModuleElastixComponent.cmake
@@ -18,6 +18,14 @@
 #=========================================================================

 set( MODULE ModuleElastixComponent )
+
++# If OpenMP is supported by this machine, elastix will be compiled with
++# OpenMP flags, and we need to add them here as well
++find_package( OpenMP )
++if (OPENMP_FOUND)
++  set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}" )
++  set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}" )
++endif()

 # Find UseElastix.cmake
 if( NOT EXISTS ${ELASTIX_USE_FILE} )


Address minor feedback on PR #4312

Address minor feedback on PR #4312

--- src/Native/configure.cmake
+++ src/Native/configure.cmake
@@ -270,13 +270,6 @@
     inotify_rm_watch
     HAVE_INOTIFY_RM_WATCH)

-check_cxx_source_compiles(
-    "
-    #include <curl/multi.h>
-    int main() { int i = CURLM_ADDED_ALREADY; }
-    "
-    HAVE_CURLM_ADDED_ALREADY)
-
 set (HAVE_INOTIFY 0)
 if (HAVE_INOTIFY_INIT AND HAVE_INOTIFY_ADD_WATCH AND HAVE_INOTIFY_RM_WATCH)
 	set (HAVE_INOTIFY 1)
@@ -284,6 +277,13 @@
 	message(FATAL_ERROR "Cannot find inotify functions on a Linux platform.")
 endif()

+check_cxx_source_compiles(
+    "
+    #include <curl/multi.h>
+    int main() { int i = CURLM_ADDED_ALREADY; }
+    "
+    HAVE_CURLM_ADDED_ALREADY)
+
 set (CMAKE_REQUIRED_LIBRARIES)

 configure_file(


Prevents CMake warning about finding GLUT from an OSG install.

CMake Warning (dev) at C:/Program Files/CMake/share/cmake-3.19/Modules/FindPackageHandleStandardArgs.cmake:424 (message):
The package name passed to `find_package_handle_standard_args` (GLUT) does
not match the name of the calling package (GlutFromOsg).  This can lead to
problems in calling code that expects `find_package` result variables
(e.g., `_FOUND`) to follow a certain pattern.

--- CMake/FindGlutFromOsg.cmake
+++ CMake/FindGlutFromOsg.cmake
@@ -38,7 +38,8 @@
 # NB: use the same names here as FindGLUT.cmake, so you cam use both
 # interchangeably as described in the comments above.  --advornik
 find_package_handle_standard_args(GLUT
-	DEFAULT_MSG GLUT_glut_LIBRARY GLUT_INCLUDE_DIR)
+	REQUIRED_VARS GLUT_glut_LIBRARY GLUT_INCLUDE_DIR
+	NAME_MISMATCHED)

 if(GLUT_FOUND)
 	# What if GLUT needs additional libraries to work on this system?


BUG: ExternalData downloads from midas3.kitware.com only supports https.

Recently, http protocol download support was removed from midas3.kitware.com.
Make this explicit in the ExternalData URL to inform expectations and provide
better error messages.

Change-Id: Ie8c177a42fb96824831294fe647c36d332a5f95b

--- CMake/ITKExternalData.cmake
+++ CMake/ITKExternalData.cmake
@@ -32,7 +32,7 @@
 if(NOT ITK_FORBID_DOWNLOADS)
   list(APPEND ExternalData_URL_TEMPLATES
     # Data published on MIDAS
-    "http://midas3.kitware.com/midas/api/rest?method=midas.bitstream.download&checksum=%(hash)&algorithm=%(algo)"
+    "https://midas3.kitware.com/midas/api/rest?method=midas.bitstream.download&checksum=%(hash)&algorithm=%(algo)"

     # Data published by developers using git-gerrit-push.
     "http://www.itk.org/files/ExternalData/%(algo)/%(hash)"


ENH: Remove unused warning file.

ENH: Remove unused warning file.

--- CMake/InstallDisabled.cmake
+++ CMake/InstallDisabled.cmake
@@ -1,3 +0,0 @@
-MESSAGE(FATAL_ERROR
-  "ERROR: VTK installation is disabled because VTK_USE_RPATH is ON and you are using a CMake version earlier than 2.4.  It is not safe to install binaries that have a runtime path pointing to the build tree.  In order to install safely you need to delete the libraries from your build tree, set VTK_USE_RPATH to OFF, and rebuild.  See comments in VTK/CMake/vtkSelectSharedLibraries.cmake for more information."
-)


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

--- Modules/ThirdParty/KWSys/src/KWSys/kwsysDateStamp.cmake
+++ Modules/ThirdParty/KWSys/src/KWSys/kwsysDateStamp.cmake
@@ -15,7 +15,7 @@
 SET(KWSYS_DATE_STAMP_YEAR  2011)

 # KWSys version date month component.  Format is MM.
-SET(KWSYS_DATE_STAMP_MONTH 04)
+SET(KWSYS_DATE_STAMP_MONTH 05)

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


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   03)
+SET(KWSYS_DATE_STAMP_DAY   04)


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

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


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

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


ENH: switching (testing) to ITK 4.0.0

ENH: switching (testing) to ITK 4.0.0

--- Testing/Dashboard/pxDashboard_LKEB_win7-64_VS2008.cmake
+++ Testing/Dashboard/pxDashboard_LKEB_win7-64_VS2008.cmake
@@ -11,7 +11,7 @@
 # and defaults to Nightly.
 # NOTE that Model should directly follow the comma: no space allowed!
 #
-# Setup: Windows 7, Visual Studio 9 2008 Win64, Release mode, ITK git
+# Setup: Windows 7, Visual Studio 9 2008 Win64, Release mode, ITK 4.0.0
 # PC: LKEB, MS personal computer

 # Client maintainer: m.staring@lumc.nl
@@ -36,7 +36,7 @@

 SET( dashboard_cache "
 // Which ITK to use
-ITK_DIR:PATH=D:/toolkits/ITK/git/bin
+ITK_DIR:PATH=D:/toolkits/ITK/4.0.0/binVS2008

 // Some ITKTools settings, defining the configuration
 ITKTOOLS_BUILD_TESTING:BOOL=ON


BUG: Restore list of headers generation for swig.

--- Code/BasicFilters/SourceCodeGenerator.cmake
+++ Code/BasicFilters/SourceCodeGenerator.cmake
@@ -28,9 +28,9 @@
 endforeach()

 # clear the include files
-# file ( WRITE ${CMAKE_CURRENT_BINARY_DIR}/SimpleITKBasicFiltersGeneratedHeaders.h "" )
-# file ( WRITE ${CMAKE_CURRENT_BINARY_DIR}/SimpleITKBasicFiltersGeneratedHeaders.i "" )
-# foreach ( filter ${GENERATED_FILTER_LIST} )
-#   file ( APPEND ${CMAKE_CURRENT_BINARY_DIR}/SimpleITKBasicFiltersGeneratedHeaders.h "#include \"sitk${filter}ImageFilter.h\"\n" )
-#   file ( APPEND ${CMAKE_CURRENT_BINARY_DIR}/SimpleITKBasicFiltersGeneratedHeaders.i "%include \"sitk${filter}ImageFilter.h\"\n" )
-# endforeach()
+file ( WRITE ${CMAKE_CURRENT_BINARY_DIR}/SimpleITKBasicFiltersGeneratedHeaders.h "" )
+file ( WRITE ${CMAKE_CURRENT_BINARY_DIR}/SimpleITKBasicFiltersGeneratedHeaders.i "" )
+foreach ( filter ${GENERATED_FILTER_LIST} )
+  file ( APPEND ${CMAKE_CURRENT_BINARY_DIR}/SimpleITKBasicFiltersGeneratedHeaders.h "#include \"sitk${filter}ImageFilter.h\"\n" )
+  file ( APPEND ${CMAKE_CURRENT_BINARY_DIR}/SimpleITKBasicFiltersGeneratedHeaders.i "%include \"sitk${filter}ImageFilter.h\"\n" )
+endforeach()


SVN_SILENT made messages (.desktop file)

--- plasma-runner-ktp-contact.desktop.cmake
+++ plasma-runner-ktp-contact.desktop.cmake
@@ -1,6 +1,26 @@
 [Desktop Entry]
 Name=Instant Messaging
+Name[bs]=Brze poruke
+Name[ca]=Missatgeria instantània
+Name[de]=Instant-Messaging
+Name[fr]=Messagerie instantanée
+Name[it]=Messaggistica istantanea
+Name[kk]=Лезде хабарласу
+Name[nl]=Instant Messaging
+Name[sv]=Direktmeddelanden
+Name[uk]=Миттєвий обмін повідомленнями
+Name[x-test]=xxInstant Messagingxx
 Comment=Start a chat with any of your IM contacts or change your IM status
+Comment[bs]=Počnite ćaskanje s nekim od IM kontakta ili promijenite vaš IM status
+Comment[ca]=Inicia un xat amb qualsevol dels vostres contactes de MI o canvia el vostre estat de MI
+Comment[de]=Chats mit ihren Kontakten starten oder Ihren IM-Status ändern
+Comment[fr]=Démarre une discussion avec n'importe lequel de vos contacts de messagerie instantanée ou change l'état de celle-ci
+Comment[it]=Avvia una chat con un tuo contatto di MI oppure cambia il tuo stato di MI
+Comment[kk]=Кез-келген лезде хабарласу контактыңызбен чат-әңгімені бастау не күй-жайын өзгерту
+Comment[nl]=Begin een chat met een van uw IM-contactpersonen of wijzig uw IM-status
+Comment[sv]=Börja chatta med någon direktmeddelandekontakt eller ändra din direktmeddelandestatus
+Comment[uk]=Почати спілкування з будь-яким з ваших контактів або змінити ваш запис стану у системах обміну повідомленнями
+Comment[x-test]=xxStart a chat with any of your IM contacts or change your IM statusxx
 Icon=user-online

 X-KDE-ServiceTypes=Plasma/Runner


Disable edit-and-continue (makes breakpoints not work on occasion).

--- indra/cmake/00-Common.cmake
+++ indra/cmake/00-Common.cmake
@@ -35,10 +35,10 @@
   # Don't build DLLs.
   set(BUILD_SHARED_LIBS OFF)

-  set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /Od /ZI /MDd /MP"
+  set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /Od /Zi /MDd /MP"
       CACHE STRING "C++ compiler debug options" FORCE)
   set(CMAKE_CXX_FLAGS_RELWITHDEBINFO
-      "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /Od /ZI /MD /MP"
+      "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /Od /Zi /MD /MP"
       CACHE STRING "C++ compiler release-with-debug options" FORCE)
   set(CMAKE_CXX_FLAGS_RELEASE
       "${CMAKE_CXX_FLAGS_RELEASE} ${LL_CXX_FLAGS} /O2 /Zi /MD /MP"


Push base sdk back up to 10.8 for Xcode4.5+

--- indra/cmake/Variables.cmake
+++ indra/cmake/Variables.cmake
@@ -136,7 +136,7 @@
   # To support a different SDK update these Xcode settings:
   if (XCODE_VERSION GREATER 4.5)
     set(CMAKE_OSX_DEPLOYMENT_TARGET 10.7)
-    set(CMAKE_OSX_SYSROOT macosx10.7)
+    set(CMAKE_OSX_SYSROOT macosx10.8)
   else (XCODE_VERSION GREATER 4.5)
   if (XCODE_VERSION GREATER 4.2)
     set(CMAKE_OSX_DEPLOYMENT_TARGET 10.6)


Switching to 10.5 SDK

Switching to 10.5 SDK

--- indra/cmake/Variables.cmake
+++ indra/cmake/Variables.cmake
@@ -79,7 +79,7 @@
   # NOTE: wont have a distributable build unless you add this on the configure line with:
   # -DCMAKE_OSX_ARCHITECTURES:STRING='i386;ppc'
   #set(CMAKE_OSX_ARCHITECTURES i386;ppc)
-  set(CMAKE_OSX_SYSROOT /Developer/SDKs/MacOSX10.4u.sdk)
+  set(CMAKE_OSX_SYSROOT /Developer/SDKs/MacOSX10.5.sdk)
   if (CMAKE_OSX_ARCHITECTURES MATCHES "i386" AND CMAKE_OSX_ARCHITECTURES MATCHES "ppc")
     set(ARCH universal)
   else (CMAKE_OSX_ARCHITECTURES MATCHES "i386" AND CMAKE_OSX_ARCHITECTURES MATCHES "ppc")


We're no longer using the GSL.

We're no longer using the GSL.

--- src/cmake/FindGSL.cmake
+++ src/cmake/FindGSL.cmake
@@ -1,17 +0,0 @@
-#
-# locate the GSL
-#
-
-if(NOT GSL_LIBRARIES OR NOT GSL_INCLUDE_DIRS)
-    find_path(GSL_INCLUDE_DIR gsl/gsl_math.h)
-    find_library(GSL_CORE_LIBRARY gsl)
-    find_library(GSL_CBLAS_LIBRARY gslcblas)
-
-    set(GSL_INCLUDE_DIRS ${GSL_INCLUDE_DIR})
-    set(GSL_LIBRARIES ${GSL_CORE_LIBRARY} ${GSL_CBLAS_LIBRARY})
-endif(NOT GSL_LIBRARIES OR NOT GSL_INCLUDE_DIRS)
-
-include(FindPackageHandleStandardArgs)
-
-find_package_handle_standard_args(GSL DEFAULT_MSG GSL_LIBRARIES GSL_INCLUDE_DIRS)
-


Fix DevIL find package call

Fix DevIL find package call

Add the headers path so it matches the expected called macros.
This is also in line with how every such call is done.

--- cmake/FindDevIL.cmake
+++ cmake/FindDevIL.cmake
@@ -24,7 +24,7 @@
 endif()

 cegui_find_package_handle_standard_args(IL IL_LIB IL_H_PATH)
-cegui_find_package_handle_standard_args(ILU ILU_LIB)
+cegui_find_package_handle_standard_args(ILU ILU_LIB IL_H_PATH)

 # set up output vars
 if (IL_FOUND AND ILU_FOUND)


Link to blosc library

Link to blosc library

--- cmake/FindMGARD.cmake
+++ cmake/FindMGARD.cmake
@@ -49,7 +49,7 @@
   )
   if(MGARD_FOUND)
     set(MGARD_INCLUDE_DIRS ${MGARD_INCLUDE_DIR})
-    set(MGARD_LIBRARIES ${MGARD_LIBRARY} ${ZLIB_LIBRARY} ${BLOSC_LIBRARY_OPTS})
+    set(MGARD_LIBRARIES ${MGARD_LIBRARY} ${ZLIB_LIBRARY} ${BLOSC_LIBRARY})
     if(MGARD_FOUND AND NOT TARGET MGARD::MGARD)
       add_library(MGARD::MGARD UNKNOWN IMPORTED)
       set_target_properties(MGARD::MGARD PROPERTIES


Allow building the gold plugin even if the gold binary is not found.

The gold binary is not required to build the plugin. All that is
needed is for LLVM_BINUTILS_INCDIR to point to the directory
containing plugin-api.h.

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

--- cmake/config-ix.cmake
+++ cmake/config-ix.cmake
@@ -527,10 +527,8 @@
 endif()

 find_program(GOLD_EXECUTABLE NAMES ld.gold ld DOC "The gold linker")
-if(GOLD_EXECUTABLE)
-	set(LLVM_BINUTILS_INCDIR "" CACHE PATH
-		"PATH to binutils/include containing plugin-api.h for gold plugin.")
-endif()
+set(LLVM_BINUTILS_INCDIR "" CACHE PATH
+	"PATH to binutils/include containing plugin-api.h for gold plugin.")

 if(APPLE)
   find_program(LD64_EXECUTABLE NAMES ld DOC "The ld64 linker")


[CMake][libunwind] Use -nodefaultlibs for CMake checks

Since libunwind is built with -nodefaultlibs, we should be using this
option even for CMake checks to avoid any inconsistency and also to
avoid dependency on a working C++ standard library just for the setting
up the build itself. The implementation is largely similar to the one
used by libc++.

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

git-svn-id: 62ef012455b6b8fcec9c41ca270ebf409aae1006@299796 91177308-0d34-0410-b5e6-96231b3b80d8

--- cmake/config-ix.cmake
+++ cmake/config-ix.cmake
@@ -2,6 +2,29 @@
 include(CheckCCompilerFlag)
 include(CheckCXXCompilerFlag)
 include(CheckLibraryExists)
+
+check_library_exists(c fopen "" LIBUNWIND_HAS_C_LIB)
+
+# libunwind is built with -nodefaultlibs, so we want all our checks to also
+# use this option, otherwise we may end up with an inconsistency between
+# the flags we think we require during configuration (if the checks are
+# performed without -nodefaultlibs) and the flags that are actually
+# required during compilation (which has the -nodefaultlibs). libc is
+# required for the link to go through. We remove sanitizers from the
+# configuration checks to avoid spurious link errors.
+check_c_compiler_flag(-nodefaultlibs LIBUNWIND_HAS_NODEFAULTLIBS_FLAG)
+if (LIBUNWIND_HAS_NODEFAULTLIBS_FLAG)
+  set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -nodefaultlibs")
+  if (LIBUNWIND_HAS_C_LIB)
+    list(APPEND CMAKE_REQUIRED_LIBRARIES c)
+  endif ()
+  if (CMAKE_C_FLAGS MATCHES -fsanitize OR CMAKE_CXX_FLAGS MATCHES -fsanitize)
+    set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -fno-sanitize=all")
+  endif ()
+  if (CMAKE_C_FLAGS MATCHES -fsanitize-coverage OR CMAKE_CXX_FLAGS MATCHES -fsanitize-coverage)
+    set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -fno-sanitize-coverage=edge,trace-cmp,indirect-calls,8bit-counters")
+  endif ()
+endif ()

 # Check compiler flags
 check_c_compiler_flag(-funwind-tables         LIBUNWIND_HAS_FUNWIND_TABLES)
@@ -9,7 +32,6 @@
 check_cxx_compiler_flag(-fno-exceptions       LIBUNWIND_HAS_NO_EXCEPTIONS_FLAG)
 check_cxx_compiler_flag(-fno-rtti             LIBUNWIND_HAS_NO_RTTI_FLAG)
 check_cxx_compiler_flag(-fstrict-aliasing     LIBUNWIND_HAS_FSTRICT_ALIASING_FLAG)
-check_cxx_compiler_flag(-nodefaultlibs        LIBUNWIND_HAS_NODEFAULTLIBS_FLAG)
 check_cxx_compiler_flag(-nostdinc++           LIBUNWIND_HAS_NOSTDINCXX_FLAG)
 check_cxx_compiler_flag(-Wall                 LIBUNWIND_HAS_WALL_FLAG)
 check_cxx_compiler_flag(-W                    LIBUNWIND_HAS_W_FLAG)
@@ -44,7 +66,6 @@
   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
 endif()

-check_library_exists(c fopen "" LIBUNWIND_HAS_C_LIB)
 check_library_exists(dl dladdr "" LIBUNWIND_HAS_DL_LIB)
 check_library_exists(pthread pthread_once "" LIBUNWIND_HAS_PTHREAD_LIB)


Fix bug #5

Fix bug #5

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

--- cmake/pcl_utils.cmake
+++ cmake/pcl_utils.cmake
@@ -123,13 +123,13 @@
 macro(DISSECT_VERSION)
     # Find version components
     string(REGEX REPLACE "^([0-9]+).*" "\\1"
-        PROJECT_MAJOR_VERSION "${PROJECT_VERSION}")
+        PCL_MAJOR_VERSION "${PCL_VERSION}")
     string(REGEX REPLACE "^[0-9]+\\.([0-9]+).*" "\\1"
-        PROJECT_MINOR_VERSION "${PROJECT_VERSION}")
+        PCL_MINOR_VERSION "${PCL_VERSION}")
     string(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]+)" "\\1"
-        PROJECT_REVISION_VERSION "${PROJECT_VERSION}")
+        PCL_REVISION_VERSION "${PCL_VERSION}")
     string(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.[0-9]+(.*)" "\\1"
-        PROJECT_CANDIDATE_VERSION "${PROJECT_VERSION}")
+        PCL_CANDIDATE_VERSION "${PCL_VERSION}")
 endmacro(DISSECT_VERSION)

 ###############################################################################


New 64-bit check from #86

New 64-bit check from #86

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

--- cmake/pcl_utils.cmake
+++ cmake/pcl_utils.cmake
@@ -141,11 +141,11 @@
 # Sets LINUX if the operating system is Linux.
 macro(GET_OS_INFO)
     string(REGEX MATCH "Linux" OS_IS_LINUX ${CMAKE_SYSTEM_NAME})
-    if(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86_64")
+    if(CMAKE_SIZEOF_VOID_P EQUAL 8)
         set(OS_IS_64BIT TRUE)
-    else(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86_64")
+    else(CMAKE_SIZEOF_VOID_P EQUAL 8)
         set(OS_IS_64BIT FALSE)
-    endif(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86_64")
+    endif(CMAKE_SIZEOF_VOID_P EQUAL 8)
 endmacro(GET_OS_INFO)


Make sure to include a C99 wrapper for MSVC compiler

--- itkIncludeDirectories.cmake
+++ itkIncludeDirectories.cmake
@@ -80,6 +80,11 @@
     ${ITK_SOURCE_DIR}/Utilities/gdcm/Source/DataDictionary
     ${ITK_BINARY_DIR}/Utilities/gdcm/Source/Common # generated gdcmConfigure.h
     )
+  IF(MSVC)
+    SET(ITK_INCLUDE_DIRS_BUILD_TREE ${ITK_INCLUDE_DIRS_BUILD_TREE}
+      ${ITK_SOURCE_DIR}/Utilities/gdcm/Utilities/C99
+    )
+  ENDIF(MSVC)
 ENDIF(NOT ITK_USE_SYSTEM_GDCM)

 # LIBXML2 include directories.


store the lib location directly instead of storing the property

--- gtest.cmake
+++ gtest.cmake
@@ -17,9 +17,9 @@

   set(byproducts)
   foreach(lib ${GTEST_LIBRARIES})
-    set(file ${binary_dir}/${CMAKE_CFG_INTDIR}/${CMAKE_STATIC_LIBRARY_PREFIX}${lib}${CMAKE_STATIC_LIBRARY_SUFFIX})
-    set(${lib}_properties IMPORTED_LOCATION ${file})
-    list(APPEND byproducts ${file})
+    set(${lib}_location
+      ${binary_dir}/${CMAKE_CFG_INTDIR}/${CMAKE_STATIC_LIBRARY_PREFIX}${lib}${CMAKE_STATIC_LIBRARY_SUFFIX})
+    list(APPEND byproducts ${${lib}_location})
   endforeach()

   ExternalProject_Add(
@@ -49,7 +49,7 @@
   foreach(lib ${GTEST_LIBRARIES})
     add_library(${lib} IMPORTED STATIC)
     add_dependencies(${lib} gtest-external)
-    set_target_properties(${lib} PROPERTIES ${${lib}_properties})
+    set_target_properties(${lib} PROPERTIES IMPORTED_LOCATION ${${lib}_location})
   endforeach()

   ExternalProject_Get_Property(gtest-external source_dir)


copying pyne's findhdf5

copying pyne's findhdf5

--- cmake/FindHDF5.cmake
+++ cmake/FindHDF5.cmake
@@ -26,7 +26,7 @@
 # In addition to finding the includes and libraries required to compile an HDF5
 # client application, this module also makes an effort to find tools that come
 # with the HDF5 distribution that may be useful for regression testing.
-#
+#
 # This module will define the following variables:
 #  HDF5_INCLUDE_DIRS - Location of the hdf5 includes
 #  HDF5_INCLUDE_DIR - Location of the hdf5 includes (deprecated)
@@ -60,268 +60,270 @@
 include(FindPackageHandleStandardArgs)

 # List of the valid HDF5 components
-set(HDF5_VALID_COMPONENTS
+set( HDF5_VALID_COMPONENTS
     C
     CXX
-    )
+)

 # try to find the HDF5 wrapper compilers
-find_program(HDF5_C_COMPILER_EXECUTABLE
+find_program( HDF5_C_COMPILER_EXECUTABLE
     NAMES h5cc h5pcc
     HINTS ENV HDF5_ROOT
     PATH_SUFFIXES bin Bin
-    DOC "HDF5 Wrapper compiler.  Used only to detect HDF5 compile flags.")
-mark_as_advanced(HDF5_C_COMPILER_EXECUTABLE)
-
-find_program(HDF5_CXX_COMPILER_EXECUTABLE
+    DOC "HDF5 Wrapper compiler.  Used only to detect HDF5 compile flags." )
+mark_as_advanced( HDF5_C_COMPILER_EXECUTABLE )
+
+find_program( HDF5_CXX_COMPILER_EXECUTABLE
     NAMES h5c++ h5pc++
     HINTS ENV HDF5_ROOT
     PATH_SUFFIXES bin Bin
-    DOC "HDF5 C++ Wrapper compiler.  Used only to detect HDF5 compile flags.")
-mark_as_advanced(HDF5_CXX_COMPILER_EXECUTABLE)
-
-find_program(HDF5_DIFF_EXECUTABLE
+    DOC "HDF5 C++ Wrapper compiler.  Used only to detect HDF5 compile flags." )
+mark_as_advanced( HDF5_CXX_COMPILER_EXECUTABLE )
+
+find_program( HDF5_DIFF_EXECUTABLE
     NAMES h5diff
     HINTS ENV HDF5_ROOT
-    PATH_SUFFIXES bin Bin
-    DOC "HDF5 file differencing tool.")
-mark_as_advanced(HDF5_DIFF_EXECUTABLE)
+    PATH_SUFFIXES bin Bin
+    DOC "HDF5 file differencing tool." )
+mark_as_advanced( HDF5_DIFF_EXECUTABLE )

 # Invoke the HDF5 wrapper compiler.  The compiler return value is stored to the
 # return_value argument, the text output is stored to the output variable.
-macro(_HDF5_invoke_compiler language output return_value)
-    if(HDF5_${language}_COMPILER_EXECUTABLE)
-        exec_program(${HDF5_${language}_COMPILER_EXECUTABLE}
+macro( _HDF5_invoke_compiler language output return_value )
+    if( HDF5_${language}_COMPILER_EXECUTABLE )
+        exec_program( ${HDF5_${language}_COMPILER_EXECUTABLE}
             ARGS -show
             OUTPUT_VARIABLE ${output}
             RETURN_VALUE ${return_value}
-            )
-        if(${${return_value}} EQUAL 0)
+        )
+        if( ${${return_value}} EQUAL 0 )
             # do nothing
         else()
-            message(STATUS
-                "Unable to determine HDF5 ${language} flags from HDF5 wrapper.")
+            message( STATUS
+              "Unable to determine HDF5 ${language} flags from HDF5 wrapper." )
         endif()
     endif()
 endmacro()

 # Parse a compile line for definitions, includes, library paths, and libraries.
-macro(_HDF5_parse_compile_line
-        compile_line_var
-        include_paths
-        definitions
-        library_paths
-        libraries)
+macro( _HDF5_parse_compile_line
+    compile_line_var
+    include_paths
+    definitions
+    library_paths
+    libraries )

     # Match the include paths
-    string(REGEX MATCHALL "-I([^\" ]+)" include_path_flags
+    string( REGEX MATCHALL "-I([^\" ]+)" include_path_flags
         "${${compile_line_var}}"
-        )
-    foreach(IPATH ${include_path_flags})
-        string(REGEX REPLACE "^-I" "" IPATH ${IPATH})
-        string(REGEX REPLACE "//" "/" IPATH ${IPATH})
-        list(APPEND ${include_paths} ${IPATH})
+    )
+    foreach( IPATH ${include_path_flags} )
+        string( REGEX REPLACE "^-I" "" IPATH ${IPATH} )
+        string( REGEX REPLACE "//" "/" IPATH ${IPATH} )
+        list( APPEND ${include_paths} ${IPATH} )
     endforeach()

     # Match the definitions
-    string(REGEX MATCHALL "-D[^ ]*" definition_flags "${${compile_line_var}}")
-    foreach(DEF ${definition_flags})
-        list(APPEND ${definitions} ${DEF})
+    string( REGEX MATCHALL "-D[^ ]*" definition_flags "${${compile_line_var}}" )
+    foreach( DEF ${definition_flags} )
+        list( APPEND ${definitions} ${DEF} )
     endforeach()

     # Match the library paths
-    string(REGEX MATCHALL "-L([^\" ]+|\"[^\"]+\")" library_path_flags
+    string( REGEX MATCHALL "-L([^\" ]+|\"[^\"]+\")" library_path_flags
         "${${compile_line_var}}"
-        )
-
-    foreach(LPATH ${library_path_flags})
-        string(REGEX REPLACE "^-L" "" LPATH ${LPATH})
-        string(REGEX REPLACE "//" "/" LPATH ${LPATH})
-        list(APPEND ${library_paths} ${LPATH})
+    )
+
+    foreach( LPATH ${library_path_flags} )
+        string( REGEX REPLACE "^-L" "" LPATH ${LPATH} )
+        string( REGEX REPLACE "//" "/" LPATH ${LPATH} )
+        list( APPEND ${library_paths} ${LPATH} )
     endforeach()

     # now search for the library names specified in the compile line (match -l...)
     # match only -l's preceded by a space or comma
     # this is to exclude directory names like xxx-linux/
-    string(REGEX MATCHALL "[, ]-l([^\", ]+)" library_name_flags
-        "${${compile_line_var}}")
+    string( REGEX MATCHALL "[, ]-l([^\", ]+)" library_name_flags
+        "${${compile_line_var}}" )
     # strip the -l from all of the library flags and add to the search list
-    foreach(LIB ${library_name_flags})
-        string(REGEX REPLACE "^[, ]-l" "" LIB ${LIB})
-        list(APPEND ${libraries} ${LIB})
+    foreach( LIB ${library_name_flags} )
+        string( REGEX REPLACE "^[, ]-l" "" LIB ${LIB} )
+        list( APPEND ${libraries} ${LIB} )
     endforeach()
 endmacro()

-if(HDF5_INCLUDE_DIRS AND HDF5_LIBRARIES)
+if( HDF5_INCLUDE_DIRS AND HDF5_LIBRARIES )
     # Do nothing: we already have HDF5_INCLUDE_PATH and HDF5_LIBRARIES in the
     # cache, it would be a shame to override them
 else()
-    _HDF5_invoke_compiler(C HDF5_C_COMPILE_LINE HDF5_C_RETURN_VALUE)
-    _HDF5_invoke_compiler(CXX HDF5_CXX_COMPILE_LINE HDF5_CXX_RETURN_VALUE)
-
-    if(NOT HDF5_FIND_COMPONENTS)
-        set(HDF5_LANGUAGE_BINDINGS "C")
+    _HDF5_invoke_compiler( C HDF5_C_COMPILE_LINE HDF5_C_RETURN_VALUE )
+    _HDF5_invoke_compiler( CXX HDF5_CXX_COMPILE_LINE HDF5_CXX_RETURN_VALUE )
+
+    if( NOT HDF5_FIND_COMPONENTS )
+        set( HDF5_LANGUAGE_BINDINGS "C" )
     else()
         # add the extra specified components, ensuring that they are valid.
-        foreach(component ${HDF5_FIND_COMPONENTS})
-            list(FIND HDF5_VALID_COMPONENTS ${component} component_location)
-            if(${component_location} EQUAL -1)
-                message(FATAL_ERROR
-                    "\"${component}\" is not a valid HDF5 component.")
+        foreach( component ${HDF5_FIND_COMPONENTS} )
+            list( FIND HDF5_VALID_COMPONENTS ${component} component_location )
+            if( ${component_location} EQUAL -1 )
+                message( FATAL_ERROR
+                    "\"${component}\" is not a valid HDF5 component." )
             else()
-                list(APPEND HDF5_LANGUAGE_BINDINGS ${component})
+                list( APPEND HDF5_LANGUAGE_BINDINGS ${component} )
             endif()
         endforeach()
     endif()
-
+
     # seed the initial lists of libraries to find with items we know we need
-    set(HDF5_C_LIBRARY_NAMES_INIT hdf5_hl hdf5)
-    set(HDF5_CXX_LIBRARY_NAMES_INIT hdf5_cpp ${HDF5_C_LIBRARY_NAMES_INIT})
-
-    foreach(LANGUAGE ${HDF5_LANGUAGE_BINDINGS})
-        if(HDF5_${LANGUAGE}_COMPILE_LINE)
-            _HDF5_parse_compile_line(HDF5_${LANGUAGE}_COMPILE_LINE
-            HDF5_${LANGUAGE}_INCLUDE_FLAGS
-            HDF5_${LANGUAGE}_DEFINITIONS
-            HDF5_${LANGUAGE}_LIBRARY_DIRS
-            HDF5_${LANGUAGE}_LIBRARY_NAMES
+    set( HDF5_C_LIBRARY_NAMES_INIT hdf5_hl hdf5 )
+    set( HDF5_CXX_LIBRARY_NAMES_INIT hdf5_cpp ${HDF5_C_LIBRARY_NAMES_INIT} )
+
+    foreach( LANGUAGE ${HDF5_LANGUAGE_BINDINGS} )
+        if( HDF5_${LANGUAGE}_COMPILE_LINE )
+            _HDF5_parse_compile_line( HDF5_${LANGUAGE}_COMPILE_LINE
+                HDF5_${LANGUAGE}_INCLUDE_FLAGS
+                HDF5_${LANGUAGE}_DEFINITIONS
+                HDF5_${LANGUAGE}_LIBRARY_DIRS
+                HDF5_${LANGUAGE}_LIBRARY_NAMES
             )
-
-        # take a guess that the includes may be in the 'include' sibling directory
-        # of a library directory.
-        foreach(dir ${HDF5_${LANGUAGE}_LIBRARY_DIRS})
-            list(APPEND HDF5_${LANGUAGE}_INCLUDE_FLAGS ${dir}/../include)
+
+            # take a guess that the includes may be in the 'include' sibling directory
+            # of a library directory.
+            foreach( dir ${HDF5_${LANGUAGE}_LIBRARY_DIRS} )
+                list( APPEND HDF5_${LANGUAGE}_INCLUDE_FLAGS ${dir}/../include )
+            endforeach()
+        endif()
+
+        # set the definitions for the language bindings.
+        list( APPEND HDF5_DEFINITIONS ${HDF5_${LANGUAGE}_DEFINITIONS} )
+
+        # find the HDF5 include directories
+        find_path( HDF5_${LANGUAGE}_INCLUDE_DIR hdf5.h
+            HINTS
+                ${HDF5_${LANGUAGE}_INCLUDE_FLAGS}
+                ENV
+                    HDF5_ROOT
+            PATHS
+                $ENV{HOME}/.local/include
+            PATH_SUFFIXES
+                include
+                Include
+        )
+        mark_as_advanced( HDF5_${LANGUAGE}_INCLUDE_DIR )
+        list( APPEND HDF5_INCLUDE_DIRS ${HDF5_${LANGUAGE}_INCLUDE_DIR} )
+
+        set( HDF5_${LANGUAGE}_LIBRARY_NAMES
+            ${HDF5_${LANGUAGE}_LIBRARY_NAMES_INIT}
+            ${HDF5_${LANGUAGE}_LIBRARY_NAMES} )
+
+        # find the HDF5 libraries
+        foreach( LIB ${HDF5_${LANGUAGE}_LIBRARY_NAMES} )
+            if( UNIX AND HDF5_USE_STATIC_LIBRARIES )
+                # According to bug 1643 on the CMake bug tracker, this is the
+                # preferred method for searching for a static library.
+                # See http://www.cmake.org/Bug/view.php?id=1643.  We search
+                # first for the full static library name, but fall back to a
+                # generic search on the name if the static search fails.
+                set( THIS_LIBRARY_SEARCH_DEBUG lib${LIB}d.a ${LIB}d )
+                set( THIS_LIBRARY_SEARCH_RELEASE lib${LIB}.a ${LIB} )
+            else()
+                set( THIS_LIBRARY_SEARCH_DEBUG ${LIB}d )
+                set( THIS_LIBRARY_SEARCH_RELEASE ${LIB} )
+            endif()
+            find_library( HDF5_${LIB}_LIBRARY_DEBUG
+                NAMES ${THIS_LIBRARY_SEARCH_DEBUG}
+                HINTS ${HDF5_${LANGUAGE}_LIBRARY_DIRS}
+                ENV HDF5_ROOT
+                PATH_SUFFIXES lib Lib )
+            find_library( HDF5_${LIB}_LIBRARY_RELEASE
+                NAMES ${THIS_LIBRARY_SEARCH_RELEASE}
+                HINTS ${HDF5_${LANGUAGE}_LIBRARY_DIRS}
+                ENV HDF5_ROOT
+                PATH_SUFFIXES lib Lib )
+            select_library_configurations( HDF5_${LIB} )
+            # even though we adjusted the individual library names in
+            # select_library_configurations, we still need to distinguish
+            # between debug and release variants because HDF5_LIBRARIES will
+            # need to specify different lists for debug and optimized builds.
+            # We can't just use the HDF5_${LIB}_LIBRARY variable (which was set
+            # up by the selection macro above) because it may specify debug and
+            # optimized variants for a particular library, but a list of
+            # libraries is allowed to specify debug and optimized only once.
+            list( APPEND HDF5_${LANGUAGE}_LIBRARIES_DEBUG
+                ${HDF5_${LIB}_LIBRARY_DEBUG} )
+            list( APPEND HDF5_${LANGUAGE}_LIBRARIES_RELEASE
+                ${HDF5_${LIB}_LIBRARY_RELEASE} )
         endforeach()
-    endif()
-
-    # set the definitions for the language bindings.
-    list(APPEND HDF5_DEFINITIONS ${HDF5_${LANGUAGE}_DEFINITIONS})
-
-    # find the HDF5 include directories
-    find_path(HDF5_${LANGUAGE}_INCLUDE_DIR hdf5.h
-        HINTS
-        ${HDF5_${LANGUAGE}_INCLUDE_FLAGS}
-        ENV
-        HDF5_ROOT
-        PATHS
-        $ENV{HOME}/.local/include
-        PATH_SUFFIXES
-        include
-        Include
-        )
-    mark_as_advanced(HDF5_${LANGUAGE}_INCLUDE_DIR)
-    list(APPEND HDF5_INCLUDE_DIRS ${HDF5_${LANGUAGE}_INCLUDE_DIR})
-
-    set(HDF5_${LANGUAGE}_LIBRARY_NAMES
-        ${HDF5_${LANGUAGE}_LIBRARY_NAMES_INIT}
-        ${HDF5_${LANGUAGE}_LIBRARY_NAMES})
-
-    # find the HDF5 libraries
-    foreach(LIB ${HDF5_${LANGUAGE}_LIBRARY_NAMES})
-        if(UNIX AND HDF5_USE_STATIC_LIBRARIES)
-            # According to bug 1643 on the CMake bug tracker, this is the
-            # preferred method for searching for a static library.
-            # See http://www.cmake.org/Bug/view.php?id=1643.  We search
-            # first for the full static library name, but fall back to a
-            # generic search on the name if the static search fails.
-            set(THIS_LIBRARY_SEARCH_DEBUG lib${LIB}d.a ${LIB}d)
-            set(THIS_LIBRARY_SEARCH_RELEASE lib${LIB}.a ${LIB})
-        else()
-            set(THIS_LIBRARY_SEARCH_DEBUG ${LIB}d)
-            set(THIS_LIBRARY_SEARCH_RELEASE ${LIB})
+        list( APPEND HDF5_LIBRARY_DIRS ${HDF5_${LANGUAGE}_LIBRARY_DIRS} )
+
+        # Append the libraries for this language binding to the list of all
+        # required libraries.
+        list( APPEND HDF5_LIBRARIES_DEBUG
+            ${HDF5_${LANGUAGE}_LIBRARIES_DEBUG} )
+        list( APPEND HDF5_LIBRARIES_RELEASE
+            ${HDF5_${LANGUAGE}_LIBRARIES_RELEASE} )
+    endforeach()
+
+    # We may have picked up some duplicates in various lists during the above
+    # process for the language bindings (both the C and C++ bindings depend on
+    # libz for example).  Remove the duplicates.
+    if( HDF5_INCLUDE_DIRS )
+        list( REMOVE_DUPLICATES HDF5_INCLUDE_DIRS )
+    endif()
+    if( HDF5_LIBRARIES_DEBUG )
+        list( REMOVE_DUPLICATES HDF5_LIBRARIES_DEBUG )
+    endif()
+    if( HDF5_LIBRARIES_RELEASE )
+        list( REMOVE_DUPLICATES HDF5_LIBRARIES_RELEASE )
+    endif()
+    if( HDF5_LIBRARY_DIRS )
+        list( REMOVE_DUPLICATES HDF5_LIBRARY_DIRS )
+    endif()
+
+    # Construct the complete list of HDF5 libraries with debug and optimized
+    # variants when the generator supports them.
+    if( CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE )
+        set( HDF5_LIBRARIES
+            debug ${HDF5_LIBRARIES_DEBUG}
+            optimized ${HDF5_LIBRARIES_RELEASE} )
+    else()
+        set( HDF5_LIBRARIES ${HDF5_LIBRARIES_RELEASE} )
+    endif()
+
+    # If the HDF5 include directory was found, open H5pubconf.h to determine if
+    # HDF5 was compiled with parallel IO support
+    set( HDF5_IS_PARALLEL FALSE )
+    foreach( _dir HDF5_INCLUDE_DIRS )
+        if( EXISTS "${_dir}/H5pubconf.h" )
+            file( STRINGS "${_dir}/H5pubconf.h"
+                HDF5_HAVE_PARALLEL_DEFINE
+                REGEX "HAVE_PARALLEL 1" )
+            if( HDF5_HAVE_PARALLEL_DEFINE )
+                set( HDF5_IS_PARALLEL TRUE )
+            endif()
         endif()
-        find_library(HDF5_${LIB}_LIBRARY_DEBUG
-            NAMES ${THIS_LIBRARY_SEARCH_DEBUG}
-            HINTS ${HDF5_${LANGUAGE}_LIBRARY_DIRS}
-            ENV HDF5_ROOT
-            PATH_SUFFIXES lib Lib)
-        find_library(HDF5_${LIB}_LIBRARY_RELEASE
-            NAMES ${THIS_LIBRARY_SEARCH_RELEASE}
-            HINTS ${HDF5_${LANGUAGE}_LIBRARY_DIRS}
-            ENV HDF5_ROOT
-            PATH_SUFFIXES lib Lib)
-        select_library_configurations(HDF5_${LIB})
-        # even though we adjusted the individual library names in
-        # select_library_configurations, we still need to distinguish
-        # between debug and release variants because HDF5_LIBRARIES will
-        # need to specify different lists for debug and optimized builds.
-        # We can't just use the HDF5_${LIB}_LIBRARY variable (which was set
-        # up by the selection macro above) because it may specify debug and
-        # optimized variants for a particular library, but a list of
-        # libraries is allowed to specify debug and optimized only once.
-        list(APPEND HDF5_${LANGUAGE}_LIBRARIES_DEBUG
-            ${HDF5_${LIB}_LIBRARY_DEBUG})
-        list(APPEND HDF5_${LANGUAGE}_LIBRARIES_RELEASE
-            ${HDF5_${LIB}_LIBRARY_RELEASE})
-    endforeach()
-    list(APPEND HDF5_LIBRARY_DIRS ${HDF5_${LANGUAGE}_LIBRARY_DIRS})
-
-    # Append the libraries for this language binding to the list of all
-    # required libraries.
-    list(APPEND HDF5_LIBRARIES_DEBUG
-        ${HDF5_${LANGUAGE}_LIBRARIES_DEBUG})
-    list(APPEND HDF5_LIBRARIES_RELEASE
-        ${HDF5_${LANGUAGE}_LIBRARIES_RELEASE})
-endforeach()
-
-# We may have picked up some duplicates in various lists during the above
-# process for the language bindings (both the C and C++ bindings depend on
-# libz for example).  Remove the duplicates.
-if(HDF5_INCLUDE_DIRS)
-    list(REMOVE_DUPLICATES HDF5_INCLUDE_DIRS)
+    endforeach()
+    set( HDF5_IS_PARALLEL ${HDF5_IS_PARALLEL} CACHE BOOL
+        "HDF5 library compiled with parallel IO support" )
+    mark_as_advanced( HDF5_IS_PARALLEL )
+
 endif()
-if(HDF5_LIBRARIES_DEBUG)
-    list(REMOVE_DUPLICATES HDF5_LIBRARIES_DEBUG)
-endif()
-if(HDF5_LIBRARIES_RELEASE)
-    list(REMOVE_DUPLICATES HDF5_LIBRARIES_RELEASE)
-endif()
-if(HDF5_LIBRARY_DIRS)
-    list(REMOVE_DUPLICATES HDF5_LIBRARY_DIRS)
-endif()
-
-# Construct the complete list of HDF5 libraries with debug and optimized
-# variants when the generator supports them.
-if(CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
-    set(HDF5_LIBRARIES
-        debug ${HDF5_LIBRARIES_DEBUG}
-        optimized ${HDF5_LIBRARIES_RELEASE})
-else()
-    set(HDF5_LIBRARIES ${HDF5_LIBRARIES_RELEASE})
-endif()
-
-# If the HDF5 include directory was found, open H5pubconf.h to determine if
-# HDF5 was compiled with parallel IO support
-set(HDF5_IS_PARALLEL FALSE)
-foreach(_dir HDF5_INCLUDE_DIRS)
-    if(EXISTS "${_dir}/H5pubconf.h")
-        file(STRINGS "${_dir}/H5pubconf.h"
-            HDF5_HAVE_PARALLEL_DEFINE
-            REGEX "HAVE_PARALLEL 1")
-        if(HDF5_HAVE_PARALLEL_DEFINE)
-            set(HDF5_IS_PARALLEL TRUE)
-        endif()
-    endif()
-endforeach()
-set(HDF5_IS_PARALLEL ${HDF5_IS_PARALLEL} CACHE BOOL
-    "HDF5 library compiled with parallel IO support")
-mark_as_advanced(HDF5_IS_PARALLEL)
-
-endif()
-
-find_package_handle_standard_args(HDF5 DEFAULT_MSG
-    HDF5_LIBRARIES
+
+find_package_handle_standard_args( HDF5 DEFAULT_MSG
+    HDF5_LIBRARIES
     HDF5_INCLUDE_DIRS
-    )
-
-mark_as_advanced(
-    HDF5_INCLUDE_DIRS
-    HDF5_LIBRARIES
+)
+
+mark_as_advanced(
+    HDF5_INCLUDE_DIRS
+    HDF5_LIBRARIES
     HDF5_DEFINTIONS
     HDF5_LIBRARY_DIRS
     HDF5_C_COMPILER_EXECUTABLE
-    HDF5_CXX_COMPILER_EXECUTABLE)
+    HDF5_CXX_COMPILER_EXECUTABLE )

 # For backwards compatibility we set HDF5_INCLUDE_DIR to the value of
 # HDF5_INCLUDE_DIRS
-set(HDF5_INCLUDE_DIR "${HDF5_INCLUDE_DIRS}")
+set( HDF5_INCLUDE_DIR "${HDF5_INCLUDE_DIRS}" )
+
+


Find llvm-config on OS X w/ brew LLVM

Find llvm-config on OS X w/ brew LLVM

Tested on 10.11.3 El Capitan with -DDOWNLOAD_CLANG=1 and homebrew's
LLVM (3.6.2)

--- cmake/FindLLVM.cmake
+++ cmake/FindLLVM.cmake
@@ -38,7 +38,7 @@
                       llvm-config-3.1 llvm-config31 llvm-config)
 find_program(LLVM_CONFIG
     NAMES ${llvm_config_names}
-    PATHS ${LLVM_ROOT_DIR}/bin NO_DEFAULT_PATH
+    PATHS ${LLVM_ROOT_DIR}/bin /usr/local/opt/llvm/bin NO_DEFAULT_PATH
     DOC "Path to llvm-config tool.")
 find_program(LLVM_CONFIG NAMES ${llvm_config_names})


Ignore empty data files.

Ignore empty data files.

Empty data files (e.g. no function in file) will result in an lcov error. To
avoid these errors, all data files will be concatenated first before passing
them to lcov.

--- cmake/FindLcov.cmake
+++ cmake/FindLcov.cmake
@@ -107,19 +107,21 @@
 function (lcov_merge_files OUTFILE ...)
 	# Remove ${OUTFILE} from ${ARGV} and generate lcov parameters with files.
 	list(REMOVE_AT ARGV 0)
-	set(LCOV_ARGS "")
-	foreach (FILE ${ARGV})
-		list(APPEND LCOV_ARGS -a ${FILE})
-	endforeach ()

 	# Generate merged file.
 	string(REPLACE "${CMAKE_BINARY_DIR}/" "" FILE_REL "${OUTFILE}")
-	add_custom_command(OUTPUT "${OUTFILE}"
-		COMMAND ${LCOV_BIN} ${LCOV_ARGS} --base-directory ${PROJECT_SOURCE_DIR}
-			${LCOV_EXTERN_FLAG} --output-file ${OUTFILE} --quiet
-			${LCOV_EXTRA_FLAGS}
+	add_custom_command(OUTPUT "${OUTFILE}.raw"
+		COMMAND cat ${ARGV} > ${OUTFILE}.raw
 		DEPENDS ${ARGV}
 		COMMENT "Generating ${FILE_REL}"
+	)
+
+	add_custom_command(OUTPUT "${OUTFILE}"
+		COMMAND ${LCOV_BIN} --quiet -a ${OUTFILE}.raw ${LCOV_EXTERN_FLAG}
+			--base-directory ${PROJECT_SOURCE_DIR} --output-file ${OUTFILE}
+			${LCOV_EXTRA_FLAGS}
+		DEPENDS ${OUTFILE}.raw
+		COMMENT "Post-processing ${FILE_REL}"
 	)
 endfunction ()


Fix formatting in cmake/FindPoco.cmake

Fix formatting in cmake/FindPoco.cmake

--- cmake/FindPoco.cmake
+++ cmake/FindPoco.cmake
@@ -1,7 +1,8 @@
 find_package(Poco COMPONENTS ${Poco_FIND_COMPONENTS} CONFIG)
 if(Poco_FOUND)
-return()
+  return()
 endif()
+
 find_path(Poco_INCLUDE_DIR Poco/Poco.h)
 mark_as_advanced(FORCE Poco_INCLUDE_DIR)


FindPoco.cmake: Don't override existing target

--- cmake/FindPoco.cmake
+++ cmake/FindPoco.cmake
@@ -8,11 +8,13 @@
   if(${component_var})
     set(Poco_${component}_FOUND TRUE)
     list(APPEND Poco_LIBRARIES ${component})
-    add_library(Poco::${component} SHARED IMPORTED)
-    set_target_properties(Poco::${component} PROPERTIES
-      INTERFACE_INCLUDE_DIRECTORIES ${Poco_INCLUDE_DIR}
-      IMPORTED_LOCATION ${${component_var}}
-    )
+    if(NOT TARGET Poco::${component})
+      add_library(Poco::${component} SHARED IMPORTED)
+      set_target_properties(Poco::${component} PROPERTIES
+        INTERFACE_INCLUDE_DIRECTORIES ${Poco_INCLUDE_DIR}
+        IMPORTED_LOCATION ${${component_var}}
+      )
+    endif()
   endif()
 endforeach()


build: update Findllvm.cmake for llvm 8

build: update Findllvm.cmake for llvm 8

--- cmake/Findllvm.cmake
+++ cmake/Findllvm.cmake
@@ -24,14 +24,14 @@
 	OUTPUT_VARIABLE LLVM_CONFIG_VERSION
 	OUTPUT_STRIP_TRAILING_WHITESPACE)

-if("${LLVM_CONFIG_VERSION}" VERSION_LESS 7)
-  message(FATAL_ERROR "expected LLVM 7.x but found ${LLVM_CONFIG_VERSION}")
+if("${LLVM_CONFIG_VERSION}" VERSION_LESS 8)
+  message(FATAL_ERROR "expected LLVM 8.x but found ${LLVM_CONFIG_VERSION}")
 endif()
-if("${LLVM_CONFIG_VERSION}" VERSION_EQUAL 8)
-  message(FATAL_ERROR "expected LLVM 7.x but found ${LLVM_CONFIG_VERSION}")
+if("${LLVM_CONFIG_VERSION}" VERSION_EQUAL 9)
+  message(FATAL_ERROR "expected LLVM 8.x but found ${LLVM_CONFIG_VERSION}")
 endif()
-if("${LLVM_CONFIG_VERSION}" VERSION_GREATER 8)
-  message(FATAL_ERROR "expected LLVM 7.x but found ${LLVM_CONFIG_VERSION}")
+if("${LLVM_CONFIG_VERSION}" VERSION_GREATER 9)
+  message(FATAL_ERROR "expected LLVM 8.x but found ${LLVM_CONFIG_VERSION}")
 endif()

 execute_process(
@@ -57,6 +57,7 @@
 NEED_TARGET("PowerPC")
 NEED_TARGET("Sparc")
 NEED_TARGET("SystemZ")
+NEED_TARGET("WebAssembly")
 NEED_TARGET("X86")
 NEED_TARGET("XCore")


[cmake] turn off MSVC10 warninig

[cmake] turn off MSVC10 warninig


toplevel: minor typo

toplevel: minor typo

--- cmake/toplevel.cmake
+++ cmake/toplevel.cmake
@@ -17,7 +17,7 @@
   ERROR_STRIP_TRAILING_WHITESPACE
 )
 if(NOT _res EQUAL 0 AND NOT _res EQUAL 2)
-  # searching fot catkin resulted in an error
+  # searching for catkin resulted in an error
   string(REPLACE ";" " " _cmd_str "${_cmd}")
   message(FATAL_ERROR "Search for 'catkin' in workspace failed (${_cmd_str}): ${_err}")
 endif()


Accumulate kit library target names in VTK_LIBRARIES.

Change-Id: I83fca005ed1f0f7f4e89f10c8838e9e53f39cad0

--- CMake/KitCommonBlock.cmake
+++ CMake/KitCommonBlock.cmake
@@ -6,6 +6,11 @@

 VTK_ADD_LIBRARY(vtk${KIT} ${Kit_SRCS} ${Kit_EXTRA_SRCS} ${KitInstantiator_SRCS})
 SET(KIT_LIBRARY_TARGETS ${KIT_LIBRARY_TARGETS} vtk${KIT})
+
+# accumulate list of kit library target names
+# we export these in VTKConfig as VTK_LIBRARIES.
+set_property(GLOBAL APPEND PROPERTY VTK_LIBRARIES vtk${KIT})
+
 # Add target specific compile flags for ABI setttings
 IF(VTK_ABI_CXX_FLAGS)
   SET_PROPERTY(TARGET vtk${KIT} APPEND


Fix install error on some machines

Fix install error on some machines

On some machines CMake replaces test -e by test -E, which is an
invalid option.

--- CMakeExternals/Boost.cmake
+++ CMakeExternals/Boost.cmake
@@ -188,7 +188,7 @@

     else()

-      set(bootstrap_cmd test -e ./b2 || ./bootstrap.sh ${bootstrap_args})
+      set(bootstrap_cmd #[[ test -e ./b2 || ]] ./bootstrap.sh ${bootstrap_args})
       set(b2_cmd ./b2 ${b2_options} ${b2_properties} stage)

       #[[ We already told Boost if we want to use GCC or Clang but so far we
@@ -249,7 +249,7 @@
     )
   else()
     set(install_cmd
-      test -e <INSTALL_DIR>/include/boost/config.hpp ||
+      # test -e <INSTALL_DIR>/include/boost/config.hpp ||
       ${CMAKE_COMMAND} -E copy_directory <SOURCE_DIR>/boost <INSTALL_DIR>/include/boost
     )
   endif()


added FBX SDK 2017.1 and try to add apple (clang) support (not tested - I have no apple)

--- CMakeModules/FindFBX.cmake
+++ CMakeModules/FindFBX.cmake
@@ -9,7 +9,12 @@
 # correspond to the ./configure --prefix=$FBX_DIR

 IF(APPLE)
+  if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
+    # using regular Clang or AppleClang
+    SET(FBX_LIBDIR "clang")
+  else()
     SET(FBX_LIBDIR "gcc4/ub")
+  endif()
 ELSEIF(CMAKE_COMPILER_IS_GNUCXX)
     SET(FBX_LIBDIR "gcc4")
 ELSEIF(MSVC80)
@@ -55,6 +60,9 @@

 SET( FBX_SEARCH_PATHS
     $ENV{FBX_DIR}
+    "$ENV{ProgramW6432}/Autodesk/FBX/FBX SDK/2017.1"
+    "$ENV{PROGRAMFILES}/Autodesk/FBX/FBX SDK/2017.1"
+    "/Applications/Autodesk/FBX SDK/2017.1"
     "$ENV{ProgramW6432}/Autodesk/FBX/FBX SDK/2016.1.1"
     "$ENV{PROGRAMFILES}/Autodesk/FBX/FBX SDK/2016.1.1"
     "$ENV{ProgramW6432}/Autodesk/FBX/FBX SDK/2015.1"