kent's recent changes to this file resulted in flag loss due to
the way cmake parses, in particular CMAKE_SIZEOF_VOID_P was
uninitialized during the first parse, and the bad values were
cached.

Pull in SIZEOF_VOIDP macro from package_name.cmake, define some
useful variables, and clean up the file a bit with explicit
definitions, to hopefully avoid this problem in the future.

--- cmake/build_configurations/mysql_release.cmake
+++ cmake/build_configurations/mysql_release.cmake
@@ -17,6 +17,16 @@

 INCLUDE(CheckIncludeFiles)
 INCLUDE(CheckLibraryExists)
+INCLUDE(CheckTypeSize)
+
+# XXX package_name.cmake uses this too, move it somewhere global
+CHECK_TYPE_SIZE("void *" SIZEOF_VOIDP)
+IF(SIZEOF_VOIDP EQUAL 4)
+  SET(32BIT 1)
+ENDIF()
+IF(SIZEOF_VOIDP EQUAL 8)
+  SET(64BIT 1)
+ENDIF()

 SET(FEATURE_SET "community" CACHE STRING
 " Selection of features. Options are
@@ -78,14 +88,13 @@
       SET(WITH_${eng}_STORAGE_ENGINE OFF CACHE BOOL "")
     ELSE()
      SET(WITH_${eng}_STORAGE_ENGINE ON CACHE BOOL "")
-	ENDIF()
+    ENDIF()
   ENDFOREACH()
 ENDIF()

 OPTION(ENABLED_LOCAL_INFILE "" ON)
 SET(WITH_SSL bundled CACHE STRING "")
 SET(WITH_ZLIB bundled CACHE STRING "")
-

 IF(NOT COMPILATION_COMMENT)
   SET(COMPILATION_COMMENT "MySQL Community Server (GPL)")
@@ -117,59 +126,62 @@

 ENDIF()

-
 # Compiler options
-IF(UNIX)
-
-  # Defaults if not set at all
-
-  SET(OPT_FLG "-O")
-  SET(DBG_FLG "-g")
-  SET(COMMON_CFLAGS   "")
-  SET(COMMON_CXXFLAGS "")
+IF(UNIX)

   # Default GCC flags
+  IF(CMAKE_COMPILER_IS_GNUC)
+    SET(COMMON_C_FLAGS               "-g -static-libgcc -fno-omit-frame-pointer")
+    SET(CMAKE_C_FLAGS_DEBUG          "-O ${COMMON_C_FLAGS}")
+    SET(CMAKE_C_FLAGS_RELWITHDEBINFO "-O3 ${COMMON_C_FLAGS}")
+  ENDIF()
   IF(CMAKE_COMPILER_IS_GNUCXX)
-    SET(OPT_FLG "-O3")
-    SET(DBG_FLG "-O")
-    SET(COMMON_CFLAGS   "-static-libgcc -g -fno-omit-frame-pointer")
-    SET(COMMON_CXXFLAGS "${COMMON_CFLAGS} -fno-implicit-templates -felide-constructors -fno-exceptions -fno-rtti")
+    SET(COMMON_CXX_FLAGS               "-g -static-libgcc -fno-omit-frame-pointer -fno-implicit-templates -felide-constructors -fno-exceptions -fno-rtti")
+    SET(CMAKE_CXX_FLAGS_DEBUG          "-O ${COMMON_CXX_FLAGS}")
+    SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O3 ${COMMON_CXX_FLAGS}")
   ENDIF()

   # HPUX flags
   IF(CMAKE_SYSTEM_NAME MATCHES "HP-UX")
     IF(CMAKE_C_COMPILER_ID MATCHES "HP")
       IF(CMAKE_SYSTEM_PROCESSOR MATCHES "ia64")
-	SET(OPT_FLG "+O2")
-	SET(DBG_FLG "+O0")
-        SET(COMMON_CFLAGS   "+DD64 +DSitanium2 -mt -AC99")
-        SET(COMMON_CXXFLAGS "+DD64 +DSitanium2 -mt -Aa")
+        SET(COMMON_C_FLAGS                 "+DSitanium2 -mt -AC99")
+        SET(COMMON_CXX_FLAGS               "+DSitanium2 -mt -Aa")
+        SET(CMAKE_C_FLAGS_DEBUG            "+O0 -g ${COMMON_C_FLAGS}")
+        SET(CMAKE_CXX_FLAGS_DEBUG          "+O0 -g ${COMMON_CXX_FLAGS}")
+	# We have seen compiler bugs with optimisation and -g, so disabled for now
+        SET(CMAKE_C_FLAGS_RELWITHDEBINFO   "+O2 ${COMMON_C_FLAGS}")
+        SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "+O2 ${COMMON_CXX_FLAGS}")
       ENDIF()
     ENDIF()
-    SET(WITH_SSL no)
+    SET(WITH_SSL)
   ENDIF()

   # Linux flags
   IF(CMAKE_SYSTEM_NAME MATCHES "Linux")
     IF(CMAKE_C_COMPILER_ID MATCHES "Intel")
-      SET(OPT_FLG "-O3 -unroll2 -ip")
-      SET(DBG_FLG "")
-      SET(COMMON_CFLAGS   "-static-intel -static-libgcc -g -mp -restrict")
-      SET(COMMON_CXXFLAGS "${COMMON_CFLAGS} -fno-implicit-templates -fno-exceptions -fno-rtti")
+      SET(COMMON_C_FLAGS                 "-static-intel -static-libgcc -g -mp -restrict")
+      SET(COMMON_CXX_FLAGS               "-static-intel -static-libgcc -g -mp -restrict -fno-implicit-templates -fno-exceptions -fno-rtti")
+      IF(CMAKE_SYSTEM_PROCESSOR MATCHES "ia64")
+        SET(COMMON_C_FLAGS               "${COMMON_C_FLAGS} -no-ftz -no-prefetch")
+        SET(COMMON_CXX_FLAGS             "${COMMON_CXX_FLAGS} -no-ftz -no-prefetch")
+      ENDIF()
+      SET(CMAKE_C_FLAGS_DEBUG            "${COMMON_C_FLAGS}")
+      SET(CMAKE_CXX_FLAGS_DEBUG          "${COMMON_CXX_FLAGS}")
+      SET(CMAKE_C_FLAGS_RELWITHDEBINFO   "-O3 -unroll2 -ip ${COMMON_C_FLAGS}")
+      SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O3 -unroll2 -ip ${COMMON_CXX_FLAGS}")
       SET(WITH_SSL no)
-      IF(CMAKE_SYSTEM_PROCESSOR MATCHES "ia64")
-        SET(COMMON_CFLAGS   "${COMMON_CFLAGS} -no-ftz -no-prefetch")
-        SET(COMMON_CXXFLAGS "${COMMON_CXXFLAGS} -no-ftz -no-prefetch")
-      ENDIF()
     ENDIF()
   ENDIF()

   # OSX flags
   IF(APPLE)
-    SET(OPT_FLG "-Os")
-    SET(DBG_FLG "-O")
-    SET(COMMON_CFLAGS   "-g -fno-common")
-    SET(COMMON_CXXFLAGS "-g -felide-constructors -fno-common")
+    SET(COMMON_C_FLAGS                 "-g -fno-common")
+    SET(COMMON_CXX_FLAGS               "-g -fno-common -felide-constructors -fno-implicit-templates -fno-exceptions -fno-rtti")
+    SET(CMAKE_C_FLAGS_DEBUG            "-O ${COMMON_C_FLAGS}")
+    SET(CMAKE_CXX_FLAGS_DEBUG          "-O ${COMMON_CXX_FLAGS}")
+    SET(CMAKE_C_FLAGS_RELWITHDEBINFO   "-Os ${COMMON_C_FLAGS}")
+    SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-Os ${COMMON_CXX_FLAGS}")
   ENDIF()

   # Solaris flags
@@ -179,42 +191,49 @@
       SET(WITH_MYSQLD_LDFLAGS "-lmtmalloc" CACHE STRING "")
     ENDIF()
     IF(CMAKE_C_COMPILER_ID MATCHES "SunPro")
-      SET(DBG_FLG "")
       IF(CMAKE_SYSTEM_PROCESSOR MATCHES "i386")
-        IF(CMAKE_SIZEOF_VOID_P EQUAL 4)
-	  # Solaris x86
-          SET(OPT_FLG "-xO2")
-        ELSE()
-	  # Solaris x86_64
-          SET(OPT_FLG "-xO3")
+        SET(COMMON_C_FLAGS                   "-g -mt -fsimple=1 -ftrap=%none -nofstore -xbuiltin=%all -xlibmil -xlibmopt -xtarget=generic")
+        SET(COMMON_CXX_FLAGS                 "-g0 -mt -fsimple=1 -ftrap=%none -nofstore -xbuiltin=%all -xlibmil -xlibmopt -xtarget=generic")
+        SET(CMAKE_C_FLAGS_DEBUG              "${COMMON_C_FLAGS}")
+        SET(CMAKE_CXX_FLAGS_DEBUG            "${COMMON_CXX_FLAGS}")
+        IF(32BIT)
+          SET(CMAKE_C_FLAGS_RELWITHDEBINFO   "-xO2 ${COMMON_C_FLAGS}")
+          SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-xO2 ${COMMON_CXX_FLAGS}")
+        ELSEIF(64BIT)
+          SET(CMAKE_C_FLAGS_RELWITHDEBINFO   "-xO3 ${COMMON_C_FLAGS}")
+          SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-xO3 ${COMMON_CXX_FLAGS}")
         ENDIF()
-	SET(COMMON_CFLAGS
-	  "-g -mt -fsimple=1 -ftrap=%none -nofstore -xbuiltin=%all -xlibmil -xlibmopt -xtarget=generic")
-	SET(COMMON_CXXFLAGS
-	  "-g0 -mt -fsimple=1 -ftrap=%none -nofstore -xbuiltin=%all -features=no%except -xlibmil -xlibmopt -xtarget=generic")
       ELSE()
-        IF(CMAKE_SIZEOF_VOID_P EQUAL 4)
-          # Solaris sparc 32 bit
-          SET(OPT_FLG "-xO3")
-          SET(COMMON_CFLAGS   "-g -Xa -xstrconst -mt -xarch=sparc")
-          SET(COMMON_CXXFLAGS "-g0 -noex -mt -xarch=sparc")
-        ELSE()
-          # Solaris sparc 64 bit
-          SET(OPT_FLG "-xO3")
-          SET(COMMON_CFLAGS   "-g -Xa -xstrconst -mt")
-          SET(COMMON_CXXFLAGS "-g0 -noex -mt")
-        ENDIF()
+        # Assume !x86 is SPARC
+        SET(COMMON_C_FLAGS                 "-g -Xa -xstrconst -mt")
+        SET(COMMON_CXX_FLAGS               "-g0 -noex -mt")
+        IF(32BIT)
+          SET(COMMON_C_FLAGS               "${COMMON_C_FLAGS} -xarch=sparc")
+          SET(COMMON_CXX_FLAGS             "${COMMON_CXX_FLAGS} -xarch=sparc")
+	ENDIF()
+        SET(CMAKE_C_FLAGS_DEBUG            "${COMMON_C_FLAGS}")
+        SET(CMAKE_CXX_FLAGS_DEBUG          "${COMMON_CXX_FLAGS}")
+        SET(CMAKE_C_FLAGS_RELWITHDEBINFO   "-xO3 ${COMMON_C_FLAGS}")
+        SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-xO3 ${COMMON_CXX_FLAGS}")
       ENDIF()
     ENDIF()
   ENDIF()
-
-  SET(CMAKE_CXX_FLAGS_RELEASE "${OPT_FLG} ${COMMON_CXXFLAGS}")
-  SET(CMAKE_C_FLAGS_RELEASE "${OPT_FLG} ${COMMON_CFLAGS}")
-
-  SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${OPT_FLG} ${COMMON_CXXFLAGS}")
-  SET(CMAKE_C_FLAGS_RELWITHDEBINFO "${OPT_FLG} ${COMMON_CFLAGS}")
-
-  SET(CMAKE_CXX_FLAGS_DEBUG "${DBG_FLG} ${COMMON_CXXFLAGS}")
-  SET(CMAKE_C_FLAGS_DEBUG "${DBG_FLG} ${COMMON_CFLAGS}")
-
-ENDIF()
+
+  IF(CMAKE_C_FLAGS_DEBUG)
+    SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG}"
+      CACHE STRING "Debug C compile flags")
+  ENDIF()
+  IF(CMAKE_CXX_FLAGS_DEBUG)
+    SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}"
+      CACHE STRING "Debug C++ compile flags")
+  ENDIF()
+  IF(CMAKE_C_FLAGS_RELWITHDEBINFO)
+    SET(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO}"
+      CACHE STRING "RelWithDebInfo C compile flags")
+  ENDIF()
+  IF(CMAKE_CXX_FLAGS_RELWITHDEBINFO)
+    SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}"
+      CACHE STRING "RelWithDebInfo C++ compile flags")
+  ENDIF()
+
+ENDIF()


update FindGraphicsOrigin

update FindGraphicsOrigin

--- cmake/modules/FindGraphicsOrigin.cmake
+++ cmake/modules/FindGraphicsOrigin.cmake
@@ -38,11 +38,11 @@
   set( GRAPHICS_ORIGIN_LIBRARY_DIR "${GRAPHICS_ORIGIN_INCLUDE_DIR}/../lib")

   if( CMAKE_BUILD_TYPE STREQUAL "Debug" )
-  	set( GRAPHICS_ORIGIN_LIBRARY_DIR ${GRAPHICS_ORIGIN_LIBRARY_DIR}/debug )
-  else if( CMAKE_BUILD_TYPE STREQUAL "Release" )
-    set( GRAPHICS_ORIGIN_LIBRARY_DIR ${GRAPHICS_ORIGIN_LIBRARY_DIR}/release )
-  else if( CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo" )
-    set( GRAPHICS_ORIGIN_LIBRARY_DIR ${GRAPHICS_ORIGIN_LIBRARY_DIR}/relwithdebinfo )
+  	set( GRAPHICS_ORIGIN_LIBRARY_DIR "${GRAPHICS_ORIGIN_LIBRARY_DIR}/debug" )
+  elseif( CMAKE_BUILD_TYPE STREQUAL "Release" )
+    set( GRAPHICS_ORIGIN_LIBRARY_DIR "${GRAPHICS_ORIGIN_LIBRARY_DIR}/release" )
+  elseif( CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo" )
+    set( GRAPHICS_ORIGIN_LIBRARY_DIR "${GRAPHICS_ORIGIN_LIBRARY_DIR}/relwithdebinfo" )
   else()
     message( SEND_ERROR "${CMAKE_BUILD_TYPE} is not a recognized build type" )
   endif()
@@ -126,6 +126,7 @@
 	  find_package( Qt5Gui REQUIRED )
 	  find_package( Qt5Qml REQUIRED )
 	  find_package( Qt5Network REQUIRED )
+	  find_package( Qt5Widgets REQUIRED )

 	  # glew
 	  find_package( GLEW REQUIRED )
@@ -137,12 +138,12 @@
     	${GRAPHICS_ORIGIN_APPLICATION_LIBRARIES}
     	${GRAPHICS_ORIGIN_GEOMETRY_LIBRARIES}
   		${GLEW_LIBRARIES} ${OPENGL_LIBRARIES}
-  		${Qt5Quick_LIBRARIES} ${Qt5Gui_LIBRARIES} ${Qt5Qml_LIBRARIES} ${Qt5Network_LIBRARIES} ${Qt5Core_LIBRARIES})
+  		${Qt5Quick_LIBRARIES} ${Qt5Gui_LIBRARIES} ${Qt5Qml_LIBRARIES} ${Qt5Network_LIBRARIES} ${Qt5Core_LIBRARIES} ${Qt5Widgets_LIBRARIES})

   	set( GRAPHICS_ORIGIN_APPLICATION_INCLUDE_DIRS
   		${GRAPHICS_ORIGIN_GEOMETRY_INCLUDE_DIRS}
 	  	${GLEW_INCLUDE_DIR} ${OPENGL_INCLUDE_DIR}
-  		${Qt5Quick_INCLUDE_DIRS} ${Qt5Gui_INCLUDE_DIRS} ${Qt5Qml_INCLUDE_DIRS} ${Qt5Network_INCLUDE_DIRS} ${Qt5Core_INCLUDE_DIRS})
+  		${Qt5Quick_INCLUDE_DIRS} ${Qt5Gui_INCLUDE_DIRS} ${Qt5Qml_INCLUDE_DIRS} ${Qt5Network_INCLUDE_DIRS} ${Qt5Core_INCLUDE_DIRS} ${Qt5Widgets_INCLUDE_DIRS})

   	set( GRAPHICS_ORIGIN_LIBRARIES
   		${GRAPHICS_ORIGIN_APPLICATION_LIBRARIES})


[Build] Re-instated the CMake support for Xapian (which had unfortunately disappeared after a Git merge).

--- config/project_config_embeddable.cmake
+++ config/project_config_embeddable.cmake
@@ -279,6 +279,10 @@
       get_boost (${_arg_version})
     endif (${_arg_lower} STREQUAL "boost")

+    if (${_arg_lower} STREQUAL "xapian")
+      get_xapian (${_arg_version})
+    endif (${_arg_lower} STREQUAL "xapian")
+
     if (${_arg_lower} STREQUAL "readline")
       get_readline (${_arg_version})
     endif (${_arg_lower} STREQUAL "readline")
