CMake: Bugfix, expose run failure to outside world

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

--- deal.II/cmake/macros/macro_deal_ii_invoke_autopilot.cmake
+++ deal.II/cmake/macros/macro_deal_ii_invoke_autopilot.cmake
@@ -59,7 +59,12 @@
     #
     FILE(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/run_target.cmake
       "SET(ENV{PATH} \"${DEAL_II_PATH}/${DEAL_II_LIBRARY_RELDIR}:\$ENV{PATH}\")\n"
-      "EXECUTE_PROCESS(COMMAND ${CMAKE_CURRENT_BINARY_DIR}/${TARGET_RUN})"
+      "EXECUTE_PROCESS(COMMAND ${CMAKE_CURRENT_BINARY_DIR}/${TARGET_RUN}\n"
+      "  RESULT_VARIABLE _return_value\n"
+      "  )\n"
+      "IF(NOT \"\${_return_value}\" STREQUAL "0")\n"
+      "  MESSAGE(SEND_ERROR \"\nProgram terminated with exit code: \${_return_value}\")\n"
+      "ENDIF()\n"
       )
     ADD_CUSTOM_TARGET(run
       COMMAND ${CMAKE_COMMAND} -P ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/run_target.cmake


[upgrade] Remove unused VTK_DIR

[upgrade] Remove unused VTK_DIR

--- Superbuild/Projects/lidarview.cmake
+++ Superbuild/Projects/lidarview.cmake
@@ -13,7 +13,6 @@
     -DSOFTWARE_VENDOR=${SOFTWARE_VENDOR}
     -Dsuperbuild_python_version=${superbuild_python_version}
     -DParaView_DIR:PATH=${SuperBuild_BINARY_DIR}/common-superbuild/paraview/build
-    -DVTK_DIR:PATH=${SuperBuild_BINARY_DIR}/common-superbuild/paraview/build/VTK
     -DCMAKE_CXX_STANDARD:STRING=${CMAKE_CXX_STANDARD}
     -Dparaview_version=${paraview_version}
     -Dqt_version:STRING=${qt_version}


Allow building unversioned libraries

Allow building unversioned libraries

Third-party applications which embed OCE may find convenient
to drop version numbers from libraries.  With this commit, one
can call cmake -DOCE_NO_LIBRARY_VERSION=ON.
This is based on a similar feature found in VTK.

--- adm/cmake/BuildToolkit.cmake
+++ adm/cmake/BuildToolkit.cmake
@@ -93,10 +93,13 @@

 # TODO Add current toolkit header files into a source group?
 # Add target specific locations of *.lxx and *.ixx files
-SET_TARGET_PROPERTIES(${TOOLKIT} PROPERTIES
-	SOVERSION ${${PROJECT_NAME}_ABI_SOVERSION}
-	VERSION ${${PROJECT_NAME}_ABI_VERSION}
-)
+IF(NOT ${PROJECT_NAME}_NO_LIBRARY_VERSION)
+    SET_TARGET_PROPERTIES(${TOOLKIT} PROPERTIES
+	    SOVERSION ${${PROJECT_NAME}_ABI_SOVERSION}
+	    VERSION ${${PROJECT_NAME}_ABI_VERSION}
+    )
+ENDIF(NOT ${PROJECT_NAME}_NO_LIBRARY_VERSION)
+
 IF(DEFINED X11_FONT_PATH)
 	SET_SOURCE_FILES_PROPERTIES("${${PROJECT_NAME}_SOURCE_DIR}/src/OSD/OSD_FontMgr.cxx" PROPERTIES COMPILE_FLAGS "-DX11_FONT_PATH=\"${X11_FONT_PATH}\"")
 ENDIF(DEFINED X11_FONT_PATH)


Bug fix for code coverage script. make coverage_init is not part of make all any more, as a clean checkout would fail to build.

--- external/cmake_modules/UseCodeCoverage.cmake
+++ external/cmake_modules/UseCodeCoverage.cmake
@@ -43,7 +43,7 @@
         add_definitions( -fprofile-arcs -ftest-coverage )
         link_libraries( gcov )
         set( CMAKE_EXE_LINKER_FLAGS ${CMAKE_EXE_LINKER_FLAGS} --coverage )
-        add_custom_target( coverage_init ALL ${CODECOV_LCOV} --base-directory . --directory ${CMAKE_BINARY_DIR} --output-file ${CODECOV_OUTPUTFILE} --capture --initial )
+        add_custom_target( coverage_init ${CODECOV_LCOV} --base-directory . --directory ${CMAKE_BINARY_DIR} --output-file ${CODECOV_OUTPUTFILE} --capture --initial )
         add_custom_target( coverage ${CODECOV_LCOV} --base-directory . --directory ${CMAKE_BINARY_DIR} --output-file ${CODECOV_OUTPUTFILE} --capture COMMAND genhtml -o ${CODECOV_HTMLOUTPUTDIR} ${CODECOV_OUTPUTFILE} )
     endif ( CMAKE_COMPILER_IS_GNUCXX )


Add OpenGL libraries to GLBINDING_LIBRARIES

--- glbinding-config.cmake
+++ glbinding-config.cmake
@@ -8,6 +8,8 @@
 # GLBINDING_LIBRARY_RELEASE
 # GLBINDING_LIBRARY_DEBUG
 # GLBINDING_INCLUDE_DIR
+
+find_package(OpenGL REQUIRED)

 include(FindPackageHandleStandardArgs)

@@ -88,6 +90,8 @@

 endmacro()

+set(GLBINDING_LIBRARIES "${OPENGL_LIBRARIES}")
+
 find(glbinding glbinding/glbinding_api.h ${LIB_PATHS})

 # DEBUG


install flexisip_stats.py and flexisip_monitor.py

--- build/rpm/flexisip.spec.cmake
+++ build/rpm/flexisip.spec.cmake
@@ -129,6 +129,11 @@
 %install
 make install DESTDIR=%{buildroot}

+
+#
+# Shouldn't be the role of cmake to install all the following stuff ?
+# It is surprising to let the specfile install all these things from the source tree.
+#
 mkdir -p  $RPM_BUILD_ROOT/etc/init.d
 mkdir -p  $RPM_BUILD_ROOT/etc/flexisip
 mkdir -p  $RPM_BUILD_ROOT/%{_docdir}
@@ -154,6 +159,9 @@
 %endif
 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d
 install -p -m 0644 scripts/flexisip-logrotate $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d
+
+install -p -m 0744 scripts/flexisip_stats.py $RPM_BUILD_ROOT%{_bindir}
+install -p -m 0744 scripts/flexisip_monitor.py $RPM_BUILD_ROOT%{_bindir}

 %if %{bcpkg}
 export QA_RPATHS=0x0003


Fix typo.

Fix typo.

--- cmake/Modules/FindCMSIS.cmake
+++ cmake/Modules/FindCMSIS.cmake
@@ -126,7 +126,7 @@
     FOREACH(CHIP_TYPE ${STM32_CHIP_TYPES})
         STRING(TOLOWER ${CHIP_TYPE} CHIP_TYPE_LOWER)
         LIST(APPEND ${LIBRARIES} ${NAME}_${STM32_FAMILY_LOWER}_${CHIP_TYPE_LOWER})
-        ADD_LIBRARY(${NAME}_${STM32_FAMILY_LOWER}_${CHIP_TYPE_LOWER} ${BAREMETAL_DELAY_SOURCES})
+        ADD_LIBRARY(${NAME}_${STM32_FAMILY_LOWER}_${CHIP_TYPE_LOWER} ${SOURCES})
         STM32_SET_CHIP_DEFINITIONS(${NAME}_${STM32_FAMILY_LOWER}_${CHIP_TYPE_LOWER} ${CHIP_TYPE})
     ENDFOREACH()
 ENDMACRO()


changing windows search path for new version of flann

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

--- cmake/Modules/FindFlann.cmake
+++ cmake/Modules/FindFlann.cmake
@@ -13,7 +13,7 @@

 find_path(FLANN_INCLUDE_DIR flann/flann.hpp
           HINTS ${PC_FLANN_INCLUDEDIR} ${PC_FLANN_INCLUDE_DIRS} "${FLANN_ROOT}" "$ENV{FLANN_ROOT}"
-          PATHS "$ENV{PROGRAMFILES}/flann 1.6.8" "$ENV{PROGRAMW6432}/flann 1.6.8"
+          PATHS "$ENV{PROGRAMFILES}/flann 1.6.9" "$ENV{PROGRAMW6432}/flann 1.6.9"
           PATH_SUFFIXES include)

 # Prefer static libraries in Windows over shared ones
@@ -21,13 +21,13 @@
   find_library(FLANN_LIBRARY
                NAMES flann_cpp_s flann_cpp
                HINTS ${PC_FLANN_LIBDIR} ${PC_FLANN_LIBRARY_DIRS} "${FLANN_ROOT}" "$ENV{FLANN_ROOT}"
-               PATHS "$ENV{PROGRAMFILES}/flann 1.6.8" "$ENV{PROGRAMW6432}/flann 1.6.8"
+               PATHS "$ENV{PROGRAMFILES}/flann 1.6.9" "$ENV{PROGRAMW6432}/flann 1.6.9"
                PATH_SUFFIXES lib)

   find_library(FLANN_LIBRARY_DEBUG
                NAMES flann_cpp_s-gd flann_cpp-gd flann_cpp_s flann_cpp
                HINTS ${PC_FLANN_LIBDIR} ${PC_FLANN_LIBRARY_DIRS} "${FLANN_ROOT} $ENV{FLANN_ROOT}"
-               PATHS "$ENV{PROGRAMFILES}/flann 1.6.8" "$ENV{PROGRAMW6432}/flann 1.6.8"
+               PATHS "$ENV{PROGRAMFILES}/flann 1.6.9" "$ENV{PROGRAMW6432}/flann 1.6.9"
                PATH_SUFFIXES lib)
 else(WIN32)
   find_library(FLANN_LIBRARY


Improve build warnings

Improve build warnings

Port of the stuff from lxqt-build-tools.

--- cmake/compiler_settings.cmake
+++ cmake/compiler_settings.cmake
@@ -81,18 +81,25 @@
     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-exceptions")
 endif()

-
 #-----------------------------------------------------------------------------
 # Common warning flags
 #-----------------------------------------------------------------------------
-set(QTXDG_COMMON_WARNING_FLAGS "-Wall")
+set(QTXDG_COMMON_WARNING_FLAGS "-Wall -Wextra -Wchar-subscripts -Wno-long-long -Wpointer-arith -Wundef -Wformat-security")

 #-----------------------------------------------------------------------------
 # Warning flags
 #-----------------------------------------------------------------------------
+if (CMAKE_COMPILER_IS_GNUCXX OR QTXDG_COMPILER_IS_CLANGCXX)
+    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${__QTXDG_COMMON_WARNING_FLAGS} -Wnon-virtual-dtor -Woverloaded-virtual -Wpedantic")
+endif()
+
+if (QTXDG_COMPILER_IS_CLANGCXX)
+    # qCDebug(), qCWarning, etc trigger a very verbose warning, about.... nothing. Disable it.
+    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-gnu-zero-variadic-macro-arguments")
+endif()
+
 list(APPEND QTXDG_WARNING_FLAGS ${QTXDG_COMMON_WARNING_FLAGS})
-add_definitions(${QTXDG_WARNING_FLAGS})

 #-----------------------------------------------------------------------------
 # String conversion flags


Use GIT_SHALLOW. (#4902)

Use GIT_SHALLOW. (#4902)

Co-authored-by: Robert Kimball <f8f4fb0160c4e961c3d6afdbdcc40cfc21344ca8@intel.com>

--- cmake/external_pybind11.cmake
+++ cmake/external_pybind11.cmake
@@ -27,6 +27,7 @@
     ext_pybind11
     GIT_REPOSITORY ${PYBIND11_GIT_URL}
     GIT_TAG        ${PYBIND11_GIT_TAG}
+    GIT_SHALLOW    1
 )

 FetchContent_GetProperties(ext_pybind11)


Fix SHA1 for manually downloaded hunter with git

When using CMake 3.0.x, with manually downloaded Hunter the examples
fails with:

CMake Error at /home/pretyman/.hunter/gate/cmake/HunterGate.cmake:124
(string):
  string end index: 7 is out of range -1 - 1
Call Stack (most recent call first):
  /home/pretyman/.hunter/gate/cmake/HunterGate.cmake:447
(hunter_gate_self)
  /home/pretyman/.hunter/examples/common.cmake:33 (HunterGate)
  CMakeLists.txt:5 (include)

Because the SHA1 passed by examples/common.cmake is too short, so it
was expanded to 7 characters to avoid this error.

--- examples/common.cmake
+++ examples/common.cmake
@@ -30,5 +30,5 @@
   HunterGate(URL "${TESTING_URL}" SHA1 "${TESTING_SHA1}")
 else()
   get_filename_component(HUNTER_ROOT "${CMAKE_CURRENT_LIST_DIR}/.." ABSOLUTE)
-  HunterGate(URL "x" SHA1 "x")
+  HunterGate(URL "x" SHA1 "xxxxxxxx")
 endif()


OCIO 2.1 now exports cmake config -- explain

--- src/cmake/modules/FindOpenColorIO.cmake
+++ src/cmake/modules/FindOpenColorIO.cmake
@@ -3,12 +3,21 @@
 # This module will first look into the directories hinted by the variables:
 #   - OpenColorIO_ROOT
 #
-# This module defines the following variables:
+# This module defines the following targets:
+#
+#   - OpenColorIO::OpenColorIO
+#
+# Old style CMake, this module also defines the following variables:
 #
 # OPENCOLORIO_FOUND       - True if OpenColorIO was found.
 # OPENCOLORIO_INCLUDES    - where to find OpenColorIO.h
 # OPENCOLORIO_LIBRARIES   - list of libraries to link against when using OpenColorIO
 # OPENCOLORIO_DEFINITIONS - Definitions needed when using OpenColorIO
+#
+# OpenColorIO 2.1 exports proper cmake config files on its own.
+# Once OCIO 2.1 is our new minimum, this FindOpenColorIO.cmake will
+# eventually be deprecated and disappear.
+#

 include (FindPackageHandleStandardArgs)
 include (FindPackageMessage)


(CMAKE) Add float support with newlib

(CMAKE) Add float support with newlib

--- backends/cmake/project.cmake
+++ backends/cmake/project.cmake
@@ -5,7 +5,7 @@
 set(COMMON_COMPILE_FLAGS "-Os -g -Werror -Wno-error=cpp -Wextra -Warray-bounds -ffunction-sections -fdata-sections")
 #set(COMMON_COMPILE_FLAGS "-Os -Werror -Wextra -Warray-bounds -ffunction-sections -fdata-sections")
 #-u _printf_float
-set(COMMON_LINK_FLAGS "-Wl,--gc-sections --specs=nano.specs")
+set(COMMON_LINK_FLAGS "-Wl,--gc-sections --specs=nano.specs -u _printf_float")

 #load all mcus
 include(mcus)


msvc build flag.

msvc build flag.

--- cmake/CompillerSettings.cmake
+++ cmake/CompillerSettings.cmake
@@ -45,7 +45,7 @@
   add_definitions(-DMSVC)
   add_definitions(-D_ENABLE_ATOMIC_ALIGNMENT_FIX)

-  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_WIN32_WINNT=0x0501")
+  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_WIN32_WINNT=0x0501 /EHsc")
   set(CMAKE_CXX_FLAGS_RELEASE "/Ox /GT /Ot -DNDEBUG")
   set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Oy") #-fno-omit-frame-pointer analog
   set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DDEBUG")


Revert relabeled 'build' directory for protobuf compilation

--- cmake/External/Protobuf.cmake
+++ cmake/External/Protobuf.cmake
@@ -24,16 +24,16 @@
     ExternalProject_Add(protobuf_external
       SOURCE_DIR ${CMAKE_SOURCE_DIR}/third_party/protobuf
       BUILD_IN_SOURCE 1
-      CONFIGURE_COMMAND "./autogen.sh" COMMAND ./configure --prefix=${CMAKE_SOURCE_DIR}/third_party/protobuf/_build
+      CONFIGURE_COMMAND "./autogen.sh" COMMAND ./configure --prefix=${CMAKE_SOURCE_DIR}/third_party/protobuf/build
       BUILD_COMMAND make
       INSTALL_COMMAND make install
       )

     set(PROTOBUF_FOUND TRUE)
-    set(PROTOBUF_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/third_party/protobuf/_build/include)
-    set(PROTOBUF_LIBRARIES ${CMAKE_SOURCE_DIR}/third_party/protobuf/_build/lib/libprotobuf.so)
-    set(PROTOBUF_LIBRARY_DIRS ${CMAKE_SOURCE_DIR}/third_party/protobuf/_build/lib)
-    set(PROTOBUF_PROTOC_EXECUTABLE ${CMAKE_SOURCE_DIR}/third_party/protobuf/_build/bin/protoc)
+    set(PROTOBUF_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/third_party/protobuf/build/include)
+    set(PROTOBUF_LIBRARIES ${CMAKE_SOURCE_DIR}/third_party/protobuf/build/lib/libprotobuf.so)
+    set(PROTOBUF_LIBRARY_DIRS ${CMAKE_SOURCE_DIR}/third_party/protobuf/build/lib)
+    set(PROTOBUF_PROTOC_EXECUTABLE ${CMAKE_SOURCE_DIR}/third_party/protobuf/build/bin/protoc)
     set(PROTOBUF_EXTERNAL TRUE)

     list(APPEND external_project_dependencies protobuf_external)


Now it works - including reusing the cache after gpgme is found once

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

--- cmake/modules/FindGpgme.cmake
+++ cmake/modules/FindGpgme.cmake
@@ -5,32 +5,38 @@
 #  GPGME_INCLUDE_DIR - the gpgme include directory
 #  GPGME_LIBRARIES - The libraries needed to use gpgme

-FIND_PROGRAM(GPGMECONFIG_EXECUTABLE NAMES gpgme-config)
+# if not already in cache
+IF (NOT GPGME_LIBRARIES OR NOT GPGME_INCLUDE_DIR)
+  set(GPGME_FOUND FALSE)

-#reset vars
-set(GPGME_LIBRARIES)
-set(GPGME_INCLUDE_DIR)
+  FIND_PROGRAM(GPGMECONFIG_EXECUTABLE NAMES gpgme-config)

-# if gpgme-config has been found
-IF (GPGMECONFIG_EXECUTABLE)
+  # if gpgme-config has been found
+  IF (GPGMECONFIG_EXECUTABLE)
+    EXEC_PROGRAM(${GPGMECONFIG_EXECUTABLE} ARGS --libs RETURN_VALUE _return_VALUE OUTPUT_VARIABLE GPGME_LIBRARIES)

-  EXEC_PROGRAM(${GPGMECONFIG_EXECUTABLE} ARGS --libs RETURN_VALUE _return_VALUE OUTPUT_VARIABLE GPGME_LIBRARIES)
+    EXEC_PROGRAM(${GPGMECONFIG_EXECUTABLE} ARGS --cflags RETURN_VALUE _return_VALUE OUTPUT_VARIABLE GPGME_CFLAGS)
+    IF (GPGME_CFLAGS)
+      # problem: here I get two identical -I directives, and having two paths in INCLUDE_DIR breaks
+      # so for now I just keep the first -Ifoo, but this might need to be fixed at some point...
+      STRING(REGEX REPLACE "-I([^ ]*).*" "\\1" GPGME_INCLUDE_DIR "${GPGME_CFLAGS}")
+    ENDIF (GPGME_CFLAGS)

-  EXEC_PROGRAM(${GPGMECONFIG_EXECUTABLE} ARGS --cflags RETURN_VALUE _return_VALUE OUTPUT_VARIABLE GPGME_INCLUDE_DIR)
+    # ensure that they are cached
+    set(GPGME_INCLUDE_DIR ${GPGME_INCLUDE_DIR} CACHE INTERNAL "The gpgme include path")
+    set(GPGME_LIBRARIES ${GPGME_LIBRARIES} CACHE INTERNAL "The gpgme libraries")
+
+  ENDIF (GPGMECONFIG_EXECUTABLE)

   IF (GPGME_LIBRARIES AND GPGME_INCLUDE_DIR)
-    SET(GPGME_FOUND TRUE)
-    STRING(REGEX REPLACE "-I(.+)" "\\1" GPGME_INCLUDE_DIR "${GPGME_INCLUDE_DIR}")
-    message(STATUS "Found gpgme: ${GPGME_LIBRARIES}")
+      set(GPGME_FOUND TRUE)
+      #message(STATUS "Found gpgme: includes: ${GPGME_INCLUDE_DIR} libs: ${GPGME_LIBRARIES}")
+      message(STATUS "Found gpgme using ${GPGMECONFIG_EXECUTABLE}.")
   ENDIF (GPGME_LIBRARIES AND GPGME_INCLUDE_DIR)

   IF (NOT GPGME_FOUND)
-    message(FATAL_ERROR "You are missing gpgme 0.4.5 or higher.
-  Download gpgme >= 0.4.5 from ftp://ftp.gnupg.org/gcrypt/alpha/gpgme
-  or use the --with-gpgme-prefix=/path/where/gpgme/is/installed option.")
-
+      message(FATAL_ERROR "You are missing gpgme 0.4.5 or higher.
+    Download gpgme >= 0.4.5 from ftp://ftp.gnupg.org/gcrypt/alpha/gpgme
+    or use the --with-gpgme-prefix=/path/where/gpgme/is/installed option.")
   ENDIF (NOT GPGME_FOUND)
-
-  MARK_AS_ADVANCED(GPGME_INCLUDE_DIR GPGME_LIBRARIES)
-
-ENDIF (GPGMECONFIG_EXECUTABLE)
+ENDIF (NOT GPGME_LIBRARIES OR NOT GPGME_INCLUDE_DIR)


Set the include dir for NumPy in the cache

--- cmake/modules/FindNumPy.cmake
+++ cmake/modules/FindNumPy.cmake
@@ -17,7 +17,8 @@
     ERROR_QUIET)

   if (${__numpy_include_dir_res} EQUAL 0)
-    set(NUMPY_INCLUDE_DIR "${__numpy_include_dir}")
+    set(NUMPY_INCLUDE_DIR "${__numpy_include_dir}"
+      CACHE PATH "Include directory for NumPy headers")
   endif ()
 endif ()


Bug 781645 - Skip GSettings schema compile when DESTDIR is set

--- cmake/modules/GLibTools.cmake
+++ cmake/modules/GLibTools.cmake
@@ -238,9 +238,11 @@
 	if(_install_code)
 		# Compile gsettings schemas and ensure that all of them are in the place.
 		install(CODE
-			"execute_process(${_install_code}
-				COMMAND ${CMAKE_COMMAND} -E chdir . \"${GLIB_COMPILE_SCHEMAS}\" \"${GSETTINGS_SCHEMAS_DIR}\"
-			)")
+			"if(\"\$ENV{DESTDIR}\" STREQUAL \"\")
+				execute_process(${_install_code}
+					COMMAND ${CMAKE_COMMAND} -E chdir . \"${GLIB_COMPILE_SCHEMAS}\" \"${GSETTINGS_SCHEMAS_DIR}\"
+				)
+			endif(\"\$ENV{DESTDIR}\" STREQUAL \"\")")
 	endif(_install_code)
 endmacro(add_gsettings_schemas)


[CMAKE] Properly clean the junit reports

Summary:
The merged test suite junit reports from `test/junit` are correclty
cleaned, but not the intermediate test reports located in the current
binary directory.

Test Plan:
  ninja check
Check there is a lot of xml reports here:
  ls src/test
Then:
  ninja clean
  ls src/test
Check the reports are gone as expected.

Reviewers: #bitcoin_abc, jasonbcox

Reviewed By: #bitcoin_abc, jasonbcox

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

--- cmake/modules/TestSuite.cmake
+++ cmake/modules/TestSuite.cmake
@@ -181,7 +181,13 @@
 		get_filename_component(_test_name "${_test_source}" NAME_WE)

 		if(ENABLE_JUNIT_REPORT)
-			set(JUNIT_LOGGER ":JUNIT,message,${SUITE}-${_test_name}.xml")
+			set(JUNIT_REPORT_FILE "${SUITE}-${_test_name}.xml")
+			set(JUNIT_LOGGER ":JUNIT,message,${JUNIT_REPORT_FILE}")
+			set_property(
+				DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
+				APPEND PROPERTY ADDITIONAL_CLEAN_FILES
+					"${JUNIT_REPORT_FILE}"
+			)
 		endif()

 		add_test_runner(


[C++, Build] make mosquitto find module platform independent

Change-Id: I59b60bf117c8d5c2345b348106dbf355f9cbc145

--- cpp/CMake/Findmosquitto.cmake
+++ cpp/CMake/Findmosquitto.cmake
@@ -1,5 +1,5 @@
 find_path(MOSQUITTO_INCLUDE_DIR mosquittopp.h)
-find_library(MOSQUITTO_LIBRARY libmosquittopp.so)
+find_library(MOSQUITTO_LIBRARY "libmosquittopp${CMAKE_SHARED_LIBRARY_SUFFIX}")

 set(MOSQUITTO_INCLUDE_DIRS ${MOSQUITTO_INCLUDE_DIR} )
 set(MOSQUITTO_LIBRARIES ${MOSQUITTO_LIBRARY} )


Added INCLUDE_PREFIX option for flatbuffers_generate_headers (#5866)

This option was in an earlier revision of flatbuffers_generate_headers
but was lost while refactoring by mistake. We have it as a function
argument rather than one of the optional flags so that we can use it to
inform the rule where to place the generated headers, so that the file
location matches the prefix that will be added to the filenames in the
generated files.

Also fixed some of the documentation in the file.

--- CMake/BuildFlatBuffers.cmake
+++ CMake/BuildFlatBuffers.cmake
@@ -160,22 +160,24 @@
 # Arguments:
 #   TARGET: The name of the target to generate.
 #   SCHEMAS: The list of schema files to generate code for.
-#   BINARY_SCHEMAS_DIR: The directory in which to generate binary schemas.
-#       Binary schemas will only be generated if a path is provided.
-#   INCLUDE: Search for includes in the specified paths. (Use this instead of
-#       "-I <path>" and the FLAGS option so that CMake is aware of the
-#       directories that need to be searched).
-#   FLAGS: A list of any additional flags that you would like to pass to flatc.
+#   BINARY_SCHEMAS_DIR: Optional. The directory in which to generate binary
+#       schemas. Binary schemas will only be generated if a path is provided.
+#   INCLUDE: Optional. Search for includes in the specified paths. (Use this
+#       instead of "-I <path>" and the FLAGS option so that CMake is aware of
+#       the directories that need to be searched).
+#   INCLUDE_PREFIX: Optional. The directory in which to place the generated
+#       files. Use this instead of the --include-prefix option.
+#   FLAGS: Optional. A list of any additional flags that you would like to pass
+#       to flatc.
 #
 # Example:
 #
 #     flatbuffers_generate_headers(
 #         TARGET my_generated_headers_target
+#         INCLUDE_PREFIX ${MY_INCLUDE_PREFIX}"
 #         SCHEMAS ${MY_SCHEMA_FILES}
 #         BINARY_SCHEMAS_DIR "${MY_BINARY_SCHEMA_DIRECTORY}"
-#         FLAGS
-#           --include-prefix "${MY_INCLUDE_PREFIX}"
-#           --gen-object-api)
+#         FLAGS --gen-object-api)
 #
 #     target_link_libraries(MyExecutableTarget
 #         PRIVATE my_generated_headers_target
@@ -185,6 +187,7 @@
   set(options)
   set(one_value_args
     "TARGET"
+    "INCLUDE_PREFIX"
     "BINARY_SCHEMAS_DIR")
   set(multi_value_args
     "SCHEMAS"
@@ -219,6 +222,8 @@
   set(generated_include_dir "${generated_target_dir}")
   if (NOT ${FLATBUFFERS_GENERATE_HEADERS_INCLUDE_PREFIX} STREQUAL "")
     set(generated_include_dir "${generated_include_dir}/${FLATBUFFERS_GENERATE_HEADERS_INCLUDE_PREFIX}")
+    list(APPEND FLATBUFFERS_GENERATE_HEADERS_FLAGS
+         "--include-prefix" ${FLATBUFFERS_GENERATE_HEADERS_INCLUDE_PREFIX})
   endif()

   # Create rules to generate the code for each schema.
@@ -290,8 +295,7 @@
 #
 # This function takes a target name and a list of schemas and Json files. You
 # can also specify other flagc flags and options to change the behavior of the
-# flatc compiler. Flags are named the same as they would be in the flatc tool
-# except ALL_CAPS. For example, --strict-json would be passed in as STRICT_JSON.
+# flatc compiler.
 #
 # Adding this target to your executable ensurses that the flatbuffer binaries
 # are compiled before your executable is run.
@@ -300,12 +304,13 @@
 #   TARGET: The name of the target to generate.
 #   JSON_FILES: The list of json files to compile to flatbuffers binaries.
 #   SCHEMA: The flatbuffers schema of the Json files to be compiled.
-#   INCLUDE: Search for includes in the specified paths. (Use this instead of
-#       "-I <path>" and the FLAGS option so that CMake is aware of the
-#       directories that need to be searched).
+#   INCLUDE: Optional. Search for includes in the specified paths. (Use this
+#       instead of "-I <path>" and the FLAGS option so that CMake is aware of
+#       the directories that need to be searched).
 #   OUTPUT_DIR: The directly where the generated flatbuffers binaries should be
 #       placed.
-#   FLAGS: A list of any additional flags that you would like to pass to flatc.
+#   FLAGS: Optional. A list of any additional flags that you would like to pass
+#       to flatc.
 #
 # Example:
 #


Added Mac specific include directory.

Added Mac specific include directory.

--- CMake/PolycodeIncludes.cmake
+++ CMake/PolycodeIncludes.cmake
@@ -4,6 +4,7 @@
     INCLUDE_DIRECTORIES(${Polycode_SOURCE_DIR}/Core/Build/MSVC/Polycore)
 ELSEIF(APPLE)
     ADD_DEFINITIONS(-DGL_GLEXT_PROTOTYPES)
+    INCLUDE_DIRECTORIES("${Polycode_SOURCE_DIR}/Core/Build/Mac OS X")
 ELSE(MSVC)
     ADD_DEFINITIONS(-DGL_GLEXT_PROTOTYPES)
     INCLUDE_DIRECTORIES(${Polycode_SOURCE_DIR}/Core/Build/Linux)


cmake: check if FFTW3_LIBRARIES really work

--- CMakeModules/FindFFTW3.cmake
+++ CMakeModules/FindFFTW3.cmake
@@ -36,4 +36,12 @@

 find_package_handle_standard_args(FFTW3 DEFAULT_MSG FFTW3_LIBRARY FFTW3_INCLUDE_DIR )

+if (FFTW3_FOUND)
+  include(CheckLibraryExists)
+  check_library_exists("${FFTW3_LIBRARIES}" fftw_plan_r2r_1d "" FOUND_FFTW_PLAN)
+  if(NOT FOUND_FFTW_PLAN)
+    message(FATAL_ERROR "Could not find fftw_plan_r2r_1d in ${FFTW3_LIBRARY}, take a look at the error message in ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log to find out what was going wrong. If you don't have pkg-config installed you will most likely have to set FFTW3_LIBRARY by hand (i.e. -DFFTW3_LIBRARY='/path/to/libfftw3.so') !")
+  endif(NOT FOUND_FFTW_PLAN)
+endif (FFTW3_FOUND)
+
 mark_as_advanced(FFTW3_INCLUDE_DIR FFTW3_LIBRARY )


Remove unnecessary warning message from FindSpaceNavigator

--- source/EXTENSIONS/SPACENAV/cmake/FindSpaceNavigator.cmake
+++ source/EXTENSIONS/SPACENAV/cmake/FindSpaceNavigator.cmake
@@ -29,8 +29,6 @@
 	SET(SPNAV_PROCESS_INCLUDES spnav_include)
 	SET(SPNAV_PROCESS_LIBS spnav_lib)

-	MESSAGE(STATUS ${spnav_include})
-
 	LIBFIND_PROCESS(SPNAV)
 ELSEIF(APPLE)
 	#TODO: Improve MacOS X code


Add some custom targets

Add some custom targets

git-svn-id: fbbf69ba8011aca0e74e1c67904b11cccbdbe66b@27050 0785d39b-7218-0410-832d-ea1e28bc413d

--- deal.II/cmake/setup_custom_targets.cmake
+++ deal.II/cmake/setup_custom_targets.cmake
@@ -28,11 +28,21 @@

 FOREACH(build ${DEAL_II_BUILD_TYPES})
   ADD_DEPENDENCIES(library ${DEAL_II_BASE_NAME}${DEAL_II_${build}_SUFFIX})
+  IF(build MATCHES "RELEASE")
+    ADD_CUSTOM_TARGET(optimized
+      DEPENDS ${DEAL_II_BASE_NAME}${DEAL_II_${build}_SUFFIX}
+      )
+  ELSEIF(build MATCHES "DEBUG")
+    ADD_CUSTOM_TARGET(debug
+      DEPENDS ${DEAL_II_BASE_NAME}${DEAL_II_${build}_SUFFIX}
+      )
+  ENDIF()
 ENDFOREACH()

 IF(DEAL_II_COMPONENT_DOCUMENTATION)
-  ADD_CUSTOM_TARGET(documentation)
-  ADD_DEPENDENCIES(documentation doxygen)
+  ADD_CUSTOM_TARGET(documentation
+    DEPENDS doxygen
+    )
 ENDIF()

 IF(DEAL_II_COMPONENT_COMPAT_FILES)
@@ -45,9 +55,10 @@
 ENDIF()

 IF(DEAL_II_COMPONENT_CONTRIB)
-  ADD_CUSTOM_TARGET(contrib)
-  ADD_DEPENDENCIES(contrib
-    mesh_conversion
+  ADD_CUSTOM_TARGET(contrib
+    DEPENDS
+      mesh_conversion
+      parameter_gui
     )
 ENDIF()


CMake, Add build of library for engine or remote.

	* build-aux/cmake/modules/UModule.cmake: Here.
	(add_library_for_uobject): New.
	(handler_engine_dependency): New.
	(handler_remote_dependency): New.
	(add_engine): Use handler_engine_dependency.

--- build-aux/cmake/modules/UModule.cmake
+++ build-aux/cmake/modules/UModule.cmake
@@ -33,6 +33,8 @@
 set(UOBJECT_ENGINE_TARGET_SUFFIX -engine)
 set(UMODULE_TEST_TARGET_SUFFIX -test)
 set(UMODULE_LIBRARY_TARGET_SUFFIX)
+set(UMODULE_LIBRARY_ENGINE_TARGET_SUFFIX -lib-engine)
+set(UMODULE_LIBRARY_REMOTE_TARGET_SUFFIX -lib-remote)

 # Input default naming
 set(UMODULE_UOBJECT_SOURCE_PREFIX)
@@ -328,7 +330,7 @@

     # Link with urbi remote and dependencies
     link_remote_libraries(${UOBJECT_REMOTE_NAME})
-    target_link_libraries(${UOBJECT_REMOTE_NAME} ${UOBJECT_REMOTE_DEPENDS})
+    handler_remote_dependency(${UOBJECT_REMOTE_NAME} ${UOBJECT_REMOTE_DEPENDS})
     list_shared_libraries(UOBJECT_REMOTE_DEPENDS
                           ${UMODULE_DIR}_REMOTE_SHARED_LIBRARIES)

@@ -379,15 +381,10 @@
                           PROPERTIES COMPILE_DEFINITIONS URBI_ENV_ENGINE)

     # Link with needed umodules
-    foreach(UOBJECT_ENGINE_UMODULE ${UOBJECT_ENGINE_UMODULES})
-        target_link_libraries(${UOBJECT_ENGINE_NAME}
-                              ${${UOBJECT_ENGINE_UMODULE}_TARGET_NAME}${UMODULE_LIBRARY_TARGET_SUFFIX})
-    endforeach(UOBJECT_ENGINE_UMODULE)
+    handler_engine_dependency(${UOBJECT_ENGINE_NAME} ${UOBJECT_ENGINE_UMODULE})

     # Link with custom libraries
-    foreach(UOBJECT_ENGINE_DEPEND ${UOBJECT_ENGINE_DEPENDS})
-        target_link_libraries(${UOBJECT_ENGINE_NAME} ${UOBJECT_ENGINE_DEPEND})
-    endforeach(UOBJECT_ENGINE_DEPEND)
+    handler_engine_dependency(${UOBJECT_ENGINE_NAME} ${UOBJECT_ENGINE_DEPENDS})

     # Link with urbi engine and dependencies
     link_engine_libraries(${UOBJECT_ENGINE_NAME})
@@ -400,6 +397,121 @@
     endif(UOBJECT_ENGINE_INSTALL)

 ENDMACRO(add_engine)
+
+#------------------------------------------------------------------------------
+#                           Add library for umodule
+#------------------------------------------------------------------------------
+# Add rules to compile a library. This can be use to add an engine or a remote.
+# By default, it is not assign to an engine or remote environment.
+#
+# FIXME: Add install, but not by default.
+# FIXME: Add handle of test.
+# FIXME: In general case, if lib depend of an engine lib, use env_engine.
+
+MACRO(add_library_for_uobject)
+  set(${UMODULE_DIR}_TARGET_NAME ${PROJECT_NAME} PARENT_SCOPE)
+  message(STATUS "Add workspace for library named: ${PROJECT_NAME}")
+
+  parse_arguments(UOBJECT_LIBRARY "DEPENDS" "ENV_ENGINE;ENV_REMOTE" ${ARGN})
+
+  # General case
+  if(NOT UOBJECT_LIBRARY_ENV_ENGINE AND NOT UOBJECT_LIBRARY_ENV_REMOTE)
+    set(TARGET ${PROJECT_NAME}${UMODULE_LIBRARY_TARGET_SUFFIX})
+
+    add_library(${TARGET} ${${UMODULE_DIR}_UOBJECT_SOURCES})
+    target_link_libraries(${TARGET} ${UMODULE_LINKS} ${UOBJECT_LIBRARY_DEPENDS})
+  endif()
+
+  # Case of engine environment
+  if(UOBJECT_LIBRARY_ENV_ENGINE)
+    set(TARGET ${PROJECT_NAME}${UMODULE_LIBRARY_ENGINE_TARGET_SUFFIX})
+
+    add_library(${TARGET} ${${UMODULE_DIR}_UOBJECT_SOURCES})
+    set_target_properties(${TARGET} PROPERTIES COMPILE_DEFINITIONS URBI_ENV_ENGINE)
+    handler_engine_dependency(${TARGET} ${UMODULE_LINKS} ${UOBJECT_LIBRARY_DEPENDS})
+  endif()
+
+  # Case of remote environment
+  if(UOBJECT_LIBRARY_ENV_REMOTE)
+    set(TARGET ${PROJECT_NAME}${UMODULE_LIBRARY_REMOTE_TARGET_SUFFIX})
+
+    add_library(${TARGET} ${${UMODULE_DIR}_UOBJECT_SOURCES})
+    set_target_properties(${TARGET} PROPERTIES COMPILE_DEFINITIONS URBI_ENV_REMOTE)
+    handler_remote_dependency(${TARGET} ${UMODULE_LINKS} ${UOBJECT_LIBRARY_DEPENDS})
+  endif()
+
+ENDMACRO(add_library_for_uobject)
+
+#------------------------------------------------------------------------------
+#               Handler for dependency between umodule
+#------------------------------------------------------------------------------
+# This macro was use to link target with libraries, it check if we can
+# use libraries.
+# Some library was only build for engine and can't be use with a
+# remote.
+
+macro(handler_engine_dependency TARGET)
+    foreach(DEPEND ${ARGN})
+      # Check if the custom library has in umodule
+      if(NOT ${DEPEND}_TARGET_NAME)
+        # Link with external library
+        target_link_libraries(${TARGET} ${DEPEND})
+      else()
+        # Check if target exist
+        get_target_property(res ${${DEPEND}_TARGET_NAME} TYPE)
+
+        if(res)
+          # Link to a standard library
+          target_link_libraries(${TARGET} ${DEPEND})
+        else(res)
+          # Check if a library only for engine exist
+          get_target_property(res
+            ${${DEPEND}_TARGET_NAME}${UMODULE_LIBRARY_ENGINE_TARGET_SUFFIX} TYPE)
+          if(res)
+            # Link with it
+            target_link_libraries(${TARGET}
+              ${${DEPEND}_TARGET_NAME}${UMODULE_LIBRARY_ENGINE_TARGET_SUFFIX})
+          else()
+            message(SEND_ERROR
+              "${DEPEND} can't be link to ${TARGET}")
+          endif()
+        endif()
+
+      endif()
+    endforeach(DEPEND)
+endmacro()
+
+
+macro(handler_remote_dependency TARGET)
+    foreach(DEPEND ${ARGN})
+      # Check if the custom library has in umodule
+      if(NOT ${DEPEND}_TARGET_NAME)
+        # Link with external library
+        target_link_libraries(${TARGET} ${DEPEND})
+      else()
+        # Check if target exist
+        get_target_property(res ${${DEPEND}_TARGET_NAME} TYPE)
+
+        if(res)
+          # Link to a standard library
+          target_link_libraries(${TARGET} ${DEPEND})
+        else(res)
+          # Check if a library only for remote exist
+          get_target_property(res
+            ${${DEPEND}_TARGET_NAME}${UMODULE_LIBRARY_REMOTE_TARGET_SUFFIX} TYPE)
+          if(res)
+            # Link with it
+            target_link_libraries(${TARGET}
+              ${${DEPEND}_TARGET_NAME}${UMODULE_LIBRARY_REMOTE_TARGET_SUFFIX})
+          else()
+            message(SEND_ERROR
+              "${DEPEND} can't be link to ${TARGET}")
+          endif()
+        endif()
+
+      endif()
+    endforeach(DEPEND)
+endmacro()

 #------------------------------------------------------------------------------
@@ -472,8 +584,6 @@
                 ${SDK_ENGINE_SHARED_LIBRARIES})

 ENDMACRO(link_engine_libraries)
-
-endif(NOT MODULE_UMODULE_LOADED)

 #------------------------------------------------------------------------------
@@ -539,3 +649,4 @@

 ENDMACRO(add_install)

+endif(NOT MODULE_UMODULE_LOADED)


ENH: Added support for Python 2.5 on Windows by naming extension modules with a .pyd extension.

--- CMake/KitCommonPythonWrapBlock.cmake
+++ CMake/KitCommonPythonWrapBlock.cmake
@@ -36,6 +36,13 @@
 ADD_LIBRARY(vtk${KIT}Python MODULE vtk${KIT}PythonInit.cxx)
 TARGET_LINK_LIBRARIES(vtk${KIT}Python vtk${KIT}PythonD)

+# Python extension modules on Windows must have the extension ".pyd"
+# instead of ".dll" as of Python 2.5.  Older python versions do support
+# this suffix.
+IF(WIN32 AND NOT CYGWIN)
+  SET_TARGET_PROPERTIES(vtk${KIT}Python PROPERTIES SUFFIX ".pyd")
+ENDIF(WIN32 AND NOT CYGWIN)
+
 IF(WIN32 OR APPLE)
   TARGET_LINK_LIBRARIES (vtk${KIT}Python ${VTK_PYTHON_LIBRARIES})
 ENDIF(WIN32 OR APPLE)


BUG: Fix spell error in CMake/ctkDashboardDriverScript.cmake

Should be Continuous instead of Continous

--- CMake/ctkDashboardDriverScript.cmake
+++ CMake/ctkDashboardDriverScript.cmake
@@ -47,7 +47,7 @@
 elseif (SCRIPT_MODE STREQUAL "continuous")
   set(empty_binary_directory FALSE)
   set(force_build FALSE)
-  set(model Continous)
+  set(model Continuous)
 elseif (SCRIPT_MODE STREQUAL "nightly")
   set(empty_binary_directory TRUE)
   set(force_build TRUE)
@@ -205,7 +205,7 @@
   endif()
 endmacro()

-if(SCRIPT_MODE STREQUAL "continous")
+if(SCRIPT_MODE STREQUAL "continuous")
   while(${CTEST_ELAPSED_TIME} LESS 68400)
     set(START_TIME ${CTEST_ELAPSED_TIME})
     run_ctest()


fixed wrong API_DIR (was libopensync-0.37-rXXXX instead of libopensync1)

git-svn-id: e31799a7ad59d6ea355ca047c69e0aee8a59fcd3@3473 53f5c7ee-bee3-0310-bbc5-ea0e15fffd5e

--- cmake/OpenSyncDefaults.cmake
+++ cmake/OpenSyncDefaults.cmake
@@ -26,7 +26,7 @@

 # Installation directories:

-SET( OPENSYNC_API_DIR "libopensync-${OPENSYNC_VERSION}" )
+SET( OPENSYNC_API_DIR "libopensync${OPENSYNC_LIBVERSION_SOVERSION}" )
 SET( OPENSYNC_PLUGINDIR "${LIB_INSTALL_DIR}/${OPENSYNC_API_DIR}/plugins" CACHE PATH "OpenSync plugin directory" )
 SET( OPENSYNC_FORMATSDIR "${LIB_INSTALL_DIR}/${OPENSYNC_API_DIR}/formats" CACHE PATH "OpenSync format plugin directory" )
 SET( OPENSYNC_PYTHON_PLUGINDIR "${LIB_INSTALL_DIR}/${OPENSYNC_API_DIR}/python-plugins" CACHE PATH "OpenSync python plugin directory" )


Added sketch path to include directory of sketch.

--- cmake/Platform/Arduino.cmake
+++ cmake/Platform/Arduino.cmake
@@ -1090,6 +1090,7 @@
     get_filename_component(SKETCH_PATH "${SKETCH_PATH}" ABSOLUTE)

     if(EXISTS "${SKETCH_PATH}")
+        include_directories(${SKETCH_PATH})
         set(SKETCH_CPP  ${CMAKE_CURRENT_BINARY_DIR}/${SKETCH_NAME}.cpp)
         set(MAIN_SKETCH ${SKETCH_PATH}/${SKETCH_NAME})

@@ -1103,7 +1104,7 @@
         #message("${MAIN_SKETCH}")

         # Find all sketch files
-        file(GLOB SKETCH_SOURCES ${SKETCH_PATH}/*.pde ${SKETCH_PATH}/*.ino)
+        file(GLOB SKETCH_SOURCES ${SKETCH_PATH}/*.h ${SKETCH_PATH}/*.pde ${SKETCH_PATH}/*.ino)
         list(REMOVE_ITEM SKETCH_SOURCES ${MAIN_SKETCH})
         list(SORT SKETCH_SOURCES)

@@ -1323,7 +1324,7 @@
         list(APPEND ARDUINO_PATHS arduino-00${VERSION})
     endforeach()

-    file(GLOB SDK_PATH_HINTS /usr/share/arduino* /usr/local/share/arduino*)
+    file(GLOB SDK_PATH_HINTS /usr/share/arduino* /opt/local/ardiuno* /usr/local/share/arduino*)
     list(SORT SDK_PATH_HINTS)
     list(REVERSE SDK_PATH_HINTS)


fix #3994

fix #3994

--- cmake/ShogunFindLAPACK.cmake
+++ cmake/ShogunFindLAPACK.cmake
@@ -31,6 +31,26 @@
     # this is supported since Eigen version 3.1 and later
     MESSAGE(STATUS "Found MKL using as BLAS/LAPACK backend.")
     SET(HAVE_MKL 1)
+
+    # trying to use the new Single Dynamic Library of MKL
+    # https://software.intel.com/en-us/articles/a-new-linking-model-single-dynamic-library-mkl_rt-since-intel-mkl-103
+    IF (NOT "${LAPACK_LIBRARIES}" MATCHES ".*/.*mkl_rt.*")
+      # just use the mkl_rt and let the user specify/decide all the MKL specific
+      # optimisation runtime
+      SET(MKL_LIBRARIES ${LAPACK_LIBRARIES})
+      LIST(FILTER MKL_LIBRARIES INCLUDE REGEX ".*/.*mkl_core.*")
+      get_filename_component(MKL_PATH ${MKL_LIBRARIES} DIRECTORY)
+      find_library(MKL_RT mkl_rt PATHS ${MKL_PATH})
+      IF (MKL_RT)
+        IF (MSVC)
+          SET(LAPACK_LIBRARIES ${MKL_RT})
+        ELSEIF(CMAKE_USE_PTHREADS_INIT)
+          SET(LAPACK_LIBRARIES ${MKL_RT})
+          LIST(APPEND LAPACK_LIBRARIES ${CMAKE_THREAD_LIBS_INIT} -lm)
+        ENDIF()
+      ENDIF()
+    ENDIF()
+
     IF (ENABLE_EIGEN_LAPACK)
       FIND_PATH(MKL_INCLUDE_DIR mkl.h)
       IF(NOT MKL_INCLUDE_DIR)


[build] avoid use generator expression to add linker parameter (#29636)

* [build] use generator expression only on CMake > 3.15

In CMake < 3.16, Generator expressions seem not to allow the `LINKER:` prefix to be
expanded correctly when used in `target_link_options`.

To account for this, account for two code paths according to CMake version -- use the generator expression when detecting we are on 3.16 and resort to an if statement otherwise

Addresses rdar://problem/59117166

--- cmake/modules/AddSwift.cmake
+++ cmake/modules/AddSwift.cmake
@@ -1403,10 +1403,27 @@
     # Include LLVM Bitcode slices for iOS, Watch OS, and Apple TV OS device libraries.
     if(SWIFT_EMBED_BITCODE_SECTION AND NOT SWIFTLIB_SINGLE_DONT_EMBED_BITCODE)
       if(${SWIFTLIB_SINGLE_SDK} MATCHES "(I|TV|WATCH)OS")
-        target_link_options(${target} PRIVATE
-          "LINKER:-bitcode_bundle"
-          $<$<BOOL:SWIFT_EMBED_BITCODE_SECTION_HIDE_SYMBOLS>:"LINKER:-bitcode_hide_symbols">
-          "LINKER:-lto_library,${LLVM_LIBRARY_DIR}/libLTO.dylib")
+        # The two branches of this if statement accomplish the same end result
+        # We are simply accounting for the fact that on CMake < 3.16
+        # using a generator expression to
+        # specify a LINKER: argument does not work,
+        # since that seems not to allow the LINKER: prefix to be
+        # evaluated (i.e. it will be added as-is to the linker parameters)
+        if(CMAKE_VERSION VERSION_LESS 3.16)
+          target_link_options(${target} PRIVATE
+            "LINKER:-bitcode_bundle"
+            "LINKER:-lto_library,${LLVM_LIBRARY_DIR}/libLTO.dylib")
+
+          if(SWIFT_EMBED_BITCODE_SECTION_HIDE_SYMBOLS)
+            target_link_options(${target} PRIVATE
+              "LINKER:-bitcode_hide_symbols")
+          endif()
+        else()
+          target_link_options(${target} PRIVATE
+            "LINKER:-bitcode_bundle"
+            $<$<BOOL:SWIFT_EMBED_BITCODE_SECTION_HIDE_SYMBOLS>:"LINKER:-bitcode_hide_symbols">
+            "LINKER:-lto_library,${LLVM_LIBRARY_DIR}/libLTO.dylib")
+        endif()
       endif()
     endif()
   endif()


TableGen.cmake: sometimes the .td file is not in the current directory
(clang/include/clang/Basic/StmtNodes.td, for instance, is tablegenned
from clang/include/clang/AST/CMakeLists.txt) so it is not contained on
the list of all .td files on the current source directory which is
used as the DEPENDS of the custom command. We must add the .td file to
the DEPENDS list of the custom command. Otherwise some .inc files are
not regenerated when the corresponding .td file changes.

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

--- cmake/modules/TableGen.cmake
+++ cmake/modules/TableGen.cmake
@@ -18,7 +18,10 @@
     -I ${LLVM_MAIN_SRC_DIR}/lib/Target -I ${LLVM_MAIN_INCLUDE_DIR}
     ${LLVM_TARGET_DEFINITIONS_ABSOLUTE}
     -o ${CMAKE_CURRENT_BINARY_DIR}/${ofn}.tmp
-    DEPENDS tblgen ${local_tds} ${global_tds}
+    # The file in LLVM_TARGET_DEFINITIONS may be not in the current
+    # directory and local_tds may not contain it, so we must
+    # explicitly list it here:
+    DEPENDS tblgen ${local_tds} ${global_tds} ${LLVM_TARGET_DEFINITIONS_ABSOLUTE}
     COMMENT "Building ${ofn}..."
     )
   add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${ofn}


Fix cmake POWER10 detection

Fix cmake POWER10 detection

Recent commit 60c98a8 changed variable mlas_common_srcs which affects
POWER10 detection.

--- cmake/onnxruntime_mlas.cmake
+++ cmake/onnxruntime_mlas.cmake
@@ -299,7 +299,7 @@
               HAS_P10_RUNTIME
             )
             if (HAS_P10_RUNTIME)
-              set_source_files_properties(${mlas_common_srcs} PROPERTIES COMPILE_FLAGS "-DPOWER10")
+              set_source_files_properties(${MLAS_SRC_DIR}/platform.cpp PROPERTIES COMPILE_FLAGS "-DPOWER10")
             endif()
             set(mlas_platform_srcs_power10
               ${MLAS_SRC_DIR}/power/SgemmKernelPOWER10.cpp


- Fix to allow internet sockets  - Fix to allow easier modification of permissions

--- cmake/Packaging/AndroidApkBuild.cmake
+++ cmake/Packaging/AndroidApkBuild.cmake
@@ -110,7 +110,14 @@
         )

     set ( ANDROID_OPTIONAL_FEATURES
+        "android.hardware.usb.host"
+        "android.hardware.touchscreen"
+        "android.hardware.touchscreen.multitouch"
+        "android.hardware.touchscreen.multitouch.distinct"
+        "android.hardware.touchscreen.multitouch.jazzhand"
         "android.hardware.sensor.accelerometer"
+        "android.hardware.sensor.gyroscope"
+        "android.hardware.sensor.hifi_sensors"
         "android.hardware.opengles.aep"
         "${ANDROID_CUSTOM_PERMISSIONS}"
         )
@@ -140,7 +147,16 @@
             )
     endif()

-    set ( ANDROID_PERMISSIONS )
+    set ( ANDROID_PERMISSIONS_PRE
+        "android.permission.INTERNET"
+        "android.permission.VIBRATE")
+
+    foreach(perm ${ANDROID_PERMISSIONS_PRE})
+        set ( ANDROID_PERMISSIONS
+            "${ANDROID_PERMISSIONS}
+            <uses-permission android:name=\"${perm}\" />"
+            )
+    endforeach()

     # For valid options, see:
     # http://developer.android.com/guide/topics/manifest/activity-element.html


cmake: Don't do anything for LLVM_ENABLE_ASSERTIONS=OFF

By default, CMake will set NDEBUG in Rel* builds and leave it off in
debug builds, so we shouldn't need to do anything ourselves.

Before this change, it was possible to a Debug build without assertions
(aka Debug-Asserts in the autoconf system) by configuring with
-DLLVM_ENABLE_ASSERTIONS=OFF, but this configuration isn't very useful.
You can still get the same effect by explicitly adding -DNDEBUG to
CFLAGS.

Differential Revision: http://reviews.llvm.org/D4257

Patch by Janusz Sobczak!

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

--- cmake/modules/HandleLLVMOptions.cmake
+++ cmake/modules/HandleLLVMOptions.cmake
@@ -66,12 +66,6 @@
       string (REGEX REPLACE "(^| )[/-]D *NDEBUG($| )" " "
         "${flags_var_to_scrub}" "${${flags_var_to_scrub}}")
     endforeach()
-  endif()
-else()
-  if( NOT uppercase_CMAKE_BUILD_TYPE STREQUAL "RELEASE" )
-    if( NOT MSVC_IDE AND NOT XCODE )
-      add_definitions( -DNDEBUG )
-    endif()
   endif()
 endif()


fixed compilation with clang due to uninteresting -Wignored-attributes Tokutek/mongo#869

--- cmake_modules/TokuSetupCompiler.cmake
+++ cmake_modules/TokuSetupCompiler.cmake
@@ -88,6 +88,7 @@
   -Wno-error=missing-format-attribute
   -Wno-error=address-of-array-temporary
   -Wno-error=tautological-constant-out-of-range-compare
+  -Wno-ignored-attributes
   -fno-rtti
   -fno-exceptions
   )


Fix superbuild

Fix superbuild

External-ITKDoxygenXML.cmake has been relocated in the cmake/ folder and this
file has to been updated.

--- superbuild/Superbuild.cmake
+++ superbuild/Superbuild.cmake
@@ -38,7 +38,7 @@
 endif()

 if(NOT ITKDoxygenXML_DIR )
-  include( ${CMAKE_SOURCE_DIR}/External-ITKDoxygenXML.cmake )
+  include( ${CMAKE_SOURCE_DIR}/../cmake/External-ITKDoxygenXML.cmake )
   list( APPEND ITKExamples_DEPENDENCIES ITKDoxygenXML )
 endif()


[hsa] Search libs/includes from user locations before default paths

Search for HSA libraries and includes from location specified by
-DWITH_HSA_*_DIR defines before default locations. Before this commit
cmake configuration would find them from default locations first
effectively ignoring the -DWITH_HSA_*_DIR defines.

--- cmake/HSA.cmake
+++ cmake/HSA.cmake
@@ -64,12 +64,14 @@
 endif()

-find_path(HSA_INCLUDES "hsa.h" PATHS "${HSA_INCLUDEDIR}")
+find_path(HSA_INCLUDES "hsa.h" PATHS "${HSA_INCLUDEDIR}" NO_DEFAULT_PATH)
+find_path(HSA_INCLUDES "hsa.h")
 if(NOT HSA_INCLUDES)
   message(FATAL_ERROR "hsa.h header not found (use -DHSA_RUNTIME_DIR=... to specify path to HSA runtime)")
 endif()

-find_library(HSALIB NAMES "hsa-runtime64" "hsa-runtime" "phsa-runtime64" PATHS "${HSA_LIBDIR}")
+find_library(HSALIB NAMES "hsa-runtime64" "hsa-runtime" "phsa-runtime64" PATHS "${HSA_LIBDIR}" NO_DEFAULT_PATH)
+find_library(HSALIB NAMES "hsa-runtime64" "hsa-runtime" "phsa-runtime64")
 if(NOT HSALIB)
   message(FATAL_ERROR "libhsa-runtime not found (use -DWITH_HSA_RUNTIME_DIR=... to specify path to HSA runtime) ${HSA_LIBDIR}")
 endif()


remove the accidentally doubled up python.cmake include

--- cmake/all.cmake
+++ cmake/all.cmake
@@ -51,7 +51,6 @@
     install_matching_to_share
     list_append_unique
     parse_arguments
-    python
     safe_execute_process
     stamp
     platform/lsb


fixed compiler warning

fixed compiler warning

removed -fvisibility-inlines-hidden compiler option for CUDA sources

--- cmake/OpenCVDetectCUDA.cmake
+++ cmake/OpenCVDetectCUDA.cmake
@@ -160,6 +160,10 @@

       # we remove -Wsign-promo as it generates warnings under linux
       string(REPLACE "-Wsign-promo" "" ${var} "${${var}}")
+
+      # we remove -fvisibility-inlines-hidden because it's used for C++ compiler
+      # but NVCC uses C compiler by default
+      string(REPLACE "-fvisibility-inlines-hidden" "" ${var} "${${var}}")
     endforeach()

     if(BUILD_SHARED_LIBS)


Check for clang-format version >= 4

Check for clang-format version >= 4

--- cmake/clang-cpp-checks.cmake
+++ cmake/clang-cpp-checks.cmake
@@ -9,32 +9,39 @@
 # Adding clang-format check and formatter if found
 FIND_PROGRAM(CLANG_FORMAT NAMES "clang-format-6.0" "clang-format-5.0" "clang-format-4.0" "clang-format")
 IF(CLANG_FORMAT)
-    MESSAGE(STATUS "Found ${CLANG_FORMAT}, adding formatting targets")
-    ADD_CUSTOM_TARGET(
-        format
-        COMMAND
-        ${CLANG_FORMAT}
-        -i
-        -style=file
-        ${CHECK_CXX_SOURCE_FILES}
-        COMMENT "Auto formatting of all source files"
-    )
+    EXEC_PROGRAM(${CLANG_FORMAT} ${CMAKE_CURRENT_SOURCE_DIR} ARGS --version OUTPUT_VARIABLE CLANG_VERSION)
+    STRING(REGEX REPLACE ".*([0-9]+)\\.[0-9]+\\.[0-9]+.*" "\\1" CLANG_MAJOR_VERSION ${CLANG_VERSION})

-    ADD_CUSTOM_TARGET(
-        check-format
-        COMMAND
-        ${CLANG_FORMAT}
-        -style=file
-        -output-replacements-xml
-        ${CHECK_CXX_SOURCE_FILES}
-        # print output
-        | tee ${CMAKE_BINARY_DIR}/check_format_file.txt | grep -c "replacement " |
-                tr -d "[:cntrl:]" && echo " replacements necessary"
-        # WARNING: fix to stop with error if there are problems
-        COMMAND ! grep -c "replacement "
-                  ${CMAKE_BINARY_DIR}/check_format_file.txt > /dev/null
-        COMMENT "Checking format compliance"
-    )
+    IF(${CLANG_MAJOR_VERSION} GREATER_EQUAL "4")
+        MESSAGE(STATUS "Found ${CLANG_FORMAT}, adding formatting targets")
+        ADD_CUSTOM_TARGET(
+            format
+            COMMAND
+            ${CLANG_FORMAT}
+            -i
+            -style=file
+            ${CHECK_CXX_SOURCE_FILES}
+            COMMENT "Auto formatting of all source files"
+        )
+
+        ADD_CUSTOM_TARGET(
+            check-format
+            COMMAND
+            ${CLANG_FORMAT}
+            -style=file
+            -output-replacements-xml
+            ${CHECK_CXX_SOURCE_FILES}
+            # print output
+            | tee ${CMAKE_BINARY_DIR}/check_format_file.txt | grep -c "replacement " |
+            tr -d "[:cntrl:]" && echo " replacements necessary"
+            # WARNING: fix to stop with error if there are problems
+            COMMAND ! grep -c "replacement "
+            ${CMAKE_BINARY_DIR}/check_format_file.txt > /dev/null
+            COMMENT "Checking format compliance"
+        )
+    ELSE()
+        MESSAGE(STATUS "Could only find version ${CLANG_MAJOR_VERSION} of clang-format, but version >= 4 is required.")
+    ENDIF()
 ELSE()
     MESSAGE(STATUS "Could NOT find clang-format")
 ENDIF()


fixed copy paste error

fixed copy paste error

--- cmake/external/ColPack.cmake
+++ cmake/external/ColPack.cmake
@@ -8,7 +8,7 @@
 	CONFIGURE_COMMAND rm <SOURCE_DIR>/config.status && <SOURCE_DIR>/configure --includedir=${THIRD_PARTY_DIR}/include/ColPack --libdir=${THIRD_PARTY_DIR}/libs/ColPack --disable-shared --with-pic
 	)

-SET(JSON_INCLUDE_DIRS ${THIRD_PARTY_DIR}/include/ColPack)
-SET(JSON_LDFLAGS ${THIRD_PARTY_DIR}/libs/libColPack.a)
+SET(COLPACK_INCLUDE_DIRS ${THIRD_PARTY_DIR}/include/ColPack)
+SET(COLPACK_LDFLAGS ${THIRD_PARTY_DIR}/libs/libColPack.a)

 LIST(APPEND SHOGUN_DEPENDS COLPACK)


Whitespace.

Whitespace.

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

--- cmake/modules/TableGen.cmake
+++ cmake/modules/TableGen.cmake
@@ -9,14 +9,14 @@
   if (IS_ABSOLUTE ${LLVM_TARGET_DEFINITIONS})
     set(LLVM_TARGET_DEFINITIONS_ABSOLUTE ${LLVM_TARGET_DEFINITIONS})
   else()
-    set(LLVM_TARGET_DEFINITIONS_ABSOLUTE
+    set(LLVM_TARGET_DEFINITIONS_ABSOLUTE
       ${CMAKE_CURRENT_SOURCE_DIR}/${LLVM_TARGET_DEFINITIONS})
   endif()
   add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${ofn}.tmp
     # Generate tablegen output in a temporary file.
     COMMAND ${${project}_TABLEGEN_EXE} ${ARGN} -I ${CMAKE_CURRENT_SOURCE_DIR}
     -I ${LLVM_MAIN_SRC_DIR}/lib/Target -I ${LLVM_MAIN_INCLUDE_DIR}
-    ${LLVM_TARGET_DEFINITIONS_ABSOLUTE}
+    ${LLVM_TARGET_DEFINITIONS_ABSOLUTE}
     -o ${CMAKE_CURRENT_BINARY_DIR}/${ofn}.tmp
     # The file in LLVM_TARGET_DEFINITIONS may be not in the current
     # directory and local_tds may not contain it, so we must
@@ -41,7 +41,7 @@
     PROPERTY ADDITIONAL_MAKE_CLEAN_FILES ${ofn}.tmp ${ofn})

   set(TABLEGEN_OUTPUT ${TABLEGEN_OUTPUT} ${CMAKE_CURRENT_BINARY_DIR}/${ofn} PARENT_SCOPE)
-  set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/${ofn}
+  set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/${ofn}
     PROPERTIES GENERATED 1)
 endfunction(tablegen)

@@ -95,7 +95,7 @@
           FORCE)
     endif()
   endif()
-
+
   # Effective tblgen executable to be used:
   set(${project}_TABLEGEN_EXE ${${project}_TABLEGEN} PARENT_SCOPE)


px4_fmu-v2_multicopter disable batt_smbus

 - saves a bit of flash

--- boards/px4/fmu-v2/multicopter.cmake
+++ boards/px4/fmu-v2/multicopter.cmake
@@ -20,7 +20,7 @@

 	DRIVERS
 		barometer/ms5611
-		batt_smbus
+		#batt_smbus
 		camera_capture
 		camera_trigger
 		distance_sensor # all available distance sensor drivers


[cmake] debug flags fixup for icc

[cmake] debug flags fixup for icc

--- cmake/modules/DuneStuffMacros.cmake
+++ cmake/modules/DuneStuffMacros.cmake
@@ -80,17 +80,28 @@
 SET( CMAKE_CXX_FLAGS "-DDUNE_GRID_EXPERIMENTAL_GRID_EXTENSIONS=1 ${CMAKE_CXX_FLAGS}" )

 SET( CMAKE_CXX_FLAGS_DEBUG
-  "-O0 -DDNDEBUG -g3 -ggdb -Wunused-variable -Winline -fno-strict-aliasing -fPIC -Wall -Wextra -Wc++0x-compat -Wparentheses -pedantic -Wredundant-decls -Wshadow -Wundef -Wnon-virtual-dtor -ftemplate-backtrace-limit=0 ${CMAKE_CXX_FLAGS_DEBUG}")
+  "-O0 -DDNDEBUG -g3 -ggdb -Wunused-variable -fno-strict-aliasing -fPIC -Wall -Wextra -Wparentheses -pedantic  -Wshadow -Wundef -Wnon-virtual-dtor  ${CMAKE_CXX_FLAGS_DEBUG}")
+
+#aka anything but intel, but cmake has ident for icc
+if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
+  set( CMAKE_CXX_FLAGS_DEBUG CACHE STRING
+        " -Wc++0x-compat -Wredundant-decls -Winline  -ftemplate-backtrace-limit=0 ${CMAKE_CXX_FLAGS_DEBUG} "
+      )
+else ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
+  # for us effectively icc
+  set( CMAKE_CXX_FLAGS_DEBUG CACHE STRING
+        "-Wcast-qual -Wformat=2 -Winit-self -Woverloaded-virtual -Wshadow -Wsign-conversion -Wsign-promo -Wundef  -Wno-unused ${CMAKE_CXX_FLAGS_DEBUG}")
+endif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")

 if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
