update cmake config with new project name

--- cmake/ElmConfig.cmake
+++ cmake/ElmConfig.cmake
@@ -1,56 +1,56 @@
-# - Config file for the SEM package
+# - Config file for the Elm package
 # ===================================================================================
-#  The SEM CMake configuration file
-#  Config file for the SEM package
+#  The Elm CMake configuration file
+#  Config file for the Elm package
 #
 #  Usage from an external project:
 #    In your project's CMakeLists.txt, add these lines:
 #
-#    FIND_PACKAGE(SEM REQUIRED)
-#	 include_directories(${ELM_INCLUDE_DIRS})
-#    TARGET_LINK_LIBRARIES(MY_TARGET_NAME ${ELM_LIBS})
+#    FIND_PACKAGE(Elm REQUIRED)
+#	 include_directories(${Elm_INCLUDE_DIRS})
+#    TARGET_LINK_LIBRARIES(MY_TARGET_NAME ${Elm_LIBS})
 #
-#    Searching for specific SEM modules not supported yet.
+#    Searching for specific Elm modules not supported yet.
 #
-#    If the packages is found then ELM_FOUND is set to TRUE/ON.
+#    If the packages is found then Elm_FOUND is set to TRUE/ON.
 #
 #    This file will define the following variables:
-#      - ELM_LIBS                     : The list of libraries to link against.
-#      - ELM_LIB_DIR                  : The directory(es) where lib files are. Calling LINK_DIRECTORIES
+#      - Elm_LIBS                     : The list of libraries to link against.
+#      - Elm_LIB_DIR                  : The directory(es) where lib files are. Calling LINK_DIRECTORIES
 #                                          with this path is NOT needed.
-#      - ELM_INCLUDE_DIRS             : The SEM include directories.
+#      - Elm_INCLUDE_DIRS             : The Elm include directories.
 #
 #		TODO: define and expose version variables
-#      - ELM_VERSION                  : The version of this package build. Example: "2.4.0"
-#      - ELM_VERSION_MAJOR            : Major version part of ELM_VERSION. Example: "2"
-#      - ELM_VERSION_MINOR            : Minor version part of ELM_VERSION. Example: "4"
-#      - ELM_VERSION_PATCH            : Patch version part of ELM_VERSION. Example: "0"
+#      - Elm_VERSION                  : The version of this package build. Example: "2.4.0"
+#      - Elm_VERSION_MAJOR            : Major version part of Elm_VERSION. Example: "2"
+#      - Elm_VERSION_MINOR            : Minor version part of Elm_VERSION. Example: "4"
+#      - Elm_VERSION_PATCH            : Patch version part of Elm_VERSION. Example: "0"
 #
 # ===================================================================================
 #

 cmake_minimum_required(VERSION 2.8.7)

-set(ELM_FOUND FALSE)
+set(Elm_FOUND FALSE)

 # Compute paths
-get_filename_component(ELM_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH CACHE)
+get_filename_component(Elm_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH CACHE)

-get_filename_component(PARENT_DIR ${ELM_CMAKE_DIR} PATH)
+get_filename_component(PARENT_DIR ${Elm_CMAKE_DIR} PATH)

 message(STATUS "PARENT_DIR= ${PARENT_DIR}")
 # Are we in install prefix or in a build directory?
 if(EXISTS ${PARENT_DIR}/modules AND IS_DIRECTORY ${PARENT_DIR}/modules)

 	# install prefix
-	set(ELM_INCLUDE_DIRS ${PARENT_DIR}/modules)
-	set(ELM_LIB_DIR ${PARENT_DIR}/lib)
+	set(Elm_INCLUDE_DIRS ${PARENT_DIR}/modules)
+	set(Elm_LIB_DIR ${PARENT_DIR}/lib)

 elseif(EXISTS ${PARENT_DIR}/../include AND IS_DIRECTORY ${PARENT_DIR}/../include)

 	#build directory
-	set(ELM_INCLUDE_DIRS ${PARENT_DIR}/../include)
-	set(ELM_LIB_DIR ${PARENT_DIR}/../lib)
+	set(Elm_INCLUDE_DIRS ${PARENT_DIR}/../include)
+	set(Elm_LIB_DIR ${PARENT_DIR}/../lib)

 else()

@@ -58,17 +58,17 @@

 endif()

-file(GLOB ELM_LIBS "${ELM_LIB_DIR}/*.a")
+file(GLOB Elm_LIBS "${Elm_LIB_DIR}/*.a")

 # verify it's not an empty lib directory
-list(LENGTH ELM_LIBS ELM_NB_LIBS)
+list(LENGTH Elm_LIBS Elm_NB_LIBS)

-if(${ELM_NB_LIBS})
-	set(ELM_FOUND TRUE)
-else(${ELM_NB_LIBS})
-	set(ELM_FOUND FALSE)
-    message (FATAL_ERROR "Identified ${ELM_NB_LIBS} sem libs.")
-endif(${ELM_NB_LIBS})
+if(${Elm_NB_LIBS})
+	set(Elm_FOUND TRUE)
+else(${Elm_NB_LIBS})
+	set(Elm_FOUND FALSE)
+    message (FATAL_ERROR "Identified ${Elm_NB_LIBS} Elm libs.")
+endif(${Elm_NB_LIBS})

 # TODO: instead of duplicating, order them from depdendent to independent
-list(APPEND ${ELM_LIBS} ${ELM_LIBS})
+list(APPEND ${Elm_LIBS} ${Elm_LIBS})


[update the cmake]

[update the cmake]

--- cmake/FindCetty.cmake
+++ cmake/FindCetty.cmake
@@ -1,7 +1,10 @@
 #find cetty
 #SET(CETTY_HEADER_FILE cetty/bootstrap/Bootstrap.h)

-FIND_PATH(CETTY_INCLUDE_DIR cetty.h
+set(CETTY_HEADER_FILES cetty/bootstrap/Bootstrap.h)
+
+FIND_PATH(CETTY_INCLUDE_DIR ${CETTY_HEADER_FILES}
+	/mnt/hgfs/alp_new/cetty/include/
 	/mnt/hgfs/alp/Cetty/include
 	/mnt/hgfs/alp-2/Cetty/include
 	/usr/local/include
@@ -11,7 +14,8 @@

 FIND_LIBRARY(CETTY_LIBRARY_DIR
 	NAMES cetty
-	PATHS /mnt/hgfs/alp/Cetty/buildcmake/lib/
+	PATHS /mnt/hgfs/alp_new/cetty/mybuild/lib
+		  /mnt/hgfs/alp/Cetty/buildcmake/lib/
 		  /mnt/hgfs/alp-2/Cetty/buildcmake/lib/
 	#PATHS /mnt/hgfs/alp/Cetty/buildfpic/lib/
 		  /usr/local/lib
@@ -20,7 +24,7 @@
   )
 mark_as_advanced(CETTY_LIBRARY_DIR)

-include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+include(FindPackageHandleStandardArgs)
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(CETTY DEFAULT_MSG
     CETTY_LIBRARY_DIR CETTY_INCLUDE_DIR)


FindFFTW3.cmake: properly create FFTW3_LIBRARIES on Windows

--- cmake/FindFFTW3.cmake
+++ cmake/FindFFTW3.cmake
@@ -49,8 +49,10 @@
 					"libfftw3${_SUFFIXF}-${FFTW3_VERSION_MINOR}"
 					"fftw3${_SUFFIXF}-${FFTW3_VERSION_MINOR}"
 				PATHS ${_subdirs})
-		if("${FFTW3${_SUFFIXV}_LIBRARY}")
+		# message(STATUS "FFTW3${_SUFFIXV}_LIBRARY: ${FFTW3${_SUFFIXV}_LIBRARY}")
+		if (FFTW3${_SUFFIXV}_LIBRARY)
 			list(APPEND FFTW3_LIBRARIES "${FFTW3${_SUFFIXV}_LIBRARY}")
+			# message(STATUS "FFTW3_LIBRARIES: ${FFTW3_LIBRARIES}")
 		endif()
 	endmacro()


Updated SetupGLES.cmake

Updated SetupGLES.cmake

--- cmake/SetupGLES.cmake
+++ cmake/SetupGLES.cmake
@@ -1,20 +1,36 @@
 # mic fixme
-# search IMG and AMD library and include paths automatically
+# Under windows search for IMG and AMD includes and libraries for EGL and OpenGL ES 1 and OpenGL ES 2

-option(VL_GLES1_EXAMPLES "Build GLES 1.x examples" ON)
+option(VL_GLES_EXAMPLES "Build OpenGL ES 1.x or 2.x examples" ON)

-# set(VL_GLES_INCLUDE_DIR "NOTFOUND" CACHE STRING "Path to GLES include directories")
-set(VL_GLES_INCLUDE_DIR "C:/Imagination Technologies/POWERVR SDK/OGLES/Builds/OGLES/Include" CACHE PATH "Path to GLES include directories")
+# EGL include
+# mic fixme: remove hardcoded path
+set(VL_EGL_INCLUDE_DIR "C:/Imagination Technologies/POWERVR SDK/OGLES/Builds/OGLES/Include" CACHE PATH "Path to EGL include directories")
+if (VL_EGL_INCLUDE_DIR)
+	include_directories(${VL_EGL_INCLUDE_DIR})
+endif()
+# EGL library
+set(VL_EGL_LIB_DIR "C:/Imagination Technologies/POWERVR SDK/OGLES/Builds/OGLES/WindowsX86/Lib" CACHE PATH "Path to directory containing EGL library")
+if (VL_EGL_LIB_DIR)
+	link_directories(${VL_EGL_LIB_DIR})
+endif()
+set(VL_EGL_LIBRARY "libEGL.lib" CACHE STRING "EGL library name")

-# set(VL_GLES_LIB_DIR "NOTFOUND" CACHE STRING "Path to directory containing GLES and EGL libraries")
-set(VL_GLES_LIB_DIR "C:/Imagination Technologies/POWERVR SDK/OGLES/Builds/OGLES/WindowsX86/Lib" CACHE PATH "Path to directory containing GLES and EGL libraries")
-
-set(VL_GLES_LIBRARIES "libEGL.lib;libgles_cm.lib" CACHE STRING "GLES and EGL library names separated by ;")
-
-if (VL_GLES_INCLUDE_DIR)
-	include_directories(${VL_GLES_INCLUDE_DIR})
+# OpenGL ES library
+# mic fixme: remove hardcoded path
+#set(VL_GLES_LIB_DIR "NOTFOUND" CACHE PATH "Path to directory containing OpenGL ES library")
+if(VL_OPENGL_ES1)
+	set(VL_GLES_LIB_DIR "C:/Imagination Technologies/POWERVR SDK/OGLES/Builds/OGLES/WindowsX86/Lib" CACHE PATH "Path to directory containing OpenGL ES library")
+elseif(VL_OPENGL_ES2)
+	set(VL_GLES_LIB_DIR "C:/Imagination Technologies/POWERVR SDK/OGLES2/Builds/OGLES2/WindowsX86/Lib" CACHE PATH "Path to directory containing OpenGL ES library")
 endif()
-
 if (VL_GLES_LIB_DIR)
 	link_directories(${VL_GLES_LIB_DIR})
 endif()
+# mic fixme
+# set(VL_GLES_LIBRARY "NOTFOUND" CACHE STRING "OpenGL ES library")
+if(VL_OPENGL_ES1)
+	set(VL_GLES_LIBRARY "libgles_cm.lib" CACHE STRING "OpenGL ES library")
+elseif(VL_OPENGL_ES2)
+	set(VL_GLES_LIBRARY "libGLESv2.lib" CACHE STRING "OpenGL ES library")
+endif()


Remove check for i686.

Remove check for i686.

libxml2 is supported for 32 bit, so our build system should be checking
the target rather than native os when choosing shared libs.

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

--- cmake/config-ix.cmake
+++ cmake/config-ix.cmake
@@ -159,7 +159,7 @@
   find_library(ICONV_LIBRARY_PATH NAMES iconv libiconv libiconv-2 c)
   set(LLVM_LIBXML2_ENABLED 0)
   set(LIBXML2_FOUND 0)
-  if((LLVM_ENABLE_LIBXML2) AND (CMAKE_SYSTEM_NAME MATCHES "Linux") AND (ICONV_LIBRARY_PATH) AND (NOT LLVM_ARCH_I686))
+  if((LLVM_ENABLE_LIBXML2) AND (CMAKE_SYSTEM_NAME MATCHES "Linux") AND (ICONV_LIBRARY_PATH))
     find_package(LibXml2)
     if (LIBXML2_FOUND)
       set(LLVM_LIBXML2_ENABLED 1)
@@ -382,11 +382,6 @@
 if( LLVM_NATIVE_ARCH STREQUAL "host" )
   string(REGEX MATCH "^[^-]*" LLVM_NATIVE_ARCH ${LLVM_HOST_TRIPLE})
 endif ()
-
-set(LLVM_ARCH_I686 0)
-if (LLVM_NATIVE_ARCH MATCHES "i686")
-  set(LLVM_ARCH_I686 1)
-endif()

 if (LLVM_NATIVE_ARCH MATCHES "i[2-6]86")
   set(LLVM_NATIVE_ARCH X86)


Only replace the dest if the output has changed

--- cmake/configure.cmake
+++ cmake/configure.cmake
@@ -17,6 +17,8 @@
 function (vistk_configure_file name source dest)
   set(configure_script
     "${CMAKE_CURRENT_BINARY_DIR}/configure.${name}.cmake")
+  set(configured_path
+    "${configure_script}.output")

   file(WRITE "${configure_script}"
     "# Configure script for \"${source}\" -> \"${dest}\"\n")
@@ -29,8 +31,15 @@
   file(APPEND "${configure_script}" "
 configure_file(
   \"${source}\"
-  \"${dest}\"
+  \"${configured_path}\"
   @ONLY)\n")
+
+  file(APPEND "${configure_script}" "
+execute_process(
+  COMMAND \"${CMAKE_COMMAND}\"
+          -E copy_if_different
+          \"${configured_path}\"
+          \"${dest}\")\n")

   add_custom_command(
     OUTPUT  "${dest}"


Fixed ChangeLog creation with python

Fixed ChangeLog creation with python

--- cmake/createDoc.cmake
+++ cmake/createDoc.cmake
@@ -1,11 +1,11 @@
 find_package(Doxygen)
-if(DOXYGEN_FOUND)
+if(DOXYGEN_FOUND AND PYTHONINTERP_FOUND)

     # convert ChangeLog to Markdown for usage in doxygen
     add_custom_command(
         OUTPUT ${PROJECT_BINARY_DIR}/doc/changeLog/ChangeLog.md
         DEPENDS ${PROJECT_SOURCE_DIR}/ChangeLog
-        COMMAND python ${PROJECT_SOURCE_DIR}/misc/createChangeLog/changeLogToMD.py -i ${PROJECT_SOURCE_DIR}/ChangeLog -o ${PROJECT_BINARY_DIR}/doc/changeLog/ChangeLog.md
+        COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/misc/createChangeLog/changeLogToMD.py -i ${PROJECT_SOURCE_DIR}/ChangeLog -o ${PROJECT_BINARY_DIR}/doc/changeLog/ChangeLog.md
     )

 	configure_file(${PROJECT_SOURCE_DIR}/doc/Doxyfile.in ${PROJECT_BINARY_DIR}/doc/Doxyfile @ONLY)
@@ -147,4 +147,4 @@
 			COMMENT "Generating API documentation with Doxygen" VERBATIM
 		)
 	endif()
-endif(DOXYGEN_FOUND)
+endif(DOXYGEN_FOUND AND PYTHONINTERP_FOUND)


add link directories to use_pkg() cmake macro

--- cmake/dd-macros.cmake
+++ cmake/dd-macros.cmake
@@ -33,4 +33,7 @@

   set_target_properties(${target} PROPERTIES COMPILE_FLAGS ${_cflags_str})
   set_target_properties(${target} PROPERTIES LINK_FLAGS ${_ldflags_str})
+  link_directories(${${cachevar}_pkgconfig_LIBRARY_DIRS})
+  target_link_libraries(${target} ${${cachevar}_pkgconfig_LIBRARIES})
+
 endmacro()


update installation

update installation

git-svn-id: 6b1c4fe79111c0bc0cce83313250759594f8984b@4005 e128ff1e-fa79-4151-a8cb-522299a2c450

--- cmake/gsInstall.cmake
+++ cmake/gsInstall.cmake
@@ -35,10 +35,10 @@
   FILE "${PROJECT_BINARY_DIR}/gismoTargets.cmake" APPEND)
 endif()

-if(GISMO_WITH_ONURBS)
-  export(TARGETS gsOpennurbsExtension
-    FILE "${PROJECT_BINARY_DIR}/gismoTargets.cmake" APPEND)
-endif(GISMO_WITH_ONURBS)
+#if(GISMO_WITH_ONURBS)
+#  export(TARGETS gsOpennurbsExtension
+#    FILE "${PROJECT_BINARY_DIR}/gismoTargets.cmake" APPEND)
+#endif(GISMO_WITH_ONURBS)

 # Export the package for use from the build-tree
 # (this registers the build-tree with a global CMake-registry)


mute 'runtime library file does not exist' cmake warning, when using express editions of MSVC

git-svn-id: e7ea667a1d39a4453c4efcc4ba7bca3d620c3f19@4477 a9d63959-f2ad-4865-b262-bf0e56cfafb6

--- cmake/pcl_cpack.cmake
+++ cmake/pcl_cpack.cmake
@@ -58,6 +58,10 @@
   endif(EXISTS ${PACKAGE_MAKER_PROGRAM})
 endif()

+# By default, do not warn when built on machines using only VS Express:
+if(NOT DEFINED CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS)
+  set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS ON)
+endif()
 include(InstallRequiredSystemLibraries)

 set(PCL_CPACK_CFG_FILE "${PCL_BINARY_DIR}/cpack_options.cmake")


Split generated unity build translation units into volumes of max 500 real translation units each

--- cmake/utilities.cmake
+++ cmake/utilities.cmake
@@ -11,24 +11,54 @@

 # this function is based on the unity build function described at: https://cheind.wordpress.com/2009/12/10/reducing-compilation-time-unity-builds/
 function(enable_unity_build UNITY_SUFFIX SOURCE_FILES)
+    set(MAX_TRANSLATION_UNITS_PER_UNITY_UNIT 500)
+
     set(files ${${SOURCE_FILES}})
+    list(LENGTH files length)
+
+    set(UNITY_FILE_COUNT "")
+    if (length GREATER ${MAX_TRANSLATION_UNITS_PER_UNITY_UNIT})
+        set(UNITY_FILE_COUNT 1)
+    endif()
+
+    set(SOURCE_FILE_COUNT 0)

     # Generate a unique filename for the unity build translation unit
-    set(unity_build_file ${CMAKE_CURRENT_BINARY_DIR}/ub_${UNITY_SUFFIX}.cpp)
+    set(unity_build_file ${CMAKE_CURRENT_BINARY_DIR}/ub${UNITY_FILE_COUNT}_${UNITY_SUFFIX}.cpp)

     # Exclude all translation units from compilation
     set_source_files_properties(${files} PROPERTIES HEADER_FILE_ONLY true)

     # Open the ub file
-    FILE(WRITE ${unity_build_file} "// Unity Build generated by CMake\n")
-
-    # Add include statement for each translation unit
-    foreach(source_file ${files} )
-        FILE( APPEND ${unity_build_file} "#include <${source_file}>\n")
-    endforeach(source_file)
+    if (length GREATER ${MAX_TRANSLATION_UNITS_PER_UNITY_UNIT})
+        FILE(WRITE ${unity_build_file} "// Unity Build Volume ${UNITY_FILE_COUNT} generated by CMake\n")
+    else()
+        FILE(WRITE ${unity_build_file} "// Unity Build generated by CMake\n")
+    endif()

     # Complement list of translation units with the name of ub
-    set(${SOURCE_FILES} ${${SOURCE_FILES}} ${unity_build_file} PARENT_SCOPE)
+    list(APPEND ${SOURCE_FILES} "${unity_build_file}")
+    set(${SOURCE_FILES} ${${SOURCE_FILES}} PARENT_SCOPE)
+
+    foreach(source_file ${files} )
+        if(SOURCE_FILE_COUNT EQUAL ${MAX_TRANSLATION_UNITS_PER_UNITY_UNIT})
+            MATH(EXPR UNITY_FILE_COUNT "${UNITY_FILE_COUNT}+1")
+            set(SOURCE_FILE_COUNT 0)
+
+            set(unity_build_file ${CMAKE_CURRENT_BINARY_DIR}/ub${UNITY_FILE_COUNT}_${UNITY_SUFFIX}.cpp)
+            # Open the ub file
+            FILE(WRITE ${unity_build_file} "// Unity Build Volume ${UNITY_FILE_COUNT} generated by CMake\n")
+
+            # Complement list of translation units with the name of ub
+            list(APPEND ${SOURCE_FILES} "${unity_build_file}")
+            set(${SOURCE_FILES} ${${SOURCE_FILES}} PARENT_SCOPE)
+        endif()
+
+        # Add include statement for each translation unit
+        FILE( APPEND ${unity_build_file} "#include <${source_file}>\n")
+
+        MATH(EXPR SOURCE_FILE_COUNT "${SOURCE_FILE_COUNT}+1")
+    endforeach(source_file)
 endfunction(enable_unity_build)

 macro(setup_install)


Notify installation location only once

Notify installation location only once

--- CMake/hoomd/HOOMDPythonSetup.cmake
+++ CMake/hoomd/HOOMDPythonSetup.cmake
@@ -34,4 +34,4 @@
         "Python site-packages directory (relative to CMAKE_INSTALL_PREFIX)" FORCE)
 endif()

