[backport#17674] tests: Add initialization order fiasco detection in Travis

Summary:
1f9d5af4f197e7cc0469a0bb25dcbc51dfa537f4 tests: Add initialization order fiasco detection in Travis (practicalswift)

Pull request description:

  Add initialization order fiasco detection in Travis :)

  Context: https://github.com/bitcoin/bitcoin/pull/17670#issuecomment-562035813

  This would have caught the `events_hasher` initialization order issue introduced in #17573  and fixed in #17670.

  Output in case of an initialization order fiasco:

  ```
  ==7934==ERROR: AddressSanitizer: initialization-order-fiasco on address 0x557098d79200 at pc 0x55709796b9a3 bp 0x7ffde524dc30 sp 0x7ffde524dc28
  READ of size 8 at 0x557098d79200 thread T0
      #0 0x55709796b9a2 in CSHA256::Finalize(unsigned char*) src/crypto/sha256.cpp:667:25
      #1 0x5570978150e9 in SeedEvents(CSHA512&) src/random.cpp:462:19
      #2 0x5570978145e1 in SeedSlow(CSHA512&) src/random.cpp:482:5
      #3 0x5570978149a3 in SeedStartup(CSHA512&, (anonymous namespace)::RNGState&) src/random.cpp:527:5
      #4 0x55709781102d in ProcRand(unsigned char*, int, RNGLevel) src/random.cpp:571:9
      #5 0x557097810d19 in GetRandBytes(unsigned char*, int) src/random.cpp:576:59
      #6 0x557096c2f9d5 in (anonymous namespace)::CSignatureCache::CSignatureCache() src/script/sigcache.cpp:34:9
      #7 0x557096511977 in __cxx_global_var_init.7 src/script/sigcache.cpp:67:24
      #8 0x5570965119f8 in _GLOBAL__sub_I_sigcache.cpp src/script/sigcache.cpp
      #9 0x557097bba4ac in __libc_csu_init (src/bitcoind+0x18554ac)
      #10 0x7f214b1c2b27 in __libc_start_main /build/glibc-OTsEL5/glibc-2.27/csu/../csu/libc-start.c:266
      #11 0x5570965347d9 in _start (src/bitcoind+0x1cf7d9)

  0x557098d79200 is located 96 bytes inside of global variable 'events_hasher' defined in 'random.cpp:456:16' (0x557098d791a0) of size 104
    registered at:
      #0 0x557096545dfd in __asan_register_globals compiler-rt/lib/asan/asan_globals.cpp:360:3
      #1 0x557097817f8b in asan.module_ctor (src/bitcoind+0x14b2f8b)

  SUMMARY: AddressSanitizer: initialization-order-fiasco src/crypto/sha256.cpp:667:25 in CSHA256::Finalize(unsigned char*)
  ```

---