-        set( CMAKE_CXX_FLAGS_DEBUG CACHE STRING
+  set( CMAKE_CXX_FLAGS_DEBUG CACHE STRING
         "-Wnon-literal-null-conversion -Wused-but-marked-unused -Wno-tautological-compare -Wfloat-equal -Wdisabled-macro-expansion -Wcovered-switch-default -Wswitch-enum -Wunreachable-code -Wshorten-64-to-32  ${CMAKE_CXX_FLAGS_DEBUG}"
-        )
+      )
 elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
-        set( CMAKE_CXX_FLAGS_DEBUG CACHE STRING
+  set( CMAKE_CXX_FLAGS_DEBUG CACHE STRING
         "-Wlogical-op  ${CMAKE_CXX_FLAGS_DEBUG} "
-        )
-        ADD_IF_SUPPORTED("-Og")
+      )
+  ADD_IF_SUPPORTED("-Og") #only since 4.7
 endif()

 MACRO(INCLUDE_SYS_DIR)


fix wrap/siconos/tests error + misc in docs

--- cmake/siconos_find_common_dep.cmake
+++ cmake/siconos_find_common_dep.cmake
@@ -5,7 +5,7 @@
 #================================================================

 # --- Blas Lapack ---
-include(BlasLapackSetup)
+# include(BlasLapackSetup)
 compile_with(BLAS REQUIRED)
 compile_with(LAPACK REQUIRED)
 if(NOT BLAS_INCLUDE_DIRS)