-message(STATUS "Installing hoomd python module to: ${CMAKE_INSTALL_PREFIX}/${PYTHON_SITE_INSTALL_DIR}")
+find_package_message(hoomd_install "Installing hoomd python module to: ${CMAKE_INSTALL_PREFIX}/${PYTHON_SITE_INSTALL_DIR}" "[${CMAKE_INSTALL_PREFIX}][${PYTHON_SITE_INSTALL_DIR}]")


BUG: Unnecessary tools from niral_utilities are not compiled anymore

POLYDATATRANSFORM and POLYDATAMERGE need GenerateCLP to be built. Only SlicerExecutionModel_DIR is given to the derived Superbuild projects in the DTIPrep build system. The tools that need GenerateCLP could not find it. To avoid this compilation issue, we do not build these tools that are not needed by DTIPrep.

--- SuperBuild/External_niral_utilities.cmake
+++ SuperBuild/External_niral_utilities.cmake
@@ -57,16 +57,16 @@
   set(${proj}_CMAKE_OPTIONS
     -DCOMPILE_CONVERTITKFORMATS:BOOL=ON
     -DCOMPILE_CORREVAL:BOOL=OFF
-    -DCOMPILE_CROPTOOLS:BOOL=ON
+    -DCOMPILE_CROPTOOLS:BOOL=OFF
     -DCOMPILE_CURVECOMPARE:BOOL=OFF
     -DCOMPILE_DMDBIOMARKERTOOL:BOOL=OFF
     -DCOMPILE_DTIAtlasBuilder:BOOL=OFF
     -DCOMPILE_DWI_NIFTINRRDCONVERSION:BOOL=OFF
     -DCOMPILE_IMAGEMATH:BOOL=ON
-    -DCOMPILE_IMAGESTAT:BOOL=ON
+    -DCOMPILE_IMAGESTAT:BOOL=OFF
     -DCOMPILE_MULTIATLASSEG:BOOL=OFF
-    -DCOMPILE_POLYDATAMERGE:BOOL=ON
-    -DCOMPILE_POLYDATATRANSFORM:BOOL=ON
+    -DCOMPILE_POLYDATAMERGE:BOOL=OFF
+    -DCOMPILE_POLYDATATRANSFORM:BOOL=OFF
     -DCOMPILE_TRANSFORMDEFORMATIONFIELD:BOOL=OFF
     -DCOMPILE_TEXTUREBIOMARKERTOOL:BOOL=OFF
     -DUSE_SYSTEM_SlicerExecutionModel:BOOL=ON


Use -Wl,--as-needed also for gcc 4.8 and future versions (Dario)

--- cmake/CMakelinuxx8664gcc.cmake
+++ cmake/CMakelinuxx8664gcc.cmake
@@ -68,8 +68,8 @@
   set(CXXFLAGS "${OPT} -fPIC -pipe -fmessage-length=0 -Dlinux")
   add_definitions(-Dlinux)
   set(CXXFLAGSNO "${NOOPT} -fPIC -pipe -fmessage-length=0")
-  if(CCMINORV STRGREATER 5 AND CCMINORV STRLESS 8)
-    message("-- 4.5 < GCC version < 4.8 - mask default -Wl,--as-needed")
+  if(CCMINORV STRGREATER 5)
+    message("-- GCC version > 4.5 - mask default -Wl,--as-needed")
     set(XTRA_LDFLAGS "-Wl,--no-as-needed")
   endif()


Fix clang configuration output

Fix clang configuration output

--- cmake/PlatformLinuxClang.cmake
+++ cmake/PlatformLinuxClang.cmake
@@ -1,9 +1,7 @@
-message(STATUS "Configuring for platform Linux/GCC.")
+message(STATUS "Configuring for platform Linux/Clang.")

 # Enable C++11 support
-
-message(STATUS "Configuring for Clang")

 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")


Improve heuristic checking if patches should be re-applied

The "applied" file indicating if a patch has been applied is now
written in the source directory. This allows to check if a source
tree was removed and re-downloaded.

To ensure existing build tree remains in a good state, we also check
if a legacy "applied" file exists.

--- cmake/PythonApplyPatches.cmake
+++ cmake/PythonApplyPatches.cmake
@@ -21,7 +21,12 @@
   foreach(patch IN LISTS _patches)
     set(msg "Applying '${patch}'")
     message(STATUS "${msg}")
-    set(applied ${PROJECT_BINARY_DIR}/CMakeFiles/patches/${patch}.applied)
+    set(applied ${SRC_DIR}/.patches/${patch}.applied)
+    # Handle case where source tree was patched using the legacy approach.
+    set(legacy_applied ${PROJECT_BINARY_DIR}/CMakeFiles/patches/${patch}.applied)
+    if(EXISTS ${legacy_applied})
+      set(applied ${legacy_applied})
+    endif()
     if(EXISTS ${applied})
       message(STATUS "${msg} - skipping (already applied)")
       continue()


incremented version number

incremented version number

--- cmake/global_versioninfo.cmake
+++ cmake/global_versioninfo.cmake
@@ -16,7 +16,7 @@

 # MEGAMOL CORE VERSION
 set(MEGAMOL_MAJOR 1)
-set(MEGAMOL_MINOR 2)
+set(MEGAMOL_MINOR 3)
 set(MEGAMOL_PATCH 0)
 set(MEGAMOL_VERSION ${MEGAMOL_MAJOR}.${MEGAMOL_MINOR}.${MEGAMOL_PATCH})


Include more headers from the source directory during build

This amends commit 663868be371ae1b8c478749d9c5dedfe7d916550.
Using include_directories(BEFORE ${CMAKE_BINARY_DIR}/include)
hides problems of missing dependencies and missing includes
due to headers being copied to ${CMAKE_BINARY_DIR}/include
at configuration time.

--- cmake/modules/RootMacros.cmake
+++ cmake/modules/RootMacros.cmake
@@ -836,12 +836,41 @@
 function(ROOT_OBJECT_LIBRARY library)
   CMAKE_PARSE_ARGUMENTS(ARG "" "" "BUILTINS"  ${ARGN})
   ROOT_GET_SOURCES(lib_srcs src ${ARG_UNPARSED_ARGUMENTS})
-  include_directories(BEFORE ${CMAKE_BINARY_DIR}/include)
   add_library( ${library} OBJECT ${lib_srcs})
   if(lib_srcs MATCHES "(^|/)(G__[^.]*)[.]cxx.*")
      add_dependencies(${library} ${CMAKE_MATCH_2})
   endif()
   add_dependencies(${library} move_headers)
+
+  if(PROJECT_NAME STREQUAL "ROOT")
+    if(IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/inc)
+      target_include_directories(${library}
+        PRIVATE
+          ${CMAKE_CURRENT_SOURCE_DIR}/inc
+        INTERFACE
+          $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/inc>
+      )
+    endif()
+
+    if(root7 AND IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/v7/inc)
+      target_include_directories(${library}
+        PRIVATE
+          ${CMAKE_CURRENT_SOURCE_DIR}/v7/inc
+        INTERFACE
+          $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/v7/inc>
+      )
+    endif()
+
+    if(IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/res)
+      target_include_directories(${library}
+        PRIVATE
+          ${CMAKE_CURRENT_SOURCE_DIR}/res
+      )
+    endif()
+
+    # needed for generated headers like RConfigure.h and ROOT/RConfig.hxx
+    target_include_directories(${library} PRIVATE ${CMAKE_BINARY_DIR}/include)
+  endif()

   #--- Only for building shared libraries
   set_property(TARGET ${library} PROPERTY POSITION_INDEPENDENT_CODE 1)
@@ -896,7 +925,6 @@
 function(ROOT_MODULE_LIBRARY library)
   CMAKE_PARSE_ARGUMENTS(ARG "" "" "LIBRARIES" ${ARGN})
   ROOT_GET_SOURCES(lib_srcs src ${ARG_UNPARSED_ARGUMENTS})
-  include_directories(BEFORE ${CMAKE_BINARY_DIR}/include)
   add_library(${library} SHARED ${lib_srcs})
   add_dependencies(${library} move_headers)
   set_target_properties(${library}  PROPERTIES ${ROOT_LIBRARY_PROPERTIES})
@@ -905,6 +933,36 @@
   # creates extra module variants, and not useful because we don't use these
   # macros.
   set_target_properties(${library} PROPERTIES DEFINE_SYMBOL "")
+
+  if(PROJECT_NAME STREQUAL "ROOT")
+    if(IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/inc)
+      target_include_directories(${library}
+        PRIVATE
+          ${CMAKE_CURRENT_SOURCE_DIR}/inc
+        INTERFACE
+          $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/inc>
+      )
+    endif()
+
+    if(root7 AND IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/v7/inc)
+      target_include_directories(${library}
+        PRIVATE
+          ${CMAKE_CURRENT_SOURCE_DIR}/v7/inc
+        INTERFACE
+          $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/v7/inc>
+      )
+    endif()
+
+    if(IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/res)
+      target_include_directories(${library}
+        PRIVATE
+          ${CMAKE_CURRENT_SOURCE_DIR}/res
+      )
+    endif()
+
+    # needed for generated headers like RConfigure.h and ROOT/RConfig.hxx
+    target_include_directories(${library} PRIVATE ${CMAKE_BINARY_DIR}/include)
+  endif()

   target_link_libraries(${library} PUBLIC ${ARG_LIBRARIES})
   #----Installation details-------------------------------------------------------


[ci] enable second_deadlock_stack for TSan

Summary: this gives us more informative error logs when TSan detects a lock inversion

Test Plan:
invert a LOCK2(...) in a test somewhere

  CC=clang CXX=clang++ cmake .. -GNinja -DENABLE_SANITIZERS=thread
  ninja all check

make sure the TSan warning output is more informative

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Differential Revision: https://reviews.bitcoinabc.org/D9090

--- cmake/modules/Sanitizers.cmake
+++ cmake/modules/Sanitizers.cmake
@@ -47,6 +47,7 @@
 		add_test_environment(LSAN_OPTIONS "suppressions=${SAN_SUPP_DIR}/lsan:$ENV{LSAN_OPTIONS}")
 	endif()
 	if("thread" IN_LIST ARGN)
+		add_test_environment(TSAN_OPTIONS "second_deadlock_stack=1:$ENV{TSAN_OPTIONS}")
 		add_test_environment(TSAN_OPTIONS "suppressions=${SAN_SUPP_DIR}/tsan:$ENV{TSAN_OPTIONS}")
 	endif()
 	if("undefined" IN_LIST ARGN)


updated rpath settings

updated rpath settings

--- cmake/oskar_build_macros.cmake
+++ cmake/oskar_build_macros.cmake
@@ -29,7 +29,7 @@
     target_link_libraries(${name} oskar ${MATLAB_LIBRARIES})
     set_target_properties(${name} PROPERTIES
         PREFIX "" SUFFIX ".${MATLAB_MEXFILE_EXT}"
-        INSTALL_RPATH ${OSKAR_LIB_INSTALL_DIR}
+        INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/${OSKAR_LIB_INSTALL_DIR}
         INSTALL_RPATH_USE_LINK_PATH TRUE
         COMPILE_FLAGS ${MATLAB_CXX_FLAGS}
         LINK_FLAGS ${MATLAB_CXX_FLAGS})


ENH: update libgeotiff to 1.4.2

ENH: update libgeotiff to 1.4.2

--- SuperBuild/CMake/External_geotiff.cmake
+++ SuperBuild/CMake/External_geotiff.cmake
@@ -46,8 +46,8 @@

   ExternalProject_Add(GEOTIFF
     PREFIX GEOTIFF
-    URL "http://download.osgeo.org/geotiff/libgeotiff/libgeotiff-1.4.1.tar.gz"
-    URL_MD5 48bdf817e6e7a37671cc1f41b01e10fc
+    URL "http://download.osgeo.org/geotiff/libgeotiff/libgeotiff-1.4.2.tar.gz"
+    URL_MD5 96ab80e0d4eff7820579957245d844f8
     SOURCE_DIR ${GEOTIFF_SB_SRC}
     BINARY_DIR ${GEOTIFF_SB_SRC}
     INSTALL_DIR ${SB_INSTALL_PREFIX}
@@ -72,8 +72,8 @@

   ExternalProject_Add(GEOTIFF
     PREFIX GEOTIFF
-    URL "http://download.osgeo.org/geotiff/libgeotiff/libgeotiff-1.4.1.tar.gz"
-    URL_MD5 48bdf817e6e7a37671cc1f41b01e10fc
+    URL "http://download.osgeo.org/geotiff/libgeotiff/libgeotiff-1.4.2.tar.gz"
+    URL_MD5 96ab80e0d4eff7820579957245d844f8
     SOURCE_DIR ${GEOTIFF_SB_SRC}
     BINARY_DIR ${GEOTIFF_SB_BUILD_DIR}
     INSTALL_DIR ${SB_INSTALL_PREFIX}


Fixing data deps on test targets in cmake (#2535)

--- build_tools/cmake/iree_macros.cmake
+++ build_tools/cmake/iree_macros.cmake
@@ -130,7 +130,8 @@
   # Otherwise it must be a target defined in the current CMake invocation
   # and we can just use `$<TARGET_FILE:${TARGET}>` on it.
   set(${OUTPUT_VAR}
-      "$IF:$<TARGET_PROPERTY:${TARGET},HOST_TARGET_FILE>:$<TARGET_PROPERTY:${TARGET},HOST_TARGET_FILE>,$<TARGET_FILE:${TARGET}>")
+      "$<IF:$<BOOL:$<TARGET_PROPERTY:${TARGET},HOST_TARGET_FILE>>,$<TARGET_PROPERTY:${TARGET},HOST_TARGET_FILE>,$<TARGET_FILE:${TARGET}>>"
+      PARENT_SCOPE)
 endfunction()

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


when building the swift libs, do not automatically import _Concurrency

This fixes issues when building Swift with concurrency enabled by default. See rdar://71045297

If some of our overlays need to use the concurrency API, they can manually import _Concurrency.

--- stdlib/cmake/modules/AddSwiftStdlib.cmake
+++ stdlib/cmake/modules/AddSwiftStdlib.cmake
@@ -1657,6 +1657,12 @@
     list(APPEND SWIFTLIB_DEPENDS clang)
   endif()

+  # Turn off implicit import of _Concurrency when building libraries
+  if(SWIFT_ENABLE_EXPERIMENTAL_CONCURRENCY)
+    list(APPEND SWIFTLIB_SWIFT_COMPILE_FLAGS
+                      "-Xfrontend;-disable-implicit-concurrency-module-import")
+  endif()
+
   # If we are building this library for targets, loop through the various
   # SDKs building the variants of this library.
   list_intersect(


Fixed a typo in android toolchain documentation.

--- platforms/android/android.toolchain.cmake
+++ platforms/android/android.toolchain.cmake
@@ -157,7 +157,7 @@
 #                          Silently degrades to gnustl_static if not available.
 #        c++_static     -> Use the LLVM libc++ runtime as a static library.
 #                          Implies -frtti -fexceptions.
-#        c++_shared     -> Use the LLVM libc++ runtime as a static library.
+#        c++_shared     -> Use the LLVM libc++ runtime as a shared library.
 #                          Implies -frtti -fno-exceptions.
 #
 #    ANDROID_STL_FORCE_FEATURES=ON - turn rtti and exceptions support based on


removed "project" interface

removed "project" interface

--- project.cmake
+++ project.cmake
@@ -8,25 +8,23 @@
 include(layers/install_pkg_config)
 include(layers/install_cmake_config)

-bde_prefixed_override(bdeproj project_setup_interface)
-function(bdeproj_project_setup_interface proj)
-    bde_assert_no_extra_args()
+function(bdeproj_uor_setup_interface uor)
+    uor_setup_interface_base("" ${ARGV})

-    project_setup_interface_base("" ${ARGV})
-
-    bde_struct_get_field(interfaceTarget ${proj} INTERFACE_TARGET)
+    bde_struct_get_field(interfaceTarget ${uor} INTERFACE_TARGET)
     bde_interface_target_compile_definitions(
         ${interfaceTarget}
         PUBLIC
             $<$<NOT:$<BOOL:$<TARGET_PROPERTY:SUPPRESS_BSL_OVERRIDES_STD>>>:BSL_OVERRIDES_STD>
     )
-
-    bde_return(${proj})
 endfunction()

 bde_prefixed_override(bdeproj project_process_uors)
 function(bdeproj_project_process_uors proj listDir)
     bde_assert_no_extra_args()
+
+    bde_record_overrides()
+    bde_prefixed_override(bdeproj uor_setup_interface)

     bde_project_process_package_groups(
         ${proj}
@@ -37,6 +35,8 @@
         ${listDir}/groups/btl
     )

+    bde_remove_recorded_overrides()
+
     bde_project_process_standalone_packages(
         ${proj}
         ${listDir}/thirdparty/decnumber


--- toolchains/android-studio.toolchain.cmake
+++ toolchains/android-studio.toolchain.cmake
@@ -33,6 +33,11 @@
 string( REPLACE "-fstack-protector-strong" ""    CMAKE_CXX_FLAGS                "${CMAKE_CXX_FLAGS}"        )
 string( REPLACE "-fstack-protector-strong" ""    CMAKE_ASM_FLAGS                "${CMAKE_ASM_FLAGS}"        )

+string( REPLACE "-D_FORTIFY_SOURCE=2"      ""    ANDROID_COMPILER_FLAGS         "${ANDROID_COMPILER_FLAGS}" )
+string( REPLACE "-D_FORTIFY_SOURCE=2"      ""    CMAKE_C_FLAGS                  "${CMAKE_C_FLAGS}  "        )
+string( REPLACE "-D_FORTIFY_SOURCE=2"      ""    CMAKE_CXX_FLAGS                "${CMAKE_CXX_FLAGS}"        )
+string( REPLACE "-D_FORTIFY_SOURCE=2"      ""    CMAKE_ASM_FLAGS                "${CMAKE_ASM_FLAGS}"        )
+
 string( REPLACE "-O2"                      "-O3" ANDROID_COMPILER_FLAGS_RELEASE "${ANDROID_COMPILER_FLAGS_RELEASE}" )
 string( REPLACE "-O2"                      "-O3" CMAKE_C_FLAGS_RELEASE          "${CMAKE_C_FLAGS_RELEASE}  "        )
 string( REPLACE "-O2"                      "-O3" CMAKE_CXX_FLAGS_RELEASE        "${CMAKE_CXX_FLAGS_RELEASE}"        )
@@ -54,6 +59,9 @@
 else()
     include( "${CMAKE_CURRENT_LIST_DIR}/gcc.cmake" )
 endif()
+
+# Re-enable source fortification only in debug/development builds
+set( TNUN_compiler_assertions -D_FORTIFY_SOURCE=2 )

 set( TNUN_arch_include_dir "${CMAKE_CURRENT_LIST_DIR}/android" )
 set( TNUN_ABI  ${ANDROID_ABI} )


Delete GObjectIntrospectionMacros.cmake

Delete GObjectIntrospectionMacros.cmake

--- cmake/GObjectIntrospectionMacros.cmake
+++ cmake/GObjectIntrospectionMacros.cmake
@@ -1,34 +0,0 @@
-macro(add_target_gir TARGET_NAME GIR_NAME HEADER CFLAGS GRANITE_VERSION)
-    set(PACKAGES "")
-    foreach(PKG ${ARGN})
-        set(PACKAGES ${PACKAGES} --include=${PKG})
-    endforeach()
-    install(CODE "set(ENV{LD_LIBRARY_PATH} \"${CMAKE_CURRENT_BINARY_DIR}:\$ENV{LD_LIBRARY_PATH}\")
-    execute_process(COMMAND g-ir-scanner ${CFLAGS} -n ${GIR_NAME}
-            --quiet
-            --library ${TARGET_NAME} ${PACKAGES}
-            -o ${CMAKE_CURRENT_BINARY_DIR}/${GIR_NAME}-${GRANITE_VERSION}.gir
-            -L${CMAKE_CURRENT_BINARY_DIR}
-            --nsversion=${GRANITE_VERSION} ${HEADER})")
-    install(CODE "execute_process(COMMAND g-ir-compiler ${CMAKE_CURRENT_BINARY_DIR}/${GIR_NAME}-${GRANITE_VERSION}.gir -o ${CMAKE_CURRENT_BINARY_DIR}/${GIR_NAME}-${GRANITE_VERSION}.typelib)")
-    install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${GIR_NAME}-${GRANITE_VERSION}.gir DESTINATION share/gir-1.0/)
-    install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${GIR_NAME}-${GRANITE_VERSION}.typelib DESTINATION lib/girepository-1.0/)
-endmacro()
-
-macro(add_target_gir_with_executable TARGET_NAME EXE_NAME GIR_NAME HEADER EXE_HEADER CFLAGS GRANITE_VERSION)
-    set(PACKAGES "")
-    foreach(PKG ${ARGN})
-        set(PACKAGES ${PACKAGES} --include=${PKG})
-    endforeach()
-    install(CODE "set(ENV{LD_LIBRARY_PATH} \"${CMAKE_CURRENT_BINARY_DIR}:\$ENV{LD_LIBRARY_PATH}\")
-    execute_process(COMMAND g-ir-scanner ${CFLAGS} -n ${GIR_NAME}
-            --quiet
-            --library ${TARGET_NAME} --program ${EXE_NAME} ${PACKAGES}
-            -o ${CMAKE_CURRENT_BINARY_DIR}/${GIR_NAME}-${GRANITE_VERSION}.gir
-            -L${CMAKE_CURRENT_BINARY_DIR}
-            -I${CMAKE_CURRENT_BINARY_DIR}
-            --nsversion=${GRANITE_VERSION} ${HEADER} ${EXE_HEADER})")
-    install(CODE "execute_process(COMMAND g-ir-compiler ${CMAKE_CURRENT_BINARY_DIR}/${GIR_NAME}-${GRANITE_VERSION}.gir -o ${CMAKE_CURRENT_BINARY_DIR}/${GIR_NAME}-${GRANITE_VERSION}.typelib)")
-    install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${GIR_NAME}-${GRANITE_VERSION}.gir DESTINATION share/gir-1.0/)
-    install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${GIR_NAME}-${GRANITE_VERSION}.typelib DESTINATION lib/girepository-1.0/)
-endmacro()


Disable SSE instructions when compiling with MinGW as MinGW-w64 fails with them in 32bit mode.

--- cmake/Modules/Urho3D-CMake-magic.cmake
+++ cmake/Modules/Urho3D-CMake-magic.cmake
@@ -135,7 +135,8 @@
         else ()
             set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m32")
             set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m32")
-            if (ENABLE_SSE)
+            # MinGW-w64 may fail when specifying the SSE instruction set, so only enable when not compiling on Windows
+            if (ENABLE_SSE AND NOT WIN32)
                 set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -msse")
                 set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse")
             endif ()
@@ -271,7 +272,7 @@
         elseif (URHO3D_BUILD_TYPE STREQUAL STATIC)
             set_target_properties (${TARGET_NAME} PROPERTIES COMPILE_DEFINITIONS URHO3D_STATIC_DEFINE)
         endif ()
-
+
         # Locate the location of the objects that are used to link to this target to be used later by Urho3D library target
         if (MSVC)
             # Specific to VS generator


Eliminate -fvisibility=hidden option from CFLAGS for shapelib if the
user specifies it as an overall environment variable to be honored by
build_projects build.  The reason this workaround is required is
shapelib currently has no visibility support for Linux.

svn path=/trunk/; revision=12610

--- cmake/build_projects/shapelib/bp.cmake
+++ cmake/build_projects/shapelib/bp.cmake
@@ -47,11 +47,15 @@
 endif(MSYS_PLATFORM)
 #message(STATUS "modified BP_PATH for ${BP_PACKAGE} = ${BP_PATH}")

+set(${BP_PACKAGE}_CFLAGS $ENV{CFLAGS})
+# Eliminate this option which is not allowed for shapelib
+string(REGEX REPLACE "-fvisibility=hidden" "" ${BP_PACKAGE}_CFLAGS ${${BP_PACKAGE}_CFLAGS})
+
 ExternalProject_Add(
   build_${BP_PACKAGE}
   URL ${${BP_PACKAGE}_URL}
   URL_MD5 ${${BP_PACKAGE}_URL_MD5}
-  CONFIGURE_COMMAND ${ENV_EXECUTABLE} PATH=${BP_PATH} ${BP_CMAKE_COMMAND} -DEG_DATA:PATH=${EP_BASE}/Source/build_${BP_PACKAGE}/eg_data ${EP_BASE}/Source/build_${BP_PACKAGE}
+  CONFIGURE_COMMAND ${ENV_EXECUTABLE} PATH=${BP_PATH} CFLAGS=${${BP_PACKAGE}_CFLAGS} ${BP_CMAKE_COMMAND} -DEG_DATA:PATH=${EP_BASE}/Source/build_${BP_PACKAGE}/eg_data ${EP_BASE}/Source/build_${BP_PACKAGE}
   BUILD_COMMAND ${ENV_EXECUTABLE} PATH=${BP_PATH} ${BP_PARALLEL_BUILD_COMMAND}
   TEST_BEFORE_INSTALL ON
   TEST_COMMAND ${ENV_EXECUTABLE} PATH=${BP_PATH} ${BP_PARALLEL_CTEST_COMMAND}


Adding support for easybuild

Adding support for easybuild

Former-commit-id: 15c25b027acc8d3a499e66d061fa1a4e6d188ce2

--- cmake-modules/FindPackageHDF5.cmake
+++ cmake-modules/FindPackageHDF5.cmake
@@ -74,6 +74,10 @@
     if(HDF5_C_LIBRARY_sz)
         target_link_libraries(hdf5 INTERFACE $<LINK_ONLY:-lsz>  )
     endif()
+    if(HDF5_IS_PARALLEL)
+        find_package(MPI REQUIRED)
+        target_link_libraries(hdf5 INTERFACE MPI::MPI_C  )
+    endif()
 #    if(HDF5_C_LIBRARY_z)
 #        target_link_libraries(hdf5 INTERFACE $<LINK_ONLY:-lz>  )
 #    endif()


CMake: Ensure that CMakeFiles/Dictionaries/ exist

This is workaround for older CMake not creating target directory
for custom commands.

Former-commit-id: 9e286fc871f8fa68809f7a71160c029bf2c9ecb8

--- cmake/JPetFramework-Utilities.cmake
+++ cmake/JPetFramework-Utilities.cmake
@@ -41,6 +41,7 @@
     endif()
     if(NOT skip)
       # output dictionary file will be kept in CMake build folder
+      file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/Dictionaries)
       set(dictionary
         ${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/Dictionaries/${name}Dictionary)
       if(EXISTS ${linkdef})


[compiler-rt] Use exact spelling when building for default target

When building for default target only, use exact target spelling
when deriving the name for the per-target runtime directory. This
is necessary for AArch32 where the CMake build by default rewrites
the architecture which leads to unexpected results.

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

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

--- cmake/Modules/CompilerRTUtils.cmake
+++ cmake/Modules/CompilerRTUtils.cmake
@@ -337,7 +337,10 @@
 function(get_compiler_rt_target arch variable)
   string(FIND ${COMPILER_RT_DEFAULT_TARGET_TRIPLE} "-" dash_index)
   string(SUBSTRING ${COMPILER_RT_DEFAULT_TARGET_TRIPLE} ${dash_index} -1 triple_suffix)
-  if(ANDROID AND ${arch} STREQUAL "i386")
+  if(COMPILER_RT_DEFAULT_TARGET_ONLY)
+    # Use exact spelling when building only for the target specified to CMake.
+    set(target "${COMPILER_RT_DEFAULT_TARGET_TRIPLE}")
+  elseif(ANDROID AND ${arch} STREQUAL "i386")
     set(target "i686${COMPILER_RT_OS_SUFFIX}${triple_suffix}")
   else()
     set(target "${arch}${triple_suffix}")


cmake: add haswell option for arch

cmake: add haswell option for arch

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

--- cmake/OptimizeForArchitecture.cmake
+++ cmake/OptimizeForArchitecture.cmake
@@ -142,7 +142,7 @@
 endmacro()

 macro(OptimizeForArchitecture)
-   set(TARGET_ARCHITECTURE "auto" CACHE STRING "CPU architecture to optimize for. Using an incorrect setting here can result in crashes of the resulting binary because of invalid instructions used.\nSetting the value to \"auto\" will try to optimize for the architecture where cmake is called.\nOther supported values are: \"none\", \"generic\", \"core\", \"merom\" (65nm Core2), \"penryn\" (45nm Core2), \"nehalem\", \"westmere\", \"sandy-bridge\", \"ivy-bridge\", \"atom\", \"k8\", \"k8-sse3\", \"barcelona\", \"istanbul\", \"magny-cours\", \"bulldozer\", \"interlagos\", \"piledriver\", \"AMD 14h\", \"AMD 16h\".")
+   set(TARGET_ARCHITECTURE "auto" CACHE STRING "CPU architecture to optimize for. Using an incorrect setting here can result in crashes of the resulting binary because of invalid instructions used.\nSetting the value to \"auto\" will try to optimize for the architecture where cmake is called.\nOther supported values are: \"none\", \"generic\", \"core\", \"merom\" (65nm Core2), \"penryn\" (45nm Core2), \"nehalem\", \"westmere\", \"sandy-bridge\", \"ivy-bridge\", \"haswell\", \"atom\", \"k8\", \"k8-sse3\", \"barcelona\", \"istanbul\", \"magny-cours\", \"bulldozer\", \"interlagos\", \"piledriver\", \"AMD 14h\", \"AMD 16h\".")
    set(_force)
    if(NOT _last_target_arch STREQUAL "${TARGET_ARCHITECTURE}")
       message(STATUS "target changed from \"${_last_target_arch}\" to \"${TARGET_ARCHITECTURE}\"")
@@ -188,6 +188,12 @@
       list(APPEND _march_flag_list "corei7")
       list(APPEND _march_flag_list "core2")
       list(APPEND _available_vector_units_list "sse" "sse2" "sse3" "ssse3" "sse4.1" "sse4.2")
+   elseif(TARGET_ARCHITECTURE STREQUAL "haswell")
+      list(APPEND _march_flag_list "core-avx2")
+      list(APPEND _march_flag_list "core-avx-i")
+      list(APPEND _march_flag_list "corei7-avx")
+      list(APPEND _march_flag_list "core2")
+      list(APPEND _available_vector_units_list "sse" "sse2" "sse3" "ssse3" "sse4.1" "sse4.2" "avx" "avx2" "rdrnd" "f16c" "fma")
    elseif(TARGET_ARCHITECTURE STREQUAL "ivy-bridge")
       list(APPEND _march_flag_list "core-avx-i")
       list(APPEND _march_flag_list "corei7-avx")


CMake: Add include/opencascade to include path alternatives

--- cmake/modules/FindOPENCASCADE.cmake
+++ cmake/modules/FindOPENCASCADE.cmake
@@ -38,7 +38,7 @@

 DEAL_II_FIND_PATH(OPENCASCADE_INCLUDE_DIR Standard_Version.hxx
   HINTS ${OPENCASCADE_DIR}
-  PATH_SUFFIXES include include/oce inc
+  PATH_SUFFIXES include include/oce include/opencascade inc
   )

 IF(EXISTS ${OPENCASCADE_INCLUDE_DIR}/Standard_Version.hxx)


Add 'clean up done' message

Add 'clean up done' message

--- cmake/modules/hunter_download.cmake
+++ cmake/modules/hunter_download.cmake
@@ -437,5 +437,7 @@
     file(REMOVE_RECURSE "${HUNTER_PACKAGE_INSTALL_PREFIX}")
   endif()

+  hunter_status_debug("Clean up done")
+
   file(WRITE "${HUNTER_PACKAGE_DONE_STAMP}" "")
 endfunction()


Update osvrRenderManagerConfig.cmake

Update osvrRenderManagerConfig.cmake

Don't unconditionally search for (and apparently require) SDL2 and GLEW

--- cmake/osvrRenderManagerConfig.cmake
+++ cmake/osvrRenderManagerConfig.cmake
@@ -12,11 +12,13 @@
 include(CMakeFindDependencyMacro)
 set(OSVRRM_NEED_SDL2 @OSVRRM_NEED_SDL2@)
 if(OSVRRM_NEED_SDL2)
-	find_dependency(SDL2)
+    # TODO
+	#find_dependency(SDL2)
 endif()
 set(OSVRRM_NEED_GLEW @OSVRRM_NEED_GLEW@)
 if(OSVRRM_NEED_GLEW)
-	find_dependency(GLEW)
+    # TODO
+	#find_dependency(GLEW)
 endif()

 # Set up config mapping


Just the last bug

Just the last bug

Former-commit-id: ec1ed3e1da687173450220ee07ebacfd6daa9979

--- cmake_modules/Fetch_Arpack-ng.cmake
+++ cmake_modules/Fetch_Arpack-ng.cmake
@@ -68,11 +68,10 @@

     ExternalProject_Get_Property(library_ARPACK INSTALL_DIR)
     set(ARPACK_INCLUDE_DIRS ${INSTALL_DIR}/include)
-    add_library(arpack UNKNOWN IMPORTED)
+    add_library(arpack INTERFACE)
     set_target_properties(arpack
             PROPERTIES
-            IMPORTED_LOCATION ${INSTALL_DIR}/lib/libarpack${CMAKE_STATIC_LIBRARY_SUFFIX}
-            INTERFACE_LINK_LIBRARIES "${GFORTRAN_LIB};${BLAS_LIBRARIES};${LAPACK_LIBRARIES}"
+            INTERFACE_LINK_LIBRARIES "${INSTALL_DIR}/lib/libarpack${CMAKE_STATIC_LIBRARY_SUFFIX};${GFORTRAN_LIB};${BLAS_LIBRARIES};${LAPACK_LIBRARIES}"
             INTERFACE_INCLUDE_DIRECTORIES ${INSTALL_DIR}/include)
 #    add_library(arpack INTERFACE)
 #    set_target_properties(arpack
@@ -84,5 +83,5 @@
     target_link_libraries(${PROJECT_NAME} PRIVATE arpack)
     target_include_directories(${PROJECT_NAME} PRIVATE ${ARPACK_INCLUDE_DIRS})
     #For convenience, define these variables
-    get_target_property(ARPACK_LIBRARIES arpack IMPORTED_LOCATION)
+    get_target_property(ARPACK_LIBRARIES arpack INTERFACE_LINK_LIBRARIES)
 endif()


Fix for ROOT-6458 (3)

Fix for ROOT-6458 (3)

--- cint/cint/PlatformDependentSettings.cmake
+++ cint/cint/PlatformDependentSettings.cmake
@@ -104,15 +104,10 @@
   LIST(APPEND CINT_CXX_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/src/dict/gcc4strm.cxx)
 ENDIF(${GCC_MAJOR} EQUAL 4)

-IF(${CLANG_MAJOR} EQUAL 2)
+IF(${CLANG_MAJOR} GREATER 2)
   LIST(REMOVE_ITEM CINT_CXX_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/src/dict/libstrm.cxx ${CMAKE_CURRENT_SOURCE_DIR}/src/dict/longif.cxx)
   LIST(APPEND CINT_CXX_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/src/dict/gcc4strm.cxx)
-ENDIF(${CLANG_MAJOR} EQUAL 2)
-
-IF(${CLANG_MAJOR} EQUAL 3)
-  LIST(REMOVE_ITEM CINT_CXX_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/src/dict/libstrm.cxx ${CMAKE_CURRENT_SOURCE_DIR}/src/dict/longif.cxx)
-  LIST(APPEND CINT_CXX_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/src/dict/gcc4strm.cxx)
-ENDIF()
+ENDIF(${CLANG_MAJOR} GREATER 2)

 IF(USING_LIBCXX)
   LIST(REMOVE_ITEM CINT_CXX_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/src/dict/gcc4strm.cxx )


Adjust zlib find tool to be inline with the rest

--- src/tritonsort/cmake_tools/FindZLIB.cmake
+++ src/tritonsort/cmake_tools/FindZLIB.cmake
@@ -1,27 +1,9 @@
-# - Find zlib
-# Find the native ZLIB includes and library
-#
-#  ZLIB_INCLUDE_DIR - where to find zlib.h, etc.
-#  ZLIB_LIBRARIES   - List of libraries when using zlib.
-#  ZLIB_FOUND       - True if zlib found.
+FIND_PATH(ZLIB_INCLUDE_DIR zlib.h)
+FIND_LIBRARY(ZLIB_LIBRARY z)

-
-IF (ZLIB_INCLUDE_DIR)
-  # Already in cache, be silent
-  SET(ZLIB_FIND_QUIETLY TRUE)
-ENDIF (ZLIB_INCLUDE_DIR)
-
-FIND_PATH(ZLIB_INCLUDE_DIR zlib.h)
-
-SET(ZLIB_NAMES z zlib zdll)
-FIND_LIBRARY(ZLIB_LIBRARY NAMES ${ZLIB_NAMES})
-
-MARK_AS_ADVANCED(
-  ZLIB_LIBRARY
-  ZLIB_INCLUDE_DIR
-  )
+MARK_AS_ADVANCED(ZLIB ZLIB_LIBRARY ZLIB_INCLUDE_DIR)

 INCLUDE(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(ZLIB DEFAULT_MSG ZLIB_INCLUDE_DIR ZLIB_LIBRARY)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(ZLIB "zlib is required" ZLIB_INCLUDE_DIR ZLIB_LIBRARY)

 INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIR})


removed changed which are just whitespaces

--- config/VIGRA_ADD_NUMPY_MODULE.cmake
+++ config/VIGRA_ADD_NUMPY_MODULE.cmake
@@ -21,7 +21,7 @@
 #        'vigranumpy_modulename' in order to get useful alphabetic sorting of
 #        targets in project files.
 FUNCTION(VIGRA_ADD_NUMPY_MODULE target)
-
+
     # parse the args
     set(v SOURCES)
     set(PART_OF_VIGRANUMPY 0)


[Build] Fixed a check/test issue with CMake 2.6.

--- config/project_config_embeddable.cmake
+++ config/project_config_embeddable.cmake
@@ -977,7 +977,8 @@
     endforeach (_module_name)

     # Register all the module (CMake/CTest) test targets at once
-    add_custom_target (check DEPENDS ${_check_target_list})
+    add_custom_target (check)
+    add_dependencies (check ${_check_target_list})

     # Register, for reporting purpose, the list of modules to be tested
     set (PROJ_ALL_MOD_FOR_TST ${_test_suite_dir_list})


Added boost dependency for opengm.

Added boost dependency for opengm.

--- opengm.cmake
+++ opengm.cmake
@@ -21,6 +21,7 @@

 message ("Installing ${opengm_NAME} into FlyEM build area: ${BUILDEM_DIR} ...")
 ExternalProject_Add(${opengm_NAME}
+    DEPENDS             ${boost_NAME}
     PREFIX              ${BUILDEM_DIR}
     GIT_REPOSITORY      ${opengm_URL}
     UPDATE_COMMAND      ""


Bugfix: remove stale failing_* files, provide some more information in failing RUN and DIFF stages

git-svn-id: 59f82343654cec32357d3b049d399063e4e4cfc7@31251 0785d39b-7218-0410-832d-ea1e28bc413d

--- deal.II/cmake/macros/macro_add_test.cmake
+++ deal.II/cmake/macros/macro_add_test.cmake
@@ -123,13 +123,15 @@
       #

       ADD_CUSTOM_COMMAND(OUTPUT ${_test_directory}/output
+        COMMAND rm -f ${_test_directory}/failing_output
         COMMAND touch ${_test_directory}/output
         COMMAND
           ${_run_command}
           || (mv ${_test_directory}/output
                  ${_test_directory}/failing_output
               && echo "${_test_full}: BUILD successful."
-              && echo "${_test_full}: RUN failed. Output:"
+              && echo "${_test_full}: RUN failed. ------ Result: ${_test_directory}/failing_output"
+              && echo "${_test_full}: RUN failed. ------ Partial output:"
               && cat ${_test_directory}/failing_output
               && exit 1)
         COMMAND
@@ -142,6 +144,7 @@
           ${DEAL_II_SOURCE_DIR}/cmake/scripts/normalize.pl
         )
       ADD_CUSTOM_COMMAND(OUTPUT ${_test_directory}/diff
+        COMMAND rm -f ${_test_directory}/failing_diff
         COMMAND touch ${_test_directory}/diff
         COMMAND
           ${TEST_DIFF}
@@ -154,6 +157,7 @@
               && echo "${_test_full}: RUN successful."
               && echo "${_test_full}: DIFF failed. ------ Source: ${_comparison_file}"
               && echo "${_test_full}: DIFF failed. ------ Result: ${_test_directory}/output"
+              && echo "${_test_full}: DIFF failed. ------ Diff:   ${_test_directory}/failing_diff"
               && echo "${_test_full}: DIFF failed. ------ Diffs as follows:"
               && cat ${_test_directory}/failing_diff
               && exit 1)


Sort INTERNAL_DLL_TARGETS for easier maintenance.

PiperOrigin-RevId: 466492826
Change-Id: I610fb7f6bbdb682558046c6ae995bcc07ba6f98a

--- CMake/AbseilDll.cmake
+++ CMake/AbseilDll.cmake
@@ -353,120 +353,120 @@
 )

 set(ABSL_INTERNAL_DLL_TARGETS
-  "stacktrace"
-  "symbolize"
-  "examine_stack"
-  "failure_signal_handler"
+  "algorithm"
+  "algorithm_container"
+  "any"
+  "any_invocable"
+  "atomic_hook"
+  "bad_any_cast"
+  "bad_any_cast_impl"
+  "bad_optional_access"
+  "bad_variant_access"
+  "base"
+  "base_internal"
+  "bind_front"
+  "bits"
+  "btree"
+  "city"
+  "civil_time"
+  "compare"
+  "compressed_tuple"
+  "config"
+  "container"
+  "container_common"
+  "container_memory"
+  "cord"
+  "core_headers"
+  "counting_allocator"
+  "debugging"
   "debugging_internal"
   "demangle_internal"
+  "dynamic_annotations"
+  "endian"
+  "examine_stack"
+  "exponential_biased"
+  "failure_signal_handler"
+  "fixed_array"
+  "flat_hash_map"
+  "flat_hash_set"
+  "function_ref"
+  "graphcycles_internal"
+  "hash"
+  "hash_function_defaults"
+  "hash_policy_traits"
+  "hashtable_debug"
+  "hashtable_debug_hooks"
+  "hashtablez_sampler"
+  "inlined_vector"
+  "inlined_vector_internal"
+  "int128"
+  "kernel_timeout_internal"
+  "layout"
   "leak_check"
+  "log_severity"
+  "malloc_internal"
+  "memory"
+  "meta"
+  "node_hash_map"
+  "node_hash_set"
+  "node_slot_policy"
+  "numeric"
+  "optional"
+  "periodic_sampler"
+  "pow10_helper"
+  "pretty_function"
+  "random_bit_gen_ref"
+  "random_distributions"
+  "random_internal_distribution_caller"
+  "random_internal_distributions"
+  "random_internal_explicit_seed_seq"
+  "random_internal_fastmath"
+  "random_internal_fast_uniform_bits"
+  "random_internal_generate_real"
+  "random_internal_iostream_state_saver"
+  "random_internal_nonsecure_base"
+  "random_internal_pcg_engine"
+  "random_internal_platform"
+  "random_internal_pool_urbg"
+  "random_internal_randen"
+  "random_internal_randen_engine"
+  "random_internal_randen_hwaes"
+  "random_internal_randen_hwaes_impl"
+  "random_internal_randen_slow"
+  "random_internal_salted_seed_seq"
+  "random_internal_seed_material"
+  "random_internal_sequence_urbg"
+  "random_internal_traits"
+  "random_internal_uniform_helper"
+  "random_internal_wide_multiply"
+  "random_random"
+  "random_seed_gen_exception"
+  "random_seed_sequences"
+  "raw_hash_map"
+  "raw_hash_set"
+  "raw_logging_internal"
+  "sample_recorder"
+  "scoped_set_env"
+  "span"
+  "spinlock_wait"
+  "spy_hash_state"
   "stack_consumption"
-  "debugging"
-  "hash"
-  "spy_hash_state"
-  "city"
-  "memory"
+  "stacktrace"
+  "status"
+  "str_format"
+  "str_format_internal"
   "strings"
   "strings_internal"
-  "cord"
-  "str_format"
-  "str_format_internal"
-  "pow10_helper"
-  "int128"
-  "numeric"
-  "utility"
-  "any"
-  "bad_any_cast"
-  "bad_any_cast_impl"
-  "span"
-  "optional"
-  "bad_optional_access"
-  "bad_variant_access"
-  "variant"
-  "compare"
-  "algorithm"
-  "algorithm_container"
-  "graphcycles_internal"
-  "kernel_timeout_internal"
+  "symbolize"
   "synchronization"
   "thread_pool"
-  "any_invocable"
-  "bind_front"
-  "function_ref"
-  "atomic_hook"
-  "log_severity"
-  "raw_logging_internal"
-  "spinlock_wait"
-  "config"
-  "dynamic_annotations"
-  "core_headers"
-  "malloc_internal"
-  "base_internal"
-  "base"
   "throw_delegate"
-  "pretty_function"
-  "endian"
-  "bits"
-  "exponential_biased"
-  "periodic_sampler"
-  "scoped_set_env"
+  "time"
+  "time_zone"
+  "tracked"
   "type_traits"
-  "meta"
-  "random_random"
-  "random_bit_gen_ref"
-  "random_distributions"
-  "random_seed_gen_exception"
-  "random_seed_sequences"
-  "random_internal_traits"
-  "random_internal_distribution_caller"
-  "random_internal_distributions"
-  "random_internal_fast_uniform_bits"
-  "random_internal_seed_material"
-  "random_internal_pool_urbg"
-  "random_internal_explicit_seed_seq"
-  "random_internal_sequence_urbg"
-  "random_internal_salted_seed_seq"
-  "random_internal_iostream_state_saver"
-  "random_internal_generate_real"
-  "random_internal_wide_multiply"
-  "random_internal_fastmath"
-  "random_internal_nonsecure_base"
-  "random_internal_pcg_engine"
-  "random_internal_randen_engine"
-  "random_internal_platform"
-  "random_internal_randen"
-  "random_internal_randen_slow"
-  "random_internal_randen_hwaes"
-  "random_internal_randen_hwaes_impl"
-  "random_internal_uniform_helper"
-  "status"
-  "time"
-  "civil_time"
-  "time_zone"
-  "container"
-  "btree"
-  "compressed_tuple"
-  "fixed_array"
-  "inlined_vector_internal"
-  "inlined_vector"
-  "counting_allocator"
-  "flat_hash_map"
-  "flat_hash_set"
-  "node_hash_map"
-  "node_hash_set"
-  "container_memory"
-  "hash_function_defaults"
-  "hash_policy_traits"
-  "hashtablez_sampler"
-  "hashtable_debug"
-  "hashtable_debug_hooks"
-  "node_slot_policy"
-  "raw_hash_map"
-  "container_common"
-  "raw_hash_set"
-  "layout"
-  "tracked"
-  "sample_recorder"
+  "utility"
+  "variant"
 )

 function(absl_internal_dll_contains)


Find OpenBLAS more aggressively.  This made a difference on Fedora 20

--- bench/btl/cmake/FindOPENBLAS.cmake
+++ bench/btl/cmake/FindOPENBLAS.cmake
@@ -3,7 +3,7 @@
   set(OPENBLAS_FIND_QUIETLY TRUE)
 endif (OPENBLAS_LIBRARIES)

-find_file(OPENBLAS_LIBRARIES libopenblas.so PATHS /usr/lib $ENV{OPENBLASDIR} ${LIB_INSTALL_DIR})
+find_file(OPENBLAS_LIBRARIES NAMES libopenblas.so libopenblas.so.0 PATHS /usr/lib /usr/lib64 $ENV{OPENBLASDIR} ${LIB_INSTALL_DIR})
 find_library(OPENBLAS_LIBRARIES openblas PATHS $ENV{OPENBLASDIR} ${LIB_INSTALL_DIR})

 if(OPENBLAS_LIBRARIES AND CMAKE_COMPILER_IS_GNUCXX)


fix: mirtk_target_dependencies unset dep_attr [CMake]

--- CMake/Modules/mirtkTargetDependencies.cmake
+++ CMake/Modules/mirtkTargetDependencies.cmake
@@ -25,7 +25,7 @@
 ## @brief Add target dependency
 function (mirtk_target_dependencies target_name)
   # Check arguments
-  cmake_parse_arguments(ARGN "OPTIONAL" "" "")
+  cmake_parse_arguments(ARGN "OPTIONAL" "" "" ${ARGN})
   if (NOT ARGN_UNPARSED_ARGUMENTS)
     return()
   endif ()
@@ -36,7 +36,7 @@
   # Get current MIRTK_LIBRARY_PATH used by "mirtk" command launcher
   get_property(ldpath GLOBAL PROPERTY MIRTK_LIBRARY_PATH)
   # Add dependency on link library file, imported library target, or other target
-  set(dep_attr)
+  unset(dep_attr)
   foreach (dep IN LISTS ARGN_UNPARSED_ARGUMENTS)
     if (dep MATCHES "^(general|optimized|debug)$")
       set(dep_attr "${dep}")
@@ -64,9 +64,9 @@
         if (IS_ABSOLUTE "${dep_name}")
           get_filename_component(dep_path "${dep_name}" PATH)
           if (CMAKE_HOST_WIN32)
+            get_filename_component(dll_name "${dep_name}" NAME_WE)
             string(REPLACE "/lib/" "/bin/" dll_path "${dep_path}")
-            string(REPLACE "/Lib/" "/Bin/" dll_path "${dep_path}")
-            get_filename_component(dll_name "${dep_name}" NAME_WE)
+            string(REPLACE "/Lib/" "/Bin/" dll_path "${dll_path}")
             if (EXISTS "${dll_path}/${dll_name}.dll")
               set(dep_path "${dll_path}")
             endif ()
@@ -74,11 +74,11 @@
           list(APPEND ldpath "${dep_path}")
         endif ()
       endif ()
-      set(deb_attr)
+      unset(dep_attr)
     endif ()
   endforeach ()
   if (dep_attr)
-    message(FATAL_ERROR "Expected library file path or imported target after ${dep_attr}")
+    message(FATAL_ERROR "Expected library file path or imported target after ${dep_attr}\nArguments = [${ARGN_UNPARSED_ARGUMENTS}]")
   endif ()
   # Update MIRTK_LIBRARY_PATH
   list(REMOVE_DUPLICATES ldpath)


Major OSX Installer Fix: Libraries were being deep copied and not symlinks

This issue probably originated around 3.3 where libaf*.dylib / libaf*.major.dylib
were not being treated as symlinks but were full versions of the library
on their own.
This was due to CMake copying symlinks as the files they point to rather
than symlinks.

--- CMakeModules/osx_install/OSXInstaller.cmake
+++ CMakeModules/osx_install/OSXInstaller.cmake
@@ -29,7 +29,7 @@

 # Backends - CPU, CUDA, OpenCL, Unified
 MACRO(OSX_INSTALL_SETUP BACKEND LIB)
-    FILE(GLOB ${BACKEND}LIB "${CMAKE_INSTALL_PREFIX}/${AF_INSTALL_LIB_DIR}/lib${LIB}*.dylib")
+    FILE(GLOB ${BACKEND}LIB "${CMAKE_INSTALL_PREFIX}/${AF_INSTALL_LIB_DIR}/lib${LIB}.${AF_VERSION}.dylib")
     FILE(GLOB ${BACKEND}CMAKE "${CMAKE_INSTALL_PREFIX}/${AF_INSTALL_CMAKE_DIR}/ArrayFire${BACKEND}*.cmake")

     ADD_CUSTOM_TARGET(OSX_INSTALL_SETUP_${BACKEND})
@@ -39,9 +39,24 @@
                            COMMAND ${CMAKE_COMMAND} -E copy
                            ${SRC} "${OSX_TEMP}/${BACKEND}/${SRC_REL}"
                            WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
-                           COMMENT "Copying ${BACKEND} files to temporary OSX Install Dir"
+                           COMMENT "Copying ${BACKEND} files to temporary OSX Install Dir - File: ${SRC_REL}"
                            )
     ENDFOREACH()
+    # Create symlinks separately. Copying them in above command will do a deep copy
+    ADD_CUSTOM_COMMAND(TARGET OSX_INSTALL_SETUP_${BACKEND} PRE_BUILD
+                       COMMAND ${CMAKE_COMMAND} -E create_symlink
+                       "lib${LIB}.${AF_VERSION}.dylib"
+                       "lib${LIB}.${AF_VERSION_MAJOR}.dylib"
+                       WORKING_DIRECTORY "${OSX_TEMP}/${BACKEND}/${AF_INSTALL_LIB_DIR}"
+                       COMMENT "Copying ${BACKEND} files to temporary OSX Install Dir (Symlink)"
+                       )
+    ADD_CUSTOM_COMMAND(TARGET OSX_INSTALL_SETUP_${BACKEND} PRE_BUILD
+                       COMMAND ${CMAKE_COMMAND} -E create_symlink
+                       "lib${LIB}.${AF_VERSION_MAJOR}.dylib"
+                       "lib${LIB}.dylib"
+                       WORKING_DIRECTORY "${OSX_TEMP}/${BACKEND}/${AF_INSTALL_LIB_DIR}"
+                       COMMENT "Copying ${BACKEND} files to temporary OSX Install Dir (Symlink)"
+                       )
 ENDMACRO(OSX_INSTALL_SETUP)

 OSX_INSTALL_SETUP(CPU afcpu)
@@ -79,7 +94,12 @@
     MAKE_DIRECTORY("${OSX_TEMP}/Forge")

     # Forge Library
-    FILE(GLOB FORGE_LIB "${CMAKE_INSTALL_PREFIX}/${AF_INSTALL_LIB_DIR}/libforge*.dylib")
+    FILE(GLOB FORGE_LIB "${CMAKE_INSTALL_PREFIX}/${AF_INSTALL_LIB_DIR}/libforge.*.*.*.dylib")
+
+    GET_FILENAME_COMPONENT(LIBFORGE_NAME ${FORGE_LIB} NAME_WE) # Will return libforge
+    STRING(REGEX MATCH "([0-9]+)\\.([0-9]+)\\.([0-9]+)" FORGE_VERSION ${FORGE_LIB}) # Will return x.y.z
+    STRING(SUBSTRING ${FORGE_VERSION} 0 1 FORGE_VERSION_MAJOR) # Will return x
+
     ADD_CUSTOM_TARGET(OSX_INSTALL_SETUP_FORGE_LIB)
     FOREACH(SRC ${FORGE_LIB})
         FILE(RELATIVE_PATH SRC_REL ${CMAKE_INSTALL_PREFIX} ${SRC})
@@ -87,9 +107,24 @@
                            COMMAND ${CMAKE_COMMAND} -E copy
                            ${SRC} "${OSX_TEMP}/Forge/${SRC_REL}"
                            WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
-                           COMMENT "Copying libforge files to temporary OSX Install Dir"
+                           COMMENT "Copying libforge files to temporary OSX Install Dir - File: ${SRC_REL}"
         )
     ENDFOREACH()
+    # Create symlinks separately. Copying them in above command will do a deep copy
+    ADD_CUSTOM_COMMAND(TARGET OSX_INSTALL_SETUP_FORGE_LIB PRE_BUILD
+                       COMMAND ${CMAKE_COMMAND} -E create_symlink
+                       "${LIBFORGE_NAME}.${FORGE_VERSION}.dylib"
+                       "${LIBFORGE_NAME}.${FORGE_VERSION_MAJOR}.dylib"
+                       WORKING_DIRECTORY "${OSX_TEMP}/Forge/${AF_INSTALL_LIB_DIR}"
+                       COMMENT "Copying libforge files to temporary OSX Install Dir (Symlink)"
+                       )
+    ADD_CUSTOM_COMMAND(TARGET OSX_INSTALL_SETUP_FORGE_LIB PRE_BUILD
+                       COMMAND ${CMAKE_COMMAND} -E create_symlink
+                       "${LIBFORGE_NAME}.${FORGE_VERSION_MAJOR}.dylib"
+                       "${LIBFORGE_NAME}.dylib"
+                       WORKING_DIRECTORY "${OSX_TEMP}/Forge/${AF_INSTALL_LIB_DIR}"
+                       COMMENT "Copying libforge files to temporary OSX Install Dir (Symlink)"
+                       )

     # Forge Headers
     ADD_CUSTOM_TARGET(OSX_INSTALL_SETUP_FORGE_INCLUDE


in runsuite: don't build if configure fails; don't test if build failed
fixes issue 280

git-svn-id: ed337ca7cdb08c0ba29d8fe58632bb7686892c2d@566 49cc7528-f6fd-11dd-9d1a-b59b2e1864b6

--- suite/runsuite.cmake
+++ suite/runsuite.cmake
@@ -318,29 +318,33 @@
   if (DO_UPDATE)
     ctest_update(SOURCE "${CTEST_SOURCE_DIRECTORY}")
   endif (DO_UPDATE)
-  ctest_configure(BUILD "${CTEST_BINARY_DIRECTORY}")
-  ctest_build(BUILD "${CTEST_BINARY_DIRECTORY}")
-  # to run a subset of tests add an INCLUDE regexp to ctest_test.  e.g.:
-  #   INCLUDE broadfun
-  if ("${cmake_ver_string}" STRLESS "2.8.")
-    # Parallel tests not supported
-    set(RUN_PARALLEL OFF)
-  elseif (WIN32 AND TEST_LONG)
-    # FIXME i#265: on Windows we can't run multiple instances of
-    # the same app b/c of global reg key conflicts: should support
-    # env vars and not require registry
-    set(RUN_PARALLEL OFF)
-  else ()
-    set(RUN_PARALLEL ON)
-  endif ()
-  if (RUN_PARALLEL)
-    # i#111: run tests in parallel, supported on CTest 2.8.0+
-    # Note that adding -j to CMAKE_COMMAND does not work, though invoking
-    # this script with -j does work, but we want parallel by default.
-    ctest_test(BUILD "${CTEST_BINARY_DIRECTORY}" PARALLEL_LEVEL 5)
-  else (RUN_PARALLEL)
-    ctest_test(BUILD "${CTEST_BINARY_DIRECTORY}")
-  endif (RUN_PARALLEL)
+  ctest_configure(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE config_success)
+  if (config_success)
+    ctest_build(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE build_success)
+    if (build_success)
+      # to run a subset of tests add an INCLUDE regexp to ctest_test.  e.g.:
+      #   INCLUDE broadfun
+      if ("${cmake_ver_string}" STRLESS "2.8.")
+        # Parallel tests not supported
+        set(RUN_PARALLEL OFF)
+      elseif (WIN32 AND TEST_LONG)
+        # FIXME i#265: on Windows we can't run multiple instances of
+        # the same app b/c of global reg key conflicts: should support
+        # env vars and not require registry
+        set(RUN_PARALLEL OFF)
+      else ()
+        set(RUN_PARALLEL ON)
+      endif ()
+      if (RUN_PARALLEL)
+        # i#111: run tests in parallel, supported on CTest 2.8.0+
+        # Note that adding -j to CMAKE_COMMAND does not work, though invoking
+        # this script with -j does work, but we want parallel by default.
+        ctest_test(BUILD "${CTEST_BINARY_DIRECTORY}" PARALLEL_LEVEL 5)
+      else (RUN_PARALLEL)
+        ctest_test(BUILD "${CTEST_BINARY_DIRECTORY}")
+      endif (RUN_PARALLEL)
+    endif (build_success)
+  endif (config_success)
   if (DO_SUBMIT)
     # include any notes via set(CTEST_NOTES_FILES )?
     ctest_submit()


remove unnecessary dependencies

remove unnecessary dependencies

--- ConfigureChecks.cmake
+++ ConfigureChecks.cmake
@@ -4,18 +4,9 @@
 ##################################################
 # Our Proprietary Libraries
 #####
-FIND_PACKAGE(izenelib REQUIRED COMPONENTS
-  message_framework
-  index_manager
+FIND_PACKAGE(izenelib REQUIRED
+  COMPONENTS
   febird
-  udt3
-  izene_log
-  izene_util
-  bigint
-  procmeminfo
-  luxio
-  jemalloc
-  am
   )


Remove -DWIN32 for Msys since that is a Posix environment

--- cmake/Modules/DefineCompilerFlags.cmake
+++ cmake/Modules/DefineCompilerFlags.cmake
@@ -56,7 +56,3 @@
         add_definitions(-D_CRT_SECURE_NO_WARNINGS=1)
     endif (MSVC)
 endif (WIN32)
-
-if (MSYS)
-   add_definitions(-DWIN32)
-endif (MSYS)


Improved indenting

Improved indenting

--- CMakeModules/KrisLibraryDependencies.cmake
+++ CMakeModules/KrisLibraryDependencies.cmake
@@ -20,51 +20,51 @@
 #MESSAGE(${CMAKE_CXX_COMPILER})

 if(CMAKE_VERSION VERSION_LESS "3.1.0")
-MESSAGE("Old version of CMAKE - can't check compiler")
+  MESSAGE("Old version of CMAKE - can't check compiler")
 else(CMAKE_VERSION VERSION_LESS "3.1.0")
-include(CheckCXXCompilerFlag)
-CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
+  include(CheckCXXCompilerFlag)
+  CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)

-include(CheckIncludeFileCXX REQUIRED)
-CHECK_INCLUDE_FILE_CXX(thread HAVE_CPP_THREAD)
+  include(CheckIncludeFileCXX REQUIRED)
+  CHECK_INCLUDE_FILE_CXX(thread HAVE_CPP_THREAD)

-if(HAVE_CPP_THREAD)
-SET(C11_ENABLED ON)
-SET(CMAKE_CXX_STANDARD 11)
-MESSAGE("Compling with C++11")
-#SET(CMAKE_CXX_STANDARD_REQUIRED ON)
-else(HAVE_CPP_THREAD)
-MESSAGE("C11 compiler not available")
-endif(HAVE_CPP_THREAD)
+  if(HAVE_CPP_THREAD)
+    SET(C11_ENABLED ON)
+    SET(CMAKE_CXX_STANDARD 11)
+    MESSAGE("Compling with C++11")
+    #SET(CMAKE_CXX_STANDARD_REQUIRED ON)
+  else(HAVE_CPP_THREAD)
+    MESSAGE("C11 compiler not available")
+  endif(HAVE_CPP_THREAD)
 endif(CMAKE_VERSION VERSION_LESS "3.1.0")

 if(C11_ENABLED)
-set(KRISLIBRARY_DEFINITIONS ${KRISLIBRARY_DEFINITIONS} -DUSE_CPP_THREADS)
+  set(KRISLIBRARY_DEFINITIONS ${KRISLIBRARY_DEFINITIONS} -DUSE_CPP_THREADS)
 else(C11_ENABLED)
-# Boost threads vs pthreads
-SET(Boost_USE_STATIC_LIBS OFF)
-SET(Boost_USE_MULTITHREADED ON)
-SET(Boost_USE_STATIC_RUNTIME OFF)
-# Boost settings
-set(Boost_NO_BOOST_CMAKE ON CACHE BOOL "Enable fix for FindBoost.cmake" )
-add_definitions(-DBOOST_ALL_NO_LIB) # Don't use 'pragma lib' on Windows
-add_definitions(-DBoost_NO_BOOST_CMAKE) # Fix for CMake problem in FindBoost
-if(NOT Boost_USE_STATIC_LIBS)
-add_definitions(-DBOOST_TEST_DYN_LINK) # generates main() for unit tests
-endif()
-FIND_PACKAGE(Boost COMPONENTS thread system)
-IF(Boost_FOUND)
-  SET(KRISLIBRARY_DEFINITIONS ${KRISLIBRARY_DEFINITIONS} -DHAVE_BOOST=1 -DUSE_BOOST_THREADS=1)
-  SET(KRISLIBRARY_INCLUDE_DIRS ${KRISLIBRARY_INCLUDE_DIRS} ${Boost_INCLUDE_DIR})
-  SET(KRISLIBRARY_LIBRARIES ${KRISLIBRARY_LIBRARIES} ${Boost_LIBRARIES})
-ELSE(Boost_FOUND)
-  MESSAGE("Boost library not found, trying pthreads for multithreading...")
-  FIND_PACKAGE(pthreads)
-  IF(pthreads_FOUND)
-    SET(KRISLIBRARY_DEFINITIONS ${KRISLIBRARY_DEFINITIONS} -USE_PTHREADS)
-    SET(KRISLIBRARY_LIBRARIES ${KRISLIBRARY_LIBRARIES} pthreads)
-  ENDIF(pthreads_FOUND)
-ENDIF(Boost_FOUND)
+  # Boost threads vs pthreads
+  SET(Boost_USE_STATIC_LIBS OFF)
+  SET(Boost_USE_MULTITHREADED ON)
+  SET(Boost_USE_STATIC_RUNTIME OFF)
+  # Boost settings
+  set(Boost_NO_BOOST_CMAKE ON CACHE BOOL "Enable fix for FindBoost.cmake" )
+  add_definitions(-DBOOST_ALL_NO_LIB) # Don't use 'pragma lib' on Windows
+  add_definitions(-DBoost_NO_BOOST_CMAKE) # Fix for CMake problem in FindBoost
+  if(NOT Boost_USE_STATIC_LIBS)
+  add_definitions(-DBOOST_TEST_DYN_LINK) # generates main() for unit tests
+  endif()
+  FIND_PACKAGE(Boost COMPONENTS thread system)
+  IF(Boost_FOUND)
+    SET(KRISLIBRARY_DEFINITIONS ${KRISLIBRARY_DEFINITIONS} -DHAVE_BOOST=1 -DUSE_BOOST_THREADS=1)
+    SET(KRISLIBRARY_INCLUDE_DIRS ${KRISLIBRARY_INCLUDE_DIRS} ${Boost_INCLUDE_DIR})
+    SET(KRISLIBRARY_LIBRARIES ${KRISLIBRARY_LIBRARIES} ${Boost_LIBRARIES})
+  ELSE(Boost_FOUND)
+    MESSAGE("Boost library not found, trying pthreads for multithreading...")
+    FIND_PACKAGE(pthreads)
+    IF(pthreads_FOUND)
+      SET(KRISLIBRARY_DEFINITIONS ${KRISLIBRARY_DEFINITIONS} -USE_PTHREADS)
+      SET(KRISLIBRARY_LIBRARIES ${KRISLIBRARY_LIBRARIES} pthreads)
+    ENDIF(pthreads_FOUND)
+  ENDIF(Boost_FOUND)
 ENDIF(C11_ENABLED)

 # GLUI
@@ -173,9 +173,9 @@

 #USE_LOGGING
 IF(WIN32)
-SET(LOG4CXX_ROOT "${KRISLIBRARY_ROOT}/KrisLibrary/logging/WIN32")
+  SET(LOG4CXX_ROOT "${KRISLIBRARY_ROOT}/KrisLibrary/logging/WIN32")
 ELSEIF(UNIX)
-SET(LOG4CXX_ROOT "${KRISLIBRARY_ROOT}/KrisLibrary/logging/UNIX")
+  SET(LOG4CXX_ROOT "${KRISLIBRARY_ROOT}/KrisLibrary/logging/UNIX")
 ELSE()
 ENDIF()
 FIND_PACKAGE(LOG4CXX REQUIRED)


Static Exceptions -> Fixed CMake Clang Toolchain to actually use LLD linker.

[LLD] - The LLVM Linker: Using LLD
~ https://lld.llvm.org/#using-lld

[LLVM Code Review] - [Clang] Accept absolute paths in the -fuse-ld option
~ https://reviews.llvm.org/D17952

--- static-exceptions/toolchain/Toolchain.cmake
+++ static-exceptions/toolchain/Toolchain.cmake
@@ -35,6 +35,10 @@

 # CMake Toolchain
 cmake_minimum_required (VERSION 3.10)
+
+
+# Propagate variables to projects generated by the try_compile().
+set(CMAKE_TRY_COMPILE_PLATFORM_VARIABLES  TOOLCHAIN_ROOT)

 # Target System
@@ -78,3 +82,9 @@
 else()
     message(FATAL_ERROR "Generator ${CMAKE_GENERATOR} is not supported!")
 endif()
+
+
+# Linker Flags
+set(CMAKE_EXE_LINKER_FLAGS_INIT    "-fuse-ld=${TOOLCHAIN_ROOT}/llvm/bin/ld.lld")
+set(CMAKE_SHARED_LINKER_FLAGS_INIT "-fuse-ld=${TOOLCHAIN_ROOT}/llvm/bin/ld.lld")
+set(CMAKE_MODULE_LINKER_FLAGS_INIT "-fuse-ld=${TOOLCHAIN_ROOT}/llvm/bin/ld.lld")


CI: fix typo

CI: fix typo

--- CI/prepare_superbuild.cmake
+++ CI/prepare_superbuild.cmake
@@ -365,6 +365,6 @@
   message("MacOS cleanup")
   file(REMOVE_RECURSE CTEST_INSTALL_DIRECTORY)
   file(REMOVE_RECURSE CI_PROJ_DIR)
-else
+else()
   message("not apple")
 endif()


ENH: Add ITK_CUSTOM_LIBRARY_SUFFIX variable.

ITK libraries have a major and minor suffix version in their names to
prevent DLL hell and to allow multiple versions of ITK to be installed on the
same system.

When using CMake as a build system, the paths are automatically handled by CMake. To assist
building against ITK when not using CMake (not recommended), an
ITK_CUSTOM_LIBRARY_SUFFIX is added to specify the library suffix. If a
suffix is not desired, set this to the empty string.

Change-Id: I6f902144b927f0b379f35e27634487bf7bceeca8

--- CMake/ITKModuleMacros.cmake
+++ CMake/ITKModuleMacros.cmake
@@ -371,7 +371,14 @@
   else()
     set(_itk "itk")
   endif()
-  set_property(TARGET ${_name} PROPERTY OUTPUT_NAME ${_itk}${_name}-${ITK_VERSION_MAJOR}.${ITK_VERSION_MINOR})
+  # Support custom library suffix names, for other projects wanting to inject
+  # their own version numbers etc.
+  if(DEFINED ITK_CUSTOM_LIBRARY_SUFFIX)
+    set(_lib_suffix "${ITK_CUSTOM_LIBRARY_SUFFIX}")
+  else()
+    set(_lib_suffix "-${ITK_VERSION_MAJOR}.${ITK_VERSION_MINOR}")
+  endif()
+  set_property(TARGET ${_name} PROPERTY OUTPUT_NAME ${_itk}${_name}${_lib_suffix})
 endmacro()

 macro(itk_module_target_export _name)


removed the parent scope option from FEAT_ENABLED in SM.cmake;

--- SM/SM.cmake
+++ SM/SM.cmake
@@ -25,16 +25,16 @@
 	# message(STATUS "CV_NONFREE_FOUND: ${CV_NONFREE_FOUND}")
 	if(CV_NONFREE_FOUND)
 		set(COMPOSITE_SEARCH_METHODS ${COMPOSITE_SEARCH_METHODS} FeatureTracker)
-		set(FEAT_ENABLED ON PARENT_SCOPE)
+		set(FEAT_ENABLED ON)
 	else(CV_NONFREE_FOUND)
 		message(STATUS "OpenCV nonfree module not found so disabling the feature based grid tracker")
 		set(MTF_DEFINITIONS ${MTF_DEFINITIONS} DISABLE_GRID_FEAT)
-		set(FEAT_ENABLED OFF PARENT_SCOPE)
+		set(FEAT_ENABLED OFF)
 	endif(CV_NONFREE_FOUND)
 else(WITH_FEAT)
 	message(STATUS "Feature based grid tracker disabled")
 	set(MTF_DEFINITIONS ${MTF_DEFINITIONS} DISABLE_GRID_FEAT)
-	set(FEAT_ENABLED OFF PARENT_SCOPE)
+	set(FEAT_ENABLED OFF)
 endif(WITH_FEAT)
 if(WITH_REGNET)
 	set(SEARCH_METHODS_NT ${SEARCH_METHODS_NT} RegNet)


Test->TEST

Test->TEST

--- CMake/UseCyclus.cmake
+++ CMake/UseCyclus.cmake
@@ -182,7 +182,7 @@
       CACHE INTERNAL "Agent test source" FORCE
       )

-    ADD_LIBRARY(${lib_root}Tests ${${lib_root}_Test_CC})
+    ADD_LIBRARY(${lib_root}Tests ${${lib_root}_TEST_CC})
     TARGET_LINK_LIBRARIES(${lib_root}Tests dl cycluscore ${CYCLUS_GTEST_LIBRARIES})
     SET_TARGET_PROPERTIES(${lib_root}Tests PROPERTIES LINKER_LANGUAGE C)
     SET(


Cleanup Cmake logic for VTK_EGL_DEVICE_INDEX.

No need to force set VTK_EGL_DEVICE_INDEX when not defined. The default
"set" does exactly that. Also marking VTK_EGL_DEVICE_INDEX as advanced.

--- CMake/vtkOpenGL.cmake
+++ CMake/vtkOpenGL.cmake
@@ -22,10 +22,8 @@
 # EGL offscreen rendering
 option(VTK_USE_OFFSCREEN_EGL
   "Use EGL for OpenGL client API for offscreen rendering." OFF)
-if (NOT DEFINED VTK_EGL_DEVICE_INDEX)
-  set(VTK_EGL_DEVICE_INDEX 0 CACHE STRING
-      "Index of the EGL device (graphics card) to use." FORCE)
-endif()
+set(VTK_EGL_DEVICE_INDEX 0 CACHE STRING
+  "Index of the EGL device (graphics card) to use.")

 if (VTK_USE_OFFSCREEN_EGL AND VTK_RENDERING_BACKEND STREQUAL "OpenGL")
   message(FATAL_ERROR "You can use VTK_USE_OFFSCREEN_EGL only for OpenGL2")
@@ -53,7 +51,7 @@
 endif()

 mark_as_advanced(VTK_USE_X VTK_OPENGL_HAS_OSMESA VTK_USE_OFFSCREEN_EGL
-  VTK_USE_OFFSCREEN)
+  VTK_USE_OFFSCREEN VTK_EGL_DEVICE_INDEX)

 if(VTK_USE_OSMESA)
   find_package(OSMesa REQUIRED)


Using user passed cflags and cxxflags (#204)

--- tools/cmake/FindOptions.cmake
+++ tools/cmake/FindOptions.cmake
@@ -52,13 +52,13 @@
 set(CMAKE_C_FLAGS_RELEASE "-O3")
 endif()

-set(CMAKE_C_FLAGS "${STD_FLAGS} ${OPT_FLAGS} ${INCLUDE_FLAGS} ${WARNING_FLAGS} ${ROARING_SANITIZE_FLAGS} ")
+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${STD_FLAGS} ${OPT_FLAGS} ${INCLUDE_FLAGS} ${WARNING_FLAGS} ${ROARING_SANITIZE_FLAGS} ")

 if(NOT MSVC)
 set(CMAKE_CXX_FLAGS_DEBUG "-ggdb")
 set(CMAKE_CXX_FLAGS_RELEASE "-O3")
 endif()
-set(CMAKE_CXX_FLAGS "${CXXSTD_FLAGS} ${OPT_FLAGS} ${INCLUDE_FLAGS} ${WARNING_FLAGS} ${ROARING_SANITIZE_FLAGS} ")
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CXXSTD_FLAGS} ${OPT_FLAGS} ${INCLUDE_FLAGS} ${WARNING_FLAGS} ${ROARING_SANITIZE_FLAGS} ")

 if(MSVC)
 add_definitions( "/W3 /D_CRT_SECURE_NO_WARNINGS /wd4005 /wd4996 /wd4267 /wd4244  /wd4113 /nologo")


Fix CLI script name on Windows

Fix CLI script name on Windows

--- cmake/Modules/SampPluginTest.cmake
+++ cmake/Modules/SampPluginTest.cmake
@@ -48,7 +48,12 @@

 	file(READ "${ARG_OUT_FILE}" out)

-	add_test(${name} "samp-server-cli" ${arguments})
+	if(WIN32)
+		add_test(${name} "samp-server-cli.bat" ${arguments})
+	else()
+		add_test(${name} "samp-server-cli" ${arguments})
+	endif()
+
 	set_tests_properties(${name} PROPERTIES
 		ENVIRONMENT "AMX_PATH=${CMAKE_CURRENT_SOURCE_DIR}/${name}"
 		PASS_REGULAR_EXPRESSION "${out}"


libogg: ++PACKAGE_INTERNAL_DEPS_ID

libogg: ++PACKAGE_INTERNAL_DEPS_ID

--- cmake/projects/libogg/hunter.cmake
+++ cmake/projects/libogg/hunter.cmake
@@ -33,4 +33,5 @@
     libogg
     PACKAGE_UNRELOCATABLE_TEXT_FILES
     "${CMAKE_INSTALL_LIBDIR}/pkgconfig/ogg.pc"
+    PACKAGE_INTERNAL_DEPS_ID "1"
 )


cmake: Add missing install variables

cmake: Add missing install variables

--- CMakeInstall.cmake
+++ CMakeInstall.cmake
@@ -68,7 +68,7 @@
     "${CMAKE_INSTALL_PREFIX}/share/theimagingsource/tiscamera/uvc-extension/"
     CACHE PATH "Folder for uvc extension descriptions")
   set(TCAM_INSTALL_DESKTOP_FILES "${CMAKE_INSTALL_PREFIX}/share/applications" CACHE PATH "Folder for storing .desktop files")