@@ -469,6 +473,28 @@
   endif (Boost_FOUND)

 endmacro (get_boost)
+
+# ~~~~~~~~~~ Xapian ~~~~~~~~~
+macro (get_xapian)
+  unset (_required_version)
+  if (${ARGC} GREATER 0)
+    set (_required_version ${ARGV0})
+    message (STATUS "Requires Xapian-${_required_version}")
+  else (${ARGC} GREATER 0)
+    message (STATUS "Requires Xapian without specifying any version")
+  endif (${ARGC} GREATER 0)
+
+  find_package (Xapian ${_required_version} REQUIRED)
+
+  if (XAPIAN_FOUND)
+    # Update the list of include directories for the project
+    include_directories (${XAPIAN_INCLUDE_DIR})
+
+    # Update the list of dependencies for the project
+    list (APPEND PROJ_DEP_LIBS_FOR_LIB ${XAPIAN_LIBRARIES})
+  endif (XAPIAN_FOUND)
+
+endmacro (get_xapian)

 # ~~~~~~~~~~ Readline ~~~~~~~~~
 macro (get_readline)
@@ -1883,6 +1909,17 @@
     message (STATUS "  - Boost required libraries ... : ${BOOST_REQUIRED_LIBS}")
   endif (Boost_FOUND)
 endmacro (display_boost)
+
+# Xapian
+macro (display_xapian)
+  if (XAPIAN_FOUND)
+    message (STATUS)
+	message (STATUS "* Xapian:")
+	message (STATUS "  - XAPIAN_VERSION ............. : ${XAPIAN_VERSION}")
+	message (STATUS "  - XAPIAN_LIBRARIES ........... : ${XAPIAN_LIBRARIES}")
+	message (STATUS "  - XAPIAN_INCLUDE_DIR ......... : ${XAPIAN_INCLUDE_DIR}")
+  endif (XAPIAN_FOUND)
+endmacro (display_xapian)

 # Readline
 macro (display_readline)
@@ -2170,6 +2207,7 @@
   display_python ()
   display_zeromq ()
   display_boost ()
+  display_xapian ()
   display_readline ()
   display_mysql ()
   display_soci ()


Update external yaml-cpp for shared library builds

When building OpenSurgSim as a shared library, also build yaml-cpp as a
shared library.

--- CMake/External_yamlcpp.cmake
+++ CMake/External_yamlcpp.cmake
@@ -21,6 +21,7 @@
 	CMAKE_ARGS
 		-DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
 		-DYAML_CPP_BUILD_TOOLS:BOOL=OFF
+		-DBUILD_SHARED_LIBS:BOOL=${BUILD_SHARED_LIBS}
 )

 ExternalProject_Get_Property(yaml-cpp install_dir)
@@ -31,9 +32,15 @@
 		optimized ${install_dir}/lib/libyaml-cppmd${CMAKE_STATIC_LIBRARY_SUFFIX}
 		CACHE INTERNAL "")
 else()
-	set(YAML_CPP_LIBRARIES
-		"${install_dir}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}yaml-cpp${CMAKE_STATIC_LIBRARY_SUFFIX}"
-		CACHE INTERNAL "")
+	if(BUILD_SHARED_LIBS)
+		set(YAML_CPP_LIBRARIES
+			"${install_dir}/lib/${CMAKE_SHARED_LIBRARY_PREFIX}yaml-cpp${CMAKE_SHARED_LIBRARY_SUFFIX}"
+			CACHE INTERNAL "")
+	else()
+		set(YAML_CPP_LIBRARIES
+			"${install_dir}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}yaml-cpp${CMAKE_STATIC_LIBRARY_SUFFIX}"
+			CACHE INTERNAL "")
+	endif()
 endif()

 set(YAML_CPP_INCLUDE_DIR "${install_dir}/include" CACHE INTERNAL "")


iOS: Guard a media dir variable update since we want to preserve the relative paths on iOS

--HG--
branch : v1-7

--- CMake/InstallResources.cmake
+++ CMake/InstallResources.cmake
@@ -21,7 +21,7 @@
   set(OGRE_SAMPLES_DIR_DBG ".")
   set(OGRE_CFG_INSTALL_PATH "bin")
 elseif (APPLE)
-  set(OGRE_MEDIA_PATH "media")
+  set(OGRE_MEDIA_PATH "Media")
   if(OGRE_BUILD_PLATFORM_IPHONE)
     set(OGRE_MEDIA_DIR_REL "${OGRE_MEDIA_PATH}")
     set(OGRE_MEDIA_DIR_DBG "${OGRE_MEDIA_PATH}")
@@ -142,8 +142,11 @@

 # CREATE CONFIG FILES - BUILD DIR VERSIONS
-set(OGRE_MEDIA_DIR_REL "${OGRE_SOURCE_DIR}/Samples/Media")
-set(OGRE_MEDIA_DIR_DBG "${OGRE_SOURCE_DIR}/Samples/Media")
+if (NOT OGRE_BUILD_PLATFORM_IPHONE)
+  set(OGRE_MEDIA_DIR_REL "${OGRE_SOURCE_DIR}/Samples/Media")
+  set(OGRE_MEDIA_DIR_DBG "${OGRE_SOURCE_DIR}/Samples/Media")
+endif ()
+
 if (WIN32)
   set(OGRE_PLUGIN_DIR_REL ".")
   set(OGRE_PLUGIN_DIR_DBG ".")


Remove install rules related to MINGW

Remove install rules related to MINGW

--- CMake/mitkInstallRules.cmake
+++ CMake/mitkInstallRules.cmake
@@ -105,37 +105,6 @@
             CONFIGURATIONS Debug)
   endif()

-  #DCMTK Dlls install target (shared libs on gcc only)
-  if(MINGW AND DCMTK_ofstd_LIBRARY)
-    set(_dcmtk_libs
-        ${DCMTK_dcmdata_LIBRARY}
-        ${DCMTK_dcmimgle_LIBRARY}
-        ${DCMTK_dcmnet_LIBRARY}
-        ${DCMTK_ofstd_LIBRARY}
-       )
-
-    foreach(_dcmtk_lib ${_dcmtk_libs})
-      MITK_INSTALL(FILES ${_dcmtk_lib} )
-    endforeach()
-  endif()
-
-  #MinGW dll
-  if(MINGW)
-    find_library(MINGW_RUNTIME_DLL "mingwm10.dll" HINTS ${CMAKE_FIND_ROOT_PATH}/sys-root/mingw/bin)
-    if(MINGW_RUNTIME_DLL)
-      MITK_INSTALL(FILES ${MINGW_RUNTIME_DLL} )
-    else()
-      message(SEND_ERROR "Could not find mingwm10.dll which is needed for a proper install")
-    endif()
-
-    find_library(MINGW_GCC_RUNTIME_DLL "libgcc_s_dw2-1.dll" HINTS ${CMAKE_FIND_ROOT_PATH}/sys-root/mingw/bin)
-    if(MINGW_GCC_RUNTIME_DLL)
-      MITK_INSTALL(FILES ${MINGW_GCC_RUNTIME_DLL} )
-    else()
-      message(SEND_ERROR "Could not find libgcc_s_dw2-1.dll which is needed for a proper install")
-    endif()
-  endif()
-
 else()

   #DCMTK Dlls install target (shared libs on gcc only)


Suppress a number of warnings that ICC generates.

git-svn-id: 31d9d2f6432a47c86a3640814024c107794ea77c@32580 0785d39b-7218-0410-832d-ea1e28bc413d

--- deal.II/cmake/setup_compiler_flags_intel.cmake
+++ deal.II/cmake/setup_compiler_flags_intel.cmake
@@ -94,6 +94,7 @@
 #   -w1572 floating-point equality and inequality comparisons are unreliable
 #   -w2259 non-pointer conversion from "double" to "float" may
 #          lose significant bits
+#   -w21   type qualifiers are meaningless in this declaration
 #   -w2536 type qualifiers are meaningless here
 #
 ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-wd68")
@@ -109,7 +110,26 @@
 ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-wd1478")
 ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-wd1572")
 ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-wd2259")
+ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-wd21")
 ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-wd2536")
+
+
+# Also disable the following warnings that we frequently
+# trigger writing dimension independent code:
+#   -w111 statement is unreachable
+#         Happens in code that is guarded by a check on 'dim'
+#   -w128 loop is not reachable from preceding
+#         Same as above
+#   -w185 dynamic initialization in unreachable code
+#         When initializing a local variable in code
+#         that is executed only for one specific dimension
+#   -w280 selector expression is constant
+#         When writing 'switch(dim)'
+ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-wd111")
+ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-wd128")
+ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-wd185")
+ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-wd280")
+

 IF(DEAL_II_STATIC_EXECUTABLE)


Propagate CMake visibility variables in external projects.

--- SuperBuild/SuperBuild.cmake
+++ SuperBuild/SuperBuild.cmake
@@ -264,6 +264,10 @@
   CMAKE_JOB_POOLS
   CMAKE_JOB_POOL_LINK
   CMAKE_JOB_POOL_COMPILE
+
+  CMAKE_C_VISIBILITY_PRESET
+  CMAKE_CXX_VISIBILITY_PRESET
+  CMAKE_VISIBILITY_INLINES_HIDDEN

   CMAKE_GENERATOR
   CMAKE_GENERATOR_INSTANCE


ceres-solver: explicitly disable SUITESPARSE and LAPACK

--- cmake/projects/ceres-solver/hunter.cmake
+++ cmake/projects/ceres-solver/hunter.cmake
@@ -32,11 +32,15 @@
     SHA1
     c8a24d83bf4b26b99fd8fc3bed28a267e6247c85
 )
-# explicitly remove dependency on gflags (only needed for tests)
-# also don't build examples: when suitesparse is enabled the examples need Fortran libraries
 hunter_cmake_args(ceres-solver CMAKE_ARGS
+    # explicitly remove dependency on gflags (only needed for tests)
     GFLAGS=OFF
+    # explicitly disable suitesparse support
+    LAPACK=OFF
+    SUITESPARSE=OFF
+    # don't build tests
     BUILD_TESTING=OFF
+    # also don't build examples: when suitesparse is enabled the examples need Fortran libraries
     BUILD_EXAMPLES=OFF
 )


[CMake] [darwin] Removing a line of debug code that I accidentally committed.

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

--- cmake/Modules/CompilerRTDarwinUtils.cmake
+++ cmake/Modules/CompilerRTDarwinUtils.cmake
@@ -198,7 +198,6 @@
   add_dependencies(${LIB_PARENT_TARGET} ${name})
   install(FILES ${LIB_OUTPUT_DIR}/lib${name}.a
     DESTINATION ${LIB_INSTALL_DIR})
-  message("LIB_INSTALL_DIR: ${LIB_INSTALL_DIR}")
 endfunction()

 # Filter out generic versions of routines that are re-implemented in


skip -pedantic if no cxx11

skip -pedantic if no cxx11

--- cmake/checks/check_03_compiler_bugs.cmake
+++ cmake/checks/check_03_compiler_bugs.cmake
@@ -62,6 +62,17 @@

 #
+# Newer gcc versions generate a large number of warnings inside boost if we
+# are compiling without cxx11 but with -pedantic and there is no way to
+# silence them.
+#
+IF(CMAKE_CXX_COMPILER_ID MATCHES "GNU" AND
+   NOT DEAL_II_WITH_CXX11)
+  STRIP_FLAG(DEAL_II_CXX_FLAGS "-pedantic")
+ENDIF()
+
+
+#
 # In some cases, we would like to name partial specializations
 # as friends. However, the standard forbids us to do so. But
 # then, we can declare the general template as a friend, and


Added Github bot support. (2)

Added Github bot support. (2)

--- run_ctest.cmake
+++ run_ctest.cmake
@@ -125,7 +125,7 @@
 elseif(DEFINED ENV{TRAVIS})
     set(CTEST_SITE "Travis CI")
     set(CTEST_SOURCE_DIRECTORY "$ENV{TRAVIS_BUILD_DIR}")
-    if($ENV{TRAVIS_PULL_REQUEST} NOT STREQUAL "false")
+    if($ENV{TRAVIS_PULL_REQUEST})
         set(CTEST_CHANGE_ID "$ENV{TRAVIS_PULL_REQUEST}")
     endif()
 elseif(DEFINED ENV{WERCKER_ROOT})


Update FW: Fix static frame input from host with RGB alignment and stereo

--- cmake/Depthai/DepthaiDeviceSideConfig.cmake
+++ cmake/Depthai/DepthaiDeviceSideConfig.cmake
@@ -2,7 +2,7 @@
 set(DEPTHAI_DEVICE_SIDE_MATURITY "snapshot")

 # "full commit hash of device side binary"
-set(DEPTHAI_DEVICE_SIDE_COMMIT "6821a65c99033d806e42472985c6e66985f05ca9")
+set(DEPTHAI_DEVICE_SIDE_COMMIT "33cc407af320f00d4c0ccc3f49eda8289342105d")

 # "version if applicable"
 set(DEPTHAI_DEVICE_SIDE_VERSION "")


Updated FW

Updated FW

--- cmake/Depthai/DepthaiDeviceSideConfig.cmake
+++ cmake/Depthai/DepthaiDeviceSideConfig.cmake
@@ -2,7 +2,7 @@
 set(DEPTHAI_DEVICE_SIDE_MATURITY "snapshot")

 # "full commit hash of device side binary"
-set(DEPTHAI_DEVICE_SIDE_COMMIT "a680cd835b605e3d384a7b9d9837ff55ff336774")
+set(DEPTHAI_DEVICE_SIDE_COMMIT "5a4001ab6618e113eb14ef5020a4773dce48e981")

 # "version if applicable"
 set(DEPTHAI_DEVICE_SIDE_VERSION "")


Revert "Fail if monalisa is not found and fail-on-missing=ON"

This reverts commit 48aeaef8ce6be145a4ba2d0e41bec264eb22b7b4.

--- cmake/modules/SearchInstalledSoftware.cmake
+++ cmake/modules/SearchInstalledSoftware.cmake
@@ -821,15 +821,11 @@

 #---Monalisa support----------------------------------------------------------------
 if(monalisa)
-  if(fail-on-missing)
-    find_package(Monalisa REQUIRED)
-  else()
-    find_package(Monalisa)
-    if(NOT MONALISA_FOUND)
-      message(STATUS "Monalisa not found. Set variable MONALISA_DIR to point to your Monalisa installation")
-      message(STATUS "For the time being switching OFF 'monalisa' option")
-      set(monalisa OFF CACHE BOOL "" FORCE)
-    endif()
+  find_package(Monalisa)
+  if(NOT MONALISA_FOUND)
+    message(STATUS "Monalisa not found. Set variable MONALISA_DIR to point to your Monalisa installation")
+    message(STATUS "For the time being switching OFF 'monalisa' option")
+    set(monalisa OFF CACHE BOOL "" FORCE)
   endif()
 endif()


Revert "Point to the actual path of libbenchmark."

This reverts commit 25aaac84c07acfbf3db28cb6ba7e8f4ef27e1c84.

--- cmake/modules/SearchInstalledSoftware.cmake
+++ cmake/modules/SearchInstalledSoftware.cmake
@@ -1616,7 +1616,7 @@
                   -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}
     # Disable install step
     INSTALL_COMMAND ""
-    BUILD_BYPRODUCTS "${CMAKE_CURRENT_BINARY_DIR}/googlebenchmark-prefix/src/googlebenchmark-build/src/libbenchmark.a"
+    BUILD_BYPRODUCTS "${CMAKE_CURRENT_BINARY_DIR}/googletest-prefix/src/libbenchmark.a"
     # Wrap download, configure and build steps in a script to log output
     LOG_DOWNLOAD ON
     LOG_CONFIGURE ON


fix iphlpapi when used with visual studio

Note that this works fine when using NMake Makefiles ...
We should probably file a CMake bug report

Change-Id: If50851bfa5d1022419f6a1caebceb75cfccef99b
Reviewed-on: http://gerrit.aldebaran.lan:8080/1723
Reviewed-by: dmerejkowsky <1e4b13000fa8777df4cefd2fd8215187e3deb062@aldebaran-robotics.com>
Tested-by: dmerejkowsky <1e4b13000fa8777df4cefd2fd8215187e3deb062@aldebaran-robotics.com>

--- cmake/qibuild/modules/iphlpapi-config.cmake
+++ cmake/qibuild/modules/iphlpapi-config.cmake
@@ -4,7 +4,16 @@

 clean(IPHLPAPI)
-fpath(IPHLPAPI IPHLpApi.h)
+if(NOT MSVC)
+  fpath(IPHLPAPI IPHLpApi.h)
+else()
+  # For some reason find_path does not work
+  # when using the visual studio generator ...
+  # See: http://www.cmake.org/Bug/view.php?id=13291
+  # So, set the variable to something non-empty so that
+  # export_lib does not complain
+  set(IPHLPAPI_INCLUDE_DIRS "  ")
+endif()
 # Note: find_library(Iphlpapi) won't work because it would
 # return c:\windows\system32\iphlpapi.dll ...
 if(MSCV)


ENH: Update Wiki examples for latest code changes

This synchronization provides the latest wiki examples
in preparation for the ITKv5 transition.

The WikiExamples had many compiler warnings, and many ITKv3
backwards compatibility conditionals.

Change-Id: I2572e20a04d13447a7e6dbf53fd8c3fd51667640

--- Modules/Remote/WikiExamples.remote.cmake
+++ Modules/Remote/WikiExamples.remote.cmake
@@ -5,7 +5,7 @@
 # If the environment var WikiExamplesTag exists, use it
 if (NOT DEFINED ENV{WikiExamplesTag})
   # December 26, 2016