BUG: fixing crash in test

BUG: fixing crash in test

Exception is thrown with requested region
not being fully contained in the largest possible region

Change-Id: I8d43e7a08297abf248c132bcf764ce326a303deb

--- Modules/Remote/RLEImage.remote.cmake
+++ Modules/Remote/RLEImage.remote.cmake
@@ -9,5 +9,5 @@
 This work is supported by NIH grant R01 EB014346
 'Continued development and maintenance of the ITK-SNAP 3D image segmentation software'."
   GIT_REPOSITORY ${git_protocol}://github.com/KitwareMedical/ITKRLEImage.git
-  GIT_TAG 520cc0fb9c32d888e996f7e9b6c854868e43ba98
+  GIT_TAG 0506f5109272bf52bc95b825f377fc004d945b30
   )


STYLE: C-x h M-x indent-region

STYLE: C-x h M-x indent-region

--- SuperBuild/CMake/External_fftw.cmake
+++ SuperBuild/CMake/External_fftw.cmake
@@ -1,86 +1,86 @@
 if(NOT __EXTERNAL_FFTW__)
-set(__EXTERNAL_FFTW__ 1)
+  set(__EXTERNAL_FFTW__ 1)

-if(USE_SYSTEM_FFTW)
-  # TODO : use ITK's FindFFTW
-  #find_package ( FFTW )
-  message(STATUS "  Using FFTW system version")
-else()
-  SETUP_SUPERBUILD(PROJECT FFTW)
+  if(USE_SYSTEM_FFTW)
+    # TODO : use ITK's FindFFTW
+    #find_package ( FFTW )
+    message(STATUS "  Using FFTW system version")
+  else()
+    SETUP_SUPERBUILD(PROJECT FFTW)

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