-
+  set(TCAM_INSTALL_BASH_COMPLETION "${CMAKE_INSTALL_PREFIX}/share/bash-completion/completions/" CACHE PATH "Folder for storing bash-completions")
 else()

   set(TCAM_INSTALL_LIB "${CMAKE_INSTALL_PREFIX}/lib" CACHE PATH "library installation path" FORCE)
@@ -92,6 +92,7 @@
     "${CMAKE_INSTALL_PREFIX}/share/theimagingsource/tiscamera/uvc-extension/"
     CACHE PATH "Folder for uvc extension descriptions" FORCE)
   set(TCAM_INSTALL_DESKTOP_FILES "${CMAKE_INSTALL_PREFIX}/share/applications" CACHE PATH "Folder for storing .desktop files" FORCE)
+  set(TCAM_INSTALL_BASH_COMPLETION "${CMAKE_INSTALL_PREFIX}/share/bash-completion/completions/" CACHE PATH "Folder for storing bash-completions" FORCE)

 endif(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)


Show download progress in CMake

Show download progress in CMake

--- macros.cmake
+++ macros.cmake
@@ -215,6 +215,7 @@
             TIMEOUT 300
             ${hash_args}
             STATUS status
+            SHOW_PROGRESS
             LOG log)

     list(GET status 0 status_code)


