[Build] RMOL now cleanly builds with the new common CMake framework.

--- config/project_config_embeddable.cmake
+++ config/project_config_embeddable.cmake
@@ -754,20 +754,14 @@
   endif ("${_linker_lang}" STREQUAL "_linker_lang-NOTFOUND")

   ##
-  # Installation
-  set (_all_targets ${_lib_target})
-  foreach (_arg_lib_name ${${MODULE_NAME}_INTER_TARGETS})
-    list (APPEND _all_targets ${_arg_lib_name}lib)
-  endforeach (_arg_lib_name)
-
-  # Installation of the library binaries
-  install (TARGETS ${_all_targets}
+  # Installation of the library
+  install (TARGETS ${_lib_target}
     EXPORT ${LIB_DEPENDENCY_EXPORT}
     LIBRARY DESTINATION "${INSTALL_LIB_DIR}" COMPONENT runtime)

   # Register, for reporting purpose, the list of libraries to be built
   # and installed for that module
-  list (APPEND ${MODULE_NAME}_ALL_LIBS ${_all_targets})
+  list (APPEND ${MODULE_NAME}_ALL_LIBS ${_lib_target})
   set (${MODULE_NAME}_ALL_LIBS ${${MODULE_NAME}_ALL_LIBS} PARENT_SCOPE)

   # Install the header files for the library
@@ -872,22 +866,32 @@
 ##                            Tests                              ##
 ###################################################################
 #
-macro (add_test_suites _test_suite_dir_list)
+macro (add_test_suites)
+  #
+  set (_test_suite_dir_list ${ARGV})
+
   if (Boost_FOUND)
     # Tell CMake/CTest that tests will be performed
     enable_testing()

-    #
+    # Browse all the modules, and register test suites for each of them
+    set (_check_target_list "")
     foreach (_module_name ${_test_suite_dir_list})
       set (${_module_name}_ALL_TST_TARGETS "")
       # Each individual test suite is specified within the dedicated
       # sub-directory. The CMake file within each of those test sub-directories
       # specifies a target named check_${_module_name}tst.
       add_subdirectory (test/${_module_name})
-      add_custom_target (check DEPENDS check_${_module_name}tst)
+
+      # Register, for book-keeping purpose (a few lines below),
+      # the (CMake/CTest) test target of the current module
+      list (APPEND _check_target_list check_${_module_name}tst)
     endforeach (_module_name)

-    # Register, for book-keeping purpose, the list of modules to be tested
+    # Register all the module (CMake/CTest) test targets at once
+    add_custom_target (check DEPENDS ${_check_target_list})
+
+    # Register, for reporting purpose, the list of modules to be tested
     set (PROJ_ALL_MOD_FOR_TST ${_test_suite_dir_list})

   endif (Boost_FOUND)


[cmake] Make it possible to override CL_DISABLE_HALF.

I suspect the check is currently wrong. It seems to be checking whether C
allows half precision types in arguments and returns. On Mips, this is not
currently allowed. However, I suspect OpenCL allows this regardless of
target.

This patch removes the unconventional caching mechanism for
CL_DISABLE_HALF in favour of cmake's usual method which allows the user
to specify it with -DCL_DISABLE_HALF=ON/OFF. This allows me to investigate
whether the check is correct or not.

--- cmake/LLVM.cmake
+++ cmake/LLVM.cmake
@@ -650,9 +650,7 @@

 ####################################################################

-setup_cache_var_name(CL_DISABLE_HALF "CL_DISABLE_HALF-${LLVM_HOST_TARGET}-${CLANG}")
-
-if(NOT DEFINED ${CACHE_VAR_NAME})
+if(NOT DEFINED ${CL_DISABLE_HALF})
   set(CL_DISABLE_HALF 0)
   # TODO -march=CPU flags !
   custom_try_compile_c_cxx("${CLANG}" "c" "__fp16 callfp16(__fp16 a) { return a * (__fp16)1.8; };" "__fp16 x=callfp16((__fp16)argc);" RESV -c ${CLANG_TARGET_OPTION}${LLC_TRIPLE} ${CLANG_MARCH_FLAG}${LLC_HOST_CPU})
@@ -661,4 +659,4 @@
   endif()
 endif()

-set_cache_var(CL_DISABLE_HALF "Disable cl_khr_fp16 because fp16 is not supported")
+set(CL_DISABLE_HALF "${CL_DISABLE_HALF}" CACHE BOOL "Disable cl_khr_fp16 because fp16 is not supported")


[hsa] HSAIL library not needed anymore (and unavailable)

--- cmake/LLVM.cmake
+++ cmake/LLVM.cmake
@@ -220,12 +220,6 @@
 # Convert LLVM_LIBS from string -> list format to make handling them easier
 separate_arguments(LLVM_LIBS)

-# workaround for a bug in current HSAIL LLVM
-# it forgets to report one HSAIL library in llvm-config
-if(ENABLE_HSA)
-  list(APPEND LLVM_LIBS "-lLLVMHSAILUtil")
-endif()
-
 # With Visual Studio llvm-config gives invalid list of static libs (libXXXX.a instead of XXXX.lib)
 # we extract the pure names (LLVMLTO, LLVMMipsDesc etc) and let find_library do its job
 foreach(LIBFLAG ${LLVM_LIBS})


cmake: add a macro to build perf test utilities

Signed-off-by: Josef 'Jeff' Sipek <a620f141433c70aa9e43778305a6c68cbfadfb25@josefsipek.net>

--- cmake/test.cmake
+++ cmake/test.cmake
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2016-2017 Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
+# Copyright (c) 2016-2018 Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
 #
 # Permission is hereby granted, free of charge, to any person obtaining a copy
 # of this software and associated documentation files (the "Software"), to deal
@@ -30,6 +30,16 @@
 	)
 endfunction()