-  if(MSVC)
-    # TODO : get precompiled binaries as not all MSVC versions can compile FFTW
+    if(MSVC)
+      # TODO : get precompiled binaries as not all MSVC versions can compile FFTW
       message(STATUS "  FFTW SuperBuild is not available yet...")
       add_custom_target(FFTW)
-  else()
-    message(STATUS "  Using FFTW SuperBuild version")
+    else()
+      message(STATUS "  Using FFTW SuperBuild version")

-    # Compile the float version of FFTW
-    ExternalProject_Add(FFTWF
-      PREFIX FFTW/FFTWF
-      URL "http://www.fftw.org/fftw-3.3.4.tar.gz"
-      URL_MD5 2edab8c06b24feeb3b82bbb3ebf3e7b3
-      SOURCE_DIR ${FFTWF_SB_SRC}
-      BINARY_DIR ${FFTWF_SB_SRC}
-      INSTALL_DIR ${SB_INSTALL_PREFIX}
-      DOWNLOAD_DIR ${DOWNLOAD_LOCATION}
-      CONFIGURE_COMMAND
-      ${SB_ENV_CONFIGURE_CMD}
+      # Compile the float version of FFTW
+      ExternalProject_Add(FFTWF
+        PREFIX FFTW/FFTWF
+        URL "http://www.fftw.org/fftw-3.3.4.tar.gz"
+        URL_MD5 2edab8c06b24feeb3b82bbb3ebf3e7b3
+        SOURCE_DIR ${FFTWF_SB_SRC}
+        BINARY_DIR ${FFTWF_SB_SRC}
+        INSTALL_DIR ${SB_INSTALL_PREFIX}
+        DOWNLOAD_DIR ${DOWNLOAD_LOCATION}
+        CONFIGURE_COMMAND
+        ${SB_ENV_CONFIGURE_CMD}
         ${FFTWF_SB_SRC}/configure
-            --prefix=${SB_INSTALL_PREFIX}
-            --enable-shared
-            --disable-static
-            --enable-float
-            --enable-threads
-            --disable-fortran
-            --disable-dependency-tracking
-      DEPENDS ${FFTW_DEPENDENCIES}
-      )
+        --prefix=${SB_INSTALL_PREFIX}
+        --enable-shared
+        --disable-static
+        --enable-float
+        --enable-threads
+        --disable-fortran
+        --disable-dependency-tracking
+        DEPENDS ${FFTW_DEPENDENCIES}
+        )