-  set(GIT_TAG 93b266b8b8a1443ed1dfd47b9b427fce4aebf3b0)
+  set(GIT_TAG ef997a295367dbc169118066069748cdf61fdc14)
 else()
   set(GIT_TAG $ENV{WikiExamplesTag})
 endif()


COMP: do not include OpenCVAdapters dir in include dir list unless OTB_USE_OPENCV is TRUE

--- CMake/otbIncludeDirectories.cmake
+++ CMake/otbIncludeDirectories.cmake
@@ -32,7 +32,6 @@
   ${OTB_SOURCE_DIR}/Code/UtilitiesAdapters/OssimAdapters
   ${OTB_SOURCE_DIR}/Code/UtilitiesAdapters/TinyXMLAdapters
   ${OTB_SOURCE_DIR}/Code/UtilitiesAdapters/OGRAdapters
-  ${OTB_SOURCE_DIR}/Code/UtilitiesAdapters/OpenCVAdapters
   ${OTB_SOURCE_DIR}/Code/UtilitiesAdapters/ITKPendingPatches
   ${OTB_SOURCE_DIR}/Code/UtilitiesAdapters
   ${OTB_SOURCE_DIR}/Code/Visu
@@ -49,6 +48,11 @@
   ${OTB_SOURCE_DIR}/Utilities/otbedison/edge
   ${OTB_SOURCE_DIR}/Utilities/otbconfigfile
 )
+
+IF(OTB_USE_OPENCV)
+  SET(OTB_INCLUDE_DIRS_BUILD_TREE ${OTB_INCLUDE_DIRS_BUILD_TREE}
+      ${OTB_SOURCE_DIR}/Code/UtilitiesAdapters/OpenCVAdapters )
+ENDIF()

 IF(OTB_WRAP_QT)
   SET(OTB_INCLUDE_DIRS_BUILD_TREE ${OTB_INCLUDE_DIRS_BUILD_TREE}
@@ -305,6 +309,11 @@
   Utilities/otbconfigfile
 )

+IF(OTB_USE_OPENCV)
+  SET(OTB_INCLUDE_RELATIVE_DIRS ${OTB_INCLUDE_RELATIVE_DIRS}
+      UtilitiesAdapters/OpenCVAdapters )
+ENDIF()
+
 IF(OTB_WRAP_QT)
   SET(OTB_INCLUDE_RELATIVE_DIRS ${OTB_INCLUDE_RELATIVE_DIRS}
     Wrappers


updated models hash

updated models hash

--- CTestConfig.cmake
+++ CTestConfig.cmake
@@ -16,7 +16,7 @@

 set(CTEST_PROJECT_NAME "Embree")
 set(CTEST_NIGHTLY_START_TIME "22:00:00 UTC")
-set(TEST_MODELS_HASH 60d4f3119759f0125c2b2ea2b6a4b8c00ea23fe9)
+set(TEST_MODELS_HASH c5e2111312bf8004ded2d53ab6bd903ad6e76584)

 IF (NOT CTEST_DROP_SITE)
   set(CTEST_DROP_METHOD "http")


set UPDATE_TYPE to silence a warning at configure time

--- CTestConfig.cmake
+++ CTestConfig.cmake
@@ -3,6 +3,7 @@
 SET(CTEST_DROP_LOCATION "/CDash/submit.php?project=VC")
 SET(CTEST_TRIGGER_SITE "fairroot.gsi.de")
 SET(CTEST_NIGHTLY_START_TIME "23:00:00 UTC")
+SET(CTEST_UPDATE_TYPE "git")

 find_program(GITCOMMAND git)
 SET(CTEST_UPDATE_COMMAND "${GITCOMMAND}")


avoid some configure warnings to show up on the dashboard

--- CTestConfig.cmake
+++ CTestConfig.cmake
@@ -17,4 +17,9 @@
 SET (CTEST_DROP_SITE "dbisdart.inf.ethz.ch")
 SET (CTEST_DROP_LOCATION "/cdash/submit.php?project=zorba")
 SET (CTEST_DROP_SITE_CDASH TRUE)
+SET (CTEST_CUSTOM_WARNING_EXCEPTION
+    ${CTEST_CUSTOM_WARNING_EXCEPTION}
+    "Warning: GNU Bison not available.*"
+    "Warning: FlexLexer.h has not been found.*"
+    "Warning: using repository file")
 # SET (CTEST_COMPRESS_SUBMISSION ON)


ENH: Several improvements with the way things are handled. Also, support multiple submited files

--- CTestConfig.cmake
+++ CTestConfig.cmake
@@ -1,2 +1,3 @@
 SET (CTEST_PROJECT_NAME "kwsys")
 SET (CTEST_NIGHTLY_START_TIME "21:00:00 EDT")
+SET (CTEST_DART_SERVER_VERSION "2")


Tweak code coverage exclusion list

Tweak code coverage exclusion list

--- CommonCTest.cmake
+++ CommonCTest.cmake
@@ -16,7 +16,7 @@
       ${LCOV_VERSION})
   endif()
   if( GCC_COMPILER_VERSION VERSION_GREATER 4.6.99 AND
-      LCOV_VERSION VERSION_LESS 1.10 )
+      LCOV_VERSION VERSION_LESS 1.10)
     message(STATUS "Need lcov >= 1.10 for gcc ${GCC_COMPILER_VERSION}, found lcov ${LCOV_VERSION}")
     set(LCOV)
   endif()
@@ -88,7 +88,7 @@
     WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
     DEPENDS runtests)
   add_custom_target(lcov-remove
-    COMMAND ${LCOV} -q --remove lcov.info 'tests/*' '/usr/*' '/opt/*' '*.l' --output-file lcov2.info
+    COMMAND ${LCOV} -q --remove lcov.info 'tests/*' '/usr/*' '/opt/*' '*.l' 'CMake/test/*' '*/install/*' '/Applications/Xcode.app/*' '${CMAKE_BINARY_DIR}/*' --output-file lcov2.info
     COMMENT "Cleaning up code coverage counters"
     WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
     DEPENDS lcov-gather)


Issue #12: According to Qt docs, should not install to subdir called plugins.

--- CMake/mpCreateGuiApplication.cmake
+++ CMake/mpCreateGuiApplication.cmake
@@ -60,15 +60,15 @@
     get_filename_component(_qmake_path "${_qmake_location}" DIRECTORY)
     if(APPLE)
       install(FILES "${_qmake_path}/../plugins/platforms/libqcocoa.dylib"
-              DESTINATION "${APP_NAME}.app/Contents/MacOS/plugins/platforms"
+              DESTINATION "${APP_NAME}.app/Contents/MacOS/platforms"
               CONFIGURATIONS Release)
     elseif(WIN32)
       install(FILES "${_qmake_path}/../plugins/platforms/qwindows.dll"
-              DESTINATION "bin/plugins/platforms"
+              DESTINATION "bin/platforms"
               CONFIGURATIONS Release)
     elseif(UNIX)
       install(FILES "${_qmake_path}/../plugins/platforms/libqxcb.so"
-              DESTINATION "bin/plugins/platforms"
+              DESTINATION "bin/platforms"
               CONFIGURATIONS Release)
     else()
       message(WARNING "Unrecognised platform, so cannot install Qt platforms.")