Backport of Core [[https://github.com/bitcoin/bitcoin/pull/17674 | PR17674]]

Depends on D8756

Test Plan:
  cmake -GNinja -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DENABLE_SANITIZERS=address
  ninja all check check-functional

Reviewers: #bitcoin_abc, jasonbcox

Reviewed By: #bitcoin_abc, jasonbcox

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

--- cmake/modules/Sanitizers.cmake
+++ cmake/modules/Sanitizers.cmake
@@ -42,6 +42,8 @@
 	if("address" IN_LIST ARGN)
 		add_test_environment(ASAN_OPTIONS "malloc_context_size=0:$ENV{ASAN_OPTIONS}")
 		add_test_environment(ASAN_OPTIONS "detect_stack_use_after_return=1:$ENV{ASAN_OPTIONS}")
+		add_test_environment(ASAN_OPTIONS "check_initialization_order=1:$ENV{ASAN_OPTIONS}")
+		add_test_environment(ASAN_OPTIONS "strict_init_order=1:$ENV{ASAN_OPTIONS}")
 		add_test_environment(LSAN_OPTIONS "suppressions=${SAN_SUPP_DIR}/lsan:$ENV{LSAN_OPTIONS}")
 	endif()
 	if("thread" IN_LIST ARGN)


Enable documentation warnings

Enable documentation warnings

Clang can warn about Doxygen problems during the compile.

--- cmake/snippets/flags-gnu.cmake
+++ cmake/snippets/flags-gnu.cmake
@@ -67,6 +67,7 @@
 sprokit_check_compiler_flag(sprokit_warnings -Wlogical-op)
 sprokit_check_compiler_flag(sprokit_warnings -Wmissing-braces)
 sprokit_check_compiler_flag(sprokit_warnings -Wimplicit-fallthrough)
+sprokit_check_compiler_flag(sprokit_warnings -Wdocumentation)

 option(SPROKIT_ENABLE_NITPICK "Generate warnings about nitpicky things" OFF)
 if (SPROKIT_ENABLE_NITPICK)


minor changes

minor changes

--- utils.cmake
+++ utils.cmake
@@ -74,6 +74,7 @@
 		add_definitions(-Wno-error=unused-parameter)
 		add_definitions(-Wno-error=deprecated-declarations)
 		add_definitions(-Wno-error=sign-conversion)
+		add_definitions(-Wno-error=switch-enum)

 		if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
 			add_definitions(-Wno-error=suggest-attribute=noreturn)


ENH: Fiberviewer was not compiling anymore with r23735 (previously?).

There were issues with using the system default CMAKE_C_COMPILER and the CMAKE_CXX_COMPILER to build the extension when Slicer was built with other compilers.

--- SuperBuild.cmake
+++ SuperBuild.cmake
@@ -46,8 +46,8 @@
   #We also remove 'EXTENSION_SUPERBUILD_BINARY_DIR:PATH' from 'list(APPEND ${CMAKE_PROJECT_NAME}_SUPERBUILD_EP_VARS'
   #include(${Slicer_USE_FILE})
   set(EXTENSION TRUE)
-  unsetAllForSlicerBut( NAMES VTK_DIR ITK_DIR SlicerExecutionModel_DIR QT_QMAKE_EXECUTABLE )
-  resetForSlicer( NAMES CMAKE_MODULE_PATH CMAKE_C_COMPILER CMAKE_CXX_COMPILER CMAKE_CXX_FLAGS CMAKE_C_FLAGS )
+  unsetAllForSlicerBut( NAMES VTK_DIR ITK_DIR SlicerExecutionModel_DIR QT_QMAKE_EXECUTABLE CMAKE_C_COMPILER CMAKE_CXX_COMPILER CMAKE_CXX_FLAGS CMAKE_C_FLAGS )
+  resetForSlicer( NAMES CMAKE_MODULE_PATH )
   set( SUPERBUILD_NOT_EXTENSION FALSE )
 else()
   set( SUPERBUILD_NOT_EXTENSION TRUE )


BUG: Setting linker and cxx/c flags

BUG: Setting linker and cxx/c flags

--- SuperBuild.cmake
+++ SuperBuild.cmake
@@ -33,6 +33,8 @@
     CMAKE_ARGS
       -DCMAKE_CXX_FLAGS:STRING=${CMAKE_CXX_FLAGS}
       -DCMAKE_C_FLAGS:STRING=${CMAKE_C_FLAGS}
+      -DCMAKE_EXE_LINKER_FLAGS:STRING=${CMAKE_EXE_LINKER_FLAGS}
+      -DCMAKE_SHARED_LINKER_FLAGS:STRING=${CMAKE_SHARED_LINKER_FLAGS}
       -DCMAKE_BUILD_TYPE:STRING=${build_type}
       -DBUILD_SHARED_LIBS:BOOL=${shared}
       -DBUILD_EXAMPLES:BOOL=OFF
@@ -59,6 +61,8 @@
   CMAKE_ARGS
     -DCMAKE_CXX_FLAGS:STRING=${CMAKE_CXX_FLAGS}
     -DCMAKE_C_FLAGS:STRING=${CMAKE_C_FLAGS}
+    -DCMAKE_EXE_LINKER_FLAGS:STRING=${CMAKE_EXE_LINKER_FLAGS}
+    -DCMAKE_SHARED_LINKER_FLAGS:STRING=${CMAKE_SHARED_LINKER_FLAGS}
     -DCMAKE_BUILD_TYPE:STRING=${build_type}
     -DBUILD_SHARED_LIBS:BOOL=${shared}
     -DBUILD_EXAMPLES:BOOL=OFF
@@ -87,6 +91,8 @@
   CMAKE_ARGS
     -DCMAKE_CXX_FLAGS:STRING=${CMAKE_CXX_FLAGS}
     -DCMAKE_C_FLAGS:STRING=${CMAKE_C_FLAGS}
+    -DCMAKE_EXE_LINKER_FLAGS:STRING=${CMAKE_EXE_LINKER_FLAGS}
+    -DCMAKE_SHARED_LINKER_FLAGS:STRING=${CMAKE_SHARED_LINKER_FLAGS}
     -DCMAKE_BUILD_TYPE:STRING=${build_type}
     -DBUILD_SHARED_LIBS:BOOL=${shared}
     -DBUILD_EXAMPLES:BOOL=OFF
@@ -111,6 +117,8 @@
   CMAKE_ARGS
     -DCMAKE_CXX_FLAGS:STRING=${CMAKE_CXX_FLAGS}
     -DCMAKE_C_FLAGS:STRING=${CMAKE_C_FLAGS}
+    -DCMAKE_EXE_LINKER_FLAGS:STRING=${CMAKE_EXE_LINKER_FLAGS}
+    -DCMAKE_SHARED_LINKER_FLAGS:STRING=${CMAKE_SHARED_LINKER_FLAGS}
     -DCMAKE_BUILD_TYPE:STRING=${build_type}
     -DBUILD_SHARED_LIBS:BOOL=${shared}
     -DBUILD_EXAMPLES:BOOL=OFF
@@ -140,6 +148,8 @@
     CMAKE_ARGS
       -DCMAKE_CXX_FLAGS:STRING=${CMAKE_CXX_FLAGS}
       -DCMAKE_C_FLAGS:STRING=${CMAKE_C_FLAGS}
+      -DCMAKE_EXE_LINKER_FLAGS:STRING=${CMAKE_EXE_LINKER_FLAGS}
+      -DCMAKE_SHARED_LINKER_FLAGS:STRING=${CMAKE_SHARED_LINKER_FLAGS}
       -DCMAKE_BUILD_TYPE:STRING=${build_type}
       -DBUILD_SHARED_LIBS:BOOL=${shared}
       -DBUILD_EXAMPLES:BOOL=OFF
@@ -164,8 +174,7 @@
   find_package( Qt4 )
   if( NOT QT4_FOUND )
    MESSAGE(SEND_ERROR
-     "Qt ${QT_MIN_VERSION} or greater not found."
-     "  Please check the QT_QMAKE_EXECUTABLE variable." )
+     "Qt ${QT_MIN_VERSION} or greater not found. Please check the QT_QMAKE_EXECUTABLE variable." )
   endif( NOT QT4_FOUND )
   set(proj CTK)
   ExternalProject_Add(${proj}


Add remote module for superbuild build

Add remote module for superbuild build

--- CI/main_superbuild.cmake
+++ CI/main_superbuild.cmake
@@ -126,6 +126,13 @@

 set (CONFIGURE_OPTIONS  "")
 include ( "${CMAKE_CURRENT_LIST_DIR}/configure_option.cmake" )
+
+# For superbuild we need remote module
+foreach(remote_module SertitObject Mosaic otbGRM DiapOTBModule)
+    set ( CONFIGURE_OPTIONS
+      "${CONFIGURE_OPTIONS}-DModule_${remote_module}:BOOL=ON;")
+endforeach()
+
 # SuperBuild case : one more configure option
 set ( CONFIGURE_OPTIONS
   "${CONFIGURE_OPTIONS}-DCMAKE_PREFIX_PATH=${XDK_PATH};")


do not force a boost thread version

do not force a boost thread version

fixes #99

--- CMake/Dependencies.cmake
+++ CMake/Dependencies.cmake
@@ -270,11 +270,6 @@
     find_package(Boost COMPONENTS ${OGRE_BOOST_COMPONENTS} QUIET)
 endif()

-if(Boost_VERSION GREATER 105200)
-	# Use boost threading version 4 for boost 1.53 and above
-	add_definitions( -DBOOST_THREAD_VERSION=4 )
-endif()
-
 if(Boost_FOUND AND NOT WIN32)
   list(REMOVE_DUPLICATES Boost_LIBRARIES)
 endif()


iOS: Don't search for X11 if building for iOS.  I'm surprised that this hasn't been found until now.  Apparently most devs have the X11 package installed.

--HG--
branch : v1-7

--- CMake/Dependencies.cmake
+++ CMake/Dependencies.cmake
@@ -70,7 +70,7 @@
 macro_log_feature(FREETYPE_FOUND "freetype" "Portable font engine" "http://www.freetype.org" TRUE "" "")

 # Find X11
-if (UNIX)
+if (UNIX AND NOT OGRE_BUILD_PLATFORM_IPHONE)
 	find_package(X11)
 	macro_log_feature(X11_FOUND "X11" "X Window system" "http://www.x.org" TRUE "" "")
 	macro_log_feature(X11_Xt_FOUND "Xt" "X Toolkit" "http://www.x.org" TRUE "" "")


Fix CMake problem that could cause errors and configuration to stop if boost was not found.

--- CMake/Dependencies.cmake
+++ CMake/Dependencies.cmake
@@ -170,7 +170,9 @@
     find_package(Boost COMPONENTS ${OGRE_BOOST_COMPONENTS} QUIET)
 endif()

-list(REMOVE_DUPLICATES Boost_LIBRARIES)
+if(Boost_FOUND)
+  list(REMOVE_DUPLICATES Boost_LIBRARIES)
+endif()

 # Optional Boost libs (Boost_${COMPONENT}_FOUND
 macro_log_feature(Boost_FOUND "boost" "Boost (general)" "http://boost.org" FALSE "" "")


CMake: request legacy GL discovery mode

CMake: request legacy GL discovery mode

--- CMake/Dependencies.cmake
+++ CMake/Dependencies.cmake
@@ -233,6 +233,7 @@

 # Find OpenGL
 if(NOT ANDROID AND NOT EMSCRIPTEN)
+  set(OpenGL_GL_PREFERENCE LEGACY) # we want to use OPENGL_gl_LIBRARY for now
   find_package(OpenGL)
   macro_log_feature(OPENGL_FOUND "OpenGL" "Support for the OpenGL and OpenGL 3+ render systems" "http://www.opengl.org/" FALSE "" "")
 endif()


Fix the link for TBB

Fix the link for TBB

--HG--
extra : convert_revision : svn%3A8631bf8a-c64b-0410-883c-f3eb003322f7/trunk%401120

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

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


vtkMPI: install so that vtk_mpi_link is available

Change-Id: Ifa31f43938a5c20dfce8ea8b135d43db5f2b3697

--- CMake/vtkModuleTop.cmake
+++ CMake/vtkModuleTop.cmake
@@ -454,6 +454,7 @@
                 CMake/vtkModuleHeaders.cmake.in
                 CMake/vtkModuleInfo.cmake.in
                 CMake/vtkModuleMacros.cmake
+                CMake/vtkMPI.cmake
                 CMake/vtkExternalModuleMacros.cmake
                 CMake/vtkObjectFactory.cxx.in
                 CMake/vtkObjectFactory.h.in


Updated CTK version to include fixes for GCC 4.7

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

   if(NOT DEFINED CTK_DIR)

-    set(revision_tag 70c0a8d3)
+    set(revision_tag 96bb84d885d936b3980f07f7dc5dafecfcc96a8e)
     #IF(${proj}_REVISION_TAG)
     #  SET(revision_tag ${${proj}_REVISION_TAG})
     #ENDIF()


Android toolchain default NDK path is updated for version r6

--- android/android.toolchain.cmake
+++ android/android.toolchain.cmake
@@ -1,5 +1,5 @@
 # ----------------------------------------------------------------------------
-#  Android CMake toolchain file, for use with the ndk r5
+#  Android CMake toolchain file, for use with the ndk r5,r6
 #  See home page: http://code.google.com/p/android-cmake/
 #
 #  Usage Linux:
@@ -16,13 +16,13 @@
 #     You need native port of make to build your project.
 #     For example this one: http://gnuwin32.sourceforge.net/packages/make.htm
 #
-#   $ SET ANDROID_NDK=C:\<absolute path to NDK>\android-ndk-r5c
+#   $ SET ANDROID_NDK=C:\<absolute path to NDK>\android-ndk-r6
 #   $ cmake.exe -G"Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE=<path to this file>\android.toolchain.cmake -DCMAKE_MAKE_PROGRAM=C:\<absolute path to make>\make.exe ..
 #   $ C:\<absolute path to make>\make.exe
 #
 #
 #  Toolchain options (can be set as cmake parameters: -D<option_name>=<value>):
-#    ANDROID_NDK=/opt/android-ndk-r5c - path to NDK root.
+#    ANDROID_NDK=/opt/android-ndk-r6 - path to NDK root.
 #      Can be set as environment variable.
 #
 #    ANDROID_NDK_TOOLCHAIN_ROOT=/opt/android-toolchain - path to standalone toolchain.
@@ -95,6 +95,9 @@
 #     [-] removed SWIG-related stuff from toolchain
 #     [+] added macro find_host_package, find_host_program to search packages/programs on host system
 #     [~] fixed path to STL library
+#   - modified June 2011 Andrey Kamaev andrey.kamaev@itseez.com
+#     [~] default NDK path is updated for version r6
+#     [~] fixed options caching
 # ----------------------------------------------------------------------------

@@ -104,7 +107,7 @@
 #this one not so much
 set( CMAKE_SYSTEM_VERSION 1 )

-set( ANDROID_NDK_DEFAULT_SEARCH_PATH /opt/android-ndk-r5c )
+set( ANDROID_NDK_DEFAULT_SEARCH_PATH /opt/android-ndk-r6 )
 set( ANDROID_NDK_TOOLCHAIN_DEFAULT_SEARCH_PATH /opt/android-toolchain )
 set( TOOL_OS_SUFFIX "" )


Document clang params used for contract compilation

--- CMakeModules/wasm.cmake
+++ CMakeModules/wasm.cmake
@@ -28,18 +28,36 @@

 macro(add_wast_target target SOURCE_FILES INCLUDE_FOLDERS DESTINATION_FOLDER)

-  # add_definitions( -DDebug )
-  # get_directory_property( DirDefs DIRECTORY ${CMAKE_SOURCE_DIR} COMPILE_DEFINITIONS )
-
   set(outfiles "")
   foreach(srcfile ${SOURCE_FILES})

     get_filename_component(outfile ${srcfile} NAME)
     get_filename_component(infile ${srcfile} ABSOLUTE)

+    # -ffreestanding
+    #   Assert that compilation targets a freestanding environment.
+    #   This implies -fno-builtin. A freestanding environment is one in which the standard library may not exist, and program startup may not necessarily be at main.
+    #   The most obvious example is an OS kernel.
+
+    # -nostdlib
+    #   Do not use the standard system startup files or libraries when linking.
+    #   No startup files and only the libraries you specify are passed to the linker, and options specifying linkage of the system libraries, such as -static-libgcc or -shared-libgcc, are ignored.
+    #   The compiler may generate calls to memcmp, memset, memcpy and memmove.
+    #   These entries are usually resolved by entries in libc. These entry points should be supplied through some other mechanism when this option is specified.
+
+    # -fno-threadsafe-statics
+    #   Do not emit the extra code to use the routines specified in the C++ ABI for thread-safe initialization of local statics.
+    #   You can use this option to reduce code size slightly in code that doesn’t need to be thread-safe.
+
+    # -fno-rtti
+    #   Disable generation of information about every class with virtual functions for use by the C++ run-time type identification features (dynamic_cast and typeid).
+
+    # -fno-exceptions
+    #   Disable the generation of extra code needed to propagate exceptions
+
     add_custom_command(OUTPUT ${outfile}.bc
       DEPENDS ${infile}
-      COMMAND ${WASM_CLANG} -emit-llvm -O3 --std=c++14 --target=wasm32 -fno-builtin -ffreestanding -nostdlib -I ${INCLUDE_FOLDERS} -fno-threadsafe-statics -fno-rtti -fno-exceptions -c ${infile} -o ${outfile}.bc
+      COMMAND ${WASM_CLANG} -emit-llvm -O3 --std=c++14 --target=wasm32 -ffreestanding -nostdlib -fno-threadsafe-statics -fno-rtti -fno-exceptions -I ${INCLUDE_FOLDERS} -c ${infile} -o ${outfile}.bc
       IMPLICIT_DEPENDS CXX ${infile}
       COMMENT "Building LLVM bitcode ${outfile}.bc"
       WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}


ENH: Prefer https vs http for ctest submission.

--- CTestConfig.cmake
+++ CTestConfig.cmake
@@ -1,7 +1,7 @@
 set(CTEST_PROJECT_NAME "ITK")
 set(CTEST_NIGHTLY_START_TIME "1:00:00 UTC")

-set(CTEST_DROP_METHOD "http")
+set(CTEST_DROP_METHOD "https")
 set(CTEST_DROP_SITE "open.cdash.org")
 set(CTEST_DROP_LOCATION "/submit.php?project=Insight")
 set(CTEST_DROP_SITE_CDASH TRUE)


Reduced default warning number to accomodate bandwidth limitations on hosted CDash.

--- CTestCustom.cmake
+++ CTestCustom.cmake
@@ -5,4 +5,4 @@
 ##
 ## for more information.

-set(CTEST_CUSTOM_MAXIMUM_NUMBER_OF_WARNINGS "10000")+set(CTEST_CUSTOM_MAXIMUM_NUMBER_OF_WARNINGS "500")


Tweak CommonCTest

Tweak CommonCTest

--- CommonCTest.cmake
+++ CommonCTest.cmake
@@ -45,7 +45,7 @@
   list(APPEND ALL_TESTS ${NAME})
   add_executable(${NAME} ${FILE})
   set_target_properties(${NAME} PROPERTIES FOLDER "Tests")
-  target_link_libraries(${NAME} Lunchbox ${Boost_LIBRARIES})
+  target_link_libraries(${NAME} ${TEST_LIBRARIES})

   get_target_property(EXECUTABLE ${NAME} LOCATION)
   STRING(REGEX REPLACE "\\$\\(.*\\)" "\${CTEST_CONFIGURATION_TYPE}"


BUG: KWStyle is in Kitware github community

--- CMake/Superbuild/ExternalProjectsConfig.cmake
+++ CMake/Superbuild/ExternalProjectsConfig.cmake
@@ -48,7 +48,7 @@

 # KWStyle
 set( KWStyle_URL
-  ${git_protocol}://github.com/KitwareMedical/KWStyle.git )
+  ${git_protocol}://github.com/Kitware/KWStyle.git )
 set( KWStyle_HASH_OR_TAG f9e849c91e0613cbb16e102b7da805f4acd018cf )

 # LIBSVM


Disable variadic macro warning when compiling at full warning level. I was not able to get a macro version running and thus I opted for a cmake patch.

--- cmake/EigenTesting.cmake
+++ cmake/EigenTesting.cmake
@@ -233,7 +233,12 @@
     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++0x")
   endif(EIGEN_TEST_C++0x)
   if(EIGEN_TEST_MAX_WARNING_LEVEL)
-	set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wconversion")
+    CHECK_CXX_COMPILER_FLAG("-Wno-variadic-macros" FLAG_VARIADIC)
+    if(FLAG_VARIADIC)
+      set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wconversion -Wno-variadic-macros")
+    else(FLAG_VARIADIC)
+      set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wconversion")
+    endif(FLAG_VARIADIC)
   endif(EIGEN_TEST_MAX_WARNING_LEVEL)
   if(CMAKE_SYSTEM_NAME MATCHES Linux)
     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${COVERAGE_FLAGS} -g2")


Fix build with >=freetype-2.5.1 wrt #1007

--- cmake/FindFreetype.cmake
+++ cmake/FindFreetype.cmake
@@ -3,8 +3,12 @@
 ################################################################################
 include(FindPackageHandleStandardArgs)

-find_path(FREETYPE_H_PATH_ft2build NAMES ft2build.h)
+find_path(FREETYPE_H_PATH_ft2build NAMES ft2build.h PATH_SUFFIXES include/freetype2 include)
 find_path(FREETYPE_H_PATH_ftconfig NAMES freetype/config/ftconfig.h PATH_SUFFIXES freetype2)
+if (NOT FREETYPE_H_PATH_ftconfig)
+    find_path(FREETYPE_H_PATH_ftconfig NAMES config/ftconfig.h PATH_SUFFIXES include/freetype2 include)
+endif()
+
 find_library(FREETYPE_LIB NAMES freetype2 freetype libfreetype PATH_SUFFIXES dynamic)
 find_library(FREETYPE_LIB_DBG NAMES freetype_d libfreetype_d PATH_SUFFIXES dynamic)
 mark_as_advanced(FREETYPE_H_PATH_ft2build FREETYPE_H_PATH_ftconfig FREETYPE_LIB FREETYPE_LIB_DBG)


cmake: support OPENCV_ABI_SKIP_MODULES_LIST

--- cmake/OpenCVGenABI.cmake
+++ cmake/OpenCVGenABI.cmake
@@ -1,6 +1,8 @@
 if (NOT GENERATE_ABI_DESCRIPTOR)
   return()
 endif()
+
+set(OPENCV_ABI_SKIP_MODULES_LIST "" CACHE STRING "List of modules to exclude from ABI checker")

 set(filename "opencv_abi.xml")
 set(path1 "${CMAKE_BINARY_DIR}/${filename}")
@@ -26,6 +28,7 @@
   string(REGEX REPLACE "^opencv_" "" mod "${mod}")
   if(NOT OPENCV_MODULE_opencv_${mod}_CLASS STREQUAL "PUBLIC"
       OR NOT "${OPENCV_MODULE_opencv_${mod}_LOCATION}" STREQUAL "${OpenCV_SOURCE_DIR}/modules/${mod}" # opencv_contrib
+      OR ";${mod};" MATCHES ";${OPENCV_ABI_SKIP_MODULES_LIST};"
   )
     # headers
     foreach(h ${OPENCV_MODULE_opencv_${mod}_HEADERS})


make ADD_GUILE_TEST propagate GUILE_LOAD_PATH

--- cmake/OpenCogGuile.cmake
+++ cmake/OpenCogGuile.cmake
@@ -175,7 +175,9 @@
             COMMAND guile -L ${PROJECT_BINARY_DIR}/opencog/scm
                       --use-srfi=64 ${FILE_PATH}
             WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
-
+        IF (GUILE_LOAD_PATH)
+            SET_PROPERTY(TEST ${TEST_NAME} PROPERTY ENVIRONMENT "GUILE_LOAD_PATH=${GUILE_LOAD_PATH}")
+        ENDIF(GUILE_LOAD_PATH)
     ENDIF()
 ENDFUNCTION(ADD_GUILE_TEST)


enable SSE in debug mode

enable SSE in debug mode

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

--- cmake/pcl_find_sse.cmake
+++ cmake/pcl_find_sse.cmake
@@ -138,6 +138,7 @@
       endif ()

     endif()
+    set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} ${SSE_FLAGS}")
     set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} ${SSE_FLAGS}")
     set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${SSE_FLAGS}")


cmake FEATURE full-featured cmake find file

--- FindLibYANG.cmake
+++ FindLibYANG.cmake
@@ -3,10 +3,11 @@
 #
 #  LIBYANG_FOUND - system has LibYANG
 #  LIBYANG_INCLUDE_DIRS - the LibYANG include directory
-#  LIBYANG_LIBRARIES - Link these to use LibSSH
+#  LIBYANG_LIBRARIES - Link these to use LibYANG
+#  LIBYANG_VERSION - SO version of the found libyang library
 #
-#  Author Radek Krejci <rkrejci@cesnet.cz>
-#  Copyright (c) 2015 CESNET, z.s.p.o.
+#  Author Michal Vasko <mvasko@cesnet.cz>
+#  Copyright (c) 2021 CESNET, z.s.p.o.
 #
 #  Redistribution and use in source and binary forms, with or without
 #  modification, are permitted provided that the following conditions
@@ -17,7 +18,7 @@
 #  2. Redistributions in binary form must reproduce the copyright
 #     notice, this list of conditions and the following disclaimer in the
 #     documentation and/or other materials provided with the distribution.
-#  3. The name of the author may not be used to endorse or promote products
+#  3. The name of the author may not be used to endorse or promote products
 #     derived from this software without specific prior written permission.
 #
 #  THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
@@ -31,50 +32,58 @@
 #  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 #  THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #
+include(FindPackageHandleStandardArgs)

-if (LIBYANG_LIBRARIES AND LIBYANG_INCLUDE_DIRS)
-  # in cache already
-  set(LIBYANG_FOUND TRUE)
-else (LIBYANG_LIBRARIES AND LIBYANG_INCLUDE_DIRS)
+if(LIBYANG_LIBRARIES AND LIBYANG_INCLUDE_DIRS)
+    # in cache already
+    set(LIBYANG_FOUND TRUE)
+else()
+    find_path(LIBYANG_INCLUDE_DIR
+        NAMES
+        libyang/libyang.h
+        PATHS
+        /usr/include
+        /usr/local/include
+        /opt/local/include
+        /sw/include
+        ${CMAKE_INCLUDE_PATH}
+        ${CMAKE_INSTALL_PREFIX}/include
+    )

-  find_path(LIBYANG_INCLUDE_DIR
-    NAMES
-      libyang/libyang.h
-    PATHS
-      /usr/include
-      /usr/local/include
-      /opt/local/include
-      /sw/include
-      ${CMAKE_INCLUDE_PATH}
-      ${CMAKE_INSTALL_PREFIX}/include
-  )
-
-  find_library(LIBYANG_LIBRARY
-    NAMES
-      yang
-      libyang
-    PATHS
-      /usr/lib
-      /usr/lib64
-      /usr/local/lib
-      /usr/local/lib64
-      /opt/local/lib
-      /sw/lib
-      ${CMAKE_LIBRARY_PATH}
-      ${CMAKE_INSTALL_PREFIX}/lib
-  )
+    find_library(LIBYANG_LIBRARY
+        NAMES
+        yang
+        libyang
+        PATHS
+        /usr/lib
+        /usr/lib64
+        /usr/local/lib
+        /usr/local/lib64
+        /opt/local/lib
+        /sw/lib
+        ${CMAKE_LIBRARY_PATH}
+        ${CMAKE_INSTALL_PREFIX}/lib
+    )

-  if (LIBYANG_INCLUDE_DIR AND LIBYANG_LIBRARY)
-    set(LIBYANG_FOUND TRUE)
-  else (LIBYANG_INCLUDE_DIR AND LIBYANG_LIBRARY)
-    set(LIBYANG_FOUND FALSE)
-  endif (LIBYANG_INCLUDE_DIR AND LIBYANG_LIBRARY)
+    if(LIBYANG_INCLUDE_DIR)
+        find_path(LY_VERSION_PATH "libyang/version.h" HINTS ${LIBYANG_INCLUDE_DIR})
+        if(LY_VERSION_PATH)
+            file(READ "${LY_VERSION_PATH}/libyang/version.h" LY_VERSION_FILE)
+        else()
+            find_path(LY_HEADER_PATH "libyang/libyang.h" HINTS ${LIBYANG_INCLUDE_DIR})
+            file(READ "${LY_HEADER_PATH}/libyang/libyang.h" LY_VERSION_FILE)
+        endif()
+        string(REGEX MATCH "#define LY_VERSION \"[0-9]+\\.[0-9]+\\.[0-9]+\"" LY_VERSION_MACRO "${LY_VERSION_FILE}")
+        string(REGEX MATCH "[0-9]+\\.[0-9]+\\.[0-9]+" LIBYANG_VERSION "${LY_VERSION_MACRO}")
+    endif()

-  set(LIBYANG_INCLUDE_DIRS ${LIBYANG_INCLUDE_DIR})
-  set(LIBYANG_LIBRARIES ${LIBYANG_LIBRARY})
+    set(LIBYANG_INCLUDE_DIRS ${LIBYANG_INCLUDE_DIR})
+    set(LIBYANG_LIBRARIES ${LIBYANG_LIBRARY})
+    mark_as_advanced(LIBYANG_INCLUDE_DIRS LIBYANG_LIBRARIES)

-  # show the LIBYANG_INCLUDE_DIRS and LIBYANG_LIBRARIES variables only in the advanced view
-  mark_as_advanced(LIBYANG_INCLUDE_DIRS LIBYANG_LIBRARIES)
-
-endif (LIBYANG_LIBRARIES AND LIBYANG_INCLUDE_DIRS)
-
+    # handle the QUIETLY and REQUIRED arguments and set LIBYANG_FOUND to TRUE
+    # if all listed variables are TRUE
+    find_package_handle_standard_args(LibYANG FOUND_VAR LIBYANG_FOUND
+        REQUIRED_VARS LIBYANG_LIBRARY LIBYANG_INCLUDE_DIR
+        VERSION_VAR LIBYANG_VERSION)
+endif()


Correctly locate plugin binaries from Ogre 1.6 if pointed at it

--- CMake/Packages/FindOGRE.cmake
+++ CMake/Packages/FindOGRE.cmake
@@ -109,6 +109,7 @@
     set(OGRE_INC_SEARCH_PATH ${dir}/include ${OGRE_INC_SEARCH_PATH})
     set(OGRE_LIB_SEARCH_PATH ${dir}/lib ${OGRE_LIB_SEARCH_PATH})
     set(OGRE_BIN_SEARCH_PATH ${dir}/bin ${OGRE_BIN_SEARCH_PATH})
+	set(OGRE_BIN_SEARCH_PATH ${dir}/Samples/Common/bin ${OGRE_BIN_SEARCH_PATH})
   endforeach(dir)
 else()
   set(OGRE_PREFIX_SOURCE "NOTFOUND")
@@ -397,15 +398,17 @@
         set(OGRE_PLUGIN_SEARCH_PATH_REL
           ${OGRE_LIBRARY_DIR_REL}/..
           ${OGRE_LIBRARY_DIR_REL}/../..
+		  ${OGRE_BIN_SEARCH_PATH}
         )
         set(OGRE_PLUGIN_SEARCH_PATH_DBG
           ${OGRE_LIBRARY_DIR_DBG}/..
           ${OGRE_LIBRARY_DIR_DBG}/../..
+		  ${OGRE_BIN_SEARCH_PATH}
         )
         find_path(OGRE_PLUGIN_DIR_REL NAMES "${PLUGIN}.dll" HINTS ${OGRE_PLUGIN_SEARCH_PATH_REL}
-          PATH_SUFFIXES "" bin bin/release bin/relwithdebinfo bin/minsizerel)
+          PATH_SUFFIXES "" bin bin/release bin/relwithdebinfo bin/minsizerel release)
         find_path(OGRE_PLUGIN_DIR_DBG NAMES "${PLUGIN}_d.dll" HINTS ${OGRE_PLUGIN_SEARCH_PATH_DBG}
-          PATH_SUFFIXES "" bin bin/debug)
+          PATH_SUFFIXES "" bin bin/debug debug)
       elseif (UNIX)
         get_filename_component(OGRE_PLUGIN_DIR_TMP ${OGRE_${PLUGIN}_LIBRARY_REL} PATH)
         set(OGRE_PLUGIN_DIR_REL ${OGRE_PLUGIN_DIR_TMP} CACHE STRING "Ogre plugin dir (release)")