Porting to Paraview 3.98.1

Porting to Paraview 3.98.1

--- salome_adm/cmake_files/deprecated/install_python_from_idl.cmake
+++ salome_adm/cmake_files/deprecated/install_python_from_idl.cmake
@@ -23,4 +23,4 @@
 SET(FULLDIR ${CMAKE_INSTALL_PREFIX}/${DIR})
 FILE(MAKE_DIRECTORY ${FULLDIR})
 MESSAGE(STATUS "Compiling ${IDL_FILE} into ${FULLDIR}")
-EXECUTE_PROCESS(COMMAND ${OMNIORB_IDL_PYTHON} ${IDLPYFLAGS} -C${FULLDIR} ${IDL_FILE})
+EXECUTE_PROCESS(COMMAND ${OMNIORB_IDL_COMPILER} ${IDLPYFLAGS} -C${FULLDIR} ${IDL_FILE})


update IRIS

update IRIS

--- software/externals/cmake/externals.cmake
+++ software/externals/cmake/externals.cmake
@@ -104,7 +104,7 @@
 set(gurobi_depends)

 set(iris_url ssh://git@github.com/rdeits/iris-distro.git)
-set(iris_revision a188343ea955a7fa1aa40d972afaa390c316e7c6)
+set(iris_revision 094120d6716eb62a1e48f77114ea30b1db3f0c24)
 set(iris_depends)

 set(mosek_url ssh://git@github.com/rdeits/mosek.git)


Fixed bug where windows would not receive additional include directory.

--- CMake/PackageDepends/MITK_OpenCL_Config.cmake
+++ CMake/PackageDepends/MITK_OpenCL_Config.cmake
@@ -1,6 +1,6 @@
 find_package(OpenCL REQUIRED)
 list(APPEND ALL_LIBRARIES ${OpenCL_LIBRARY})
-list(APPEND ALL_INCLUDE_DIRS ${OpenCL_INCLUDE_DIR})
+list(APPEND ALL_INCLUDE_DIRECTORIES ${OpenCL_INCLUDE_DIR})

 # on OS X the linker needs a flag pointing to the OpenCL.framework
 if(APPLE)


ENH: Update ITKIOTransformDCMTK remote module

https://github.com/InsightSoftwareConsortium/ITKIOTransformDCMTK/compare/8d191900a54c6b83a2733f9be55e11b98a6703c7...InsightSoftwareConsortium:f6372c4861e7a77ebeab33b3c5e7d29f6502aa58
Change-Id: I4c38576766d4717afdfbbb4129b4c6e6a8470520

--- Modules/Remote/IOTransformDCMTK.remote.cmake
+++ Modules/Remote/IOTransformDCMTK.remote.cmake
@@ -4,5 +4,5 @@
   files. See http://www.insight-journal.org/browse/publication/923
              https://hdl.handle.net/10380/3468"
   GIT_REPOSITORY ${git_protocol}://github.com/InsightSoftwareConsortium/ITKIOTransformDCMTK.git
-  GIT_TAG 8d191900a54c6b83a2733f9be55e11b98a6703c7
+  GIT_TAG f6372c4861e7a77ebeab33b3c5e7d29f6502aa58
   )


Need quotes around variable value.

Need quotes around variable value.

--HG--
extra : convert_revision : 210885b8e4dc02ee6ed1dcbc959134a5f0f47394

--- trunk/py-bindings/abs_to_rel_path.cmake
+++ trunk/py-bindings/abs_to_rel_path.cmake
@@ -6,5 +6,5 @@
 	file(READ ${fname} _text)
 	string(REPLACE "#include \"${CMAKE_CURRENT_SOURCE_DIR}/bindings/"
 		"#include \"../" _new_text "${_text}")
-	file(WRITE ${fname} ${_new_text})
+	file(WRITE ${fname} "${_new_text}")
 endforeach(fname)


COMP: Synchronize with module template.

COMP: Synchronize with module template.

--- itk-module.cmake
+++ itk-module.cmake
@@ -1,13 +1,7 @@
-set(DOCUMENTATION "This module implements a minimal path extraction framework
-based on Fast Marching arrival functions.
-
-A more detailed description can be found in the Insight Journal article::
-
-  Mueller, D. \"Fast Marching Minimal Path Extraction in ITK\"
-  http://hdl.handle.net/1926/1332
-  http://www.insight-journal.org/browse/publication/213
-  March, 2008.
-")
+# the top-level README is used for describing this module, just
+# re-used it for documentation here
+get_filename_component(MY_CURRENT_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
+file(READ "${MY_CURRENT_DIR}/README.rst" DOCUMENTATION)

 itk_module(MinimalPathExtraction
   ENABLE_SHARED
@@ -19,7 +13,8 @@
   TEST_DEPENDS
     ITKTestKernel
     ITKIOSpatialObjects
-  EXCLUDE_FROM_DEFAULT
   DESCRIPTION
     "${DOCUMENTATION}"
+  EXCLUDE_FROM_DEFAULT
+  ENABLE_SHARED
 )


- add support for Visual Studio 2019 (16) (#117)

Signed-off-by: SSE4 <96590f2cd2f24822a7d8bd20596928fbcb06105f@gmail.com>

--- conan.cmake
+++ conan.cmake
@@ -52,6 +52,8 @@
         set(${result} 14 PARENT_SCOPE)
     elseif(NOT MSVC_VERSION VERSION_LESS 1910 AND MSVC_VERSION VERSION_LESS 1920)
         set(${result} 15 PARENT_SCOPE)
+    elseif(NOT MSVC_VERSION VERSION_LESS 1920 AND MSVC_VERSION VERSION_LESS 1930)
+        set(${result} 16 PARENT_SCOPE)
     else()
         message(FATAL_ERROR "Conan: Unknown MSVC compiler version [${MSVC_VERSION}]")
     endif()


fix and remove PackageMaker install config

--- cpack.cmake
+++ cpack.cmake
@@ -7,11 +7,10 @@
 		${CMAKE_CURRENT_BINARY_DIR}/LICENSE.txt)
 	file(RENAME ${CMAKE_CURRENT_BINARY_DIR}/README
 		${CMAKE_CURRENT_BINARY_DIR}/README.txt)
-	set(CPACK_PACKAGE_INSTALL_DIRECTORY /usr/local)
+	set(CPACK_PACKAGING_INSTALL_PREFIX /usr/local)
 	set(CPACK_RESOURCE_FILE_LICENSE ${CMAKE_CURRENT_BINARY_DIR}/LICENSE.txt)
 	set(CPACK_RESOURCE_FILE_README ${CMAKE_CURRENT_BINARY_DIR}/README.txt)
 elseif(CPACK_GENERATOR STREQUAL "DEB") # linux (deb)
-	set(CPACK_PACKAGE_INSTALL_DIRECTORY /usr)
 	if(CMAKE_SIZEOF_VOID_P MATCHES "8")
 		set(SUFFIX_ARCH "_amd64")
 	else(CMAKE_SIZEOF_VOID_P MATCHES "8")
@@ -22,7 +21,6 @@
 	set(CPACK_DEBIAN_PACKAGE_MAINTAINER
 		"Konoha Developers <admin@konohascript.org>")
 elseif(CPACK_GENERATOR STREQUAL "RPM") # linux (rpm)
-	set(CPACK_PACKAGE_INSTALL_DIRECTORY /usr)
 	set(CPACK_RPM_PACKAGE_LICENSE "Simplified BSD")
 	set(CPACK_RPM_PACKAGE_GROUP "Development/Languages")
 	set(CPACK_RPM_PACKAGE_URL "http://konohascript.org")


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 "2ea5a46de3560651d6c7cb53f6f9c9cf7356497b")
+set(DEPTHAI_DEVICE_SIDE_COMMIT "f1880c01409eff1f37947392f47fd1bdb501e804")

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


Updated FW - MobileNet parsing bugfix

Updated FW - MobileNet parsing bugfix

--- 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 "595330292c4bd1955e4e8046b0f42af2dba4b124")
+set(DEPTHAI_DEVICE_SIDE_COMMIT "f34e1ec1450b659bd8ff8383eaff5b7f988cb6fc")

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


Make some space in flash

Make some space in flash

--- cmake/configs/nuttx_px4fmu-v2_default.cmake
+++ cmake/configs/nuttx_px4fmu-v2_default.cmake
@@ -37,7 +37,7 @@
 	drivers/meas_airspeed
 	drivers/frsky_telemetry
 	modules/sensors
-	drivers/mkblctrl
+	#drivers/mkblctrl
 	drivers/px4flow
 	drivers/oreoled
 	drivers/gimbal
@@ -54,7 +54,7 @@
 	systemcmds/pwm
 	systemcmds/esc_calib
 	systemcmds/reboot
-	systemcmds/topic_listener
+	#systemcmds/topic_listener
 	systemcmds/top
 	systemcmds/config
 	systemcmds/nshterm


px4fmu-v4 add lpe

px4fmu-v4 add lpe

--- cmake/configs/nuttx_px4fmu-v4_default.cmake
+++ cmake/configs/nuttx_px4fmu-v4_default.cmake
@@ -83,12 +83,11 @@
 	#
 	# Estimation modules (EKF/ SO3 / other filters)
 	#
-	# Too high RAM usage due to static allocations
-	# modules/attitude_estimator_ekf
 	modules/attitude_estimator_q
 	modules/ekf_att_pos_estimator
 	modules/position_estimator_inav
 	modules/ekf2
+	modules/local_position_estimator

 	#
 	# Vehicle Control


Improve wording.

Improve wording.

"Eventually needed" means that in the end, TMVA really needs it, while it really is optional.

--- cmake/modules/SearchInstalledSoftware.cmake
+++ cmake/modules/SearchInstalledSoftware.cmake
@@ -1237,9 +1237,9 @@

 #---Check for CUDA and BLAS ---------------------------------------------------------
 if(tmva)
-  message(STATUS "Looking for CUDA eventually needed by TMVA")
+  message(STATUS "Looking for CUDA for optional parts of TMVA")
   find_package(CUDA QUIET)
-  message(STATUS "Looking for BLAS eventually needed by TMVA")
+  message(STATUS "Looking for BLAS for optional parts of TMVA")
   find_package(BLAS QUIET)
 endif()


Enable builtin VecCore instead of failing if not found

--- cmake/modules/SearchInstalledSoftware.cmake
+++ cmake/modules/SearchInstalledSoftware.cmake
@@ -1354,15 +1354,10 @@
   if(vc)
     set(VecCore_COMPONENTS Vc)
   endif()
-  if(fail-on-missing)
-    find_package(VecCore 0.4.0 CONFIG QUIET REQUIRED COMPONENTS ${VecCore_COMPONENTS})
-  else()
-    find_package(VecCore 0.4.0 CONFIG QUIET COMPONENTS ${VecCore_COMPONENTS})
-    if(NOT VecCore_FOUND)
-      message(STATUS "VecCore not found, support for it disabled.")
-      message(STATUS "Please enable the option 'builtin_veccore' to build VecCore internally.")
-      set(veccore OFF CACHE BOOL "" FORCE)
-    endif()
+  find_package(VecCore 0.4.0 CONFIG QUIET COMPONENTS ${VecCore_COMPONENTS})
+  if(NOT VecCore_FOUND)
+    message(STATUS "VecCore not found, switching on 'builtin_veccore' option.")
+    set(builtin_veccore ON CACHE BOOL "" FORCE)
   endif()
 endif()


actually added the orig argument

actually added the orig argument

--- CMake/UseCyclus.cmake
+++ CMake/UseCyclus.cmake
@@ -36,7 +36,7 @@
   SET(CCOUT "-o=${BUILD_DIR}/${_name}.cc")
   SET(ORIG "--pass3-use-orig")
   MESSAGE(STATUS "Executing ${CYCPP} ${CCIN} ${CCOUT} ${ORIG}")
-  EXECUTE_PROCESS(COMMAND ${CYCPP} ${CCIN} ${CCOUT})
+  EXECUTE_PROCESS(COMMAND ${CYCPP} ${CCIN} ${CCOUT} ${ORIG})

   # add library
   ADD_LIBRARY(${_dir} ${BUILD_DIR}/${_name}.cc)


MITK 2013.09.00 version update

MITK 2013.09.00 version update

--- CMake/mitkSetupVariables.cmake
+++ CMake/mitkSetupVariables.cmake
@@ -6,8 +6,8 @@

 # MITK_VERSION
 set(MITK_VERSION_MAJOR "2013")
-set(MITK_VERSION_MINOR "06")
-set(MITK_VERSION_PATCH "99")
+set(MITK_VERSION_MINOR "09")
+set(MITK_VERSION_PATCH "00")
 set(MITK_VERSION_STRING "${MITK_VERSION_MAJOR}.${MITK_VERSION_MINOR}.${MITK_VERSION_PATCH}")
 if(MITK_VERSION_PATCH STREQUAL "99")
   set(MITK_VERSION_STRING "${MITK_VERSION_STRING}-${MITK_REVISION_SHORTID}")


Reorganize GUI installer comps heirarchy

--- CMakeModules/CPackConfig.cmake
+++ CMakeModules/CPackConfig.cmake
@@ -7,7 +7,7 @@

 cmake_minimum_required(VERSION 3.5)

-set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/CMakeModules/nsis")
+list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/CMakeModules/nsis")

 include(Version)
 include(CPackIFW)
@@ -48,13 +48,10 @@

 # Platform specific settings for CPACK generators
 # - OSX specific
-#   - DragNDrop (OSX only)
-#   - PackageMaker (OSX only)
-#   - OSXX11 (OSX only)
-#   - Bundle (OSX only)
+#   - productbuild (OSX only)
 # - Windows
 #   - NSIS64 Generator
-if (WIN32)
+if(WIN32)
   set(WIN_INSTALL_SOURCE ${PROJECT_SOURCE_DIR}/CMakeModules/nsis)

   set(LICENSE_FILE       "${Forge_SOURCE_DIR}/LICENSE")
@@ -70,15 +67,15 @@
   set(CPACK_NSIS_HELP_LINK "${APP_URL}")
   set(CPACK_NSIS_URL_INFO_ABOUT "${APP_URL}")
   set(CPACK_NSIS_INSTALLED_ICON_NAME "${MY_CPACK_PACKAGE_ICON}")
-  if (CMAKE_CL_64)
+  if(CMAKE_CL_64)
     set(CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES64")
-  else (CMAKE_CL_64)
+  else(CMAKE_CL_64)
     set(CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES")
-  endif (CMAKE_CL_64)
-else ()
+  endif(CMAKE_CL_64)
+else()
     set(CPACK_RESOURCE_FILE_LICENSE "${Forge_SOURCE_DIR}/LICENSE")
     set(CPACK_RESOURCE_FILE_README "${Forge_SOURCE_DIR}/README.md")
-endif ()
+endif()

 # Set the default components installed in the package
 get_cmake_property(CPACK_COMPONENTS_ALL COMPONENTS)
@@ -92,25 +89,31 @@
 cpack_add_install_type(Runtime
   DISPLAY_NAME "Runtime")

+cpack_add_component_group(backends
+  DISPLAY_NAME "Forge"
+  DESCRIPTION "Forge libraries")
+
 cpack_add_component(dependencies
-  DISPLAY_NAME "Forge Library Dependencies"
-  DESCRIPTION "Libraries required by forge OpenGL backend"
+  DISPLAY_NAME "Forge Dependencies"
+  DESCRIPTION "Libraries required by Forge OpenGL backend"
+  PARENT_GROUP backends
   INSTALL_TYPES Development Runtime)

 cpack_add_component(forge
   DISPLAY_NAME "Forge"
   DESCRIPTION "Forge library."
+  PARENT_GROUP backends
   DEPENDS dependencies
   INSTALL_TYPES Development Runtime)

 cpack_add_component(documentation
   DISPLAY_NAME "Documentation"
-  DESCRIPTION "Doxygen documentation"
+  DESCRIPTION "Forge documentation files"
   INSTALL_TYPES Extra)

 cpack_add_component(headers
   DISPLAY_NAME "C/C++ Headers"
-  DESCRIPTION "Headers for the Forge Libraries."
+  DESCRIPTION "Development headers for the Forge library."
   INSTALL_TYPES Development)

 cpack_add_component(cmake
@@ -135,10 +138,11 @@
 set(CPACK_IFW_PACKAGE_WINDOW_ICON "${CMAKE_SOURCE_DIR}/assets/arrayfire_icon.png")
 set(CPACK_IFW_PACKAGE_LOGO "${CMAKE_SOURCE_DIR}/assets/arrayfire_logo.png")
 if (WIN32)
-    set(CPACK_IFW_ADMIN_TARGET_DIRECTORY "$PROGRAMFILES64/${CPACK_PACKAGE_INSTALL_DIRECTORY}")
+  set(CPACK_IFW_ADMIN_TARGET_DIRECTORY "$PROGRAMFILES64/${CPACK_PACKAGE_INSTALL_DIRECTORY}")
 else ()
-    set(CPACK_IFW_ADMIN_TARGET_DIRECTORY "/opt/${CPACK_PACKAGE_INSTALL_DIRECTORY}")
+  set(CPACK_IFW_ADMIN_TARGET_DIRECTORY "/opt/${CPACK_PACKAGE_INSTALL_DIRECTORY}")
 endif ()
+cpack_ifw_configure_component_group(backends)
 cpack_ifw_configure_component(dependencies)
 cpack_ifw_configure_component(forge)
 cpack_ifw_configure_component(documentation)


Forward some more CMake variables to host builds. (#3690)

* Forward some more CMake variables to host builds.

This makes it so that these variables (which control sanitizers, use of
ccache, and cmake verbosity) apply also to the host build, not just to
the target build.

* address Scott's review comment

--- build_tools/cmake/iree_cross_compile.cmake
+++ build_tools/cmake/iree_cross_compile.cmake
@@ -124,6 +124,12 @@
         # )
         -DIREE_HAL_DRIVERS_TO_BUILD="${_CONFIG_HAL_DRIVERS_TO_BUILD}"
         -DIREE_TARGET_BACKENDS_TO_BUILD="${_CONFIG_TARGET_BACKENDS_TO_BUILD}"
+        -DIREE_ENABLE_ASAN=${IREE_ENABLE_ASAN}
+        -DIREE_ENABLE_MSAN=${IREE_ENABLE_MSAN}
+        -DIREE_ENABLE_TSAN=${IREE_ENABLE_TSAN}
+        -DIREE_ENABLE_CCACHE=${IREE_ENABLE_CCACHE}
+        -DLLVM_CCACHE_BUILD=${LLVM_CCACHE_BUILD}
+        -DCMAKE_VERBOSE_MAKEFILE=${CMAKE_VERBOSE_MAKEFILE}
     WORKING_DIRECTORY ${_CONFIG_BINARY_ROOT}
     DEPENDS iree_prepare_${CONFIG_NAME}_dir
     COMMENT "Configuring IREE for ${CONFIG_NAME} build...")


cmake error

cmake error

--- ConfigureChecks.cmake
+++ ConfigureChecks.cmake
@@ -10,6 +10,7 @@
   febird
   udt3
   izene_log
+  izene_util
   bigint
   procmeminfo
   luxio


Fix build error simplifying logic used to include external projects

Since calling "find_package(Slicer [...])" already include ITK, it
should be done conditionally in case the project is not build as a
Slicer extension.

This should fix the following issue: http://slicer-devel.65872.n3.nabble.com/Extension-argument-list-length-error-td4028691.html

Note also that this commit does not address the other build error related to IO_WriteOnly and IO_Translate. QFile::WriteOnly should probably be used.

--- DTIAtlasBuilder.cmake
+++ DTIAtlasBuilder.cmake
@@ -2,50 +2,10 @@
 CMAKE_POLICY(VERSION 2.8)

 #======================================================================================
-# As the external project gives this CMakeLists the paths to the needed libraries (*_DIR), find_package will just use the existing *_DIR
-find_package(ITK REQUIRED)
-if(ITK_FOUND)
-  include(${ITK_USE_FILE}) # creates ITK_DIR
-else(ITK_FOUND)
-  message(FATAL_ERROR "ITK not found. Please set ITK_DIR")
-endif(ITK_FOUND)
-
-find_package(GenerateCLP REQUIRED)
-if(GenerateCLP_FOUND)
-  include(${GenerateCLP_USE_FILE}) # creates GenerateCLP_DIR ModuleDescriptionParser_DIR TCLAP_DIR
-else(GenerateCLP_FOUND)
-  message(FATAL_ERROR "GenerateCLP not found. Please set GenerateCLP_DIR")
-endif(GenerateCLP_FOUND)
-
-find_package(Qt4 REQUIRED) # For DTIAtlasBuilder
-if(QT_USE_FILE)
-  include_directories(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR} ${QT_INCLUDE_DIR})
-  include(${QT_USE_FILE}) # creates QT_QMAKE_EXECUTABLE
-  add_definitions(-DQT_GUI_LIBS -DQT_CORE_LIB -DQT3_SUPPORT)
-else(QT_USE_FILE)
-  message(FATAL_ERROR, "QT not found. Please set QT_DIR.")
-endif(QT_USE_FILE)
-
-#======================================================================================
 # For Slicer Extension -> will create target "ExperimentalUpload" inside inner build. !! Needs to be before add testing
-if( DTIAtlasBuilder_BUILD_SLICER_EXTENSION )
-  # Unset variables because Slicer will try to set it again and ERROR
-  set( ITK_DIR_TMP ${ITK_DIR} )
-  unset( ITK_DIR CACHE )
-  unset( ITK_DIR )
-  set( ITK_LIBRARIES_TMP ${ITK_LIBRARIES} )
-  unset( ITK_LIBRARIES CACHE )
-  unset( ITK_LIBRARIES )
-  set( SlicerExecutionModel_DIR_TMP ${SlicerExecutionModel_DIR} )
-  unset( SlicerExecutionModel_DIR )
-  unset( SlicerExecutionModel_DIR CACHE )
-
+if(DTIAtlasBuilder_BUILD_SLICER_EXTENSION)
   find_package(Slicer REQUIRED)
   include(${Slicer_USE_FILE})
-
-  set( ITK_DIR ${ITK_DIR_TMP} CACHE PATH "ITK PATH" FORCE )
-  set( ITK_LIBRARIES ${ITK_LIBRARIES_TMP} CACHE PATH "ITK PATH" FORCE )
-  set( SlicerExecutionModel_DIR ${SlicerExecutionModel_DIR_TMP} CACHE PATH "SlicerExecutionModel PATH" FORCE )

   # Create sym links during install step
   if(APPLE)
@@ -54,7 +14,24 @@
     install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/InstallApple/AppleCreateLinkLibs.sh DESTINATION ${INSTALL_DIR}/../share)
   endif(APPLE)

-endif( DTIAtlasBuilder_BUILD_SLICER_EXTENSION )
+endif(DTIAtlasBuilder_BUILD_SLICER_EXTENSION)
+
+#======================================================================================
+# As the external project gives this CMakeLists the paths to the needed libraries (*_DIR), find_package will just use the existing *_DIR
+
+if(NOT ITK_FOUND)
+  find_package(ITK REQUIRED)
+  include(${ITK_USE_FILE})
+endif(NOT ITK_FOUND)
+
+
+find_package(Qt4 REQUIRED) # For DTIAtlasBuilder
+include(${QT_USE_FILE})
+
+find_package(GenerateCLP REQUIRED)
+include(${GenerateCLP_USE_FILE})
+
+include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR})

 #======================================================================================
 # Compile step for DTIAtlasBuilder
