Addressed a small issue which prevented us from building LLVM on Linux.

--- src/plugins/3rdparty/LLVM/common.cmake
+++ src/plugins/3rdparty/LLVM/common.cmake
@@ -12,8 +12,12 @@
             _SCL_SECURE_NO_DEPRECATE
             _SCL_SECURE_NO_WARNINGS
         )
+    ELSEIF(APPLE)
+        SET(LLVM_MSVC_DEFINITIONS)
     ELSE()
-        SET(LLVM_MSVC_DEFINITIONS)
+        SET(LLVM_MSVC_DEFINITIONS
+            __STDC_FORMAT_MACROS
+        )
     ENDIF()

     SET(LLVM_DEFINITIONS


fix build error on ODROID-X2

fix build error on ODROID-X2

--- cmake/OpenCVFindLAPACK.cmake
+++ cmake/OpenCVFindLAPACK.cmake
@@ -136,6 +136,10 @@
         unset(LAPACK_LIBRARIES)
         unset(LAPACK_LIBRARIES CACHE)
       endif()
+    else()
+      # LAPACK not found
+      unset(LAPACK_LIBRARIES)
+      unset(LAPACK_LIBRARIES CACHE)
     endif()
   endif()


Correct regex

Correct regex

--- cmake/OpenCogFunctions.cmake
+++ cmake/OpenCogFunctions.cmake
@@ -124,7 +124,7 @@

             # Specify module paths.
             STRING(REGEX MATCH
-                "^(${PREFIX_DIR_PATH})([a-z0-9/-_]+)*/([a-z0-9-_]+)" ""
+                "^(${PREFIX_DIR_PATH})([_a-z0-9/-]+)*/([_a-z0-9-]+)" ""
                 ${SCM_MODULE_DESTINATION})

             # MODULE_NAME: it is equal to the MODULE_DESTINATION directory name


Moved position of Arduino.h include to match Arduino preprocessor.

--- cmake/Platform/Arduino.cmake
+++ cmake/Platform/Arduino.cmake
@@ -1159,13 +1159,13 @@

 	# write the file head
     file(APPEND ${SKETCH_CPP} "\n")
+    file(APPEND ${SKETCH_CPP} "${SKETCH_HEAD}")
     if(ARDUINO_SDK_VERSION VERSION_LESS 1.0)
         file(APPEND ${SKETCH_CPP} "#include \"WProgram.h\"\n")
     else()
         file(APPEND ${SKETCH_CPP} "#include \"Arduino.h\"\n")
     endif()
     file(APPEND ${SKETCH_CPP} "\n")
-    file(APPEND ${SKETCH_CPP} "${SKETCH_HEAD}")

     # Find function prototypes
     foreach(SKETCH_SOURCE_PATH ${SKETCH_SOURCES} ${MAIN_SKETCH_PATH})


OSX: fix a typo + add message

OSX: fix a typo + add message

--- cmake/PlatformSpecific.cmake
+++ cmake/PlatformSpecific.cmake
@@ -118,7 +118,7 @@
 	### it does  work in xcode 4.3 due it defaults to "Debug" and needs this mandatory ###
 	### you must change build configuration in xcode4.3 itself until solution is found ###

-	if(${XCODE_VERSION} LESS 4.3 AND ${CMAKE_BUILD_TYPE} MATCHES Release)
+	if(${XCODE_VERSION} LESS "4.3" AND ${CMAKE_BUILD_TYPE} MATCHES Release)
 		SET(CMAKE_CONFIGURATION_TYPES "Release" CACHE STRING "limit configs" FORCE) # not valid for xcode 4.3
 	elseif(${CMAKE_BUILD_TYPE} MATCHES Debug)
 		SET(CMAKE_CONFIGURATION_TYPES "Debug" CACHE STRING "limit configs" FORCE) # valid for xcode 4.3
@@ -139,6 +139,7 @@
 		MESSAGE(STATUS "CMAKE_XCODE_ATTRIBUTE_ARCHS ( cmake 2.8 or higher method ): " ${CMAKE_XCODE_ATTRIBUTE_ARCHS})
 	ENDIF(CMAKE_VERSION VERSION_LESS 2.8.1)
 	MESSAGE(STATUS "OSX SDK SETTING : " ${CMAKE_OSX_SYSROOT})
+	MESSAGE(STATUS "XCODE_VERSION : " ${XCODE_VERSION})
 	MESSAGE(STATUS "BUILD_TYPE : " ${CMAKE_BUILD_TYPE})
 	MESSAGE(STATUS "UPDATE_LUXRAYS_IN_MACOS_REPO : " ${OSX_UPDATE_LUXRAYS_REPO})
 	MESSAGE(STATUS "BUILD_LUXMARK_OSX : " ${OSX_BUILD_LUXMARK})


Update -qopenmp flag for latest compilers

--- cmake/custom/math_libs.cmake
+++ cmake/custom/math_libs.cmake
@@ -384,7 +384,7 @@
         set(_omp_flag)
         if(HAVE_MKL_BLAS OR HAVE_MKL_LAPACK)
             if(MKL_COMPILER_BINDINGS MATCHES Intel)
-                set(_omp_flag -openmp)
+                set(_omp_flag -qopenmp)
             endif()
             if(MKL_COMPILER_BINDINGS MATCHES GNU)
                 set(_omp_flag -fopenmp)


[SR-14813] Add Swift compile options for fuzzing.

We only had the C/C++/ObjC/ObjC++ option.  Add the Swift one too.

--- cmake/modules/AddSwift.cmake
+++ cmake/modules/AddSwift.cmake
@@ -885,7 +885,9 @@

   # Then make sure that we pass the -fsanitize=fuzzer flag both on the cflags
   # and cxx flags line.
-  target_compile_options(${executable} PRIVATE $<$<COMPILE_LANGUAGE:C,CXX,OBJC,OBJCXX>:-fsanitize=fuzzer>)
+  target_compile_options(${executable} PRIVATE
+    $<$<COMPILE_LANGUAGE:C,CXX,OBJC,OBJCXX>:-fsanitize=fuzzer>
+    $<$<COMPILE_LANGUAGE:Swift>:-sanitize=fuzzer>)
   target_link_libraries(${executable} PRIVATE "-fsanitize=fuzzer")
 endfunction()


build: simplify check using the SDK OBJECT_FORMAT

_OBJECT_FORMAT was added recentlyish for all the SDKs.  Use that property rather
than enumerating all the ELFish targets.  This ensures that the code path is
correct if another ELFish target is ported to.

--- cmake/modules/AddSwift.cmake
+++ cmake/modules/AddSwift.cmake
@@ -578,20 +578,16 @@
     set(SWIFTLIB_SINGLE_API_NOTES "${module_name}")
   endif()

-  # On platforms that use ELF binaries (for now that is Linux and FreeBSD)
-  # we add markers for metadata sections in the shared libraries using
-  # these object files.  This wouldn't be necessary if the link was done by
-  # the swift binary: rdar://problem/19007002
-  if("${SWIFTLIB_SINGLE_SDK}" STREQUAL "LINUX" OR
-     "${SWIFTLIB_SINGLE_SDK}" STREQUAL "FREEBSD")
-
+  # On platforms that use ELF binaries we add markers for metadata sections in
+  # the shared libraries using these object files.  This wouldn't be necessary
+  # if the link was done by the swift binary: rdar://problem/19007002
+  if("${SWIFT_SDK_${SWIFTLIB_SINGLE_SDK}_OBJECT_FORMAT}" STREQUAL "ELF")
     if("${libkind}" STREQUAL "SHARED")
       set(arch_subdir "${SWIFTLIB_DIR}/${SWIFTLIB_SINGLE_SUBDIR}")

       set(SWIFT_SECTIONS_OBJECT_BEGIN "${arch_subdir}/swift_begin.o")
       set(SWIFT_SECTIONS_OBJECT_END   "${arch_subdir}/swift_end.o")
     endif()
-
   endif()

   # FIXME: don't actually depend on the libraries in SWIFTLIB_SINGLE_LINK_LIBRARIES,


build: link to ICU by full path on Android

Use the variable that holds the path to the ICU libraries to link
against ICU rather than hardcoding the names.  This restores control to
the ICU linking to the way that traditional CMake `find_package` based
linking works.

--- cmake/modules/AddSwift.cmake
+++ cmake/modules/AddSwift.cmake
@@ -462,9 +462,10 @@
     list(APPEND link_libraries "bsd" "atomic")
     list(APPEND result "-Wl,-Bsymbolic")
   elseif("${LFLAGS_SDK}" STREQUAL "ANDROID")
-    list(APPEND link_libraries "dl" "log" "atomic" "icudataswift" "icui18nswift" "icuucswift")
+    list(APPEND link_libraries "dl" "log" "atomic")
     # We need to add the math library, which is linked implicitly by libc++
     list(APPEND result "-lm")
+
     if("${LFLAGS_ARCH}" MATCHES armv7)
       set(android_libcxx_path "${SWIFT_ANDROID_NDK_PATH}/sources/cxx-stl/llvm-libc++/libs/armeabi-v7a")
     elseif("${LFLAGS_ARCH}" MATCHES aarch64)
@@ -476,8 +477,17 @@
     else()
       message(SEND_ERROR "unknown architecture (${LFLAGS_ARCH}) for android")
     endif()
-    list(APPEND link_libraries "${android_libcxx_path}/libc++abi.a")
-    list(APPEND link_libraries "${android_libcxx_path}/libc++_shared.so")
+
+    # link against the custom C++ library
+    list(APPEND link_libraries
+      ${android_libcxx_path}/libc++abi.a
+      ${android_libcxx_path}/libc++_shared.so)
+
+    # link against the ICU libraries
+    list(APPEND link_libraries
+      ${SWIFT_ANDROID_${LFLAGS_ARCH}_ICU_I18N}
+      ${SWIFT_ANDROID_${LFLAGS_ARCH}_ICU_UC})
+
     swift_android_lib_for_arch(${LFLAGS_ARCH} ${LFLAGS_ARCH}_LIB)
     foreach(path IN LISTS ${LFLAGS_ARCH}_LIB)
       list(APPEND library_search_directories ${path})


COMP: Update GROUPS organization from SlicerSALT to NIRALUser

No functional changes have been integrated.

This commit is a follow-up of 5976e6fb8 where the organization was
switched to `SlicerSALT` organization due to the lack of merge right for
the projects `GROUPS` and `RigidAlignment` associated with the `NIRALUser`
organization.

--- SuperBuild.cmake
+++ SuperBuild.cmake
@@ -38,8 +38,8 @@
 set(${extension_name}_SOURCE_DIR "${CMAKE_BINARY_DIR}/${extension_name}")
 FetchContent_Populate(${extension_name}
   SOURCE_DIR     ${${extension_name}_SOURCE_DIR}
-  GIT_REPOSITORY ${EP_GIT_PROTOCOL}://github.com/SlicerSALT/GROUPS.git
-  GIT_TAG        388eacafbd09441a09f7bb072bf5b44594fd2395 # spharmpdm-2021-05-43e7eef5f
+  GIT_REPOSITORY ${EP_GIT_PROTOCOL}://github.com/NIRALUser/GROUPS.git
+  GIT_TAG        9573229937eeca85bb671d1c466bd7cebca27740 # master
   GIT_PROGRESS   1
   QUIET
   )


COMP: Fix ENABLE_SHARED variable name

COMP: Fix ENABLE_SHARED variable name

ENABLED -> ENABLE to match required syntax
for the module.

Change-Id: I6dfa8005ea51f4664031f7eabf545e207a4de2f9

--- Modules/Filtering/FFT/itk-module.cmake
+++ Modules/Filtering/FFT/itk-module.cmake
@@ -6,7 +6,7 @@
 implementation you must comply with the GPL license.")

 if( ITK_USE_FFTWF OR ITK_USE_FFTWD )
-  set(FFT_ENABLED_SHARED "ENABLED_SHARED")
+  set(FFT_ENABLE_SHARED "ENABLE_SHARED")
 endif()

 itk_module(ITKFFT


[cmake] Ignore required explicit availability in Swift stdlib

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

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


Fix for MSVC build : support non-defined OCE_VERSION_PATCH in RC file

--- Version.rc.cmake
+++ Version.rc.cmake
@@ -1,8 +1,21 @@
 #include <winresrc.h>

+#cmakedefine OCE_VERSION_PATCH
+#define OCE_VERSION_PATCH_VAL @OCE_VERSION_PATCH@
+
+/* If patch is not defined at project level, here is defined to 0 */
+#ifndef OCE_VERSION_PATCH
+#define OCE_VERSION_PATCH_VAL 0
+#endif
+
+/* Stringify OCE_VERSION_PATCH */
+#define QU(x) #x
+#define QUH(x) QU(x)
+#define OCE_VERSION_PATCH_STR QUH(OCE_VERSION_PATCH_VAL)
+
 VS_VERSION_INFO VERSIONINFO
-  FILEVERSION @OCE_VERSION_MAJOR@,@OCE_VERSION_MINOR@,@OCE_VERSION_PATCH@,0
-  PRODUCTVERSION @OCE_VERSION_MAJOR@,@OCE_VERSION_MINOR@,@OCE_VERSION_PATCH@,0
+  FILEVERSION @OCE_VERSION_MAJOR@,@OCE_VERSION_MINOR@,OCE_VERSION_PATCH_VAL,0
+  PRODUCTVERSION @OCE_VERSION_MAJOR@,@OCE_VERSION_MINOR@,OCE_VERSION_PATCH_VAL,0
   FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
 #ifndef DEBUG
   FILEFLAGS 0
@@ -30,12 +43,12 @@
       BLOCK "04090000"
       BEGIN
         VALUE "FileDescription", "OpenCascade Community Edition"
-        VALUE "FileVersion", "@OCE_VERSION_MAJOR@.@OCE_VERSION_MINOR@.@OCE_VERSION_PATCH@"
+        VALUE "FileVersion", "@OCE_VERSION_MAJOR@.@OCE_VERSION_MINOR@." OCE_VERSION_PATCH_STR
         VALUE "InternalName", "@PROJECT_NAME@"
         VALUE "LegalCopyright", ""
         VALUE "OriginalFilename", ""
         VALUE "ProductName", "@PROJECT_NAME@"
-        VALUE "ProductVersion", "@OCE_VERSION_MAJOR@.@OCE_VERSION_MINOR@.@OCE_VERSION_PATCH@"
+        VALUE "ProductVersion", "@OCE_VERSION_MAJOR@.@OCE_VERSION_MINOR@." OCE_VERSION_PATCH_STR
       END
     END
     BLOCK "VarFileInfo"


[Input pipeline] Disable failing test on Windows while we investigate the cause.

PiperOrigin-RevId: 156331434

--- tensorflow/contrib/cmake/tf_tests.cmake
+++ tensorflow/contrib/cmake/tf_tests.cmake
@@ -215,7 +215,8 @@
       # Newly running on Windows since TensorBoard backend move. Fail on Windows and need debug.
       "${tensorflow_source_dir}/tensorflow/tensorboard/backend/event_processing/directory_watcher_test.py"
       "${tensorflow_source_dir}/tensorflow/tensorboard/backend/event_processing/event_multiplexer_test.py"
-    )
+      "${tensorflow_source_dir}/tensorflow/contrib/data/python/kernel_tests/dataset_constructor_op_test.py"  # Segfaults on Windows.
+  )
   endif()
   list(REMOVE_ITEM tf_test_src_py ${tf_test_src_py_exclude})


Don't write STOP lines.

Don't write STOP lines.

--- BlueBerry/CMake/FunctionCreateProvisioningInfo.cmake
+++ BlueBerry/CMake/FunctionCreateProvisioningInfo.cmake
@@ -10,8 +10,8 @@

     if(${${plugin_name_with_dirs}_option_name})
       set(out_var "${out_var}\nSTART ${plugin_url}")
-    else()
-      set(out_var "${out_var}\nSTOP ${plugin_url}")
+    #else()
+    #  set(out_var "${out_var}\nSTOP ${plugin_url}")
     endif()
   endforeach()


:lipstick: Add comment

:lipstick: Add comment

--- scripts/EnvironmentScript.cmake
+++ scripts/EnvironmentScript.cmake
@@ -43,6 +43,7 @@
     if(NOT env_EXECUTABLE)
         set(env_EXECUTABLE "")
     endif()
+    # used in the configured script: if set, modifies python path
     if(NOT env_PYTHON)
         set(env_PYTHON "")
     endif()