Enable update step of MITK-Data

Enable update step of MITK-Data

--- CMakeExternals/MITKData.cmake
+++ CMakeExternals/MITKData.cmake
@@ -21,7 +21,7 @@
     GIT_REPOSITORY https://phabricator.mitk.org/source/mitkdata.git
     GIT_TAG ${revision_tag}
 #   URL ${MITK_THIRDPARTY_DOWNLOAD_PREFIX_URL}/mitk-data_${revision_tag}.tar.gz
-    UPDATE_COMMAND ""
+#   UPDATE_COMMAND ""
     CONFIGURE_COMMAND ""
     BUILD_COMMAND ""
     INSTALL_COMMAND ""


COMP: correct value for mitk-data was lost during merge. Set correct again.

--- CMakeExternals/MITKData.cmake
+++ CMakeExternals/MITKData.cmake
@@ -13,7 +13,7 @@

 if(BUILD_TESTING)

-  set(revision_tag b6b96768)
+  set(revision_tag 0ae54d86)
 #                  ^^^^^^^^  these are just to check correct length of hash part

   ExternalProject_Add(${proj}


Bugfix for LCOV external flag.

Bugfix for LCOV external flag.

--- cmake/FindLcov.cmake
+++ cmake/FindLcov.cmake
@@ -50,8 +50,8 @@
 find_program(LCOV_BIN lcov)
 if (NOT LCOV_BIN STREQUAL "")
 	execute_process(COMMAND ${LCOV_BIN} --help OUTPUT_VARIABLE LCOV_HELP)
-	string(REGEX MATCH "external" LCOV_RES "${LCOV_ERRSTR}")
-	if (NOT "${LCOV_RES}" STREQUAL "")
+	string(REGEX MATCH "external" LCOV_RES "${LCOV_HELP}")
+	if ("${LCOV_RES}" STREQUAL "")
 		set(LCOV_EXTERN_FLAG "")
 	endif ()
 endif ()


removed message

removed message

--- cmake/FindOgre.cmake
+++ cmake/FindOgre.cmake
@@ -111,7 +111,6 @@
     determine_ogre_static(OGRE_CONFIG_STATIC ${OGRE_H_BUILD_SETTINGS_PATH}/OgreBuildSettings.h)
     determine_ogre_freeimage(OGRE_CONFIG_FREEIMAGE ${OGRE_H_BUILD_SETTINGS_PATH}/OgreBuildSettings.h)
     set(OGRE_STATIC ${OGRE_CONFIG_STATIC})
-    message(status " OGRE_CONFIG_FREEIMAGE : ${OGRE_CONFIG_FREEIMAGE}")
 endif ()

 if (OGRE_STATIC)
@@ -181,7 +180,7 @@
         endif()
     endif()

-    # look for required Ogre dependencies in case of static build
+    # look for required Ogre dependencies in case of static build
     if (OGRE_STATIC)
         set(OGRE_DEPS_FOUND TRUE)
         find_package(FreeImage QUIET)


[cmake] cache the output of lsb_release, as it might take very long

--- cmake/VcMacros.cmake
+++ cmake/VcMacros.cmake
@@ -87,18 +87,22 @@

          # some distributions patch their GCC to be API incompatible to what the FSF released. In
          # those cases we require a macro to identify the distribution version
-         find_program(_lsb_release lsb_release)
-         mark_as_advanced(_lsb_release)
-         if(_lsb_release)
-            execute_process(COMMAND ${_lsb_release} -is OUTPUT_VARIABLE _distributor_id OUTPUT_STRIP_TRAILING_WHITESPACE)
-            execute_process(COMMAND ${_lsb_release} -rs OUTPUT_VARIABLE _distributor_release OUTPUT_STRIP_TRAILING_WHITESPACE)
-            string(TOUPPER "${_distributor_id}" _distributor_id)
-            if(_distributor_id STREQUAL "UBUNTU")
+         find_program(Vc_lsb_release lsb_release)
+         mark_as_advanced(Vc_lsb_release)
+         if(Vc_lsb_release)
+            if(NOT Vc_distributor_id)
+              execute_process(COMMAND ${Vc_lsb_release} -is OUTPUT_VARIABLE Vc_distributor_id OUTPUT_STRIP_TRAILING_WHITESPACE)
+              string(TOUPPER "${Vc_distributor_id}" Vc_distributor_id)
+              set(Vc_distributor_id "${Vc_distributor_id}" CACHE STRING "lsb distribution id")
+              execute_process(COMMAND ${Vc_lsb_release} -rs OUTPUT_VARIABLE Vc_distributor_release OUTPUT_STRIP_TRAILING_WHITESPACE)
+              set(Vc_distributor_release "${Vc_distributor_release}" CACHE STRING "lsb release id")
+            endif()
+            if(Vc_distributor_id STREQUAL "UBUNTU")
                execute_process(COMMAND ${CMAKE_CXX_COMPILER} --version OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE _gcc_version)
                string(REGEX MATCH "\\(.* ${Vc_GCC_VERSION}-([0-9]+).*\\)" _tmp "${_gcc_version}")
                if(_tmp)
                   set(_patch ${CMAKE_MATCH_1})
-                  string(REGEX MATCH "^([0-9]+)\\.([0-9]+)$" _tmp "${_distributor_release}")
+                  string(REGEX MATCH "^([0-9]+)\\.([0-9]+)$" _tmp "${Vc_distributor_release}")
                   execute_process(COMMAND printf 0x%x%02x%02x ${CMAKE_MATCH_1} ${CMAKE_MATCH_2} ${_patch} OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE _tmp)
                   set(Vc_DEFINITIONS "${Vc_DEFINITIONS} -D__GNUC_UBUNTU_VERSION__=${_tmp}")
                endif()


fptu: remove '/INCREMENTAL' for LTO (fix warning).

--- cmake/compiler.cmake
+++ cmake/compiler.cmake
@@ -379,17 +379,34 @@

   if(MSVC AND MSVC_LTO_ENABLED)
     add_compile_flags("C;CXX" "/GL")
-    set(EXE_LINKER_FLAGS "${EXE_LINKER_FLAGS} /LTCG")
-    set(SHARED_LINKER_FLAGS "${SHARED_LINKER_FLAGS} /LTCG")
-    set(STATIC_LINKER_FLAGS "${STATIC_LINKER_FLAGS} /LTCG")
-    set(MODULE_LINKER_FLAGS "${MODULE_LINKER_FLAGS} /LTCG")
+    foreach(linkmode IN ITEMS EXE SHARED STATIC MODULE)
+      set(${linkmode}_LINKER_FLAGS "${${linkmode}_LINKER_FLAGS} /LTCG")
+      string(REGEX REPLACE "^(.*)(/INCREMENTAL:NO *)(.*)$" "\\1\\3" ${linkmode}_LINKER_FLAGS "${${linkmode}_LINKER_FLAGS}")
+      string(REGEX REPLACE "^(.*)(/INCREMENTAL:YES *)(.*)$" "\\1\\3" ${linkmode}_LINKER_FLAGS "${${linkmode}_LINKER_FLAGS}")
+      string(REGEX REPLACE "^(.*)(/INCREMENTAL *)(.*)$" "\\1\\3" ${linkmode}_LINKER_FLAGS "${${linkmode}_LINKER_FLAGS}")
+      string(STRIP "${${linkmode}_LINKER_FLAGS}" ${linkmode}_LINKER_FLAGS)
+      foreach(config IN LISTS CMAKE_CONFIGURATION_TYPES ITEMS Release MinSizeRel RelWithDebInfo Debug)
+        string(TOUPPER "${config}" config_uppercase)
+        if(DEFINED "CMAKE_${linkmode}_LINKER_FLAGS_${config_uppercase}")
+          string(REGEX REPLACE "^(.*)(/INCREMENTAL:NO *)(.*)$" "\\1\\3" altered_flags "${CMAKE_${linkmode}_LINKER_FLAGS_${config_uppercase}}")
+          string(REGEX REPLACE "^(.*)(/INCREMENTAL:YES *)(.*)$" "\\1\\3" altered_flags "${altered_flags}")
+          string(REGEX REPLACE "^(.*)(/INCREMENTAL *)(.*)$" "\\1\\3" altered_flags "${altered_flags}")
+          string(STRIP "${altered_flags}" altered_flags)
+          if(NOT "${altered_flags}" STREQUAL "${CMAKE_${linkmode}_LINKER_FLAGS_${config_uppercase}}")
+            set(CMAKE_${linkmode}_LINKER_FLAGS_${config_uppercase} "${altered_flags}" CACHE STRING "Altered: '/INCREMENTAL' removed for LTO" FORCE)
+          endif()
+        endif()
+      endforeach(config)
+    endforeach(linkmode)
+    unset(linkmode)
+
     foreach(config IN LISTS CMAKE_CONFIGURATION_TYPES ITEMS Release MinSizeRel RelWithDebInfo)
       foreach(lang IN ITEMS C CXX)
         string(TOUPPER "${config}" config_uppercase)
         if(DEFINED "CMAKE_${lang}_FLAGS_${config_uppercase}")
           string(REPLACE "/O2" "/Ox" altered_flags "${CMAKE_${lang}_FLAGS_${config_uppercase}}")
           if(NOT "${altered_flags}" STREQUAL "${CMAKE_${lang}_FLAGS_${config_uppercase}}")
-            set("CMAKE_${lang}_FLAGS_${config_uppercase}" "${altered_flags}" CACHE STRING "Altered for LTO" FORCE)
+            set(CMAKE_${lang}_FLAGS_${config_uppercase} "${altered_flags}" CACHE STRING "Altered: '/O2' replaced by '/Ox' for LTO" FORCE)
           endif()
         endif()
       endforeach(lang)


Updating build rules towards packaging.

Updating build rules towards packaging.

--- cmake/dtkBuild.cmake
+++ cmake/dtkBuild.cmake
@@ -4,9 +4,9 @@
 ## Copyright (C) 2008 - Julien Wintz, Inria.
 ## Created: Fri Apr  2 09:05:55 2010 (+0200)
 ## Version: $Id$
-## Last-Updated: Fri Apr  2 11:09:52 2010 (+0200)
+## Last-Updated: Fri Apr  2 14:13:38 2010 (+0200)
 ##           By: Julien Wintz
-##     Update #: 27
+##     Update #: 28
 ######################################################################
 ##
 ### Commentary:
@@ -44,23 +44,21 @@
 export_library_dependencies(
   ${${PROJECT_NAME}_BINARY_DIR}/${PROJECT_NAME}LibraryDepends.cmake)

-if(NOT ${PROJECT_NAME}_INSTALL_NO_DEVELOPMENT)
-  install(FILES
-    ${${PROJECT_NAME}_SOURCE_DIR}/cmake/${PROJECT_NAME}Build.cmake
-    ${${PROJECT_NAME}_SOURCE_DIR}/cmake/${PROJECT_NAME}Dart.cmake
-    ${${PROJECT_NAME}_SOURCE_DIR}/cmake/${PROJECT_NAME}Dependencies.cmake
-    ${${PROJECT_NAME}_SOURCE_DIR}/cmake/${PROJECT_NAME}Install.cmake
-    ${${PROJECT_NAME}_SOURCE_DIR}/cmake/${PROJECT_NAME}Nightly.cmake
-    ${${PROJECT_NAME}_SOURCE_DIR}/cmake/${PROJECT_NAME}Pack.cmake
-    ${${PROJECT_NAME}_SOURCE_DIR}/cmake/${PROJECT_NAME}Paths.cmake
-    ${${PROJECT_NAME}_BINARY_DIR}/${PROJECT_NAME}Use.cmake
-    ${${PROJECT_NAME}_BINARY_DIR}/${PROJECT_NAME}Config.cmake
-    ${${PROJECT_NAME}_BINARY_DIR}/${PROJECT_NAME}Uninstall.cmake
-    ${${PROJECT_NAME}_BINARY_DIR}/${PROJECT_NAME}LibraryDepends.cmake
-    ${${PROJECT_NAME}_BINARY_DIR}/${PROJECT_NAME}BuildSettings.cmake
-    DESTINATION
-    ${CMAKE_INSTALL_PREFIX}/cmake)
-endif(NOT ${PROJECT_NAME}_INSTALL_NO_DEVELOPMENT)
+install(FILES
+  ${${PROJECT_NAME}_SOURCE_DIR}/cmake/${PROJECT_NAME}Build.cmake
+  ${${PROJECT_NAME}_SOURCE_DIR}/cmake/${PROJECT_NAME}Dart.cmake
+  ${${PROJECT_NAME}_SOURCE_DIR}/cmake/${PROJECT_NAME}Dependencies.cmake
+  ${${PROJECT_NAME}_SOURCE_DIR}/cmake/${PROJECT_NAME}Install.cmake
+  ${${PROJECT_NAME}_SOURCE_DIR}/cmake/${PROJECT_NAME}Nightly.cmake
+  ${${PROJECT_NAME}_SOURCE_DIR}/cmake/${PROJECT_NAME}Pack.cmake
+  ${${PROJECT_NAME}_SOURCE_DIR}/cmake/${PROJECT_NAME}Paths.cmake
+  ${${PROJECT_NAME}_BINARY_DIR}/${PROJECT_NAME}Use.cmake
+  ${${PROJECT_NAME}_BINARY_DIR}/${PROJECT_NAME}Config.cmake
+  ${${PROJECT_NAME}_BINARY_DIR}/${PROJECT_NAME}Uninstall.cmake
+  ${${PROJECT_NAME}_BINARY_DIR}/${PROJECT_NAME}LibraryDepends.cmake
+  ${${PROJECT_NAME}_BINARY_DIR}/${PROJECT_NAME}BuildSettings.cmake
+  DESTINATION
+  ${CMAKE_INSTALL_PREFIX}/cmake)

 ## Settings specific to the build tree.


restoring macosx-version-min to 10.7

restoring macosx-version-min to 10.7

--- common/cmake/clang.cmake
+++ common/cmake/clang.cmake
@@ -124,13 +124,7 @@
   SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -O3")             # enable full optimizations

   IF (APPLE)
-    IF (MACOS)
-      IF (EMBREE_TASKING_SYSTEM STREQUAL "TBB")
-        SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mmacosx-version-min=10.14")   # makes sure code runs on older MacOSX versions
-      ELSE()
-        SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mmacosx-version-min=10.12")   # makes sure code runs on older MacOSX versions
-      ENDIF()
-    ENDIF()
+    SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mmacosx-version-min=10.7")   # makes sure code runs on older MacOSX versions
     SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")             # link against libc++ which supports C++11 features
   ELSE(APPLE)
     IF (NOT EMBREE_ADDRESS_SANITIZER) # for address sanitizer this causes link errors


Added Unspecified component to CPack to fix Windows installers.

--- cmake/BALLComponents.cmake
+++ cmake/BALLComponents.cmake
@@ -112,6 +112,7 @@
  ${COMPONENT_DOCUMENTATION_PDF}
  ${COMPONENT_PLUGINS}
  ${COMPONENT_BALLVIEW}
+ "Unspecified"
 )

 IF (BALL_BUILD_QUEASY)