@@ -202,4 +179,3 @@
     include(${Slicer_EXTENSION_CPACK}) # So we can make package
   endif()
 endif( DTIAtlasBuilder_BUILD_SLICER_EXTENSION )
-


Support C-only projects

Support C-only projects

--- conan.cmake
+++ conan.cmake
@@ -62,37 +62,57 @@
         endif()
     endif()

-    if (${CMAKE_CXX_COMPILER_ID} STREQUAL GNU)
+    get_property(_languages GLOBAL PROPERTY ENABLED_LANGUAGES)
+    list (FIND _languages "CXX" _index)
+    if (${_index} GREATER -1)
+        set(USING_CXX 1)
+    else ()
+        set(USING_CXX 0)
+    endif()
+
+    if (${CMAKE_C_COMPILER_ID} STREQUAL GNU)
         # using GCC
         # TODO: Handle other params
-        string(REPLACE "." ";" VERSION_LIST ${CMAKE_CXX_COMPILER_VERSION})
+        string(REPLACE "." ";" VERSION_LIST ${CMAKE_C_COMPILER_VERSION})
         list(GET VERSION_LIST 0 MAJOR)
         list(GET VERSION_LIST 1 MINOR)
-        conan_cmake_detect_gnu_libcxx(_LIBCXX)
-        set(_SETTINGS ${_SETTINGS} -s compiler=gcc -s compiler.version=${MAJOR}.${MINOR} -s compiler.libcxx=${_LIBCXX})
-    elseif (${CMAKE_CXX_COMPILER_ID} STREQUAL AppleClang)
+        set(_SETTINGS ${_SETTINGS} -s compiler=gcc -s compiler.version=${MAJOR}.${MINOR})
+        if (USING_CXX)
+            conan_cmake_detect_gnu_libcxx(_LIBCXX)
+            set(_SETTINGS ${_SETTINGS} -s compiler.libcxx=${_LIBCXX})
+        endif ()
+    elseif (${CMAKE_C_COMPILER_ID} STREQUAL AppleClang)
         # using AppleClang