@@ -77,7 +77,7 @@

   install(CODE "
           file(GLOB_RECURSE QTPLUGINS
-          \"\${CMAKE_INSTALL_PREFIX}/${plugin_dest_dir}/plugins/platforms/*${CMAKE_SHARED_LIBRARY_SUFFIX}\")
+          \"\${CMAKE_INSTALL_PREFIX}/${plugin_dest_dir}/platforms/*${CMAKE_SHARED_LIBRARY_SUFFIX}\")
           file(GLOB_RECURSE QMLPLUGINS
           \"\${CMAKE_INSTALL_PREFIX}/${plugin_dest_dir}/qml/*${CMAKE_SHARED_LIBRARY_SUFFIX}\")
           list(APPEND QTPLUGINS \"\${QMLPLUGINS}\")


Issue #12: Fixup plugin path when doing fixup_bundle.

--- CMake/mpCreateGuiApplication.cmake
+++ CMake/mpCreateGuiApplication.cmake
@@ -77,7 +77,7 @@

   install(CODE "
           file(GLOB_RECURSE QTPLUGINS
-          \"\${CMAKE_INSTALL_PREFIX}/${plugin_dest_dir}/platforms/*${CMAKE_SHARED_LIBRARY_SUFFIX}\")
+          \"\${CMAKE_INSTALL_PREFIX}/${plugin_dest_dir}/plugins/platforms/*${CMAKE_SHARED_LIBRARY_SUFFIX}\")
           file(GLOB_RECURSE QMLPLUGINS
           \"\${CMAKE_INSTALL_PREFIX}/${plugin_dest_dir}/qml/*${CMAKE_SHARED_LIBRARY_SUFFIX}\")
           list(APPEND QTPLUGINS \"\${QMLPLUGINS}\")


more generalisation in common CMake

more generalisation in common CMake

--- CMakeOlxCommon.cmake
+++ CMakeOlxCommon.cmake
@@ -6,12 +6,12 @@
 	cmake_policy(SET CMP0005 OLD)
 	cmake_policy(SET CMP0003 OLD)
 	cmake_policy(SET CMP0011 OLD)
-	include(PCHSupport_26.cmake)
+	include(${OLXROOTDIR}/PCHSupport_26.cmake)
 ENDIF (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.4)

 IF(PCH)
-	EXEC_PROGRAM(./update_precompiled_header.sh OUTPUT_VARIABLE NULL)
-	ADD_PRECOMPILED_HEADER(openlierox include/PrecompiledHeader.hpp 1)
+	EXEC_PROGRAM(./${OLXROOTDIR}/update_precompiled_header.sh OUTPUT_VARIABLE NULL)
+	ADD_PRECOMPILED_HEADER(openlierox ${OLXROOTDIR}/include/PrecompiledHeader.hpp 1)
 ENDIF(PCH)

@@ -85,12 +85,12 @@
 EXEC_PROGRAM(mkdir ARGS -p bin OUTPUT_VARIABLE DUMMY)

 # main includes
-INCLUDE_DIRECTORIES(optional-includes/generated)
-INCLUDE_DIRECTORIES(include)
-INCLUDE_DIRECTORIES(libs/pstreams)
+INCLUDE_DIRECTORIES(${OLXROOTDIR}/optional-includes/generated)
+INCLUDE_DIRECTORIES(${OLXROOTDIR}/include)
+INCLUDE_DIRECTORIES(${OLXROOTDIR}/libs/pstreams)

 IF(ADVASSERT)
-	INCLUDE_DIRECTORIES(optional-includes/advanced-assert)
+	INCLUDE_DIRECTORIES(${OLXROOTDIR}/optional-includes/advanced-assert)
 ENDIF(ADVASSERT)

 # TODO: don't hardcode path here
@@ -108,32 +108,32 @@
 SET(ALL_SRCS ${CLIENT_SRCS} ${CLIENT_SRCS_GUI_OLD} ${CLIENT_SRCS_GUI_NEW} ${COMMON_SRCS} ${SERVER_SRCS})

 IF (GCOREDUMPER)
-	INCLUDE_DIRECTORIES(libs/coredumper/src)
+	INCLUDE_DIRECTORIES(${OLXROOTDIR}/libs/coredumper/src)
 	ADD_DEFINITIONS(-DGCOREDUMPER)
-	AUX_SOURCE_DIRECTORY(libs/coredumper/src COREDUMPER_SRCS)
+	AUX_SOURCE_DIRECTORY(${OLXROOTDIR}/libs/coredumper/src COREDUMPER_SRCS)
 	SET(ALL_SRCS ${ALL_SRCS} ${COREDUMPER_SRCS})
 ENDIF (GCOREDUMPER)

 IF (HAWKNL_BUILTIN)
-	INCLUDE_DIRECTORIES(libs/hawknl/include)
-	SET(ALL_SRCS ${ALL_SRCS} libs/hawknl/src/crc.c)
-	SET(ALL_SRCS ${ALL_SRCS} libs/hawknl/src/errorstr.c)
-	SET(ALL_SRCS ${ALL_SRCS} libs/hawknl/src/nl.c)
-	SET(ALL_SRCS ${ALL_SRCS} libs/hawknl/src/sock.c)
-	SET(ALL_SRCS ${ALL_SRCS} libs/hawknl/src/group.c)
-	SET(ALL_SRCS ${ALL_SRCS} libs/hawknl/src/loopback.c)
-	SET(ALL_SRCS ${ALL_SRCS} libs/hawknl/src/err.c)
-	SET(ALL_SRCS ${ALL_SRCS} libs/hawknl/src/thread.c)
-	SET(ALL_SRCS ${ALL_SRCS} libs/hawknl/src/mutex.c)
-	SET(ALL_SRCS ${ALL_SRCS} libs/hawknl/src/condition.c)
-	SET(ALL_SRCS ${ALL_SRCS} libs/hawknl/src/nltime.c)
+	INCLUDE_DIRECTORIES(${OLXROOTDIR}/libs/hawknl/include)
+	SET(ALL_SRCS ${ALL_SRCS} ${OLXROOTDIR}/libs/hawknl/src/crc.c)
+	SET(ALL_SRCS ${ALL_SRCS} ${OLXROOTDIR}/libs/hawknl/src/errorstr.c)
+	SET(ALL_SRCS ${ALL_SRCS} ${OLXROOTDIR}/libs/hawknl/src/nl.c)
+	SET(ALL_SRCS ${ALL_SRCS} ${OLXROOTDIR}/libs/hawknl/src/sock.c)
+	SET(ALL_SRCS ${ALL_SRCS} ${OLXROOTDIR}/libs/hawknl/src/group.c)
+	SET(ALL_SRCS ${ALL_SRCS} ${OLXROOTDIR}/libs/hawknl/src/loopback.c)
+	SET(ALL_SRCS ${ALL_SRCS} ${OLXROOTDIR}/libs/hawknl/src/err.c)
+	SET(ALL_SRCS ${ALL_SRCS} ${OLXROOTDIR}/libs/hawknl/src/thread.c)
+	SET(ALL_SRCS ${ALL_SRCS} ${OLXROOTDIR}/libs/hawknl/src/mutex.c)
+	SET(ALL_SRCS ${ALL_SRCS} ${OLXROOTDIR}/libs/hawknl/src/condition.c)
+	SET(ALL_SRCS ${ALL_SRCS} ${OLXROOTDIR}/libs/hawknl/src/nltime.c)
 ELSE (HAWKNL_BUILTIN)
 	INCLUDE_DIRECTORIES(/usr/include/hawknl)
 ENDIF (HAWKNL_BUILTIN)

 IF (LIBZIP_BUILTIN)
-	INCLUDE_DIRECTORIES(libs/libzip)
-	AUX_SOURCE_DIRECTORY(libs/libzip LIBZIP_SRCS)
+	INCLUDE_DIRECTORIES(${OLXROOTDIR}/libs/libzip)
+	AUX_SOURCE_DIRECTORY(${OLXROOTDIR}/libs/libzip LIBZIP_SRCS)
 	SET(ALL_SRCS ${ALL_SRCS} ${LIBZIP_SRCS})
 ENDIF (LIBZIP_BUILTIN)

@@ -154,7 +154,7 @@
 ENDIF(DEBUG)

 IF(MEMSTATS)
-	ADD_DEFINITIONS(-include optional-includes/memdebug/memstats.h)
+	ADD_DEFINITIONS(-include ${OLXROOTDIR}/optional-includes/memdebug/memstats.h)
 ENDIF(MEMSTATS)

@@ -167,14 +167,14 @@
 	ELSE(DEBUG)
 		ADD_DEFINITIONS(${OPTIMIZE_COMPILER_FLAG})
 	ENDIF(DEBUG)
-	INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/libs/hawknl/include
-				${CMAKE_SOURCE_DIR}/libs/hawknl/src
-				${CMAKE_SOURCE_DIR}/libs/libzip
-				${CMAKE_SOURCE_DIR}/libs/boost_process)
+	INCLUDE_DIRECTORIES(${OLXROOTDIR}//libs/hawknl/include
+				${OLXROOTDIR}/libs/hawknl/src
+				${OLXROOTDIR}/libs/libzip
+				${OLXROOTDIR}/libs/boost_process)
 ELSE(WIN32)
 	ADD_DEFINITIONS(-Wall)

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

@@ -189,7 +189,7 @@

 IF(OPTIM_PROJECTILES)
 	#Always optimize these files - they make debug build unusable otherwise
-	SET_SOURCE_FILES_PROPERTIES(	src/common/PhysicsLX56_Projectiles.cpp
+	SET_SOURCE_FILES_PROPERTIES(	${OLXROOTDIR}/src/common/PhysicsLX56_Projectiles.cpp
 						PROPERTIES COMPILE_FLAGS ${OPTIMIZE_COMPILER_FLAG})
 ENDIF(OPTIM_PROJECTILES)

@@ -220,12 +220,12 @@

 IF(WIN32)
 	SET(LIBS ${LIBS} SDL_mixer wsock32 wininet dbghelp
-				"${CMAKE_SOURCE_DIR}/build/msvc/libs/SDLmain.lib"
-				"${CMAKE_SOURCE_DIR}/build/msvc/libs/libxml2.lib"
-				"${CMAKE_SOURCE_DIR}/build/msvc/libs/NLstatic.lib"
-				"${CMAKE_SOURCE_DIR}/build/msvc/libs/libzip.lib"
-				"${CMAKE_SOURCE_DIR}/build/msvc/libs/zlib.lib"
-				"${CMAKE_SOURCE_DIR}/build/msvc/libs/bgd.lib")
+				"${OLXROOTDIR}/build/msvc/libs/SDLmain.lib"
+				"${OLXROOTDIR}/build/msvc/libs/libxml2.lib"
+				"${OLXROOTDIR}/build/msvc/libs/NLstatic.lib"
+				"${OLXROOTDIR}/build/msvc/libs/libzip.lib"
+				"${OLXROOTDIR}/build/msvc/libs/zlib.lib"
+				"${OLXROOTDIR}/build/msvc/libs/bgd.lib")
 ELSE(WIN32)
 	EXEC_PROGRAM(sdl-config ARGS --libs OUTPUT_VARIABLE SDLLIBS)
 	STRING(REGEX REPLACE "[\r\n]" " " SDLLIBS "${SDLLIBS}")


Fix variable name of executable target

Fix variable name of executable target

--- CMake/mitkInstallRules.cmake
+++ CMake/mitkInstallRules.cmake
@@ -52,7 +52,7 @@
   foreach(_mitk_executable_target ${_mitk_executable_targets})
     MITK_INSTALL_TARGETS(EXECUTABLES ${_mitk_executable_target} GLOB_PLUGINS)
     if(UNIX AND NOT APPLE)
-      install(PROGRAMS "${MITK_SOURCE_DIR}/CMake/RunInstalledApp.sh" DESTINATION "." RENAME ${EXECUTABLE_TARGET}.sh)
+      install(PROGRAMS "${MITK_SOURCE_DIR}/CMake/RunInstalledApp.sh" DESTINATION "." RENAME ${_mitk_executable_target}.sh)
     endif()
   endforeach()
 endif()


Separate Qt platform and style plugin install rules

--- CMake/mitkInstallRules.cmake
+++ CMake/mitkInstallRules.cmake
@@ -37,16 +37,22 @@

   if(WIN32)
     MITK_INSTALL(FILES "${_qmake_path}/../plugins/platforms/qwindows.dll")
-    MITK_INSTALL(FILES "${_qmake_path}/../plugins/styles/qwindowsvistastyle.dll")
   elseif(APPLE)
     MITK_INSTALL(FILES "${_qmake_path}/../plugins/platforms/libqcocoa.dylib")
-
-    set(_install_DESTINATION "plugins/styles")
-    MITK_INSTALL(FILES "${_qmake_path}/../plugins/styles/libqmacstyle.dylib")
   elseif(UNIX)
     MITK_INSTALL(FILES
       "${_qmake_path}/../plugins/platforms/libqxcb.so"
       "${_qmake_path}/../plugins/xcbglintegrations/libqxcb-glx-integration.so")
+  endif()
+
+  # Install platform-specific Qt styles
+
+  set(_install_DESTINATION "plugins/styles")
+
+  if(WIN32)
+    MITK_INSTALL(FILES "${_qmake_path}/../plugins/styles/qwindowsvistastyle.dll")
+  elseif(APPLE)
+    MITK_INSTALL(FILES "${_qmake_path}/../plugins/styles/libqmacstyle.dylib")
   endif()

   # Install Qt WebEngine


fix typo

fix typo

--- CMakeModules/Findflann.cmake
+++ CMakeModules/Findflann.cmake
@@ -6,7 +6,7 @@
 if (FLANN_INCLUDE_DIRS)
     file(READ "${FLANN_INCLUDE_DIRS}/config.h" FLANN_CONFIG)
     string(REGEX REPLACE ".*FLANN_VERSION_ \"([0-9.]+)\".*" "\\1" FLANN_VERSION ${FLANN_CONFIG})
-    if(FLANN_VESION VERSION_LESS flann_FIND_VERSION)
+    if(FLANN_VERSION VERSION_LESS flann_FIND_VERSION)
         unset(FLANN_INCLUDE_DIRS)
     else()
         string(REGEX REPLACE "/flann$" "" FLANN_INCLUDE_DIRS ${FLANN_INCLUDE_DIRS})


Remove debug message

Remove debug message

--- Modules/ManageReleaseFedora.cmake
+++ Modules/ManageReleaseFedora.cmake
@@ -123,7 +123,6 @@
     )

 MACRO(RELEASE_FEDORA_FIND_FILE_DEPENDENCY var name)
-    MESSAGE("ARGN=${ARGN}")
     FIND_FILE_ERROR_HANDLING(${var}
 	ERROR_MSG "${name} not found, Fedora release support disabled."
 	ERROR_VAR _manage_release_fedora_dependencies_missing


ENH: compile and install otb_loader tool in packages

--- SuperBuild/Packaging/PackageHelper.cmake
+++ SuperBuild/Packaging/PackageHelper.cmake
@@ -199,9 +199,7 @@
     if(LINUX)
       list(APPEND program_list "${PATCHELF_PROGRAM}")
     endif()
-
-  endif()
-
+  endif()

   foreach(prog ${program_list})
     install(
@@ -209,6 +207,11 @@
       DESTINATION ${PKG_STAGE_DIR})
   endforeach()

+  ############# otb_loader executable ################
+  add_executable(otb_loader ${PACKAGE_SUPPORT_FILES_DIR}/otb_loader.cxx)
+  target_link_libraries(otb_loader ${CMAKE_DL_LIBS})
+  install(TARGETS otb_loader
+          RUNTIME DESTINATION ${PKG_STAGE_DIR}/bin COMPONENT Runtime)

   # We need qt.conf on windows. for macx and linux we write it
   # after extracting package


Avoid duplicate entries in the BlueBerry provisioning file.

--- BlueBerry/CMake/FunctionCreateProvisioningFile.cmake
+++ BlueBerry/CMake/FunctionCreateProvisioningFile.cmake
@@ -90,6 +90,10 @@
   else()
     # Fill the _plugin_list variable with external and internal plug-in target names.
     ctkFunctionGetAllPluginTargets(_plugin_list)
+  endif()
+
+  if(_plugin_list)
+    list(REMOVE_DUPLICATES _plugin_list)
   endif()

   set(_exclude_targets )


Explicitly specify feature test macro for glibc earlier than 2.19

--- src/Native/Runtime/unix/configure.cmake
+++ src/Native/Runtime/unix/configure.cmake
@@ -10,7 +10,7 @@
 if(CMAKE_SYSTEM_NAME STREQUAL FreeBSD)
   set(CMAKE_REQUIRED_INCLUDES /usr/local/include)
 elseif(NOT CMAKE_SYSTEM_NAME STREQUAL Darwin)
-  set(CMAKE_REQUIRED_DEFINITIONS "-D_DEFAULT_SOURCE -D_POSIX_C_SOURCE=200809L")
+  set(CMAKE_REQUIRED_DEFINITIONS "-D_BSD_SOURCE -D_SVID_SOURCE -D_DEFAULT_SOURCE -D_POSIX_C_SOURCE=200809L")
 endif()

 list(APPEND CMAKE_REQUIRED_DEFINITIONS -D_FILE_OFFSET_BITS=64)


Remove reference to old client target from TensileCreateLibraryFiles cmake function intended for new client only (#1106)

--- Tensile/cmake/TensileConfig.cmake
+++ Tensile/cmake/TensileConfig.cmake
@@ -143,7 +143,6 @@
   if(Tensile_LIBRARY_FORMAT)
     set(Options ${Options} "--library-format=${Tensile_LIBRARY_FORMAT}")
     if(Tensile_LIBRARY_FORMAT MATCHES "yaml")
-        target_compile_definitions( Tensile PUBLIC -DTENSILE_YAML=1)
         target_compile_definitions( TensileHost PUBLIC -DTENSILE_YAML=1)
     endif()
   endif()


deprecate Property component

deprecate Property component

largely unused and not really related to Ogre

--- CMake/FeatureSummary.cmake
+++ CMake/FeatureSummary.cmake
@@ -31,7 +31,7 @@
 	set(_components "${_components}  + Paging\n")
 endif ()
 if (OGRE_BUILD_COMPONENT_PROPERTY)
-	set(_components "${_components}  + Property\n")
+	set(_components "${_components}  + Property [DEPRECATED]\n")
 endif ()
 if (OGRE_BUILD_COMPONENT_PYTHON)
 	set(_components "${_components}  + Python [BETA]\n")


Split off 8.0.34

Split off 8.0.34

Signed-off-by: Richard Chapman <5900d56196fe29dba8e3ae556d57eae28e9f0195@hpccsystems.com>

--- version.cmake
+++ version.cmake
@@ -5,7 +5,7 @@
 set ( HPCC_PROJECT "nagios-monitoring" )
 set ( HPCC_MAJOR 8 )
 set ( HPCC_MINOR 0 )
-set ( HPCC_POINT 33 )
+set ( HPCC_POINT 35 )
 set ( HPCC_MATURITY "closedown" )
 set ( HPCC_SEQUENCE 0 )
 ###


Removed IGT and ToF examples and tutorials

--- CMake/BuildConfigurations/mitkNavigationModules.cmake
+++ CMake/BuildConfigurations/mitkNavigationModules.cmake
@@ -27,12 +27,9 @@
   org.mitk.gui.qt.remeshing
   org.mitk.gui.qt.viewnavigator
   org.mitk.gui.qt.imagecropper
-  org.mitk.gui.qt.igtexamples
   org.mitk.gui.qt.igttracking
-  org.mitk.gui.qt.igtlplugin
   org.mitk.gui.qt.openigtlink
   org.mitk.gui.qt.ultrasound
-  org.mitk.gui.qt.toftutorial
   org.mitk.gui.qt.tofutil
 )


cmake: address uncaught exception support in catch when targetting older mac os versions

--- test/min-lib-unittest.cmake
+++ test/min-lib-unittest.cmake
@@ -34,7 +34,8 @@

 if (APPLE)
 	set_target_properties(${PROJECT_NAME} PROPERTIES LINK_FLAGS "-Wl,-F'${C74_MAX_API_DIR}/lib/mac', -weak_framework JitterAPI")
-
+    target_compile_options(${PROJECT_NAME} PRIVATE -DCATCH_CONFIG_NO_CPP17_UNCAUGHT_EXCEPTIONS)
+
     # The build dir won't be present the first time the test is compiled.
     # This isn't a problem but it does generate linker warnings about the folder not existing.
     # So we create the folder in advance.


Update samp-server-cli filename in AddSAMPPlugin

--- cmake/AddSAMPPluginTest.cmake
+++ cmake/AddSAMPPluginTest.cmake
@@ -29,7 +29,7 @@
   endif()

   if(WIN32)
-    set(command samp-server-cli.bat)
+    set(command samp-server-cli.exe)
   else()
     set(command samp-server-cli)
   endif()


FIX: cygwin patch for zlib added

FIX: cygwin patch for zlib added

see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79771

--- cmake/dependencies/zlib.cmake
+++ cmake/dependencies/zlib.cmake
@@ -27,13 +27,20 @@
 		find_package(ZLIB REQUIRED)

 	else()
-
+		if(CYGWIN)
+			sources_url(ZLIB_GZOPEN_W_PATCH
+				"zlib.net/zlib/1.2.11-gzopen_w.patch"
+				"https://github.com/cygwinports/zlib/blob/master/1.2.11-gzopen_w.patch")
+			file(DOWNLOAD ${ZLIB_GZOPEN_W_PATCH_URL} "${STAGING_DIR}/1.2.11-gzopen_w.patch")
+			set(EXTRA_PATCH patch -p2 -i "${STAGING_DIR}/1.2.11-gzopen_w.patch")
+		endif()
 		sources_url(ZLIB
 			"zlib.net/zlib/zlib-1.2.11.tar.gz"
 			"http://zlib.net/zlib-1.2.11.tar.gz")
 		ExternalProject_Add(dependencies_zlib
 			URL ${ZLIB_URL}
 			URL_HASH SHA256=c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1
+			PATCH_COMMAND ${EXTRA_PATCH}
 			CONFIGURE_COMMAND ./configure --prefix=<INSTALL_DIR> --static
 			INSTALL_DIR "${STAGING_DIR}"
 			BUILD_IN_SOURCE 1


cmake/modules/FindVIGRA.cmake: Removed search for site-packages from VIGRA.

--- cmake/modules/FindVIGRA.cmake
+++ cmake/modules/FindVIGRA.cmake
@@ -27,7 +27,6 @@

-EXECUTE_PROCESS ( COMMAND python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()" OUTPUT_VARIABLE PYTHON_SITE_PACKAGES OUTPUT_STRIP_TRAILING_WHITESPACE)

 # handle the QUIETLY and REQUIRED arguments and set VIGRA_FOUND to TRUE if
 # all listed variables are TRUE


RT kernel support for ChibiOS.

RT kernel support for ChibiOS.

--- cmake/Modules/ChibiOS3.cmake
+++ cmake/Modules/ChibiOS3.cmake
@@ -1,10 +1,12 @@
 IF(NOT ChibiOS_FIND_COMPONENTS)
-    SET(ChibiOS_FIND_COMPONENTS nil)
+    SET(ChibiOS_FIND_COMPONENTS nil hal st)
     MESSAGE(STATUS "No ChibiOS components specified, using default: ${ChibiOS_FIND_COMPONENTS}")
 ENDIF()

 LIST(FIND ChibiOS_FIND_COMPONENTS nil ChibiOS_FIND_COMPONENTS_nil)
 LIST(FIND ChibiOS_FIND_COMPONENTS rt ChibiOS_FIND_COMPONENTS_rt)
+LIST(FIND ChibiOS_FIND_COMPONENTS hal ChibiOS_FIND_COMPONENTS_hal)
+LIST(FIND ChibiOS_FIND_COMPONENTS st ChibiOS_FIND_COMPONENTS_st)

 IF((${ChibiOS_FIND_COMPONENTS_nil} LESS 0) AND (${ChibiOS_FIND_COMPONENTS_rt} LESS 0))
   MESSAGE(STATUS "No kernel component selected, using Nil kernel")
@@ -21,6 +23,14 @@
   ENDIF()
 ENDIF()

+IF(${ChibiOS_FIND_COMPONENTS_hal} LESS 0)
+  LIST(APPEND ChibiOS_FIND_COMPONENTS hal)
+ENDIF()
+
+IF(${ChibiOS_FIND_COMPONENTS_st} LESS 0)
+  LIST(APPEND ChibiOS_FIND_COMPONENTS st)
+ENDIF()
+
 INCLUDE(ChibiOS3_LD)
 INCLUDE(ChibiOS3_HAL)

@@ -28,8 +38,6 @@
   INCLUDE(ChibiOS3_RT)
 ELSE()
   INCLUDE(ChibiOS3_NIL)
-  # Ugly, but requred
-  LIST(APPEND ChibiOS_FIND_COMPONENTS hal st)
 ENDIF()

 SET(CHIBIOS_COMPONENTS nil rt hal ${CHIBIOS_HAL_MODULES})


Look for NCCL in CUDA_TOOLKIT_ROOT_DIR

Look for NCCL in CUDA_TOOLKIT_ROOT_DIR

Summary: Closes https://github.com/caffe2/caffe2/pull/1611

Reviewed By: dzhulgakov

Differential Revision: D6550168

Pulled By: pietern

fbshipit-source-id: e034ce4057d37bfc8b53949c56cbcb701ea5d958

--- cmake/Modules/FindNCCL.cmake
+++ cmake/Modules/FindNCCL.cmake
@@ -9,6 +9,10 @@
 #  NCCL_FOUND
 #  NCCL_INCLUDE_DIRS
 #  NCCL_LIBRARIES
+#
+# The path hints include CUDA_TOOLKIT_ROOT_DIR seeing as some folks
+# install NCCL in the same location as the CUDA toolkit.
+# See https://github.com/caffe2/caffe2/issues/1601

 set(NCCL_ROOT_DIR "" CACHE PATH "Folder contains NVIDIA NCCL")

@@ -17,7 +21,8 @@
   HINTS
   ${NCCL_INCLUDE_DIR}
   ${NCCL_ROOT_DIR}
-  ${NCCL_ROOT_DIR}/include)
+  ${NCCL_ROOT_DIR}/include
+  ${CUDA_TOOLKIT_ROOT_DIR}/include)

 find_library(NCCL_LIBRARIES
   NAMES nccl
@@ -26,7 +31,8 @@
   ${NCCL_ROOT_DIR}
   ${NCCL_ROOT_DIR}/lib
   ${NCCL_ROOT_DIR}/lib/x86_64-linux-gnu
-  ${NCCL_ROOT_DIR}/lib64)
+  ${NCCL_ROOT_DIR}/lib64
+  ${CUDA_TOOLKIT_ROOT_DIR}/lib64)

 include(FindPackageHandleStandardArgs)
 find_package_handle_standard_args(NCCL DEFAULT_MSG NCCL_INCLUDE_DIRS NCCL_LIBRARIES)


Added "include" and "lib" directories to the find_path and find_library commands; Without these, CMake was not finding the WinPCAP include and library directories.

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

--- cmake/Modules/FindPcap.cmake
+++ cmake/Modules/FindPcap.cmake
@@ -1,6 +1,7 @@
 ###################################################################
 #
 # Copyright (c) 2006 Frederic Heem, <frederic.heem@telsey.it>
+# Copyright (c) 2012 Keven Ring
 # All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
@@ -40,9 +41,13 @@
 # The environment variable PCAPDIR allows to specficy where to find
 # libpcap in non standard location.
 #
+# 2012/01/02 - KEVEN RING
+#              Modified to find include/libs for WinPCAP
+#
 # PCAP_INCLUDE_DIRS - where to find pcap.h, etc.
 # PCAP_LIBRARIES - List of libraries when using pcap.
 # PCAP_FOUND - True if pcap found.
+
 if(WIN32)
   set(_PCAP_LIBRARY_NAME wpcap)
 else(WIN32)
@@ -56,6 +61,8 @@
 pcap.h
 PATHS
 $ENV{PCAPDIR}
+PATHS
+$ENV{PCAPDIR}/include
 NO_DEFAULT_PATH
 )

@@ -64,9 +71,10 @@
 ${_PCAP_LIBRARY_NAME}
 PATHS
 $ENV{PCAPDIR}
+PATHS
+$ENV{PCAPDIR}/lib
 NO_DEFAULT_PATH
 )
-

 ELSE(EXISTS $ENV{PCAPDIR})
 FIND_PATH(PCAP_INCLUDE_DIR


Fixed issue #54, as of Arduino version 1.0.1 USB VID and PID options have appeared and are needed by Leonardo board

--- cmake/Platform/Arduino.cmake
+++ cmake/Platform/Arduino.cmake
@@ -523,8 +523,14 @@

         # output
         set(COMPILE_FLAGS "-DF_CPU=${${BOARD_ID}.build.f_cpu} -DARDUINO=${ARDUINO_VERSION_DEFINE} -mmcu=${${BOARD_ID}.build.mcu}")
+        if(DEFINED ${BOARD_ID}.build.vid)
+            set(COMPILE_FLAGS "${COMPILE_FLAGS} -DUSB_VID=${${BOARD_ID}.build.vid}")
+        endif()
+        if(DEFINED ${BOARD_ID}.build.pid)
+            set(COMPILE_FLAGS "${COMPILE_FLAGS} -DUSB_PID=${${BOARD_ID}.build.pid}")
+        endif()
         if(NOT MANUAL)
-          set(COMPILE_FLAGS "${COMPILE_FLAGS} -I\"${ARDUINO_CORES_PATH}/${BOARD_CORE}\" -I\"${ARDUINO_LIBRARIES_PATH}\"")
+            set(COMPILE_FLAGS "${COMPILE_FLAGS} -I\"${ARDUINO_CORES_PATH}/${BOARD_CORE}\" -I\"${ARDUINO_LIBRARIES_PATH}\"")
         endif()
         set(LINK_FLAGS "-mmcu=${${BOARD_ID}.build.mcu}")
         if(ARDUINO_SDK_VERSION VERSION_GREATER 1.0 OR ARDUINO_SDK_VERSION VERSION_EQUAL 1.0)


[cmake] this is amend actually — there was a typo in last commit

--- cmake/axl_std_settings.cmake
+++ cmake/axl_std_settings.cmake
@@ -269,7 +269,7 @@
 		if (CMAKE_GENERATOR MATCHES "Xcode")
 			# Xcode fires unresolved externals otherwise
 			set (CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} ${GCC_SANITIZER}")
-			set (CMAKE_SHARED_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} ${GCC_SANITIZER}")
+			set (CMAKE_SHARED_LINKER_FLAGS_DEBUG "${CMAKE_SHARED_LINKER_FLAGS_DEBUG} ${GCC_SANITIZER}")
 		endif ()

 		set (CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} ${GCC_SANITIZER}")


build: only use gold on ELF targets

build: only use gold on ELF targets

gold only supports ELF.  This adds two new helper functions
(is_windows_based_sdk and is_elfish_sdk) to ensure that we dont try to use gold
on non-ELF targets.  This comes up when trying to setup cross-compilation for
the standard library for Windows.

The ELF check is implemented as the negation of Darwin (which uses MachO) and
Windows (which uses COFF).  The reason for this is that there are additional
targets which also use ELF.  Rather than enumerating the larger set, enumerate
the smaller set (windows) and use the negation.

--- cmake/modules/AddSwift.cmake
+++ cmake/modules/AddSwift.cmake
@@ -73,6 +73,25 @@
     set(${out_var} TRUE PARENT_SCOPE)
   else()
     set(${out_var} FALSE PARENT_SCOPE)
+  endif()
+endfunction()
+
+function(is_windows_based_sdk sdk_name out_var)
+  if("${sdk_name}" STREQUAL "WINDOWS" OR
+     "${sdk_name}" STREQUAL "CYGWIN")
+   set(${out_var} TRUE PARENT_SCOPE)
+ else()
+   set(${out_var} FALSE PARENT_SCOPE)
+ endif()
+endfunction()
+
+function(is_elfish_sdk sdk_name out_var)
+  is_darwin_based_sdk("${sdk_name}" IS_DARWIN)
+  is_windows_based_sdk("${sdk_name}" IS_WINDOWS)
+  if(IS_DARWIN OR IS_WINDOWS)
+    set(${out_var} FALSE PARENT_SCOPE)
+  else()
+    set(${out_var} TRUE PARENT_SCOPE)
   endif()
 endfunction()

@@ -871,7 +890,8 @@
     RESULT_VAR_NAME link_flags
       )

-  if(SWIFT_ENABLE_GOLD_LINKER)
+  is_elfish_sdk("${SWIFTLIB_SINGLE_SDK}" IS_ELFISH)
+  if(SWIFT_ENABLE_GOLD_LINKER AND IS_ELFISH)
     list(APPEND link_flags "-fuse-ld=gold")
   endif()

@@ -1512,9 +1532,8 @@
         "-Xlinker" "@executable_path/../lib/swift/${SWIFT_SDK_${SWIFTEXE_SINGLE_SDK}_LIB_SUBDIR}")
   endif()

-  if(SWIFT_ENABLE_GOLD_LINKER AND
-     ( "${SWIFTEXE_SINGLE_SDK}" STREQUAL "LINUX" ) )
-    # Extend the link_flags for the gold linker.
+  is_elfish_sdk("${SWIFTLIB_SINGLE_SDK}" IS_ELFISH)
+  if(SWIFT_ENABLE_GOLD_LINKER AND IS_ELFISH)
     list(APPEND link_flags "-fuse-ld=gold")
   endif()


Don't attempt to set a custom linker when building with MSVC/clang-cl on Windows

--- cmake/modules/AddSwift.cmake
+++ cmake/modules/AddSwift.cmake
@@ -354,15 +354,17 @@
   if(NOT "${SWIFT_${LFLAGS_SDK}_ICU_I18N}" STREQUAL "")
     list(APPEND library_search_directories "${SWIFT_${sdk}_ICU_I18N}")
   endif()
-
-  if(SWIFT_ENABLE_GOLD_LINKER AND
-     "${SWIFT_SDK_${LFLAGS_SDK}_OBJECT_FORMAT}" STREQUAL "ELF")
-    list(APPEND result "-fuse-ld=gold")
-  endif()
-  if(SWIFT_ENABLE_LLD_LINKER OR
-     ("${LFLAGS_SDK}" STREQUAL "WINDOWS" AND
-      NOT "${CMAKE_SYSTEM_NAME}" STREQUAL "WINDOWS"))
-    list(APPEND result "-fuse-ld=lld")
+
+  if(NOT SWIFT_COMPILER_IS_MSVC_LIKE)
+    if(SWIFT_ENABLE_GOLD_LINKER AND
+       "${SWIFT_SDK_${LFLAGS_SDK}_OBJECT_FORMAT}" STREQUAL "ELF")
+      list(APPEND result "-fuse-ld=gold")
+    endif()
+    if(SWIFT_ENABLE_LLD_LINKER OR
+       ("${LFLAGS_SDK}" STREQUAL "WINDOWS" AND
+        NOT "${CMAKE_SYSTEM_NAME}" STREQUAL "WINDOWS"))
+      list(APPEND result "-fuse-ld=lld")
+    endif()
   endif()

   set("${LFLAGS_RESULT_VAR_NAME}" "${result}" PARENT_SCOPE)


build: emulate /GR- when compiling for Windows

The /GR- emulation is needed to support building on Windows.
std::function in Microsoft's C++ runtime requires the use of `typeid`.
We do not want to emit RTTI data.  `-frtti -fno-rtti-data` allows the
use of the `typeid` and `dynamic_cast` behaviours but will not emit the
RTTI data.  With this change, it is possible to build the Windows
runtime once again.

--- cmake/modules/AddSwift.cmake
+++ cmake/modules/AddSwift.cmake
@@ -248,6 +248,13 @@
     list(APPEND result "-D_DLL")
     # NOTE: We assume that we are using VS 2015 U2+
     list(APPEND result "-D_ENABLE_ATOMIC_ALIGNMENT_FIX")
+
+    # msvcprt's std::function requires RTTI, but we do not want RTTI data.
+    # Emulate /GR-
+    if(NOT SWIFT_COMPILER_IS_MSVC_LIKE)
+      list(APPEND result -frtti)
+      list(APPEND result -Xclang;-fno-rtti-data)
+    endif()
   endif()

   if(CFLAGS_ENABLE_ASSERTIONS)


Fix build warings in linux Fedora 17

Fix build warings in linux Fedora 17

git-svn-id: 8b72b58fb31a931b6e9a2bd3bb08bc6614045fb1@3465 c330d7e9-fc0c-0410-a5b3-fd85c6f5aa8f

--- cmake-modules/FindThirdPartyPython.cmake
+++ cmake-modules/FindThirdPartyPython.cmake
@@ -33,18 +33,18 @@
 	IF(PYTHONLIBS_FOUND)
 		MESSAGE(STATUS "  Found Python...")
 		INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_PATH})
-
-		FOREACH(PYTHON_LIB ${PYTHON_LIBRARIES})
-			SET(PYTHON_LIB1 "PYTHON_LIB1-NOTFOUND")
-			FIND_LIBRARY(PYTHON_LIB1 NAMES ${PYTHON_LIB} PATHS NO_DEFAULT_PATH)
-			FIND_LIBRARY(PYTHON_LIB1 NAMES ${PYTHON_LIB} PATHS "/")
-			IF(PYTHON_LIB1)
-				MESSAGE(STATUS "    [  OK  ] Third party lib ${PYTHON_LIB1}")
-				TARGET_LINK_LIBRARIES(${PROJECT_NAME}-dynamic ${PYTHON_LIB1})
-			ELSE(PYTHON_LIB1)
-				MESSAGE(STATUS "    [FAILED] Third party lib ${PYTHON_LIB}")
-			ENDIF(PYTHON_LIB1)
-		ENDFOREACH(PYTHON_LIB)
+		TARGET_LINK_LIBRARIES(${PROJECT_NAME}-dynamic ${PYTHON_LIBRARIES})
+#		FOREACH(PYTHON_LIB ${PYTHON_LIBRARIES})
+#			SET(PYTHON_LIB1 "PYTHON_LIB1-NOTFOUND")
+#			FIND_LIBRARY(PYTHON_LIB1 NAMES ${PYTHON_LIB} PATHS NO_DEFAULT_PATH)
+#			FIND_LIBRARY(PYTHON_LIB1 NAMES ${PYTHON_LIB} PATHS "/")
+#			IF(PYTHON_LIB1)
+#				MESSAGE(STATUS "    [  OK  ] Third party lib ${PYTHON_LIB1}")
+#				TARGET_LINK_LIBRARIES(${PROJECT_NAME}-dynamic ${PYTHON_LIB1})
+#			ELSE(PYTHON_LIB1)
+#				MESSAGE(STATUS "    [FAILED] Third party lib ${PYTHON_LIB}")
+#			ENDIF(PYTHON_LIB1)
+#		ENDFOREACH(PYTHON_LIB)

 		ADD_DEFINITIONS(-DTARGET_HAS_ThirdPartyPython)
 	ELSE(PYTHONLIBS_FOUND)


Fix for cmake, which didn't add the C++ compiler flags.

--- cmake/Modules/CppUTestWarningFlags.cmake
+++ cmake/Modules/CppUTestWarningFlags.cmake
@@ -16,10 +16,10 @@

     macro(check_and_append_cxx_warning_flags)
       foreach (flag ${ARGN})
-        check_cxx_compiler_flag("-${flag}" WARNING_CXX_FLAG_TO_CHECK)
-        if (WARNING_CXX_FLAG_TO_CHECK)
+        check_cxx_compiler_flag("-${flag}" WARNING_CXX_FLAG_${flag})
+        if (WARNING_CXX_FLAG_${flag})
             set(CPPUTEST_CXX_WARNING_FLAGS "${CPPUTEST_CXX_WARNING_FLAGS} -${flag}")
-          endif (WARNING_CXX_FLAG_TO_CHECK)
+          endif (WARNING_CXX_FLAG_${flag})
       endforeach (flag)
     endmacro(check_and_append_cxx_warning_flags)


ceres: remove explicit CMAKE_BUILD_TYPE

ceres: remove explicit CMAKE_BUILD_TYPE

--- cmake/projects/ceres-solver/hunter.cmake
+++ cmake/projects/ceres-solver/hunter.cmake
@@ -24,7 +24,6 @@
 hunter_cmake_args(ceres-solver CMAKE_ARGS
     GFLAGS=OFF
     BUILD_TESTING=OFF
-    CMAKE_BUILD_TYPE=Release
 )

 # Pick a download scheme


#7 Begin experimental support to look for libass dependencies on Windows

--- cmake/Modules/FindASS.cmake
+++ cmake/Modules/FindASS.cmake
@@ -49,6 +49,16 @@
 set(LIBASS_LIBRARIES ${LIBASS_LIBRARY} )
 set(LIBASS_INCLUDE_DIRS ${LIBASS_INCLUDE_DIR} )

+# On Windows we assume that only static version of libass is used (this is the default build type)
+# so we also link against its dependencies (libass does not provide any Find*.cmake script to simplify this aspect)
+if (${CMAKE_HOST_WIN32})
+  find_package(Freetype REQUIRED)
+  find_package(fribidi REQUIRED)
+  find_package(harfbuzz REQUIRED)
+
+  set(LIBASS_LIBRARIES ${LIBASS_LIBRARIES} ${FREETYPE_LIBRARIES} ${FRIBIDI_LIBRARIES} ${HARFBUZZ_LIBRARIES})
+endif()
+
 # handle the QUIETLY and REQUIRED arguments and set CURL_FOUND to TRUE if
 # all listed variables are TRUE
 find_package_handle_standard_args(ASS "Could not find libass. Make sure it is installed or define LIBASS_ROOT if it is located in a custom path"


Remove useless CPACK_*_COMPONENT_INSTALL variables

They don't actually do anything. And even if they did, all components are
enabled by default, anyway.

(cherry picked from commit 49fe496914cca93f19dd61aa7b1c120037d65282)

Conflicts:
	cmake/OpenCVPackaging.cmake

--- cmake/OpenCVPackaging.cmake
+++ cmake/OpenCVPackaging.cmake
@@ -96,15 +96,6 @@
   set(CPACK_COMPONENT_tests_DESCRIPTION "Accuracy and performance tests for Open Source Computer Vision Library")
 endif(NOT OPENCV_CUSTOM_PACKAGE_INFO)

-if(NOT OPENCV_CUSTOM_PACKAGE_LAYOUT)
-  set(CPACK_libs_COMPONENT_INSTALL TRUE)
-  set(CPACK_dev_COMPONENT_INSTALL TRUE)
-  set(CPACK_docs_COMPONENT_INSTALL TRUE)
-  set(CPACK_python_COMPONENT_INSTALL TRUE)
-  set(CPACK_java_COMPONENT_INSTALL TRUE)
-  set(CPACK_samples_COMPONENT_INSTALL TRUE)
-endif(NOT OPENCV_CUSTOM_PACKAGE_LAYOUT)
-
 include(CPack)

 ENDif(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")


Add support for linux/gcc/x64_32 archs

Add support for linux/gcc/x64_32 archs

--- cmake/PeacockPlatform.cmake
+++ cmake/PeacockPlatform.cmake
@@ -129,7 +129,13 @@

     if(target_architecture STREQUAL "x86_32")
         if(target_system_name STREQUAL "linux")
-            message(FATAL_ERROR "Add configure host")
+            if(peacock_compiler_id STREQUAL "gcc")
+                set(peacock_gnu_configure_host "x86_32-unknown-linux")
+            elseif(peacock_compiler_id STREQUAL "clang")
+                set(peacock_gnu_configure_host "x86_32-unknown-linux")
+            else()
+                message(FATAL_ERROR "Add GNU configure host")
+            endif()
         elseif(target_system_name STREQUAL "windows")
             if(peacock_compiler_id STREQUAL "mingw")
                 set(peacock_gnu_configure_host "i686-w64-mingw32")


Default zeromq version updated

Default zeromq version updated

--- cmake/configs/default.cmake
+++ cmake/configs/default.cmake
@@ -109,7 +109,7 @@
 hunter_config(spdlog VERSION 1.0.0-p0)
 hunter_config(szip VERSION 2.1.0-p1)
 hunter_config(wxWidgets VERSION 3.0.2)
-hunter_config(ZeroMQ VERSION 4.1.4)
+hunter_config(ZeroMQ VERSION 4.1.4-p2)
 hunter_config(Protobuf VERSION 3.0.0-beta-2)

 if(MINGW OR MSVC80)


Fix indentation

Fix indentation

--- cmake/iDynTreeOptions.cmake
+++ cmake/iDynTreeOptions.cmake
@@ -1,6 +1,3 @@
-
-
-
 #########################################################################
 # Control whether libraries are shared or static.
 if( MSVC )
@@ -56,10 +53,11 @@
 option(IDYNTREE_USES_KDL "Compile iDynTree with KDL dependency" TRUE)
 option(IDYNTREE_USES_YARP "Compile iDynTree with YARP dependency" TRUE)
 option(IDYNTREE_USES_ICUB_MAIN  "Compiled iDynTree with icub-main dependencies (for iKin and skinDynLib helper functions and tools)" TRUE)
+
 if( MSVC )
-option(IDYNTREE_USES_INTERNAL_URDFDOM "Compile iDynTree with an internal copy of urdfdom patched to avoid Boost dependencies" TRUE)
+    option(IDYNTREE_USES_INTERNAL_URDFDOM "Compile iDynTree with an internal copy of urdfdom patched to avoid Boost dependencies" TRUE)
 else()
-option(IDYNTREE_USES_INTERNAL_URDFDOM "Compile iDynTree with an internal copy of urdfdom patched to avoid Boost dependencies" FALSE)
+    option(IDYNTREE_USES_INTERNAL_URDFDOM "Compile iDynTree with an internal copy of urdfdom patched to avoid Boost dependencies" FALSE)
 endif()

 if(IDYNTREE_USES_INTERNAL_URDFDOM)
@@ -71,7 +69,6 @@
 # Enable/disable warnings
 option(IDYNTREE_ENABLE_WARNINGS "Enable compilation warnings when compiling iDynTree." FALSE)
 option(IDYNTREE_ENABLE_DOCUMENTATION_WARNINGS "Enable documentation warnings when compiling iDynTree." FALSE)
-

 if(MSVC)
     set(CMAKE_DEBUG_POSTFIX "d")


Add JAVA_INCLUDES so we can combine targets

We can now add java and C++ exports into the same export target

--- cmake/includes/Export.cmake
+++ cmake/includes/Export.cmake
@@ -24,12 +24,15 @@
 # APKS: list of Android APK files that need to be installed
 # JAR_PATHS: directories containg jars that wish to be exposed to other
 #       projects
+# JAVA_INCLUDES: directories containing java files that wish to be exposed to
+#       other projects
 #
 ###############################################################################
 function(export_project)
     set(options )
     set(oneValueArgs NAME VERSION)
-    set(multiValueArgs INCLUDES LIBS ARCHIVES BINS RES JARS APKS JAR_PATHS)
+    set(multiValueArgs INCLUDES LIBS ARCHIVES BINS RES JARS APKS JAR_PATHS
+        JAVA_INCLUDES)
     cmake_parse_arguments(EXP "${options}" "${oneValueArgs}"
         "${multiValueArgs}" ${ARGN})

@@ -134,7 +137,7 @@
             DESTINATION ${CMAKE_INSTALL_PREFIX}/res
         )
     endif()
-
+    # install jars
     if(EXP_JARS)
         file(APPEND ${export_config} "set(${EXP_NAME_uc}_JARS \"\")\n")
         foreach(j ${EXP_JARS})
@@ -149,7 +152,7 @@
                 ${CMAKE_INSTALL_PREFIX}/jar
         )
     endif()
-
+    # install APKs
     if(EXP_APKS)
         install(
             FILES
@@ -158,13 +161,20 @@
                 ${CMAKE_INSTALL_PREFIX}/apk
         )
     endif()
-
     # export jar files
     if (EXP_JAR_PATHS)
         file(APPEND ${export_config} "set(${EXP_NAME_uc}_JAR_PATHS \"\")\n")
         foreach(j ${EXP_JAR_PATHS})
             file(APPEND ${export_config}
                 "list(APPEND ${EXP_NAME_uc}_JAR_PATHS ${j})\n")
+        endforeach()
+    endif()
+    # export java includes
+    if (EXP_JAVA_INCLUDES)
+        file(APPEND ${export_config} "set(${EXP_NAME_uc}_JAVA_INCLUDE_DIRS \"\")\n")
+        foreach(j ${EXP_JAVA_INCLUDES})
+            file(APPEND ${export_config}
+                "list(APPEND ${EXP_NAME_uc}_JAVA_INCLUDE_DIRS ${j})\n")
         endforeach()
     endif()


[CMake] [PR31433] Fix LLDB tool installation

This resolves PR 31433.

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

--- cmake/modules/AddLLDB.cmake
+++ cmake/modules/AddLLDB.cmake
@@ -118,7 +118,6 @@
   set_target_properties(${name} PROPERTIES
     FOLDER "lldb executables")

-  set(install_dir bin)
   if(LLDB_BUILD_FRAMEWORK)
     if(ARG_INCLUDE_IN_FRAMEWORK)
       string(REGEX REPLACE "[^/]+" ".." _dots ${LLDB_FRAMEWORK_INSTALL_DIR})
@@ -130,18 +129,19 @@
       set_target_properties(${name} PROPERTIES
             BUILD_WITH_INSTALL_RPATH On
             INSTALL_RPATH "@loader_path/../${LLDB_FRAMEWORK_INSTALL_DIR}")
-      if(ARG_GENERATE_INSTALL)
-        install(TARGETS ${name}
-              COMPONENT ${name}
-              RUNTIME DESTINATION ${install_dir})
-        if (NOT CMAKE_CONFIGURATION_TYPES)
-          add_custom_target(install-${name}
-                            DEPENDS ${name}
-                            COMMAND "${CMAKE_COMMAND}"
-                                    -DCMAKE_INSTALL_COMPONENT=${name}
-                                    -P "${CMAKE_BINARY_DIR}/cmake_install.cmake")
-        endif()
-      endif()
+    endif()
+  endif()
+
+  if(ARG_GENERATE_INSTALL)
+    install(TARGETS ${name}
+          COMPONENT ${name}
+          RUNTIME DESTINATION bin)
+    if (NOT CMAKE_CONFIGURATION_TYPES)
+      add_custom_target(install-${name}
+                        DEPENDS ${name}
+                        COMMAND "${CMAKE_COMMAND}"
+                                -DCMAKE_INSTALL_COMPONENT=${name}
+                                -P "${CMAKE_BINARY_DIR}/cmake_install.cmake")
     endif()
   endif()


Use correct host/target CMake variables to define lit variables.

CMake and autotools disagree on what "host" means in a cross-compilation
context. Autotools (and lit) take it to be the machine the binaries being
compiled now will run on. CMake takes it to be the machine actually compiling
the binaries now.

This change makes lit.site-cfg more consistent between autotools and CMake,
allowing lit tests (particularly in ExecutionEngine) to run correctly when
cross-compiled with CMake

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

--- cmake/modules/AddLLVM.cmake
+++ cmake/modules/AddLLVM.cmake
@@ -246,8 +246,8 @@
     set(ENABLE_ASSERTIONS "0")
   endif()

-  set(HOST_OS ${CMAKE_HOST_SYSTEM_NAME})
-  set(HOST_ARCH ${CMAKE_HOST_SYSTEM_PROCESSOR})
+  set(HOST_OS ${CMAKE_SYSTEM_NAME})
+  set(HOST_ARCH ${CMAKE_SYSTEM_PROCESSOR})

   configure_file(${input} ${output} @ONLY)
 endfunction()


Better fix to the windows conditional.

Better fix to the windows conditional.

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

--- cmake/modules/AddLLVM.cmake
+++ cmake/modules/AddLLVM.cmake
@@ -423,7 +423,7 @@
     set_target_properties( ${name} PROPERTIES EXCLUDE_FROM_ALL ON)
   else()
     if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY OR ${name} STREQUAL "LTO")