ENH: Test whether VTK_MAKE_INSTANTIATOR command exists and set the corresponding variable.  This allows the instantiator registration with vtkInstantiator when CMake supports it.

--- vtkCMakeOptions.cmake
+++ vtkCMakeOptions.cmake
@@ -154,4 +154,6 @@
   ENDIF (JAVA_AWT_INCLUDE_PATH)
 ENDIF (VTK_WRAP_JAVA)

-
+IF(COMMAND VTK_MAKE_INSTANTIATOR)
+  SET(VTK_MAKE_INSTANTIATOR 1)
+ENDIF(COMMAND VTK_MAKE_INSTANTIATOR)


Fix fmt detector

Fix fmt detector

--- project/cmake/ProjectBuildOption.cmake
+++ project/cmake/ProjectBuildOption.cmake
@@ -323,7 +323,7 @@
         set(LIBATFRAME_UTILS_TEST_FMT_BACKUP_CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES})
         set(CMAKE_REQUIRED_LIBRARIES ${LIBATFRAME_UTILS_FMT_TARGET})
         check_cxx_source_compiles("
-        #include <fmt/format>
+        #include <fmt/format.h>
         #include <iostream>
         #include <string>
         int main() {


precompiled_libs.cmake/windows: update library names to support the last set of pre-compiled libraries.

Since we no longer have libs for 2013, support is dropped from cmake as well.

--- src/cmake/precompiled_libs.cmake
+++ src/cmake/precompiled_libs.cmake
@@ -16,17 +16,13 @@
 	set(_lib_DIR "${CMAKE_SOURCE_DIR}/../lib/darwin-9.x.universal")
 elseif(WIN32)
 	if(CMAKE_CL_64)
-		if(MSVC12)
-			set(_lib_DIR "${CMAKE_SOURCE_DIR}/../lib/win64_vc12")
-		elseif(MSVC14)
+		if(MSVC14)
 			set(_lib_DIR "${CMAKE_SOURCE_DIR}/../lib/win64_vc14")
 		else()
 			message(FATAL_ERROR "Unsupported Visual Studio Version")
 		endif()
 	else()
-		if(MSVC12)
-			set(_lib_DIR "${CMAKE_SOURCE_DIR}/../lib/windows_vc12")
-		elseif(MSVC14)
+		if(MSVC14)
 			set(_lib_DIR "${CMAKE_SOURCE_DIR}/../lib/windows_vc14")
 		else()
 			message(FATAL_ERROR "Unsupported Visual Studio Version")
@@ -48,7 +44,7 @@
 set(PNG_LIBRARIES "${_lib_DIR}/png/lib/libpng${CMAKE_STATIC_LIBRARY_SUFFIX}")
 set(JPEG_LIBRARIES "${_lib_DIR}/jpeg/lib/libjpeg${CMAKE_STATIC_LIBRARY_SUFFIX}")
 if (MSVC)
-	set(JPEG_LIBRARIES ${JPEG_LIBRARIES};${_lib_DIR}/openjpeg/lib/openjpeg.lib)
+	set(JPEG_LIBRARIES ${JPEG_LIBRARIES};${_lib_DIR}/openjpeg/lib/openjp2.lib)
 endif()
 # TODO(sergey): Move naming to a consistent state.
 set(TIFF_LIBRARY "${_lib_DIR}/tiff/lib/libtiff${CMAKE_STATIC_LIBRARY_SUFFIX}")
@@ -126,24 +122,24 @@
 	)

 	set(OPENEXR_IEX_LIBRARY
-		optimized ${OPENEXR_ROOT_DIR}/lib/Iex-2_2.lib
-		debug ${OPENEXR_ROOT_DIR}/lib/Iex-2_2_d.lib
+		optimized ${OPENEXR_ROOT_DIR}/lib/Iex_s.lib
+		debug ${OPENEXR_ROOT_DIR}/lib/Iex_s_d.lib
 	)
 	set(OPENEXR_HALF_LIBRARY
-		optimized ${OPENEXR_ROOT_DIR}/lib/Half.lib
-		debug ${OPENEXR_ROOT_DIR}/lib/Half_d.lib
+		optimized ${OPENEXR_ROOT_DIR}/lib/Half_s.lib
+		debug ${OPENEXR_ROOT_DIR}/lib/Half_s_d.lib
 	)
 	set(OPENEXR_ILMIMF_LIBRARY
-		optimized ${OPENEXR_ROOT_DIR}/lib/IlmImf-2_2.lib
-		debug ${OPENEXR_ROOT_DIR}/lib/IlmImf-2_2_d.lib
+		optimized ${OPENEXR_ROOT_DIR}/lib/IlmImf_s.lib
+		debug ${OPENEXR_ROOT_DIR}/lib/IlmImf_s_d.lib
 	)
 	set(OPENEXR_IMATH_LIBRARY
-		optimized ${OPENEXR_ROOT_DIR}/lib/Imath-2_2.lib
-		debug ${OPENEXR_ROOT_DIR}/lib/Imath-2_2_d.lib
+		optimized ${OPENEXR_ROOT_DIR}/lib/Imath_s.lib
+		debug ${OPENEXR_ROOT_DIR}/lib/Imath_s_d.lib
 	)
 	set(OPENEXR_ILMTHREAD_LIBRARY
-		optimized ${OPENEXR_ROOT_DIR}/lib/IlmThread-2_2.lib
-		debug ${OPENEXR_ROOT_DIR}/lib/IlmThread-2_2_d.lib
+		optimized ${OPENEXR_ROOT_DIR}/lib/IlmThread_s.lib
+		debug ${OPENEXR_ROOT_DIR}/lib/IlmThread_s_d.lib
 	)
 endif()


some more dir to find the libraries

some more dir to find the libraries

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

--- Numerics/cmake/FortranLibraries.cmake
+++ Numerics/cmake/FortranLibraries.cmake
@@ -86,7 +86,11 @@

     IF(NOT FORT_LIBS_WORK)
       # let's find it in some potentiallink directories
-      FILE(GLOB _LIBDIRS_MAYBE /lib /usr/lib /lib/* /usr/*/lib /usr/lib/* /opt/lib /opt/*/lib)
+      FILE(GLOB _LIBDIRS_MAYBE
+        /lib /lib/*
+        /usr/lib /usr/*/lib /usr/lib/*
+        /usr/local/lib /usr/local/*/lib /usr/local/lib/*
+        /opt/lib /opt/*/lib /opt/lib/*)
       FOREACH(_F ${_LIBDIRS_MAYBE})
         IF(IS_DIRECTORY ${_F})
           LIST(APPEND _LIBDIRS ${_F})


COMP: do not use -Wlong-long flag

COMP: do not use -Wlong-long flag

The intrinsic type "long long" was introduced in C99 but not in the
C++x03 standard. ITK optionally supports the "long long" type by
testing with CMake try_compiles and other techniques. Therefore, ITK
should not warn when long long is used.

Change-Id: I78847bf60be6eb1610225a8fc6c03a3cacd8dda8

--- CMake/ITKSetStandardCompilerFlags.cmake
+++ CMake/ITKSetStandardCompilerFlags.cmake
@@ -80,7 +80,6 @@
     -Wextra
     -Wformat=2
     -Winvalid-pch
-    -Wlong-long
     -Wno-format-nonliteral
     -Wpointer-arith
     -Wshadow


start 3.7.0

start 3.7.0

--- CMake/Mathematica/FindMathematica.cmake
+++ CMake/Mathematica/FindMathematica.cmake
@@ -34,7 +34,7 @@
 cmake_policy(POP)

 set (Mathematica_CMAKE_MODULE_DIR "${CMAKE_CURRENT_LIST_DIR}")
-set (Mathematica_CMAKE_MODULE_VERSION "3.6.0")
+set (Mathematica_CMAKE_MODULE_VERSION "3.7.0")

 # activate select policies
 if (POLICY CMP0025)


Fix ABSL_RANDOM_RANDEN_COPTS setting on FreeBSD (#664)

* Fix build on FreeBSD

On FreeBSD amd64, both uname -p and uname -m returns amd64 (lowercase).
It seems Windows returns AMD64 (uppercase).

Reference:
[1] https://cmake.org/cmake/help/latest/variable/CMAKE_SYSTEM_PROCESSOR.html
[2] https://cmake.org/cmake/help/latest/variable/CMAKE_HOST_SYSTEM_PROCESSOR.html

* Use MATCHES for multiple values

--- absl/copts/AbseilConfigureCopts.cmake
+++ absl/copts/AbseilConfigureCopts.cmake
@@ -12,7 +12,7 @@
   set(ABSL_BUILD_DLL FALSE)
 endif()

-if("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "x86_64" OR "${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "AMD64")
+if("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "x86_64|amd64|AMD64")
   if (MSVC)
     set(ABSL_RANDOM_RANDEN_COPTS "${ABSL_RANDOM_HWAES_MSVC_X64_FLAGS}")
   else()


Removed EAGLE_ADD_ON dependency

Removed EAGLE_ADD_ON dependency

Signed-off-by: Mark Charlebois <f1891e7fc976ae1bd489627e2954fb730751d728@gmail.com>

--- cmake/configs/qurt_eagle_release.cmake
+++ cmake/configs/qurt_eagle_release.cmake
@@ -1,10 +1,10 @@
 include(qurt/px4_impl_qurt)

-if ("$ENV{EAGLE_ADDON_ROOT}" STREQUAL "")
-	message(FATAL_ERROR "Enviroment variable EAGLE_ADDON_ROOT must be set")
-else()
-	set(EAGLE_ADDON_ROOT $ENV{EAGLE_ADDON_ROOT})
-endif()
+#if ("$ENV{EAGLE_ADDON_ROOT}" STREQUAL "")
+#	message(FATAL_ERROR "Enviroment variable EAGLE_ADDON_ROOT must be set")
+#else()
+#	set(EAGLE_ADDON_ROOT $ENV{EAGLE_ADDON_ROOT})
+#endif()

 if ("$ENV{HEXAGON_SDK_ROOT}" STREQUAL "")
 	message(FATAL_ERROR "Enviroment variable HEXAGON_SDK_ROOT must be set")
@@ -21,8 +21,12 @@
 STRING(REGEX REPLACE "//" "/" EAGLE_DRIVERS_SRC ${EAGLE_DRIVERS_SRC})
 STRING(REGEX REPLACE "/" "__" EAGLE_DRIVERS_MODULE_PREFIX ${EAGLE_DRIVERS_SRC})

-include_directories(${EAGLE_ADDON_ROOT}/flight_controller/hexagon/inc)
-include_directories(${HEXAGON_SDK_ROOT}/lib/common/qurt/ADSPv5MP/include)
+#include_directories(${EAGLE_ADDON_ROOT}/flight_controller/hexagon/inc)
+include_directories(
+	${HEXAGON_SDK_ROOT}/inc
+	${HEXAGON_SDK_ROOT}/inc/stddef
+	${HEXAGON_SDK_ROOT}/lib/common/qurt/ADSPv5MP/include
+	)

 message("hexagon_sdk_root is ${HEXAGON_SDK_ROOT}")

@@ -30,9 +34,9 @@

 set(CONFIG_SHMEM "1")

+#-L${EAGLE_ADDON_ROOT}/flight_controller/hexagon/libs
 # For Actual flight we need to link against the driver dynamic libraries
 set(target_libraries
-	-L${EAGLE_ADDON_ROOT}/flight_controller/hexagon/libs
 	mpu9x50
 	uart_esc
 	csr_gps
@@ -49,10 +53,10 @@
 	#
 	drivers/device
 	modules/sensors
-	${EAGLE_DRIVERS_SRC}/mpu9x50
+	#${EAGLE_DRIVERS_SRC}/mpu9x50
 	${EAGLE_DRIVERS_SRC}/uart_esc
-	${EAGLE_DRIVERS_SRC}/rc_receiver
-	${EAGLE_DRIVERS_SRC}/csr_gps
+	#${EAGLE_DRIVERS_SRC}/rc_receiver
+	#${EAGLE_DRIVERS_SRC}/csr_gps

 	#
 	# System commands


Fix luajit build

Fix luajit build

Build options were not taken into account correctly.

--- external/luajit/luajit.cmake
+++ external/luajit/luajit.cmake
@@ -7,7 +7,6 @@

 set(LUAJIT_CFLAGS -fPIC -DLUAJIT_ENABLE_LUA52COMPAT)
 set(LUAJIT_CCDEBUG "")
-set(LUAJIT_MAKE_OPT CFLAGS="${LUAJIT_CFLAGS}" CCDEBUG="${LUAJIT_CCDEBUG}" PREFIX=${INSTALL_FULLDIR} )

 if(NOT ${CMAKE_HOST_SYSTEM_PROCESSOR} STREQUAL "x86_64")
 	# Force external unwinding
@@ -30,6 +29,8 @@
 else()
 	set(LUAJIT_CFLAGS ${LUAJIT_CFLAGS} -O2)
 endif()
+
+set(LUAJIT_MAKE_OPT CFLAGS="${LUAJIT_CFLAGS}" CCDEBUG="${LUAJIT_CCDEBUG}" PREFIX=${INSTALL_FULLDIR} )

 execute_process(COMMAND mkdir -p ${CMAKE_BINARY_DIR}/${LUAJIT_DIR})
 execute_process(COMMAND echo ${LUAJIT_MAKE_OPT} OUTPUT_FILE ${CMAKE_BINARY_DIR}/${LUAJIT_DIR}/cmake.tmp)


SuperBuild: apply patch on windows. problem was git version 1.9.1preview

--- SuperBuild/CMake/External_openjpeg.cmake
+++ SuperBuild/CMake/External_openjpeg.cmake
@@ -40,8 +40,4 @@
 SUPERBUILD_UPDATE_CMAKE_VARIABLES(OPENJPEG FALSE)

 #Apply patches to openjpeg (for now Even Roualt optim)
-#cannot apply on windows.
-#There is an issue with CLRF and patch from github
-if(NOT MSVC)
 SUPERBUILD_PATCH_SOURCE(OPENJPEG)
-endif()


COMP: Removed tests for they do not run correctly

--- Modules/ToFHardware/Testing/files.cmake
+++ Modules/ToFHardware/Testing/files.cmake
@@ -4,10 +4,10 @@
   mitkToFCameraMITKPlayerDeviceTest.cpp
   mitkToFCameraPMDCamBoardControllerTest.cpp
   mitkToFCameraPMDCamBoardDeviceTest.cpp
-  mitkToFCameraPMDRawDataCamBoardDeviceTest.cpp
+  #mitkToFCameraPMDRawDataCamBoardDeviceTest.cpp
   mitkToFCameraPMDCamCubeControllerTest.cpp
   mitkToFCameraPMDCamCubeDeviceTest.cpp
-  mitkToFCameraPMDRawDataCamCubeDeviceTest.cpp
+  #mitkToFCameraPMDRawDataCamCubeDeviceTest.cpp
   mitkToFCameraPMDControllerTest.cpp
   mitkToFCameraPMDDeviceTest.cpp
   mitkToFCameraPMDRawDataDeviceTest.cpp


[Build] Fixed a packaging issue about the INSTALL file when not existing.

--- config/project_config_embeddable.cmake
+++ config/project_config_embeddable.cmake
@@ -104,7 +104,11 @@

   ##
   # Basic documentation (i.e., AUTHORS, NEWS, README, INSTALL)
-  set (BASICDOC_FILES AUTHORS NEWS README INSTALL)
+  set (DOC_INSTALL_FILE INSTALL)
+  if (NOT EXISTS ${DOC_INSTALL_FILE})
+    unset (DOC_INSTALL_FILE)
+  endif (NOT EXISTS ${DOC_INSTALL_FILE})
+  set (BASICDOC_FILES AUTHORS NEWS README ${DOC_INSTALL_FILE})
   set (BASICDOC_PATH "share/doc/${PACKAGE}-${PACKAGE_VERSION}")

 endmacro (set_project_options)


[Config] (hopefully) better detection of Boost.Python across platforms

--- config/project_config_embeddable.cmake
+++ config/project_config_embeddable.cmake
@@ -504,7 +504,7 @@
 	  set (PY_MINOR_VERSION "${CMAKE_MATCH_2}")
 	  set (PY_PATCH_VERSION "${CMAKE_MATCH_3}")
 	endif (${PYTHONLIBS_VERSION_STRING} MATCHES "([0-9]).([0-9]).([0-9])")
-
+
 	message (STATUS "Found PythonLibs ${PYTHONLIBS_VERSION} (${PYTHONLIBS_VERSION_STRING} / ${PY_MAJOR_VERSION}.${PY_MINOR_VERSION}.${PY_PATCH_VERSION})")

 	# Set the Python installation directory
@@ -585,15 +585,15 @@
 macro (register_boost_lib _boost_lib_list_name _boost_lib_list)
   # Update the list of library dependencies for the project
   foreach (_lib_cpt ${_boost_lib_list})
-	string (TOUPPER ${_lib_cpt} _lib_cpt_up)
-
-	if (Boost_${_lib_cpt_up}_LIBRARY)
-	  # Update the list of dependencies for the project
-	  list (APPEND ${_boost_lib_list_name} ${Boost_${_lib_cpt_up}_LIBRARY})
-
-	  # Update the list of libraries to be displayed
-	  list (APPEND BOOST_REQUIRED_LIBS ${Boost_${_lib_cpt_up}_LIBRARY})
-	endif (Boost_${_lib_cpt_up}_LIBRARY)
+    string (TOUPPER ${_lib_cpt} _lib_cpt_up)
+
+    if (Boost_${_lib_cpt_up}_LIBRARY)
+      # Update the list of dependencies for the project
+      list (APPEND ${_boost_lib_list_name} ${Boost_${_lib_cpt_up}_LIBRARY})
+
+      # Update the list of libraries to be displayed
+      list (APPEND BOOST_REQUIRED_LIBS ${Boost_${_lib_cpt_up}_LIBRARY})
+    endif (Boost_${_lib_cpt_up}_LIBRARY)
   endforeach (_lib_cpt ${_boost_lib_list})
 endmacro (register_boost_lib _boost_lib_list_name _boost_lib_list)

@@ -606,18 +606,26 @@
   else (${ARGC} GREATER 0)
     message (STATUS "Requires Boost without specifying any version")
   endif (${ARGC} GREATER 0)
-
+
   #
-  # Note: ${Boost_DATE_TIME_LIBRARY} and ${Boost_PROGRAM_OPTIONS_LIBRARY}
-  # are already set by ${SOCIMYSQL_LIBRARIES} and/or ${SOCI_LIBRARIES}.
-  #
-  set (python_component_name "python${PY_MAJOR_VERSION}${PY_MINOR_VERSION}")
+  # Note 1: ${Boost_DATE_TIME_LIBRARY} and ${Boost_PROGRAM_OPTIONS_LIBRARY}
+  #         are already set by ${SOCIMYSQL_LIBRARIES} and/or ${SOCI_LIBRARIES}.
+  # Note 2: Boost libraries are not installed in a consistent way across the
+  #         the different platforms and versions of Boost.
+  #         For a while, the Boost.Python library component was just called
+  #         'python'. It is now suffixed with the version of Python, and
+  #         on some Linux distributions, there is even a '-py' suffix.
+  #         On some platform/Boost version combinations, the Python version
+  #         may be just the major version (2 or 3 as of 2019) or the major
+  #         and minor versions (e.g., 27, 28, 34, 36, 37 as of 2019)
+  set (python_cpt_name1 "python${PY_MAJOR_VERSION}")
+  set (python_cpt_name2 "python${PY_MAJOR_VERSION}${PY_MINOR_VERSION}")
   set (Boost_USE_STATIC_LIBS OFF)
   set (Boost_USE_MULTITHREADED ON)
   set (Boost_USE_STATIC_RUNTIME OFF)
   set (BOOST_REQUIRED_COMPONENTS_FOR_LIB
     date_time random iostreams serialization filesystem system
-	locale ${python_component_name} regex)
+    locale ${python_cpt_name1} ${python_cpt_name2} regex)
   set (BOOST_REQUIRED_COMPONENTS_FOR_BIN program_options)
   set (BOOST_REQUIRED_COMPONENTS_FOR_TST unit_test_framework)
   set (BOOST_REQUIRED_COMPONENTS ${BOOST_REQUIRED_COMPONENTS_FOR_LIB}
@@ -637,23 +645,28 @@
   find_package (BoostWrapper ${_required_version} REQUIRED)

   if (Boost_FOUND)
+    # Boost.Python library
+    message (STATUS "  + Boost_PYTHON_LIBRARY: ${Boost_PYTHON_LIBRARY}")
+    message (STATUS "  + Boost_PYTHON3_LIBRARY: ${Boost_PYTHON3_LIBRARY}")
+    message (STATUS "  + Boost_PYTHON37_LIBRARY: ${Boost_PYTHON37_LIBRARY}")
+
     # Update the list of include directories for the project
     include_directories (${Boost_INCLUDE_DIRS})

-	# For display purposes
+    # For display purposes
     set (BOOST_REQUIRED_LIBS "")

     # Update the list of library dependencies for the project
-	register_boost_lib ("PROJ_DEP_LIBS_FOR_LIB"
-	  "${BOOST_REQUIRED_COMPONENTS_FOR_LIB}")
+    register_boost_lib ("PROJ_DEP_LIBS_FOR_LIB"
+      "${BOOST_REQUIRED_COMPONENTS_FOR_LIB}")

     # Update the list of binary dependencies for the project
-	register_boost_lib ("PROJ_DEP_LIBS_FOR_BIN"
-	  "${BOOST_REQUIRED_COMPONENTS_FOR_BIN}")
+    register_boost_lib ("PROJ_DEP_LIBS_FOR_BIN"
+      "${BOOST_REQUIRED_COMPONENTS_FOR_BIN}")

     # Update the list of test dependencies for the project
-	register_boost_lib ("PROJ_DEP_LIBS_FOR_TST"
-	  "${BOOST_REQUIRED_COMPONENTS_FOR_TST}")
+    register_boost_lib ("PROJ_DEP_LIBS_FOR_TST"
+      "${BOOST_REQUIRED_COMPONENTS_FOR_TST}")

   endif (Boost_FOUND)


COMP: On some project configure may not copy right away

--- Utilities/kwsys/CheckCXXSourceRuns.cmake
+++ Utilities/kwsys/CheckCXXSourceRuns.cmake
@@ -30,7 +30,7 @@
     ENDIF(CMAKE_REQUIRED_INCLUDES)
     SET(CMAKE_EMPTY_INPUT_FILE_CONTENT "${SOURCE}")
     CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/CMakeEmptyInputFile.in"
-      "${CMAKE_BINARY_DIR}/CMakeFiles/CMakeTmp/src.cxx")
+      "${CMAKE_BINARY_DIR}/CMakeFiles/CMakeTmp/src.cxx" IMMEDIATE)

     MESSAGE(STATUS "Performing Test ${COMMENT}")
     TRY_RUN(${VAR} HAVE_${VAR}


Fix dependency resolution for applications.

--- BdeBuildSystem/BdeTargetUtils.cmake
+++ BdeBuildSystem/BdeTargetUtils.cmake
@@ -516,8 +516,6 @@
         else()
             add_library(${lib_target} INTERFACE)

-            bbs_import_target_dependencies(${lib_target} "${${uor_name}_PCDEPS}")
-
             target_link_libraries(${lib_target} INTERFACE ${${uor_name}_PCDEPS})
             bbs_add_target_include_dirs(${lib_target} INTERFACE ${${uor_name}_INCLUDE_DIRS})

@@ -533,6 +531,8 @@
             endforeach()
         endif()

+        bbs_import_target_dependencies(${lib_target} "${${uor_name}_PCDEPS}")
+
         # Build the main source and link against the private library
         set_target_properties(${target} PROPERTIES LINKER_LANGUAGE CXX)
         target_sources(${target} PRIVATE ${${uor_name}_MAIN_SOURCE})


Use default _ITERATOR_DEBUG_LEVEL in Visual Studio

--- CMakeModules/CompilerSettings.cmake
+++ CMakeModules/CompilerSettings.cmake
@@ -6,7 +6,7 @@
 endif()

 if(MSVC OR MSVC90 OR MSVC10)
-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc /MP /W1 /D_ITERATOR_DEBUG_LEVEL=0")
+    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc /MP /W1")
 endif(MSVC OR MSVC90 OR MSVC10)

 if(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")


Fix a WinDDK include path detection issue

--- CMake/FindWinDDK.cmake
+++ CMake/FindWinDDK.cmake
@@ -47,7 +47,7 @@
 # Search for header files

 SET(WINDDK_INCLUDE_SEARCH_DIRS ${WINDDK_DIR}/inc )
-FIND_PATH(WINDDK_INCLUDE_DIR api #hidpi.h
+FIND_PATH(WINDDK_INCLUDE_DIR api/hidpi.h
 	PATHS ${WINDDK_INCLUDE_SEARCH_DIRS} )
 SET(WINDDK_INCLUDE_DIR ${WINDDK_INCLUDE_DIR}
 	CACHE STRING "Directory containing Ms WinDDK header files")


Add todo for removing dependency on curl.

--- external/Swig.cmake
+++ external/Swig.cmake
@@ -33,6 +33,8 @@
         ${PROJECT_SOURCE_DIR}/${PLATFORM}${BITNESS}/bin/swig.exe)
     set(SWIG_DIR ${PROJECT_SOURCE_DIR}/common/share/swig/3.0.2)
   else()
+    # TODO: Remove dependency on curl by using native CMake functionality for
+    # fetching pcre.
     ExternalProject_Add(
       Swig
       URL http://prdownloads.sourceforge.net/swig/swig-3.0.2.tar.gz


fix VS2015 logic

fix VS2015 logic

--- connext_cmake_module/cmake/Modules/FindConnext.cmake
+++ connext_cmake_module/cmake/Modules/FindConnext.cmake
@@ -133,7 +133,7 @@
     endif()
     if(match AND WIN32)
       string(FIND "${library}" "VS2015/" _found)
-      if(NOT ${_found} EQUAL -1)
+      if(${_found} EQUAL -1)
         set(match FALSE)
       endif()
     endif()


Update parallel make build process.

Update parallel make build process.

--- src/inserts/build.cmake
+++ src/inserts/build.cmake
@@ -55,6 +55,16 @@
     set(ERROR_QUIET ERROR_QUIET)
 endif()

+# TODO: maybe provide better way of parallel build
+# from cppan's build() call
+# Q: how to pass -j options to cmake --build?
+# A: cmake --build .  *more args* -- -jN
+# maybe add similar options to cppan? '-- pass all args after two dashes to cmake build'
+set(parallel)
+if (MULTICORE)
+    set(parallel -j${N_CORES})
+endif()
+
 if (CONFIG)
     if (NOT DEFINED make OR
         "${make}" STREQUAL "" OR
@@ -100,9 +110,9 @@
                 )
         endif()
     else()
-        cppan_debug_message("COMMAND make -j${N_CORES} -C ${BUILD_DIR}")
+        cppan_debug_message("COMMAND make ${parallel} -C ${BUILD_DIR}")
         execute_process(
-            COMMAND make -j${N_CORES} -C ${BUILD_DIR}
+            COMMAND make ${parallel} -C ${BUILD_DIR}
             ${OUTPUT_QUIET}
             ${ERROR_QUIET}
             RESULT_VARIABLE ret
@@ -120,9 +130,9 @@
             RESULT_VARIABLE ret
         )
     else()
-        cppan_debug_message("COMMAND make -j${N_CORES} -C ${BUILD_DIR}")
+        cppan_debug_message("COMMAND make ${parallel} -C ${BUILD_DIR}")
         execute_process(
-            COMMAND make -j${N_CORES} -C ${BUILD_DIR}
+            COMMAND make ${parallel} -C ${BUILD_DIR}
             ${OUTPUT_QUIET}
             ${ERROR_QUIET}
             RESULT_VARIABLE ret


Moved the find for WMS to OssimWMS

Moved the find for WMS to OssimWMS

--- cmake/CMakeModules/FindWMS.cmake
+++ cmake/CMakeModules/FindWMS.cmake
@@ -1,48 +0,0 @@
-# - Find wms library
-# Find the native wms includes and library
-# This module defines
-#  WMS_INCLUDE_DIR, where to find tiff.h, etc.
-#  WMS_LIBRARIES, libraries to link against to use WMS.
-#  WMS_FOUND, If false, do not try to use WMS.
-# also defined, but not for general use are
-#  WMS_LIBRARY, where to find the WMS library.
-SET(CMAKE_FIND_FRAMEWORK "LAST")
-FIND_PATH(WMS_INCLUDE_DIR wms/wms.h
-	HINTS
-		$ENV{OSSIM_DEV_HOME}/libwms/include
-		$ENV{OSSIM_DEV_HOME}/libwms/lib
-		$ENV{OSSIM_INSTALL_PREFIX}/include
-	PATHS
-		$ENV{OSSIM_DEV_HOME}/libwms
-		$ENV{OSSIM_INSTALL_PREFIX}
-    	PATH_SUFFIXES
-		lib
-		include
-
-)
-
-SET(WMS_NAMES ${WMS_NAMES} wms libwms)
-FIND_LIBRARY(WMS_LIBRARY NAMES ${WMS_NAMES}
-	HINTS
-		$ENV{OSSIM_DEV_HOME}/liwms/lib
-		$ENV{OSSIM_DEV_HOME}/libwms
-		$ENV{OSSIM_INSTALL_PREFIX}
-	PATHS
-		$ENV{OSSIM_DEV_HOME}/libwms/lib
-		$ENV{OSSIM_DEV_HOME}/libwms
-		$ENV{OSSIM_INSTALL_PREFIX}
-    	PATH_SUFFIXES
-		lib
-		Frameworks
-)
-
-# handle the QUIETLY and REQUIRED arguments and set WMS_FOUND to TRUE if
-# all listed variables are TRUE
-INCLUDE(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(WMS  DEFAULT_MSG  WMS_LIBRARY  WMS_INCLUDE_DIR)
-
-IF(WMS_FOUND)
-  SET( WMS_LIBRARIES ${WMS_LIBRARY} )
-ENDIF(WMS_FOUND)
-
-MARK_AS_ADVANCED(WMS_INCLUDE_DIR WMS_LIBRARY)


cmake: fix building without BINDINGS

cmake: fix building without BINDINGS

fix #793
thanks to @KurtMi

--- cmake/Modules/LibAddMacros.cmake
+++ cmake/Modules/LibAddMacros.cmake
@@ -481,12 +481,14 @@
 endmacro()

 macro(removal ELEMENTS TO_REMOVE_ELEMENTS)
-	set(MY_ELEMENTS ${${ELEMENTS}})
-	list(REMOVE_DUPLICATES MY_ELEMENTS)
-	foreach(B ${${TO_REMOVE_ELEMENTS}})
-		list(REMOVE_ITEM MY_ELEMENTS ${B})
-	endforeach(B)
-	set(${ELEMENTS} ${MY_ELEMENTS})
+	if (${ELEMENTS})
+		set (MY_ELEMENTS ${${ELEMENTS}})
+		list (REMOVE_DUPLICATES MY_ELEMENTS)
+		foreach (B ${${TO_REMOVE_ELEMENTS}})
+			list (REMOVE_ITEM MY_ELEMENTS ${B})
+		endforeach (B)
+		set (${ELEMENTS} ${MY_ELEMENTS})
+	endif ()
 endmacro()


CMake: Stylistic fixes

CMake: Stylistic fixes

--- cmake/modules/FindSUNDIALS.cmake
+++ cmake/modules/FindSUNDIALS.cmake
@@ -27,61 +27,37 @@

 DEAL_II_FIND_LIBRARY(SUNDIALS_LIB_IDA NAMES sundials_ida
   HINTS ${SUNDIALS_DIR}
-  PATH_SUFFIXES lib
+  PATH_SUFFIXES lib${LIB_SUFFIX} lib64 lib
   )

 DEAL_II_FIND_LIBRARY(SUNDIALS_LIB_KINSOL NAMES sundials_kinsol
   HINTS ${SUNDIALS_DIR}
-  PATH_SUFFIXES lib
+  PATH_SUFFIXES lib${LIB_SUFFIX} lib64 lib
   )

 DEAL_II_FIND_LIBRARY(SUNDIALS_LIB_SER NAMES sundials_nvecserial
   HINTS ${SUNDIALS_DIR}
-  PATH_SUFFIXES lib
+  PATH_SUFFIXES lib${LIB_SUFFIX} lib64 lib
   )

 SET(SUN_INC "${SUNDIALS_DIR}/include")

+SET(_sundials_additional_libs)
 IF(DEAL_II_WITH_MPI)
   DEAL_II_FIND_LIBRARY(SUNDIALS_LIB_PAR NAMES sundials_nvecparallel
     HINTS ${SUNDIALS_DIR}
-    PATH_SUFFIXES lib
+    PATH_SUFFIXES lib${LIB_SUFFIX} lib64 lib
     )
+  SET(_sundials_additional_libs SUNDIALS_LIB_PAR)
+ENDIF()

-  DEAL_II_PACKAGE_HANDLE(SUNDIALS
-    LIBRARIES REQUIRED
-    SUNDIALS_LIB_IDA
-    SUNDIALS_LIB_KINSOL
-    SUNDIALS_LIB_SER
-    SUNDIALS_LIB_PAR
-    INCLUDE_DIRS
-    REQUIRED SUN_INC
-    USER_INCLUDE_DIRS
-    REQUIRED SUN_INC
-    CLEAR
-    SUNDIALS_LIB_IDA
-    SUNDIALS_LIB_KINSOL
-    SUNDIALS_LIB_SER
-    SUNDIALS_LIB_PAR
+DEAL_II_PACKAGE_HANDLE(SUNDIALS
+  LIBRARIES REQUIRED
+    SUNDIALS_LIB_IDA SUNDIALS_LIB_KINSOL SUNDIALS_LIB_SER SUNDIALS_LIB_PAR
+    ${_sundials_additional_libs}
+  INCLUDE_DIRS REQUIRED SUN_INC
+  USER_INCLUDE_DIRS REQUIRED SUN_INC
+  CLEAR
+    SUNDIALS_LIB_IDA SUNDIALS_LIB_KINSOL SUNDIALS_LIB_SER SUNDIALS_LIB_PAR
     SUN_INC
-    )
-
-ELSE()
-
-  DEAL_II_PACKAGE_HANDLE(SUNDIALS
-    LIBRARIES REQUIRED
-    SUNDIALS_LIB_IDA
-    SUNDIALS_LIB_KINSOL
-    SUNDIALS_LIB_SER
-    INCLUDE_DIRS
-    REQUIRED SUN_INC
-    USER_INCLUDE_DIRS
-    REQUIRED SUN_INC
-    CLEAR
-    SUNDIALS_LIB_IDA
-    SUNDIALS_LIB_KINSOL
-    SUNDIALS_LIB_SER
-    SUN_INC
-    )
-
-ENDIF()
+  )


Fix microbit link circular dependency

Fix microbit link circular dependency

--- Source/PLT/target/microbit/config.cmake
+++ Source/PLT/target/microbit/config.cmake
@@ -99,4 +99,4 @@
 execute_process(COMMAND ${CMAKE_C_COMPILER} -mcpu=cortex-m0 -print-file-name=libgcc.a OUTPUT_VARIABLE gcc_lib)
 string(STRIP ${gcc_lib} gcc_lib)

-set(PLT_libs tinyc ${gcc_lib})
+set(PLT_libs tinyc PLT ${gcc_lib})


Fix CMake proto_path

Fix CMake proto_path

--- cmake/cpp.cmake
+++ cmake/cpp.cmake
@@ -100,6 +100,15 @@
 set(PROTO_HDRS)
 set(PROTO_SRCS)
 file(GLOB_RECURSE proto_files RELATIVE ${PROJECT_SOURCE_DIR} "ortools/*.proto")
+
+# Get Protobuf include dir
+get_target_property(protobuf_dirs protobuf::libprotobuf INTERFACE_INCLUDE_DIRECTORIES)
+foreach(dir ${protobuf_dirs})
+	if ("${dir}" MATCHES "BUILD_INTERFACE")
+		list(APPEND PROTO_DIRS "--proto_path=${dir}")
+  endif()
+endforeach()
+
 foreach (PROTO_FILE ${proto_files})
 	#message(STATUS "protoc proto(cc): ${PROTO_FILE}")
 	get_filename_component(PROTO_DIR ${PROTO_FILE} DIRECTORY)
@@ -112,6 +121,7 @@
 		OUTPUT ${PROTO_SRC} ${PROTO_HDR}
 		COMMAND protobuf::protoc
 		"--proto_path=${PROJECT_SOURCE_DIR}"
+		"${PROTO_DIRS}"
 		"--cpp_out=${PROJECT_BINARY_DIR}"
 		${PROTO_FILE}
 		DEPENDS ${PROTO_FILE} protobuf::protoc


Regardlessly include -mt_mpi

Regardlessly include -mt_mpi

--- cmake/mpi.cmake
+++ cmake/mpi.cmake
@@ -55,6 +55,12 @@

     SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${MPI_CXX_COMPILE_FLAGS}")
     SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${MPI_CXX_LINK_FLAGS}")
+
+    IF (${CMAKE_CXX_COMPILER_ID} STREQUAL "Intel")
+      SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mt_mpi")
+      SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -mt_mpi")
+    ENDIF()
+
     INCLUDE_DIRECTORIES(SYSTEM ${MPI_CXX_INCLUDE_PATH})

     IF (THIS_IS_MIC)


BUG: remove accidentaly commited line

BUG: remove accidentaly commited line

--- SuperBuild/CMake/External_otb.cmake
+++ SuperBuild/CMake/External_otb.cmake
@@ -221,7 +221,6 @@
   CMAKE_ARGS ${OTB_SB_CONFIG}
   CMAKE_COMMAND ${SB_CMAKE_COMMAND}
   LOG_CONFIGURE 1
-  CMAKE_GENERATOR Ninja
   )


fixed linking to lua in cmake

fixed linking to lua in cmake

--- CMakeOlxCommon.cmake
+++ CMakeOlxCommon.cmake
@@ -339,7 +339,7 @@
 		SET(LIBS ${LIBS} zip)
 	ENDIF (NOT LIBZIP_BUILTIN)
 	IF (NOT LIBLUA_BUILTIN)
-		SET(LIBS ${LIBS} lua5.1)
+		SET(LIBS ${LIBS} lua)
 	ENDIF (NOT LIBLUA_BUILTIN)
 	IF(X11)
 		SET(LIBS ${LIBS} X11)


No Tests for crossGuid

No Tests for crossGuid

--- cmake/external/FindCrossGUIDLib.cmake
+++ cmake/external/FindCrossGUIDLib.cmake
@@ -19,7 +19,7 @@
                             GIT_SHALLOW         ON
                             TIMEOUT 10
                             UPDATE_DISCONNECTED  ON
-                            CMAKE_ARGS "-DCMAKE_BUILD_TYPE=Release" "-DCMAKE_VERBOSE_MAKEFILE=ON" "-DXG_TESTS=OFF"
+                            CMAKE_ARGS "-DCMAKE_BUILD_TYPE=Release" "-DCMAKE_VERBOSE_MAKEFILE=ON" "-DCROSSGUID_TESTS=OFF"
                                        "-DCMAKE_INSTALL_PREFIX=${INSTALL_DIR}"
                             INSTALL_DIR "${INSTALL_DIR}")


RDSIBRM-2385: incorrect dependencies in .pc generated by BDE cmake build system (#107)

--- cmake/layers/install_pkg_config.cmake
+++ cmake/layers/install_pkg_config.cmake
@@ -47,10 +47,15 @@
         set(uor_version ${versionTag})
     endif()

-    bde_struct_get_field(pc_depends ${uor} DEPENDS)
+    bde_uor_to_pkgconfig_name(pkgconfig_name ${component})
+
+    bde_struct_get_field(uor_depends ${uor} DEPENDS)
+    set(pc_depends "")
+    foreach(uorName IN LISTS uor_depends)
+        bde_uor_to_pkgconfig_name(pcName ${uorName})
+        list(APPEND pc_depends ${pcName})
+    endforeach()
     string(REPLACE ";" " " uor_pc_depends "${pc_depends}")
-
-    bde_uor_to_pkgconfig_name(pkgconfig_name ${component})

     configure_file(
         ${pkgConfigFile}


[MinGW] Enable large file for mingw-w64

[MinGW] Enable large file for mingw-w64

64-bit mingw doesn't define _FILE_OFFSET_BITS=64 by default.

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

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

--- cmake/modules/HandleLLVMOptions.cmake
+++ cmake/modules/HandleLLVMOptions.cmake
@@ -222,6 +222,10 @@
   # MinGW warns if -fvisibility-inlines-hidden is used.
   check_cxx_compiler_flag("-fvisibility-inlines-hidden" SUPPORTS_FVISIBILITY_INLINES_HIDDEN_FLAG)
   append_if(SUPPORTS_FVISIBILITY_INLINES_HIDDEN_FLAG "-fvisibility-inlines-hidden" CMAKE_CXX_FLAGS)
+endif()
+
+if(CMAKE_SIZEOF_VOID_P EQUAL 8 AND MINGW)
+  add_definitions( -D_FILE_OFFSET_BITS=64 )
 endif()

 if( CMAKE_SIZEOF_VOID_P EQUAL 8 AND NOT WIN32 )


[CMake] Fix cache invalidation of LLVM_CXX_STD

This cleans up fallout from https://reviews.llvm.org/D66195.

git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@368897 91177308-0d34-0410-b5e6-96231b3b80d8
(cherry picked from commit 874a0a3b9d31e438555bf5a349ce743dd2ba492e)

--- cmake/modules/HandleLLVMOptions.cmake
+++ cmake/modules/HandleLLVMOptions.cmake
@@ -23,8 +23,11 @@
 if (LLVM_ENABLE_CXX1Z)
   set(LLVM_CXX_STD_default "c++1z")
 endif()
+if (LLVM_CXX_STD STREQUAL "c++11")
+  set(LLVM_CXX_STD_force FORCE)
+endif()
 set(LLVM_CXX_STD ${LLVM_CXX_STD_default}
-    CACHE STRING "C++ standard to use for compilation.")
+    CACHE STRING "C++ standard to use for compilation." ${LLVM_CXX_STD_force})

 set(LLVM_ENABLE_LTO OFF CACHE STRING "Build LLVM with LTO. May be specified as Thin or Full to use a particular kind of LTO")
 string(TOUPPER "${LLVM_ENABLE_LTO}" uppercase_LLVM_ENABLE_LTO)


Re-application of 187310.  Re-enabling warning C4275 for MSVC 11 and up, but not MSVC 10 since it is still required there.

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

--- cmake/modules/HandleLLVMOptions.cmake
+++ cmake/modules/HandleLLVMOptions.cmake
@@ -151,10 +151,16 @@
 if( MSVC )
   include(ChooseMSVCCRT)

-  if( MSVC11 )
+  if( MSVC10 )
+    # MSVC 10 will complain about headers in the STL not being exported, but
+    # will not complain in MSVC 11.
+    add_llvm_definitions(
+      -wd4275 # Suppress 'An exported class was derived from a class that was not exported.'
+    )
+  elseif( MSVC11 )
     add_llvm_definitions(-D_VARIADIC_MAX=10)
   endif()
-
+
   # Add definitions that make MSVC much less annoying.
   add_llvm_definitions(
     # For some reason MS wants to deprecate a bunch of standard functions...
@@ -176,7 +182,6 @@
     -wd4503 # Suppress ''identifier' : decorated name length exceeded, name was truncated'
     -wd4624 # Suppress ''derived class' : destructor could not be generated because a base class destructor is inaccessible'
     -wd4800 # Suppress ''type' : forcing value to bool 'true' or 'false' (performance warning)'
-    -wd4275 # Suppress 'An exported class was derived from a class that was not exported.'

     # Promoted warnings.
     -w14062 # Promote 'enumerator in switch of enum is not handled' to level 1 warning.


Always use UNIX line endings (allowing to execute scripts in cygwin shell)

--- cmake/modules/RootConfiguration.cmake
+++ cmake/modules/RootConfiguration.cmake
@@ -441,7 +441,7 @@
 set(pythonvers ${PYTHON_VERSION})

 #---CINT Configuration---------------------------------------------------------------------------------------
-#configure_file(${PROJECT_SOURCE_DIR}/cmake/scripts/cint-config.in ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/cint-config @ONLY)
+#configure_file(${PROJECT_SOURCE_DIR}/cmake/scripts/cint-config.in ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/cint-config @ONLY NEWLINE_STYLE UNIX)

 #---Create the configcint.h header file and copy the file first to the cint/cint directory. Copy it to the
 #   temporary include directory only if there is a change. Otherwise you have to recompile unneccessarily some files
@@ -452,29 +452,29 @@
 #install(FILES ${HEADER_OUTPUT_PATH}/configcint.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})

 #---RConfigure.h---------------------------------------------------------------------------------------------
-configure_file(${PROJECT_SOURCE_DIR}/config/RConfigure.in include/RConfigure.h)
+configure_file(${PROJECT_SOURCE_DIR}/config/RConfigure.in include/RConfigure.h NEWLINE_STYLE UNIX)
 install(FILES ${CMAKE_BINARY_DIR}/include/RConfigure.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})

 #---Configure and install various files----------------------------------------------------------------------
 execute_Process(COMMAND hostname OUTPUT_VARIABLE BuildNodeInfo OUTPUT_STRIP_TRAILING_WHITESPACE )

-configure_file(${CMAKE_SOURCE_DIR}/config/rootrc.in ${CMAKE_BINARY_DIR}/etc/system.rootrc @ONLY)
-configure_file(${CMAKE_SOURCE_DIR}/config/RConfigOptions.in include/RConfigOptions.h)
+configure_file(${CMAKE_SOURCE_DIR}/config/rootrc.in ${CMAKE_BINARY_DIR}/etc/system.rootrc @ONLY NEWLINE_STYLE UNIX)
+configure_file(${CMAKE_SOURCE_DIR}/config/RConfigOptions.in include/RConfigOptions.h NEWLINE_STYLE UNIX)
 if(ruby)
   file(APPEND ${CMAKE_BINARY_DIR}/include/RConfigOptions.h "\#define R__RUBY_MAJOR ${RUBY_MAJOR_VERSION}\n\#define R__RUBY_MINOR ${RUBY_MINOR_VERSION}\n")
 endif()

-configure_file(${CMAKE_SOURCE_DIR}/config/Makefile-comp.in config/Makefile.comp)
-configure_file(${CMAKE_SOURCE_DIR}/config/Makefile.in config/Makefile.config)
-configure_file(${CMAKE_SOURCE_DIR}/config/mimes.unix.in ${CMAKE_BINARY_DIR}/etc/root.mimes)
+configure_file(${CMAKE_SOURCE_DIR}/config/Makefile-comp.in config/Makefile.comp NEWLINE_STYLE UNIX)
+configure_file(${CMAKE_SOURCE_DIR}/config/Makefile.in config/Makefile.config NEWLINE_STYLE UNIX)
+configure_file(${CMAKE_SOURCE_DIR}/config/mimes.unix.in ${CMAKE_BINARY_DIR}/etc/root.mimes NEWLINE_STYLE UNIX)

 #---Generate the ROOTConfig files to be used by CMake projects-----------------------------------------------
 ROOT_SHOW_OPTIONS(ROOT_ENABLED_OPTIONS)
 configure_file(${CMAKE_SOURCE_DIR}/cmake/scripts/ROOTConfig-version.cmake.in
-               ${CMAKE_BINARY_DIR}/ROOTConfig-version.cmake @ONLY)
+               ${CMAKE_BINARY_DIR}/ROOTConfig-version.cmake @ONLY NEWLINE_STYLE UNIX)
 configure_file(${CMAKE_SOURCE_DIR}/cmake/scripts/RootUseFile.cmake.in
-               ${CMAKE_BINARY_DIR}/ROOTUseFile.cmake @ONLY)
+               ${CMAKE_BINARY_DIR}/ROOTUseFile.cmake @ONLY NEWLINE_STYLE UNIX)

 #---Compiler flags (because user apps are a bit dependent on them...)----------------------------------------
 set(ROOT_COMPILER_FLAG_HINTS "#
@@ -502,7 +502,7 @@
 get_property(exported_targets GLOBAL PROPERTY ROOT_EXPORTED_TARGETS)
 export(TARGETS ${exported_targets} FILE ${PROJECT_BINARY_DIR}/ROOTConfig-targets.cmake)
 configure_file(${CMAKE_SOURCE_DIR}/cmake/scripts/ROOTConfig.cmake.in
-               ${CMAKE_BINARY_DIR}/ROOTConfig.cmake @ONLY)
+               ${CMAKE_BINARY_DIR}/ROOTConfig.cmake @ONLY NEWLINE_STYLE UNIX)

 #---To be used from the install tree--------------------------------------------------------------------------
 # Need to calculate actual relative paths from CMAKEDIR to other locations
@@ -527,7 +527,7 @@
 set(CMAKE_MODULE_PATH \${CMAKE_MODULE_PATH}  \${_thisdir}/modules)
 ")
 configure_file(${CMAKE_SOURCE_DIR}/cmake/scripts/ROOTConfig.cmake.in
-               ${CMAKE_BINARY_DIR}/installtree/ROOTConfig.cmake @ONLY)
+               ${CMAKE_BINARY_DIR}/installtree/ROOTConfig.cmake @ONLY NEWLINE_STYLE UNIX)
 install(FILES ${CMAKE_BINARY_DIR}/ROOTConfig-version.cmake
               ${CMAKE_BINARY_DIR}/ROOTUseFile.cmake
               ${CMAKE_BINARY_DIR}/installtree/ROOTConfig.cmake DESTINATION ${CMAKE_INSTALL_CMAKEDIR})
@@ -545,7 +545,7 @@
 #---compiledata.h--------------------------------------------------------------------------------------------
 if(WIN32)
   # We cannot use the compiledata.sh script for windows
-  configure_file(${CMAKE_SOURCE_DIR}/cmake/scripts/compiledata.win32.in include/compiledata.h)
+  configure_file(${CMAKE_SOURCE_DIR}/cmake/scripts/compiledata.win32.in include/compiledata.h NEWLINE_STYLE UNIX)
 else()
   execute_process(COMMAND ${CMAKE_SOURCE_DIR}/build/unix/compiledata.sh include/compiledata.h "${CXX}" ""
        "${CMAKE_CXX_FLAGS_${uppercase_CMAKE_BUILD_TYPE}}"
@@ -553,19 +553,19 @@
         "${libdir}" "-lCore" "-lRint" "${incdir}" "" "" "${ROOT_ARCHITECTURE}" "" "${explicitlink}" )
 endif()

-configure_file(${CMAKE_SOURCE_DIR}/config/root-config.in ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/root-config @ONLY)
-configure_file(${CMAKE_SOURCE_DIR}/config/memprobe.in ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/memprobe @ONLY)
-configure_file(${CMAKE_SOURCE_DIR}/config/thisroot.sh ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/thisroot.sh @ONLY)
-configure_file(${CMAKE_SOURCE_DIR}/config/thisroot.csh ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/thisroot.csh @ONLY)
+configure_file(${CMAKE_SOURCE_DIR}/config/root-config.in ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/root-config @ONLY NEWLINE_STYLE UNIX)
+configure_file(${CMAKE_SOURCE_DIR}/config/memprobe.in ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/memprobe @ONLY NEWLINE_STYLE UNIX)
+configure_file(${CMAKE_SOURCE_DIR}/config/thisroot.sh ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/thisroot.sh @ONLY NEWLINE_STYLE UNIX)
+configure_file(${CMAKE_SOURCE_DIR}/config/thisroot.csh ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/thisroot.csh @ONLY NEWLINE_STYLE UNIX)
 configure_file(${CMAKE_SOURCE_DIR}/config/setxrd.csh ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/setxrd.csh COPYONLY)
 configure_file(${CMAKE_SOURCE_DIR}/config/setxrd.sh ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/setxrd.sh COPYONLY)
-configure_file(${CMAKE_SOURCE_DIR}/config/genreflex.in ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/genreflex @ONLY)
-configure_file(${CMAKE_SOURCE_DIR}/config/genreflex-rootcint.in ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/genreflex-rootcint @ONLY)
-configure_file(${CMAKE_SOURCE_DIR}/config/proofserv.in ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/proofserv @ONLY)
-configure_file(${CMAKE_SOURCE_DIR}/config/roots.in ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/roots @ONLY)
-configure_file(${CMAKE_SOURCE_DIR}/config/root-help.el.in root-help.el @ONLY)
+configure_file(${CMAKE_SOURCE_DIR}/config/genreflex.in ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/genreflex @ONLY NEWLINE_STYLE UNIX)
+configure_file(${CMAKE_SOURCE_DIR}/config/genreflex-rootcint.in ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/genreflex-rootcint @ONLY NEWLINE_STYLE UNIX)
+configure_file(${CMAKE_SOURCE_DIR}/config/proofserv.in ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/proofserv @ONLY NEWLINE_STYLE UNIX)
+configure_file(${CMAKE_SOURCE_DIR}/config/roots.in ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/roots @ONLY NEWLINE_STYLE UNIX)
+configure_file(${CMAKE_SOURCE_DIR}/config/root-help.el.in root-help.el @ONLY NEWLINE_STYLE UNIX)
 if (XROOTD_FOUND AND XROOTD_NOMAIN)
-  configure_file(${CMAKE_SOURCE_DIR}/config/xproofd.in ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/xproofd @ONLY)
+  configure_file(${CMAKE_SOURCE_DIR}/config/xproofd.in ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/xproofd @ONLY NEWLINE_STYLE UNIX)
 endif()
 if(WIN32)
   set(thisrootbat ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/thisroot.bat)


[Build System: CMake] Partially revert PR #22840, manually adding the LLVM CMake module path to CMAKE_MODULE_PATH rather than using find_package.

--- cmake/modules/StandaloneOverlay.cmake
+++ cmake/modules/StandaloneOverlay.cmake
@@ -21,12 +21,13 @@
 set(SWIFT_DARWIN_DEPLOYMENT_VERSION_WATCHOS "2.0" CACHE STRING "")
 set(SWIFT_ENABLE_PARSEABLE_MODULE_INTERFACES TRUE)

-set(SWIFT_SOURCE_DIR "${SWIFT_SOURCE_ROOT}/src/swift" CACHE PATH "")
+set(SWIFT_SOURCE_DIR "${SWIFT_SOURCE_ROOT}/swift" CACHE PATH "")
 set(SWIFT_NATIVE_SWIFT_TOOLS_PATH "${TOOLCHAIN_DIR}/usr/bin" CACHE PATH "")
 set(SWIFT_SDKS ${SWIFT_HOST_VARIANT_SDK})

-find_package(LLVM CONFIG REQUIRED NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
-list(APPEND CMAKE_MODULE_PATH "${LLVM_CMAKE_DIR}" "${PROJECT_SOURCE_DIR}/../../../../cmake/modules")
+list(APPEND CMAKE_MODULE_PATH
+  "${SWIFT_SOURCE_ROOT}/llvm/cmake/modules"
+  "${PROJECT_SOURCE_DIR}/../../../../cmake/modules")

 set(SWIFT_DARWIN_XCRUN_TOOLCHAIN "XcodeDefault" CACHE STRING
     "The name of the toolchain to pass to 'xcrun'")


RunRemoteTest.cmake now only considers the directories in the ZORBA_MODULES_DIR as module candidates.

--- test/remote/RunRemoteTest.cmake
+++ test/remote/RunRemoteTest.cmake
@@ -78,10 +78,12 @@
   set (mod_count 1)
   file (GLOB module_dirs "${modules_dir}/*")
   foreach (module_dir ${module_dirs})
-    message (STATUS "Module ${mod_count}: ${module_dir}")
-    svn_package ("${module_dir}" "${workdir}" "${changelist}"
-      "${workdir}/module-${mod_count}.tgz")
-    math (EXPR mod_count "${mod_count} + 1")
+    if (IS_DIRECTORY "${module_dir}")
+      message (STATUS "Module ${mod_count}: ${module_dir}")
+      svn_package ("${module_dir}" "${workdir}" "${changelist}"
+        "${workdir}/module-${mod_count}.tgz")
+      math (EXPR mod_count "${mod_count} + 1")
+    endif (IS_DIRECTORY "${module_dir}")
   endforeach (module_dir)
 endif (IS_DIRECTORY "${modules_dir}")


Update ios.toolchain.cmake

Update ios.toolchain.cmake

Added fix if upgrading Xcode versions on consequent builds

--- ios.toolchain.cmake
+++ ios.toolchain.cmake
@@ -182,20 +182,22 @@
 message(STATUS "Configuring iOS build for platform: ${IOS_PLATFORM}, "
   "architecture(s): ${IOS_ARCH}")
 # If user did not specify the SDK root to use, then query xcodebuild for it.
-if (NOT CMAKE_OSX_SYSROOT)
+if (NOT EXISTS ${CMAKE_OSX_SYSROOT})
   execute_process(COMMAND xcodebuild -version -sdk ${XCODE_IOS_PLATFORM} Path
     OUTPUT_VARIABLE CMAKE_OSX_SYSROOT
     ERROR_QUIET
     OUTPUT_STRIP_TRAILING_WHITESPACE)
-  message(STATUS "Using SDK: ${CMAKE_OSX_SYSROOT} for platform: ${IOS_PLATFORM}")
-endif()
-if (NOT EXISTS ${CMAKE_OSX_SYSROOT})
-  message(SEND_ERROR "Please make sure that Xcode is installed and that the toolchain"
-    "is pointing to the correct path. Please run:"
-    "sudo xcode-select -s /Applications/Xcode.app/Contents/Developer"
-    "and see if that fixes the problem for you.")
-  message(FATAL_ERROR "Invalid CMAKE_OSX_SYSROOT: ${CMAKE_OSX_SYSROOT} "
-    "does not exist.")
+
+    if (NOT EXISTS ${CMAKE_OSX_SYSROOT})
+      message(SEND_ERROR "Please make sure that Xcode is installed and that the toolchain"
+      "is pointing to the correct path. Please run:"
+      "sudo xcode-select -s /Applications/Xcode.app/Contents/Developer"
+      "and see if that fixes the problem for you.")
+      message(FATAL_ERROR "Invalid CMAKE_OSX_SYSROOT: ${CMAKE_OSX_SYSROOT} "
+      "does not exist.")
+    else()
+       message(STATUS "Using SDK: ${CMAKE_OSX_SYSROOT} for platform: ${IOS_PLATFORM}")
+    endif()
 endif()
 # Specify minimum version of deployment target.
 if (NOT DEFINED IOS_DEPLOYMENT_TARGET)


ManageReleaseFedora: Should not assume that MANAGE_SOURCE_VERSION_CONTRAL_TAG_FILE exists

--- Modules/ManageReleaseFedora.cmake
+++ Modules/ManageReleaseFedora.cmake
@@ -87,8 +87,6 @@
 #       * Reads following variables:
 #         + PRJ_SRPM_FILE: Project SRPM
 #         + FEDPKG_DIR: Directory for fedpkg checkout.
-#         + MANAGE_SOURCE_VERSION_CONTROL_TAG_FILE:
-#           Version tag file used in source version control.
 #       * Defines following targets:
 #         + fedpkg_build: Build with fedpkg and push to bodhi.
 #            This depends on the tag file from source control
@@ -186,11 +184,6 @@
     IF(_manage_release_fedora_dependencies_missing)
 	RETURN()
     ENDIF(_manage_release_fedora_dependencies_missing)
-    IF(MANAGE_SOURCE_VERSION_CONTROL_TAG_FILE STREQUAL "")
-	M_MSG(${M_ERROR} "RELEASE_FEDORA_FEDPKG: Undefined
-MANAGE_SOURCE_VERSION_CONTROL_TAG_FILE, please use MANAGE_SOURCE_VERSION_CONTROL_GIT() or other source version control functions")
-    ENDIF(MANAGE_SOURCE_VERSION_CONTROL_TAG_FILE STREQUAL "")
-    M_MSG(${M_INFO2} 	"MANAGE_SOURCE_VERSION_CONTROL_TAG_FILE=${MANAGE_SOURCE_VERSION_CONTROL_TAG_FILE}")
     SET(_cmdOpts "")
     IF ("${CHANGE_SUMMARY}" STREQUAL "")
 	SET(CHANGE_SUMMARY "Release ${PROJECT_NAME}-${PRJ_VER}")
@@ -204,9 +197,9 @@
 	COMMAND ${CMAKE_FEDORA_FEDPKG_CMD} -d "${FEDPKG_DIR}"
 	-m "${CHANGE_SUMMARY}"
 	${_cmdOpts} "${PRJ_SRPM_FILE}" ${ARGN}
-	DEPENDS "${MANAGE_SOURCE_VERSION_CONTROL_TAG_FILE}"
 	VERBATIM
 	)
+    ADD_DEPENDENCIES(fedpkg_build tag_post)
 ENDFUNCTION(RELEASE_FEDORA_FEDPKG)

 FUNCTION(RELEASE_FEDORA)


build system: use C17 and C++2a by default

Closes https://github.com/espressif/esp-idf/pull/4846
Related to https://github.com/espressif/esp-idf/issues/5003
Related to https://github.com/espressif/esp-idf/issues/6885
Related to https://github.com/espressif/arduino-esp32/issues/5859

--- tools/cmake/build.cmake
+++ tools/cmake/build.cmake
@@ -117,9 +117,9 @@
                                     # go into the final binary so have no impact on size
                                     "-ggdb")

-    list(APPEND c_compile_options   "-std=gnu99")
-
-    list(APPEND cxx_compile_options "-std=gnu++11")
+    list(APPEND c_compile_options   "-std=gnu17")
+
+    list(APPEND cxx_compile_options "-std=gnu++20")

     idf_build_set_property(COMPILE_DEFINITIONS "${compile_definitions}" APPEND)
     idf_build_set_property(COMPILE_OPTIONS "${compile_options}" APPEND)


STYLE: ExternalData: Clean up duplicate regex matches with CMAKE_MATCH_<n>

The matches have already been calculated and can simply be taken from
CMAKE_MATCH_n variables. This avoids multiple compilations of the same or very
similar regular expressions.

Change-Id: Id0bf5690a50f8eea73212bbc9eb6cfeda73a0a35

--- CMake/ExternalData.cmake
+++ CMake/ExternalData.cmake
@@ -267,8 +267,7 @@
       foreach(piece IN LISTS pieces)
         if("x${piece}" MATCHES "^x${data_regex}$")
           # Replace this DATA{}-piece with a file path.
-          string(REGEX REPLACE "${data_regex}" "\\1" data "${piece}")
-          _ExternalData_arg("${target}" "${piece}" "${data}" file)
+          _ExternalData_arg("${target}" "${piece}" "${CMAKE_MATCH_1}" file)
           set(outArg "${outArg}${file}")
         else()
           # No replacement needed for this piece.
@@ -406,10 +405,9 @@
   set(associated_files "")
   set(associated_regex "")
   foreach(opt ${options})
-    if("x${opt}" MATCHES "^xREGEX:[^:/]+$")
-      # Regular expression to match associated files.
-      string(REGEX REPLACE "^REGEX:" "" regex "${opt}")
-      list(APPEND associated_regex "${regex}")
+    # Regular expression to match associated files.
+    if("x${opt}" MATCHES "^xREGEX:([^:/]+)$")
+      list(APPEND associated_regex "${CMAKE_MATCH_1}")
     elseif(opt STREQUAL ":")
       # Activate series matching.
       set(series_option "${opt}")


modified ctk args for superbuild

modified ctk args for superbuild

--- CMakeExternals/CTK.cmake
+++ CMakeExternals/CTK.cmake
@@ -24,6 +24,8 @@
     if(MITK_USE_Python)
       list(APPEND ctk_optional_cache_args
            -DCTK_LIB_Scripting/Python/Widgets:BOOL=ON
+           -DCTK_ENABLE_Python_Wrapping:BOOL=ON
+           -DCTK_APP_ctkSimplePythonShell:BOOL=ON
       )
     endif()


ctk with no dicomdir support

ctk with no dicomdir support

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

   if(NOT DEFINED CTK_DIR)

-    SET(revision_tag 31d144ecab0c7a8bdc5d8e2ec8b33972ce8e490d)
+    SET(revision_tag ffb23fc7611b60cf5f9db4688da0f368cccbc444)
     IF(${proj}_REVISION_TAG)
       SET(revision_tag ${${proj}_REVISION_TAG})
     ENDIF()


Change 'path' to 'dir'.

Change 'path' to 'dir'.

	We now use 'dir' when it is a directory and 'path' when it is a
	directory plus a file name.

	* build-aux/cmake/modules/DynLibDep.cmake: Do that.

Signed-off-by: Nicolas Despres <abdeb541ca46f1651c9cc594d44e707056e73d5d@gostai.com>

--- build-aux/cmake/modules/DynLibDep.cmake
+++ build-aux/cmake/modules/DynLibDep.cmake
@@ -28,10 +28,10 @@
   endfunction(dldep_error)

   # Puts respectively the name and the path of the dependent libraries of the
-  # binary _binary_ in _list_names_ and _lib_paths_.
+  # binary _binary_ in _list_names_ and _lib_dirs_.
   #
   # It uses 'ldd' to gather the list of dependencies.
-  function(dldep_ldd binary lib_names lib_paths)
+  function(dldep_ldd binary lib_names lib_dirs)

     set(tools ldd)
     find_program(tool ${tools})
@@ -53,7 +53,7 @@
     endif(err)

     set(_lib_names "")
-    set(_lib_paths "")
+    set(_lib_dirs "")

     string(REGEX REPLACE "\n" ";" lines ${out})
     set(regex "\t+([^ ]+) +=> +([^ ]+) +")
@@ -67,10 +67,10 @@

 	if(${lib_path} STREQUAL "not found")
 	  dldep_info("cannot find '${lib_name}'")
-	  list(APPEND _lib_paths "")
+	  list(APPEND _lib_dirs "")
 	else(${lib_path} STREQUAL "not found")
-	  get_filename_component(lib_path_tmp ${lib_path} PATH)
-	  list(APPEND _lib_paths ${lib_path_tmp})
+	  get_filename_component(lib_dir ${lib_path} PATH)
+	  list(APPEND _lib_dirs ${lib_dir})
 	endif(${lib_path} STREQUAL "not found")

       else(line MATCHES ${regex})
@@ -79,14 +79,14 @@
     endforeach(line)

     set(${lib_names} ${_lib_names} PARENT_SCOPE)
-    set(${lib_paths} ${_lib_paths} PARENT_SCOPE)
+    set(${lib_dirs} ${_lib_dirs} PARENT_SCOPE)

   endfunction(dldep_ldd)

   # Filter library names from _lib_names_ that match one of the regexp from
-  # _exclusions_. Corresponding library paths from _lib_paths_ are stored in
-  # _result_.
-  function(dldep_filter lib_names lib_paths exclusions result)
+  # _exclusions_. Corresponding library paths from _lib_dirs_ are stored in
+  # _result_ with library name appended.
+  function(dldep_filter lib_names lib_dirs exclusions result)

     set(_result "")

@@ -98,12 +98,12 @@
       foreach(i RANGE ${lib_count})

 	list(GET lib_names ${i} lib_name)
-	list(GET lib_paths ${i} lib_path)
+	list(GET lib_dirs ${i} lib_dir)

 	string_list_match("${exclusions}" ${lib_name} index)

 	if(index EQUAL -1)
-	  list(APPEND _result ${lib_path}/${lib_name})
+	  list(APPEND _result ${lib_dir}/${lib_name})
 	else(index EQUAL -1)
 	  dldep_info("exclude '${lib_name}'")
 	endif(index EQUAL -1)
@@ -122,10 +122,10 @@
   function(dldep binary outlist)

     if(UNIX)
-      dldep_ldd(${binary} lib_names lib_paths)
+      dldep_ldd(${binary} lib_names lib_dirs)
       dldep_filter(
 	"${lib_names}"
-	"${lib_paths}"
+	"${lib_dirs}"
 	"${DLDEP_UNIX_EXCLUSION_LIST}"
 	outlist_)
     endif(UNIX)


use find_program to locate java_home

use find_program to locate java_home

--- CMake/Mathematica/FindMathematica.cmake
+++ CMake/Mathematica/FindMathematica.cmake
@@ -1854,9 +1854,11 @@
 			if (DEFINED Mathematica_VERSION)
 				if ("${Mathematica_VERSION}" VERSION_LESS "10.0")
 					# use java_home to find path to JVM installed on system
-					if (EXISTS "/usr/libexec/java_home")
+					find_program(Mathematica_JAVA_HOME_EXECUTABLE "java_home" PATHS "/usr/libexec/")
+					mark_as_advanced(Mathematica_JAVA_HOME_EXECUTABLE)
+					if (Mathematica_JAVA_HOME_EXECUTABLE)
 						execute_process(
-							COMMAND "/usr/libexec/java_home" "--version" "1.6"
+							COMMAND "${Mathematica_JAVA_HOME_EXECUTABLE}" "--version" "1.6"
 							TIMEOUT 10 OUTPUT_VARIABLE _mmaJavaHome ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
 					endif()
 				endif()


Limit the install of Urho3D DLL for CMake version 3.0 or higher. [ci only: master]

--- CMake/Modules/Urho3D-CMake-common.cmake
+++ CMake/Modules/Urho3D-CMake-common.cmake
@@ -995,8 +995,12 @@
             install (TARGETS ${TARGET_NAME} RUNTIME DESTINATION ${DEST_RUNTIME_DIR} BUNDLE DESTINATION ${DEST_BUNDLE_DIR})
             if (WIN32 AND NOT ARG_NODEPS AND URHO3D_LIB_TYPE STREQUAL SHARED AND NOT URHO3D_DLL_INSTALLED AND NOT DEST_RUNTIME_DIR STREQUAL bin)
                 if (TARGET Urho3D)
-                    install (FILES $<TARGET_FILE:Urho3D> DESTINATION ${DEST_RUNTIME_DIR})
-                    set (URHO3D_DLL_INSTALLED TRUE)
+                    if (CMAKE_VERSION VERSION_LESS 3.0)
+                        # What to do? Upgrade the minimum CMake version? Or workaround it again?
+                    else ()
+                        install (FILES $<TARGET_FILE:Urho3D> DESTINATION ${DEST_RUNTIME_DIR})
+                        set (URHO3D_DLL_INSTALLED TRUE)
+                    endif ()
                 else ()
                     # TODO: Handle the case for external project
                 endif ()


Fix precompiling header file for Clang. [ci rebase]

--- CMake/Modules/Urho3D-CMake-common.cmake
+++ CMake/Modules/Urho3D-CMake-common.cmake
@@ -492,14 +492,15 @@
                         string (MAKE_C_IDENTIFIER ${EXPORT_IMPORT_CONDITION} EXPORT_IMPORT_CONDITION)
                     endif ()
                     list (APPEND COMPILE_DEFINITIONS ${EXPORT_IMPORT_CONDITION})
-                    set (PIC -fPIC)
+                    # Below is a hack as it assumes the compiler is modern enough to support these flags
+                    set (COMPILER_EXPORT_FLAGS "-fPIC -fvisibility=hidden -fvisibility-inlines-hidden")
                 endif ()
                 string (REPLACE ";" " -D" COMPILE_DEFINITIONS "-D${COMPILE_DEFINITIONS}")
                 string (REPLACE ";" " -I" INCLUDE_DIRECTORIES "-I${INCLUDE_DIRECTORIES}")
                 file (MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${PCH_FILENAME})
                 foreach (CONFIG ${CMAKE_CONFIGURATION_TYPES} ${CMAKE_BUILD_TYPE})
                     string (TOUPPER ${CONFIG} UPPERCASE_CONFIG)
-                    file (WRITE ${CMAKE_CURRENT_BINARY_DIR}/Precompiled.h.${CONFIG}.rsp.new "${COMPILE_DEFINITIONS} ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_${UPPERCASE_CONFIG}} ${PIC} ${INCLUDE_DIRECTORIES}")
+                    file (WRITE ${CMAKE_CURRENT_BINARY_DIR}/Precompiled.h.${CONFIG}.rsp.new "${COMPILE_DEFINITIONS} ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_${UPPERCASE_CONFIG}} ${COMPILER_EXPORT_FLAGS} ${INCLUDE_DIRECTORIES}")
                     execute_process (COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_BINARY_DIR}/Precompiled.h.${CONFIG}.rsp.new ${CMAKE_CURRENT_BINARY_DIR}/Precompiled.h.${CONFIG}.rsp)
                     file (REMOVE ${CMAKE_CURRENT_BINARY_DIR}/Precompiled.h.${CONFIG}.rsp.new)
                     # Make sure the precompiled headers are not stale


BUG: increase the stack size on win32 because of 6S code

--- CMake/OTBSetStandardCompilerFlags.cmake
+++ CMake/OTBSetStandardCompilerFlags.cmake
@@ -132,6 +132,20 @@

 macro(check_compiler_platform_flags)
+  # Since CMake 2.8.11, the size of the stack is not modified by CMake on
+  # windows platform, it uses the default size: with visual compiler it is 1Mbyte
+  # which is to lower for us (thanks to 6S code).
+  if(WIN32)
+    if (${CMAKE_VERSION} VERSION_GREATER "2.8.10.2")
+      if("${CMAKE_EXE_LINKER_FLAGS}" MATCHES "/STACK:[0-9]+")
+          message(STATUS "The size of the stack is already defined, so we dont't modified it.")
+      else()
+          set(OTB_REQUIRED_LINK_FLAGS "${OTB_REQUIRED_LINK_FLAGS} /STACK:10000000")
+          message(STATUS "Increase the size of the stack to 10Mbytes.")
+      endif()
+    endif()
+  endif()
+
   # On Visual Studio 8 MS deprecated C. This removes all 1.276E1265 security
   # warnings
   if(WIN32)


Add additional link_directories in ConfigureGoogleTest.cmake

--- cmake/Modules/ConfigureGoogleTest.cmake
+++ cmake/Modules/ConfigureGoogleTest.cmake
@@ -52,3 +52,5 @@
 message(STATUS "GTEST_ROOT: " ${GTEST_ROOT})

 link_directories(${GTEST_ROOT}/lib/)
+link_directories(${GTEST_ROOT}/lib/x86_64-linux-gnu)
+link_directories(${GTEST_ROOT}/lib64)


toolchain: Bump min SDK version to 0.11.1

For various reasons bump the min SDK required to 0.11.1.  We need 0.11.x
for xtensa and ARM64 support.

Signed-off-by: Kumar Gala <a5e5248af4cd4f0ed8c515f61d40a6e2db46a66e@linaro.org>

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

-set(REQUIRED_SDK_VER 0.10.3)
+set(REQUIRED_SDK_VER 0.11.1)
 set(TOOLCHAIN_VENDOR zephyr)
 set(TOOLCHAIN_ARCH x86_64)


BUG: patch requires explicit call to macro

--- SuperBuild/CMake/External_geotiff.cmake
+++ SuperBuild/CMake/External_geotiff.cmake
@@ -56,6 +56,8 @@
   LOG_INSTALL 1
   )

+SUPERBUILD_PATCH_SOURCE(GEOTIFF)
+
 set(_SB_GEOTIFF_INCLUDE_DIR ${SB_INSTALL_PREFIX}/include)
 if(WIN32)
   set(_SB_GEOTIFF_LIBRARY ${SB_INSTALL_PREFIX}/lib/geotiff_i.lib)


remove 32-bit Linux from supported system IDs for versions >= 11.3

--- CMake/Mathematica/FindMathematica.cmake
+++ CMake/Mathematica/FindMathematica.cmake
@@ -757,7 +757,14 @@
 			list (APPEND ${_outSystemIDs} ${_systemID})
 		endif()
 		# Linux 64-bit can run x86 through ia32-libs package
-		list (APPEND ${_outSystemIDs} "Linux")
+		if (Mathematica_VERSION)
+			if ("${Mathematica_VERSION}" VERSION_LESS "11.3")
+				# Mathematica 11.3 dropped support for 32-bit Linux
+				list (APPEND ${_outSystemIDs} "Linux")
+			endif()
+		else()
+			list (APPEND ${_outSystemIDs} "Linux")
+		endif()
 	else()
 		list (APPEND ${_outSystemIDs} ${_systemID})
 	endif()


Add '-fsigned-char' compiler flag for RPI and generic ARM builds. To be consistent with other non-ARM platforms, this flag makes 'char' signed by default.

--- CMake/Modules/Urho3D-CMake-common.cmake
+++ CMake/Modules/Urho3D-CMake-common.cmake
@@ -576,7 +576,7 @@
     if (NOT ANDROID)    # Most of the flags are already setup in android.toolchain.cmake module
         if (ARM AND CMAKE_SYSTEM_NAME STREQUAL Linux)
             # Common compiler flags for aarch64-linux-gnu and arm-linux-gnueabihf, we do not support Windows on arm for now
-            set (ARM_CFLAGS "${ARM_CFLAGS} -pipe")
+            set (ARM_CFLAGS "${ARM_CFLAGS} -fsigned-char -pipe")
             if (NOT URHO3D_64BIT)
                 # We only support armhf distros, so turn on hard-float by default
                 set (ARM_CFLAGS "${ARM_CFLAGS} -mfloat-abi=hard -Wno-psabi")


Fix android toolchain - now find_XXX works

--- CMake/toolchain/android.toolchain.cmake
+++ CMake/toolchain/android.toolchain.cmake
@@ -961,7 +961,7 @@
 set( BUILD_ANDROID True )

 # where is the target environment
-set( CMAKE_FIND_ROOT_PATH "${ANDROID_TOOLCHAIN_ROOT}/bin" "${ANDROID_TOOLCHAIN_ROOT}/${ANDROID_TOOLCHAIN_MACHINE_NAME}" "${ANDROID_SYSROOT}" "${CMAKE_INSTALL_PREFIX}" "${CMAKE_INSTALL_PREFIX}/share" )
+set( CMAKE_FIND_ROOT_PATH "/" "${ANDROID_TOOLCHAIN_ROOT}/bin" "${ANDROID_TOOLCHAIN_ROOT}/${ANDROID_TOOLCHAIN_MACHINE_NAME}" "${ANDROID_SYSROOT}" "${CMAKE_INSTALL_PREFIX}" "${CMAKE_INSTALL_PREFIX}/share" )

 # only search for libraries and includes in the ndk toolchain
 set( CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ONLY )


Build universal simulator libs

Build universal simulator libs

--- toolchain/iOS.cmake
+++ toolchain/iOS.cmake
@@ -4,7 +4,7 @@

 # Options:
 #
-# IOS_PLATFORM = OS (default) or SIMULATOR or SIMULATOR64
+# IOS_PLATFORM = OS (default) or SIMULATOR
 #   This decides if SDKS will be selected from the iPhoneOS.platform or iPhoneSimulator.platform folders
 #   OS - the default, used to build for iPhone and iPad physical devices, which have an arm arch.
 #   SIMULATOR - used to build for the Simulator platforms, which have an x86 arch.
@@ -92,12 +92,6 @@
 endif (NOT DEFINED IOS_PLATFORM)
 set (IOS_PLATFORM ${IOS_PLATFORM} CACHE STRING "Type of iOS Platform")

-# Setup building for arm64 or not
-if (NOT DEFINED BUILD_ARM64)
-    set (BUILD_ARM64 true)
-endif (NOT DEFINED BUILD_ARM64)
-set (BUILD_ARM64 ${BUILD_ARM64} CACHE STRING "Build arm64 arch or not")
-
 # Check the platform selection and setup for developer root
 if (${IOS_PLATFORM} STREQUAL "OS")
 	set (IOS_PLATFORM_LOCATION "iPhoneOS.platform")
@@ -152,13 +146,11 @@
 set (CMAKE_OSX_SYSROOT ${CMAKE_IOS_SDK_ROOT} CACHE PATH "Sysroot used for iOS support")

 # set the architecture for iOS
-if (${IOS_PLATFORM} STREQUAL "OS")
-    set (IOS_ARCH armv7 armv7s arm64)
-elseif (${IOS_PLATFORM} STREQUAL "SIMULATOR")
-    set (IOS_ARCH i386)
-elseif (${IOS_PLATFORM} STREQUAL "SIMULATOR64")
-    set (IOS_ARCH x86_64)
-endif (${IOS_PLATFORM} STREQUAL "OS")
+if (IOS_PLATFORM STREQUAL "OS")
+	set (IOS_ARCH "armv7;armv7s;arm64")
+elseif (IOS_PLATFORM STREQUAL "SIMULATOR")
+	set (IOS_ARCH "i386;x86_64")
+endif ()

 set (CMAKE_OSX_ARCHITECTURES ${IOS_ARCH} CACHE string  "Build architecture for iOS")


use windows fix only on windows

use windows fix only on windows

--- CMakeExternals.cmake
+++ CMakeExternals.cmake
@@ -390,7 +390,9 @@
       INTERFACE_COMPILE_DEFINITIONS "ZMQ_STATIC")

     # TODO libzmq cmake does a lot more checks and options. This will probably work only in some configurations.
-    target_link_libraries(libzmq INTERFACE ws2_32 iphlpapi)
+    if(WIN32)
+      target_link_libraries(libzmq INTERFACE ws2_32 iphlpapi)
+    endif()

     add_external_headeronly_project(libcppzmq
       DEPENDS libzmq


Set ALL_CPP_TESTS entry from TEST_NAME

Set ALL_CPP_TESTS entry from TEST_NAME

Changes to the setting of TEST_NAME disassociates the
list of tests in ALL_CPP_TESTS from the actual
executables. This sets the entry in ALL_CPP_TESTS
from TEST_NAME.

--- CommonCPPCTest.cmake
+++ CommonCPPCTest.cmake
@@ -44,15 +44,15 @@
   string(REGEX REPLACE "[./]" "_" NAME ${NAME})
   source_group(\\ FILES ${FILE})

-  if(NAME MATCHES "^perf.*")
-    list(APPEND ALL_CPP_PERF_TESTS ${PROJECT_NAME}_${NAME})
-  else()
-    list(APPEND ALL_CPP_TESTS ${PROJECT_NAME}_${NAME})
-  endif()
-
   set(TEST_NAME ${PROJECT_NAME}_${NAME})
   if(NOT TARGET ${NAME}) # Create target without project prefix if possible
     set(TEST_NAME ${NAME})
+  endif()
+
+  if(NAME MATCHES "^perf.*")
+    list(APPEND ALL_CPP_PERF_TESTS ${TEST_NAME})
+  else()
+    list(APPEND ALL_CPP_TESTS ${TEST_NAME})
   endif()

   add_executable(${TEST_NAME} ${FILE})


cmake: Add -Wmissing-field-initializers

cmake: Add -Wmissing-field-initializers

Signed-off-by: Andreas Schneider <5be00ddc76278cf6077f5047ca3384a88460c671@cryptomilk.org>

--- CompilerChecks.cmake
+++ CompilerChecks.cmake
@@ -41,6 +41,7 @@
     add_c_compiler_flag("-Werror=strict-overflow" SUPPORTED_COMPILER_FLAGS)
     add_c_compiler_flag("-Wstrict-overflow=2" SUPPORTED_COMPILER_FLAGS)
     add_c_compiler_flag("-Wno-format-zero-length" SUPPORTED_COMPILER_FLAGS)
+    add_c_compiler_flag("-Wmissing-field-initializers" SUPPORTED_COMPILER_FLAGS)

     check_c_compiler_flag("-Wformat" REQUIRED_FLAGS_WFORMAT)
     if (REQUIRED_FLAGS_WFORMAT)


build: disable AVX512

build: disable AVX512

Currently it is not supported.
All builds are broken with enabled AVX512 option.

--- cmake/OpenCVCompilerOptimizations.cmake
+++ cmake/OpenCVCompilerOptimizations.cmake
@@ -143,7 +143,7 @@
 endif()

 if(X86 OR X86_64)
-  ocv_update(CPU_KNOWN_OPTIMIZATIONS "SSE;SSE2;SSE3;SSSE3;SSE4_1;POPCNT;SSE4_2;FP16;FMA3;AVX;AVX2;AVX512")
+  ocv_update(CPU_KNOWN_OPTIMIZATIONS "SSE;SSE2;SSE3;SSSE3;SSE4_1;POPCNT;SSE4_2;FP16;FMA3;AVX;AVX2") # without AVX512

   ocv_update(CPU_SSE_TEST_FILE "${OpenCV_SOURCE_DIR}/cmake/checks/cpu_sse.cpp")
   ocv_update(CPU_SSE2_TEST_FILE "${OpenCV_SOURCE_DIR}/cmake/checks/cpu_sse2.cpp")


Fixed error in cmake script

Fixed error in cmake script

--- cmake/dev/generate_msvc_libraries.cmake
+++ cmake/dev/generate_msvc_libraries.cmake
@@ -38,11 +38,18 @@
         FILES_MATCHING
         PATTERN "*${PROJECT_NAME}*-${PROJECT_MAJOR_VERSION}.${PROJECT_MINOR_VERSION}*"
         )
-    install(DIRECTORY ${PROJECT_BINARY_DIR}/../${platform}/cmake/config/
+    install(FILES
+        ${PROJECT_BINARY_DIR}/../${platform}/cmake/config/${PROJECT_NAME}Config.cmake
+        ${PROJECT_BINARY_DIR}/../${platform}/cmake/config/${PROJECT_NAME}ConfigVersion.cmake
         DESTINATION lib/${platform}/${PROJECT_NAME}/cmake
         COMPONENT cmake
-        FILES_MATCHING
-        PATTERN "*.cmake"
+        )
+    install(FILES
+        ${PROJECT_BINARY_DIR}/../${platform}/src/cpp/CMakeFiles/Export/lib/${platform}/${PROJECT_NAME}/cmake/${PROJECT_NAME}Targets.cmake
+        ${PROJECT_BINARY_DIR}/../${platform}/src/cpp/CMakeFiles/Export/lib/${platform}/${PROJECT_NAME}/cmake/${PROJECT_NAME}Targets-release.cmake
+        ${PROJECT_BINARY_DIR}/../${platform}/src/cpp/CMakeFiles/Export/lib/${platform}/${PROJECT_NAME}/cmake/${PROJECT_NAME}Targets-debug.cmake
+        DESTINATION lib/${platform}/${PROJECT_NAME}/cmake
+        COMPONENT cmake
         )
     string(TOUPPER "${platform}" ${platform}_UPPER)
     set(CPACK_COMPONENT_LIBRARIES_${${platform}_UPPER}_DISPLAY_NAME "${platform}" PARENT_SCOPE)


MAINT: remove gcc flags since Eigen is updated.

--- cmake/sara_configure_cxx_compiler.cmake
+++ cmake/sara_configure_cxx_compiler.cmake
@@ -62,12 +62,6 @@
     sara_substep_message("Enable colored output of GCC.")
     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fdiagnostics-color=always")
   endif ()
-
-  # Silence some annoying compiler warnings in Eigen since GCC 7.0.
-  if (GCC_VERSION VERSION_GREATER 7.0 OR
-      GCC_VERSION VERSION_EQUAL 7.0)
-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-int-in-bool-context")
-  endif ()
 endif ()

 if (UNIX)


cmake: Add VERSION and update copyright year

--- BasisProject.cmake
+++ BasisProject.cmake
@@ -1,8 +1,8 @@
 # ==============================================================================
 # Medical Image Registration ToolKit (MIRTK)
 #
-# Copyright 2013-2015 Imperial College London
-# Copyright 2013-2015 Andreas Schuh
+# Copyright 2013-2016 Imperial College London
+# Copyright 2013-2016 Andreas Schuh
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
@@ -43,10 +43,11 @@
   # ----------------------------------------------------------------------------
   # meta-data
   NAME        "Deformable"
+  VERSION     "1.1.0"
   PACKAGE     "MIRTK"
   AUTHORS     "Andreas Schuh"
   DESCRIPTION "Deformable library of the Medical Image Registration ToolKit."
-  COPYRIGHT   "2013-2015 Imperial College London, Andreas Schuh"
+  COPYRIGHT   "2013-2016 Imperial College London, Andreas Schuh"
   LICENSE     "Apache License Version 2.0"
   CONTACT     "Andreas Schuh <andreas.schuh.84@gmail.com>"
   TEMPLATE    "mirtk-module/1.0"


Add a macro allowing to use moc for the BALL library

--- cmake/BALLMacros.cmake
+++ cmake/BALLMacros.cmake
@@ -185,6 +185,31 @@

 		### and add them to the sources ###
 		SET(VIEW_sources ${VIEW_sources} ${OUTFILE})
+
+		### source group definition ###
+		STRING(REGEX REPLACE "/" "\\\\" S_GROUP ${GROUP})
+		SOURCE_GROUP("Source Files\\\\${S_GROUP}" FILES ${OUTFILE})
+	ENDFOREACH()
+ENDMACRO()
+
+MACRO(ADD_BALL_CORE_MOCFILES GROUP INPUT_DIRECTORY MOC_LIST)
+	SET(DIRECTORY source/${GROUP})
+
+	### for out of source builds, the output directory might not yet exist ###
+	FILE(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/${DIRECTORY})
+
+	### iterate over the moc files ###
+	FOREACH(i ${MOC_LIST})
+		GET_FILENAME_COMPONENT(NAME_BASE ${i} NAME_WE)
+
+		SET(MOC_FILE ${INPUT_DIRECTORY}/${NAME_BASE}.h)
+		SET(OUTFILE  ${PROJECT_BINARY_DIR}/${DIRECTORY}/moc_${NAME_BASE}.C)
+
+		### generate the corresponding moc files ###
+		QT4_GENERATE_MOC(${MOC_FILE} ${OUTFILE})
+
+		### and add them to the sources ###
+		SET(BALL_sources ${BALL_sources} ${OUTFILE})

 		### source group definition ###
 		STRING(REGEX REPLACE "/" "\\\\" S_GROUP ${GROUP})


QT4_EXTRACT_OPTIONS CMake macro changed in CMake 2.8.12; fixed BALLMacros.cmake

--- cmake/BALLMacros.cmake
+++ cmake/BALLMacros.cmake
@@ -6,16 +6,22 @@
 ### minor modifications (marked with ## BALL ###)
 ###
 MACRO(QT4_WRAP_UI_BALL outfiles )
-  QT4_EXTRACT_OPTIONS(ui_files ui_options ${ARGN})
-
-	### BALL ###
+  # since 2.8.12 qt4_extract_options has an additional argument
+  # copied fix from OpenMS
+  IF(${CMAKE_VERSION} VERSION_LESS "2.8.12")
+      QT4_EXTRACT_OPTIONS(ui_files ui_options ${ARGN})
+  ELSE()
+      QT4_EXTRACT_OPTIONS(ui_files ui_options ui_target ${ARGN})
+  ENDIF()
+
+  ### BALL ###
   # create output directory (will not exist for out-of-source builds)
   FILE(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/include/BALL/VIEW/UIC/)

   FOREACH (it ${ui_files})
     GET_FILENAME_COMPONENT(outfile ${it} NAME_WE)
     GET_FILENAME_COMPONENT(infile ${it} ABSOLUTE)
-		### BALL ###
+    ### BALL ###
     SET(outfile ${PROJECT_BINARY_DIR}/include/BALL/VIEW/UIC/ui_${outfile}.h)
     ADD_CUSTOM_COMMAND(OUTPUT ${outfile}
       COMMAND ${QT_UIC_EXECUTABLE}


MINIFICPP-279 Including Boost includes for BuildTests to resolve build issue in PutFileTests

This closes #167.

Signed-off-by: Marc Parisi <3cd89688bb0a35b1f4229ca5a98e5d7bf31861da@apache.org>

--- cmake/BuildTests.cmake
+++ cmake/BuildTests.cmake
@@ -53,6 +53,7 @@
     target_include_directories(${testName} PRIVATE BEFORE "${CMAKE_SOURCE_DIR}/libminifi/include/utils")
     target_include_directories(${testName} PRIVATE BEFORE "${CMAKE_SOURCE_DIR}/libminifi/include/processors")
     target_include_directories(${testName} PRIVATE BEFORE "${CMAKE_SOURCE_DIR}/libminifi/include/provenance")
+    target_include_directories(${testName} PRIVATE BEFORE "${Boost_INCLUDE_DIRS}")
     target_link_libraries(${testName} ${CMAKE_THREAD_LIBS_INIT} ${OPENSSL_LIBRARIES} core-minifi minifi yaml-cpp c-library civetweb-cpp ${JSON_CPP_LIB})
     target_link_libraries(${testName} ${Boost_SYSTEM_LIBRARY})
     target_link_libraries(${testName} ${Boost_FILESYSTEM_LIBRARY})


Add clang-format to the list of names after the one suffixed by 3.9

--- cmake/CodeFormat.cmake
+++ cmake/CodeFormat.cmake
@@ -3,6 +3,7 @@
         NAMES
         clang-format-3.9
         clang-format-mp-3.9
+        clang-format
     )
     if(CLANG_FORMAT_EXECUTABLE)
         message("-- Found clang-format: ${CLANG_FORMAT_EXECUTABLE}")


Remove bad import

Remove bad import

--- cmake/DaemonCBSE.cmake
+++ cmake/DaemonCBSE.cmake
@@ -49,7 +49,7 @@
     # Check if python has all the dependencies
     # TODO: Execute pip directly here and install them
     execute_process(
-        COMMAND ${PYTHON_EXECUTABLE} -c "import jinja2, yaml, collections.namedtuple, argparse, sys, os.path, re"
+        COMMAND ${PYTHON_EXECUTABLE} -c "import jinja2, yaml, collections, argparse, sys, os.path, re"
         RESULT_VARIABLE RET)
     if (NOT RET EQUAL 0)
         message(FATAL_ERROR "Missing dependences for CBSE generation. Use pip -r install src/utils/cbse/requirements.txt to install")


Mark BUILTIN_FOO and ENABLE_FOO as advanced if they use default values.

Co-authored-by: Jean-Christophe Fillion-Robin <859d3fd8ca46de62a08fca56c64958e301f5352c@kitware.com>

--- cmake/Extensions.cmake
+++ cmake/Extensions.cmake
@@ -66,9 +66,15 @@
            "Controls whether the \"${name}\" extension will be built"
            ON
     )
+    if(ENABLE_${upper_name})
+        mark_as_advanced(FORCE ENABLE_${upper_name})
+    else()
+        mark_as_advanced(CLEAR ENABLE_${upper_name})
+    endif()

     # Add options that the extention is either external to libpython or
-    # builtin.
+    # builtin.  These will be marked as advanced unless different from default
+    # values
     if(NOT ADD_PYTHON_EXTENSION_BUILTIN)
         set(ADD_PYTHON_EXTENSION_BUILTIN ${BUILD_EXTENSIONS_AS_BUILTIN})
     endif()
@@ -76,6 +82,12 @@
            "If this is set the \"${name}\" extension will be compiled in to libpython"
            ${ADD_PYTHON_EXTENSION_BUILTIN}
     )
+    if((BUILTIN_${upper_name} AND BUILD_EXTENSIONS_AS_BUILTIN)
+       OR (NOT BUILTIN_${upper_name} AND NOT BUILD_EXTENSIONS_AS_BUILTIN))
+        mark_as_advanced(FORCE BUILTIN_${upper_name})
+    else()
+        mark_as_advanced(CLEAR BUILTIN_${upper_name})
+    endif()

     # HACK _ctypes_test should always be shared
     if(${name} STREQUAL "_ctypes_test")


Never build '_ctypes_test' as builtin extension

ctypes tests expect the module to be shared.

--- cmake/Extensions.cmake
+++ cmake/Extensions.cmake
@@ -68,6 +68,12 @@
            "If this is set the \"${name}\" extension will be compiled in to libpython"
            ${ADD_PYTHON_EXTENSION_BUILTIN}
     )
+
+    # HACK _ctypes_test should always be shared
+    if(${name} STREQUAL "_ctypes_test")
+        unset(BUILTIN_${upper_name} CACHE)
+        set(BUILTIN_${upper_name} 0)
+    endif()

     # Check all the things we require are found.
     set(missing_deps "")


Python2 Cmake Fixes for UNIX.

Python2 Cmake Fixes for UNIX.

--- cmake/FindPython.cmake
+++ cmake/FindPython.cmake
@@ -133,20 +133,120 @@

 elseif(UNIX)
     set(UNIX_INCLUDE_PATHS /usr/local/pyenv/versions/2.7.6/include/python2.7 /usr/include/python2.7 /usr/include/python2.6 /usr/include/python2.5)
-    set(UNIX_LIB_PATHS /usr/local/pyenv/versions/2.7.6/lib/ /usr/lib/i386-linux-gnu)
-    find_path(PYTHON_INCLUDE_DIR Python.h ${UNIX_INCLUDE_PATHS})
-    if(BUILD_SHARED_LIBS)
-        set(PYTHON_UNIX_LIBS libpython2.7.so libpython2.6.so libpython2.5.so libpython2.4.so)
-    else()
-        set(PYTHON_UNIX_LIBS libpython2.7.a libpython2.6.a libpython2.5.a libpython2.4.a)
+     set(UNIX_LIB_PATHS /usr/local/pyenv/versions/2.7.6/lib/ /usr/lib/i386-linux-gnu /usr/lib/python2.7 /usr/lib/python2.6 /usr/lib/python2.5)
+
+
+    #numpy
+    find_path(PYTHON_BASE_DIR python python2.7 python2.6 python2.5 python2.4 ${PYTHON_BASE_DIR})
+
+    execute_process(COMMAND "${PYTHON_BASE_DIR}/python" "-c"
+                        "try: import sys; print(sys.path);\nexcept: print('failed')\n"
+                        RESULT_VARIABLE PIP_STATUS
+                        OUTPUT_VARIABLE PYTHON_SYS_PATH_OUTPUT
+                        ERROR_VARIABLE PIP_ERROR
+                        OUTPUT_STRIP_TRAILING_WHITESPACE
+                       )
+    if (PYTHON_SYS_PATH_OUTPUT MATCHES "failed")
+    	message (FATAL_ERROR "Failed to find system path " )
     endif()
-    find_library(PYTHON_LIBRARIES NAMES ${PYTHON_UNIX_LIBS} PATHS ${UNIX_LIB_PATHS})
-
-    FIND_PACKAGE_HANDLE_STANDARD_ARGS(Python DEFAULT_MSG PYTHON_LIBRARIES PYTHON_INCLUDE_DIR)
-
+
+    #FIND_PACKAGE_HANDLE_STANDARD_ARGS(Python DEFAULT_MSG PYTHON_LIBRARIES PYTHON_INCLUDE_DIR)
+
+
+    #message (FATAL_ERROR "System path from python " ${PYTHON_SYS_PATH_OUTPUT} )
+
+    if(PYTHON_BASE_DIR)
+        find_path(PYTHON_INCLUDE_DIR Python.h ${UNIX_INCLUDE_PATHS})
+
+    	if(BUILD_SHARED_LIBS)
+    	    set(PYTHON_LIBRARY libpython2.7 libpython2.7.so libpython2.6.so libpython2.5.so libpython2.4.so)
+    	else()
+    	    set(PYTHON_LIBRARY libpython2.7 libpython2.7.a libpython2.6.a libpython2.5.a libpython2.4.a)
+    	endif()
+
+    	find_library(PYTHON_LIBRARIES GLOB_RECURSE NAMES ${PYTHON_LIBRARY} PATHS ${UNIX_LIB_PATHS})
+
+	find_path(PYTHON_LIBRARY_DIR GLOB_RECURSE NAMES ${PYTHON_LIBRARY}  PATHS ${UNIX_LIB_PATHS})
+
+	#get_filename_component(PYTHON_LIBRARY_DIR PYTHON_LIBRARIES DIRECTORY)
+        #get_filename_component(PYTHON_LIBRARIES ${PYTHON_LIBRARIES} NAME)
+    endif(PYTHON_BASE_DIR)
+
+    if(PYTHON_BASE_DIR AND IVW_MODULE_PYPACKAGES)
+
+        #numpy
+        execute_process(COMMAND "${PYTHON_BASE_DIR}/python" "-c"
+                        "import numpy; print(numpy.__version__)"
+                        RESULT_VARIABLE NUMPY_STATUS
+                        OUTPUT_VARIABLE NUMPY_OUTPUT_VERSION
+                        ERROR_VARIABLE NUMPY_ERROR
+                        OUTPUT_STRIP_TRAILING_WHITESPACE
+                       )
+
+        if (NUMPY_OUTPUT_VERSION MATCHES "failed")
+            message (FATAL_ERROR "Missing Missing Python Package Numpy. Install using pip or easy_install ")
+        endif()
+
+        #message (FATAL_ERROR "Numpy Status " "${NUMPY_STATUS}" )
+        #message (FATAL_ERROR "Numpy Version " "${NUMPY_OUTPUT_VERSION}" )
+        #message (FATAL_ERROR "Numpy Error " "${NUMPY_ERROR}" )
+
+        execute_process(COMMAND "${PYTHON_BASE_DIR}/python" "-c"
+                        "import numpy;print(numpy.get_include())"
+                        RESULT_VARIABLE NUMPY_STATUS
+                        OUTPUT_VARIABLE NUMPY_OUTPUT_INCLUDES
+                        ERROR_VARIABLE NUMPY_ERROR
+                        OUTPUT_STRIP_TRAILING_WHITESPACE
+                       )
+
+        if (NUMPY_STATUS MATCHES 0)
+            set(PYTHON_NUMPY_FOUND TRUE CACHE INTERNAL "Python numpy development package is available")
+            find_path(PYTHON_NUMPY_INCLUDE_DIR arrayobject.h
+                      "${NUMPY_OUTPUT_INCLUDES}\\numpy"
+                      DOC "Directory where the arrayobject.h header file can be found. This file is part of the numpy package"
+                     )
+            LIST(APPEND PYTHON_INCLUDE_DIR "${PYTHON_NUMPY_INCLUDE_DIR}")
+        else()
+            #message (FATAL_ERROR "Numpy not found : ${NUMPY_OUTPUT_INCLUDES}" )
+            set(PYTHON_NUMPY_FOUND FALSE)
+        endif()
+
+        #Setuptools and EasyInstall
+        execute_process(COMMAND "${PYTHON_BASE_DIR}/python" "-c"
+                        "from setuptools.command import easy_install;import setuptools;print(setuptools.__version__)"
+                        RESULT_VARIABLE SETUPTOOLS_STATUS
+                        OUTPUT_VARIABLE SETUPTOOLS_OUTPUT_VERSION
+                        ERROR_VARIABLE SETUPTOOLS_ERROR
+                        OUTPUT_STRIP_TRAILING_WHITESPACE
+                       )
+        if (SETUPTOOLS_OUTPUT_VERSION MATCHES "failed")
+            message (FATAL_ERROR "Missing Python Package Setuptools. Install using pip or easy_install ")
+        endif()
+
+        #pip
+        execute_process(COMMAND "${PYTHON_BASE_DIR}/python" "-c"
+                        "import pip;print(pip.__version__)"
+                        RESULT_VARIABLE PIP_STATUS
+                        OUTPUT_VARIABLE PIP_OUTPUT_VERSION
+                        ERROR_VARIABLE PIP_ERROR
+                        OUTPUT_STRIP_TRAILING_WHITESPACE
+                       )
+        if (PIP_OUTPUT_VERSION MATCHES "failed")
+            message (FATAL_ERROR "Missing Python Package Pip. Install using easy_install ")
+        endif()
+
+    endif()
+
+    FIND_PACKAGE_HANDLE_STANDARD_ARGS( Python DEFAULT_MSG PYTHON_LIBRARY_DIR PYTHON_INCLUDE_DIR )
+
     mark_as_advanced(PYTHON_FOUND)
+    mark_as_advanced(PYTHON_VERSION)
     mark_as_advanced(PYTHON_INCLUDE_DIR)
     mark_as_advanced(PYTHON_LIBRARY_DIR)
+    mark_as_advanced(PYTHON_LIBRARY)
     mark_as_advanced(PYTHON_LIBRARIES)
+    mark_as_advanced(PYTHON_BASE_DIR)
+    mark_as_advanced(PYTHON_NUMPY_FOUND)
+    mark_as_advanced(PYTHON_NUMPY_INCLUDE_DIR)
 endif()


cmake: Add sorting of linker snippets by key

Allows snippets to be placed in a predictable order into the linker
script. This is useful for data that must be placed at a particular
location.

Signed-off-by: Øyvind Rønningstad <5f9e1eedbdafebd99226f1498f634e1047455d88@nordicsemi.no>

--- cmake/extensions.cmake
+++ cmake/extensions.cmake
@@ -863,7 +863,7 @@
   endif()
 endfunction(zephyr_check_compiler_flag_hardcoded)

-# zephyr_linker_sources(<location> <files>)
+# zephyr_linker_sources(<location> [SORT_KEY <sort_key>] <files>)
 #
 # <files> is one or more .ld formatted files whose contents will be
 #    copied/included verbatim into the given <location> in the global linker.ld.
@@ -878,6 +878,9 @@
 #    RAM_SECTIONS Inside the RAMABLE_REGION GROUP.
 #    SECTIONS     Near the end of the file. Don't use this when linking into
 #                 RAMABLE_REGION, use RAM_SECTIONS instead.
+# <sort_key> is an optional key to sort by inside of each location. The key must
+#    be alphanumeric, and the keys are sorted alphabetically. If no key is
+#    given, the key 'default' is used. Keys are case-sensitive.
 #
 # Use NOINIT, RWDATA, and RODATA unless they don't work for your use case.
 #
@@ -945,7 +948,13 @@
     message(fatal_error "Must choose valid location for linker snippet.")
   endif()

-  foreach(file IN ITEMS ${ARGN})
+  cmake_parse_arguments(L "" "SORT_KEY" "" ${ARGN})
+  set(SORT_KEY default)
+  if(DEFINED L_SORT_KEY)
+    set(SORT_KEY ${L_SORT_KEY})
+  endif()
+
+  foreach(file IN ITEMS ${L_UNPARSED_ARGUMENTS})
     # Resolve path.
     if(IS_ABSOLUTE ${file})
       set(path ${file})
@@ -957,11 +966,18 @@
       message(FATAL_ERROR "zephyr_linker_sources() was called on a directory")
     endif()

-    # Append the file contents to the relevant destination file.
-    file(READ ${path} snippet)
-    file(RELATIVE_PATH relpath ${ZEPHYR_BASE} ${path})
-    file(APPEND ${snippet_path}
-             "\n/* From \${ZEPHYR_BASE}/${relpath}: */\n" "${snippet}\n")
+    # Find the relative path to the linker file from the include folder.
+    file(RELATIVE_PATH relpath ${ZEPHYR_BASE}/include ${path})
+
+    # Create strings to be written into the file
+    set (include_str "/* Sort key: \"${SORT_KEY}\" */#include \"${relpath}\"")
+
+    # Add new line to existing lines, sort them, and write them back.
+    file(STRINGS ${snippet_path} lines) # Get current lines (without newlines).
+    list(APPEND lines ${include_str})
+    list(SORT lines)
+    string(REPLACE ";" "\n;" lines "${lines}") # Add newline to each line.
+    file(WRITE ${snippet_path} ${lines} "\n")
   endforeach()
 endfunction(zephyr_linker_sources)


scopes cuti's definitions to the test target to prevent polluting the other targets

--- cmake/findCUTI.cmake
+++ cmake/findCUTI.cmake
@@ -28,25 +28,18 @@
 set(CUTI_INCLUDE_DIRS ${CUTI_ROOT_DIR}/include)

 IF(USE_CUTI_INTEGRATION AND WIN32)
-	find_package(VisualStudio REQUIRED)
-	add_definitions(-DCUTI_USES_MSVC_UNIT_BACKEND)
-    option(EXCLUDE_TEST_FROM_COVERAGE "Exclude tests from coverage (Cuti)" OFF)
-    IF(EXCLUDE_TEST_FROM_COVERAGE)
-	    add_definitions(-DCUTI_EXCLUDE_TEST_FROM_COVERAGE)
-    ENDIF(EXCLUDE_TEST_FROM_COVERAGE)
-	add_definitions(-DCUTI_WARNING_UNIMPLEMENTED)
+  find_package(VisualStudio REQUIRED)
+  option(EXCLUDE_TEST_FROM_COVERAGE "Exclude tests from coverage (Cuti)" OFF)
   set(CUTI_LIBRARIES_DEBUG ${MSVC_UNIT_TEST_LIB})
-	set(CUTI_LIBRARIES_RELEASE ${MSVC_UNIT_TEST_LIB})
+  set(CUTI_LIBRARIES_RELEASE ${MSVC_UNIT_TEST_LIB})
 ELSE()
-	find_package(CppUnit REQUIRED)
-	add_definitions(-DCUTI_USES_CPPUNIT_BACKEND)
-	add_definitions(-DCPPUNIT_DLL)
+  find_package(CppUnit REQUIRED)
   IF(USE_CUTI_INTEGRATION OR WIN32)
-	  set(CUTI_LIBRARIES_DEBUG ${CPPUNIT_LIBRARIES_DEBUG})
-	  set(CUTI_LIBRARIES_RELEASE ${CPPUNIT_LIBRARIES_RELEASE})
+    set(CUTI_LIBRARIES_DEBUG ${CPPUNIT_LIBRARIES_DEBUG})
+    set(CUTI_LIBRARIES_RELEASE ${CPPUNIT_LIBRARIES_RELEASE})
   ELSE()
     set(CUTI_LIBRARIES_DEBUG ${CPPUNIT_DYN_LIB_DEBUG})
-	  set(CUTI_LIBRARIES_RELEASE ${CPPUNIT_DYN_LIB_RELEASE})
+    set(CUTI_LIBRARIES_RELEASE ${CPPUNIT_DYN_LIB_RELEASE})
   ENDIF()
   include_directories(${CPPUNIT_INCLUDE_DIRS})
 ENDIF(USE_CUTI_INTEGRATION AND WIN32)
@@ -54,9 +47,22 @@
 include_directories(${CUTI_INCLUDE_DIRS})
 get_filename_component(CUTI_INCLUDE ${CUTI_ROOT_DIR}/include/Cuti.h ABSOLUTE)
 IF(USE_CUTI_INTEGRATION AND APPLE)
-	get_filename_component(CUTI_SOURCE ${CUTI_ROOT_DIR}/src/Cuti.mm ABSOLUTE)
-	set_source_files_properties(${CUTI_SOURCE} PROPERTIES COMPILE_FLAGS "-x objective-c++")
+  get_filename_component(CUTI_SOURCE ${CUTI_ROOT_DIR}/src/Cuti.mm ABSOLUTE)
+  set_source_files_properties(${CUTI_SOURCE} PROPERTIES COMPILE_FLAGS "-x objective-c++")
 ENDIF(USE_CUTI_INTEGRATION AND APPLE)
+
+function(cuti_init_target_flags target)
+  IF(USE_CUTI_INTEGRATION AND WIN32)
+    target_compile_definitions(${target} PUBLIC -DCUTI_USES_MSVC_UNIT_BACKEND)
+      IF(EXCLUDE_TEST_FROM_COVERAGE)
+        target_compile_definitions(${target} PUBLIC -DCUTI_EXCLUDE_TEST_FROM_COVERAGE)
+      ENDIF(EXCLUDE_TEST_FROM_COVERAGE)
+    target_compile_definitions(${target} PUBLIC -DCUTI_WARNING_UNIMPLEMENTED)
+  ELSE()
+    target_compile_definitions(${target} PUBLIC -DCUTI_USES_CPPUNIT_BACKEND)
+    target_compile_definitions(${target} PUBLIC -DCPPUNIT_DLL)
+  ENDIF(USE_CUTI_INTEGRATION AND WIN32)
+endfunction(cuti_init_target_flags)

 function(cuti_xctest_add_bundle target testee)
   if(NOT XCTest_FOUND)
@@ -125,4 +131,5 @@

 	target_link_libraries(${target} PRIVATE debug ${CUTI_LIBRARIES_DEBUG} ${testee})
 	target_link_libraries(${target} PRIVATE optimized ${CUTI_LIBRARIES_RELEASE} ${testee})
+  cuti_init_target_flags(${target})
 endfunction(cuti_creates_test_target)


fix for mac

fix for mac

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

--- cmake/gsConfig.cmake
+++ cmake/gsConfig.cmake
@@ -10,11 +10,14 @@
 ## Configuration
 ## #################################################################

-set(GISMO_CXX_VISIBILITY_PRESET hidden)
-set(CMAKE_C_VISIBILITY_PRESET   hidden)
-set(CMAKE_VISIBILITY_INLINES_HIDDEN 1 )
-
 include(CheckCXXCompilerFlag)
+
+if (NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
+  #fixme: enable for Darwin (probably no export explicit template instantiations)
+  set(GISMO_CXX_VISIBILITY_PRESET hidden)
+  set(CMAKE_C_VISIBILITY_PRESET   hidden)
+  set(CMAKE_VISIBILITY_INLINES_HIDDEN 1 )
+endif()

 # Set a default coefficient numeric types if not specified
 if(NOT GISMO_COEFF_TYPE)
@@ -152,7 +155,7 @@
 endif()

 if (MINGW)
-  # export explicit template instantiations (to be fixed)
+  # fixme: export explicit template instantiations in MinGW ?
   set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--export-all-symbols")

   # large files can overflow pe/coff sections, so use the pe+ format
@@ -163,8 +166,8 @@
     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wa,-mbig-obj")
     #set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ffunction-sections -Wl,--gc-sections")
   endif()
-elseif(CMAKE_COMPILER_IS_GNUCXX AND NOT POLICY CMP0063) #not mingw
-#elseif(NOT MSVC AND NOT POLICY CMP0063) #to do: fix clang
+elseif(NOT MSVC AND NOT POLICY CMP0063 AND NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
+  #fixme: enable for Darwin (probably no export explicit template instantiations)
   check_cxx_compiler_flag(-fvisibility=hidden visibility)
     if (visibility) # for object libraries with cmake less than 3.3
       set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility=hidden")