[cmake] python is always funnier than what you tought

--- cmake/FindPythonFull.cmake
+++ cmake/FindPythonFull.cmake
@@ -58,7 +58,11 @@
     # --- Search python library corresponding to python exec.
     find_library(PYTHON_LIBRARY
       NAMES
-      python${PYTHON_VERSION_NO_DOTS} python${PYTHON_VERSION}
+      python${PYTHON_VERSION_NO_DOTS}
+      python${PYTHON_VERSION}mu
+      python${PYTHON_VERSION}m
+      python${PYTHON_VERSION}u
+      python${PYTHON_VERSION}
       NO_DEFAULT_PATH
       HINTS ${PYTHON_PREFIX} ${PYTHON_PREFIX}/lib/python${PYTHON_VERSION}/config ${PYTHON_PREFIX}/lib/python${PYTHON_VERSION}/config-${CMAKE_LIBRARY_ARCHITECTURE}
       PATH_SUFFIXES lib libs


[build] Turned off -Werror temporarily for issues with performance-bot (#4946)

--- cmake/TaichiCXXFlags.cmake
+++ cmake/TaichiCXXFlags.cmake
@@ -51,7 +51,7 @@
     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall ")

     # [Global] CXX compilation option to treat all warnings as errors.
-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror ")
+    #set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror ")

     # [Global] By default, CXX compiler will throw a warning if it decides to ignore an attribute, for example "[[ maybe unused ]]".
     # However, this behaviour diverges across different compilers (GCC/CLANG), as well as different compiler versions.


this appears to be crufty

this appears to be crufty

--- cmake/catkin_project.cmake
+++ cmake/catkin_project.cmake
@@ -26,7 +26,7 @@
   set(PACKAGE_LIBRARIES ${PACKAGE_LIBRARIES})
   set(PACKAGE_CFG_EXTRAS ${PACKAGE_CFG_EXTRAS})
   set(PACKAGE_CMAKE_CONFIG_FILES_DIR ${CMAKE_INSTALL_PREFIX}/share/${PACKAGE_NAME}/cmake)
-  set(PACKAGE_MSG_DIRS ${PACKAGE_MSG_DIRS})
+  # set(PACKAGE_MSG_DIRS ${PACKAGE_MSG_DIRS})

   #
   # Versions find_packageable from the buildspace
@@ -39,7 +39,7 @@
   # in source
   set(PKG_INCLUDE_PREFIX ${CMAKE_CURRENT_SOURCE_DIR})
   set(PKG_LIB_PREFIX ${CMAKE_CURRENT_BINARY_DIR})
-  set(PKG_MSG_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/msg)
+  # set(PKG_MSG_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/msg)
   set(PKG_CMAKE_DIR ${_cfgdir})
   set(PKG_CMAKE_SRC_DIR ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
   set(PKG_BIN_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/scripts
@@ -93,7 +93,7 @@
   # installable
   set(PKG_INCLUDE_PREFIX ${CMAKE_INSTALL_PREFIX})
   set(PKG_LIB_PREFIX ${CMAKE_INSTALL_PREFIX})
-  set(PKG_MSG_DIRS ${CMAKE_INSTALL_PREFIX}/share/${PACKAGE_NAME}/msg)
+  # set(PKG_MSG_DIRS ${CMAKE_INSTALL_PREFIX}/share/${PACKAGE_NAME}/msg)
   set(PKG_CMAKE_DIR ${CMAKE_INSTALL_PREFIX}/share/${PACKAGE_NAME}/cmake)
   set(PKG_CMAKE_SRC_DIR ${PKG_CMAKE_DIR})
   set(PKG_BIN_DIRS ${CMAKE_INSTALL_PREFIX}/bin)


CMake: typo

CMake: typo


fix(cmake/modules): update driver to support kernels 5.6.y

Co-authored-by: Lorenzo Fontana <638e8f0171575864326f06d2a5f8e72287427b15@linux.com>
Signed-off-by: Leonardo Di Donato <2012e0ca99d70aa6c893822ff73002216e5dba72@gmail.com>

--- cmake/modules/sysdig.cmake
+++ cmake/modules/sysdig.cmake
@@ -26,8 +26,8 @@
 # To update sysdig version for the next release, change the default below
 # In case you want to test against another sysdig version just pass the variable - ie., `cmake -DSYSDIG_VERSION=dev ..`
 if(NOT SYSDIG_VERSION)
-  set(SYSDIG_VERSION "a259b4bf49c3330d9ad6c3eed9eb1a31954259a6")
-  set(SYSDIG_CHECKSUM "SHA256=fdbeb8d182e6383fe89428e0934d521636068f62109c1b3ca11689d886458284")
+  set(SYSDIG_VERSION "47374b2b73734d509f3c99890c80be5242021c3d")
+  set(SYSDIG_CHECKSUM "SHA256=df73b5c69eca8880e30c618dc47b995140286b47fa845c97a3d7a6ddb2d6f1b1")
 endif()
 set(PROBE_VERSION "${SYSDIG_VERSION}")


Define namespace prefixed aliases for targets in the CMake build

This allows projects that depend on ruy to use namespace qualified
target names regardless of whether they consume ruy through
add_subdirectory or find_package.

Closes https://github.com/google/ruy/pull/311

COPYBARA_INTEGRATE_REVIEW=https://github.com/google/ruy/pull/311 from petrhosek:cmake-alias c00fae2a56a567b216dea0b0fe7378c28ddadbbf
PiperOrigin-RevId: 451184466

--- cmake/ruy_cc_library.cmake
+++ cmake/ruy_cc_library.cmake
@@ -83,6 +83,8 @@
     )
   endif()

+  add_library(${PROJECT_NAME}::${_NAME} ALIAS ${_NAME})
+
   if(NOT _RULE_TESTONLY)
     install(
       TARGETS ${_NAME}


fix findTBB for oneTBB and search for tbb12.dll on windows

--- common/cmake/FindTBB.cmake
+++ common/cmake/FindTBB.cmake
@@ -315,16 +315,29 @@

     # On window, also search the DLL so that the client may install it.
     set(DLL_NAME "${LIB_NAME}.dll")
-    find_path(${BIN_DIR_VAR}
-      NAMES "${DLL_NAME}"
+
+    # lib name with version suffix to handle oneTBB tbb12.dll
+    set(LIB_NAME_VERSION "")
+    if (${COMPONENT_NAME} STREQUAL "tbb")
+      if (BUILD_CONFIG STREQUAL "DEBUG")
+        set(LIB_NAME_VERSION "tbb12_debug")
+      else()
+        set(LIB_NAME_VERSION "tbb12")
+      endif()
+    endif()
+    set(DLL_NAME_VERSION "${LIB_NAME_VERSION}.dll")
+
+    find_file(BIN_FILE
+      NAMES ${DLL_NAME} ${DLL_NAME_VERSION}
       PATHS
-        ${TBB_ROOT}/bin/${TBB_ARCH}/${TBB_VCVER}
-        ${TBB_ROOT}/bin
-        ${TBB_ROOT}/../redist/${TBB_ARCH}/tbb/${TBB_VCVER}
-        ${TBB_ROOT}/../redist/${TBB_ARCH}_win/tbb/${TBB_VCVER}
-      NO_DEFAULT_PATH
-    )
-    set(${DLL_VAR} "${${BIN_DIR_VAR}}/${DLL_NAME}" CACHE PATH "${COMPONENT_NAME} ${BUILD_CONFIG} dll path")
+        "${TBB_ROOT}/bin/${TBB_ARCH}/${TBB_VCVER}"
+        "${TBB_ROOT}/bin"
+        "${TBB_ROOT}/redist/${TBB_ARCH}/${TBB_VCVER}"
+        "${TBB_ROOT}/../redist/${TBB_ARCH}/tbb/${TBB_VCVER}"
+        "${TBB_ROOT}/../redist/${TBB_ARCH}_win/tbb/${TBB_VCVER}"
+      NO_DEFAULT_PATH)
+    get_filename_component(${BIN_DIR_VAR} ${BIN_FILE} DIRECTORY)
+    set(${DLL_VAR} "${BIN_FILE}" CACHE PATH "${COMPONENT_NAME} ${BUILD_CONFIG} dll path")
   elseif(APPLE)
     set(LIB_PATHS ${TBB_ROOT}/lib)
   else()


Attempted fixes for linking Python on OS X

--- FindPythonLibsNew.cmake
+++ FindPythonLibsNew.cmake
@@ -102,7 +102,8 @@
 list(GET _PYTHON_VALUES 6 PYTHON_SIZEOF_VOID_P)

 # Make sure the Python has the same pointer-size as the chosen compiler
-if(NOT ${PYTHON_SIZEOF_VOID_P} MATCHES ${CMAKE_SIZEOF_VOID_P})
+# Skip the check on OS X, it doesn't have CMAKE_SIZEOF_VOID_P defined
+if((NOT APPLE) AND (NOT "${PYTHON_SIZEOF_VOID_P}" STREQUAL "${CMAKE_SIZEOF_VOID_P}"))
     if(PythonLibsNew_FIND_REQUIRED)
         math(EXPR _PYTHON_BITS "${PYTHON_SIZEOF_VOID_P} * 8")
         math(EXPR _CMAKE_BITS "${CMAKE_SIZEOF_VOID_P} * 8")
@@ -198,7 +199,14 @@

     SET_PROPERTY(GLOBAL  APPEND  PROPERTY  PY_MODULES_LIST ${_NAME})
     ADD_LIBRARY(${_NAME} ${PY_MODULE_TYPE} ${ARGN})
-    TARGET_LINK_LIBRARIES(${_NAME} ${PYTHON_LIBRARIES})
+    IF(APPLE)
+      # On OS X, linking against the Python libraries causes
+      # segfaults, so do this dynamic lookup instead.
+      SET_TARGET_PROPERTIES(${_NAME} PROPERTIES LINK_FLAGS
+                          "-undefined dynamic_lookup")
+    ELSE()
+      TARGET_LINK_LIBRARIES(${_NAME} ${PYTHON_LIBRARIES})
+    ENDIF()

     IF(PYTHON_MODULE_${_NAME}_BUILD_SHARED)
       SET_TARGET_PROPERTIES(${_NAME} PROPERTIES PREFIX "${PYTHON_MODULE_PREFIX}")


CMake sync

CMake sync

--- adm_local_without_kernel/cmake_files/FindSalomePython.cmake
+++ adm_local_without_kernel/cmake_files/FindSalomePython.cmake
@@ -146,8 +146,13 @@
       ENDIF()
   ENDIF()

-  # 6. Specifics
-  #
+  ##
+  ## 6. Save the final detected installation
+  ##
+  SET(PYTHON_ROOT_DIR "${_tmp_ROOT_DIR}")
+
+  ## 7. Specifics
+  ##

   # NumPy detection
   EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c "import numpy ; import sys ; sys.stdout.write(numpy.get_include())" OUTPUT_VARIABLE NUMPY_INCLUDE_DIR ERROR_QUIET )


fix gtest build with msvc and ninja

fix gtest build with msvc and ninja

build with ninja only works properly with the very last cmake version.
A warning is displayed when ninja is used with a too old cmake version

--- src/gtest.cmake
+++ src/gtest.cmake
@@ -9,33 +9,57 @@
     find_package( GTest )
   endif()
 else()
-#  find_package(Threads REQUIRED)
+  if(CMAKE_VERSION VERSION_LESS 3.2 AND CMAKE_GENERATOR MATCHES "Ninja")
+    message(WARNING "Building GTest with Ninja has known issues with CMake older than 3.2")
+  endif()
+
   include(ExternalProject)
+
+  set(GTEST_LIBRARIES gtest gtest_main)
+  # the binary dir must be know before creating the external project in order
+  # to pass the byproducts
+  set(prefix "${CMAKE_CURRENT_BINARY_DIR}/gtest-external-prefix")
+  set(binary_dir "${prefix}/src/gtest-external-build")
+
+  set(byproducts)
+  foreach(lib ${GTEST_LIBRARIES})
+    set(${lib}_location
+      ${binary_dir}/${CMAKE_CFG_INTDIR}/${CMAKE_STATIC_LIBRARY_PREFIX}${lib}${CMAKE_STATIC_LIBRARY_SUFFIX})
+    list(APPEND byproducts ${${lib}_location})
+  endforeach()

   ExternalProject_Add(
     gtest-external
     URL http://googletest.googlecode.com/files/gtest-1.7.0.zip
     URL_MD5 2d6ec8ccdf5c46b05ba54a9fd1d130d7
+    PREFIX ${prefix}
+    BINARY_DIR ${binary_dir}
+    CMAKE_CACHE_ARGS
+      -DCMAKE_CXX_COMPILER:FILEPATH=${CMAKE_CXX_COMPILER}
+      -DCMAKE_CXX_FLAGS:STRING=${CMAKE_CXX_FLAGS}
+      -DCMAKE_CXX_FLAGS_DEBUG:STRING=${CMAKE_CXX_FLAGS_DEBUG}
+      -DCMAKE_CXX_FLAGS_MINSIZEREL:STRING=${CMAKE_CXX_FLAGS_MINSIZEREL}
+      -DCMAKE_CXX_FLAGS_RELEASE:STRING=${CMAKE_CXX_FLAGS_RELEASE}
+      -DCMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING=${CMAKE_CXX_FLAGS_RELWITHDEBINFO}
+      -DCMAKE_C_COMPILER:FILEPATH=${CMAKE_C_COMPILER}
+      -DCMAKE_C_FLAGS:STRING=${CMAKE_C_FLAGS}
+      -DCMAKE_C_FLAGS_DEBUG:STRING=${CMAKE_C_FLAGS_DEBUG}
+      -DCMAKE_C_FLAGS_MINSIZEREL:STRING=${CMAKE_C_FLAGS_MINSIZEREL}
+      -DCMAKE_C_FLAGS_RELEASE:STRING=${CMAKE_C_FLAGS_RELEASE}
+      -DCMAKE_C_FLAGS_RELWITHDEBINFO:STRING=${CMAKE_C_FLAGS_RELWITHDEBINFO}
+      -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
+      -Dgtest_force_shared_crt:BOOL=ON
+    BUILD_BYPRODUCTS ${byproducts}
     INSTALL_COMMAND "")
-
-  ExternalProject_Get_Property(gtest-external binary_dir)
-  add_library(gtest IMPORTED STATIC GLOBAL)
-  set_target_properties(gtest PROPERTIES
-      IMPORTED_LOCATION ${binary_dir}/${CMAKE_STATIC_LIBRARY_PREFIX}gtest${CMAKE_STATIC_LIBRARY_SUFFIX}
-      # IMPORTED_LINK_INTERFACE_LIBRARIES ${CMAKE_THREAD_LIBS_INIT}
-      )
-  add_dependencies(gtest gtest-external)

-  add_library(gtest_main IMPORTED STATIC GLOBAL)
-  set_target_properties(gtest_main PROPERTIES
-      IMPORTED_LOCATION ${binary_dir}/${CMAKE_STATIC_LIBRARY_PREFIX}gtest_main${CMAKE_STATIC_LIBRARY_SUFFIX}
-      # IMPORTED_LINK_INTERFACE_LIBRARIES ${CMAKE_THREAD_LIBS_INIT}
-      )
-  add_dependencies(gtest_main gtest-external)
+  foreach(lib ${GTEST_LIBRARIES})
+    add_library(${lib} IMPORTED STATIC)
+    add_dependencies(${lib} gtest-external)
+    set_target_properties(${lib} PROPERTIES IMPORTED_LOCATION ${${lib}_location})
+  endforeach()

   ExternalProject_Get_Property(gtest-external source_dir)
   set(GTEST_INCLUDE_DIRS ${source_dir}/include)
-  set(GTEST_LIBRARIES gtest gtest_main)
   set(GTEST_FOUND ON)
 endif()


Only use dynamic lookup on macOS

Only use dynamic lookup on macOS

--- src/pythonlib/pythonlib.cmake
+++ src/pythonlib/pythonlib.cmake
@@ -51,12 +51,14 @@
   if (USE_PY_3)
     find_package(Python3 COMPONENTS Interpreter Development)
     set(PYTHON_INCLUDE_DIRS ${Python3_INCLUDE_DIRS})
+    set(PYTHON_LIBRARIES ${Python3_LIBRARIES})
     cmake_path(SET PYTHON_SITE_PACKAGES "${Python3_SITELIB}")
     cmake_path(SET PYTHON_ARCH_PACKAGES "${Python3_SITEARCH}")
     find_package(Boost COMPONENTS python${Python3_VERSION_MAJOR}${Python3_VERSION_MINOR})
   else()
     find_package(Python2 COMPONENTS Interpreter Development)
     set(PYTHON_INCLUDE_DIRS ${Python2_INCLUDE_DIRS})
+    set(PYTHON_LIBRARIES ${Python2_LIBRARIES})
     cmake_path(SET PYTHON_SITE_PACKAGES "${Python2_SITELIB}")
     cmake_path(SET PYTHON_ARCH_PACKAGES "${Python2_SITEARCH}")
     find_package(Boost COMPONENTS python${Python2_VERSION_MAJOR}${Python2_VERSION_MINOR})
@@ -68,6 +70,7 @@
 message(STATUS "Boost_LIBRARY_DIRS = ${Boost_LIBRARY_DIRS}")
 message(STATUS "Boost_LIBRARIES = ${Boost_LIBRARIES}")
 message(STATUS "PYTHON_INCLUDE_DIRS = ${PYTHON_INCLUDE_DIRS}")
+message(STATUS "PYTHON_LIBRARIES = ${PYTHON_LIBRARIES}")
 message(STATUS "PYTHON_SITE_PACKAGES = ${PYTHON_SITE_PACKAGES}")
 message(STATUS "PYTHON_ARCH_PACKAGES = ${PYTHON_ARCH_PACKAGES}")

@@ -95,8 +98,10 @@

 message(STATUS "linking Python binary ocl.so with Boost: " ${Boost_PYTHON_LIBRARY} " and OpenMP: " ${OpenMP_CXX_LIBRARIES})

-# to avoid the need to link with libpython, we should use dynamic lookup
-SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -undefined dynamic_lookup")
+if(APPLE)
+  # to avoid the need to link with libpython, we should use dynamic lookup
+  SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -undefined dynamic_lookup")
+endif()

 target_link_libraries(
   ocl
@@ -108,6 +113,10 @@
   ${Boost_LIBRARIES}
   ${OpenMP_CXX_LIBRARIES}
 )
+
+if(NOT APPLE)
+  target_link_libraries(ocl ${PYTHON_LIBRARIES})
+endif()

 # this makes the lib name ocl.so and not libocl.so
 set_target_properties(ocl PROPERTIES PREFIX "")


The new OSX 11 (Big Sur) is not compatible with wxWidgets 3.1.3. Let's use patched wxWidgets 3.1.4, even though it is not quite tested. Use the tested patched wxWidgets 3.1.3 everywhere else.

--- deps/wxWidgets/wxWidgets.cmake
+++ deps/wxWidgets/wxWidgets.cmake
@@ -1,4 +1,11 @@
-set(_wx_git_tag v3.1.3-patched)
+if (APPLE AND ${CMAKE_SYSTEM_PROCESSOR} MATCHES "arm")
+    # The new OSX 11 (Big Sur) is not compatible with wxWidgets 3.1.3.
+    # Let's use patched wxWidgets 3.1.4, even though it is not quite tested.
+    set(_wx_git_tag v3.1.4-patched)
+else ()
+    # Use the tested patched wxWidgets 3.1.3 everywhere else.
+    set(_wx_git_tag v3.1.3-patched)
+endif ()

 # set(_patch_command "")
 set(_wx_toolkit "")


board: qemu_arc: fix cpu frequency to 10Mhz

we have set SYS_CLOCK_HW_CYCLES_PER_SEC to 10000000,
so we need to set cpu.freq_hz=10000000 too.

Signed-off-by: Watson Zeng <bb6a45ebfbb8932a11537002b062f5218879c562@synopsys.com>

--- boards/arc/qemu_arc/board.cmake
+++ boards/arc/qemu_arc/board.cmake
@@ -20,7 +20,7 @@
   -global cpu.num-irqlevels=15
   -global cpu.num-irq=25
   -global cpu.ext-irq=20
-  -global cpu.freq_hz=1000000
+  -global cpu.freq_hz=10000000
   -global cpu.timer0=true
   -global cpu.timer1=true
   -global cpu.has-mpu=true


Fixed CMake variable name (initial_force_build)

--- CMake/MITKDashboardDriverScript.cmake
+++ CMake/MITKDashboardDriverScript.cmake
@@ -57,7 +57,7 @@
   set(model Experimental)
 elseif (SCRIPT_MODE STREQUAL "continuous")
   set(empty_binary_directory FALSE)
-  set(inital_force_build FALSE)
+  set(initial_force_build FALSE)
   set(model Continuous)
 elseif (SCRIPT_MODE STREQUAL "nightly")
   set(empty_binary_directory TRUE)
@@ -161,7 +161,7 @@
     math(EXPR build_errors "${build_errors} + 1")
   endif()

-  set(force_build ${inital_force_build})
+  set(force_build ${initial_force_build})
   if(COMMAND MITK_OVERRIDE_FORCE_BUILD)
     MITK_OVERRIDE_FORCE_BUILD(force_build)
   endif()


Fix Common.cmake

Fix Common.cmake

--- Common.cmake
+++ Common.cmake
@@ -65,7 +65,7 @@
   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Winvalid-pch -Wnon-virtual-dtor -Wsign-promo -Wshadow -Winit-self -Wno-unknown-pragmas -Wno-unused-parameter -Wno-write-strings")
   set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -Wuninitialized")
   set(CMAKE_CXX_FLAGS_DEBUG
-    "${CMAKE_CXX_FLAGS_DEBUG} -fprofile-arcs -ftest-coverage"
+    "${CMAKE_CXX_FLAGS_DEBUG} -fprofile-arcs -ftest-coverage")
   if(NOT WIN32 AND NOT XCODE_VERSION AND NOT RELEASE_VERSION)
     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror")
   endif()


with ternary instructions it is fine if the source registers are swapped

--- tests/abi.cmake
+++ tests/abi.cmake
@@ -7,13 +7,13 @@
    OUTPUT_VARIABLE asm)
 string(STRIP "${asm}" asm)
 if("${IMPL}" STREQUAL SSE)
-   set(reference "^(addps %xmm1,%xmm0 retq|vaddps %xmm1,%xmm0,%xmm0 retq)$")
+   set(reference "^(addps %xmm1,%xmm0 retq|vaddps %xmm(0,%xmm1|1,%xmm0),%xmm0 retq)$")
 elseif("${IMPL}" STREQUAL AVX)
-   set(reference "^vaddps %ymm1,%ymm0,%ymm0 retq$")
+   set(reference "^vaddps %ymm(0,%ymm1|1,%ymm0),%ymm0 retq$")
 elseif("${IMPL}" STREQUAL AVX2)
-   set(reference "^vaddps %ymm1,%ymm0,%ymm0 retq$")
+   set(reference "^vaddps %ymm(0,%ymm1|1,%ymm0),%ymm0 retq$")
 elseif("${IMPL}" STREQUAL MIC)
-   set(reference "^vaddps %zmm1,%zmm0,%zmm0 retq$")
+   set(reference "^vaddps %zmm(0,%zmm1|1,%zmm0),%zmm0 retq$")
 endif()

 if("${asm}" MATCHES "${reference}")


Fix typo in FindSQLite variables

Fix typo in FindSQLite variables

--- Modules/FindSQLite.cmake
+++ Modules/FindSQLite.cmake
@@ -64,7 +64,7 @@
   FOUND_VAR
     SQLite_FOUND
   REQUIRED_VARS
-    SQLite_INCLUDE_DIRS
+    SQLite_INCLUDE_DIR
     SQLite_LIBRARY
   VERSION_VAR
     SQLite_VERSION


04 changed to 03

04 changed to 03

--- cmake/EthCompilerSettings.cmake
+++ cmake/EthCompilerSettings.cmake
@@ -6,7 +6,7 @@
 	set(CMAKE_CXX_FLAGS "-std=c++11 -Wall -Wno-unknown-pragmas -Wextra -DSHAREDLIB -fPIC")
 	set(CMAKE_CXX_FLAGS_DEBUG          "-O0 -g -DETH_DEBUG")
 	set(CMAKE_CXX_FLAGS_MINSIZEREL     "-Os -DNDEBUG -DETH_RELEASE")
-	set(CMAKE_CXX_FLAGS_RELEASE        "-O4 -DNDEBUG -DETH_RELEASE")
+	set(CMAKE_CXX_FLAGS_RELEASE        "-O3 -DNDEBUG -DETH_RELEASE")
 	set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g -DETH_DEBUG")
 	set(ETH_SHARED 1)

@@ -21,7 +21,7 @@
 	set(CMAKE_CXX_FLAGS "-std=c++11 -Wall -Wno-unknown-pragmas -Wextra -DSHAREDLIB -fPIC")
 	set(CMAKE_CXX_FLAGS_DEBUG          "-O0 -g -DETH_DEBUG")
 	set(CMAKE_CXX_FLAGS_MINSIZEREL     "-Os -DNDEBUG -DETH_RELEASE")
-	set(CMAKE_CXX_FLAGS_RELEASE        "-O4 -DNDEBUG -DETH_RELEASE")
+	set(CMAKE_CXX_FLAGS_RELEASE        "-O3 -DNDEBUG -DETH_RELEASE")
 	set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g -DETH_DEBUG")
 	set(ETH_SHARED 1)


Move compiler specific flags to appropriate places

--- cmake/saya-test-generator.cmake
+++ cmake/saya-test-generator.cmake
@@ -1,5 +1,9 @@
 function(saya_remove_gtest_warnings target)
-  set_target_properties(${target} PROPERTIES COMPILE_FLAGS "-Wno-missing-field-initializers")
+  set(flags "")
+  if(NOT MSVC)
+    set(fags "-Wno-missing-field-initializers")
+  endif()
+  set_target_properties(${target} PROPERTIES COMPILE_FLAGS "${flags}")
 endfunction()

 function(saya_enable_gtest gtest_source_dir test_entrypoint_src include_dirs system_include_dirs compile_definitions)


rename the projects so they are in their own section

--- tools/cmake/ANHPythonBinding.cmake
+++ tools/cmake/ANHPythonBinding.cmake
@@ -61,7 +61,7 @@
     PARSE_ARGUMENTS(ANHPYTHONLIB "ONLY_BINDINGS;DEPENDS;SOURCES;ADDITIONAL_LIBRARY_DIRS;ADDITIONAL_INCLUDE_DIRS;ADDITIONAL_SOURCE_DIRS;DEBUG_LIBRARIES;OPTIMIZED_LIBRARIES" "" ${ARGN})

     set(base_name ${name})
-    set(name ${name}_binding)
+    set(name swgpy_${name}_binding)

     LIST(LENGTH ANHPYTHONLIB_SOURCES __source_files_list_length)
     LIST(LENGTH ANHPYTHONLIB_DEBUG_LIBRARIES _debug_list_length)


Bump TubeTK for Tortuosity fix

Bump TubeTK for Tortuosity fix

--- CMake/Superbuild/External_TubeTK.cmake
+++ CMake/Superbuild/External_TubeTK.cmake
@@ -45,7 +45,7 @@
     SOURCE_DIR ${CMAKE_BINARY_DIR}/${proj}
     BINARY_DIR ${${proj}_DIR}
     GIT_REPOSITORY "https://github.com/KitwareMedical/TubeTK.git"
-    GIT_TAG "dd4ee410f08ad78a96b7a598a12f75f57399b248"
+    GIT_TAG "6e55b85d7149d85e0c936f0ef804787686348580"
     CMAKE_CACHE_ARGS
       -DBUILD_SHARED_LIBS:BOOL=${BUILD_SHARED_LIBS}
       -DCMAKE_CXX_FLAGS:STRING=${ep_common_cxx_flags}


AVOID HORRIBLE FAILURE WHEN COMPILING OSX CODE WITH XCODE 8

--- core/cmake/toolchains/osx.cmake
+++ core/cmake/toolchains/osx.cmake
@@ -4,7 +4,7 @@
   CACHE STRING "osx_archs"
 )

-set(OSX_DEPLOYMENT_TARGET 10.7
+set(OSX_DEPLOYMENT_TARGET 10.8
   CACHE STRING "osx_deployment_target"
 )


Issue #21: Make OpenCV CUDA config more consistent in style with PCL config.

--- CMake/ExternalProjects/OpenCV.cmake
+++ CMake/ExternalProjects/OpenCV.cmake
@@ -34,16 +34,20 @@

 if(NOT DEFINED OpenCV_DIR)

-  set(_vtk_options)
+  set(_vtk_options
+    -DWITH_VTK:BOOL=${BUILD_VTK}
+  )
   if(BUILD_VTK)
-    set(_vtk_options
+    list(APPEND _vtk_options
       -DVTK_DIR:PATH=${VTK_DIR}
     )
   endif()

-  set(_cuda_options)
+  set(_cuda_options
+    -DWITH_CUDA:BOOL=${MYPROJECT_USE_CUDA}
+  )
   if(MYPROJECT_USE_CUDA)
-    set(_cuda_options
+    list(APPEND _cuda_options
       -DCUDA_TOOLKIT_ROOT_DIR:PATH=${CUDA_TOOLKIT_ROOT_DIR}
       -DCUDA_ARCH_BIN:STRING=${MYPROJECT_CUDA_ARCH_BIN}
       -DCUDA_NVCC_FLAGS:STRING=${MYPROJECT_CXX11_FLAG}
@@ -86,11 +90,9 @@
       -DWITH_EIGEN:BOOL=OFF
       -DWITH_FFMPEG:BOOL=${OPENCV_WITH_FFMPEG}
       -DWITH_OPENMP:BOOL=${MYPROJECT_USE_OPENMP}
-      -DWITH_CUDA:BOOL=${MYPROJECT_USE_CUDA}
+      ${_vtk_options}
       ${_cuda_options}
-      -DWITH_VTK:BOOL=${BUILD_VTK}
-      ${_vtk_options}
-      "-DCMAKE_CXX_FLAGS:STRING=${CMAKE_CXX_FLAGS} -DVTK_MAJOR_VERSION=6"
+      "-DCMAKE_CXX_FLAGS:STRING=${CMAKE_CXX_FLAGS} -DVTK_MAJOR_VERSION=6" # Doesn't matter what version, as long as > 5.
       ${additional_cmake_args}
     CMAKE_CACHE_ARGS
       ${EP_COMMON_CACHE_ARGS}


Don't apply visibility settings to statically built samples.  Fixes linking problems with Xcode 4 and iOS.

--- CMake/Utils/OgreConfigTargets.cmake
+++ CMake/Utils/OgreConfigTargets.cmake
@@ -293,14 +293,17 @@
       endif()
     endif(NOT OGRE_BUILD_PLATFORM_APPLE_IOS)
   endif (APPLE)
-  if (CMAKE_COMPILER_IS_GNUCXX)
-    # add GCC visibility flags to shared library build
-    set_target_properties(${SAMPLENAME} PROPERTIES COMPILE_FLAGS "${OGRE_GCC_VISIBILITY_FLAGS}")
-    set_target_properties(${SAMPLENAME} PROPERTIES XCODE_ATTRIBUTE_GCC_SYMBOLS_PRIVATE_EXTERN "${XCODE_ATTRIBUTE_GCC_SYMBOLS_PRIVATE_EXTERN}")
-    set_target_properties(${SAMPLENAME} PROPERTIES XCODE_ATTRIBUTE_GCC_INLINES_ARE_PRIVATE_EXTERN "${XCODE_ATTRIBUTE_GCC_INLINES_ARE_PRIVATE_EXTERN}")
-    # disable "lib" prefix on Unix
-    set_target_properties(${SAMPLENAME} PROPERTIES PREFIX "")
-  endif (CMAKE_COMPILER_IS_GNUCXX)
+  if (NOT OGRE_STATIC)
+    if (CMAKE_COMPILER_IS_GNUCXX)
+      # add GCC visibility flags to shared library build
+      set_target_properties(${SAMPLENAME} PROPERTIES COMPILE_FLAGS "${OGRE_GCC_VISIBILITY_FLAGS}")
+      set_target_properties(${SAMPLENAME} PROPERTIES XCODE_ATTRIBUTE_GCC_SYMBOLS_PRIVATE_EXTERN "${XCODE_ATTRIBUTE_GCC_SYMBOLS_PRIVATE_EXTERN}")
+      set_target_properties(${SAMPLENAME} PROPERTIES XCODE_ATTRIBUTE_GCC_INLINES_ARE_PRIVATE_EXTERN "${XCODE_ATTRIBUTE_GCC_INLINES_ARE_PRIVATE_EXTERN}")
+      # disable "lib" prefix on Unix
+      set_target_properties(${SAMPLENAME} PROPERTIES PREFIX "")
+    endif (CMAKE_COMPILER_IS_GNUCXX)
+  endif()
+
   if (OGRE_INSTALL_SAMPLES)
 	ogre_install_target(${SAMPLENAME} ${OGRE_SAMPLE_PATH} FALSE)
   endif()


Fixed a stupid install bug on Linux introduced in my latest CMake changes

--- CMake/Utils/OgreConfigTargets.cmake
+++ CMake/Utils/OgreConfigTargets.cmake
@@ -26,29 +26,29 @@
 endfunction(ogre_create_vcproj_userfile)

 # install targets according to current build type
-function(ogre_install_target TARGETNAME)
+function(ogre_install_target TARGETNAME SUFFIX)
   install(TARGETS ${TARGETNAME}
     RUNTIME DESTINATION "bin${OGRE_RELEASE_PATH}" CONFIGURATIONS Release None ""
-    LIBRARY DESTINATION "lib" CONFIGURATIONS Release None ""
-    ARCHIVE DESTINATION "lib" CONFIGURATIONS Release None ""
+    LIBRARY DESTINATION "lib${SUFFIX}" CONFIGURATIONS Release None ""
+    ARCHIVE DESTINATION "lib${SUFFIX}" CONFIGURATIONS Release None ""
     FRAMEWORK DESTINATION "bin${OGRE_RELEASE_PATH}" CONFIGURATIONS Release None ""
   )
   install(TARGETS ${TARGETNAME}
     RUNTIME DESTINATION "bin${OGRE_RELWDBG_PATH}" CONFIGURATIONS RelWithDebInfo
-    LIBRARY DESTINATION "lib" CONFIGURATIONS RelWithDebInfo
-    ARCHIVE DESTINATION "lib" CONFIGURATIONS RelWithDebInfo
+    LIBRARY DESTINATION "lib${SUFFIX}" CONFIGURATIONS RelWithDebInfo
+    ARCHIVE DESTINATION "lib${SUFFIX}" CONFIGURATIONS RelWithDebInfo
     FRAMEWORK DESTINATION "bin${OGRE_RELWDBG_PATH}" CONFIGURATIONS RelWithDebInfo
   )
   install(TARGETS ${TARGETNAME}
     RUNTIME DESTINATION "bin${OGRE_MINSIZE_PATH}" CONFIGURATIONS MinSizeRel
-    LIBRARY DESTINATION "lib" CONFIGURATIONS MinSizeRel
-    ARCHIVE DESTINATION "lib" CONFIGURATIONS MinSizeRel
+    LIBRARY DESTINATION "lib${SUFFIX}" CONFIGURATIONS MinSizeRel
+    ARCHIVE DESTINATION "lib${SUFFIX}" CONFIGURATIONS MinSizeRel
     FRAMEWORK DESTINATION "bin${OGRE_MINSIZE_PATH}" CONFIGURATIONS MinSizeRel
   )
   install(TARGETS ${TARGETNAME}
     RUNTIME DESTINATION "bin${OGRE_DEBUG_PATH}" CONFIGURATIONS Debug
-    LIBRARY DESTINATION "lib" CONFIGURATIONS Debug
-    ARCHIVE DESTINATION "lib" CONFIGURATIONS Debug
+    LIBRARY DESTINATION "lib${SUFFIX}" CONFIGURATIONS Debug
+    ARCHIVE DESTINATION "lib${SUFFIX}" CONFIGURATIONS Debug
     FRAMEWORK DESTINATION "bin${OGRE_DEBUG_PATH}" CONFIGURATIONS Debug
   )
 endfunction(ogre_install_target)
@@ -75,7 +75,7 @@
       set_target_properties(${LIBNAME} PROPERTIES COMPILE_FLAGS "${OGRE_GCC_VISIBILITY_FLAGS}")
 	endif (CMAKE_COMPILER_IS_GNUCXX)
   endif (OGRE_STATIC)
-  ogre_install_target(${LIBNAME})
+  ogre_install_target(${LIBNAME} "")

   if (OGRE_INSTALL_PDB)
     # install debug pdb files
@@ -115,7 +115,7 @@
       set_target_properties(${PLUGINNAME} PROPERTIES PREFIX "")
 	endif (CMAKE_COMPILER_IS_GNUCXX)
   endif (OGRE_STATIC)
-  ogre_install_target(${PLUGINNAME})
+  ogre_install_target(${PLUGINNAME} ${OGRE_PLUGIN_PATH})

   if (OGRE_INSTALL_PDB)
     # install debug pdb files
@@ -227,18 +227,18 @@
   endif (APPLE)

   if (OGRE_INSTALL_SAMPLES)
-    ogre_install_target(${SAMPLENAME})
+    ogre_install_target(${SAMPLENAME} "")
+    if (OGRE_INSTALL_PDB)
+      # install debug pdb files
+      install(FILES ${OGRE_BINARY_DIR}/bin${OGRE_DEBUG_PATH}/${SAMPLENAME}.pdb
+        DESTINATION bin${OGRE_DEBUG_PATH} CONFIGURATIONS Debug
+        )
+      install(FILES ${OGRE_BINARY_DIR}/bin${OGRE_RELWDBG_PATH}/${SAMPLENAME}.pdb
+        DESTINATION bin${OGRE_RELWDBG_PATH} CONFIGURATIONS RelWithDebInfo
+        )
+    endif ()
   endif ()

-  if (OGRE_INSTALL_PDB)
-    # install debug pdb files
-	install(FILES ${OGRE_BINARY_DIR}/bin${OGRE_DEBUG_PATH}/${SAMPLENAME}.pdb
-	  DESTINATION bin${OGRE_DEBUG_PATH} CONFIGURATIONS Debug
-	)
-	install(FILES ${OGRE_BINARY_DIR}/bin${OGRE_RELWDBG_PATH}/${SAMPLENAME}.pdb
-	  DESTINATION bin${OGRE_RELWDBG_PATH} CONFIGURATIONS RelWithDebInfo
-	)
-  endif ()
 endfunction(ogre_config_sample)

 # setup Ogre tool build
@@ -253,18 +253,18 @@
   endif ()

   if (OGRE_INSTALL_TOOLS)
-    ogre_install_target(${TOOLNAME})
+    ogre_install_target(${TOOLNAME} "")
+    if (OGRE_INSTALL_PDB)
+      # install debug pdb files
+      install(FILES ${OGRE_BINARY_DIR}/bin${OGRE_DEBUG_PATH}/${TOOLNAME}.pdb
+        DESTINATION bin${OGRE_DEBUG_PATH}
+        CONFIGURATIONS Debug
+        )
+      install(FILES ${OGRE_BINARY_DIR}/bin${OGRE_RELWDBG_PATH}/${TOOLNAME}.pdb
+        DESTINATION bin${OGRE_RELWDBG_PATH}
+        CONFIGURATIONS RelWithDebInfo
+        )
+    endif ()
   endif ()

-  if (OGRE_INSTALL_PDB)
-    # install debug pdb files
-	install(FILES ${OGRE_BINARY_DIR}/bin${OGRE_DEBUG_PATH}/${TOOLNAME}.pdb
-	  DESTINATION bin${OGRE_DEBUG_PATH}
-	  CONFIGURATIONS Debug
-	)
-	install(FILES ${OGRE_BINARY_DIR}/bin${OGRE_RELWDBG_PATH}/${TOOLNAME}.pdb
-	  DESTINATION bin${OGRE_RELWDBG_PATH}
-	  CONFIGURATIONS RelWithDebInfo
-	)
-  endif ()
 endfunction(ogre_config_tool)


Samples do not have _d appended so don't look for pdb with that suffix

--HG--
extra : convert_revision : svn%3A8631bf8a-c64b-0410-883c-f3eb003322f7/trunk%401243

--- CMake/Utils/OgreConfigTargets.cmake
+++ CMake/Utils/OgreConfigTargets.cmake
@@ -230,7 +230,7 @@

   if (OGRE_INSTALL_PDB)
 	  # install debug pdb files
-	  install(FILES ${OGRE_BINARY_DIR}/bin${OGRE_DEBUG_PATH}/${SAMPLENAME}_d.pdb
+	  install(FILES ${OGRE_BINARY_DIR}/bin${OGRE_DEBUG_PATH}/${SAMPLENAME}.pdb
 		  DESTINATION bin${OGRE_DEBUG_PATH}
 		  CONFIGURATIONS Debug
 		  )


COMP: Disable testing of MITK-ProjectTemplate for now.

Need to run ctest with -c <config> on Windows.

--- CMake/mitkTestProjectTemplate.cmake
+++ CMake/mitkTestProjectTemplate.cmake
@@ -1,4 +1,4 @@
-if(BUILD_TESTING)
+if(BUILD_TESTING AND 0)

   include(ExternalProject)


switch this to always build in shared mode

git-svn-id: 931ab4487dc05a11552de95f7d42b8249ade56b7@1420 a5045d30-4826-4484-9c7f-6e55a06ddc77

--- Code/cmake/Modules/RDKitUtils.cmake
+++ Code/cmake/Modules/RDKitUtils.cmake
@@ -10,15 +10,19 @@
   if(MSVC)
     add_library(${RDKLIB_NAME} ${RDKLIB_SOURCES})
   else(MSVC)
-    IF(RDKLIB_SHARED)
+    # we're going to always build in shared mode since we
+    # need exceptions to be (correctly) catchable across
+    # boundaries. As of now (June 2010), this doesn't work
+    # with g++ unless libraries are shared.
+    #IF(RDKLIB_SHARED)
       add_library(${RDKLIB_NAME} SHARED ${RDKLIB_SOURCES})
       INSTALL(TARGETS ${RDKLIB_NAME}
               DESTINATION ${RDKit_BinDir}/${RDKLIB_DEST})
-    ELSE(RDKLIB_SHARED)
-      add_library(${RDKLIB_NAME} ${RDKLIB_SOURCES})
-      INSTALL(TARGETS ${RDKLIB_NAME}
-              DESTINATION ${RDKit_LibDir}/${RDKLIB_DEST})
-    ENDIF(RDKLIB_SHARED)
+    #ELSE(RDKLIB_SHARED)
+    #  add_library(${RDKLIB_NAME} ${RDKLIB_SOURCES})
+    #  INSTALL(TARGETS ${RDKLIB_NAME}
+    #          DESTINATION ${RDKit_LibDir}/${RDKLIB_DEST})
+    #ENDIF(RDKLIB_SHARED)
     IF(RDKLIB_LINK_LIBRARIES)
       target_link_libraries(${RDKLIB_NAME} ${RDKLIB_LINK_LIBRARIES})
     ENDIF(RDKLIB_LINK_LIBRARIES)


move adding cyclus module path into findcyclus macro

--- cmake/FindCyclus.cmake
+++ cmake/FindCyclus.cmake
@@ -105,6 +105,8 @@
     SET(CYCLUS_DEFAULT_TEST_DRIVER)
 ENDIF()

+SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CYCLUS_CORE_INCLUDE_DIR}/../../share/cyclus/cmake)
+
 # Report the results.
 IF(CYCLUS_CORE_FOUND)
     SET(CYCLUS_CORE_DIR_MESSAGE "Found Cyclus Core Headers : "
@@ -134,6 +136,7 @@
             MESSAGE(FATAL_ERROR "${cyclus_DIR_MESSAGE}")
         ENDIF(Cyclus_FIND_REQUIRED)
     ENDIF(NOT Cyclus_FIND_QUIETLY)
+
 ENDIF(CYCLUS_CORE_FOUND)

 MARK_AS_ADVANCED(


Added comments

Added comments

--- cmake/FindEigen3.cmake
+++ cmake/FindEigen3.cmake
@@ -9,6 +9,11 @@
 #  EIGEN3_FOUND - system has eigen lib with correct version
 #  EIGEN3_INCLUDE_DIR - the eigen include directory
 #  EIGEN3_VERSION - eigen version
+
+# This module reads hints about search locations from
+# the following enviroment variables:
+#
+# EIGEN3_ROOT - Preferred Eigen3 directory

 # Copyright (c) 2006, 2007 Montel Laurent, <montel@kde.org>
 # Copyright (c) 2008, 2009 Gael Guennebaud, <g.gael@free.fr>


emscripten 1.39.16 fails with fastcomp in strict mode

--- toolchains/emscripten.cmake
+++ toolchains/emscripten.cmake
@@ -34,9 +34,11 @@

 set( TNUN_MALLOC_OVERCOMMIT_POLICY Partial )

-# always use STRICT mode: https://github.com/emscripten-core/emscripten/blob/1.38.43/src/settings.js#L809
-set( strict_mode "SHELL:-s STRICT=1" )
-add_compile_options( ${strict_mode} )
-add_link_options( ${strict_mode} )
+if ( NOT ${clang_major_version} EQUAL 6 )
+# always use STRICT mode if not using fastcomp (on fastcomp with 1.39.16 it's broken): https://github.com/emscripten-core/emscripten/blob/1.38.43/src/settings.js#L809
+    set( strict_mode "SHELL:-s STRICT=1" )
+    add_compile_options( ${strict_mode} )
+    add_link_options( ${strict_mode} )
+endif()

 add_compile_options( -fno-PIC )


COMP: Added AMR to include directories

COMP: Added AMR to include directories

Added the AMR kit directory to the list
of include directories for VTK.

--- vtkIncludeDirectories.cmake
+++ vtkIncludeDirectories.cmake
@@ -149,6 +149,7 @@
   ${VTK_SOURCE_DIR}/Filtering
   ${VTK_SOURCE_DIR}/Common
   ${VTK_SOURCE_DIR}/Utilities
+  ${VTK_SOURCE_DIR}/AMR
 )


Bug#14300733 CMAKE DOES NOT CHECK FOR ZLIB VERSION

Add check for compressBound() and deflateBound()
Keep existing functionality: fallback to bundled zlib if functions not found.

--- cmake/zlib.cmake
+++ cmake/zlib.cmake
@@ -57,13 +57,17 @@
      INCLUDE(CheckFunctionExists)
       SET(CMAKE_REQUIRED_LIBRARIES z)
       CHECK_FUNCTION_EXISTS(crc32 HAVE_CRC32)
+      CHECK_FUNCTION_EXISTS(compressBound HAVE_COMPRESSBOUND)
+      CHECK_FUNCTION_EXISTS(deflateBound HAVE_DEFLATEBOUND)
       SET(CMAKE_REQUIRED_LIBRARIES)
-      IF(HAVE_CRC32)
+      IF(HAVE_CRC32 AND HAVE_COMPRESSBOUND AND HAVE_DEFLATEBOUND)
         SET(ZLIB_LIBRARY z CACHE INTERNAL "System zlib library")
-        SET(WITH_ZLIB "system" CACHE STRING "Which zlib to use (possible values are 'bundled' or 'system')")
+        SET(WITH_ZLIB "system" CACHE STRING
+          "Which zlib to use (possible values are 'bundled' or 'system')")
         SET(ZLIB_SOURCES "")
       ELSE()
         SET(ZLIB_FOUND FALSE CACHE INTERNAL "Zlib found but not usable")
+        MESSAGE(STATUS "system zlib found but not usable")
       ENDIF()
     ENDIF()
     IF(NOT ZLIB_FOUND)


Build/Clang: suppress logical-op-parentheses warnings

--- modules/worldengine/nucleus/src/cmake/compiler/clang/settings.cmake
+++ modules/worldengine/nucleus/src/cmake/compiler/clang/settings.cmake
@@ -16,5 +16,5 @@

 # -Wno-narrowing needed to suppress a warning in g3d
 # -Wno-deprecated-register -Wstring-plus-int -Wpointer-bool-conversion are needed to suppress gsoap warnings on Unix systems.
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wno-narrowing -Wno-deprecated-register -Wstring-plus-int -Wparentheses -Wreorder")
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wno-narrowing -Wno-deprecated-register -Wstring-plus-int -Wparentheses -Wreorder -Wlogical-op-parentheses")
 set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DDEBUG=1")


Added missing Python dependencies

Added missing Python dependencies

Signed-off-by: Maciej Kurc <572803cc6e8d7bb35033942e4b03254951a2e0d6@antmicro.com>

--- xc7/make/project_xray.cmake
+++ xc7/make/project_xray.cmake
@@ -101,7 +101,7 @@
     DEPENDS
     ${TILE_IMPORT}
       ${DEPS}
-      ${PYTHON3} ${PYTHON3_TARGET}
+      ${PYTHON3} ${PYTHON3_TARGET} simplejson
     )

   add_file_target(FILE ${TILE}.pb_type.xml GENERATED)
@@ -167,7 +167,7 @@
       DEPENDS
         ${CREATE_SYNTH_TILES}
         ${PROJECT_XRAY_ARCH_USE_ROI}
-        ${PYTHON3} ${PYTHON3_TARGET}
+        ${PYTHON3} ${PYTHON3_TARGET} simplejson intervaltree
         )

     add_file_target(FILE synth_tiles.json GENERATED)
@@ -200,7 +200,7 @@
     DEPENDS
     ${ARCH_IMPORT}
     ${DEPS}
-    ${PYTHON3} ${PYTHON3_TARGET}
+    ${PYTHON3} ${PYTHON3_TARGET} simplejson
     )

   add_file_target(FILE arch.xml GENERATED)
@@ -279,7 +279,7 @@
     DEPENDS
     ${ASSIGN_PINS}
     ${DEPS} ${DEPS2} ${CHANNELS}
-    ${PYTHON3} ${PYTHON3_TARGET}
+    ${PYTHON3} ${PYTHON3_TARGET} simplejson progressbar2
     )

   add_file_target(FILE ${PIN_ASSIGNMENTS} GENERATED)


Update ITK Superbuild version toward ITK v4.10

Change-Id: Id2f4dbffa01eeb1c8f8162d1a61ffe13a2f06558

--- SuperBuild/External_ITK.cmake
+++ SuperBuild/External_ITK.cmake
@@ -35,7 +35,7 @@
 set(ITK_REPOSITORY "${git_protocol}://itk.org/ITK.git")

 # NOTE: it is very important to update the ITK_DIR path with the ITK version
-set(ITK_TAG_COMMAND GIT_TAG v4.10rc01 )
+set(ITK_TAG_COMMAND GIT_TAG  417d6a36d01aa3b835855349cc481a9b3dca8506 )

 if( ${ITK_WRAPPING} OR ${BUILD_SHARED_LIBS} )
   set( ITK_BUILD_SHARED_LIBS ON )


SuperBuild: FFTW use same dir for src and build because autoconf

--- SuperBuild/CMake/External_fftw.cmake
+++ SuperBuild/CMake/External_fftw.cmake
@@ -7,11 +7,9 @@
   message(STATUS "  Using FFTW system version")
 else()
   SETUP_SUPERBUILD(PROJECT FFTW)
-  set(projFloat FFTWF)
-  set(projDouble FFTWD)

-  set(FFTW_SB_BUILD_FLOAT_DIR ${CMAKE_BINARY_DIR}/FFTW/src/${projFloat})
-  set(FFTW_SB_BUILD_DOUBLE_DIR ${CMAKE_BINARY_DIR}/FFTW/src/${projDouble})
+  set(FFTWF_SB_SRC ${CMAKE_BINARY_DIR}/FFTW/src/FFTWF)
+  set(FFTWD_SB_SRC ${CMAKE_BINARY_DIR}/FFTW/src/FFTWD)

   if(MSVC)
     # TODO : get precompiled binaries as not all MSVC versions can compile FFTW
@@ -19,17 +17,19 @@
       add_custom_target(FFTW)
   else()
     message(STATUS "  Using FFTW SuperBuild version")
+
     # Compile the float version of FFTW
-    ExternalProject_Add(${projFloat}
-      PREFIX FFTW
+    ExternalProject_Add(FFTWF
+      PREFIX FFTW/FFTWF
       URL "http://www.fftw.org/fftw-3.3.4.tar.gz"
       URL_MD5 2edab8c06b24feeb3b82bbb3ebf3e7b3
-      SOURCE_DIR ${FFTW_SB_BUILD_FLOAT_DIR}
+      SOURCE_DIR ${FFTWF_SB_SRC}
+      BINARY_DIR ${FFTWF_SB_SRC}
       INSTALL_DIR ${SB_INSTALL_PREFIX}
       DOWNLOAD_DIR ${DOWNLOAD_LOCATION}
       CONFIGURE_COMMAND
       ${SB_ENV_CONFIGURE_CMD}
-        ${FFTW_SB_BUILD_FLOAT_DIR}/configure
+        ${FFTWF_SB_SRC}/configure
             --prefix=${SB_INSTALL_PREFIX}
             --enable-shared
             --disable-static
@@ -39,49 +39,29 @@
       DEPENDS ${FFTW_DEPENDENCIES}
       )

-    #ExternalProject_Add_Step(${projFloat} copy_source
-    #  COMMAND ${CMAKE_COMMAND} -E copy_directory
-    #    ${FFTW_SB_SRC} ${FFTW_SB_BUILD_FLOAT_DIR}
-    #  DEPENDEES patch update
-    #  DEPENDERS configure
-    #  )
-
     # Compile the double version of FFTW
-    ExternalProject_Add(FFTW
-      PREFIX FFTW
+    ExternalProject_Add(FFTWD
+      PREFIX FFTW/FFTWD
       URL "http://www.fftw.org/fftw-3.3.4.tar.gz"
       URL_MD5 2edab8c06b24feeb3b82bbb3ebf3e7b3
-      SOURCE_DIR ${FFTW_SB_BUILD_DOUBLE_DIR}
+      SOURCE_DIR ${FFTWD_SB_SRC}
+      BINARY_DIR ${FFTWD_SB_SRC}
       INSTALL_DIR ${SB_INSTALL_PREFIX}
       DOWNLOAD_DIR ${DOWNLOAD_LOCATION}
       CONFIGURE_COMMAND
       ${SB_ENV_CONFIGURE_CMD}
-        ${FFTW_SB_BUILD_DOUBLE_DIR}/configure
+        ${FFTWD_SB_SRC}/configure
             --prefix=${SB_INSTALL_PREFIX}
             --enable-shared
             --disable-static
             --disable-float
             --enable-threads
             --disable-fortran
-      DEPENDS ${FFTW_DEPENDENCIES}
       )
-
-    #ExternalProject_Add_Step(${projDouble} copy_source
-    #  COMMAND ${CMAKE_COMMAND} -E copy_directory
-    #    ${FFTW_SB_SRC} ${FFTW_SB_BUILD_DOUBLE_DIR}
-    #  DEPENDEES patch update
-    #  DEPENDERS configure
-    #  )
-
-    add_dependencies(FFTW ${projFloat})
-
-    FIX_RPATH_FOR_AUTOCONF_BUILD(FFTW "libfftw3*dylib")

     set(_SB_FFTW_INCLUDE_PATH ${SB_INSTALL_PREFIX}/include)

   endif()

-
-
 endif()
 endif()


SuperBuild: also package GeoTIFF data and OSSIM data

--- SuperBuild/CMake/Package_Macro.cmake
+++ SuperBuild/CMake/Package_Macro.cmake
@@ -202,6 +202,12 @@
     find_path(GDAL_DATA epsg.wkt ${PACKAGE_INSTALLDIR}/share/gdal)
     install(DIRECTORY ${GDAL_DATA} DESTINATION ${DATA_DIR})

+    ####################### install GeoTIFF data ###########################
+    install(DIRECTORY ${PACKAGE_INSTALLDIR}/share/epsg_csv DESTINATION ${DATA_DIR})
+
+    ####################### install OSSIM data ###########################
+    install(DIRECTORY ${PACKAGE_INSTALLDIR}/share/ossim DESTINATION ${DATA_DIR})
+
     ####################### install otbcli scripts ######################
     file(GLOB CLI_SCRIPTS ${PACKAGE_INSTALLDIR}/bin/otbcli*)
     foreach(CLI_SCRIPT ${CLI_SCRIPTS})


Get right BOINC external in RPM build

Get right BOINC external in RPM build

--- build/cmake/CondorConfigure.cmake
+++ build/cmake/CondorConfigure.cmake
@@ -842,7 +842,7 @@
     endif()
 	add_subdirectory(${CONDOR_EXTERNAL_DIR}/bundles/cream/1.15.4)
 	add_subdirectory(${CONDOR_EXTERNAL_DIR}/bundles/wso2/2.1.0)
-	if (CONDOR_PLATFORM MATCHES "Fedora27" OR CONDOR_PLATFORM MATCHES "Debian9")
+	if (PLATFORM MATCHES "Fedora27" OR PLATFORM MATCHES "Debian9")
 		add_subdirectory(${CONDOR_EXTERNAL_DIR}/bundles/boinc/7.8.6)
 	else()
 		add_subdirectory(${CONDOR_EXTERNAL_DIR}/bundles/boinc/devel)


Fix Xcode complaining about same resources in multiple groups. Tested on both Xcode and AppCode.

--- CMake/Modules/UrhoCommon.cmake
+++ CMake/Modules/UrhoCommon.cmake
@@ -929,21 +929,6 @@
     list (APPEND CPP_FILES ${ARG_EXTRA_CPP_FILES})
     list (APPEND H_FILES ${ARG_EXTRA_H_FILES})
     set (SOURCE_FILES ${CPP_FILES} ${H_FILES})
-    # Group the source files accordingly on IDE that supports it
-    foreach (CPP_FILE ${CPP_FILES})
-        get_filename_component (PATH ${CPP_FILE} PATH)
-        if (PATH)
-            string (REPLACE / \\ PATH ${PATH})
-            source_group ("Source Files\\${PATH}" FILES ${CPP_FILE})
-        endif ()
-    endforeach ()
-    foreach (H_FILE ${H_FILES})
-        get_filename_component (PATH ${H_FILE} PATH)
-        if (PATH)
-            string (REPLACE / \\ PATH ${PATH})
-            source_group ("Header Files\\${PATH}" FILES ${H_FILE})
-        endif ()
-    endforeach ()
     # Optionally enable PCH
     if (ARG_PCH)
         enable_pch (${ARG_PCH})
@@ -982,6 +967,7 @@
         set (GLOB_DIRS ${GLOB_DIRS_WITH_SENTINEL})      # Convert strings back to lists, extra sentinels are harmless
     endif ()
     list (APPEND RESOURCE_DIRS ${GLOB_DIRS} ${ARG_EXTRA_DIRS})
+    source_group ("Resource Dirs" FILES ${RESOURCE_DIRS})
     # Populate all the variables required by resource packaging, if the build option is enabled
     if (URHO3D_PACKAGING AND RESOURCE_DIRS)
         foreach (DIR ${RESOURCE_DIRS})
@@ -1045,7 +1031,7 @@
             endif ()
         endif ()
         # Group them together under 'Resources' in Xcode IDE
-        source_group (Resources FILES ${RESOURCE_DIRS} ${RESOURCE_PAKS} ${RESOURCE_FILES})
+        source_group (Resources FILES ${RESOURCE_PAKS} ${RESOURCE_FILES})     # RESOURCE_PAKS could be empty if packaging is not requested
         # But only use either paks or dirs
         if (RESOURCE_PAKS)
             set_source_files_properties (${RESOURCE_PAKS} ${RESOURCE_FILES} PROPERTIES MACOSX_PACKAGE_LOCATION Resources)


CMake: Clarify some error messages.

CMake: Clarify some error messages.

--- CMake/Modules/UrhoCommon.cmake
+++ CMake/Modules/UrhoCommon.cmake
@@ -312,7 +312,11 @@
     endif ()
     find_program(MSBUILD msbuild PATHS /Library/Frameworks/Mono.framework/Versions/Current/bin ${MONO_PATH}/bin)
     if (NOT MSBUILD)
-        message(FATAL_ERROR "MSBuild could not be found.")
+        if (WIN32)
+            message(FATAL_ERROR "MSBuild could not be found.")
+        else ()
+            message(FATAL_ERROR "MSBuild could not be found. You may need to install 'msbuild' package.")
+        endif ()
     endif ()

     if (CMAKE_SIZEOF_VOID_P EQUAL 8)
@@ -344,7 +348,11 @@
     # Strong name signatures
     find_program(SN sn PATHS PATHS /Library/Frameworks/Mono.framework/Versions/Current/bin ${MONO_PATH}/bin)
     if (NOT SN)
-        message(FATAL_ERROR "sn coild not be found.")
+        if (WIN32)
+            message(FATAL_ERROR "sn could not be found. Please install .NET framework 4.7.1.")
+        else ()
+            message(FATAL_ERROR "sn could not be found. Please install Mono.")
+        endif ()
     endif ()
     if (NOT EXISTS ${CMAKE_BINARY_DIR}/CSharp.snk)
         execute_process(COMMAND ${SN} -k ${CMAKE_BINARY_DIR}/CSharp.snk)


Enable LuaJIT by default on all platforms that support/allow it.

--- CMake/Modules/UrhoCommon.cmake
+++ CMake/Modules/UrhoCommon.cmake
@@ -196,7 +196,7 @@
     cmake_dependent_option (URHO3D_MMX "Enable MMX instruction set (32-bit Linux platform only); the MMX is effectively enabled when 3DNow! or SSE is enabled; should only be used for older CPU with MMX support" "${HAVE_MMX}" "X86 OR E2K AND CMAKE_SYSTEM_NAME STREQUAL Linux AND NOT URHO3D_64BIT AND NOT URHO3D_SSE AND NOT URHO3D_3DNOW" FALSE)
     # For completeness sake - this option is intentionally not documented as we do not officially support PowerPC (yet)
     cmake_dependent_option (URHO3D_ALTIVEC "Enable AltiVec instruction set (PowerPC only)" "${HAVE_ALTIVEC}" POWERPC FALSE)
-    cmake_dependent_option (URHO3D_LUAJIT "Enable Lua scripting support using LuaJIT (check LuaJIT's CMakeLists.txt for more options)" FALSE "NOT WEB" FALSE)
+    cmake_dependent_option (URHO3D_LUAJIT "Enable Lua scripting support using LuaJIT (check LuaJIT's CMakeLists.txt for more options)" TRUE "NOT WEB AND NOT APPLE" FALSE)
     cmake_dependent_option (URHO3D_LUAJIT_AMALG "Enable LuaJIT amalgamated build (LuaJIT only); default to true when LuaJIT is enabled" TRUE URHO3D_LUAJIT FALSE)
     cmake_dependent_option (URHO3D_SAFE_LUA "Enable Lua C++ wrapper safety checks (Lua/LuaJIT only)" FALSE URHO3D_LUA FALSE)
     if (NOT CMAKE_BUILD_TYPE STREQUAL Release AND NOT CMAKE_CONFIGURATION_TYPES)


Fix a bug about droplet lib finding

Fix a bug about droplet lib finding

In case the library wasn't installed, the library found was a static
lib, causing a miss of both the xml library and OpenSSL library while
linking the tool. We could have either fixed that by linking those
dependencies, either do what I did : try to force th dynlib finding.

--- CMakeScripts/FindDroplet.cmake
+++ CMakeScripts/FindDroplet.cmake
@@ -40,8 +40,11 @@

     # If it was found, we should be able to find the library too...
     # Same here, the user-defined path may help
+    # We need to find a dynlib because otherwise the dependencies will
+    # not be linked (Xml, SSL), and will make the linking fail
     FIND_LIBRARY(DROPLET_LIBRARY droplet
-                 PATHS ${DROPLET_PATH}/lib
+                 # droplet stores its dynlib in .libs in its source dir
+                 PATHS ${DROPLET_PATH}/.libs ${DROPLET_PATH}/lib
     )

     IF (DROPLET_INCLUDE_DIR AND DROPLET_LIBRARY)


Update hunter.cmake

Update hunter.cmake

--- cmake/projects/gloox/hunter.cmake
+++ cmake/projects/gloox/hunter.cmake
@@ -1,10 +1,20 @@
 include(hunter_add_version)
 include(hunter_cacheable)
-include(hunter_cmake_args)
 include(hunter_download)
 include(hunter_pick_scheme)

 # List of versions here...
+
+hunter_add_version(
+    PACKAGE_NAME
+    gloox
+    VERSION
+    "1.0.20-p4"
+    URL
+    "https://github.com/designerror/gloox/archive/v1.0.20-p4.tar.gz"
+    SHA1
+    d7e0c4ca27f8b68158c9428518bdcb3312fedd24
+)

 hunter_add_version(
     PACKAGE_NAME
@@ -49,16 +59,16 @@
     SHA1
     0170053e76b86ab10cbae4253221fd51d8f32f59
 )
-
-hunter_pick_scheme(DEFAULT url_sha1_cmake)
-
-hunter_cmake_args(
-    gloox
-    CMAKE_ARGS
-    BUILD_DOCS=NO
-    BUILD_TESTS=NO
-)
+if(WIN32)
+    hunter_pick_scheme(DEFAULT url_sha1_cmake)
+else()
+    hunter_configuration_types(gloox CONFIGURATION_TYPES Release)
+    hunter_pick_scheme(DEFAULT url_sha1_gloox_autotools)
+endif()

 hunter_cacheable(gloox)

-hunter_download(PACKAGE_NAME gloox)
+hunter_download(
+    PACKAGE_NAME gloox
+    PACKAGE_INTERNAL_DEPS_ID "1"
+)


Update hunter.cmake

Update hunter.cmake

--- cmake/projects/gloox/hunter.cmake
+++ cmake/projects/gloox/hunter.cmake
@@ -5,7 +5,6 @@
 include(hunter_pick_scheme)

 # List of versions here...
-

 hunter_add_version(
     PACKAGE_NAME
@@ -40,7 +39,7 @@
     0170053e76b86ab10cbae4253221fd51d8f32f59
 )

-hunter_pick_scheme(DEFAULT url_sha1_cmake)
+hunter_pick_scheme(DEFAULT url_sha1_autotools)

 hunter_cmake_args(
     gloox


additional include directory for eigen

additional include directory for eigen

issue https://github.com/smanders/externpro/issues/253

--- projects/use/usexp-eigen-config.cmake
+++ projects/use/usexp-eigen-config.cmake
@@ -10,6 +10,7 @@
 set(verDir /${prj}_@VER@)
 unset(${PRJ}_INCLUDE_DIR CACHE)
 find_path(${PRJ}_INCLUDE_DIR eigen3/Eigen/Eigen PATHS ${XP_ROOTDIR}/include${verDir} NO_DEFAULT_PATH)
+list(APPEND ${PRJ}_INCLUDE_DIR ${XP_ROOTDIR}/include${verDir}/eigen3)
 set(reqVars ${PRJ}_VER ${PRJ}_INCLUDE_DIR)
 include(FindPackageHandleStandardArgs)
 find_package_handle_standard_args(${prj} REQUIRED_VARS ${reqVars})


Avoid hardcoding the D3D9 library dependencies. This change should actually be part of this commit 971fa90c1091668e1daca2c9d77f21596b338a5f.

--- Source/CMake/Modules/Urho3D-CMake-common.cmake
+++ Source/CMake/Modules/Urho3D-CMake-common.cmake
@@ -709,7 +709,7 @@
                 list (APPEND ABSOLUTE_PATH_LIBS ${DIRECT3D_LIBRARIES})
             else ()
                 # If SDK not found, assume the libraries are found from default directories
-                list (APPEND LINK_LIBS_ONLY d3d9 d3dcompiler)
+                list (APPEND LINK_LIBS_ONLY ${DIRECT3D_LIBRARIES})
             endif ()
         endif ()


Added missing Boost::atomic library to Boost config

--- SuperBuild/External_Boost_configureboost.cmake
+++ SuperBuild/External_Boost_configureboost.cmake
@@ -3,7 +3,7 @@
     WORKING_DIRECTORY ${BUILD_DIR} RESULT_VARIABLE bootstrap_result)
 else(WIN32)
   execute_process(COMMAND ./bootstrap.sh --prefix=${BOOST_INSTALL_DIR}
-    --with-libraries=system,filesystem,thread,program_options,chrono,date_time
+    --with-libraries=system,filesystem,thread,program_options,chrono,date_time,atomic
     #--with-libraries=system,thread,program_options,log,math...
     #--without-libraries=atomic...


STYLE: Update slicerexecutionmodel version

--- SuperBuild/External_SlicerExecutionModel.cmake
+++ SuperBuild/External_SlicerExecutionModel.cmake
@@ -54,7 +54,7 @@
     )
   ### --- End Project specific additions
   set(${proj}_REPOSITORY "${git_protocol}://github.com/Slicer/SlicerExecutionModel.git")
-  set(${proj}_GIT_TAG 18cdc5a9d489f381acd7666668efa8d57ef08e47)
+  set(${proj}_GIT_TAG 983d2112ec431af20cafa49ca6cf7bd1a777869a)
   ExternalProject_Add(${proj}
     GIT_REPOSITORY ${${proj}_REPOSITORY}
     GIT_TAG ${${proj}_GIT_TAG}


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

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

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

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

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

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

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

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

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

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

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

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

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

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

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

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

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

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

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


Revert "Create and set environment variables"

This reverts commit 963cf4b8488b92be2d513741ed78163d9058eb80.
See https://github.com/CCPPETMR/SIRF-SuperBuild/issues/31

--- SuperBuild.cmake
+++ SuperBuild.cmake
@@ -87,17 +87,10 @@
 #Need to configure main project here.
 #set(proj ${PRIMARY_PROJECT_NAME})

-# SETUP ENVIRONMENT VARIABLES
 # Make environment files
 set(SIRF_SRC_PATH ${CMAKE_CURRENT_LIST_DIR}/SIRF)
 set(CCPPETMR_INSTALL ${SUPERBUILD_INSTALL_DIR})
 configure_file(env_ccppetmr.sh.in ${CCPPETMR_INSTALL}/bin/env_ccppetmr.sh)
-# create .sirfrc
-configure_file(env_ccppetmr.sh.in $ENV{HOME}/.sirfrc)
-# append .sirfrc to .bashrc
-file(APPEND $ENV{HOME}/.bashrc "#Environment variables for SIRF
-source ~/.sirfrc")
 configure_file(env_ccppetmr.csh.in ${CCPPETMR_INSTALL}/bin/env_ccppetmr.csh)
-
-#Create a default Gadgetron configuration
+#default gadgetron configuration
 configure_file(${CCPPETMR_INSTALL}/share/gadgetron/config/gadgetron.xml.example ${CCPPETMR_INSTALL}/share/gadgetron/config/gadgetron.xml)


Automatically set up the Visual Studio tree based on subdirectories.

A file called, say, win32/FileHandle.h will be placed in a subfolder
called win32 in the IDE.  Deeper subdirectories will be handled
correctly as well.

CMake targets set up using surgsim_add_library() or
surgsim_add_unit_tests() will show the subdirectories in the IDE
automatically.  For other targets, you can add something like
    surgsim_show_ide_folders("${SOURCES}" "${HEADERS}")
to set up the hierarchy.

--- CMake/SurgSimUtilities.cmake
+++ CMake/SurgSimUtilities.cmake
@@ -13,6 +13,46 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.

+
+## Options related to integration with Visual Studio and other IDEs.
+
+# options related to source file organization
+#
+option(SURGSIM_IDE_SEPARATE_SOURCES_HEADERS
+	"If turned on, separate header files from the source files in the IDE. " OFF)
+if(SURGSIM_IDE_SEPARATE_SOURCES_HEADERS)
+	set(SURGSIM_IDE_SOURCE_PREFIX "Source Files/")
+	set(SURGSIM_IDE_HEADER_PREFIX "Header Files/")
+else()
+	set(SURGSIM_IDE_SOURCE_PREFIX "Files/")
+	set(SURGSIM_IDE_HEADER_PREFIX "Files/")
+endif()
+
+# Sets up the source file organization, for Visual Studio etc.
+# This will group the source and header files in folders by directory.
+#
+# Note the use of optional arguments:
+#   surgsim_set_source_groups(PREFIX FILES...)
+#
+function(surgsim_source_hierarchy PREFIX)
+	foreach(FILE ${ARGN})
+		# Get the directory name.  Note that for files in the current
+		# directory (and empty prefix), you will get "" rather than ".".
+		get_filename_component(FILE_PREFIXED_DIR "${PREFIX}${FILE}" PATH)
+		# Apparently, the hierarchical separator is "\" (per CMake docs).
+		# Hopefully that works in Linux IDEs too...
+		string(REGEX REPLACE "/" "\\\\" FILE_GROUP "${FILE_PREFIXED_DIR}")
+		# Set the IDE source group.  Note that top level is "", not ".".
+		source_group("${FILE_GROUP}" FILES "${FILE}")
+		#message("SRC ${FILE}|${FILE_GROUP}")
+	endforeach(FILE ${ARGN})
+endfunction()
+
+# Sets up the folder organization for sources and headers in Visual Studio etc.
+function(surgsim_show_ide_folders SOURCES HEADERS)
+	surgsim_source_hierarchy("${SURGSIM_IDE_SOURCE_PREFIX}" ${SOURCES})
+	surgsim_source_hierarchy("${SURGSIM_IDE_HEADER_PREFIX}" ${HEADERS})
+endfunction()

 ## CMake support for unit test building and running during the build.

@@ -160,6 +200,7 @@
 		surgsim_copy_to_target_directory_for_debug(${TESTNAME}
 			${UNIT_TEST_SHARED_DEBUG_LIBS})
 	endif()
+	surgsim_show_ide_folders("${UNIT_TEST_SOURCES}" "${UNIT_TEST_HEADERS}")
 endmacro()

 # Run the unit test executable (unless disabled or built all-in-one).
@@ -256,8 +297,10 @@
 			PUBLIC_HEADER DESTINATION ${INSTALL_INCLUDE_DIR}/${HEADER_DIRECTORY})

 		set(EXPORT_TARGETS ${LIBRARY_NAME} ${EXPORT_TARGETS} CACHE INTERNAL "export targets")
+		surgsim_show_ide_folders("${SOURCE_FILES}" "${HEADER_FILES}")
 	else()
 		install(FILES ${HEADER_FILES} DESTINATION ${INSTALL_INCLUDE_DIR}/${HEADER_DIRECTORY})
+		surgsim_show_ide_folders("" "${HEADER_FILES}")
 	endif()
 endfunction()


add iconengines/libqsvgicon.dylib

add iconengines/libqsvgicon.dylib

--- CMake/mitkInstallRules.cmake
+++ CMake/mitkInstallRules.cmake
@@ -45,6 +45,9 @@
             CONFIGURATIONS Release)
     install(FILES "${_qmake_path}/../plugins/sqldrivers/libqsqlite.dylib"
             DESTINATION "${bundle_name}.app/Contents/MacOS/sqldrivers"
+            CONFIGURATIONS Release)
+    install(FILES "${_qmake_path}/../plugins/iconengines/libqsvgicon.dylib"
+            DESTINATION "${bundle_name}.app/Contents/MacOS/iconengines"
             CONFIGURATIONS Release)
   endforeach()
 endif()


COMP: added mitkSlicesSwiveller.cpp to files.cmake in order to resolve linker errors

--- Core/Controllers/files.cmake
+++ Core/Controllers/files.cmake
@@ -13,6 +13,7 @@
   mitkSliceNavigationController.cpp
   mitkSlicesCoordinator.cpp
   mitkSlicesRotator.cpp
+  mitkSlicesSwiveller.cpp
   mitkStatusBar.cpp
   mitkStepper.cpp
   mitkTestManager.cpp


Removed deprecated MITK_TUTORIAL switch.

--- SuperBuild.cmake
+++ SuperBuild.cmake
@@ -256,7 +256,6 @@

   MITK_BUILD_ALL_PLUGINS
   MITK_BUILD_ALL_APPS
-  MITK_BUILD_TUTORIAL # Deprecated. Use MITK_BUILD_EXAMPLES instead
   MITK_BUILD_EXAMPLES

   MITK_USE_QT


Replace CACHE INTERNAL with PARENT_SCOPE. Now that standard_project is a macro, this works as expected.

--- standard/StandardProject.cmake
+++ standard/StandardProject.cmake
@@ -49,44 +49,44 @@
   # Need to classify the architecture before we run anything else, this lets us easily configure the
   # find version file based on what the architecture was actually built to be
   if(CMAKE_SYSTEM_PROCESSOR STREQUAL "arm")
-    set(standard_BUILD_ARM ON CACHE INTERNAL "")
-    set(standard_BUILD_ARCHITECTURES "arm" CACHE INTERNAL "")
-    set(standard_BUILD_64 OFF CACHE INTERNAL "")
+    set(standard_BUILD_ARM ON PARENT_SCOPE)
+    set(standard_BUILD_ARCHITECTURES "arm" PARENT_SCOPE)
+    set(standard_BUILD_64 OFFPARENT_SCOPE)
   elseif(CMAKE_OSX_ARCHITECTURES STREQUAL "x86_64;i386")
-    set(standard_BUILD_ARCHITECTURES x64 x86 CACHE INTERNAL "")
-    set(standard_BUILD_64 ON CACHE INTERNAL "")
+    set(standard_BUILD_ARCHITECTURES x64 x86 PARENT_SCOPE)
+    set(standard_BUILD_64 ON PARENT_SCOPE)
   elseif(CMAKE_SIZEOF_VOID_P STREQUAL 4)
-    set(standard_BUILD_ARCHITECTURES "x86" CACHE INTERNAL "")
-    set(standard_BUILD_64 OFF CACHE INTERNAL "")
+    set(standard_BUILD_ARCHITECTURES "x86" PARENT_SCOPE)
+    set(standard_BUILD_64 OFF PARENT_SCOPE)
   else()
-    set(standard_BUILD_ARCHITECTURES "x64" CACHE INTERNAL "")
-    set(standard_BUILD_64 ON CACHE INTERNAL "")
+    set(standard_BUILD_ARCHITECTURES "x64" PARENT_SCOPE)
+    set(standard_BUILD_64 ON PARENT_SCOPE)
   endif()
   message(STATUS "Using architecture: ${standard_BUILD_ARCHITECTURES}")

    # All of our binaries go to one place:  The binaries output directory.  We only want to tinker
   # with this if we're building by ourselves, otherwise we just do whatever the enclosing project
   # wants us to do.
-  set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin CACHE INTERNAL "Executable Output directory")
+  set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin PARENT_SCOPE)

   # Libraries not only all wind up in the libraries directory, but we also keep them all together
   # here by putting them in the same place, regardless of whether they are debug or release.  This
   # makes globbing them together much easier.
-  set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib CACHE INTERNAL "Shared Library output directory")
-  set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}/lib CACHE INTERNAL "Shared Library output directory")
-  set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}/lib CACHE INTERNAL "Shared Library output directory")
-  set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib CACHE INTERNAL "Static Library output directory")
-  set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}/lib CACHE INTERNAL "Static Library output directory")
-  set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}/lib CACHE INTERNAL "Static Library output directory")
+  set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib PARENT_SCOPE)
+  set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}/lib PARENT_SCOPE)
+  set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}/lib PARENT_SCOPE)
+  set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib PARENT_SCOPE)
+  set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}/lib PARENT_SCOPE)
+  set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}/lib PARENT_SCOPE)

   # Postfix on all debug libraries should be "d"
-  set(CMAKE_DEBUG_POSTFIX d${CMAKE_DEBUG_POSTFIX} CACHE INTERNAL "Debug postfix")
+  set(CMAKE_DEBUG_POSTFIX d${CMAKE_DEBUG_POSTFIX} PARENT_SCOPE)

   # 64-bit installations should suffix with 64 regardless of the CPU type (arm or intel)
   if(CMAKE_SIZEOF_VOID_P EQUAL 8)
     foreach(config IN LISTS CMAKE_CONFIGURATION_TYPES)
       string(TOUPPER ${config} config)
-      set(CMAKE_${config}_POSTFIX "${CMAKE_${config}_POSTFIX}64" CACHE INTERNAL "$[config} Postfix")
+      set(CMAKE_${config}_POSTFIX "${CMAKE_${config}_POSTFIX}64" PARENT_SCOPE)
     endforeach()
   endif()