-      if("${CMAKE_SYSTEM_NAME}" STREQUAL "Windows")
+      if(WIN32 OR CYGWIN)
         install(TARGETS ${name}
           EXPORT LLVMExports
           RUNTIME DESTINATION lib${LLVM_LIBDIR_SUFFIX}


Add CASA stuff FindCFitsIO

Add CASA stuff FindCFitsIO

--- modules/FindCFitsIO.cmake
+++ modules/FindCFitsIO.cmake
@@ -5,19 +5,25 @@
 # - CFitsIO_INCLUDE_DIR is the path to the include directory
 # - CFitsIO_VERSION_STRING is the version of the library

-if(NOT CFitsIO_LIBRARY)
+find_library(CFitsIO_LIBRARY cfitsio DOC "Path to the cfitsio library")
+if(NOT "$ENV{CASAPATH}" STREQUAL "")
+    string(FIND "$ENV{CASAPATH}" " " endpath)
+    string(SUBSTRING "$ENV{CASAPATH}" 0 ${endpath} casapath)
+
     find_library(
       CFitsIO_LIBRARY cfitsio
+      NAMES libcfitsio${CMAKE_SHARED_LIBRARY_SUFFIX}.0
+      PATHS "${casapath}" "${casapath}/Frameworks"
       DOC "Path to the cfitsio library"
     )
 endif()
-if(NOT CFitsIO_INCLUDE_DIR)
-    find_path(
-      CFitsIO_INCLUDE_DIR fitsio.h
-      PATH_SUFFIXES include include/cfitsio
-      DOC "Path to the cfitsio include directory"
-    )
-endif()
+find_path(
+  CFitsIO_INCLUDE_DIR fitsio.h
+  PATH_SUFFIXES include include/cfitsio Frameworks/Headers
+  DOC "Path to the cfitsio include directory"
+  PATHS "${casapath}"
+)
+
 if(CFitsIO_INCLUDE_DIR)
   file(
     STRINGS ${CFitsIO_INCLUDE_DIR}/fitsio.h


add readdatablock test to ctest

add readdatablock test to ctest

--- phSolver/common/test/testing.cmake
+++ phSolver/common/test/testing.cmake
@@ -3,3 +3,8 @@
   COMMAND ${MPIRUN} ${MPIRUN_PROCFLAG} 4 ${PHASTA_BINARY_DIR}/bin/phIOreadheader 2
   WORKING_DIRECTORY ${CASES}/incompressible
 )
+add_test(
+  NAME readDatablock
+  COMMAND ${MPIRUN} ${MPIRUN_PROCFLAG} 4 ${PHASTA_BINARY_DIR}/bin/phIOreaddatablock 2
+  WORKING_DIRECTORY ${CASES}/incompressible
+)


Updating ParaView plugin CMake code

Updating ParaView plugin CMake code

--- Resources/CMake/ParaViewPluginIncludeMXADataModel.cmake
+++ Resources/CMake/ParaViewPluginIncludeMXADataModel.cmake
@@ -7,7 +7,7 @@
     SET(MXA_EXTERNAL_HDF5_LIBRARY ${PARAVIEW_HDF5_LIBRARIES})
     SET(HDF5_FOUND 1)
     SET(HDF5_LIBRARIES ${PARAVIEW_HDF5_LIBRARIES})
-    SET(HDF5_INCLUDE_DIRS "${ParaView_SOURCE_DIR}/Utilities/hdf5" "${ParaView_BINARY_DIR}/Utilities/hdf5")
+    SET(HDF5_INCLUDE_DIRS "${ParaView_SOURCE_DIR}/Utilities/hdf5" ${ParaView_BINARY_DIR}/Utilities/hdf5)

     # ------- Add support for Expat and XML parsing
     SET (MXA_USE_XML  ON)
@@ -21,17 +21,20 @@
     SET (MXA_EXTERNAL_TIFF_LIBRARY vtktiff)
     SET (TIFF_FOUND 1)
     SET (TIFF_LIBRARIES vtktiff)
-    SET (TIFF_INCLUDE_DIRS "${ParaView_SOURCE_DIR}/VTK/Utilities/vtktiff")
+    SET (TIFF_INCLUDE_DIRS "${ParaView_SOURCE_DIR}/VTK/Utilities/vtktiff" )

     SET (MXA_BUILD_EXAMPLES FALSE)
-   # SET (BUILD_TESTING FALSE)
+    #SET (BUILD_TESTING FALSE)

     SET (MXADATAMODEL_LIB_NAME MXADataModel)
     SET (MXA_USE_DEBUG_LIBRARY_NAME FALSE)

     MESSAGE (STATUS "Plugin: [${MODULE_NAME}] adding MXADataModel Library")
-    ADD_SUBDIRECTORY("${MXA_SOURCE_DIR}" MXADataModel)
+    set (BUILD_TESTING_SAVE ${BUILD_TESTING})
+    set (BUILD_TESTING OFF)
+    ADD_SUBDIRECTORY("${MXADataModel_SOURCE_DIR}" MXADataModel)
+    set (BUILD_TESTING ${BUILD_TESTING_SAVE})
     SET(PARAVIEW_ADDITIONAL_LIBRARIES
         ${PARAVIEW_ADDITIONAL_LIBRARIES}
         ${MXADATAMODEL_LIB_NAME} )
@@ -44,7 +47,7 @@
     SET (Boost_USE_FILESYSTEM TRUE)
     SET (Boost_USE_SYSTEM TRUE)
     SET (Boost_USE_PROGRAM_OPTIONS TRUE)
-    INCLUDE (${MXA_SOURCE_DIR}/Resources/CMake/MXAFindBoost.cmake)
+    INCLUDE (${MXADataModel_SOURCE_DIR}/Resources/CMake/MXAFindBoost.cmake)
     INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS})  # Include the Boost Headers
     LINK_DIRECTORIES(${Boost_LIBRARY_DIRS})
     #- Add the required Libraries for MXA to function