-        string(REPLACE "." ";" VERSION_LIST ${CMAKE_CXX_COMPILER_VERSION})
+        string(REPLACE "." ";" VERSION_LIST ${CMAKE_C_COMPILER_VERSION})
         list(GET VERSION_LIST 0 MAJOR)
         list(GET VERSION_LIST 1 MINOR)
-        set(_SETTINGS ${_SETTINGS} -s compiler=apple-clang -s compiler.version=${MAJOR}.${MINOR} -s compiler.libcxx=libc++)
-    elseif (${CMAKE_CXX_COMPILER_ID} STREQUAL Clang)
-        string(REPLACE "." ";" VERSION_LIST ${CMAKE_CXX_COMPILER_VERSION})
+        set(_SETTINGS ${_SETTINGS} -s compiler=apple-clang -s compiler.version=${MAJOR}.${MINOR})
+        if (USING_CXX)
+            set(_SETTINGS ${_SETTINGS} -s compiler.libcxx=libc++)
+        endif ()
+    elseif (${CMAKE_C_COMPILER_ID} STREQUAL Clang)
+        string(REPLACE "." ";" VERSION_LIST ${CMAKE_C_COMPILER_VERSION})
         list(GET VERSION_LIST 0 MAJOR)
         list(GET VERSION_LIST 1 MINOR)
         if(APPLE)
             cmake_policy(GET CMP0025 APPLE_CLANG_POLICY_ENABLED)
             if(NOT APPLE_CLANG_POLICY_ENABLED)
                 message(STATUS "Conan: APPLE and Clang detected. Assuming apple-clang compiler. Set CMP0025 to avoid it")