-    if(APPLE)
-      SUPERBUILD_PATCH_SOURCE(FFTWF "patch-for-at-rpath" ${CMAKE_SOURCE_DIR}/patches/FFTW)
+      if(APPLE)
+        SUPERBUILD_PATCH_SOURCE(FFTWF "patch-for-at-rpath" ${CMAKE_SOURCE_DIR}/patches/FFTW)
+      endif()
+
+      # Compile the double version of FFTW
+      ExternalProject_Add(FFTWD
+        PREFIX FFTW/FFTWD
+        URL "http://www.fftw.org/fftw-3.3.4.tar.gz"
+        URL_MD5 2edab8c06b24feeb3b82bbb3ebf3e7b3
+        SOURCE_DIR ${FFTWD_SB_SRC}
+        BINARY_DIR ${FFTWD_SB_SRC}
+        INSTALL_DIR ${SB_INSTALL_PREFIX}
+        DOWNLOAD_DIR ${DOWNLOAD_LOCATION}
+        CONFIGURE_COMMAND
+        ${SB_ENV_CONFIGURE_CMD}
+        ${FFTWD_SB_SRC}/configure
+        --prefix=${SB_INSTALL_PREFIX}
+        --enable-shared
+        --disable-static
+        --disable-float
+        --enable-threads
+        --disable-fortran
+        --disable-dependency-tracking
+        )
+
+      if(APPLE)
+        SUPERBUILD_PATCH_SOURCE(FFTWD "patch-for-at-rpath" ${CMAKE_SOURCE_DIR}/patches/FFTW)
+      endif()
+
+      ExternalProject_Add(FFTW
+        PREFIX FFTW
+        DOWNLOAD_COMMAND ""
+        CONFIGURE_COMMAND ""
+        BUILD_COMMAND ""
+        INSTALL_COMMAND ""
+        DEPENDS FFTWF FFTWD
+        )
+
+      set(_SB_FFTW_INCLUDE_PATH ${SB_INSTALL_PREFIX}/include)
+
     endif()

-    # Compile the double version of FFTW
-    ExternalProject_Add(FFTWD
-      PREFIX FFTW/FFTWD
-      URL "http://www.fftw.org/fftw-3.3.4.tar.gz"
-      URL_MD5 2edab8c06b24feeb3b82bbb3ebf3e7b3
-      SOURCE_DIR ${FFTWD_SB_SRC}
-      BINARY_DIR ${FFTWD_SB_SRC}
-      INSTALL_DIR ${SB_INSTALL_PREFIX}
-      DOWNLOAD_DIR ${DOWNLOAD_LOCATION}
-      CONFIGURE_COMMAND
-      ${SB_ENV_CONFIGURE_CMD}
-        ${FFTWD_SB_SRC}/configure
-            --prefix=${SB_INSTALL_PREFIX}
-            --enable-shared
-            --disable-static
-            --disable-float
-            --enable-threads
-            --disable-fortran
-            --disable-dependency-tracking
-      )
-
-    if(APPLE)
-      SUPERBUILD_PATCH_SOURCE(FFTWD "patch-for-at-rpath" ${CMAKE_SOURCE_DIR}/patches/FFTW)
-    endif()
-
-    ExternalProject_Add(FFTW
-      PREFIX FFTW
-      DOWNLOAD_COMMAND ""
-      CONFIGURE_COMMAND ""
-      BUILD_COMMAND ""
-      INSTALL_COMMAND ""
-      DEPENDS FFTWF FFTWD
-      )
-
-    set(_SB_FFTW_INCLUDE_PATH ${SB_INSTALL_PREFIX}/include)
-
   endif()
-
 endif()
-endif()


WIP: SuperBuild: proj: 4.8.0 -> 4.9.3

WIP: SuperBuild: proj: 4.8.0 -> 4.9.3

--- SuperBuild/CMake/External_proj.cmake
+++ SuperBuild/CMake/External_proj.cmake
@@ -22,47 +22,45 @@

 SETUP_SUPERBUILD(PROJ)

-if(MSVC)
+# if(MSVC)
+#   ExternalProject_Add(PROJ
+#     PREFIX PROJ
+#     URL "http://download.osgeo.org/proj/proj-4.8.0.tar.gz"
+#     URL_MD5 d815838c92a29179298c126effbb1537
+#     SOURCE_DIR ${PROJ_SB_SRC}
+#     BINARY_DIR ${PROJ_SB_SRC}
+#     INSTALL_DIR ${SB_INSTALL_PREFIX}
+#     DOWNLOAD_DIR ${DOWNLOAD_LOCATION}
+#     CONFIGURE_COMMAND ""
+#     BUILD_COMMAND nmake /f ${PROJ_SB_SRC}/makefile.vc
+#     INSTALL_COMMAND nmake /f ${PROJ_SB_SRC}/makefile.vc install-all INSTDIR=${SB_INSTALL_PREFIX_NATIVE}
+#     )
+
+# else()
+
+#   if(APPLE)
+#     set(PROJ_SB_ENV_CONFIGURE_CMD ${SB_ENV_CONFIGURE_CMD} LDFLAGS=-headerpad_max_install_names)
+#   else()
+#     set(PROJ_SB_ENV_CONFIGURE_CMD ${SB_ENV_CONFIGURE_CMD})
+#   endif()
+
   ExternalProject_Add(PROJ
     PREFIX PROJ
-    URL "http://download.osgeo.org/proj/proj-4.8.0.tar.gz"
-    URL_MD5 d815838c92a29179298c126effbb1537
-    SOURCE_DIR ${PROJ_SB_SRC}
+    URL "http://download.osgeo.org/proj/proj-4.9.3.tar.gz"
+    URL_MD5 d598336ca834742735137c5674b214a1
     BINARY_DIR ${PROJ_SB_SRC}
     INSTALL_DIR ${SB_INSTALL_PREFIX}
     DOWNLOAD_DIR ${DOWNLOAD_LOCATION}
-    CONFIGURE_COMMAND ""
-    BUILD_COMMAND nmake /f ${PROJ_SB_SRC}/makefile.vc
-    INSTALL_COMMAND nmake /f ${PROJ_SB_SRC}/makefile.vc install-all INSTDIR=${SB_INSTALL_PREFIX_NATIVE}
+    CMAKE_CACHE_ARGS
+    ${SB_CMAKE_CACHE_ARGS}
+    CMAKE_COMMAND ${SB_CMAKE_COMMAND}
     )