@@ -56,6 +59,6 @@
     )
 ENDIF (NOT DEFINED MXADATAMODEL_TARGET_ADDED OR NOT MXADATAMODEL_TARGET_ADDED)

-INCLUDE_DIRECTORIES (${MXA_SOURCE_DIR}/src)
+INCLUDE_DIRECTORIES (${MXADataModel_SOURCE_DIR}/Source)
 INCLUDE_DIRECTORIES (${ParaView_BINARY_DIR}/MXADataModel)


Allow to specify /MD or /MT when using MSVC

--- project/cmake/CompilerOption.cmake
+++ project/cmake/CompilerOption.cmake
@@ -113,10 +113,13 @@
     list(APPEND CMAKE_CXX_FLAGS_RELWITHDEBINFO -ggdb)
     #list(APPEND CMAKE_CXX_FLAGS_MINSIZEREL)
 else()
-    list(APPEND CMAKE_CXX_FLAGS_DEBUG /Od /MDd)
-    list(APPEND CMAKE_CXX_FLAGS_RELEASE /O2 /MD /D NDEBUG)
-    list(APPEND CMAKE_CXX_FLAGS_RELWITHDEBINFO /O2 /MDd)
-    list(APPEND CMAKE_CXX_FLAGS_MINSIZEREL /Ox /MD /D NDEBUG)
+    if(NOT CMAKE_MSVC_RUNTIME)
+        set(CMAKE_MSVC_RUNTIME "MD")
+    endif()
+    list(APPEND CMAKE_CXX_FLAGS_DEBUG /Od /${CMAKE_MSVC_RUNTIME}d)
+    list(APPEND CMAKE_CXX_FLAGS_RELEASE /O2 /${CMAKE_MSVC_RUNTIME} /D NDEBUG)
+    list(APPEND CMAKE_CXX_FLAGS_RELWITHDEBINFO /O2 /${CMAKE_MSVC_RUNTIME}d)
+    list(APPEND CMAKE_CXX_FLAGS_MINSIZEREL /Ox /${CMAKE_MSVC_RUNTIME} /D NDEBUG)
 endif()

 # list => string


KAA-934 Add missing unit test and clarify dependencies

--- client/client-multi/client-c/listfiles/UnitTest.cmake
+++ client/client-multi/client-c/listfiles/UnitTest.cmake
@@ -19,7 +19,7 @@
 find_package(CUnit)
 find_package(OpenSSL REQUIRED)

-set(CUNIT_LIB_NAME "")
+set(CUNIT_LIB_NAME)

 if(CUNIT_FOUND)
     set(CUNIT_LIB_NAME ${CUNIT_LIBRARIES})
@@ -48,33 +48,31 @@
             ${ARGN}
     )

-    if (DEFINED UNIT_TEST_NAME AND DEFINED UNIT_TEST_SOURCES)
-        message("-----------------------------------------------")
-        message("	Test added: ${UNIT_TEST_NAME}")
-        message("	Test sources: ${UNIT_TEST_SOURCES}")
-
-        add_executable(${UNIT_TEST_NAME} ${UNIT_TEST_SOURCES})
-        add_test(NAME ${UNIT_TEST_NAME} COMMAND ${UNIT_TEST_NAME})
-        target_link_libraries(${UNIT_TEST_NAME} CppUTest)
-        target_link_libraries(${UNIT_TEST_NAME} CppUTestExt)
-    else ()
+    if (NOT DEFINED UNIT_TEST_NAME AND DEFINED UNIT_TEST_SOURCES)
         message(FATAL_ERROR "Test sources and name must be defined!")
-    endif ()
-
-    if (UNIT_TEST_DEPENDS)
+    endif()
+
+    message("-----------------------------------------------")
+    message("	Test added: ${UNIT_TEST_NAME}")
+    message("	Test sources: ${UNIT_TEST_SOURCES}")
+
+    add_executable(${UNIT_TEST_NAME} ${UNIT_TEST_SOURCES})
+    add_test(NAME ${UNIT_TEST_NAME} COMMAND ${UNIT_TEST_NAME})
+    target_link_libraries(${UNIT_TEST_NAME} ${CUNIT_LIB_NAME})
+
+    if(UNIT_TEST_DEPENDS)
         message("	Test dependencies: ${UNIT_TEST_DEPENDS}")
         target_link_libraries(${UNIT_TEST_NAME} ${UNIT_TEST_DEPENDS})