+macro(build_perf_bin name)
+	add_executable("perf_${name}"
+		"perf_${name}.c"
+	)
+
+	target_link_libraries("perf_${name}"
+		jeffpc
+	)
+endmacro()
+
 macro(build_test_bin name)
 	add_executable("test_${name}"
 		"test_${name}.c"


Adding support for easybuild

Adding support for easybuild

Former-commit-id: 455c947b2855d57e4cacb6590f18974557eea2e2

--- cmake-modules/FindPackageHDF5.cmake
+++ cmake-modules/FindPackageHDF5.cmake
@@ -76,7 +76,13 @@
     endif()
     if(HDF5_IS_PARALLEL)
         if(HDF5_USE_STATIC_LIBRARIES)
-        message(STATUS "The HDF5 library is parallel and you are linking with -static.\n   The find_package(MPI) command is likely to give a shared library")
+        message(WARNING "The HDF5 library is parallel and you are linking with -static.\n  OpenMPI will not like it.")
+        target_link_libraries(hdf5 INTERFACE -lmpi -lopen-rte -lopen-pal -Wl,--whole-archive -libverbs -Wl,--no-whole-archive -lrt )
+        else()
+            find_package(MPI REQUIRED)
+            target_link_libraries(hdf5 INTERFACE MPI::MPI_C )
+            get_target_property(MPI_LIB MPI::MPI_C INTERFACE_LINK_LIBRARIES)
+            message("Found MPI Library: ${MPI_LIB}")
         endif()
 #        find_package(MPI REQUIRED)
 #        target_link_libraries(hdf5 INTERFACE MPI::MPI_C )


fix(cmake): typo in find protobuf-config.cmake (#3685)

`protobuf-config.cmake` is not found with `find_package(protobuf CONFIG)`,
should be `find_package(**P**rotobuf CONFIG)`.

--- cmake/FindProtobufWithTargets.cmake
+++ cmake/FindProtobufWithTargets.cmake
@@ -83,7 +83,7 @@
 # where protobuf was compiled and installed with `CMake`. Note that on Linux
 # this *must* be all lowercase ``protobuf``, while on Windows it does not
 # matter.
-find_package(protobuf CONFIG QUIET)
+find_package(Protobuf CONFIG QUIET)

 if (protobuf_DEBUG)
     message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "


[cmake] search for libama

[cmake] search for libama

--- cmake/modules/DuneStuffMacros.cmake
+++ cmake/modules/DuneStuffMacros.cmake
@@ -108,6 +108,14 @@
   include_directories(${EIGEN_INCLUDE_DIRS})
 endif(EIGEN_FOUND)

+pkg_check_modules(LIBAMA libama)
+if(LIBAMA_FOUND)
+        include_directories(${LIBAMA_INCLUDE_DIRS})
+        find_library(LIBAMA_LIBRARY NAMES ama
+                HINTS ${LIBAMA_LIBDIR} ${LIBAMA_LIBRARY_DIRS})
+        list(APPEND DUNE_DEFAULT_LIBS ${LIBAMA_LIBRARY})
+endif(LIBAMA_FOUND)
+
 include(FindLIKWID)
 find_package(LIKWID)
 if(LIKWID_FOUND)


Remove ANDROID_NDK_HOST_SYSTEM_NAME

Remove ANDROID_NDK_HOST_SYSTEM_NAME

--- cmake/modules/hunter_finalize.cmake
+++ cmake/modules/hunter_finalize.cmake
@@ -144,29 +144,6 @@

   if(ANDROID)
     # GDBSERVER moved to https://github.com/hunter-packages/android-apk/commit/32531adeb287d3e3b20498ff1a0f76336cbe0551
-
-    if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin")
-      if(CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "x86_64")
-        set(ANDROID_NDK_HOST_SYSTEM_NAME "darwin-x86_64")
-      else()
-        set(ANDROID_NDK_HOST_SYSTEM_NAME "darwin-x86")
-      endif()
-    elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux")
-      if(CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "x86_64")
-        set(ANDROID_NDK_HOST_SYSTEM_NAME "linux-x86_64")
-      else()
-        set(ANDROID_NDK_HOST_SYSTEM_NAME "linux-x86")
-      endif()
-    elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows")
-      if(CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "AMD64")
-        set(ANDROID_NDK_HOST_SYSTEM_NAME "windows-x86_64")
-      else()
-        set(ANDROID_NDK_HOST_SYSTEM_NAME "windows")
-      endif()
-    else()
-      hunter_internal_error("Unknown host for Android")
-    endif()
-
     set(ANDROID_COMPILER_VERSION "")
     string(COMPARE EQUAL "${ANDROID_COMPILER_VERSION}" "" is_empty)
     if(is_empty)


libtuv: Add support for stm32f7nucleo board (#136)

ARM Cortext M7 has at least all features of M4,
but -mfpu flag is not needed
as it will be guessed from -mcpu settings.

It was tested on Nucleo-767ZI.

Change-Id: Ie825b1728eb9373e311086153aa28bdcf42c7c76
Forwarded: https://github.com/pando-project/libtuv/pull/136
libtuv-DCO-1.0-Signed-off-by: Philippe Coval p.coval@samsung.com

--- cmake/option/option_arm-nuttx.cmake
+++ cmake/option/option_arm-nuttx.cmake
@@ -40,6 +40,14 @@
           "-mfpu=fpv4-sp-d16"
           "-mfloat-abi=hard"
           )
+  elseif(${TARGET_BOARD} STREQUAL "stm32f7nucleo")
+    set(FLAGS_COMMON
+          ${FLAGS_COMMON}
+          "-mcpu=cortex-m7"
+          "-mthumb"
+          "-march=armv7e-m"
+          "-mfloat-abi=hard"
+         )
   else()
     message(FATAL_ERROR "TARGET_BOARD=`${TARGET_BOARD}` is unknown to make")
   endif()


Updated re2 and corresponding hash.

Updated re2 and corresponding hash.

--- plugins/ndio-series/cmake/FindRE2.cmake
+++ plugins/ndio-series/cmake/FindRE2.cmake
@@ -9,7 +9,7 @@
   ExternalProject_Add(re2
     #    DOWNLOAD_COMMAND hg clone https://re2.googlecode.com/hg re2
     URL     http://dl.dropbox.com/u/782372/Software/re2.zip
-    URL_MD5 7f98f65c958248d85f6270c96373afb9
+    URL_MD5 02ef3dc07e72033ca14fc3d59259182b
     CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
                -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
     )


A small comment

A small comment

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

--- deal.II/cmake/modules/FindARPACK.cmake
+++ deal.II/cmake/modules/FindARPACK.cmake
@@ -26,6 +26,8 @@
 #
 # ARPACK needs LAPACK and BLAS as dependency, search for them with the help
 # of the LAPACK find module:
+#
+# TODO: ARPACK and mpi...
 #
 FIND_PACKAGE(LAPACK)


STYLE: remove debug messages

STYLE: remove debug messages

--- CMake/External_ossim.cmake
+++ CMake/External_ossim.cmake
@@ -16,10 +16,6 @@

 if(USE_SYSTEM_OSSIM)
   message(STATUS "  Using OSSIM system version")
-  message(WARNING " DEBUG : OSSIM_LIBRARY = ${OSSIM_LIBRARY}")
-  message(WARNING " DEBUG : OSSIM_INCLUDE_DIR = ${OSSIM_INCLUDE_DIR}")
-  message(WARNING " DEBUG : SYSTEM_OSSIM_CMAKE_CACHE = ${SYSTEM_OSSIM_CMAKE_CACHE}")
-
 else()
   set(${proj}_DEPENDENCIES)
   set(OSSIM_SB_BUILD_DIR ${CMAKE_BINARY_DIR}/${proj}/build)


force DCMTK build to link dynamic runtime library to avoid mixing static vs dynamic

--- CMakeExternals/DCMTK.cmake
+++ CMakeExternals/DCMTK.cmake
@@ -100,6 +100,7 @@
       -DDCMTK_OVERWRITE_WIN32_COMPILER_FLAGS:BOOL=OFF
       -DDCMTK_ENABLE_BUILTIN_DICTIONARY:BOOL=ON
       -DDCMTK_ENABLE_PRIVATE_TAGS:BOOL=ON
+      -DDCMTK_COMPILE_WIN32_MULTITHREADED_DLL:BOOL=ON
     DEPENDS
       ${${proj}_DEPENDENCIES}
     )


Changed dcmtk download to tarball

Changed dcmtk download to tarball

--- CMakeExternals/DCMTK.cmake
+++ CMakeExternals/DCMTK.cmake
@@ -28,10 +28,8 @@

     ExternalProject_Add(${proj}
       LIST_SEPARATOR ${sep}
-      # specific version post-3.6.2 without the API change which breaks DCMQI
-      # 065a4b + 525490
-      GIT_REPOSITORY http://git.dcmtk.org/dcmtk.git
-      GIT_TAG 29f9de10c2e8576147f16475b156bba98d14ba7d
+      URL ${MITK_THIRDPARTY_DOWNLOAD_PREFIX_URL}/dcmtk_29f9de10.tar.gz
+      URL_MD5 c4b13ef2e694f3b8c50d7181fc959f4a
       CMAKE_GENERATOR ${gen}
       CMAKE_ARGS
          ${ep_common_args}


Increment version for devel to 3.3

Increment version for devel to 3.3

--- CMakeModules/Version.cmake
+++ CMakeModules/Version.cmake
@@ -2,7 +2,7 @@
 # Make a version file that includes the ArrayFire version and git revision
 #
 SET(AF_VERSION_MAJOR "3")
-SET(AF_VERSION_MINOR "2")
+SET(AF_VERSION_MINOR "3")
 SET(AF_VERSION_PATCH "0")

 SET(AF_VERSION "${AF_VERSION_MAJOR}.${AF_VERSION_MINOR}.${AF_VERSION_PATCH}")


Fix for comparing unset CMAKE_BUILD_TYPE in FindACE.cmake

--- CMakeScripts/FindACE.cmake
+++ CMakeScripts/FindACE.cmake
@@ -4,7 +4,7 @@
 SET(ACELIB_extension "")

 # TODO: Handle other 'debug-like' configurations here
-IF(${CMAKE_BUILD_TYPE} STREQUAL "Debug")
+IF("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
     SET(ACE_debug_lib TRUE)
 ENDIF()


Added back the -O2 flag and the -Wno-return-type flag

--- CommonCompilerConfig.cmake
+++ CommonCompilerConfig.cmake
@@ -159,9 +159,9 @@
 # try compiling without them.
 #
 if(NOT ${CMAKE_CXX_COMPILER_ID} STREQUAL "MSVC")
-  set(optimization_flags_cc "${optimization_flags_cc}")
+  set(optimization_flags_cc "${optimization_flags_cc} -O2")
   set(optimization_flags_cc "-pipe ${optimization_flags_cc}") #TODO use -Ofast instead of -O3
-  set(optimization_flags_lt "${optimization_flags_lt}")
+  set(optimization_flags_lt "-O2 ${optimization_flags_lt}")

   if(${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU" AND NOT MINGW)
     set(optimization_flags_cc "${optimization_flags_cc} -fuse-ld=gold")
@@ -198,7 +198,7 @@
   set(cxx_flags_unoptimized "${cxx_flags_unoptimized} ${stdlib_cxx} -std=c++11")

   set(shared_compile_flags "${shared_compile_flags} ${stdlib_common} -fdiagnostics-show-option")
-  set (internal_compiler_warning_flags "${internal_compiler_warning_flags} -Werror -Wextra -Wunused -Wno-unused-variable -Wno-unused-parameter -Wno-missing-field-initializers")
+  set (internal_compiler_warning_flags "${internal_compiler_warning_flags} -Werror -Wextra -Wreturn-type -Wunused -Wno-unused-variable -Wno-unused-parameter -Wno-missing-field-initializers")
   set (external_compiler_warning_flags "${external_compiler_warning_flags} -Wno-unused-variable -Wno-unused-parameter -Wno-incompatible-pointer-types -Wno-deprecated-declarations")

   if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Windows")


Allow python executable for tests to be specified

--- tests/python/PythonTests.cmake
+++ tests/python/PythonTests.cmake
@@ -10,11 +10,20 @@

   set(_one_value_args PYTHONPATH)
   cmake_parse_arguments(fn "" "${_one_value_args}" "" ${ARGN})
+
+  set(_python_executable "${PYTHON_EXECUTABLE}")
+
+  # Allow a different python environment to be used other than
+  # the one Tomviz was built with. For example one that has testing
+  # packages installed such as mock.
+  if(DEFINED ENV{TOMVIZ_TEST_PYTHON_EXECUTABLE})
+    set(_python_executable "$ENV{TOMVIZ_TEST_PYTHON_EXECUTABLE}")
+  endif()

   add_test(
     NAME ${name}
     WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
-    COMMAND "${PYTHON_EXECUTABLE}" -m unittest -v ${module}
+    COMMAND "${_python_executable}" -m unittest -v ${module}
   )
   set(_pythonpath "${tomviz_python_binary_dir}")
   set(_pythonpath "${_pythonpath}${_separator}${fn_PYTHONPATH}")


Fixed ROS versioning problem

Fixed ROS versioning problem

--- CMakeModules/FindROS.cmake
+++ CMakeModules/FindROS.cmake
@@ -26,22 +26,20 @@
   MESSAGE("ROS_VERSION not defined")
   FOREACH(version ${AVAILABLE_ROS_VERSIONS})
     IF(NOT ROS_FOUND)
-      FIND_PATH(ROS_H ros.h PATHS /opt/ros/${version}/include/ros NO_DEFAULT_PATH)
-      IF(ROS_H)
+      IF(EXISTS /opt/ros/${version}/include/ros/ros.h)
         MESSAGE(STATUS "Found ros version ${version}")
         SET(ROS_VERSION2 ${version})
         SET(ROS_FOUND 1)
-      ENDIF(ROS_H)
+      ENDIF(EXISTS /opt/ros/${version}/include/ros/ros.h)
     ENDIF(NOT ROS_FOUND)
   ENDFOREACH(version)
 ELSE(ROS_VERSION MATCHES "")
   MESSAGE("ROS_VERSION defined as " ${ROS_VERSION})
-  FIND_PATH(ROS_H ros.h PATHS /opt/ros/${ROS_VERSION}/include/ros NO_DEFAULT_PATH)
-  IF(ROS_H)
+  IF(EXISTS /opt/ros/${version}/include/ros/ros.h)
     MESSAGE("Found ros version ${ROS_VERSION}")
     SET(ROS_FOUND 1)
     SET(ROS_VERSION2 ${version})
-  ENDIF(ROS_H)
+  ENDIF(EXISTS /opt/ros/${version}/include/ros/ros.h)
 ENDIF(ROS_VERSION MATCHES "")

 IF(NOT ROS_FOUND)


Respect target system

Respect target system

--- CMake/Common.cmake
+++ CMake/Common.cmake
@@ -63,7 +63,7 @@
 	if (CI_BUILD)
 		set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG -march=x86-64")
 		set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O3 -DNDEBUG -march=x86-64")
-	elseif (APPLE AND CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "arm64")
+	elseif (APPLE AND CMAKE_SYSTEM_PROCESSOR STREQUAL "arm64")
 		set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG -mcpu=apple-m1")
 		set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O3 -DNDEBUG -mcpu=apple-m1")
 	else()


Add -fparse-all-comments to CMakeList.txt

--- CMake/common.cmake
+++ CMake/common.cmake
@@ -38,7 +38,7 @@
 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++1y -pedantic-errors -Wall -W -Werror -Wextra -O2 -fno-omit-frame-pointer -Woverloaded-virtual -Winvalid-pch")

 if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
-	set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-private-field")
+	set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-private-field -fparse-all-comments")
 endif()

 # Enable linking to custom Qt version and libCore from both main executable and plugins


Restore the software write watch feature

--- clrdefinitions.cmake
+++ clrdefinitions.cmake
@@ -169,6 +169,9 @@
   add_definitions(-DFEATURE_UNIX_AMD64_STRUCT_PASSING_ITF)
 endif (CLR_CMAKE_PLATFORM_UNIX_AMD64)
 add_definitions(-DFEATURE_USE_ASM_GC_WRITE_BARRIERS)
+if(CLR_CMAKE_PLATFORM_ARCH_AMD64 AND NOT WIN32)
+  add_definitions(-DFEATURE_USE_SOFTWARE_WRITE_WATCH_FOR_GC_HEAP)
+endif(CLR_CMAKE_PLATFORM_ARCH_AMD64 AND NOT WIN32)
 add_definitions(-DFEATURE_VERSIONING)
 if(WIN32)
     add_definitions(-DFEATURE_VERSIONING_LOG)


Adapt FindGLFW script to find headers/libraries/binaries from precompiled windows package

--- cmake/FindGLFW.cmake
+++ cmake/FindGLFW.cmake
@@ -26,7 +26,35 @@

     DOC "The directory where GLFW/glfw.h resides")

-find_library(GLFW_LIBRARY_RELEASE NAMES glfw3 glfw glfw3dll glfwdll
+
+set(GLFW_LIB_SUFFIX "")
+if(MSVC14)
+    set(GLFW_LIB_SUFFIX "vc2015")
+elseif(MSVS12)
+    set(GLFW_LIB_SUFFIX "vc2013")
+elseif(MSVC11)
+    set(GLFW_LIB_SUFFIX "vc2012")
+elseif(MSVC10)
+    set(GLFW_LIB_SUFFIX "vc2010")
+elseif(MINGW)
+    if(X64)
+        set(GLFW_LIB_SUFFIX "mingw-w64")
+    else()
+        set(GLFW_LIB_SUFFIX "mingw")
+    endif()
+endif()
+
+set(GLFW_NAMES glfw3 glfw)
+set(GLFW_DEBUG_NAMES glfw3d glfwd)
+if(WIN32)
+    option(GLFW_SHARED "Use shared GLFW library (DLL)" ON)
+    if(GLFW_SHARED)
+        set(GLFW_NAMES glfw3dll glfwdll)
+        set(GLFW_DEBUG_NAMES glfw3ddll glfwddll)
+    endif()
+endif()
+
+find_library(GLFW_LIBRARY_RELEASE NAMES ${GLFW_NAMES}

     HINTS
     ${GLFW_INCLUDE_DIR}/..
@@ -49,11 +77,12 @@
     PATH_SUFFIXES
     /lib
     /lib64
+    /lib-${GLFW_LIB_SUFFIX}
     /src # for from-source builds

     DOC "The GLFW library")

-find_library(GLFW_LIBRARY_DEBUG NAMES glfw3d glfwd glfw3ddll glfwddll
+find_library(GLFW_LIBRARY_DEBUG NAMES ${GLFW_DEBUG_NAMES}

     HINTS
     ${GLFW_INCLUDE_DIR}/..
@@ -91,7 +120,7 @@
     set(GLFW_LIBRARIES ${GLFW_LIBRARY_DEBUG})
 endif()

-if(WIN32)
+if(WIN32 AND GLFW_SHARED)

     find_file(GLFW_BINARY glfw3.dll

@@ -106,6 +135,7 @@
         PATH_SUFFIXES
         /lib
         /bin
+        /lib-${GLFW_LIB_SUFFIX}

         DOC "The GLFW binary")


Fix stupid debugging typo.

Fix stupid debugging typo.

--- cmake/FindPOPT.cmake
+++ cmake/FindPOPT.cmake
@@ -39,7 +39,7 @@
 # Check with PkgConfig (to retrieve static dependencies such as iconv)
 find_package(PkgConfig)
 if (PKG_CONFIG_FOUND)
-  pkg_search_module (POPT QUIET IMPORTED_TARGET poptd)
+  pkg_search_module (POPT QUIET IMPORTED_TARGET popt)
   if (POPT_FOUND)
     # PkgConfig found it, set cached vars to use the imported target it created.
     set(POPT_INCLUDE_DIR "" CACHE PATH "Path to headers for popt.")


apparently /std:c++17 is needed even if CMAKE_CXX_COMPILER is 17

--- cmake/compiler.cmake
+++ cmake/compiler.cmake
@@ -11,6 +11,7 @@
   set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP" )
   set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /bigobj" )
   set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4834" )
+  set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /std:c++17" )

   set( CMAKE_CXX_STANDARD 17 )
   set( CMAKE_CXX_STANDARD_REQUIRED ON )


erthink-cmake: fix `stdc++fs` linking for modern GCC/CLANG.

--- cmake/compiler.cmake
+++ cmake/compiler.cmake
@@ -771,16 +771,16 @@
 if(CMAKE_CXX_COMPILER_LOADED)
   # determine library for for std::filesystem
   set(LIBCXX_FILESYSTEM "")
-  if(CMAKE_COMPILER_IS_GNUCXX)
-    if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9.0)
-      set(LIBCXX_FILESYSTEM "stdc++fs")
-    endif()
-  elseif(CMAKE_COMPILER_IS_CLANG)
+  if(CMAKE_COMPILER_IS_CLANG)
     if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0)
       set(LIBCXX_FILESYSTEM "c++experimental")
-    else()
+    elseif(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9.0)
       set(LIBCXX_FILESYSTEM "stdc++fs")
     endif()
+  elseif(CMAKE_COMPILER_IS_GNUCXX)
+    if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.3 AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9.0)
+      set(LIBCXX_FILESYSTEM "stdc++fs")
+    endif()
   endif()
 endif()


Quote include paths for getarch to protect any embedded spaces

--- cmake/prebuild.cmake
+++ cmake/prebuild.cmake
@@ -492,7 +492,7 @@
   if (NOT "${CMAKE_SYSTEM_NAME}" STREQUAL "WindowsStore")
     try_compile(GETARCH_RESULT ${GETARCH_DIR}
       SOURCES ${GETARCH_SRC}
-    COMPILE_DEFINITIONS ${EXFLAGS} ${GETARCH_FLAGS} -I${GETARCH_DIR} -I"${PROJECT_SOURCE_DIR}" -I"${PROJECT_BINARY_DIR}"
+    COMPILE_DEFINITIONS ${EXFLAGS} ${GETARCH_FLAGS} -I"${GETARCH_DIR}" -I"${PROJECT_SOURCE_DIR}" -I"${PROJECT_BINARY_DIR}"
       OUTPUT_VARIABLE GETARCH_LOG
       COPY_FILE ${PROJECT_BINARY_DIR}/${GETARCH_BIN}
     )
@@ -520,7 +520,7 @@
   if (NOT "${CMAKE_SYSTEM_NAME}" STREQUAL "WindowsStore")
     try_compile(GETARCH2_RESULT ${GETARCH2_DIR}
       SOURCES ${PROJECT_SOURCE_DIR}/getarch_2nd.c
-    COMPILE_DEFINITIONS ${EXFLAGS} ${GETARCH_FLAGS} ${GETARCH2_FLAGS} -I${GETARCH2_DIR} -I"${PROJECT_SOURCE_DIR}" -I"${PROJECT_BINARY_DIR}"
+    COMPILE_DEFINITIONS ${EXFLAGS} ${GETARCH_FLAGS} ${GETARCH2_FLAGS} -I"${GETARCH2_DIR}" -I"${PROJECT_SOURCE_DIR}" -I"${PROJECT_BINARY_DIR}"
       OUTPUT_VARIABLE GETARCH2_LOG
       COPY_FILE ${PROJECT_BINARY_DIR}/${GETARCH2_BIN}
     )


set dir for continuous build

set dir for continuous build

git-svn-id: ed1ce8e5c168003d808aec37bc6fda77b178f7bb@3495 c330d7e9-fc0c-0410-a5b3-fd85c6f5aa8f

--- trunk/test/openVibeTests.cmake
+++ trunk/test/openVibeTests.cmake
@@ -56,9 +56,7 @@
 ENDIF(${CTEST_SCRIPT_ARG} MATCHES Continuous)

 IF(${MODEL} MATCHES Continuous)
-#	set(OV-ROOT-DIR              "${CMAKE_CURRENT_SOURCE_DIR}/con.ov")
-	set(OV-ROOT-DIR              "/tmp/con.ov")
-#	file(MAKE_DIRECTORY ${OV-ROOT-DIR})
+	set(OV-ROOT-DIR              "${CMAKE_CURRENT_SOURCE_DIR}")
 ELSE(${MODEL} MATCHES Continuous)
 	# create a temporary directory with very short name to host build
 	exec_program("mktemp" ARGS "--tmpdir -d ov.XXX" OUTPUT_VARIABLE OV-ROOT-DIR)


utils: replace NONE library with custom target

--- Engine/scripts/utils.cmake
+++ Engine/scripts/utils.cmake
@@ -115,10 +115,10 @@
 	file(GLOB_RECURSE projectFiles ${PROJECT_DIRECTORY}/resources/*)

 	message(STATUS "Adding target: GeneralProject")
-	add_library(GeneralProject ${projectFiles})
-	set_target_properties(GeneralProject PROPERTIES LINKER_LANGUAGE NONE) # we don't build this library
-	assign_source_group(${projectFiles})
-	assignIdeFolder(GeneralProject Project/General)
+	add_custom_target(GeneralProject ${projectFiles})
+	#set_target_properties(GeneralProject PROPERTIES LINKER_LANGUAGE NONE) # we don't build this library
+	#assign_source_group(${projectFiles})
+	#assignIdeFolder(GeneralProject Project/General)

 endfunction(createProjectGeneral)


Fixed handling of multi-part conditional variables

--- cmake-modules/ConditionalSources.cmake
+++ cmake-modules/ConditionalSources.cmake
@@ -38,6 +38,8 @@

   source_group(${conditional_sources_GROUP_NAME} FILES ${conditional_sources_FILES})

+  separate_arguments(condition_var)
+  verbose_message("Evaluating conditional as: ${condition_var}")
   if(NOT (${condition_var}))
     set_source_files_properties( ${conditional_sources_FILES} PROPERTIES HEADER_FILE_ONLY TRUE)
     verbose_message("Setting INACTIVE source group \"${conditional_sources_GROUP_NAME}\" with files ${conditional_sources_FILES}")


Performance Tests: Let the shell evaluate the arguments first.

--- cmake/Modules/MacroAddBoostTestExecutable.cmake
+++ cmake/Modules/MacroAddBoostTestExecutable.cmake
@@ -81,10 +81,6 @@

   add_test(
     ${TEST_NAME}_performance
-    ./plot_speedup.rb
-    -s ${PERFORMANCE_TEST_SERVER_LIST}
-    -c ${TEST_NAME}_performance
-    -p ${${TEST_NAME}_MAX_PROCESSES}
-    ${__SAME_SERVERS_FLAG}
+    sh -c "./plot_speedup.rb -s ${PERFORMANCE_TEST_SERVER_LIST} -c ${TEST_NAME}_performance -p ${${TEST_NAME}_MAX_PROCESSES} ${__SAME_SERVERS_FLAG}"
   )
 endmacro(add_performance_test_executable)


CMake: Remove test DEAL_II_HAVE_CXX11_ICCBOOSTSIGNALSBUG_OK

We cannot sanely test for this regression prior to boost setup. And after
boost setup it is incredibly ugly to do so because DEAL_II_WITH_STDCXX11 is
already processed.

--- cmake/checks/check_01_cxx_features.cmake
+++ cmake/checks/check_01_cxx_features.cmake
@@ -213,50 +213,6 @@
     DEAL_II_HAVE_CXX11_ICCLIBSTDCPP47CXX11BUG_OK)

-  #
-  # icc does not play nicely with boost::signals2 and -std=c++11.
-  # Disable C++11 support in this case.
-  #
-  # [1] https://software.intel.com/en-us/forums/topic/515966
-  #
-  # - Matthias Maier, 2014
-  #
-
-  #
-  # Use bundled boost headers for this regression test because external
-  # features (such as boost) are not yet configured at this point. If we
-  # have no bundled directory available, skip the test.
-  #
-  IF(DEAL_II_HAVE_BUNDLED_DIRECTORY)
-    CHECK_CXX_SOURCE_COMPILES(
-      "
-      #include <${BOOST_FOLDER}/include/boost/signals2/signal.hpp>
-      using namespace boost::signals2;
-
-      class Order {};
-
-      class Foo
-      {
-       signal<void(Order*)> beforeOrder;
-       void test(Order* o)
-       {
-        beforeOrder(o);
-       }
-      };
-
-      int main()
-      {
-       Order o;
-       Foo foo;
-       return 0;
-      }
-      "
-      DEAL_II_HAVE_CXX11_ICCBOOSTSIGNALSBUG_OK)
-  ELSE()
-    SET(DEAL_II_HAVE_CXX11_ICCBOOSTSIGNALSBUG_OK TRUE)
-  ENDIF()
-
-
   IF( DEAL_II_HAVE_CXX11_ARRAY AND
       DEAL_II_HAVE_CXX11_CONDITION_VARIABLE AND
       DEAL_II_HAVE_CXX11_FUNCTIONAL AND
@@ -268,8 +224,7 @@
       DEAL_II_HAVE_CXX11_TYPE_TRAITS AND
       DEAL_II_HAVE_CXX11_MACOSXC99BUG_OK AND
       DEAL_II_HAVE_CXX11_ICCNUMERICLIMITSBUG_OK AND
-      DEAL_II_HAVE_CXX11_ICCLIBSTDCPP47CXX11BUG_OK AND
-      DEAL_II_HAVE_CXX11_ICCBOOSTSIGNALSBUG_OK)
+      DEAL_II_HAVE_CXX11_ICCLIBSTDCPP47CXX11BUG_OK )
       SET(DEAL_II_HAVE_CXX11 TRUE)
   ENDIF()


Split off 7.6.10

Split off 7.6.10

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

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


Split off 7.12.2

Split off 7.12.2

Signed-off-by: Gavin Halliday <2edfa8aca9fb78974188e5b35be8b52d4e4967ae@lexisnexis.com>

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


Split off 8.6.28

Split off 8.6.28

Signed-off-by: Gavin Halliday <2edfa8aca9fb78974188e5b35be8b52d4e4967ae@lexisnexis.com>

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


Nagios Monitoring 5.0.0-rc3 Release Candidate 3

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

--- version.cmake
+++ version.cmake
@@ -5,5 +5,5 @@
 set ( HPCC_NM_MINOR 0 )
 set ( HPCC_NM_POINT 0 )
 set ( HPCC_NM_MATURITY "rc" )
-set ( HPCC_NM_SEQUENCE 1 )
+set ( HPCC_NM_SEQUENCE 3 )
 ###


Split off 7.12.78

Split off 7.12.78

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

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


Split off 7.12.48

Split off 7.12.48

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

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


Split off 8.6.4

Split off 8.6.4

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

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


Split off 8.2.64

Split off 8.2.64

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

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


fixed version tag globbing to include release candidates

--- version.cmake
+++ version.cmake
@@ -22,7 +22,7 @@
 find_package(Git)
 if(GIT_FOUND)
 	execute_process(
-		COMMAND git describe --long --match "[0-9]*\\.[0-9]*\\.[0-9]" --dirty
+		COMMAND git describe --long --match "[0-9]*\\.[0-9]*\\.[0-9]*" --dirty
 		WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
 		OUTPUT_VARIABLE GIT_DESCRIBE
 		OUTPUT_STRIP_TRAILING_WHITESPACE


editor pdbs for develop

editor pdbs for develop

--- Engine/scripts/utils.cmake
+++ Engine/scripts/utils.cmake
@@ -628,7 +628,7 @@
 		set(binDir "${baseBinDir}/${configType}_${_p}/${TARGET}/bin")

 		set(_vcCfg "")
-		if(("${configType}" STREQUAL "Debug") OR ("${configType}" STREQUAL "DebugEditor"))
+		if(("${configType}" STREQUAL "Debug") OR ("${configType}" STREQUAL "Develop"))
 			set(_vcCfg "/debug")

 			# for debug applications we also copy pdbs


Fix include

Fix include

--- tests/FindLua.cmake
+++ tests/FindLua.cmake
@@ -161,7 +161,7 @@
     unset(lua_version_strings)
 endif()

-include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+include(FindPackageHandleStandardArgs)
 # handle the QUIETLY and REQUIRED arguments and set LUA_FOUND to TRUE if
 # all listed variables are TRUE
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(Lua


adress #504 - typo leading to broken $origin reference

--- Tools/CMake/torque3d.cmake
+++ Tools/CMake/torque3d.cmake
@@ -33,8 +33,8 @@
 	set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CXX_FLAG32} -Wundef -msse -pipe -Wfatal-errors -Wno-return-type-c-linkage -Wno-unused-local-typedef ${TORQUE_ADDITIONAL_LINKER_FLAGS}")
     else()
     # default compiler flags
-	set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CXX_FLAG32} -Wundef -msse -pipe -Wfatal-errors -no-pie ${TORQUE_ADDITIONAL_LINKER_FLAGS} -Wl,-rpath,'$$ORIGIN'")
-	set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CXX_FLAG32} -Wundef -msse -pipe -Wfatal-errors ${TORQUE_ADDITIONAL_LINKER_FLAGS} -Wl,-rpath,'$$ORIGIN'")
+	set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CXX_FLAG32} -Wundef -msse -pipe -Wfatal-errors -no-pie ${TORQUE_ADDITIONAL_LINKER_FLAGS} -Wl,-rpath,'$ORIGIN'")
+	set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CXX_FLAG32} -Wundef -msse -pipe -Wfatal-errors ${TORQUE_ADDITIONAL_LINKER_FLAGS} -Wl,-rpath,'$ORIGIN'")

    endif()


DOC: copyright

DOC: copyright

--- Modules/Filtering/Mosaic/otb-module.cmake
+++ Modules/Filtering/Mosaic/otb-module.cmake
@@ -1,7 +1,7 @@
 #
 # Copyright (C) 2005-2019 Centre National d'Etudes Spatiales (CNES)
-# Copyright (C) 2016-2019 Institut de Recherche Scientifique et
-#  Technique pour l'Environnement et l'Agriculture (IRSTEA)
+# Copyright (C) 2019 Institut national de Recherche en Sciences
+#  et Technologies pour l'Environnement et l'Agriculture (IRSTEA)
 #
 # This file is part of Orfeo Toolbox
 #


made test inconclusive as long as it is not finished

--- tests/cmake_module_test.cmake
+++ tests/cmake_module_test.cmake
@@ -1,4 +1,5 @@
 function(test)
+  message("Test Inconclusive")
   return()
   # {
   #   name:<string>,


Use CMAKE_INSTALL_FULL_{LIBDIR,INCLUDEDIR}. (#963)

--- CMake/AbseilHelpers.cmake
+++ CMake/AbseilHelpers.cmake
@@ -171,8 +171,8 @@
       FILE(GENERATE OUTPUT "${CMAKE_BINARY_DIR}/lib/pkgconfig/absl_${_NAME}.pc" CONTENT "\
 prefix=${CMAKE_INSTALL_PREFIX}\n\
 exec_prefix=\${prefix}\n\
-libdir=\${prefix}/${CMAKE_INSTALL_LIBDIR}\n\
-includedir=\${prefix}/${CMAKE_INSTALL_INCLUDEDIR}\n\
+libdir=${CMAKE_INSTALL_FULL_LIBDIR}\n\
+includedir=${CMAKE_INSTALL_FULL_INCLUDEDIR}\n\
 \n\
 Name: absl_${_NAME}\n\
 Description: Abseil ${_NAME} library\n\


ENH: GDAL can use local expat and libKML

--- CMake/External_GDAL.cmake
+++ CMake/External_GDAL.cmake
@@ -69,6 +69,24 @@
     list(APPEND ${proj}_DEPENDENCIES ZLIB)
   endif()

+  if(USE_SYSTEM_EXPAT)
+    set(GDAL_SB_EXPAT_CONFIG)
+  else()
+    set(GDAL_SB_EXPAT_CONFIG
+      --with-expat=${CMAKE_INSTALL_PREFIX}
+      )
+    list(APPEND ${proj}_DEPENDENCIES EXPAT)
+  endif()
+
+  if(USE_SYSTEM_LIBKML)
+    set(GDAL_SB_LIBKML_CONFIG)
+  else()
+    set(GDAL_SB_LIBKML_CONFIG
+      --with-libkml=${CMAKE_INSTALL_PREFIX}
+      )
+    list(APPEND ${proj}_DEPENDENCIES LIBKML)
+  endif()
+
   if(WIN32)
     # TODO : use nmake
   else()
@@ -93,6 +111,8 @@
         ${GDAL_SB_OPENJPEG_CONFIG}
         ${GDAL_SB_SQLITE_CONFIG}
         ${GDAL_SB_GEOS_CONFIG}
+        ${GDAL_SB_EXPAT_CONFIG}
+        ${GDAL_SB_LIBKML_CONFIG}
       BUILD_COMMAND $(MAKE)
       INSTALL_COMMAND $(MAKE) install
       DEPENDS ${${proj}_DEPENDENCIES}


removed the unrecognized library

removed the unrecognized library

--- CMake/GOMCCUDASetup.cmake
+++ CMake/GOMCCUDASetup.cmake
@@ -21,8 +21,8 @@
    set(CMAKE_CUDA_STANDARD_REQUIRED true)
 endif()

-find_package(CUDALibs)
 include_directories(${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES})
+message(${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES})

 #####################################
 if(ENSEMBLE_GPU_NVT)


Remove redundancy.

Remove redundancy.

--- CPM.cmake
+++ CPM.cmake
@@ -809,17 +809,14 @@
     set(CPM_KV_SOURCE_ADDED_MAP_${__CPM_FULL_UNID} ${CPM_LAST_MODULE_NAME} PARENT_SCOPE)
     set(CPM_KV_LIST_SOURCE_ADDED_MAP ${CPM_KV_LIST_SOURCE_ADDED_MAP} "CPM_KV_SOURCE_ADDED_MAP_${__CPM_FULL_UNID}" PARENT_SCOPE)

-    # Append target to pre-existing libraries.
-    set(CPM_LIBRARIES ${CPM_LIBRARIES} "${CPM_TARGET_NAME}" PARENT_SCOPE)
-    set(CPM_INCLUDE_DIRS ${CPM_INCLUDE_DIRS} "${__CPM_MODULE_SOURCE_DIR}" PARENT_SCOPE)
-
   else()
     _cpm_check_and_add_preproc(${name} ${CPM_KV_SOURCE_ADDED_MAP_${__CPM_FULL_UNID}} ${__CPM_FULL_UNID})
-
-    # Be sure to set appropriate library and include directory.
-    set(CPM_LIBRARIES ${CPM_LIBRARIES} "${CPM_TARGET_NAME}" PARENT_SCOPE)
-    set(CPM_INCLUDE_DIRS ${CPM_INCLUDE_DIRS} "${__CPM_MODULE_SOURCE_DIR}" PARENT_SCOPE)
-  endif()
+  endif()
+
+  # Append target to pre-existing libraries.
+  set(CPM_LIBRARIES ${CPM_LIBRARIES} "${CPM_TARGET_NAME}" PARENT_SCOPE)
+  set(CPM_INCLUDE_DIRS ${CPM_INCLUDE_DIRS} "${__CPM_MODULE_SOURCE_DIR}" PARENT_SCOPE)
+

   # Set the appropriate preprocessor definition for this module and populate
   # our namespace header file.


Fix CGAL config script being non-relocatable

--- deps/CGAL/CGAL.cmake
+++ deps/CGAL/CGAL.cmake
@@ -6,4 +6,10 @@
     # URL      https://github.com/CGAL/cgal/archive/releases/CGAL-5.0.zip
     # URL_HASH SHA256=bd9327be903ab7ee379a8a7a0609eba0962f5078d2497cf8e13e8e1598584154
     DEPENDS dep_boost dep_GMP dep_MPFR
+)
+
+ExternalProject_Add_Step(dep_CGAL dep_CGAL_relocation_fix
+    DEPENDEES install
+    COMMAND ${CMAKE_COMMAND} -E remove CGALConfig-installation-dirs.cmake
+    WORKING_DIRECTORY "${DESTDIR}/usr/local/lib/cmake/CGAL"
 )


Fixed bug introduced in 4d2c42d5600f7a9550c1a906e691ede1a0219476

--- CMake/InstallDependencies.cmake
+++ CMake/InstallDependencies.cmake
@@ -242,27 +242,27 @@
   if (WIN32)
     # copy the required DLLs to the build directory (configure_file is the only copy-like op I found in CMake)
     if(NOT OGRE_BUILD_PLATFORM_WINRT)
-      install(FILES ${OIS_BINARY_DBG} DESTINATION lib/debug CONFIGURATIONS Debug None "")
-    	install(FILES ${OIS_BINARY_REL} DESTINATION lib/release CONFIGURATIONS Release None "")
-    	install(FILES ${OIS_BINARY_REL} DESTINATION lib/relwithdebinfo CONFIGURATIONS RelWithDebInfo)
-    	install(FILES ${OIS_BINARY_REL} DESTINATION lib/minsizerel CONFIGURATIONS MinSizeRel)
+      file(COPY ${OIS_BINARY_DBG} DESTINATION ${OGRE_BINARY_DIR}/bin/debug)
+    	file(COPY ${OIS_BINARY_REL} DESTINATION ${OGRE_BINARY_DIR}/bin/release)
+    	file(COPY ${OIS_BINARY_REL} DESTINATION ${OGRE_BINARY_DIR}/bin/relwithdebinfo)
+    	file(COPY ${OIS_BINARY_REL} DESTINATION ${OGRE_BINARY_DIR}/bin/minsizerel)
     endif ()

     if (OGRE_BUILD_PLUGIN_CG)
       # if MinGW or NMake, the release/debug cg.dll's would conflict, so just pick one
       if (MINGW OR (CMAKE_GENERATOR STREQUAL "NMake Makefiles"))
         if (CMAKE_BUILD_TYPE STREQUAL "Debug")
-          install(FILES ${Cg_BINARY_DBG} DESTINATION bin/debug CONFIGURATIONS Debug None "")
+          file(COPY ${Cg_BINARY_DBG} DESTINATION ${OGRE_BINARY_DIR}/bin/debug)
         else ()
-          install(FILES ${Cg_BINARY_REL} DESTINATION bin/release CONFIGURATIONS Release None "")
-    			install(FILES ${Cg_BINARY_REL} DESTINATION bin/relwithdebinfo CONFIGURATIONS RelWithDebInfo)
-    			install(FILES ${Cg_BINARY_REL} DESTINATION bin/minsizerel CONFIGURATIONS MinSizeRel)
+          file(COPY ${Cg_BINARY_REL} DESTINATION ${OGRE_BINARY_DIR}/bin/release)
+    			file(COPY ${Cg_BINARY_REL} DESTINATION ${OGRE_BINARY_DIR}/bin/relwithdebinfo)
+    			file(COPY ${Cg_BINARY_REL} DESTINATION ${OGRE_BINARY_DIR}/bin/minsizerel)
         endif ()
       else ()
-        install(FILES ${Cg_BINARY_DBG} DESTINATION bin/debug CONFIGURATIONS Debug None "")
-    		install(FILES ${Cg_BINARY_REL} DESTINATION bin/release CONFIGURATIONS Release None "")
-    		install(FILES ${Cg_BINARY_REL} DESTINATION bin/relwithdebinfo CONFIGURATIONS RelWithDebInfo)
-    		install(FILES ${Cg_BINARY_REL} DESTINATION bin/minsizerel CONFIGURATIONS MinSizeRel)
+        file(COPY ${Cg_BINARY_DBG} DESTINATION ${OGRE_BINARY_DIR}/bin/debug)
+    		file(COPY ${Cg_BINARY_REL} DESTINATION ${OGRE_BINARY_DIR}/bin/release)
+    		file(COPY ${Cg_BINARY_REL} DESTINATION ${OGRE_BINARY_DIR}/bin/relwithdebinfo)
+    		file(COPY ${Cg_BINARY_REL} DESTINATION ${OGRE_BINARY_DIR}/bin/minsizerel)
       endif ()
     endif()


Support for customizing the output dir for plug-ins.

--- CMake/ctkMacroBuildPlugin.cmake
+++ CMake/ctkMacroBuildPlugin.cmake
@@ -235,10 +235,16 @@
     )

   # Set the output directory for the plugin
-  SET(output_dir_suffix "plugins")
+  IF(MY_OUTPUT_DIR)
+    SET(output_dir_suffix ${MY_OUTPUT_DIR})
+  ELSE()
+    SET(output_dir_suffix "plugins")
+  ENDIF()
+
   IF(MY_TEST_PLUGIN)
-    SET(output_dir_suffix "test_plugins")
-  ENDIF()
+    SET(output_dir_suffix "test_${output_dir_suffix}")
+  ENDIF()
+
   IF(CMAKE_RUNTIME_OUTPUT_DIRECTORY)
     SET(runtime_output_dir "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${output_dir_suffix}")
   ELSE()


Improved OpenMPI CUDA detection

Improved OpenMPI CUDA detection

--- CMake/hoomd/HOOMDMPISetup.cmake
+++ CMake/hoomd/HOOMDMPISetup.cmake
@@ -24,25 +24,19 @@
                 endif()
             endif()
         elseif(MPI_LIBRARY MATCHES libmpi)
-            # find out if this OpenMPI
-            if (MPI_INCLUDE_PATH)
-               foreach(_dir ${MPI_INCLUDE_PATH})
-                   if (EXISTS ${_dir}/openmpi/opal_config.h)
-                       file( STRINGS ${_dir}/openmpi/opal_config.h
-                             _ompi_cuda_support
-                             REGEX "#define OMPI_CUDA_SUPPORT[ \t]+([0-9x]+)$"
-                           )
-                       if (_ompi_cuda_support)
-                           string( REGEX REPLACE
-                               "#define OMPI_CUDA_SUPPORT[ \t]+"
-                               "" _ompi_cuda_support ${_ompi_cuda_support} )
-                           if (_ompi_cuda_support MATCHES 1)
-                               message(STATUS "Found OpenMPI with CUDA support.")
-                               set(MPI_CUDA TRUE)
-                           endif()
-                       endif()
-                    endif()
-               endforeach()
+            # find out if this is OpenMPI
+            get_filename_component(_mpi_library_dir ${MPI_LIBRARY} PATH)
+            find_program(OMPI_INFO
+                NAMES ompi_info
+                HINTS ${_mpi_library_dir} ${_mpi_library_dir}/../bin
+            )
+            if (OMPI_INFO)
+                execute_process(COMMAND ${OMPI_INFO}
+                                OUTPUT_VARIABLE _output)
+                if (_output MATCHES "smcuda")
+                    set(MPI_CUDA TRUE)
+                    message(STATUS "Found OpenMPI with CUDA support.")
+                endif()
             endif()
         endif()


adding quotes to python version miss-match warning message

Change-Id: I630a6a08c82493a400ac43354b6cd8c5f4bf8375

--- CMake/sitkLanguageOptions.cmake
+++ CMake/sitkLanguageOptions.cmake
@@ -35,7 +35,7 @@
 find_package ( PythonLibs ${PYTHON_VERSION_STRING} EXACT ${_QUIET} )

 if (PYTHON_VERSION_STRING VERSION_LESS 2.6)
-  message( WARNING "Python version less that 2.6. " ${PYTHON_VERSION_STRING} )
+  message( WARNING "Python version less that 2.6: \"${PYTHON_VERSION_STRING}\"." )
 endif()

 if ( PYTHONLIBS_FOUND AND PYTHONINTERP_FOUND


CMake: Fix default option values not being taken into account.

--- CMake/Modules/UrhoOptions.cmake
+++ CMake/Modules/UrhoOptions.cmake
@@ -85,14 +85,16 @@
     set (URHO3D_${FEATURE} ON CACHE BOOL "" FORCE)
 endforeach()

-macro (_option NAME DESCRIPTION)
-    if (NOT ${NAME}_DEFAULT)
-        set (${NAME}_DEFAULT ${URHO3D_ENABLE_ALL})
-    endif ()
-    if (NOT DEFINED ${NAME})
-        option(${NAME} "${DESCRIPTION}" ${${NAME}_DEFAULT})
-    endif ()
-endmacro ()
+function (_option NAME DESCRIPTION)
+    if (NOT DEFINED ${NAME}_DEFAULT)
+        if ("${ARGN}" MATCHES "^$")
+            set (${NAME}_DEFAULT ${URHO3D_ENABLE_ALL})
+        else ()
+            set (${NAME}_DEFAULT ${ARGN})
+        endif ()
+    endif ()
+    option(${NAME} "${DESCRIPTION}" ${${NAME}_DEFAULT})
+endfunction ()

 # Enable by default for developers preset
 if (URHO3D_DEVELOPER)


work around missing cerealConfig.cmake on Summit

--- CMake/hoomd/HOOMDMPISetup.cmake
+++ CMake/hoomd/HOOMDMPISetup.cmake
@@ -9,8 +9,13 @@
     if (cereal_FOUND)
         find_package_message(cereal "Found cereal: ${cereal_DIR}" "[${cereal_DIR}]")
     else()
+        # work around missing ceralConfig.cmake
+
+        find_path(cereal_INCLUDE_DIR NAMES cereal/cereal.hpp
+            PATHS ${CMAKE_INSTALL_PREFIX}/include)
         add_library(cereal INTERFACE IMPORTED)
-        find_package_message(cereal "Could not find cereal, assuming it is on a default path" "[${cereal_DIR}]")
+        target_include_directories(cereal INTERFACE ${cereal_INCLUDE_DIR})
+        find_package_message(cereal "Could not find cereal, assuming it is on a default path" "[${cereal_INCLUDE_DIR}]")
     endif()

     mark_as_advanced(MPI_EXTRA_LIBRARY)


Fixed path to support/iOS.cmake

Fixed path to support/iOS.cmake

--- Googlify.cmake
+++ Googlify.cmake
@@ -16,7 +16,7 @@
   set(IOS_PLATFORM "SIMULATOR")
 endif ()
 if (${IOS_BUILD} OR ${IOS_SIMULATOR_BUILD})
-  include(support/iOS.cmake)
+  include(${CMAKE_CURRENT_LIST_DIR}/support/iOS.cmake)
 else ()
   option(BUILD_SHARED_LIBS "Build shared libraries" ON)
 endif ()


flags/fpic: prepare for Android

flags/fpic: prepare for Android

--- flags/fpic.cmake
+++ flags/fpic.cmake
@@ -9,5 +9,13 @@

 include(polly_add_cache_flag)

-polly_add_cache_flag(CMAKE_CXX_FLAGS "-fPIC")
-polly_add_cache_flag(CMAKE_C_FLAGS "-fPIC")
+string(COMPARE EQUAL "${ANDROID_NDK_VERSION}" "" _not_android)
+
+# TODO: test other platfroms, CMAKE_CXX_FLAGS_INIT should work for all
+if(_not_android)
+  polly_add_cache_flag(CMAKE_CXX_FLAGS "-fPIC")
+  polly_add_cache_flag(CMAKE_C_FLAGS "-fPIC")
+else()
+  polly_add_cache_flag(CMAKE_CXX_FLAGS_INIT "-fPIC")
+  polly_add_cache_flag(CMAKE_C_FLAGS_INIT "-fPIC")
+endif()


ManageEnvironment: fixed compile env.

ManageEnvironment: fixed compile env.

--- Modules/ManageEnvironment.cmake
+++ Modules/ManageEnvironment.cmake
@@ -111,7 +111,7 @@
 	SET(${var} "${${var}}" ${_setOpts})
     ELSEIF(NOT "$ENV{${_env}}" STREQUAL "")
 	SET(${var} "$ENV{${_env}}" ${_setOpts})
-    ELSEIF()
+    ELSE()
 	## Use default value
 	SET(${var} "${_defaultValue}" ${_setOpts})
     ENDIF()
@@ -121,7 +121,7 @@
     CMAKE_POLICY(SET CMP0005 NEW)
     ADD_DEFINITIONS(-D${_env}=${${var}})
     CMAKE_POLICY(POP)
-    M_MSG(${M_INFO2} "SET(${var} ${${var}})")
+    M_MSG(${M_INFO2} "SET_COMPILE_ENV: ${var}=${${var}}")
 ENDFUNCTION(SET_COMPILE_ENV)

 MACRO(MANAGE_CMAKE_POLICY policyName defaultValue)
@@ -156,24 +156,35 @@

 ## Set variables and compile flags
 SET_COMPILE_ENV(BIN_DIR  "${CMAKE_INSTALL_PREFIX}/bin"
-    CACHE PATH "Binary dir")
+    CACHE PATH "Binary dir"
+    )
 SET_COMPILE_ENV(DATA_DIR "${CMAKE_INSTALL_PREFIX}/share"
-    CACHE PATH "Data dir")
+    CACHE PATH "Data dir"
+    )
 SET_COMPILE_ENV(DOC_DIR  "${DATA_DIR}/doc"
-    CACHE PATH "Documentation dir")
+    CACHE PATH "Documentation dir"
+    )
 SET_COMPILE_ENV(SYSCONF_DIR "/etc"
-    CACHE PATH "System configuration dir")
+    CACHE PATH "System configuration dir"
+    )
 SET_COMPILE_ENV(LIBEXEC_DIR "${CMAKE_INSTALL_PREFIX}/libexec"
-    CACHE PATH "LIBEXEC dir")
+    CACHE PATH "LIBEXEC dir"
+    )

 IF(CMAKE_SYSTEM_PROCESSOR MATCHES "64")
     SET_COMPILE_ENV(IS_64 "64" CACHE STRING "IS_64")
 ENDIF(CMAKE_SYSTEM_PROCESSOR MATCHES "64")

 SET_COMPILE_ENV(LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib${IS_64}"
-    CACHE PATH "Library dir")
-
+    CACHE PATH "Library dir"
+    )
+SET_COMPILE_ENV(PRJ_DATA_DIR "${DATA_DIR}/${PROJECT_NAME}"
+    CACHE PATH "Project data dir"
+    )
+SET_COMPILE_ENV(PRJ_DOC_DIR "${DOC_DIR}/${PROJECT_NAME}"
+    CACHE PATH "Project doc dir"
+    )
+
 SET_COMPILE_ENV(PROJECT_NAME)
-SET_COMPILE_ENV(PRJ_DATA_DIR "${DATA_DIR}/${PROJECT_NAME}")
-SET_COMPILE_ENV(PRJ_DOC_DIR "${DOC_DIR}/${PROJECT_NAME}")

+


MANAGE_CMAKE_POLICY: fixed

MANAGE_CMAKE_POLICY: fixed

--- Modules/ManageEnvironment.cmake
+++ Modules/ManageEnvironment.cmake
@@ -128,7 +128,7 @@
 	    CMAKE_POLICY(GET "${policyName}" _cmake_policy_value)
 	    IF(_cmake_policy_value STREQUAL "")
 		# Policy not defined yet
-		#CMAKE_POLICY(SET "${policyName}" "${defaultValue}")
+		CMAKE_POLICY(SET "${policyName}" "${defaultValue}")
 	    ENDIF(_cmake_policy_value STREQUAL "")
 	ENDIF(POLICY ${policyName})
     ENDMACRO(MANAGE_CMAKE_POLICY policyName defaultValue)


Add FreeRTOS config directory to include dirs (#548)

This allows the application write to set FREERTOS_CONFIG_FILE_DIRECTORY
to whichever directory the FreeRTOSConfig.h file exists in.

This was reported here - https://github.com/FreeRTOS/FreeRTOS-Kernel/issues/545

Signed-off-by: Gaurav Aggarwal <d1bf49c91a2534b91ae70bd4037813434c35a59c@amazon.com>

--- portable/ThirdParty/GCC/RP2040/library.cmake
+++ portable/ThirdParty/GCC/RP2040/library.cmake
@@ -27,7 +27,8 @@
 )

 target_include_directories(FreeRTOS-Kernel INTERFACE
-        ${CMAKE_CURRENT_LIST_DIR}/include)
+        ${CMAKE_CURRENT_LIST_DIR}/include
+        ${FREERTOS_CONFIG_FILE_DIRECTORY})

 target_link_libraries(FreeRTOS-Kernel INTERFACE
         FreeRTOS-Kernel-Core


Testsuite: add configurable executables to DEAL_II_ADD_TEST

This commit adds a second type of tests to the testsuite that consists of a
parameter file "test.prm" with an output file "test.<...>.output". It
assumes that a cmake variable

  TEST_TARGET (or TEST_TARGET_DEBUG and TEST_TARGET_RELEASE)

is defined and will invoke said target with the full path to the parameter
file. (The first type of tests consist of a source file "test.cc" instead,
that is compiled and linked.)

--- cmake/macros/macro_deal_ii_add_test.cmake
+++ cmake/macros/macro_deal_ii_add_test.cmake
@@ -16,10 +16,27 @@
 #
 # A Macro to set up tests for the testsuite
 #
-# This macro assumes that a source file "${test_name}.cc" as well as the
-# comparison file "${comparison_file}" is available in the testsuite. The
-# output of the compiled source file is compared against the file
-# comparison file.
+#
+# The testsuite distinguishes two different kinds of tests:
+#
+# - A combination of a source file "${test_name}.cc" (containing a main
+#   function) with a file "${comparison_file}" defines an executable that
+#   is compiled and linked against deal.II. Its output is compared with the
+#   comparison file. Additional libraries (like a library from a user
+#   project with code to test) the target should be linked against can be
+#   specified by
+#
+#     TEST_LIBRARIES
+#     TEST_LIBRARIES_DEBUG
+#     TEST_LIBRARIES_RELEASE
+#
+# - A combination of a parameter file "${test_name}.prm" with a file
+#   "${comparison_file}" describes the configuration of an already compiled
+#   executable that should just be run with its output being compared with
+#   the file "${comparison_file}". The executable is defined by
+#
+#     TEST_TARGET or
+#     TEST_TARGET_DEBUG and TEST_TARGET_RELEASE
 #
 # For every deal.II build type (given by the variable DEAL_II_BUILD_TYPES)
 # that is a (case insensitive) substring of CMAKE_BUILD_TYPE a test is
@@ -40,13 +57,6 @@
 #   TEST_TIME_LIMIT
 #     - specifying the maximal wall clock time in seconds a test is allowed
 #       to run
-#
-# The following variables may be set:
-#
-#   TEST_LIBRARIES
-#   TEST_LIBRARIES_DEBUG
-#   TEST_LIBRARIES_RELEASE
-#     - specifying additional libraries (and targets) to link against.
 #
 # Usage:
 #     DEAL_II_ADD_TEST(category test_name comparison_file)
@@ -128,39 +138,66 @@
     ITEM_MATCHES(_match "${_build}" ${_configuration})
     IF(_match OR "${_configuration}" STREQUAL "")

+      STRING(TOLOWER ${_build} _build_lowercase)
+
+      #
+      # Select a suitable target:
+      #
+      IF(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${_test_name}.cc")
+
+        SET(_target ${_test_name}.${_build_lowercase}) # target name
+        SET(_run_command "$<TARGET_FILE:${_target}>") # the command to issue
+
+      ELSEIF(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${_test_name}.prm")
+
+        IF(NOT "${TEST_TARGET_${_build}}" STREQUAL "")
+          SET(_target ${TEST_TARGET_${_build}})
+        ELSEIF(NOT "${TEST_TARGET}" STREQUAL "")
+          SET(_target ${TEST_TARGET})
+        ELSE()
+          MESSAGE(FATAL_ERROR
+            "\nFor ${_comparison_file}: \"${_test_name}.prm\" provided, but "
+            "neither \"\${TEST_TARGET}\", nor \"\${TEST_TARGET_${_build}}"
+            "\" is defined.\n\n"
+            )
+        ENDIF()
+        SET(_run_command "$<TARGET_FILE:${_target}> ${CMAKE_CURRENT_SOURCE_DIR}/${_test_name}.prm")
+
+      ELSE()
+        MESSAGE(FATAL_ERROR
+          "\nFor ${_comparison_file}: Neither \"${_test_name}.cc\", "
+          "nor \"${_test_name}.prm\" could be found!\n\n"
+          )
+      ENDIF()
+
       #
       # Set up a bunch of variables describing this particular test:
       #
-      STRING(TOLOWER ${_build} _build_lowercase)
-      SET(_target ${_test_name}.${_build_lowercase}) # target name

       # If _n_cpu is equal to "0", a normal, sequential test will be run,
       # otherwise run the test with mpirun:
       IF("${_n_cpu}" STREQUAL "0")

-        SET(_diff_target ${_target}.diff) # diff target name
+        SET(_diff_target ${_test_name}.${_build_lowercase}.diff) # diff target name
         SET(_test_full ${_category}/${_test_name}.${_build_lowercase}) # full test name
-        SET(_test_directory ${CMAKE_CURRENT_BINARY_DIR}/${_target}) # directory to run the test in
-        SET(_run_command ${CMAKE_CURRENT_BINARY_DIR}/${_target}/${_target}) # the command to issue
+        SET(_test_directory ${CMAKE_CURRENT_BINARY_DIR}/${_test_name}.${_build_lowercase}) # directory to run the test in

       ELSE()

         SET(_diff_target ${_test_name}.mpirun${_n_cpu}.${_build_lowercase}.diff) # diff target name
         SET(_test_full ${_category}/${_test_name}.mpirun=${_n_cpu}.${_build_lowercase}) # full test name
-        SET(_test_directory ${CMAKE_CURRENT_BINARY_DIR}/${_target}/mpirun=${_n_cpu}) # directory to run the test in
-        # the command to issue
-        SET(_run_command "${DEAL_II_MPIEXEC} ${DEAL_II_MPIEXEC_NUMPROC_FLAG} ${_n_cpu} ${DEAL_II_MPIEXEC_PREFLAGS} ${CMAKE_CURRENT_BINARY_DIR}/${_target}/${_target} ${DEAL_II_MPIEXEC_POSTFLAGS}")
-
+        SET(_test_directory ${CMAKE_CURRENT_BINARY_DIR}/${_test_name}.${_build_lowercase}/mpirun=${_n_cpu}) # directory to run the test in
+        SET(_run_command "${DEAL_II_MPIEXEC} ${DEAL_II_MPIEXEC_NUMPROC_FLAG} ${_n_cpu} ${DEAL_II_MPIEXEC_PREFLAGS} ${_run_command} ${DEAL_II_MPIEXEC_POSTFLAGS}")
       ENDIF()

       FILE(MAKE_DIRECTORY ${_test_directory})

       #
-      # Add an executable for the current test and set up compile
+      # Add an executable (for the first type of tests) and set up compile
       # definitions and the full link interface. Only add the target once.
       #
+
       IF(NOT TARGET ${_target})
-
         #
         # Add a "guard file" rule: The purpose of interrupt_guard.cc is to
         # force a complete rerun of this test (BUILD, RUN and DIFF stage)
@@ -240,7 +277,7 @@
           -DTEST=${_test_full}
           -DEXPECT=${_expect}
           -DBINARY_DIR=${CMAKE_BINARY_DIR}
-          -DGUARD_FILE=${CMAKE_CURRENT_BINARY_DIR}/${_target}/interrupt_guard.cc
+          -DGUARD_FILE=${CMAKE_CURRENT_BINARY_DIR}/${_test_name}.${_build_lowercase}/interrupt_guard.cc
           -P ${DEAL_II_PATH}/${DEAL_II_SHARE_RELDIR}/scripts/run_test.cmake
         WORKING_DIRECTORY ${_test_directory}
         )


hunter_make_directory: fix creation order

--- cmake/modules/hunter_make_directory.cmake
+++ cmake/modules/hunter_make_directory.cmake
@@ -39,9 +39,9 @@
     return()
   endif()

-  file(WRITE "${sha1_path}" "${sha1}")
   file(MAKE_DIRECTORY "${dir_path}")
   file(WRITE "${done_path}" "")
+  file(WRITE "${sha1_path}" "${sha1}")

   set("${result}" "${dir_path}" PARENT_SCOPE)
 endfunction()


sentencepiece: Add SPM_NO_THREADLOCAL=YES for iOS

--- cmake/projects/sentencepiece/hunter.cmake
+++ cmake/projects/sentencepiece/hunter.cmake
@@ -20,11 +20,26 @@
     00e5a16ce6af6a4148cd9541c7ff26b9d5e58972
 )

+set(_hunter_spm_cmake_args "")
+if(IOS)
+  list(
+      APPEND
+      _hunter_spm_cmake_args
+      SPM_NO_THREADLOCAL=YES
+  )
+endif()
+
+list(
+    APPEND
+    _hunter_spm_cmake_args
+    SPM_USE_BUILTIN_PROTOBUF=OFF
+    SPM_ENABLE_SHARED=OFF
+)
+
 hunter_cmake_args(
     sentencepiece
     CMAKE_ARGS
-    SPM_USE_BUILTIN_PROTOBUF=OFF
-    SPM_ENABLE_SHARED=OFF
+    ${_hunter_spm_cmake_args}
 )

 hunter_pick_scheme(DEFAULT url_sha1_cmake)


ENH: Update to ITKv4 with capabilities for single precision.

--- SuperBuild/External_ITKv4.cmake
+++ SuperBuild/External_ITKv4.cmake
@@ -81,7 +81,7 @@
     )
   ### --- End Project specific additions
   set(${proj}_REPOSITORY ${git_protocol}://itk.org/ITK.git)
-  set(${proj}_GIT_TAG 6b9fb9055a7be24d7df150b92bbc19031a7acfbf) #2013-05-02
+  set(${proj}_GIT_TAG 57d6ee8b0fbca5bcc6a00d6c02d00efa44e15a4f) #2013-06-20 SinglePrecision
   ExternalProject_Add(${proj}
     GIT_REPOSITORY ${${proj}_REPOSITORY}
     GIT_TAG ${${proj}_GIT_TAG}


Try running build in config step

Try running build in config step

--- Superbuild/PythonExternal.cmake
+++ Superbuild/PythonExternal.cmake
@@ -111,7 +111,7 @@
     GIT_REPOSITORY ${python_GIT_URL}
     GIT_TAG ${python_GIT_TAG}
     PATCH_COMMAND ""
-    CONFIGURE_COMMAND ""
+    CONFIGURE_COMMAND PCbuild/build.bat
     BUILD_IN_SOURCE ON
     BUILD_COMMAND ${CMAKE_BUILD_TOOL} PCbuild/pcbuild.sln /nologo /property:Configuration=Release /property:Platform=${python_WIN32_ARCH}
     INSTALL_COMMAND "${CMAKE_COMMAND}" -E copy_if_different


COMP: Update FindDCMTK to not look in default path.

When DCMTK was installed on the system, FindDCMTK was using
these system libs instead of the one available under DCMTK_DIR

--- Utilities/CMake/FindDCMTK.cmake
+++ Utilities/CMake/FindDCMTK.cmake
@@ -37,80 +37,101 @@
 ENDIF( NOT DCMTK_FOUND )

 FIND_PATH( DCMTK_config_INCLUDE_DIR osconfig.h
-  ${DCMTK_DIR}/config/include
-  ${DCMTK_DIR}/config
-  ${DCMTK_DIR}/include/dcmtk/config
-  ${DCMTK_DIR}/include
+  PATHS
+    ${DCMTK_DIR}/config/include
+    ${DCMTK_DIR}/config
+    ${DCMTK_DIR}/include/dcmtk/config
+    ${DCMTK_DIR}/include
+  NO_DEFAULT_PATH
+
 )

 FIND_PATH( DCMTK_ofstd_INCLUDE_DIR ofstdinc.h
-  ${DCMTK_DIR}/ofstd/include
-  ${DCMTK_DIR}/ofstd
-  ${DCMTK_DIR}/include/ofstd
-  ${DCMTK_DIR}/include/dcmtk/ofstd
+  PATHS
+    ${DCMTK_DIR}/ofstd/include
+    ${DCMTK_DIR}/ofstd
+    ${DCMTK_DIR}/include/ofstd
+    ${DCMTK_DIR}/include/dcmtk/ofstd
+  NO_DEFAULT_PATH
 )

 FIND_LIBRARY( DCMTK_ofstd_LIBRARY ofstd
-  ${DCMTK_DIR}/ofstd/libsrc
-  ${DCMTK_DIR}/ofstd/libsrc/Release
-  ${DCMTK_DIR}/ofstd/libsrc/Debug
-  ${DCMTK_DIR}/ofstd/Release
-  ${DCMTK_DIR}/ofstd/Debug
-  ${DCMTK_DIR}/lib
+  PATHS
+    ${DCMTK_DIR}/ofstd/libsrc
+    ${DCMTK_DIR}/ofstd/libsrc/Release
+    ${DCMTK_DIR}/ofstd/libsrc/Debug
+    ${DCMTK_DIR}/ofstd/Release
+    ${DCMTK_DIR}/ofstd/Debug
+    ${DCMTK_DIR}/lib
+  NO_DEFAULT_PATH
 )

 FIND_LIBRARY( DCMTK_oflog_LIBRARY oflog
-  ${DCMTK_DIR}/oflog/libsrc
-  ${DCMTK_DIR}/oflog/libsrc/Release
-  ${DCMTK_DIR}/oflog/libsrc/Debug
-  ${DCMTK_DIR}/oflog/Release
-  ${DCMTK_DIR}/oflog/Debug
-  ${DCMTK_DIR}/lib
+  PATHS
+    ${DCMTK_DIR}/oflog/libsrc
+    ${DCMTK_DIR}/oflog/libsrc/Release
+    ${DCMTK_DIR}/oflog/libsrc/Debug
+    ${DCMTK_DIR}/oflog/Release
+    ${DCMTK_DIR}/oflog/Debug
+    ${DCMTK_DIR}/lib
+  NO_DEFAULT_PATH
 )

 FIND_PATH( DCMTK_dcmdata_INCLUDE_DIR dctypes.h
-  ${DCMTK_DIR}/include/dcmdata
-  ${DCMTK_DIR}/include/dcmtk/dcmdata
-  ${DCMTK_DIR}/dcmdata
-  ${DCMTK_DIR}/dcmdata/include
+  PATHS
+    ${DCMTK_DIR}/include/dcmdata
+    ${DCMTK_DIR}/include/dcmtk/dcmdata
+    ${DCMTK_DIR}/dcmdata
+    ${DCMTK_DIR}/dcmdata/include
+  NO_DEFAULT_PATH
 )

 FIND_LIBRARY( DCMTK_dcmdata_LIBRARY dcmdata
-  ${DCMTK_DIR}/dcmdata/libsrc
-  ${DCMTK_DIR}/dcmdata/libsrc/Release
-  ${DCMTK_DIR}/dcmdata/libsrc/Debug
-  ${DCMTK_DIR}/dcmdata/Release
-  ${DCMTK_DIR}/dcmdata/Debug
-  ${DCMTK_DIR}/lib
+  PATHS
+    ${DCMTK_DIR}/dcmdata/libsrc
+    ${DCMTK_DIR}/dcmdata/libsrc/Release
+    ${DCMTK_DIR}/dcmdata/libsrc/Debug
+    ${DCMTK_DIR}/dcmdata/Release
+    ${DCMTK_DIR}/dcmdata/Debug
+    ${DCMTK_DIR}/lib
+  NO_DEFAULT_PATH
 )

 FIND_PATH( DCMTK_dcmimgle_INCLUDE_DIR dcmimage.h
-  ${DCMTK_DIR}/dcmimgle/include
-  ${DCMTK_DIR}/dcmimgle
-  ${DCMTK_DIR}/include/dcmimgle
-  ${DCMTK_DIR}/include/dcmtk/dcmimgle
+  PATHS
+    ${DCMTK_DIR}/dcmimgle/include
+    ${DCMTK_DIR}/dcmimgle
+    ${DCMTK_DIR}/include/dcmimgle
+    ${DCMTK_DIR}/include/dcmtk/dcmimgle
+  NO_DEFAULT_PATH
 )

 FIND_LIBRARY( DCMTK_dcmimgle_LIBRARY dcmimgle
-  ${DCMTK_DIR}/dcmimgle/libsrc
-  ${DCMTK_DIR}/dcmimgle/libsrc/Release
-  ${DCMTK_DIR}/dcmimgle/libsrc/Debug
-  ${DCMTK_DIR}/dcmimgle/Release
-  ${DCMTK_DIR}/dcmimgle/Debug
-  ${DCMTK_DIR}/lib
+  PATHS
+    ${DCMTK_DIR}/dcmimgle/libsrc
+    ${DCMTK_DIR}/dcmimgle/libsrc/Release
+    ${DCMTK_DIR}/dcmimgle/libsrc/Debug
+    ${DCMTK_DIR}/dcmimgle/Release
+    ${DCMTK_DIR}/dcmimgle/Debug
+    ${DCMTK_DIR}/lib
+  NO_DEFAULT_PATH
 )

 # MM: I could not find this library on debian system / dcmtk 3.5.4
-FIND_LIBRARY(DCMTK_imagedb_LIBRARY imagedb
-  ${DCMTK_DIR}/imagectn/libsrc/Release
-  ${DCMTK_DIR}/imagectn/libsrc/
-  ${DCMTK_DIR}/imagectn/libsrc/Debug
-  )
-
-FIND_LIBRARY(DCMTK_dcmnet_LIBRARY dcmnet
-  ${DCMTK_DIR}/dcmnet/libsrc/Release
-  ${DCMTK_DIR}/dcmnet/libsrc/Debug
-  ${DCMTK_DIR}/dcmnet/libsrc/
+FIND_LIBRARY(DCMTK_imagedb_LIBRARY imagedb
+  PATHS
+    ${DCMTK_DIR}/imagectn/libsrc/Release
+    ${DCMTK_DIR}/imagectn/libsrc/
+    ${DCMTK_DIR}/imagectn/libsrc/Debug
+  NO_DEFAULT_PATH
+  )
+
+FIND_LIBRARY(DCMTK_dcmnet_LIBRARY dcmnet
+  PATHS
+    ${DCMTK_DIR}/dcmnet/libsrc/Release
+    ${DCMTK_DIR}/dcmnet/libsrc/Debug
+    ${DCMTK_DIR}/dcmnet/libsrc/
+  NO_DEFAULT_PATH
   )

 IF( DCMTK_config_INCLUDE_DIR
@@ -181,15 +202,21 @@
     AND DCMTK_dcmimgle_LIBRARY )

 FIND_PROGRAM(DCMTK_DCMDUMP_EXECUTABLE dcmdump
-  ${DCMTK_DIR}/bin
+  PATHS
+    ${DCMTK_DIR}/bin
+  NO_DEFAULT_PATH
   )

 FIND_PROGRAM(DCMTK_DCMDJPEG_EXECUTABLE dcmdjpeg
-  ${DCMTK_DIR}/bin
+  PATHS
+    ${DCMTK_DIR}/bin
+  NO_DEFAULT_PATH
   )

 FIND_PROGRAM(DCMTK_DCMDRLE_EXECUTABLE dcmdrle
-  ${DCMTK_DIR}/bin
+  PATHS
+    ${DCMTK_DIR}/bin
+  NO_DEFAULT_PATH
   )

 MARK_AS_ADVANCED(


FindDCMTK - Do not explicitly set DCMTK_DEFINITIONS

Following commit commontk/CTK@12c052 fixing a packaging Debian bug,
the DCMTK_DEFINITIONS was set directly inside the FindDCMTK.cmake
module using "add_definitions".

When used outside of this project, setting automatically the definition
could have some unintended effects. For example, by globally adding
DCMTK_DEFINITIONS (and more specifically HAVE_CONFIG_H), it prevented from
compiling successfully program against the "tclap" library. Compile errors
like the following occurred:

// ------------------
In file included from <DIR>/SlicerExecutionModel/tclap/include/tclap/CmdLine.h:27:0,
                 from <DIR>/Slicer-build/Modules/CLI/CheckerBoardFilter/CheckerBoardFilterCLP.h:13,
                 from <SRC>/Modules/CLI/CheckerBoardFilter/CheckerBoardFilter.cxx:23:
<DIR>/SlicerExecutionModel/tclap/include/tclap/MultiSwitchArg.h:44:2: error: #error "Need a stringstream (sstream or strstream) to compile!"
 #error "Need a stringstream (sstream or strstream) to compile!"
  ^
<DIR>/SlicerExecutionModel/tclap/include/tclap/MultiSwitchArg.h:171:2: error: #error "Need a stringstream (sstream or strstream) to compile!"
 #error "Need a stringstream (sstream or strstream) to compile!"
  ^
In file included from <DIR>/SlicerExecutionModel/tclap/include/tclap/UnlabeledValueArg.h:30:0,
                 from <DIR>/SlicerExecutionModel/tclap/include/tclap/CmdLine.h:28,
                 from <DIR>/Slicer-build/Modules/CLI/CheckerBoardFilter/CheckerBoardFilterCLP.h:13,
                 from <SRC>/Modules/CLI/CheckerBoardFilter/CheckerBoardFilter.cxx:23:
<DIR>/SlicerExecutionModel/tclap/include/tclap/ValueArg.h:43:2: error: #error "Need a stringstream (sstream or strstream) to compile!"
 #error "Need a stringstream (sstream or strstream) to compile!"
  ^
<DIR>/SlicerExecutionModel/tclap/include/tclap/ValueArg.h:97:2: error: #error "Need a stringstream (sstream or strstream) to compile!"
 #error "Need a stringstream (sstream or strstream) to compile!"
  ^
// ------------------

See #382

--- Utilities/CMake/FindDCMTK.cmake
+++ Utilities/CMake/FindDCMTK.cmake
@@ -329,10 +329,6 @@

 # Workaround bug in packaging of DCMTK 3.6.0 on Debian.
 # See http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=637687
-#
-# By setting 'DCMTK_FIND_PACKAGE_SKIP_ADD_DEFINITIONS' to '1' before
-# calling 'find_package(DCMTK)', the variable 'DCMTK_DEFINITIONS' will be set
-# appropriately.
 if(DCMTK_FOUND AND UNIX AND NOT APPLE)
   include(CheckCXXSourceCompiles)
   set(CMAKE_REQUIRED_FLAGS )
@@ -343,10 +339,7 @@
     DCMTK_HAVE_CONFIG_H_OPTIONAL
     )
   if(NOT DCMTK_HAVE_CONFIG_H_OPTIONAL)
-    set(DCMTK_DEFINITIONS "-DHAVE_CONFIG_H")
-  endif()
-  if(NOT DCMTK_HAVE_CONFIG_H_OPTIONAL AND NOT DCMTK_FIND_PACKAGE_SKIP_ADD_DEFINITIONS)
-    add_definitions(${DCMTK_DEFINITIONS})
+    set(DCMTK_DEFINITIONS "HAVE_CONFIG_H")
   endif()
 endif()


Restructure argument parsing in shell script.

This makes it easier to maintain and the arguments become position-
independent, which is very useful.

--- heaptrack.sh.cmake
+++ heaptrack.sh.cmake
@@ -19,7 +19,7 @@
 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 #

-if [ "$1" = "--help" -o "$1" = "-h" ]; then
+usage() {
     echo "Usage: $0 [--debug|-d] DEBUGGEE [ARGUMENT]..."
     echo
     echo "A heap memory usage profiler. It uses LD_PRELOAD to track all"
@@ -41,25 +41,44 @@
     echo "  -d, --debug    Run the debuggee in GDB and heaptrack."
     echo "  ARGUMENT       Any number of arguments that will be passed verbatim"
     echo "                 to the debuggee."
+    echo "  -h, --help     Show this help message and exit."
     echo
     exit 0
-fi
+}

 debug=
-if [ "$1" = "--debug" -o "$1" = "-d" ]; then
-    debug=1
-    shift 1;
-fi
+client=
+clientargs=

-if [ ! -x "$(which $1)" ]; then
-    echo "Error: Debuggee \"$1\" is not an executable."
-    echo
-    echo "Usage: $0 [--debug|-d] DEBUGGEE [ARGS...]"
-    exit 1
-fi
+while true; do
+    case "$1" in
+        "-d") ;&
+        "--debug")
+            debug=1
+            shift 1
+            ;;
+        "-h") ;&
+        "--help")
+            usage
+            exit 0
+            ;;
+        *)
+            if [ ! -x "$(which $1 2> /dev/null)" ]; then
+                echo "Error: Debuggee \"$1\" is not an executable."
+                echo
+                echo "Usage: $0 [--debug|-d] [--help|-h] DEBUGGEE [ARGS...]"
+                exit 1
+            fi
+            client="$1"
+            shift 1
+            clientargs="$@"
+            break;
+            ;;
+    esac
+done

 # put output into current pwd
-output=$(pwd)/heaptrack.$(basename $1).$$
+output=$(pwd)/heaptrack.$(basename $client).$$

 # find preload library and interpreter executable using relative paths
 EXE_PATH=$(readlink -f $(dirname $0))
@@ -94,11 +113,11 @@
 echo "output will be written to $output"

 if [ -z "$debug" ]; then
-  LD_PRELOAD=$LIBHEAPTRACK DUMP_HEAPTRACK_OUTPUT="$pipe" $@
+  LD_PRELOAD=$LIBHEAPTRACK DUMP_HEAPTRACK_OUTPUT="$pipe" $client $clientargs
 else
   gdb --eval-command="set environment LD_PRELOAD=$LIBHEAPTRACK" \
       --eval-command="set environment DUMP_HEAPTRACK_OUTPUT=$pipe" \
-      --eval-command="run" --args $@
+      --eval-command="run" --args $client $clientargs
 fi

 wait $debuggee


iOS: (attempt to) enable tuned arch-specific compiler options.

--- toolchains/ios.toolchain.cmake
+++ toolchains/ios.toolchain.cmake
@@ -28,7 +28,7 @@
 set( CMAKE_SYSTEM_PROCESSOR arm    )
 set( APPLE true )
 set( iOS   true )
-# compatibility with build scripts that rely on ios toolchains defining IOS instead of iOS
+# Compatibility with build scripts that rely on iOS toolchains defining IOS instead of iOS
 # CMake variables are case sensitive (unlike functions, macros and commands: https://cmake.org/cmake/help/latest/manual/cmake-language.7.html#variables
 set( IOS   true )
 set( UNIX  true )
@@ -39,7 +39,7 @@

 # Compiler detection is skipped, so we must manually set these variables so code that depend on them can work
 set( CMAKE_CXX_COMPILER_ID "AppleClang" CACHE STRING "C++ compiler id" )
-set( CMAKE_C_COMPILER_ID "AppleClang"  CACHE STRING "C compiler id" )
+set( CMAKE_C_COMPILER_ID   "AppleClang" CACHE STRING "C compiler id"   )

 set( TNUN_os_suffix iOS )

@@ -63,9 +63,17 @@
 set( CMAKE_XCODE_ATTRIBUTE_SDKROOT   iphoneos ) # "Latest iOS"

 list( APPEND TNUN_compiler_optimize_for_size -mthumb ) #...mrmlj...this will cause (harmless) warnings on ARM64 builds...
-set( XCODE_ATTRIBUTE_CFLAGS_armv7  "-mcpu=cortex-a8 -mtune=cortex-a9"  )
-set( XCODE_ATTRIBUTE_CFLAGS_armv7s "                -mtune=cortex-a15" ) # http://www.anandtech.com/show/6292/iphone-5-a6-not-a15-custom-core
-
+#...mrmlj...this no longer appears to work (Xcode 8.2):
+# http://www.cmake.org/pipermail/cmake/2011-October/046737.html
+# http://stackoverflow.com/questions/1211854/xcode-conditional-build-settings-based-on-architecture-device-arm-vs-simulat
+# http://cmake.3232098.n2.nabble.com/Different-settings-for-different-configurations-in-Xcode-td6908021.html
+# http://public.kitware.com/Bug/view.php?id=8915 Missing feature to set Xcode specific build settings
+set( XCODE_ATTRIBUTE_CFLAGS_armv7  "-mcpu=cortex-a8 -mfpu=neon -mtune=cortex-a9"  )
+set( XCODE_ATTRIBUTE_CFLAGS_armv7s "                -mfpu=neon -mtune=cortex-a15" ) # http://www.anandtech.com/show/6292/iphone-5-a6-not-a15-custom-core
+set( CMAKE_XCODE_ATTRIBUTE_OTHER_CFLAGS[arch=armv7]          "${XCODE_ATTRIBUTE_CFLAGS_armv7}  $(OTHER_CFLAGS)"         )
+set( CMAKE_XCODE_ATTRIBUTE_OTHER_CFLAGS[arch=armv7s]         "${XCODE_ATTRIBUTE_CFLAGS_armv7s} $(OTHER_CFLAGS)"         )
+set( CMAKE_XCODE_ATTRIBUTE_OTHER_CPLUSPLUSFLAGS[arch=armv7]  "${XCODE_ATTRIBUTE_CFLAGS_armv7}  $(OTHER_CPLUSPLUSFLAGS)" )
+set( CMAKE_XCODE_ATTRIBUTE_OTHER_CPLUSPLUSFLAGS[arch=armv7s] "${XCODE_ATTRIBUTE_CFLAGS_armv7s} $(OTHER_CPLUSPLUSFLAGS)" )

 # Implementation note:
 # Disable optimiser pass reports for iOS builds as they get run by the


Adding flags for mingw to create big object files

Change-Id: Ib72e891da86453bed30872d8d7c6c6d38e1150cf

--- CMake/sitkCheckRequiredFlags.cmake
+++ CMake/sitkCheckRequiredFlags.cmake
@@ -42,6 +42,11 @@
     STRING(REGEX REPLACE "INCREMENTAL(:[a-zA-Z]+)?" "INCREMENTAL:NO" ${_varName} ${${_varName}})
   endforeach()

+endif()
+
+if(MINGW)
+  set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wa,-mbig-obj" )
+  set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wa,-mbig-obj" )
 endif()


CMake: Simplify llvm-config search

CMake: Simplify llvm-config search

Make sure we pick up LLVM 3.3 if multiple versions are installed on the
system.

Signed-off-by: Pekka Enberg <add4fcd06328a394f0ad91feda7ee057316dc5ed@iki.fi>

--- CMake/FindLLVM.cmake
+++ CMake/FindLLVM.cmake
@@ -36,11 +36,7 @@
 else (LLVM_INCLUDE_DIR)

   find_program(LLVM_CONFIG_EXECUTABLE
-    NAMES llvm-config
-    PATHS
-    /opt/local/bin
-    /opt/llvm/2.6/bin
-    /opt/llvm/bin
+    NAMES llvm-config-3.3 llvm-config
     )

   if(LLVM_CONFIG_EXECUTABLE)


added check if CMAKE_BUILD_TYPE exists. Will add to cache if not (as RelWithDebInfo, since this is a Windows related issue)

--- CMake/Settings.cmake
+++ CMake/Settings.cmake
@@ -46,6 +46,10 @@
 mark_as_advanced(BUILD_ALL_MODULES)

 # Choose build configuration from CMake list of common configuration types
+if(NOT CMAKE_BUILD_TYPE)
+  set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "" FORCE)
+  set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "Choose the type of build, options are: Release, MinSizeRel, Debug, RelWithDebInfo." FORCE)
+endif()
 if (CMAKE_CONFIGURATION_TYPES)
   set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS ${CMAKE_CONFIGURATION_TYPES})
   set_property(CACHE CMAKE_CONFIGURATION_TYPES PROPERTY TYPE INTERNAL)


Improve FindDirectShow so that it works on more systems without manual adjusting.

Specifically, it now properly looks up the include and lib dirs received from FindWindowsSDK,
and also verifies that a given qedit.h includes a line with "ISampleGrabber" in it.

--- cmake/FindDirectShow.cmake
+++ cmake/FindDirectShow.cmake
@@ -71,6 +71,52 @@
 	PATH_SUFFIXES
 	"Include")

+###
+# Begin code dedicated to finding a proper qedit.h file...
+###
+
+# Checks to see if a directory has qedit.h and if that file contains ISampleGrabber.
+function(_directshow_check_qedit _dir _var)
+	set(fn "${_dir}/qedit.h")
+	if(NOT EXISTS "${fn}")
+		set(${_var} FALSE PARENT_SCOPE)
+		return()
+	endif()
+	file(STRINGS "${fn}" samplegrabber REGEX ISampleGrabber)
+	if(NOT samplegrabber)
+		set(${_var} FALSE PARENT_SCOPE)
+		return()
+	endif()
+	set(${_var} TRUE PARENT_SCOPE)
+endfunction()
+
+function(_directshow_check_current_qedit)
+	if(DIRECTSHOW_QEDIT_INCLUDE_DIR)
+		_directshow_check_qedit("${DIRECTSHOW_QEDIT_INCLUDE_DIR}" _ds_ok)
+		if(NOT _ds_ok)
+			message(STATUS "FindDirectShow: qedit.h in ${DIRECTSHOW_QEDIT_INCLUDE_DIR} lacks ISampleGrabber, unsetting DIRECTSHOW_QEDIT_INCLUDE_DIR")
+			set(DIRECTSHOW_QEDIT_INCLUDE_DIR "" CACHE PATH "" FORCE)
+		endif()
+	endif()
+endfunction()
+
+# Check before deciding if we should make our list of possible locations.
+_directshow_check_current_qedit()
+
+# Compose a list of possible directories that might hold a qedit.h file.
+set(DIRECTSHOW_QEDIT_SEARCH)
+if(WINDOWSSDK_FOUND AND NOT DIRECTSHOW_QEDIT_INCLUDE_DIR)
+    foreach(_sdk ${WINDOWSSDK_DIRS})
+		windowssdk_build_lookup("${_sdk}" _build)
+		if(_build AND ("${_build}" VERSION_LESS 6.2))
+	        get_windowssdk_include_dirs("${_sdk}" _dirs)
+	        if(_dirs)
+	            list(APPEND DIRECTSHOW_QEDIT_SEARCH ${_dirs})
+	        endif()
+		endif()
+    endforeach()
+endif()
+
 # This one we can grab from another SDK version.
 find_path(DIRECTSHOW_QEDIT_INCLUDE_DIR
 	NAMES
@@ -78,17 +124,46 @@
 	HINTS
 	"${DIRECTSHOW_WINDOWSSDK_ROOT}"
 	PATHS
-	${WINDOWSSDK_DIRS}
+	${DIRECTSHOW_QEDIT_SEARCH}
 	PATH_SUFFIXES
 	"Include")

+# Check if the directory is OK after the search.
+_directshow_check_current_qedit()
+
+# If we didn't find a proper qedit, manually look through the possibilities.
+if(NOT DIRECTSHOW_QEDIT_INCLUDE_DIR)
+	foreach(_dir "${DIRECTSHOW_WINDOWSSDK_ROOT}/Include" ${DIRECTSHOW_QEDIT_SEARCH})
+		if(NOT DIRECTSHOW_QEDIT_INCLUDE_DIR)
+			_directshow_check_qedit("${_dir}" _ds_ok)
+			if(_ds_ok)
+				set(DIRECTSHOW_QEDIT_INCLUDE_DIR "${_dir}" CACHE PATH "" FORCE)
+			endif()
+		endif()
+	endforeach()
+endif()
+
+###
+# End qedit.h section.
+###
+
+set(DIRECTSHOW_STRMIIDS_SEARCH)
+if(WINDOWSSDK_FOUND AND NOT DIRECTSHOW_STRMIIDS_LIBRARY)
+    foreach(_sdk ${WINDOWSSDK_DIRS})
+		get_windowssdk_library_dirs("${_sdk}" _dirs)
+		message(STATUS "- ${_dirs}")
+		if(_dirs)
+			list(APPEND DIRECTSHOW_STRMIIDS_SEARCH ${_dirs})
+		endif()
+    endforeach()
+endif()
 find_library(DIRECTSHOW_STRMIIDS_LIBRARY
 	NAMES
 	strmiids
 	HINTS
 	"${DIRECTSHOW_WINDOWSSDK_ROOT}"
 	PATHS
-	${_acceptable_winsdk}
+	${DIRECTSHOW_STRMIIDS_SEARCH}
 	PATH_SUFFIXES
 	"Lib${DIRECTSHOW_LIB_SUBDIR}")


cmake fix 2

cmake fix 2

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

--- cmake/gsJITConfigXml.cmake
+++ cmake/gsJITConfigXml.cmake
@@ -42,6 +42,8 @@

   # Add JIT compiler flags (all build types)
   set(JIT_C_FLAGS "${JIT_C_FLAGS} ${CMAKE_C_FLAGS} ${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS}")
+  string(REPLACE "-fvisibility=hidden"         "" JIT_C_FLAGS ${JIT_CXX_FLAGS})
+  string(REPLACE "-fvisibility-inlines-hidden" "" JIT_C_FLAGS ${JIT_CXX_FLAGS})

   if(NOT DEFINED CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS)
     set(JIT_CXX_FLAGS "${JIT_CXX_FLAGS} ${CMAKE_CXX_FLAGS} ${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS}")


More work on automating breakpad setup

More work on automating breakpad setup

--- cmake/modules/macros.cmake
+++ cmake/modules/macros.cmake
@@ -55,13 +55,30 @@

 function(generate_symbol_data target)
   if(UNIX)
+    set(TARGET_PATH ${CMAKE_BINARY_DIR}/bin/symbols/${target}.sym)
+
     add_custom_command(TARGET ${target}
       POST_BUILD
       COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/bin/symbols
-      COMMAND ${BREAKPAD_EXCEPTION_HANDLER_INSTALL_DIR}/bin/dump_syms $<TARGET_FILE:${target}> > ${CMAKE_BINARY_DIR}/bin/symbols/${target}.sym
-      #TODO Generate symbol folders
+      COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/bin/symbols/test
+      COMMAND ${BREAKPAD_EXCEPTION_HANDLER_INSTALL_DIR}/bin/dump_syms $<TARGET_FILE:${target}> > ${TARGET_PATH}
+      COMMAND head -n1 ${TARGET_PATH} > /tmp/${target}.str
+#      COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/bin/symbols/
       VERBATIM
     )
+
+    #add_custom_command(TARGET ${target}
+    #  POST_BUILD
+    #  COMMAND cat /tmp/${target}.str | awk '{ print $4 }'
+    #)
+
+    #add_custom_command(TARGET ${target}
+    #  POST_BUILD
+    #  COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/bin/symbols/${SYMBOL_DRIECTORY}
+    #  COMMAND ${BREAKPAD_EXCEPTION_HANDLER_INSTALL_DIR}/bin/dump_syms $<TARGET_FILE:${target}> > ${CMAKE_BINARY_DIR}/bin/symbols/${SYMBOL_DRIECTORY}/${target}.sym
+    #  #TODO Generate symbol folders
+    #  VERBATIM
+    #)
   endif()
 endfunction()


Copyright notice. Double-precision (double) and installation directory
(instdirs) configuration.

svn path=/trunk/; revision=6732

--- cmake/modules/plplot.cmake
+++ cmake/modules/plplot.cmake
@@ -1,3 +1,33 @@
+# cmake/modules/plplot.cmake
+#
+# Start driver initializations
+#
+# Copyright (C) 2006  Alan W. Irwin
+#
+# This file is part of PLplot.
+#
+# PLplot is free software; you can redistribute it and/or modify
+# it under the terms of the GNU Library General Public License as published
+# by the Free Software Foundation; version 2 of the License.
+#
+# PLplot is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU Library General Public License for more details.
+#
+# You should have received a copy of the GNU Library General Public License
+# along with the file PLplot; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
+
 # Module for determining all configuration variables for PLplot.

+# =======================================================================
+# Compilation and build options (PLFLT, install locations)
+# (man cmake to see rpath options).
+# Note, must come before java since that depends on, e.g., LIB_DIR.
+# =======================================================================
+include(double)
+include(instdirs)
+
+
 include(drivers)


Try to fix file dependencies

Try to fix file dependencies

Signed-off-by: Andrew Butt <f0e550b392ccab9f366ecc80ae525c032211a45e@seas.upenn.edu>

--- common/cmake/devices.cmake
+++ common/cmake/devices.cmake
@@ -963,7 +963,7 @@
         set(FASM_TO_BIT_DEPS "")
       endif()

-      string(APPEND ALL_OUT_FASM ${OUT_FASM} )
+      append_file_dependency(ALL_OUT_FASM ${OUT_FASM})

       if(USE_OVERLAY)
         if (NOT OVERLAY)
@@ -1708,6 +1708,7 @@
     )
     add_custom_target(${NAME}_fasm DEPENDS ${OUT_FASM})

+    add_output_to_fpga_target(${NAME} FASM ${OUT_FASM})
     set_target_properties(${NAME} PROPERTIES OUT_FASM ${OUT_FASM})
   else()
     # Generate HLC


[CI] broken options passing: a fix in ctest driver (ok on default config)

--- CI/machinery/CTestDriver.cmake
+++ CI/machinery/CTestDriver.cmake
@@ -1,11 +1,8 @@
 # a ctest driver for Experimental,Continuous,Nightly builds

-set(CMAKE_MODULE_PATH ${CTEST_SOURCE_DIRECTORY}/CI/cmake)
+set(CMAKE_MODULE_PATH ${CTEST_SOURCE_DIRECTORY}/CI/cmake;${CTEST_SOURCE_DIRECTORY}/CI/config)

 include(Tools)
-
-# options passed from cmake configuration command
-get_uninitialized_vars(CI_OPTIONS)

 if(NOT MODE)
   message(STATUS "set mode to Experimental")
@@ -15,6 +12,12 @@
 if(NOT CI_CONFIG)
   set(CI_CONFIG default)
 endif()
+
+include(${CI_CONFIG})
+
+foreach(option ${CI_OPTIONS})
+  set(CI_CONFIGURE_OPTIONS "${CI_CONFIGURE_OPTIONS} ${option}")
+endforeach()

 if(NOT CMAKE_WRAPPER)
   set(CMAKE_WRAPPER "cmake")
@@ -99,12 +102,13 @@

 set(CTEST_UPDATE_COMMAND "${CTEST_GIT_COMMAND}")

-set(CTEST_CONFIGURE_COMMAND "${CMAKE_WRAPPER} \"-G${CTEST_CMAKE_GENERATOR}\" -DCMAKE_BUILD_TYPE:STRING=${CTEST_BUILD_CONFIGURATION} ${CI_OPTIONS} ${CTEST_BUILD_OPTIONS}")
+set(CTEST_CONFIGURE_COMMAND "${CMAKE_WRAPPER} \"-G${CTEST_CMAKE_GENERATOR}\" -DCMAKE_BUILD_TYPE:STRING=${CTEST_BUILD_CONFIGURATION} ${CTEST_BUILD_OPTIONS}")

 if(WITH_COVERAGE)
   set(CTEST_CONFIGURE_COMMAND "${CTEST_CONFIGURE_COMMAND} -DWITH_TESTS_COVERAGE:BOOL=ON")
 endif()

+set(CTEST_CONFIGURE_COMMAND "${CTEST_CONFIGURE_COMMAND} ${CI_CONFIGURE_OPTIONS}")
 set(CTEST_CONFIGURE_COMMAND "${CTEST_CONFIGURE_COMMAND} ${CTEST_SOURCE_DIRECTORY}")

 set( dashboard_cache "


Only use CTEST_USE_LAUNCHERS with "make" based generators.

--- CMake/MITKDashboardSetup.cmake
+++ CMake/MITKDashboardSetup.cmake
@@ -60,8 +60,11 @@
 #
 # Set initial cache options
 #
-
-set(CTEST_USE_LAUNCHERS 1)
+if(CMAKE_GENERATOR MATCHES "[Mm]ake")
+  set(CTEST_USE_LAUNCHERS 1)
+else()
+  set(CTEST_USE_LAUNCHERS 0)
+endif()

 # Remove this if block after all dartclients work
 if(DEFINED ADDITIONNAL_CMAKECACHE_OPTION)


CMake: Fix rpath being not set for C# pinvoke libraries.

--- CMake/Modules/UrhoCommon.cmake
+++ CMake/Modules/UrhoCommon.cmake
@@ -559,9 +559,8 @@
             PROJECT ${CMAKE_CURRENT_SOURCE_DIR}/${BIND_MANAGED_TARGET}.csproj
             OUTPUT ${NET_OUTPUT_DIRECTORY}/${BIND_MANAGED_TARGET}.dll
             DEPENDS ${CSHARP_LIBRARY_NAME})
-        install (FILES ${NET_OUTPUT_DIRECTORY}/${BIND_MANAGED_TARGET}.dll $<TARGET_FILE:${CSHARP_LIBRARY_NAME}>
-            DESTINATION ${DEST_LIBRARY_DIR}
-        )
+        install (TARGETS ${CSHARP_LIBRARY_NAME} EXPORT Urho3D LIBRARY DESTINATION ${DEST_LIBRARY_DIR})
+        install (FILES ${NET_OUTPUT_DIRECTORY}/${BIND_MANAGED_TARGET}.dll DESTINATION ${DEST_LIBRARY_DIR})
     endif ()

     file (GLOB_RECURSE EXTRA_NATIVE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/Native/*.h ${CMAKE_CURRENT_SOURCE_DIR}/Native/*.cpp)


removed redundant commands from triangle cmake file

--HG--
branch : syclop-triangulate

--- CMakeModules/UseTriangle.cmake
+++ CMakeModules/UseTriangle.cmake
@@ -1,15 +1,3 @@
-include(FindPackageHandleStandardArgs)
-find_library (TRIANGLE_LIBRARY NAMES triangle TRIANGLE DOC "Location of the Triangle package")
-find_path (TRIANGLE_INCLUDE_DIR triangle.h PATH_SUFFIXES triangle)
-
-# TODO: Fail if triangle is not found, or perhaps compile without TriangularDecompositions
-if (TRIANGLE_LIBRARY AND TRIANGLE_INCLUDE_DIR)
-    find_package_handle_standard_args(triangle DEFAULT_MSG TRIANGLE_LIBRARY TRIANGLE_INCLUDE_DIR)
-    message (STATUS "Triangle package found.")
-else (TRIANGLE_LIBRARY AND TRIANGLE_INCLUDE_DIR)
-    message (STATUS "Triangle package not found.")
-endif (TRIANGLE_LIBRARY AND TRIANGLE_INCLUDE_DIR)
-
 find_library(TRIANGLE_LIBRARY triangle DOC "Location of Triangle library")
 find_path(TRIANGLE_INCLUDE_DIR triangle.h PATH_SUFFIXES triangle
    DOC "Location of Triangle header file directory")
@@ -19,5 +7,7 @@
     include(FindPackageHandleStandardArgs)
     find_package_handle_standard_args(triangle DEFAULT_MSG TRIANGLE_LIBRARY TRIANGLE_INCLUDE_DIR)
 else(TRIANGLE_LIBRARY AND TRIANGLE_INCLUDE_DIR)
+  #otherwise, print an error and exit
+  #TODO: if triangle not found, compile ompl without triangular decompositions
     message(FATAL_ERROR "Triangle is not found")
 endif(TRIANGLE_LIBRARY AND TRIANGLE_INCLUDE_DIR)


Added Android NDK r8 support including new mips ABI

--- android/android.toolchain.cmake
+++ android/android.toolchain.cmake
@@ -1,5 +1,5 @@
 # ------------------------------------------------------------------------------
-#  Android CMake toolchain file, for use with the Android NDK r5-r7
+#  Android CMake toolchain file, for use with the Android NDK r5-r8
 #  Requires cmake 2.6.3 or newer (2.8.3 or newer is recommended).
 #  See home page: http://code.google.com/p/android-cmake/
 #
@@ -20,7 +20,7 @@
 #
 #  Usage Windows:
 #     You need native port of make to build your project.
-#     Android NDK r7 already has make.exe on board.
+#     Android NDK r7 (or newer) already has make.exe on board.
 #     For older NDK you have to install it separately.
 #     For example, this one: http://gnuwin32.sourceforge.net/packages/make.htm
 #
@@ -177,6 +177,9 @@
 #     [+] updated for NDK r7c
 #     [~] fixed most of problems with compiler/linker flags and caching
 #     [+] added option ANDROID_FUNCTION_LEVEL_LINKING
+#   - modified May 2012
+#     [+] updated for NDK r8
+#     [+] added mips architecture support
 # ------------------------------------------------------------------------------

 cmake_minimum_required( VERSION 2.6.3 )
@@ -186,7 +189,8 @@
  return()
 endif()

-if( PROJECT_NAME STREQUAL "CMAKE_TRY_COMPILE" )
+get_property(_CMAKE_IN_TRY_COMPILE GLOBAL PROPERTY IN_TRY_COMPILE)
+if( _CMAKE_IN_TRY_COMPILE )
  include( "${CMAKE_CURRENT_SOURCE_DIR}/../android.toolchain.config.cmake" OPTIONAL )
 endif()

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

-set( ANDROID_SUPPORTED_NDK_VERSIONS ${ANDROID_EXTRA_NDK_VERSIONS} -r7c -r7b -r7 -r6b -r6 -r5c -r5b -r5 "" )
+set( ANDROID_SUPPORTED_NDK_VERSIONS ${ANDROID_EXTRA_NDK_VERSIONS} -r8 -r7c -r7b -r7 -r6b -r6 -r5c -r5b -r5 "" )
 if(NOT DEFINED ANDROID_NDK_SEARCH_PATHS)
  if( CMAKE_HOST_WIN32 )
   file( TO_CMAKE_PATH "$ENV{PROGRAMFILES}" ANDROID_NDK_SEARCH_PATHS )
@@ -211,9 +215,11 @@

 set( ANDROID_SUPPORTED_ABIS_arm "armeabi-v7a;armeabi;armeabi-v7a with NEON;armeabi-v7a with VFPV3;armeabi-v6 with VFP" )
 set( ANDROID_SUPPORTED_ABIS_x86 "x86" )
+set( ANDROID_SUPPORTED_ABIS_mipsel "mips" )

 set( ANDROID_DEFAULT_NDK_API_LEVEL 8 )
 set( ANDROID_DEFAULT_NDK_API_LEVEL_x86 9 )
+set( ANDROID_DEFAULT_NDK_API_LEVEL_mips 9 )

 macro( __LIST_FILTER listvar regex )
@@ -432,6 +438,7 @@
 #get all the details about standalone toolchain
 if( BUILD_WITH_STANDALONE_TOOLCHAIN )
  __DETECT_NATIVE_API_LEVEL( ANDROID_SUPPORTED_NATIVE_API_LEVELS "${ANDROID_STANDALONE_TOOLCHAIN}/sysroot/usr/include/android/api-level.h" )
+ set( ANDROID_STANDALONE_TOOLCHAIN_API_LEVEL ${ANDROID_SUPPORTED_NATIVE_API_LEVELS} )
  set( __availableToolchains "standalone" )
  __DETECT_TOOLCHAIN_MACHINE_NAME( __availableToolchainMachines "${ANDROID_STANDALONE_TOOLCHAIN}" )
  if( NOT __availableToolchainMachines )
@@ -441,6 +448,8 @@
   set( __availableToolchainArchs "x86" )
  elseif( __availableToolchainMachines MATCHES arm )
   set( __availableToolchainArchs "arm" )
+ elseif( __availableToolchainMachines MATCHES mipsel )
+  set( __availableToolchainArchs "mipsel" )
  endif()
  if( ANDROID_COMPILER_VERSION )
   #do not run gcc every time because it is relatevely expencive
@@ -513,16 +522,25 @@
  set( X86 true )
  set( ANDROID_NDK_ABI_NAME "x86" )
  set( ANDROID_ARCH_NAME "x86" )
+ set( ANDROID_ARCH_FULLNAME "x86" )
  set( CMAKE_SYSTEM_PROCESSOR "i686" )
+elseif( ANDROID_ABI STREQUAL "mips" )
+ set( MIPS true )
+ set( ANDROID_NDK_ABI_NAME "mips" )
+ set( ANDROID_ARCH_NAME "mips" )
+ set( ANDROID_ARCH_FULLNAME "mipsel" )
+ set( CMAKE_SYSTEM_PROCESSOR "mips" )
 elseif( ANDROID_ABI STREQUAL "armeabi" )
  set( ARMEABI true )
  set( ANDROID_NDK_ABI_NAME "armeabi" )
  set( ANDROID_ARCH_NAME "arm" )
+ set( ANDROID_ARCH_FULLNAME "arm" )
  set( CMAKE_SYSTEM_PROCESSOR "armv5te" )
 elseif( ANDROID_ABI STREQUAL "armeabi-v6 with VFP" )
  set( ARMEABI_V6 true )
  set( ANDROID_NDK_ABI_NAME "armeabi" )
  set( ANDROID_ARCH_NAME "arm" )
+ set( ANDROID_ARCH_FULLNAME "arm" )
  set( CMAKE_SYSTEM_PROCESSOR "armv6" )
  #need always fallback to older platform
  set( ARMEABI true )
@@ -530,17 +548,20 @@
  set( ARMEABI_V7A true )
  set( ANDROID_NDK_ABI_NAME "armeabi-v7a" )
  set( ANDROID_ARCH_NAME "arm" )
+ set( ANDROID_ARCH_FULLNAME "arm" )
  set( CMAKE_SYSTEM_PROCESSOR "armv7-a" )
 elseif( ANDROID_ABI STREQUAL "armeabi-v7a with VFPV3" )
  set( ARMEABI_V7A true )
  set( ANDROID_NDK_ABI_NAME "armeabi-v7a" )
  set( ANDROID_ARCH_NAME "arm" )
+ set( ANDROID_ARCH_FULLNAME "arm" )
  set( CMAKE_SYSTEM_PROCESSOR "armv7-a" )
  set( VFPV3 true )
 elseif( ANDROID_ABI STREQUAL "armeabi-v7a with NEON" )
  set( ARMEABI_V7A true )
  set( ANDROID_NDK_ABI_NAME "armeabi-v7a" )
  set( ANDROID_ARCH_NAME "arm" )
+ set( ANDROID_ARCH_FULLNAME "arm" )
  set( CMAKE_SYSTEM_PROCESSOR "armv7-a" )
  set( VFPV3 true )
  set( NEON true )
@@ -554,10 +575,10 @@
  file( APPEND "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeSystem.cmake" "SET(CMAKE_SYSTEM_PROCESSOR \"${CMAKE_SYSTEM_PROCESSOR}\")\n" )
 endif()

-set( ANDROID_SUPPORTED_ABIS ${ANDROID_SUPPORTED_ABIS_${ANDROID_ARCH_NAME}} CACHE INTERNAL "ANDROID_ABI can be changed only to one of these ABIs. Changing to any other ABI requires to reset cmake cache." )
+set( ANDROID_SUPPORTED_ABIS ${ANDROID_SUPPORTED_ABIS_${ANDROID_ARCH_FULLNAME}} CACHE INTERNAL "ANDROID_ABI can be changed only to one of these ABIs. Changing to any other ABI requires to reset cmake cache." )
 if( CMAKE_VERSION VERSION_GREATER "2.8" )
- list( SORT ANDROID_SUPPORTED_ABIS_${ANDROID_ARCH_NAME} )
- set_property( CACHE ANDROID_ABI PROPERTY STRINGS ${ANDROID_SUPPORTED_ABIS_${ANDROID_ARCH_NAME}} )
+ list( SORT ANDROID_SUPPORTED_ABIS_${ANDROID_ARCH_FULLNAME} )
+ set_property( CACHE ANDROID_ABI PROPERTY STRINGS ${ANDROID_SUPPORTED_ABIS_${ANDROID_ARCH_FULLNAME}} )
 endif()

 if( ANDROID_ARCH_NAME STREQUAL "arm" AND NOT ARMEABI_V6 )
@@ -575,7 +596,7 @@
   message( FATAL_ERROR "Previously selected toolchain \"${ANDROID_TOOLCHAIN_NAME}\" is missing. You need to remove CMakeCache.txt and rerun cmake manually to change the toolchain" )
  endif()
  list( GET __availableToolchainArchs ${__toolchainIdx} __toolchainArch )
- if( NOT __toolchainArch STREQUAL ANDROID_ARCH_NAME )
+ if( NOT __toolchainArch STREQUAL ANDROID_ARCH_FULLNAME )
   message( SEND_ERROR "Previously selected toolchain \"${ANDROID_TOOLCHAIN_NAME}\" is not able to compile binaries for the \"${ANDROID_ARCH_NAME}\" platform." )
  endif()
 else()
@@ -586,7 +607,7 @@
  math( EXPR __availableToolchainsCount "${__availableToolchainsCount}-1" )
  foreach( __idx RANGE ${__availableToolchainsCount} )
   list( GET __availableToolchainArchs ${__idx} __toolchainArch )
-  if( __toolchainArch STREQUAL ANDROID_ARCH_NAME )
+  if( __toolchainArch STREQUAL ANDROID_ARCH_FULLNAME )
    list( GET __availableToolchainCompilerVersions ${__idx} __toolchainVersion )
    if( __toolchainVersion VERSION_GREATER __toolchainMaxVersion )
     set( __toolchainMaxVersion "${__toolchainVersion}" )
@@ -614,7 +635,7 @@
 unset( __availableToolchainCompilerVersions )

 #choose native API level
-__INIT_VARIABLE( ANDROID_NATIVE_API_LEVEL ENV_ANDROID_NATIVE_API_LEVEL ANDROID_API_LEVEL ENV_ANDROID_API_LEVEL ANDROID_DEFAULT_NDK_API_LEVEL_${ANDROID_ARCH_NAME} ANDROID_DEFAULT_NDK_API_LEVEL )
+__INIT_VARIABLE( ANDROID_NATIVE_API_LEVEL ENV_ANDROID_NATIVE_API_LEVEL ANDROID_API_LEVEL ENV_ANDROID_API_LEVEL ANDROID_STANDALONE_TOOLCHAIN_API_LEVEL ANDROID_DEFAULT_NDK_API_LEVEL_${ANDROID_ARCH_NAME} ANDROID_DEFAULT_NDK_API_LEVEL )
 string( REGEX MATCH "[0-9]+" ANDROID_NATIVE_API_LEVEL "${ANDROID_NATIVE_API_LEVEL}" )
 #validate
 list( FIND ANDROID_SUPPORTED_NATIVE_API_LEVELS "${ANDROID_NATIVE_API_LEVEL}" __levelIdx )
@@ -747,13 +768,6 @@
  # NDK also defines -ffunction-sections -funwind-tables but they result in worse OpenCV performance
  set( CMAKE_CXX_FLAGS "-fPIC -Wno-psabi" )
  set( CMAKE_C_FLAGS "-fPIC -Wno-psabi" )
- if( ANDROID_USE_STLPORT )
-  set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-rtti -fno-exceptions" )
-  set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-rtti -fno-exceptions" )
- else()
-  set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -frtti -fexceptions" )
-  set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fexceptions" )
- endif()
  remove_definitions( -D__ARM_ARCH_5__ -D__ARM_ARCH_5T__ -D__ARM_ARCH_5E__ -D__ARM_ARCH_5TE__ )
  add_definitions( -D__ARM_ARCH_5__ -D__ARM_ARCH_5T__ -D__ARM_ARCH_5E__ -D__ARM_ARCH_5TE__ )
  # extra arm-specific flags
@@ -761,16 +775,21 @@
 elseif( X86 )
  set( CMAKE_CXX_FLAGS "-funwind-tables" )
  set( CMAKE_C_FLAGS "-funwind-tables" )
- if( ANDROID_USE_STLPORT )
-  set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-rtti -fno-exceptions" )
-  set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-rtti -fno-exceptions" )
- else()
-  set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -frtti -fexceptions" )
-  set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fexceptions" )
- endif()
+elseif( MIPS )
+ set( CMAKE_CXX_FLAGS "-fpic -Wno-psabi -fno-strict-aliasing -finline-functions -ffunction-sections -funwind-tables -fmessage-length=0 -fno-inline-functions-called-once -fgcse-after-reload -frerun-cse-after-loop -frename-registers" )
+ set( CMAKE_CXX_FLAGS "-fpic -Wno-psabi -fno-strict-aliasing -finline-functions -ffunction-sections -funwind-tables -fmessage-length=0 -fno-inline-functions-called-once -fgcse-after-reload -frerun-cse-after-loop -frename-registers" )
+ set( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -fsigned-char" )
 else()
  set( CMAKE_CXX_FLAGS "" )
  set( CMAKE_C_FLAGS "" )
+endif()
+
+if( ANDROID_USE_STLPORT )
+ set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-rtti -fno-exceptions" )
+ set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-rtti -fno-exceptions" )
+else()
+ set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -frtti -fexceptions" )
+ set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fexceptions" )
 endif()

 #release and debug flags
@@ -796,6 +815,11 @@
  set( CMAKE_C_FLAGS_RELEASE   "-O3 -fstrict-aliasing" )
  set( CMAKE_CXX_FLAGS_DEBUG "-O0 -finline-limit=300" )
  set( CMAKE_C_FLAGS_DEBUG   "-O0 -finline-limit=300" )
+elseif( MIPS )
+ set( CMAKE_CXX_FLAGS_RELEASE "-O3 -funswitch-loops -finline-limit=300" )
+ set( CMAKE_C_FLAGS_RELEASE   "-O3 -funswitch-loops -finline-limit=300" )
+ set( CMAKE_CXX_FLAGS_DEBUG "-O0 -g" )
+ set( CMAKE_C_FLAGS_DEBUG   "-O0 -g" )
 endif()
 set( CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -fomit-frame-pointer -DNDEBUG" )
 set( CMAKE_C_FLAGS_RELEASE   "${CMAKE_C_FLAGS_RELEASE}   -fomit-frame-pointer -DNDEBUG" )
@@ -922,9 +946,15 @@
 set( ANDROID_LINKER_FLAGS "${ANDROID_LINKER_FLAGS}" CACHE INTERNAL "Extra Android linker flags")
 set( CMAKE_CXX_FLAGS           "${ANDROID_CXX_FLAGS} ${CMAKE_CXX_FLAGS}" )
 set( CMAKE_C_FLAGS             "${ANDROID_CXX_FLAGS} ${CMAKE_C_FLAGS}" )
-set( CMAKE_SHARED_LINKER_FLAGS "${ANDROID_LINKER_FLAGS} ${CMAKE_SHARED_LINKER_FLAGS}" )
-set( CMAKE_MODULE_LINKER_FLAGS "${ANDROID_LINKER_FLAGS} ${CMAKE_MODULE_LINKER_FLAGS}" )
-set( CMAKE_EXE_LINKER_FLAGS    "${ANDROID_LINKER_FLAGS} ${CMAKE_EXE_LINKER_FLAGS}" )
+if( MIPS AND BUILD_WITH_ANDROID_NDK )
+ set( CMAKE_SHARED_LINKER_FLAGS "-Wl,-T,${ANDROID_NDK}/toolchains/${ANDROID_TOOLCHAIN_NAME}/mipself.xsc ${ANDROID_LINKER_FLAGS} ${CMAKE_SHARED_LINKER_FLAGS}" )
+ set( CMAKE_MODULE_LINKER_FLAGS "-Wl,-T,${ANDROID_NDK}/toolchains/${ANDROID_TOOLCHAIN_NAME}/mipself.xsc ${ANDROID_LINKER_FLAGS} ${CMAKE_MODULE_LINKER_FLAGS}" )
+ set( CMAKE_EXE_LINKER_FLAGS    "-Wl,-T,${ANDROID_NDK}/toolchains/${ANDROID_TOOLCHAIN_NAME}/mipself.x ${ANDROID_LINKER_FLAGS} ${CMAKE_EXE_LINKER_FLAGS}" )
+else()
+ set( CMAKE_SHARED_LINKER_FLAGS "${ANDROID_LINKER_FLAGS} ${CMAKE_SHARED_LINKER_FLAGS}" )
+ set( CMAKE_MODULE_LINKER_FLAGS "${ANDROID_LINKER_FLAGS} ${CMAKE_MODULE_LINKER_FLAGS}" )
+ set( CMAKE_EXE_LINKER_FLAGS    "${ANDROID_LINKER_FLAGS} ${CMAKE_EXE_LINKER_FLAGS}" )
+endif()

 #set these global flags for cmake client scripts to change behavior
 set( ANDROID True )
@@ -1020,7 +1050,7 @@

 # Variables controlling behavior or set by cmake toolchain:
-#   ANDROID_ABI : "armeabi-v7a" (default), "armeabi", "armeabi-v7a with NEON", "armeabi-v7a with VFPV3", "armeabi-v6 with VFP", "x86"
+#   ANDROID_ABI : "armeabi-v7a" (default), "armeabi", "armeabi-v7a with NEON", "armeabi-v7a with VFPV3", "armeabi-v6 with VFP", "x86", "mips"
 #   ANDROID_NATIVE_API_LEVEL : 3,4,5,8,9,14 (depends on NDK version)
 #   ANDROID_SET_OBSOLETE_VARIABLES : ON/OFF
 #   ANDROID_USE_STLPORT : OFF/ON - EXPERIMENTAL!!!
@@ -1054,7 +1084,7 @@
 #   BUILD_WITH_STANDALONE_TOOLCHAIN : TRUE if standalone toolchain is used
 #   ANDROID_NDK_HOST_SYSTEM_NAME : "windows", "linux-x86" or "darwin-x86" depending on host platform
 #   ANDROID_NDK_ABI_NAME : "armeabi", "armeabi-v7a" or "x86" depending on ANDROID_ABI
-#   ANDROID_ARCH_NAME : "arm" or "x86" depending on ANDROID_ABI
+#   ANDROID_ARCH_NAME : "arm" or "x86" or "mips" depending on ANDROID_ABI
 #   TOOL_OS_SUFFIX : "" or ".exe" depending on host platform
 #   ANDROID_SYSROOT : path to the compiler sysroot
 #   ANDROID_SYSTEM_INCLUDE_DIRS


[FIX] Fixing word size check in SeqAnCtdSetup.cmake.

git-svn-id: a7f2a8f7432d210e972fb03898013d213e2b549b@13602 e6417c60-b987-48fd-844e-b20f0fcc1017

--- util/cmake/SeqAnCtdSetup.cmake
+++ util/cmake/SeqAnCtdSetup.cmake
@@ -139,7 +139,7 @@
   message (FATAL_ERROR "Unknown platform name ${SEQAN_PLATFORM}")
 endif ()

-if (SEQAN_SYSTEM_PROCESSOR MATCHES ".*64.*")
+if (CMAKE_SIZEOF_VOID_P EQUAL 8)
   set (SEQAN_SYSTEM_WORDSIZE "64")
 else ()
   set (SEQAN_SYSTEM_WORDSIZE "32")


[BUILD] reverse e80c156c18699fe3b82c6d9302fe54c1462eca89

--- util/cmake/SeqAnCtdSetup.cmake
+++ util/cmake/SeqAnCtdSetup.cmake
@@ -134,7 +134,7 @@
 # Create the payload binary ZIP file.
 if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
   set (SEQAN_PLATFORM "lnx")
-elseif (CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
+elseif (CMAKE_SYSTEM_NAME STREQUAL "FreeBSd")
   set (SEQAN_PLATFORM "lnx")
 elseif (CMAKE_SYSTEM_NAME STREQUAL "Windows")
   set (SEQAN_PLATFORM "win")


Fixed test_results removal logic to handle the case where compilation of a test failed, #1701

--- core/rosbuild/public.cmake
+++ core/rosbuild/public.cmake
@@ -232,9 +232,12 @@
   # conditional to ignore failures (most often happens when a stale NFS
   # handle lingers in the test results directory), because CMake doesn't
   # seem to be able to do it.
-  add_custom_command(TARGET tests
-                     PRE_BUILD
-                     COMMAND if ! rm -rf $ENV{ROS_ROOT}/test/test_results/${PROJECT_NAME}\; then echo "WARNING: failed to remove test-results directory"\; fi)
+  add_custom_target(clean-test-results
+                    if ! rm -rf $ENV{ROS_ROOT}/test/test_results/${PROJECT_NAME}\; then echo "WARNING: failed to remove test-results directory"\; fi)
+  # Make the tests target depend on clean-test-results, which will ensure
+  # that test results are deleted before we try to build tests, and thus
+  # before we try to run tests.
+  add_dependencies(tests clean-test-results)
   # The 'test-future' target runs the future tests
   add_custom_target(test-future)

@@ -574,6 +577,10 @@
   # Redeclaration of target is to workaround bug in 2.4.6
   add_custom_target(test)
   add_dependencies(test pyunit_${_testname})
+  # Register check for test output
+  # Can't do this, because the pyunit tests generate their own name
+  # internally. TODO
+  #_rosbuild_check_rostest_xml_result(pyunit_${_testname} $ENV{ROS_ROOT}/test/test_results/${PROJECT_NAME}/${_testname}.xml)
 endmacro(rosbuild_add_pyunit)

 # A helper to run Python unit tests that are expected to fail for the near


Update o2.pc.cmake to include '-lo2'

Update o2.pc.cmake to include '-lo2'

Using @CMAKE_LIBRARY_PATH@ in Libs didn't make sense, since it generates
a "Semicolon-separated list of directories...". Hard code it to -lo2
instead since it works for both shared and static libraries, and we have
no configuration setting to change the name of the library.

--- o2.pc.cmake
+++ o2.pc.cmake
@@ -7,4 +7,4 @@
 Version: @PROJECT_VERSION@

 Cflags: -I${includedir} @CMAKE_INCLUDE_PATH@
-Libs: -L${libdir} @CMAKE_LIBRARY_PATH@
+Libs: -L${libdir} -lo2