-else()
+

-  if(APPLE)
-    set(PROJ_SB_ENV_CONFIGURE_CMD ${SB_ENV_CONFIGURE_CMD} LDFLAGS=-headerpad_max_install_names)
-  else()
-    set(PROJ_SB_ENV_CONFIGURE_CMD ${SB_ENV_CONFIGURE_CMD})
-  endif()
+# endif()

-  ExternalProject_Add(PROJ
-    PREFIX PROJ
-    URL "http://download.osgeo.org/proj/proj-4.8.0.tar.gz"
-    URL_MD5 d815838c92a29179298c126effbb1537
-    BINARY_DIR ${PROJ_SB_SRC}
-    INSTALL_DIR ${SB_INSTALL_PREFIX}
-    DOWNLOAD_DIR ${DOWNLOAD_LOCATION}
-    CONFIGURE_COMMAND
-    ${SB_ENV_CONFIGURE_CMD}
-    ${PROJ_SB_SRC}/configure
-    --prefix=${SB_INSTALL_PREFIX}
-    --enable-static=no
-    BUILD_COMMAND $(MAKE)
-    INSTALL_COMMAND $(MAKE) install
-    )
-
-endif()
-
-SUPERBUILD_PATCH_SOURCE(PROJ)
+# SUPERBUILD_PATCH_SOURCE(PROJ)

 set(_SB_PROJ_INCLUDE_DIR ${SB_INSTALL_PREFIX}/include)
 if(WIN32)


Update the vtkDICOM remote module tag.

Update the vtkDICOM remote module tag.

This brings in vtk-dicom 0.7.0

--- Remote/vtkDICOM.remote.cmake
+++ Remote/vtkDICOM.remote.cmake
@@ -4,7 +4,7 @@

 vtk_fetch_module(vtkDICOM
   "Dicom classes and utilities"
-  GIT_REPOSITORY https://github.com/lorensen/vtk-dicom
-  # September 3, 2015 - vtksys changes
-  GIT_TAG f4556b282b1f9e3f3adb98a7ad618b0bb57dc6ab
+  GIT_REPOSITORY https://github.com/dgobbi/vtk-dicom
+  # vtk-dicom tag v0.7.0 plus 2 (Oct 23, 2015)
+  GIT_TAG e32ec575b084735b90cfacff589db35ce4cfc017
   )


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

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

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

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

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

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

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

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

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

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

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

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

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

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

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

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

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


Disable specific installer for MacOS since it doesn't work as expected (yet)

--- deploy/packages/pack-template.cmake
+++ deploy/packages/pack-template.cmake
@@ -9,10 +9,9 @@

 #
-# Package configuration
-#
-
 # Output packages
+#
+
 if("${CMAKE_SYSTEM_NAME}" MATCHES "Windows")
     # Windows installer
     set(OPTION_PACK_GENERATOR "NSIS;ZIP" CACHE STRING "Package targets")
@@ -29,11 +28,13 @@
         set(PACK_COMPONENT_INSTALL OFF)
         set(PACK_INCLUDE_TOPDIR OFF)
     endif()
-elseif("${CMAKE_SYSTEM_NAME}" MATCHES "Darwin")
+#elseif("${CMAKE_SYSTEM_NAME}" MATCHES "Darwin")
     # MacOS X disk image
-    set(OPTION_PACK_GENERATOR "DragNDrop" CACHE STRING "Package targets")
-    set(PACK_COMPONENT_INSTALL OFF)
-    set(PACK_INCLUDE_TOPDIR OFF)
+    # At the moment, DMG generator and CPACK_INCLUDE_TOPLEVEL_DIRECTORY=ON do not work together.
+    # Therefore, we disable dmg images for MacOS until we've found a solution
+#   set(OPTION_PACK_GENERATOR "DragNDrop" CACHE STRING "Package targets")
+#   set(PACK_COMPONENT_INSTALL OFF)
+#   set(PACK_INCLUDE_TOPDIR ON)
 else()
     # Default (portable package for any platform)
     set(OPTION_PACK_GENERATOR "ZIP;TGZ" CACHE STRING "Package targets")
@@ -41,7 +42,11 @@
     set(PACK_INCLUDE_TOPDIR ON)
 endif()

-# Components
+
+#
+# Package components
+#
+
 set(CPACK_COMPONENTS_ALL runtime dev examples docs)

 set(CPACK_COMPONENT_RUNTIME_DISPLAY_NAME "Template library")


ENH: CI: PKG: Fixed detection of executable files as shared-object on recent Linux (-PIE).

--- Packaging/detect_using_file_command.cmake
+++ Packaging/detect_using_file_command.cmake
@@ -112,6 +112,18 @@
     message(FATAL_ERROR "unknown/untracked file type found: ${input_file}")
   endif() #if("${file_ov_lower}" MATCHES ...)

+  # Patch file command returning shared-oject for executable on Linux when -PIE is used.
+  if( LINUX )
+    get_filename_component( input_file_DIR ${input_file} DIRECTORY )
+    get_filename_component( input_file_dIR ${input_file_DIR} NAME )
+    string( TOLOWER "${input_file_DIR}" input_file_DIR )
+    if( ${input_file_DIR} MATCHES "bin" )
+      message( WARNING "${input_file} detected as shared-object." )
+      set(detected_type PROGRAMS)
+      set(detected_dir bin)
+    endif()
+  endif()
+
   #message("detected_type=${detected_type}")
   set(${result_type} "${detected_type}" PARENT_SCOPE)
   set(${result_dir} "${detected_dir}" PARENT_SCOPE)


COMP: Fix cmake warnings on EXCLUDE_FROM_ALL.

EXCLUDE_FROM_ALL is replaced by EXCLUDE_FROM_DEFAULT
in MGHIO remote module:
1beeaa5abb18188ded17bf6337b31c572d2594cf .

Change-Id: I7e0aa6b4fcec4a631faded0949d425de7cf9d3ba

--- Modules/Remote/MGHIO.remote.cmake
+++ Modules/Remote/MGHIO.remote.cmake
@@ -1,5 +1,5 @@
 itk_fetch_module(MGHIO
   "MGHIO ImageIO plugin for ITK"
   GIT_REPOSITORY https://github.com/Slicer/itkMGHImageIO.git
-  GIT_TAG 841832fd94889d0793b606c0a5b9be981b98cec3
+  GIT_TAG 1beeaa5abb18188ded17bf6337b31c572d2594cf
   )


Add test if S_IRGRP is defined

Add test if S_IRGRP is defined

--- cmake/check.cmake
+++ cmake/check.cmake
@@ -1,6 +1,7 @@
 include (CheckFunctionExists)
 include (CheckIncludeFile)
 include (CheckLibraryExists)
+include (CheckSymbolExists)
 include (CheckTypeSize)
 include (TestBigEndian)

@@ -87,6 +88,8 @@
 check_function_exists(lrintf        	HAVE_LRINTF)
 check_function_exists(lround        	HAVE_LROUND)

+check_symbol_exists (S_IRGRP sys/stat.h HAVE_DECL_S_IRGRP)
+
 test_big_endian(WORDS_BIGENDIAN)
 if (WORDS_BIGENDIAN)
 	set (WORDS_BIGENDIAN 1)


Fix CMake MySQL module to be more nix-friendly

--- cmake/mysql.cmake
+++ cmake/mysql.cmake
@@ -1,6 +1,29 @@

 if(UNIX)
-    include_directories("/usr/include/mysql/")
+    find_path(MYSQL_INCLUDE_DIR mysql.h
+        /usr/include/mysql
+        /usr/local/include/mysql
+        /opt/mysql/mysql/include
+        /opt/mysql/mysql/include/mysql
+        /opt/mysql/include
+        /opt/local/include/mysql5
+        /usr/local/mysql/include
+        /usr/local/mysql/include/mysql
+        $ENV{ProgramFiles}/MySQL/*/include
+        $ENV{SystemDrive}/MySQL/*/include
+    )
+
+    if(MYSQL_INCLUDE_DIR)
+        set(MYSQL_FOUND TRUE)
+
+        include_directories(${MYSQL_INCLUDE_DIR})
+    endif(MYSQL_INCLUDE_DIR)
+
+    if(MYSQL_FOUND)
+        message(STATUS "MySQL include dir: ${MYSQL_INCLUDE_DIR}")
+    else(MYSQL_FOUND)
+        message(FATAL_ERROR "Could not find MySQL headers.")
+    endif(MYSQL_FOUND)
 else()
     include_directories("${LIBRARY_DIR}/external/MySQL/")
     if(CMAKE_SIZEOF_VOID_P EQUAL 4)
@@ -13,5 +36,3 @@
         link_directories(${LIBRARY_DIR}/external/zlib/x64)
     endif()
 endif()
-
-


CMake updated tx2h function to handle comments on code lines properly and to remove empty lines.

--- cmake/txt2h.cmake
+++ cmake/txt2h.cmake
@@ -9,18 +9,23 @@
 	set(items "${ARGN}")
 	string(REPLACE "\n" "\n;" item_list ${items})
     foreach(item ${item_list})
-		# Removes comments (optimization)
-		string(FIND "${item}" "//" comment_pos)
-		if(NOT ${comment_pos} EQUAL -1)
-			string(SUBSTRING "${item}" 0 ${comment_pos} item)
+		string(STRIP "${item}" item)
+		if (NOT "${item}" STREQUAL "")
+			string(CONCAT item "${item}\n")
+			# Removes comments (optimization)
+			string(FIND "${item}" "//" comment_pos)
+			if(NOT ${comment_pos} EQUAL -1)
+				string(SUBSTRING "${item}" 0 ${comment_pos} item)
+				if (NOT "${item}" STREQUAL "")
+					string(CONCAT item "${item}\n")
+				endif()
+			endif()
+			if (NOT "${item}" STREQUAL "")
+				string(REPLACE "\n" " NEWLINE\\\n" item_with_end ${item})
+				string(REPLACE "\"" "\\\"" item_done ${item_with_end})
+				set(the_list "${the_list}${item_done}")
+			endif()
 		endif()
-		if (NOT "${item}" STREQUAL "")
-			string(REPLACE "\n" " NEWLINE\\\n" item_with_end ${item})
-			string(REPLACE "\"" "\\\"" item_done ${item_with_end})
-		else()
-			set(item_done ${item})
-		endif()
-        set(the_list "${the_list}${item_done}")
     endforeach()
     set(${retval} "${the_list}\";\n\n#endif\n")
 endmacro()


#6 Fix missing headers on OS X

#6 Fix missing headers on OS X

--- cmake/Properties.cmake
+++ cmake/Properties.cmake
@@ -22,7 +22,7 @@
                           MACOSX_FRAMEWORK_IDENTIFIER org.yalir.${SFEMOVIE_LIB}
                           MACOSX_FRAMEWORK_SHORT_VERSION_STRING ${VERSION_MAJOR}.${VERSION_MINOR}
                           MACOSX_FRAMEWORK_BUNDLE_VERSION ${VERSION_MAJOR}.${VERSION_MINOR}