-    endif ()
-
-    if (UNIT_TEST_INC_DIRS)
+    endif()
+
+    if(UNIT_TEST_INC_DIRS)
         message("	Test includes: ${UNIT_TEST_INC_DIRS}")
         target_include_directories(
                 ${UNIT_TEST_NAME}
                 PRIVATE
                 ${UNIT_TEST_INC_DIRS})
-    endif ()
-
-    target_include_directories(${UNIT_TEST_NAME} PRIVATE ${CPPUTEST_INCLUDE_DIRS})
+    endif()
+
     message("-----------------------------------------------")
 endfunction()

@@ -89,55 +87,55 @@
         test/platform-impl/test_ext_log_storage_memory.c
         test/kaa_test_external.c
         DEPENDS
-        kaac ${OPENSSL_LIBRARIES} ${CUNIT_LIB_NAME})
+        kaac ${OPENSSL_LIBRARIES})

 kaa_add_unit_test(NAME test_ext_log_upload_strategy_by_volume
         SOURCES
         test/platform-impl/test_ext_log_upload_strategies.c
         test/kaa_test_external.c
         DEPENDS
-        kaac ${OPENSSL_LIBRARIES} ${CUNIT_LIB_NAME})
+        kaac ${OPENSSL_LIBRARIES})

 kaa_add_unit_test(NAME test_user_extension
         SOURCES
         test/test_kaa_user.c
         test/kaa_test_external.c
         DEPENDS
-        kaac ${OPENSSL_LIBRARIES} ${CUNIT_LIB_NAME})
+        kaac ${OPENSSL_LIBRARIES})

 kaa_add_unit_test(NAME test_meta_extension
         SOURCES
         test/test_meta_extension.c
         test/kaa_test_external.c
         DEPENDS
-        kaac ${OPENSSL_LIBRARIES} ${CUNIT_LIB_NAME})
+        kaac ${OPENSSL_LIBRARIES})

 kaa_add_unit_test(NAME test_platform_utils
         SOURCES
         test/test_platform_utils.c
         test/kaa_test_external.c
         DEPENDS
-        kaac ${OPENSSL_LIBRARIES} ${CUNIT_LIB_NAME})
+        kaac ${OPENSSL_LIBRARIES})

 kaa_add_unit_test(NAME test_context
         SOURCES
         test/test_kaa_context.c
         test/kaa_test_external.c
         DEPENDS
-        kaac ${OPENSSL_LIBRARIES} ${CUNIT_LIB_NAME})
+        kaac ${OPENSSL_LIBRARIES})

 kaa_add_unit_test(NAME test_event
         SOURCES
         test/test_kaa_event.c
         test/kaa_test_external.c
         DEPENDS
-        kaac ${OPENSSL_LIBRARIES} ${CUNIT_LIB_NAME})
+        kaac ${OPENSSL_LIBRARIES})

 kaa_add_unit_test(NAME test_status
         SOURCES
         test/test_kaa_status.c
         DEPENDS
-        kaac ${OPENSSL_LIBRARIES} ${CUNIT_LIB_NAME})
+        kaac ${OPENSSL_LIBRARIES})

 kaa_add_unit_test(NAME test_profile
         SOURCES
@@ -145,14 +143,14 @@
         test/kaa_test_external.c
         ${KAA_SRC_FOLDER}/gen/kaa_profile_gen.c
         DEPENDS
-        kaac ${OPENSSL_LIBRARIES} ${CUNIT_LIB_NAME})
+        kaac ${OPENSSL_LIBRARIES})

 kaa_add_unit_test(NAME test_common
         SOURCES
         test/test_kaa_common.c
         test/kaa_test_external.c
         DEPENDS
-        kaac ${OPENSSL_LIBRARIES} ${CUNIT_LIB_NAME})
+        kaac ${OPENSSL_LIBRARIES})

 kaa_add_unit_test(NAME test_log
         SOURCES
@@ -172,57 +170,64 @@
         ${KAA_SRC_FOLDER}/kaa_status.c
         ${KAA_SRC_FOLDER}/platform-impl/common/kaa_failover_strategy.c
         DEPENDS
-        kaac ${OPENSSL_LIBRARIES} ${CUNIT_LIB_NAME})
+        kaac ${OPENSSL_LIBRARIES})

 kaa_add_unit_test(NAME test_platform_protocol
         SOURCES
         test/test_platform_protocol.c
         DEPENDS
-        kaac ${OPENSSL_LIBRARIES} ${CUNIT_LIB_NAME})
+        kaac ${OPENSSL_LIBRARIES})

 kaa_add_unit_test(NAME test_list
         SOURCES
         test/collections/test_kaa_list.c
         test/kaa_test_external.c
         DEPENDS
-        kaac ${OPENSSL_LIBRARIES} ${CUNIT_LIB_NAME})
+        kaac ${OPENSSL_LIBRARIES})

 kaa_add_unit_test(NAME test_kaatcp_parser
         SOURCES
         test/kaatcp/kaatcp_parser_test.c
         test/kaa_test_external.c
         DEPENDS
-        kaac ${OPENSSL_LIBRARIES} ${CUNIT_LIB_NAME})
+        kaac ${OPENSSL_LIBRARIES})

 kaa_add_unit_test(NAME test_kaatcp_request
         SOURCES
         test/kaatcp/kaatcp_request_test.c
         test/kaa_test_external.c
         DEPENDS
-        kaac ${OPENSSL_LIBRARIES} ${CUNIT_LIB_NAME})
+        kaac ${OPENSSL_LIBRARIES})

 kaa_add_unit_test(NAME test_kaa_tcp_channel_bootstrap
         SOURCES
         test/kaa_tcp_channel/test_kaa_tcp_channel_bootstrap.c
         test/kaa_test_external.c
         DEPENDS
-        kaac ${OPENSSL_LIBRARIES} ${CUNIT_LIB_NAME})
+        kaac ${OPENSSL_LIBRARIES})

 kaa_add_unit_test(NAME test_kaa_configuration_manager
         SOURCES
         test/test_kaa_configuration.c
         test/kaa_test_external.c
         DEPENDS
-        kaac ${OPENSSL_LIBRARIES} ${CUNIT_LIB_NAME})
+        kaac ${OPENSSL_LIBRARIES})
+
+kaa_add_unit_test(NAME test_kaa_common_schema
+        SOURCES
+        test/test_kaa_common_schema.c
+        test/kaa_test_external.c
+        DEPENDS
+        kaac ${OPENSSL_LIBRARIES})

 kaa_add_unit_test(NAME test_kaa_notification_manager
         SOURCES
         test/test_kaa_notification.c
         DEPENDS
-        kaac ${OPENSSL_LIBRARIES} ${CUNIT_LIB_NAME})
+        kaac ${OPENSSL_LIBRARIES})

 kaa_add_unit_test(NAME test_kaa_reallocation
         SOURCES
         test/utilities/test_kaa_reallocation.c
         DEPENDS
-        kaac ${OPENSSL_LIBRARIES} ${CUNIT_LIB_NAME})
+        kaac ${OPENSSL_LIBRARIES})


The maximum length for a symbol name should be 63

Since C strings are zero-terminated

--- src/bootstrap/libnany/config.h.cmake
+++ src/bootstrap/libnany/config.h.cmake
@@ -22,7 +22,7 @@
 	static constexpr uint32_t maxFuncDeclParameterCount = 7;

 	//! Maximum length for a symbol name
-	static constexpr uint32_t maxSymbolNameLength = 64;
+	static constexpr uint32_t maxSymbolNameLength = 64 - 1 /*zero-terminated*/;

 	//! Maxmimum number of pushed parameters for calling a function
 	static constexpr uint32_t maxPushedParameters = 32;


fixed path handling in dotnet assembly installer script (cmake)

--- cmake/UbiTrackCSharpHelpers.cmake
+++ cmake/UbiTrackCSharpHelpers.cmake
@@ -327,6 +327,8 @@
     get_property(type TARGET ${target} PROPERTY _assembly_type)
     get_property(pc_file TARGET ${target} PROPERTY pkg-config_template_basename)

+    STRING(REGEX REPLACE "\\\\" "/" filename ${filename})
+
     if (NOT pc_file)
         set (pc_file ${target})
     endif (NOT pc_file)


fix reinstalling Python files installed by catkin_install_python after modifying them (fix #764)

--- cmake/catkin_install_python.cmake
+++ cmake/catkin_install_python.cmake
@@ -26,6 +26,7 @@
       set(file "${CMAKE_CURRENT_SOURCE_DIR}/${file}")
     endif()
     if(EXISTS ${file})
+      stamp(${file})
       # read file and check shebang line
       file(READ ${file} data)
       set(regex "^#!/([^\r\n]+)/env python([\r\n])")


On windows, in debug mode, install also the .pdb files

--- cmake/modules/RootNewMacros.cmake
+++ cmake/modules/RootNewMacros.cmake
@@ -668,6 +668,16 @@
     else()
       install(TARGETS ${executable} EXPORT ${CMAKE_PROJECT_NAME}Exports RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT applications)
     endif()
+    if(WIN32 AND CMAKE_GENERATOR MATCHES "Visual Studio")
+      install(FILES ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${executable}.pdb
+              CONFIGURATIONS Debug
+              DESTINATION ${CMAKE_INSTALL_BINDIR}
+              COMPONENT applications)
+      install(FILES ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${executable}.pdb
+              CONFIGURATIONS RelWithDebInfo
+              DESTINATION ${CMAKE_INSTALL_BINDIR}
+              COMPONENT applications)
+    endif()
   endif()
 endfunction()


[cmake] find_file fails for absolute paths.

--- cmake/modules/RootNewMacros.cmake
+++ cmake/modules/RootNewMacros.cmake
@@ -243,7 +243,11 @@
         endif()
       endforeach()
     else()
-      find_file(headerFile ${fp} HINTS ${incdirs} NO_DEFAULT_PATH NO_SYSTEM_ENVIRONMENT_PATH)
+      if(IS_ABSOLUTE ${fp})
+        set(headerFile ${fp})
+      else()
+        find_file(headerFile ${fp} HINTS ${incdirs} NO_DEFAULT_PATH NO_SYSTEM_ENVIRONMENT_PATH)
+      endif()
       if(NOT headerFile)
         message(FATAL_ERROR "Cannot find header ${fp} to generate dictionary ${dictionary} for. Did you forget to set the INCLUDE_DIRECTORIES property for the current directory?")
       endif()


Append CXXFLAGS instead of overwriting them.

This preserves hardening buildflags set in the environment.

--- cmake/unix_compiler_options.cmake
+++ cmake/unix_compiler_options.cmake
@@ -19,4 +19,4 @@
     message(FATAL_ERROR "Unsupported C++ compiler")
 endif()

-set (CMAKE_CXX_FLAGS "${LASZIP_COMMON_CXX_FLAGS} ${CXX_STANDARD}")
+set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${LASZIP_COMMON_CXX_FLAGS} ${CXX_STANDARD}")


COMP: missing Boost libs for linking on windows

--- Modules/Learning/LearningBase/otb-module.cmake
+++ Modules/Learning/LearningBase/otb-module.cmake
@@ -32,6 +32,7 @@
     OTBShark

     TEST_DEPENDS
+    OTBBoost
     OTBTestKernel
     OTBImageIO


Attempt to fix libcurl for 64-bit

Attempt to fix libcurl for 64-bit

--- build/modules/FindCURL.cmake
+++ build/modules/FindCURL.cmake
@@ -41,6 +41,7 @@
   ELSE()
     FIND_LIBRARY(CRYPTO_LIBRARIES NAMES crypto PATHS ${CURL_LIBRARY_DIRS} NO_DEFAULT_PATH)
     FIND_LIBRARY(OPENSSL_LIBRARIES NAMES ssl PATHS ${CURL_LIBRARY_DIRS} NO_DEFAULT_PATH)
+    FIND_LIBRARY(LDAP_LIBRARIES NAMES ldap)
     IF(NOT WIN32 AND NOT APPLE)
       IF(FORCE_32BIT OR EXISTS ${PLATFORM_LIBS}/arch-32bit)
         IF(NOT CRYPTO_LIBRARIES)
@@ -49,6 +50,7 @@
         IF(NOT OPENSSL_LIBRARIES)
           FIND_LIBRARY(OPENSSL_LIBRARIES NAMES ssl PATHS ${CURL_LIBRARY_DIRS}/../../lib NO_DEFAULT_PATH)
         ENDIF()
+        SET(LDAP_LIBRARIES)
       ENDIF()
     ENDIF()
     IF(NOT CRYPTO_LIBRARIES)
@@ -57,7 +59,6 @@
     IF(NOT OPENSSL_LIBRARIES)
       FIND_LIBRARY(OPENSSL_LIBRARIES NAMES ssl)
     ENDIF()
-    FIND_LIBRARY(LDAP_LIBRARIES NAMES ldap)
     FIND_LIBRARY(ZLIB_LIBRARIES NAMES z)
     FIND_LIBRARY(CURL_LIBRARIES NAMES curl PATHS ${CURL_LIBRARY_DIRS} NO_DEFAULT_PATH)
   ENDIF()


cmake: Escape argument in regex (#3507)

cmake: Escape argument in regex (#3507)

See https://gitlab.kitware.com/cmake/cmake/-/issues/18737 for why this is an issue

--- src/cmake/modules/FindFFmpeg.cmake
+++ src/cmake/modules/FindFFmpeg.cmake
@@ -61,13 +61,13 @@
 if (FFMPEG_INCLUDES)
   file(STRINGS "${FFMPEG_INCLUDES}/libavcodec/version.h" TMP
        REGEX "^#define LIBAVCODEC_VERSION_MAJOR .*$")
-  string (REGEX MATCHALL "[0-9]+[.0-9]+" LIBAVCODEC_VERSION_MAJOR ${TMP})
+  string (REGEX MATCHALL "[0-9]+[.0-9]+" LIBAVCODEC_VERSION_MAJOR "${TMP}")
   file(STRINGS "${FFMPEG_INCLUDES}/libavcodec/version.h" TMP
        REGEX "^#define LIBAVCODEC_VERSION_MINOR .*$")
-  string (REGEX MATCHALL "[0-9]+[.0-9]+" LIBAVCODEC_VERSION_MINOR ${TMP})
+  string (REGEX MATCHALL "[0-9]+[.0-9]+" LIBAVCODEC_VERSION_MINOR "${TMP}")
   file(STRINGS "${FFMPEG_INCLUDES}/libavcodec/version.h" TMP
        REGEX "^#define LIBAVCODEC_VERSION_MICRO .*$")
-  string (REGEX MATCHALL "[0-9]+[.0-9]+" LIBAVCODEC_VERSION_MICRO ${TMP})
+  string (REGEX MATCHALL "[0-9]+[.0-9]+" LIBAVCODEC_VERSION_MICRO "${TMP}")
   set (LIBAVCODEC_VERSION "${LIBAVCODEC_VERSION_MAJOR}.${LIBAVCODEC_VERSION_MINOR}.${LIBAVCODEC_VERSION_MICRO}")
   if (LIBAVCODEC_VERSION VERSION_GREATER_EQUAL 59.18.100)
       set (FFMPEG_VERSION 5.0)


COMP: Update versions of ANTs and ITK to remove ANTs compilation error due to ITK update

--- SuperBuild/FindExternalTools.cmake
+++ SuperBuild/FindExternalTools.cmake
@@ -209,7 +209,7 @@
   # Download and compile ITKv4
   ExternalProject_Add(I4 # BRAINSStandAlone/SuperBuild/External_ITKv4.cmake # !! All args needed as they are # Name shorten from ITKv4 because Windows ITKv4 path limited to 50 chars
     GIT_REPOSITORY "${git_protocol}://itk.org/ITK.git"
-    GIT_TAG 1866ef42887df677a6197ad11ed0ef6e9b239567 # 2013-04-03 (from Slicer) # 3c03e162c7e287b81115e2175898482998b50a34 # master 01-31-13 4.4.0 : fixed extra itk namespaces # 555049f830d1c09f8d4d95904f429290467d39ab #2012-12-16 ITKv4.3.0
+    GIT_TAG 35b90133a793ffd884820e499175db19366fe627 # 2013-07-12 (from Slicer) # 1866ef42887df677a6197ad11ed0ef6e9b239567 # 2013-04-03 (from Slicer)
     SOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR}/I4 # Path shorten from ITKv4 because Windows SOURCE_DIR path limited to 50 chars
     BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/I4-b # Path shorten from ITKv4 because Windows SOURCE_DIR path limited to 50 chars
     CMAKE_GENERATOR ${gen}
@@ -486,7 +486,7 @@
   # SVN_REPOSITORY "http://advants.svn.sourceforge.net/svnroot/advants/trunk"
   # SVN_REVISION -r 1685 # 12/13/2012
   GIT_REPOSITORY "${git_protocol}://github.com/stnava/ANTs.git"
-  GIT_TAG "49a8e5911cc5cbd180f15c63ee8c545ebd3828f9" # 2013-04-11 Prevent Boost from compiling libs # 6cb624225fe99047b562acb1a0cb053dc98dbc50 # 2013-01-31 Move to new repository home
+  GIT_TAG 0d8c4939b38199e1ef2bf691189bd0991563ff7c # 2013-07-22 Update to fix comp error due to ITK # "49a8e5911cc5cbd180f15c63ee8c545ebd3828f9" # 2013-04-11 Prevent Boost from compiling libs
   )
 set( CMAKE_ExtraARGS
   -DBUILD_TESTING:BOOL=OFF


[cmake] only set GCC_LINK_GLIBC_WRAPPERS on amd64

--- cmake/axl_std_settings.cmake
+++ cmake/axl_std_settings.cmake
@@ -325,11 +325,15 @@
 			ON
 			)

-		option(
-			GCC_LINK_GLIBC_WRAPPERS
-			"Wrap a subset of GLIBC functions for improved compatibility"
-			ON
-			)
+		if (${TARGET_CPU} STREQUAL "amd64")
+			option(
+				GCC_LINK_GLIBC_WRAPPERS
+				"Wrap a subset of GLIBC functions for improved compatibility"
+				ON
+				)
+		else()
+			unset(GCC_LINK_GLIBC_WRAPPERS CACHE)
+		endif()
 	endif()

 	# alas, warning suppressions must be passed in command line, not pragma-ed


Debug build should have -O0 passed.

Debug build should have -O0 passed.

--- cmake/c_flags_override.cmake
+++ cmake/c_flags_override.cmake
@@ -15,7 +15,7 @@
 if (("${CMAKE_${_lang}_COMPILER_ID}" MATCHES "Clang") OR ("${CMAKE_${_lang}_COMPILER_ID}" MATCHES "GNU"))
   # Taken from Modules/Compiler/GNU.cmake but -DNDEBUG is removed
   set(CMAKE_${_lang}_FLAGS_INIT "")
-  set(CMAKE_${_lang}_FLAGS_DEBUG_INIT "-g")
+  set(CMAKE_${_lang}_FLAGS_DEBUG_INIT "-O0 -g")
   set(CMAKE_${_lang}_FLAGS_MINSIZEREL_INIT "-Os")
   set(CMAKE_${_lang}_FLAGS_RELEASE_INIT "-O3")
   set(CMAKE_${_lang}_FLAGS_RELWITHDEBINFO_INIT "-O2 -g")


Use target_link_libraries for fat executable dependencies

These were getting added to the link command line manually,
which can cause coincidental library ordering issues.

--- cmake/modules/AddSwift.cmake
+++ cmake/modules/AddSwift.cmake
@@ -1754,10 +1754,6 @@
   list(APPEND link_flags
       "-L${SWIFTLIB_DIR}/${SWIFT_SDK_${SWIFTEXE_SINGLE_SDK}_LIB_SUBDIR}")

-  foreach(FAT_LIBRARY ${SWIFTEXE_SINGLE_LINK_FAT_LIBRARIES})
-    list(APPEND link_flags "-l${FAT_LIBRARY}")
-  endforeach()
-
   if(SWIFTEXE_SINGLE_DISABLE_ASLR)
     list(APPEND link_flags "-Wl,-no_pie")
   endif()
@@ -1830,7 +1826,7 @@
       PROPERTIES
       HEADER_FILE_ONLY true)

-  target_link_libraries("${name}" ${SWIFTEXE_SINGLE_LINK_LIBRARIES})
+  target_link_libraries("${name}" ${SWIFTEXE_SINGLE_LINK_LIBRARIES} ${SWIFTEXE_SINGLE_LINK_FAT_LIBRARIES})
   swift_common_llvm_config("${name}" ${SWIFTEXE_SINGLE_COMPONENT_DEPENDS})

   set_target_properties(${name}


Further clean up on URHO3D_OPENGL build option.

--- Source/CMake/Modules/Urho3D-CMake-common.cmake
+++ Source/CMake/Modules/Urho3D-CMake-common.cmake
@@ -71,9 +71,14 @@
 else ()
     unset (URHO3D_TEST_TIME_OUT CACHE)
 endif ()
+# The URHO3D_OPENGL option is not defined on non-Windows platforms as they should always use OpenGL
 if (MSVC)
+    # On MSVC compiler, default to false (i.e. prefers Direct3D)
+    # OpenGL can be manually enabled with -DURHO3D_OPENGL=1, but Windows graphics card drivers are usually better optimized for Direct3D
     option (URHO3D_OPENGL "Use OpenGL instead of Direct3D (Windows platform only)")
 elseif (WIN32)
+    # On non-MSVC compiler on Windows platform, default to true to enable use of OpenGL instead of Direct3D
+    # Direct3D can be manually enabled with -DURHO3D_OPENGL=0, but it is likely to fail unless the MinGW-w64 distribution is used due to dependency to Direct3D headers and libs
     option (URHO3D_OPENGL "Use OpenGL instead of Direct3D (Windows platform only)" TRUE)
 endif ()
 cmake_dependent_option (URHO3D_MKLINK "Use mklink command to create symbolic links (Windows Vista and above only)" FALSE "WIN32" FALSE)
@@ -147,21 +152,15 @@
     add_definitions (-DURHO3D_LOGGING)
 endif ()

-# If not on MSVC, enable use of OpenGL instead of Direct3D9 (either not compiling on Windows or
-# with a compiler that may not have an up-to-date DirectX SDK). This can also be unconditionally
-# enabled, but Windows graphics card drivers are usually better optimized for Direct3D. Direct3D can
-# be manually enabled for MinGW with -DURHO3D_OPENGL=0, but is likely to fail due to missing headers
-# and libraries, unless the MinGW-w64 distribution is used.
-if (NOT WIN32 OR NOT DEFINED URHO3D_OPENGL)  # This option is only defined on Windows platform
+# If not on Windows platform, enable Unix mode for kNet library and OpenGL graphic back-end
+if (NOT WIN32)
+    add_definitions (-DUNIX)
     set (URHO3D_OPENGL 1)
 endif ()
+
+# Add definition for OpenGL
 if (URHO3D_OPENGL)
     add_definitions (-DURHO3D_OPENGL)
-endif ()
-
-# If not on Windows, enable Unix mode for kNet library.
-if (NOT WIN32)
-    add_definitions (-DUNIX)
 endif ()

 # Add definitions for GLEW


add INDEPENDENT to ExternalProject_Add_Step()

* commented-out, for now, for Windows-specific calls
  * I'm not seeing any errors on Windows, for some reason
* issue https://github.com/smanders/externpro/issues/316#issuecomment-861804748

--- modules/xpfunmac.cmake
+++ modules/xpfunmac.cmake
@@ -91,12 +91,12 @@
       ExternalProject_Add_Step(${prj}_repo remote_add_upstream
         COMMAND ${GIT_EXECUTABLE} remote add upstream ${P_GIT_UPSTREAM}
         WORKING_DIRECTORY <SOURCE_DIR>
-        DEPENDEES download DEPENDERS update
+        DEPENDEES download DEPENDERS update INDEPENDENT TRUE
         )
       ExternalProject_Add_Step(${prj}_repo set_upstream
         COMMAND ${GIT_EXECUTABLE} branch ${upstreamCmd}
         WORKING_DIRECTORY <SOURCE_DIR>
-        DEPENDEES update DEPENDERS build
+        DEPENDEES update DEPENDERS build INDEPENDENT TRUE
         )
     endif()
   endif()
@@ -288,9 +288,7 @@
         -Dpkg_md5:STRING=${X_DLMD5${add}}
         -Dpkg_dir:STRING=${pkgPath}
         -P ${MODULES_DIR}/cmsdownload.cmake
-      DEPENDEES download
-      DEPENDERS patch
-      INDEPENDENT TRUE
+      DEPENDEES download DEPENDERS patch INDEPENDENT TRUE
       )
   endif()
 endfunction()
@@ -463,7 +461,7 @@
         # work around a cmake bug: run cmake again for changes to
         # CMAKE_CONFIGURATION_TYPES to take effect (see modules/flags.cmake)
         COMMAND ${CMAKE_COMMAND} <BINARY_DIR>
-        DEPENDEES configure DEPENDERS build
+        DEPENDEES configure DEPENDERS build #INDEPENDENT TRUE
         )
       if(CMAKE_SIZEOF_VOID_P EQUAL 8)
         set(pfstr x64)