-                set(_SETTINGS ${_SETTINGS} -s compiler=apple-clang -s compiler.version=${MAJOR}.${MINOR} -s compiler.libcxx=libc++)
+                set(_SETTINGS ${_SETTINGS} -s compiler=apple-clang -s compiler.version=${MAJOR}.${MINOR})
             else()
-                set(_SETTINGS ${_SETTINGS} -s compiler=clang -s compiler.version=${MAJOR}.${MINOR} -s compiler.libcxx=libstdc++)
+                set(_SETTINGS ${_SETTINGS} -s compiler=clang -s compiler.version=${MAJOR}.${MINOR})
             endif()
-        else()
-            conan_cmake_detect_gnu_libcxx(_LIBCXX)
-            set(_SETTINGS ${_SETTINGS} -s compiler=clang -s compiler.version=${MAJOR}.${MINOR} -s compiler.libcxx=${_LIBCXX})
-        endif()
-    elseif(${CMAKE_CXX_COMPILER_ID} STREQUAL MSVC)
+            if (USING_CXX)
+                set(_SETTINGS ${_SETTINGS} -s compiler.libcxx=libc++)
+            endif ()
+        else()
+            set(_SETTINGS ${_SETTINGS} -s compiler=clang -s compiler.version=${MAJOR}.${MINOR})
+            if (USING_CXX)
+                conan_cmake_detect_gnu_libcxx(_LIBCXX)
+                set(_SETTINGS ${_SETTINGS} -s compiler.libcxx=${_LIBCXX})
+            endif ()
+        endif()
+    elseif(${CMAKE_C_COMPILER_ID} STREQUAL MSVC)
         set(_VISUAL "Visual Studio")
         _get_msvc_ide_version(_VISUAL_VERSION)
         if("${_VISUAL_VERSION}" STREQUAL "")