-                          PUBLIC_HEADER "${SFE_HEADERS}")
+                          PUBLIC_HEADER "${HEADER_FILES}")

     # adapt install directory to allow distributing dylibs/frameworks in user’s frameworks/application bundle
     set_target_properties(${SFEMOVIE_LIB} PROPERTIES


Add compiler options to clang as well as gcc and msvc

--- cmake/c11Support.cmake
+++ cmake/c11Support.cmake
@@ -1,5 +1,13 @@
 # Enable C++11
-if(CMAKE_COMPILER_IS_GNUCXX)
+if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
+  # using regular Clang or AppleClang
+  add_definitions(-std=c++11)
+elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
+  # using GCC
   add_definitions(-std=c++0x)
   add_definitions(-std=c++11)
+elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel")
+  # using Intel C++
+elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
+  # using Visual Studio C++
 endif()


[#63] Add GCC -p option for tracing support

--- cmake/deftargets.cmake
+++ cmake/deftargets.cmake
@@ -114,7 +114,7 @@
             endif()

             set(common_options -std=${STD_CXX} -Wall -pedantic -ftemplate-depth-1024 -fPIC -ftemplate-backtrace-limit=0)
-            set(debug_options -O0 -g3)
+            set(debug_options -O0 -g3 -p)
             set(release_options -O3 -g0)

             if(TARGET_TYPE STREQUAL "LIBRARY" AND ARGS_SHARED)


Fixed default parameter size for prime field module.

--- cmake/fp.cmake
+++ cmake/fp.cmake
@@ -1,6 +1,6 @@
 message(STATUS "Prime field arithmetic configuration (FP module):\n")

-message("   ** Arithmetic precision of the prime field module (default = 254,0,off,off):")
+message("   ** Arithmetic precision of the prime field module (default = 256,0,off,off):")
 message("      FP_PRIME=n        The prime modulus size in bits.\n")
 message("      FP_KARAT=n        The number of Karatsuba levels.")
 message("      FP_PMERS=[off|on] Prefer Pseudo-Mersenne primes over random primes.")


Copy include files which doesn't have an extension

--- cmake/InstallFAST.cmake
+++ cmake/InstallFAST.cmake
@@ -70,6 +70,11 @@
     DESTINATION fast/include/
     FILES_MATCHING PATTERN "*.hpp"
 )
+install(DIRECTORY ${PROJECT_BINARY_DIR}/include/
+    DESTINATION fast/include/
+    FILES_MATCHING REGEX "/[^.]+$" # Files with no extension
+)
+

 # Install created headers


SK:

SK:

-DOC: some comments

--- src/Testing/Dashboard/elxDashboard_BIGR_winXP32_VS2008.cmake
+++ src/Testing/Dashboard/elxDashboard_BIGR_winXP32_VS2008.cmake
@@ -24,7 +24,9 @@

 # default: automatically determined
 #set(CTEST_UPDATE_COMMAND /path/to/svn)
+# this does not work, because quotes are put around it later:
 #set(CTEST_UPDATE_COMMAND "C:/Program Files/Subversion/bin/svn.exe --config-dir d:/dox/rest/confignoext")
+# this seems to work:
 set(CTEST_UPDATE_COMMAND "D:/scripts/svn.bat")

 # Specify the kind of dashboard to submit


increase timeout for msan tests

increase timeout for msan tests

--- CI/config/with_msan.cmake
+++ CI/config/with_msan.cmake
@@ -3,3 +3,5 @@
 include(without_python)
 set_option(USE_SANITIZER msan)
 set_option(USE_LIBCXX "/libcxx_msan")
+set_option(tests_timeout 48)
+


Changed link to SOFA tarball.

Changed link to SOFA tarball.

--- CMakeExternals/SOFA.cmake
+++ CMakeExternals/SOFA.cmake
@@ -39,7 +39,7 @@
       SOURCE_DIR ${CMAKE_BINARY_DIR}/${proj}-src
       BINARY_DIR ${proj}-build
       PREFIX ${proj}-cmake
-      URL http://dl.dropboxusercontent.com/u/5822501/SOFA-rev9479.tar.gz
+      URL http://mitk.org/download/thirdparty/SOFA-rev9479.tar.gz
       URL_MD5 fa43e6183abb8fc36c86ec43a095fdc2
       PATCH_COMMAND ${SOFA_PATCH_COMMAND}
       INSTALL_COMMAND ""


suppressed warning C4005 on MSVC, caused by multiple definitions of WIN32_LEAN_AND_MEAN in soloud

--- globals.cmake
+++ globals.cmake
@@ -70,7 +70,7 @@
 	set(MIRRAGE_DEFAULT_COMPILER_ARGS ${MIRRAGE_DEFAULT_COMPILER_ARGS} -mavx2 -mrecip=all -fno-math-errno -funsafe-math-optimizations -fcx-limited-range -fexcess-precision=fast)

 elseif(MSVC)
-	set(MIRRAGE_DEFAULT_COMPILER_ARGS /DWIN32_LEAN_AND_MEAN /DNOMINMAX /MP /W3 /WX)
+	set(MIRRAGE_DEFAULT_COMPILER_ARGS /DWIN32_LEAN_AND_MEAN /DNOMINMAX /MP /W3 /WX /wd4005)
 	set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /ignore:4221")
 	set(CMAKE_STATIC_LINKER_FLAGS "${CMAKE_STATIC_LINKER_FLAGS} /ignore:4221")
 endif()


Revert moving gcc to g++11 in 18c3b1

Revert moving gcc to g++11 in 18c3b1

--- SetFlags.cmake
+++ SetFlags.cmake
@@ -46,10 +46,6 @@
 			set(CMAKE_CXX_FLAGS_DEBUG   "${CMAKE_CXX_FLAGS_DEBUG}   -std=c++11")
 			set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -std=c++11")
 		else()
-			set(CMAKE_CXX_FLAGS         "${CMAKE_CXX_FLAGS}         -std=c++0x")
-			set(CMAKE_CXX_FLAGS_DEBUG   "${CMAKE_CXX_FLAGS_DEBUG}   -std=c++0x")
-			set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -std=c++0x")
-
 			add_flags_cxx("-pthread")
 		endif()

@@ -60,10 +56,6 @@
 			set(CMAKE_CXX_FLAGS         "${CMAKE_CXX_FLAGS}         -std=c++11")
 			set(CMAKE_CXX_FLAGS_DEBUG   "${CMAKE_CXX_FLAGS_DEBUG}   -std=c++11")
 			set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -std=c++11")
-		else()
-			set(CMAKE_CXX_FLAGS         "${CMAKE_CXX_FLAGS}         -std=c++0x")
-			set(CMAKE_CXX_FLAGS_DEBUG   "${CMAKE_CXX_FLAGS_DEBUG}   -std=c++0x")
-			set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -std=c++0x")
 		endif()

 		# We use a signed char (fixes #640 on RasPi)


Use gsl as dll on windows

Use gsl as dll on windows

--- cmake/FindGSL.cmake
+++ cmake/FindGSL.cmake
@@ -77,6 +77,8 @@
   #  "GSL_GSLCBLAS_LIBRARY=${GSL_GSLCBLAS_LIBRARY}\n"
   #  "GSL_LIBRARIES=${GSL_LIBRARIES}")

+	# we want shared gsl libraries on windows
+	ADD_DEFINITIONS(-DGSL_DLL)

 ELSE(WIN32)


Add another path to find TBB on Windows

Add another path to find TBB on Windows

--- cmake/FindTBB.cmake
+++ cmake/FindTBB.cmake
@@ -17,7 +17,10 @@
 IF (WIN32)
   FIND_PATH(TBB_ROOT include/tbb/task_scheduler_init.h
     DOC "Root of TBB installation"
-    PATHS ${PROJECT_SOURCE_DIR}/tbb "C:/Program Files (x86)/Intel/Composer XE/tbb"
+    PATHS
+      ${PROJECT_SOURCE_DIR}/tbb
+      "C:/Program Files (x86)/Intel/Composer XE/tbb"
+      "C:/Program Files (x86)/Intel/compilers_and_libraries/windows/tbb"
   )

   IF (CMAKE_SIZEOF_VOID_P EQUAL 8)


Disabled optimization for unit test targets (when added using ./cmake/testing.cmake helper) since FakeIt isn't reliable with too heavy optimization.

--- cmake/testing.cmake
+++ cmake/testing.cmake
@@ -55,6 +55,8 @@
         COMMAND ${arg_TEST_NAME} ${arg_TEST_ARGS}
     )
     set_tests_properties(${arg_TEST_NAME} PROPERTIES LABELS ${arg_TAGS})
+    # FakeIt is not reliable with optimizations
+    target_compile_options(${arg_TEST_NAME} PUBLIC "$<$<CONFIG:RELEASE>:-O0>")

     get_target_property(OUT_DIR ${arg_TEST_NAME} BINARY_DIR)
     install(


Remove cruft

Remove cruft

--- cmake/CircleContinuous.cmake
+++ cmake/CircleContinuous.cmake
@@ -22,8 +22,6 @@
 ctest_test(RETURN_VALUE rv)
 ctest_submit()

-file(REMOVE "${CTEST_BINARY_DIRECTORY}/failure")
 if(NOT rv EQUAL 0)
-  file(WRITE "${CTEST_BINARY_DIRECTORY}/failure" "${rv}")
   message(FATAL_ERROR "Test failures occurred.")
 endif()


build: be more conservative when passing `-target`

When building the swift tools with gcc, we would fail as we would try to
pass `-target` to gcc, which does not support this option.  Invert the
condition and only pass the argument when building with clang.

--- cmake/modules/AddSwift.cmake
+++ cmake/modules/AddSwift.cmake
@@ -119,8 +119,8 @@
     endif()
   endif()

-  # MSVC and clang-cl don't understand -target.
-  if (NOT SWIFT_COMPILER_IS_MSVC_LIKE)
+  # MSVC, clang-cl, gcc don't understand -target.
+  if(CMAKE_C_COMPILER_ID STREQUAL Clang AND NOT SWIFT_COMPILER_IS_MSVC_LIKE)
     list(APPEND result "-target" "${SWIFT_SDK_${CFLAGS_SDK}_ARCH_${CFLAGS_ARCH}_TRIPLE}${DEPLOYMENT_VERSION}")
   endif()


build: cleanup unreferenced variable `SWIFTLIB_SINGLE_EXTERNAL_SOURCES` in `_add_swift_host_library_single`

--- cmake/modules/AddSwift.cmake
+++ cmake/modules/AddSwift.cmake
@@ -787,8 +787,7 @@
   endif()

   add_library("${target}" ${libkind}
-              ${SWIFTLIB_SINGLE_SOURCES}
-              ${SWIFTLIB_SINGLE_EXTERNAL_SOURCES})
+              ${SWIFTLIB_SINGLE_SOURCES})
   _set_target_prefix_and_suffix("${target}" "${libkind}" "${SWIFTLIB_SINGLE_SDK}")

   if("${SWIFTLIB_SINGLE_SDK}" STREQUAL "WINDOWS")


build: disable static RTTI on Windows if possible

Newer SDKs have the ability to disable the static RTTI usage as well as
the dynamic.  We had to enable the use of static RTTI previously for the
use of `std::function`.  Disable the static RTTI if possible.

--- cmake/modules/AddSwift.cmake
+++ cmake/modules/AddSwift.cmake
@@ -257,11 +257,18 @@
     list(APPEND result "-D_ENABLE_ATOMIC_ALIGNMENT_FIX")

     # msvcprt's std::function requires RTTI, but we do not want RTTI data.
-    # Emulate /GR-
+    # Emulate /GR-.
+    # TODO(compnerd) when moving up to VS 2017 15.3 and newer, we can disable
+    # RTTI again
     if(NOT SWIFT_COMPILER_IS_MSVC_LIKE)
       list(APPEND result -frtti)
       list(APPEND result -Xclang;-fno-rtti-data)
     endif()
+
+    # NOTE: VS 2017 15.3 introduced this to disable the static components of
+    # RTTI as well.  This requires a newer SDK though and we do not have
+    # guarantees on the SDK version currently.
+    list(APPEND result "-D_HAS_STATIC_RTTI=0")
   endif()

   if(CFLAGS_ENABLE_ASSERTIONS)


Ran dos2unix on cmake files

Ran dos2unix on cmake files

--- cmake_support/FindDeps.cmake
+++ cmake_support/FindDeps.cmake
@@ -1,88 +1,88 @@
-# win32: set BOOST_LIBRARYDIR and BOOST_INCLUDEDIR folders
-if(WIN32)
-	# ugly boost bug workaround, boost w/ static build crashes in codecvt
-	set( Boost_USE_STATIC_LIBS ON )
-        if(MINGW)
-            add_definitions( -DBOOST_THREAD_USE_LIB )
-        endif(MINGW)
-endif(WIN32)
-
-set(Boost_ADDITIONAL_VERSIONS 1.59 1.60)
-
-find_package( Boost 1.60 EXACT REQUIRED
-        COMPONENTS filesystem system thread date_time program_options atomic serialization chrono )
-
-find_package( OpenGL REQUIRED )
-
-# add possible lib names at the end of the arg list
-macro( my_find_package pkg_name header default_lib_name )
-
-    find_package( ${pkg_name} QUIET MODULE )
-
-    if(NOT ${${pkg_name}_FOUND})
-        message(STATUS "Package ${pkg_name} not found! Trying to find paths manually ...")
-
-	    if( NOT "${header}" STREQUAL "" )
-            find_path(${pkg_name}_INCLUDE_DIR ${header}
-                PATHS
-                    ${REAPING2_DEPS_INSTALL_DIR}/include
-                    $ENV{${pkg_name}_INCLUDEDIR})
-            if(NOT ${pkg_name}_INCLUDE_DIR)
-                message(FATAL_ERROR "${pkg_name} include dir not found! Searched for: ${header}" )
-	        endif(NOT ${pkg_name}_INCLUDE_DIR)
-	    endif( NOT "${header}" STREQUAL "" )
-
-	    if( NOT "${default_lib_name}" STREQUAL "" )
-            set(lib_names ${ARGN})
-            find_library(${pkg_name}_LIBRARY
-                NAMES ${default_lib_name} ${lib_names}
-                PATHS
-                    ${REAPING2_DEPS_INSTALL_DIR}/lib
-                    $ENV{${pkg_name}_LIBRARYDIR})
-            if(NOT ${pkg_name}_LIBRARY)
-                message(FATAL_ERROR "${pkg_name} library not found! Searched for: ${default_lib_name};${lib_names}")
-            endif()
-	    endif( NOT "${default_lib_name}" STREQUAL "" )
-
-        set( ${pkg_name}_INCLUDE_DIRS ${${pkg_name}_INCLUDE_DIR} CACHE PATH "" FORCE )
-        set( ${pkg_name}_LIBRARIES ${${pkg_name}_LIBRARY} CACHE PATH "" FORCE )
-
-        message( STATUS "${pkg_name} include dir: \"${${pkg_name}_INCLUDE_DIR}\" library: \"${${pkg_name}_LIBRARY}\"" )
-    else()
-        message( STATUS "${pkg_name} found!" )
-    endif()
-
-
-endmacro( my_find_package )
-
-my_find_package( GLEW GL/glew.h GLEW glew32s glew32sd )
-
-my_find_package( GLFW GLFW/glfw3.h glfw glfw3 glfw3dll )
-
-if(WIN32)
-    my_find_package( GLM glm/glm.hpp "" )
-else()
-    set( glm_include_dir "" )
-endif()
-
-my_find_package( LIBOGG ogg/ogg.h ogg libogg libogg_static )
-
-my_find_package( LIBVORBIS vorbis/vorbisfile.h vorbis ${VORBISFILE_LIBRARY_NAMES} )
-my_find_package( LIBVORBISFILE "" vorbisfile vorbisfile_static )
-set(LIBVORBIS_LIBRARIES ${LIBVORBIS_LIBRARY} ${LIBVORBISFILE_LIBRARY})
-
-my_find_package( ZLIB zlib.h z zdll zlib zlibd)
-
-my_find_package( PNG png.h png libpng16 libpng16_static libpng16d libpng16_staticd )
-
-my_find_package( PORTAUDIO portaudio.h portaudio portaudio_x86 portaudio_static_x86 portaudio_x64 portaudio_static_x64 )
-
-my_find_package( ENET enet/enet.h enet enet64 enet.lib enet64.lib )
-
-if(WIN32)
-    set( PLATFORM_LIBS "" )
-else()
-    set( PLATFORM_LIBS pthread rt X11 Xrandr Xi Xxf86vm )
-endif()
-
-set( PORTAUDIO_CMAKE_INCLUDE_DIR $ENV{PORTAUDIO_CMAKE_INCLUDEDIR} )
+# win32: set BOOST_LIBRARYDIR and BOOST_INCLUDEDIR folders
+if(WIN32)
+	# ugly boost bug workaround, boost w/ static build crashes in codecvt
+	set( Boost_USE_STATIC_LIBS ON )
+        if(MINGW)
+            add_definitions( -DBOOST_THREAD_USE_LIB )
+        endif(MINGW)
+endif(WIN32)
+
+set(Boost_ADDITIONAL_VERSIONS 1.59 1.60)
+
+find_package( Boost 1.60 EXACT REQUIRED
+        COMPONENTS filesystem system thread date_time program_options atomic serialization chrono )
+
+find_package( OpenGL REQUIRED )
+
+# add possible lib names at the end of the arg list
+macro( my_find_package pkg_name header default_lib_name )
+
+    find_package( ${pkg_name} QUIET MODULE )
+
+    if(NOT ${${pkg_name}_FOUND})
+        message(STATUS "Package ${pkg_name} not found! Trying to find paths manually ...")
+
+	    if( NOT "${header}" STREQUAL "" )
+            find_path(${pkg_name}_INCLUDE_DIR ${header}
+                PATHS
+                    ${REAPING2_DEPS_INSTALL_DIR}/include
+                    $ENV{${pkg_name}_INCLUDEDIR})
+            if(NOT ${pkg_name}_INCLUDE_DIR)
+                message(FATAL_ERROR "${pkg_name} include dir not found! Searched for: ${header}" )
+	        endif(NOT ${pkg_name}_INCLUDE_DIR)
+	    endif( NOT "${header}" STREQUAL "" )
+
+	    if( NOT "${default_lib_name}" STREQUAL "" )
+            set(lib_names ${ARGN})
+            find_library(${pkg_name}_LIBRARY
+                NAMES ${default_lib_name} ${lib_names}
+                PATHS
+                    ${REAPING2_DEPS_INSTALL_DIR}/lib
+                    $ENV{${pkg_name}_LIBRARYDIR})
+            if(NOT ${pkg_name}_LIBRARY)
+                message(FATAL_ERROR "${pkg_name} library not found! Searched for: ${default_lib_name};${lib_names}")
+            endif()
+	    endif( NOT "${default_lib_name}" STREQUAL "" )
+
+        set( ${pkg_name}_INCLUDE_DIRS ${${pkg_name}_INCLUDE_DIR} CACHE PATH "" FORCE )
+        set( ${pkg_name}_LIBRARIES ${${pkg_name}_LIBRARY} CACHE PATH "" FORCE )
+
+        message( STATUS "${pkg_name} include dir: \"${${pkg_name}_INCLUDE_DIR}\" library: \"${${pkg_name}_LIBRARY}\"" )
+    else()
+        message( STATUS "${pkg_name} found!" )
+    endif()
+
+
+endmacro( my_find_package )
+
+my_find_package( GLEW GL/glew.h GLEW glew32s glew32sd )
+
+my_find_package( GLFW GLFW/glfw3.h glfw glfw3 glfw3dll )
+
+if(WIN32)
+    my_find_package( GLM glm/glm.hpp "" )
+else()
+    set( glm_include_dir "" )
+endif()
+
+my_find_package( LIBOGG ogg/ogg.h ogg libogg libogg_static )
+
+my_find_package( LIBVORBIS vorbis/vorbisfile.h vorbis ${VORBISFILE_LIBRARY_NAMES} )
+my_find_package( LIBVORBISFILE "" vorbisfile vorbisfile_static )
+set(LIBVORBIS_LIBRARIES ${LIBVORBIS_LIBRARY} ${LIBVORBISFILE_LIBRARY})
+
+my_find_package( ZLIB zlib.h z zdll zlib zlibd)
+
+my_find_package( PNG png.h png libpng16 libpng16_static libpng16d libpng16_staticd )
+
+my_find_package( PORTAUDIO portaudio.h portaudio portaudio_x86 portaudio_static_x86 portaudio_x64 portaudio_static_x64 )
+
+my_find_package( ENET enet/enet.h enet enet64 enet.lib enet64.lib )
+
+if(WIN32)
+    set( PLATFORM_LIBS "" )
+else()
+    set( PLATFORM_LIBS pthread rt X11 Xrandr Xi Xxf86vm )
+endif()
+
+set( PORTAUDIO_CMAKE_INCLUDE_DIR $ENV{PORTAUDIO_CMAKE_INCLUDEDIR} )