@@ -488,10 +486,10 @@
           list(APPEND install_cmd -- /property:Platform=${pfstr})
         endif()
         ExternalProject_Add_Step(${XP_TARGET} build_${cfg}_${pfstr}
-          COMMAND ${build_cmd} DEPENDEES build DEPENDERS install
+          COMMAND ${build_cmd} DEPENDEES build DEPENDERS install #INDEPENDENT TRUE
           )
         ExternalProject_Add_Step(${XP_TARGET} install_${cfg}_${pfstr}
-          COMMAND ${install_cmd} DEPENDEES install
+          COMMAND ${install_cmd} DEPENDEES install #INDEPENDENT TRUE
           )
         if(XP_BUILD_VERBOSE)
           string(REPLACE ";" " " build_cmd "${build_cmd}")


* #216

* #216

--- cmake/Modules/AddIOWOW.cmake
+++ cmake/Modules/AddIOWOW.cmake
@@ -39,14 +39,14 @@
   LOG_CONFIGURE OFF
   LOG_INSTALL OFF
   CMAKE_ARGS ${CMAKE_ARGS}
-  BUILD_BYPRODUCTS "${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}/libiowow-1.a"
+  BUILD_BYPRODUCTS "${CMAKE_BINARY_DIR}/src/extern_iowow-build/src/libiowow-1.a"
 )

 add_library(iowow_s STATIC IMPORTED GLOBAL)
 set_target_properties(
    iowow_s
    PROPERTIES
-   IMPORTED_LOCATION "${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}/libiowow-1.a"
+   IMPORTED_LOCATION "${CMAKE_BINARY_DIR}/src/extern_iowow-build/src/libiowow-1.a"
 )
 add_dependencies(iowow_s extern_iowow)


Remove my formerly needed hack after last commit

--- cmake/PlatformSpecific.cmake
+++ cmake/PlatformSpecific.cmake
@@ -217,9 +217,6 @@
 	set(LUXRAYS_NO_DEFAULT_CONFIG true)
 	set(LUXRAYS_CUSTOM_CONFIG Config_OSX)

-	if(NOT CMAKE_BUILD_TYPE) # Assure something is set, default is "Release"
-		SET(CMAKE_BUILD_TYPE Release)
-	endif(NOT CMAKE_BUILD_TYPE)
 	if(NOT ${CMAKE_GENERATOR} MATCHES "Xcode") # will be set later in XCode
 		SET(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE} CACHE STRING "assure config" FORCE)
 		# Setup binaries output directory in Xcode manner


Fix scotch for OS X

Fix scotch for OS X

--- cmake/ThirdPartyScotch.cmake
+++ cmake/ThirdPartyScotch.cmake
@@ -19,11 +19,14 @@
         IF (APPLE)
             SET(SCOTCH_MAKE Makefile.inc.i686_mac_darwin8)
             SET(SCOTCH_LDFLAGS "")
+            SET(SCOTCH_CFLAGS "-O3 -Drestrict=__restrict -DCOMMON_PTHREAD -DCOMMON_RANDOM_FIXED_SEED -DCOMMON_TIMING_OLD -DSCOTCH_PTHREAD -DSCOTCH_RENAME -DCOMMON_PTHREAD_BARRIER")
         ELSE ()
             IF (CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
                 SET(SCOTCH_MAKE Makefile.inc.x86-64_pc_linux2)
+                SET(SCOTCH_CFLAGS "-O3 -DCOMMON_FILE_COMPRESS_GZ -DCOMMON_PTHREAD -DCOMMON_RANDOM_FIXED_SEED -DSCOTCH_RENAME -DSCOTCH_PTHREAD -Drestrict=__restrict -DIDXSIZE64")
             ELSE ()
                 SET(SCOTCH_MAKE Makefile.inc.i686_pc_linux2)
+                SET(SCOTCH_CFLAGS "-O3 -DCOMMON_FILE_COMPRESS_GZ -DCOMMON_PTHREAD -DCOMMON_RANDOM_FIXED_SEED -DSCOTCH_RENAME -DSCOTCH_PTHREAD -Drestrict=__restrict")
             ENDIF ()
             SET(SCOTCH_LDFLAGS "-lz -lm -lrt -lpthread")
         ENDIF ()
@@ -40,6 +43,7 @@
                 ${SCOTCH_SRC}/Make.inc/${SCOTCH_MAKE}
                 ${SCOTCH_SRC}/Makefile.inc
             BUILD_COMMAND $(MAKE) -C ${TPSRC}/src/scotch-6.0.0/src
+                "CFLAGS=${SCOTCH_CFLAGS}"
                 "LDFLAGS=${SCOTCH_LDFLAGS}"
                 "CLIBFLAGS=-fPIC" scotch
             INSTALL_COMMAND $(MAKE) -C ${TPSRC}/src/scotch-6.0.0/src


Fix discovery of `run-clang-tidy` on Ubuntu

--- cmake/clang-cpp-checks.cmake
+++ cmake/clang-cpp-checks.cmake
@@ -25,12 +25,12 @@
         ${CLANG_FORMAT}
         -style=file
         -output-replacements-xml
-        ${CHECK_CXX_SOURCE_FILES}
+        ${CHECK_CXX_SOURCE_FILES}
         # print output
-        | tee ${CMAKE_BINARY_DIR}/check_format_file.txt | grep -c "replacement " |
+        | tee ${CMAKE_BINARY_DIR}/check_format_file.txt | grep -c "replacement " |
                 tr -d "[:cntrl:]" && echo " replacements necessary"
         # WARNING: fix to stop with error if there are problems
-        COMMAND ! grep -c "replacement "
+        COMMAND ! grep -c "replacement "
                   ${CMAKE_BINARY_DIR}/check_format_file.txt > /dev/null
         COMMENT "Checking format compliance"
     )
@@ -53,7 +53,7 @@
     # Enable checking and formatting through run-clang-tidy if available
     # FIXME Make finding this program more portable
     GET_FILENAME_COMPONENT(CLANG_DIR ${CLANG_TIDY} DIRECTORY)
-    FIND_PROGRAM(RUN_CLANG_TIDY "run-clang-tidy.py" HINTS /usr/share/clang/ ${CLANG_DIR}/../share/clang/)
+    FIND_PROGRAM(RUN_CLANG_TIDY NAMES "run-clang-tidy.py" "run-clang-tidy-4.0.py" HINTS /usr/share/clang/ ${CLANG_DIR}/../share/clang/ /usr/bin/)
     IF(RUN_CLANG_TIDY)
         # Set export commands on
         SET (CMAKE_EXPORT_COMPILE_COMMANDS ON)


Minor stylistic change.

Minor stylistic change.

--- utilities.cmake
+++ utilities.cmake
@@ -14,7 +14,7 @@
 ################################################################################

 function( TNUN_make_temp_path file_name_variable )
-    if    ( EXISTS $ENV{TEMP} )
+        if( EXISTS $ENV{TEMP} )
         set( temp_dir "$ENV{TEMP}" )
     elseif( EXISTS $ENV{TMP} )
         set( temp_dir "$ENV{TMP}" )


Detect version of graphviz, to set preprocessor definitions properly; for backward compatibility with graphviz < 2.36.

--- salome_adm/cmake_files/FindGraphviz.cmake
+++ salome_adm/cmake_files/FindGraphviz.cmake
@@ -3,7 +3,9 @@
 # Output variables: GRAPHVIZ_EXECUTABLE   - where is executable 'dot' takes place.
 #		    GRAPHVIZ_INCLUDE_DIRS - where to find headers.
 # 		    GRAPHVIZ_LIBRARIES    - where to get libraries.
-# 		    GRAPHVIZ_FOUND        - True if Graphiz was found.
+#		    GRAPHVIZ_VERSION      - Graphviz version
+#		    GRAPHVIZ_DEFINITIONS  - Graphviz definitions
+# 		    GRAPHVIZ_FOUND        - True if Graphviz was found.
 #
 ###########################################################################
 # Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
@@ -45,6 +47,16 @@
   ${GRAPHVIZ_pathplan_LIBRARY}
   )

+IF(GRAPHVIZ_EXECUTABLE)
+  EXECUTE_PROCESS(COMMAND ${GRAPHVIZ_EXECUTABLE} "-V" ERROR_VARIABLE GRAPHVIZ_VERSION ERROR_STRIP_TRAILING_WHITESPACE)
+  STRING(REGEX REPLACE ".* ([0-9.]+) .*" "\\1" GRAPHVIZ_VERSION "${GRAPHVIZ_VERSION}")
+ENDIF()
+
+SET(GRAPHVIZ_DEFINITIONS)
+IF("${GRAPHVIZ_VERSION}" VERSION_LESS "2.36.0")
+  SET(GRAPHVIZ_DEFINITIONS -DWITH_CGRAPH)
+ENDIF()
+
 ## Don't detect cgraph on Windows
 #IF(NOT WIN32)
 #  FIND_LIBRARY(GRAPHVIZ_cgraph_LIBRARY   NAMES cgraph PATH_SUFFIXES bin)


Yet another workaround for CMake stupid behavior

--- salome_adm/cmake_files/SalomeMacros.cmake
+++ salome_adm/cmake_files/SalomeMacros.cmake
@@ -847,7 +847,8 @@
   SET(_tmp_res)
   STRING(REPLACE ";" "," _tmp_res "${${element_list}}")

-  LIST(LENGTH result _list_len)
+  # Yet another CMake stupidity - LIST(LENGTH ";" var) returns 0
+  STRING(LENGTH result _list_len)
   IF(NOT _list_len EQUAL 0)
     SET(${result} "${${result}}${_tmp_res};")  # LIST(APPEND ...) doesn't handle well empty elements!?
   ELSE()