@@ -101,15 +121,15 @@
             set(_SETTINGS ${_SETTINGS} -s compiler=${_VISUAL} -s compiler.version=${_VISUAL_VERSION})
         endif()

-        if (MSVC_CXX_ARCHITECTURE_ID MATCHES "64")
+        if (MSVC_C_ARCHITECTURE_ID MATCHES "64")
             set(_SETTINGS ${_SETTINGS} -s arch=x86_64)
-        elseif (MSVC_CXX_ARCHITECTURE_ID MATCHES "^ARM")
+        elseif (MSVC_C_ARCHITECTURE_ID MATCHES "^ARM")
             message(STATUS "Conan: Using default ARM architecture from MSVC")
             set(_SETTINGS ${_SETTINGS} -s arch=armv6)
-        elseif (MSVC_CXX_ARCHITECTURE_ID MATCHES "86")
+        elseif (MSVC_C_ARCHITECTURE_ID MATCHES "86")
             set(_SETTINGS ${_SETTINGS} -s arch=x86)
         else ()
-            message(FATAL_ERROR "Conan: Unknown MSVC architecture [${MSVC_CXX_ARCHITECTURE_ID}]")
+            message(FATAL_ERROR "Conan: Unknown MSVC architecture [${MSVC_C_ARCHITECTURE_ID}]")
         endif()

         conan_cmake_detect_vs_runtime(_vs_runtime)


setting CONAN_IMPORT_PATH env-var

setting CONAN_IMPORT_PATH env-var

--- conan.cmake
+++ conan.cmake
@@ -396,6 +396,7 @@
         conan_cmake_setup_conanfile(${ARGV})
         if(CONAN_CMAKE_MULTI)
             foreach(CMAKE_BUILD_TYPE "Release" "Debug")
+                set(ENV{CONAN_IMPORT_PATH} ${CMAKE_BUILD_TYPE})
                 conan_cmake_settings(settings ${ARGV})
                 conan_cmake_install(SETTINGS ${settings} ${ARGV})
             endforeach()