COMP: Force build pnglib and zlib on linux too for niftyreg

--- SuperBuild/ExternalNiftyreg.cmake
+++ SuperBuild/ExternalNiftyreg.cmake
@@ -32,6 +32,7 @@
   CMAKE_GENERATOR ${gen}
   CMAKE_ARGS
    --no-warn-unused-cli
+   -DBUILD_ALL_DEP:BOOL=ON
    -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
 )


Libraries pthread and m are only needed on linux.

--- copasi/common.cmake
+++ copasi/common.cmake
@@ -46,7 +46,7 @@
 if (EXTRA_LIBS)
   SET(SE_EXTERNAL_LIBS ${SE_EXTERNAL_LIBS} ${EXTRA_LIBS})
 else ()
-  if (${BLA_VENDOR} STREQUAL "Intel (MKL)")
+  if (UNIX AND ${BLA_VENDOR} STREQUAL "Intel (MKL)")
     SET(SE_EXTERNAL_LIBS ${SE_EXTERNAL_LIBS} -lpthread -lm)
   endif()
 endif(EXTRA_LIBS)


Allow for compilation of r bindings if FIND_LIBRARY fails to find the default framework location for macOS

--- copasi/common.cmake
+++ copasi/common.cmake
@@ -39,6 +39,9 @@

 if (APPLE)
   FIND_LIBRARY(COREFOUNDATION_LIBRARY CoreFoundation REQUIRED)
+  if (NOT COREFOUNDATION_LIBRARY AND EXISTS /System/Library/Frameworks/CoreFoundation.framework)
+  set(COREFOUNDATION_LIBRARY /System/Library/Frameworks/CoreFoundation.framework)
+  endif()
   MARK_AS_ADVANCED (COREFOUNDATION_LIBRARY)
   SET(SE_EXTERNAL_LIBS ${SE_EXTERNAL_LIBS} ${COREFOUNDATION_LIBRARY})
 endif (APPLE)


Need to include some more boost headers for boost 1.50+

--HG--
branch : v1-8

--- CMake/InstallDependencies.cmake
+++ CMake/InstallDependencies.cmake
@@ -180,7 +180,6 @@
       PATTERN "asio" EXCLUDE
       PATTERN "assign" EXCLUDE
       PATTERN "bimap" EXCLUDE
-      PATTERN "chrono" EXCLUDE
       PATTERN "circular_buffer" EXCLUDE
       PATTERN "compatibility" EXCLUDE
       PATTERN "concept_check" EXCLUDE
@@ -189,7 +188,6 @@
       PATTERN "filesystem" EXCLUDE
       PATTERN "flyweight" EXCLUDE
       PATTERN "format" EXCLUDE
-      PATTERN "functional" EXCLUDE
       PATTERN "fusion" EXCLUDE
       PATTERN "geometry" EXCLUDE
       PATTERN "gil" EXCLUDE
@@ -214,18 +212,15 @@
       PATTERN "ptr_container" EXCLUDE
       PATTERN "python" EXCLUDE
       PATTERN "random" EXCLUDE
-      PATTERN "ratio" EXCLUDE
       PATTERN "regex" EXCLUDE
       PATTERN "serialization" EXCLUDE
       PATTERN "signals" EXCLUDE
       PATTERN "signals2" EXCLUDE
       PATTERN "spirit" EXCLUDE
       PATTERN "statechart" EXCLUDE
-      PATTERN "system" EXCLUDE
       PATTERN "test" EXCLUDE
       PATTERN "timer" EXCLUDE
       PATTERN "tr1" EXCLUDE
-      PATTERN "typeof" EXCLUDE
       PATTERN "units" EXCLUDE
       PATTERN "unordered" EXCLUDE
       PATTERN "uuid" EXCLUDE


Tiny bits of cleanup in OIS lib installation for Apple platforms.

--HG--
branch : v1-9

--- CMake/InstallDependencies.cmake
+++ CMake/InstallDependencies.cmake
@@ -115,18 +115,10 @@
 		install(FILES ${OIS_LIBRARY_REL} DESTINATION lib/minsizerel CONFIGURATIONS MinSizeRel)
 	  endif ()
 	elseif(APPLE)
-	  if (EXISTS ${OGRE_DEP_DIR}/lib/debug/libOIS.a)
-	        install(FILES
-	          ${OGRE_DEP_DIR}/lib/debug/libOIS.a
-	          DESTINATION lib/debug CONFIGURATIONS Debug
-	        )
-	  endif ()
-	  if (EXISTS ${OGRE_DEP_DIR}/lib/release/libOIS.a)
-	        install(FILES
-	          ${OGRE_DEP_DIR}/lib/release/libOIS.a
-	          DESTINATION lib/release CONFIGURATIONS Release RelWithDebInfo MinSizeRel None ""
-	        )
-	  endif ()
+        install(FILES
+          ${OGRE_DEP_DIR}/lib/$(PLATFORM_NAME)/$(CONFIGURATION)/libOIS.a
+          DESTINATION lib/$(PLATFORM_NAME)/$(CONFIGURATION)
+        )
 	endif ()
 	  endif ()

@@ -291,7 +283,7 @@
       copy_release(libGLESv2.dll)
     endif ()

-  elseif(APPLE)
+  elseif(APPLE AND NOT OGRE_BUILD_PLATFORM_APPLE_IOS)
     # copy the required libs and frameworks to the build directory (configure_file is the only copy-like op I found in CMake)
     copy_debug(libOIS.a)
     copy_release(libOIS.a)


Android: use discovered path everywhere instead of guessing it

--- CMake/Utils/AndroidMacros.cmake
+++ CMake/Utils/AndroidMacros.cmake
@@ -59,7 +59,7 @@
 	endif()

 	if(OGRE_CONFIG_ENABLE_FREEIMAGE)
-        add_static_libs("${OGRE_DEPENDENCIES_DIR}/lib/@ANDROID_NDK_ABI_NAME@" "FreeImage")
+	    add_static_libs_from_paths(${FreeImage_LIBRARY_REL})
     endif()

     if(OGRE_USE_BOOST)
@@ -67,7 +67,7 @@
 	   add_static_libs_from_paths(${Boost_LIBRARIES})
     endif()

-    add_static_libs("${OGRE_DEPENDENCIES_DIR}/lib/@ANDROID_NDK_ABI_NAME@" "OIS" "freetype" "zzip")
+    add_static_libs_from_paths(${OIS_LIBRARY_REL} ${FREETYPE_LIBRARY_REL} ${ZZip_LIBRARY_REL})

     if(APPLE OR WIN32)
       SET(ANDROID_EXECUTABLE "android")


The source-group for files now always matches the relative path of the file

--- cmake/modules/DeskvoxAddTarget.cmake
+++ cmake/modules/DeskvoxAddTarget.cmake
@@ -39,53 +39,41 @@
 #

-macro(__deskvox_process_sources)
+function(__deskvox_process_sources)
   foreach(f ${ARGN})
-    get_filename_component(ext ${f} EXT)
     get_filename_component(path ${f} PATH)

-    ##
-    ## TODO:
-    ##
-    ## Re-order filesystem: (public) headers into 'include', source files into 'src'
-    ## then simply use
-    ##      source_group("${path}" FILES ${f})
-    ## below.
-    ##
-
-    if(ext MATCHES "\\.(c|cpp|cxx|mm|cu)")
-      set(group "src")
-    elseif(ext MATCHES "\\.(h|hpp|hxx|inl|inc|impl)")
-      set(group "include")
+    if(NOT path STREQUAL "")
+      string(REPLACE "/" "\\" path "${path}")
+      set(group "${path}")
     else()
       set(group "")
     endif()

-    if(NOT path STREQUAL "")
-      string(REPLACE "/" "\\" path "${path}")
-      set(group "${group}\\${path}")
-    endif()
+    source_group("${group}" FILES ${f})

-    source_group("${group}" FILES ${f})
+    get_filename_component(ext ${f} EXT)

     if(ext MATCHES "\\.(cu)")
       if(NOT DESKVOX_CUDA_FOUND)
         message(STATUS "Note: '" ${f} "' ignored: CUDA support not available or disabled")
       else()
         if(BUILD_SHARED_LIBS)
-          cuda_compile(__dps_cuda_obj ${f} SHARED)
+          cuda_compile(cuda_compile_obj ${f} SHARED)
         else()
-          cuda_compile(__dps_cuda_obj ${f})
+          cuda_compile(cuda_compile_obj ${f})
         endif()

-        list(APPEND __DESKVOX_PROCESSED_SOURCES ${f})
-        list(APPEND __DESKVOX_PROCESSED_SOURCES ${__dps_cuda_obj})
+        list(APPEND processed_sources ${f})
+        list(APPEND processed_sources ${cuda_compile_obj})
       endif()
     else()
-      list(APPEND __DESKVOX_PROCESSED_SOURCES ${f})
+      list(APPEND processed_sources ${f})
     endif()
   endforeach()
-endmacro()
+
+  set(__DESKVOX_PROCESSED_SOURCES ${__DESKVOX_PROCESSED_SOURCES} ${processed_sources} PARENT_SCOPE)
+endfunction()

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


Propagate the cmake generator used for the overall cmake to the small cmake
run that is used to test for compiler support.

svn path=/trunk/; revision=10176

--- cmake/modules/language_support.cmake
+++ cmake/modules/language_support.cmake
@@ -13,6 +13,7 @@
 # Location where PLplot cmake build system first looks for cmake modules.
 set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/modules)
 cmake_minimum_required(VERSION 2.6.0)
+message(STATUS \"CMAKE_GENERATOR = ${CMAKE_GENERATOR}\")
 enable_language(${language} OPTIONAL)
 "
     )
@@ -69,15 +70,21 @@
   endif(language_special)

   execute_process(
-    COMMAND ${CMAKE_COMMAND} .
+    COMMAND ${CMAKE_COMMAND} -G ${CMAKE_GENERATOR} .
     WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/language_tests/${language}
     RESULT_VARIABLE return_code
-    OUTPUT_QUIET
-    ERROR_QUIET)
+    #OUTPUT_VARIABLE output
+    #ERROR_VARIABLE error
+    #OUTPUT_STRIP_TRAILING_WHITESPACE
+    #ERROR_STRIP_TRAILING_WHITESPACE
+    )
   if(return_code EQUAL 0)
     set(${language_works} ON CACHE INTERNAL "")
   else(return_code EQUAL 0)
     set(${language_works} OFF CACHE INTERNAL "")
+    #message(STATUS "A test cmake run with language = ${language} enabled failed with the following stdout and stderr:")
+    #message(STATUS "stdout = ${output}")
+    #message(STATUS "stderr = ${error}")
   endif(return_code EQUAL 0)
 endfunction(workaround_9220)

@@ -94,5 +101,7 @@
 #message("Fortran_language_works = ${Fortran_language_works}")
 #workaround_9220(Java Java_language_works)
 #message("Java_language_works = ${Java_language_works}")
+# Just to terminate temporary test for convenience.
+#message(FATAL_ERROR "")


Remove flags not supported by Valgrind on the build machines.

Also tweak the other flags in a non-user-visible way.

--- CMake/SurgSimUtilities.cmake
+++ CMake/SurgSimUtilities.cmake
@@ -21,7 +21,8 @@
 option(SURGSIM_TESTS_BUILD "Include the unit tests in the build" ON)
 option(SURGSIM_TESTS_RUN "Run the unit tests at the end of the build" ON)
 if(NOT WIN32)
-	option(SURGSIM_TESTS_RUN_WITH_VALGRIND "Run the unit tests under Valgrind" OFF)
+	option(SURGSIM_TESTS_RUN_WITH_VALGRIND
+		"Run the unit tests using Valgrind's memcheck tool." OFF)
 endif(NOT WIN32)
 option(SURGSIM_TESTS_ALL_IN_ONE
 	"Build a single binary with all unit tests.  [Does not work yet!]" OFF)
@@ -32,8 +33,8 @@
 set(SURGSIM_TEST_RUN_PREFIX)
 if(NOT WIN32)
 	if(SURGSIM_TESTS_RUN_WITH_VALGRIND)
-		set(SURGSIM_TEST_RUN_PREFIX valgrind -v --error-exitcode=1
-			--fullpath-after= --leak-check=full --redzone-size=64)
+		set(SURGSIM_TEST_RUN_PREFIX valgrind -v --tool=memcheck --error-exitcode=1
+			--fullpath-after= --leak-check=full)
 	endif(SURGSIM_TESTS_RUN_WITH_VALGRIND)
 endif(NOT WIN32)


COMP: Use separate build path for fftw versions

Each version of fftw that is build should use a build
directory that is unique to that version.

--- CMake/itkExternal_FFTW.cmake
+++ CMake/itkExternal_FFTW.cmake
@@ -94,7 +94,7 @@
     if(ITK_USE_FFTWF)
       itk_download_attempt_check(FFTW)
       ExternalProject_add(fftwf
-        PREFIX fftwf
+        PREFIX fftwf-${_fftw_target_version}
         URL ${_fftw_url}
         URL_HASH SHA512=${_fftw_url_hash}
         DOWNLOAD_NAME "fftw-${_fftw_target_version}.tar.gz"
@@ -108,7 +108,7 @@
             "CPPFLAGS=$ENV{CPPFLAGS} ${_additional_deployment_target_flags}"
             "CXXFLAGS=$ENV{CXXFLAGS} ${GCC_POSITION_INDEPENDENT_CODE_FLAG} ${_additional_deployment_target_flags}"
             ${_additional_configure_env}
-          ${ITK_BINARY_DIR}/fftwf/src/fftwf/configure
+          ${ITK_BINARY_DIR}/fftwf-${_fftw_target_version}/src/fftwf/configure
             ${FFTW_SHARED_FLAG}
             ${FFTW_OPTIMIZATION_CONFIGURATION}
             ${FFTW_THREADS_CONFIGURATION}
@@ -122,7 +122,7 @@
     if(ITK_USE_FFTWD)
       itk_download_attempt_check(FFTW)
       ExternalProject_add(fftwd
-        PREFIX fftwd
+        PREFIX fftwd-${_fftw_target_version}
         URL ${_fftw_url}
         URL_HASH SHA512=${_fftw_url_hash}
         DOWNLOAD_NAME "fftw-${_fftw_target_version}.tar.gz"
@@ -136,7 +136,7 @@
             "CPPFLAGS=$ENV{CPPFLAGS} ${_additional_deployment_target_flags}"
             "CXXFLAGS=$ENV{CXXFLAGS} ${GCC_POSITION_INDEPENDENT_CODE_FLAG} ${_additional_deployment_target_flags}"
             ${_additional_configure_env}
-          ${ITK_BINARY_DIR}/fftwd/src/fftwd/configure
+          ${ITK_BINARY_DIR}/fftwd-${_fftw_target_version}/src/fftwd/configure
             ${FFTW_SHARED_FLAG}
             ${FFTW_OPTIMIZATION_CONFIGURATION}
             ${FFTW_THREADS_CONFIGURATION}