Moved roslang inclusion to inside rosbuild_genmsg and rosbuild_gensrv, to avoid running the client code unnecessarily, and to allow later calls to rosbuild_add_generated_msgs and friends, #2968.

--- core/rosbuild/public.cmake
+++ core/rosbuild/public.cmake
@@ -2,6 +2,10 @@
 # we can later catch out-of-order calls to macros that must be called prior
 # to rosbuild_init(), related to #1487.
 set(ROSBUILD_init_called 0)
+
+# Set a flag to indicate that roslang.cmake has not been included, so we
+# don't it more than once.
+set(ROSBUILD_roslang_included 0)

 # Use this package to get add_file_dependencies()
 include(AddFileDependencies)
@@ -351,17 +355,6 @@
   # must reference as a dependency of msg/srv generation
   set(gendeps_exe ${roslib_path}/scripts/gendeps)

-  # If the roslang package is available, pull in cmake/roslang.cmake from
-  # there; it will in turn include message-generation logic from client
-  # libs.  This is to allow roslang to live outside the ros stack, #3108.
-  rosbuild_find_ros_package("roslang")
-  if(roslang_PACKAGE_PATH)
-    # Can't use rosbuild_include() here, because there's no guarantee that
-    # the package we're building depends on roslang (in fact, it probably
-    # doesn't.
-    include("${roslang_PACKAGE_PATH}/cmake/roslang.cmake")
-  endif(roslang_PACKAGE_PATH)
-
   # Collect cmake fragments exported by packages that depend on
   # rosbuild.  This behavior is deprecated, in favor of using
   # rosbuild_include() to explicitly include cmake code from other packages.
@@ -769,10 +762,23 @@

 # gensrv processes srv/*.srv files into language-specific source files
 macro(rosbuild_gensrv)
-  # roslang_PACKAGE_PATH was set in rosbuild_init(), if roslang was found
-  if(NOT roslang_PACKAGE_PATH)
-    _rosbuild_warn("rosbuild_gensrv() was called, but the roslang package cannot be found. Service generation will NOT occur")
-  endif(NOT roslang_PACKAGE_PATH)
+  # If the roslang package is available, pull in cmake/roslang.cmake from
+  # there; it will in turn include message-generation logic from client
+  # libs.  This is to allow roslang to live outside the ros stack, #3108.
+  rosbuild_find_ros_package("roslang")
+  if(roslang_PACKAGE_PATH)
+    # Check whether we've included roslang already
+    if(NOT ROSBUILD_roslang_included)
+      # Can't use rosbuild_include() here, because there's no guarantee that
+      # the package we're building depends on roslang (in fact, it probably
+      # doesn't.
+      include("${roslang_PACKAGE_PATH}/cmake/roslang.cmake")
+      set(ROSBUILD_roslang_included 1)
+    endif(NOT ROSBUILD_roslang_included)
+  else(roslang_PACKAGE_PATH)
+    _rosbuild_warn("rosbuild_genmsg() was called, but the roslang package cannot be found.  Message generation will NOT occur")
+  endif(roslang_PACKAGE_PATH)
+
   # Check whether there are any .srv files
   rosbuild_get_srvs(_srvlist)
   if(NOT _srvlist)
@@ -804,10 +810,23 @@

 # genmsg processes msg/*.msg files into language-specific source files
 macro(rosbuild_genmsg)
-  # roslang_PACKAGE_PATH was set in rosbuild_init(), if roslang was found
-  if(NOT roslang_PACKAGE_PATH)
+  # If the roslang package is available, pull in cmake/roslang.cmake from
+  # there; it will in turn include message-generation logic from client
+  # libs.  This is to allow roslang to live outside the ros stack, #3108.
+  rosbuild_find_ros_package("roslang")
+  if(roslang_PACKAGE_PATH)
+    # Check whether we've included roslang already
+    if(NOT ROSBUILD_roslang_included)
+      # Can't use rosbuild_include() here, because there's no guarantee that
+      # the package we're building depends on roslang (in fact, it probably
+      # doesn't.
+      include("${roslang_PACKAGE_PATH}/cmake/roslang.cmake")
+      set(ROSBUILD_roslang_included 1)
+    endif(NOT ROSBUILD_roslang_included)
+  else(roslang_PACKAGE_PATH)
     _rosbuild_warn("rosbuild_genmsg() was called, but the roslang package cannot be found.  Message generation will NOT occur")
-  endif(NOT roslang_PACKAGE_PATH)
+  endif(roslang_PACKAGE_PATH)
+
   # Check whether there are any .srv files
   rosbuild_get_msgs(_msglist)
   if(NOT _msglist)


Include Coverage as allowed build type.

Include Coverage as allowed build type.

--- cmake/ConfigSafeGuards.cmake
+++ cmake/ConfigSafeGuards.cmake
@@ -14,6 +14,7 @@
 if(    NOT cmake_build_type_tolower STREQUAL "debug"
    AND NOT cmake_build_type_tolower STREQUAL "release"
    AND NOT cmake_build_type_tolower STREQUAL "profile"
-   AND NOT cmake_build_type_tolower STREQUAL "relwithdebinfo")
-      message(FATAL_ERROR "Unknown build type \"${CMAKE_BUILD_TYPE}\". Allowed values are Debug, Release, Profile, RelWithDebInfo (case-insensitive).")
+   AND NOT cmake_build_type_tolower STREQUAL "relwithdebinfo"
+   AND NOT cmake_build_type_tolower STREQUAL "coverage")
+      message(FATAL_ERROR "Unknown build type \"${CMAKE_BUILD_TYPE}\". Allowed values are Debug, Coverage, Release, Profile, RelWithDebInfo (case-insensitive).")
 endif()


Update cmake build scripts.

Update cmake build scripts.

--- cmake/LuaNativeObjects.cmake
+++ cmake/LuaNativeObjects.cmake
@@ -6,6 +6,9 @@
 				"Directory to LuaNativeObjects bindings generator.")
 set(USE_PRE_GENERATED_BINDINGS TRUE CACHE BOOL
 				"Set this to FALSE to re-generate bindings using LuaNativeObjects")
+
+set(GENERATE_LUADOCS TRUE CACHE BOOL
+				"Set this to FALSE to avoid generation of docs using LuaDoc")

 macro(GenLuaNativeObjects _src_files_var)
 	set(_new_src_files)
@@ -20,14 +23,16 @@
 			)
 			set_source_files_properties(${_src_file_out} PROPERTIES GENERATED TRUE)
 			set_source_files_properties(${_ffi_file_out} PROPERTIES GENERATED TRUE)
-			string(REGEX REPLACE ".nobj.lua" "" _doc_base ${_src_file})
-			string(REGEX REPLACE ".nobj.lua" ".luadoc" _doc_file_out ${_src_file})
-			add_custom_target(${_doc_file_out} ALL
-				COMMAND lua ${LUA_NATIVE_OBJECTS_PATH}/native_objects.lua -outpath docs -gen luadoc ${_src_file}
-				COMMAND luadoc -nofiles -d docs docs
-				WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
-				DEPENDS ${_src_file}
-			)
+			if (${GENERATE_LUADOCS})
+				string(REGEX REPLACE ".nobj.lua" "" _doc_base ${_src_file})
+				string(REGEX REPLACE ".nobj.lua" ".luadoc" _doc_file_out ${_src_file})
+				add_custom_target(${_doc_file_out} ALL
+					COMMAND lua ${LUA_NATIVE_OBJECTS_PATH}/native_objects.lua -outpath docs -gen luadoc ${_src_file}
+					COMMAND luadoc -nofiles -d docs docs
+					WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+					DEPENDS ${_src_file}
+				)
+			endif()
 			set_source_files_properties(${_doc_file_out} PROPERTIES GENERATED TRUE)
 			set(_new_src_files ${_new_src_files} ${_src_file_out})
 		else(_src_file MATCHES ".nobj.lua")


Specify component for every library type

--- cmake/MyPackageLibrary.cmake
+++ cmake/MyPackageLibrary.cmake
@@ -84,8 +84,16 @@
       TARGET_INCLUDE_DIRECTORIES(${_target} ${_include_directory_scope} ${_include_directory})
     ENDFOREACH ()
   ENDFOREACH ()
-  INSTALL (TARGETS ${PROJECT_NAME}        RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib COMPONENT DynamicLibraryComponent)
-  INSTALL (TARGETS ${PROJECT_NAME}_static RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib COMPONENT StaticLibraryComponent)
+  INSTALL (TARGETS ${PROJECT_NAME}
+    RUNTIME DESTINATION bin COMPONENT DynamicLibraryComponent
+    LIBRARY DESTINATION lib COMPONENT DynamicLibraryComponent
+    ARCHIVE DESTINATION lib COMPONENT DynamicLibraryComponent
+    )
+  INSTALL (TARGETS ${PROJECT_NAME}_static
+    RUNTIME DESTINATION bin COMPONENT StaticLibraryComponent
+    LIBRARY DESTINATION lib COMPONENT StaticLibraryComponent
+    ARCHIVE DESTINATION lib COMPONENT StaticLibraryComponent
+    )
   SET (_HAVE_DYNAMICLIBRARYCOMPONENT TRUE CACHE INTERNAL "Have DynamicLibraryComponent" FORCE)
   SET (_HAVE_STATICLIBRARYCOMPONENT TRUE CACHE INTERNAL "Have StaticLibraryComponent" FORCE)
   #


compute capability 8.6      - CC for RTX3090, RTX3080 and RTX3070

--- cmake/OpenCVDetectCUDA.cmake
+++ cmake/OpenCVDetectCUDA.cmake
@@ -90,7 +90,7 @@
   set(_arch_pascal  "6.0;6.1")
   set(_arch_volta   "7.0")
   set(_arch_turing  "7.5")
-  set(_arch_ampere  "8.0")
+  set(_arch_ampere  "8.0;8.6")
   if(NOT CMAKE_CROSSCOMPILING)
     list(APPEND _generations "Auto")
   endif()


CMake: properly define dependencies in cppcheck targets

--- cmake/clang-cpp-checks.cmake
+++ cmake/clang-cpp-checks.cmake
@@ -107,7 +107,6 @@
     IF(CPPCHECK_HTML)
         ADD_CUSTOM_TARGET(
             cppcheck-html
-            DEPENDS cppcheck
             COMMAND ${CPPCHECK_HTML}
             --title=${CMAKE_PROJECT_NAME}
             --file=${CMAKE_BINARY_DIR}/cppcheck_results.xml
@@ -115,5 +114,6 @@
             --source-dir=${CMAKE_SOURCE_DIR}
             COMMENT "Convert cppcheck report to HTML output"
         )
+        ADD_DEPENDENCIES(cppcheck-html cppcheck)
     ENDIF()
 ENDIF()


[cmake] Follow LLVM's lead in creating exported tool targets for clang tools.

This is needed by downstream projects such as swift to get proper cmake
dependency information for LLVM/Clang targets.

A few months ago I added support for exporting this information for Clang
libraries. In order to be incremental, I did not add support for exporting clang
tools as well at that time. Now such support is needed, so I am committing this
incremental code.

git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@284658 91177308-0d34-0410-b5e6-96231b3b80d8
(cherry picked from commit 57c31dd611eab528c5d16c7d721e44697bb9e460)

--- cmake/modules/AddClang.cmake
+++ cmake/modules/AddClang.cmake
@@ -139,6 +139,7 @@
         -DCMAKE_INSTALL_COMPONENT=${name}
         -P "${CMAKE_BINARY_DIR}/cmake_install.cmake")
     endif()
+    set_property(GLOBAL APPEND PROPERTY CLANG_EXPORTS ${name})
   endif()
 endmacro()


build: prevent `FILE_DEPENDS` from being used

The `FILE_DEPENDS` option is used in exactly one location: swiftCore.
This prevention sets the groundwork for removing the option.
Dependencies should be tracked at the target level.

--- cmake/modules/AddSwift.cmake
+++ cmake/modules/AddSwift.cmake
@@ -1541,6 +1541,9 @@
   if(ASHL_DEPENDS)
     message(SEND_ERROR "library ${name} is using DEPENDS parameter which is deprecated.  Please use add_dependencies instead")
   endif()
+  if(ASHL_FILE_DEPENDS)
+    message(SEND_ERROR "library ${name} is using FILE_DEPENDS parameter which is deprecated.")
+  endif()
   if(ASHL_LINK_LIBRARIES)
     message(SEND_ERROR "library ${name} is using LINK_LIBRARIES parameter which is deprecated.  Please use target_link_libraries instead")
   endif()
@@ -1560,7 +1563,6 @@
     SDK ${SWIFT_HOST_VARIANT_SDK}
     ARCHITECTURE ${SWIFT_HOST_VARIANT_ARCH}
     LLVM_LINK_COMPONENTS ${ASHL_LLVM_LINK_COMPONENTS}
-    FILE_DEPENDS ${ASHL_FILE_DEPENDS}
     INSTALL_IN_COMPONENT "dev"
     )


build: workaround cross-compilation for Windows

When cross-compiling the Windows standard library in release mode, we
would get undefined symbols due to LLVM invoking
`add_definitions(-D_DEBUG)`.  This would change the behaviour of certain
functions from MSVCRT resulting in undefined symbols.  Scrub out the
unwanted `-D_DEBUG`.

--- cmake/modules/AddSwift.cmake
+++ cmake/modules/AddSwift.cmake
@@ -273,6 +273,13 @@
     # RTTI as well.  This requires a newer SDK though and we do not have
     # guarantees on the SDK version currently.
     list(APPEND result "-D_HAS_STATIC_RTTI=0")
+
+    # NOTE(compnerd) workaround LLVM invoking `add_definitions(-D_DEBUG)` which
+    # causes failures for the runtime library when cross-compiling due to
+    # undefined symbols from the standard library.
+    if(NOT CMAKE_BUILD_TYPE STREQUAL Debug)
+      list(APPEND result "-U_DEBUG")
+    endif()
   endif()

   if(CFLAGS_ENABLE_ASSERTIONS)


[cmake] don't f*** with the lib suffixes, fixes fftw discovery

--- cmake/modules/FindFFTW.cmake
+++ cmake/modules/FindFFTW.cmake
@@ -31,12 +31,6 @@

 #Check whether to search static or dynamic libs
 set( CMAKE_FIND_LIBRARY_SUFFIXES_SAV ${CMAKE_FIND_LIBRARY_SUFFIXES} )
-
-if( ${FFTW_USE_STATIC_LIBS} )
-  set( CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_STATIC_LIBRARY_SUFFIX} )
-else()
-  set( CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_SHARED_LIBRARY_SUFFIX} )
-endif()

 if( FFTW_ROOT )


cmake: FindRuby for Ruby 1.9

cmake: FindRuby for Ruby 1.9

--- cmake/modules/FindRuby.cmake
+++ cmake/modules/FindRuby.cmake
@@ -22,6 +22,15 @@
 #   RUBY_LIBRUBYARG=`$RUBY -r rbconfig -e 'printf("%s",RbConfig::CONFIG@<:@"LIBRUBYARG_SHARED"@:>@)'`

 FIND_PROGRAM(RUBY_EXECUTABLE NAMES ruby ruby19 ruby1.8 ruby18 )
+
+EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print RbConfig::CONFIG['MAJOR']"
+   OUTPUT_VARIABLE RUBY_VERSION_MAJOR)
+
+EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print RbConfig::CONFIG['MINOR']"
+   OUTPUT_VARIABLE RUBY_VERSION_MINOR)
+
+EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print RbConfig::CONFIG['TEENY']"
+   OUTPUT_VARIABLE RUBY_VERSION_PATCH)

 EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print RbConfig::CONFIG['archdir']"
    OUTPUT_VARIABLE RUBY_ARCH_DIR)


Update qpp_dependencies.cmake

Update qpp_dependencies.cmake

--- cmake/qpp_dependencies.cmake
+++ cmake/qpp_dependencies.cmake
@@ -154,6 +154,7 @@
     # Disable spurious Eigen warnings with MSVC (warning STL4007)
     add_compile_definitions(_SILENCE_CXX17_ADAPTOR_TYPEDEFS_DEPRECATION_WARNING)
     add_compile_options(-bigobj)
+    add_definitions(-DNOMINMAX)
 endif ()

 #### MinGW or Cygwin have issues with object files that are too large


Fix backwards compatibility logic for FindMPI

--- cmake/upstream/FindMPI.cmake
+++ cmake/upstream/FindMPI.cmake
@@ -1144,7 +1144,7 @@
     add_library(MPI::MPI_${LANG} INTERFACE IMPORTED)
   endif()

-  if(NOT CMAKE_VERSION VERSION_LESS 3.11)
+  if(NOT CMAKE_VERSION VERSION_LESS 3.12)
     # When this is consumed for compiling CUDA, use '-Xcompiler' to wrap '-pthread'.
     string(REPLACE "-pthread" "$<$<COMPILE_LANGUAGE:CUDA>:SHELL:-Xcompiler >-pthread"
       _MPI_${LANG}_COMPILE_OPTIONS "${MPI_${LANG}_COMPILE_OPTIONS}")


Fix build break due to cyrus sasl version not being set properly

--- cmake_modules/FindSasl.cmake
+++ cmake_modules/FindSasl.cmake
@@ -4,7 +4,7 @@
 #  SASL_STATIC_LIBRARY, the library to use.
 #  SASL_FOUND, If false, do not try to use.

-set(THIRDPARTY_SASL thirdparty/cyrus-sasl-${IMPALA_CYRUS_SASL_VERSION})
+set(THIRDPARTY_SASL thirdparty/cyrus-sasl-$ENV{IMPALA_CYRUS_SASL_VERSION})

 if (DEFINED ENV{PIC_LIB_PATH})
   set(SASL_SEARCH_LIB_PATH $ENV{PIC_LIB_PATH}/lib)
@@ -12,10 +12,10 @@
 else ()
   set (THIRDPARTY ${CMAKE_SOURCE_DIR}/thirdparty)
   set(SASL_SEARCH_LIB_PATH
-    ${THIRDPARTY}/cyrus-sasl-${IMPALA_CYRUS_SASL_VERSION}/build/lib
+    ${THIRDPARTY}/cyrus-sasl-$ENV{IMPALA_CYRUS_SASL_VERSION}/build/lib
   )
   set(SASL_INCLUDE_DIR
-    ${THIRDPARTY}/cyrus-sasl-${IMPALA_CYRUS_SASL_VERSION}/build/include
+    ${THIRDPARTY}/cyrus-sasl-$ENV{IMPALA_CYRUS_SASL_VERSION}/build/include
   )
 endif ()


Fix CMake error

Fix CMake error

At least, with CMake 3.8

cc: da39a3ee5e6b4b0d3255bfef95601890afd80709@LisGein

--- cmakemodules/script_qt.cmake
+++ cmakemodules/script_qt.cmake
@@ -14,7 +14,7 @@
 		list(APPEND Qt5_COMPONENTS_LIBS "")

 		set(location_type LOCATION_RELEASE)
-		if (${CMAKE_BUILD_TYPE} STREQUAL "Debug")
+		if ("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
 			set(location_type LOCATION_DEBUG)
 		endif()


deleted the linux and mac cpack dependancies

--- CPack.cmake
+++ CPack.cmake
@@ -15,9 +15,9 @@
 ENDIF (WIN32 AND NOT UNIX)

 IF (APPLE)
-  INCLUDE(OSX.cpack)
+
 ENDIF (APPLE)

 IF (UNIX AND NOT APPLE)
-  INCLUDE(LINUX.cpack)
+
 ENDIF (UNIX AND NOT APPLE)


Added toolchain support to other buildsteps.

--- run_ctest.cmake
+++ run_ctest.cmake
@@ -267,7 +267,11 @@
     ctest_start(Continuous)
     ctest_update()
     ctest_read_custom_files(${CTEST_SOURCE_DIRECTORY})
+if(DEFINED ENV{CMAKE_TOOLCHAIN_FILE})
+    ctest_configure(OPTIONS "-DCI_FLAGS=${CC_COVERAGE_FLAGS} -DCMAKE_TOOLCHAIN_FILE=$ENV{CMAKE_TOOLCHAIN_FILE}")
+else()
     ctest_configure(OPTIONS "-DCI_FLAGS=${CC_COVERAGE_FLAGS}")
+endif()
     ctest_build()
     ctest_test()
     if(CC_NAME STREQUAL "msvc")
@@ -304,7 +308,11 @@
     if(CC_NAME STREQUAL "msvc")
         ctest_configure(OPTIONS "-DBUILD_TESTING=Off -DCI_FLAGS=/analyze")
     elseif(CC_NAME STREQUAL "clang")
-        ctest_configure(OPTIONS "-DBUILD_TESTING=Off -DCI_FLAGS=--analyze")
+        if(DEFINED ENV{CMAKE_TOOLCHAIN_FILE})
+            ctest_configure(OPTIONS "-DBUILD_TESTING=Off -DCI_FLAGS=--analyze -DCMAKE_TOOLCHAIN_FILE=$ENV{CMAKE_TOOLCHAIN_FILE}")
+        else()
+            ctest_configure(OPTIONS "-DBUILD_TESTING=Off -DCI_FLAGS=--analyze")
+        endif()
     endif()
     ctest_build()
     ctest_submit(PARTS Start Update Configure Build Upload Submit)
@@ -320,10 +328,8 @@
     ctest_start(Continuous)
     ctest_update()
     ctest_read_custom_files(${CTEST_SOURCE_DIRECTORY})
-    if(CC_NAME STREQUAL "mingw" AND CC_ARCH STREQUAL "x86_64")
-        ctest_configure(OPTIONS "-DCMAKE_TOOLCHAIN_FILE=ci-tools/toolchain/toolchain-x86_64-w64-mingw32.cmake")
-    elseif(CC_NAME STREQUAL "mingw" AND CC_ARCH STREQUAL "x86")
-        ctest_configure(OPTIONS "-DCMAKE_TOOLCHAIN_FILE=ci-tools/toolchain/toolchain-i686-w64-mingw32.cmake")
+    if(DEFINED ENV{CMAKE_TOOLCHAIN_FILE})
+        ctest_configure(OPTIONS "-DCMAKE_TOOLCHAIN_FILE=$ENV{CMAKE_TOOLCHAIN_FILE}")
     else()
         ctest_configure()
     endif()
@@ -378,7 +384,11 @@
     ctest_start(Continuous)
     ctest_update()
     ctest_read_custom_files(${CTEST_SOURCE_DIRECTORY})
-    ctest_configure(OPTIONS "-DCI_FLAGS=${CC_ASAN_FLAGS} -fsanitize=address")
+    if(DEFINED ENV{CMAKE_TOOLCHAIN_FILE})
+        ctest_configure(OPTIONS "-DCI_FLAGS=${CC_ASAN_FLAGS} -fsanitize=address -DCMAKE_TOOLCHAIN_FILE=$ENV{CMAKE_TOOLCHAIN_FILE}")
+    else()
+        ctest_configure(OPTIONS "-DCI_FLAGS=${CC_ASAN_FLAGS} -fsanitize=address")
+    endif()
     ctest_build()
     ctest_test()
     ctest_memcheck()
@@ -401,7 +411,11 @@
     ctest_start(Continuous)
     ctest_update()
     ctest_read_custom_files(${CTEST_SOURCE_DIRECTORY})
-    ctest_configure(OPTIONS "-DCI_FLAGS=-fsanitize=memory -fsanitize-memory-track-origins")
+    if(DEFINED ENV{CMAKE_TOOLCHAIN_FILE})
+        ctest_configure(OPTIONS "-DCI_FLAGS=-fsanitize=memory -fsanitize-memory-track-origins -DCMAKE_TOOLCHAIN_FILE=$ENV{CMAKE_TOOLCHAIN_FILE}")
+    else()
+        ctest_configure(OPTIONS "-DCI_FLAGS=-fsanitize=memory -fsanitize-memory-track-origins")
+    endif()
     ctest_build()
     ctest_test()
     ctest_memcheck()
@@ -435,7 +449,11 @@
     ctest_start(Continuous)
     ctest_update()
     ctest_read_custom_files(${CTEST_SOURCE_DIRECTORY})
-    ctest_configure(OPTIONS "-DCI_FLAGS=${CC_TSAN_FLAGS} -fsanitize=thread")
+    if(DEFINED ENV{CMAKE_TOOLCHAIN_FILE})
+        ctest_configure(OPTIONS "-DCI_FLAGS=${CC_TSAN_FLAGS} -fsanitize=thread -DCMAKE_TOOLCHAIN_FILE=$ENV{CMAKE_TOOLCHAIN_FILE}")
+    else()
+        ctest_configure(OPTIONS "-DCI_FLAGS=${CC_TSAN_FLAGS} -fsanitize=thread")
+    endif()
     ctest_build()
     ctest_test()
     ctest_memcheck()
@@ -460,7 +478,11 @@
     ctest_start(Continuous)
     ctest_update()
     ctest_read_custom_files(${CTEST_SOURCE_DIRECTORY})
-    ctest_configure(OPTIONS "-DCI_FLAGS=${CC_UBSAN_FLAGS}")
+    if(DEFINED ENV{CMAKE_TOOLCHAIN_FILE})
+        ctest_configure(OPTIONS "-DCI_FLAGS=${CC_UBSAN_FLAGS} -DCMAKE_TOOLCHAIN_FILE=$ENV{CMAKE_TOOLCHAIN_FILE}")
+    else()
+        ctest_configure(OPTIONS "-DCI_FLAGS=${CC_UBSAN_FLAGS}")
+    endif()
     ctest_build()
     ctest_test()
     ctest_memcheck()


Adding support for easybuild

Adding support for easybuild

Former-commit-id: f26355ba4eadbea0f8f77b48473590f61cb28c7d

--- cmake-modules/FindPackageHDF5.cmake
+++ cmake-modules/FindPackageHDF5.cmake
@@ -41,12 +41,12 @@

 # To print all variables, use the code below:
 ##
-get_cmake_property(_variableNames VARIABLES)
-foreach (_variableName ${_variableNames})
-    if("${_variableName}" MATCHES "HDF5" OR "${_variableName}" MATCHES "hdf5" OR "${_variableName}" MATCHES "h5")
-        message(STATUS "${_variableName}=${${_variableName}}")
-    endif()
-endforeach()
+#get_cmake_property(_variableNames VARIABLES)
+#foreach (_variableName ${_variableNames})
+#    if("${_variableName}" MATCHES "HDF5" OR "${_variableName}" MATCHES "hdf5" OR "${_variableName}" MATCHES "h5")
+#        message(STATUS "${_variableName}=${${_variableName}}")
+#    endif()
+#endforeach()

 if(HDF5_FOUND)


oe-sdk_cross.cmake: 'make install' now targets oe sysroot

Signed-off-by: Henry Bruce <57ea958cad66de244404958c9a01f7a4ad51b29e@intel.com>
Signed-off-by: Brendan Le Foll <3e0e8c4069934e8b47d99704927a85c66c0ceb33@intel.com>

--- cmake/Toolchains/oe-sdk_cross.cmake
+++ cmake/Toolchains/oe-sdk_cross.cmake
@@ -13,6 +13,7 @@
 set( CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER )
 set( CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY )
 set( CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY )
-set ( ORC_INCLUDE_DIRS $ENV{OECORE_TARGET_SYSROOT}/usr/include/orc-0.4 )
-set ( ORC_LIBRARY_DIRS $ENV{OECORE_TARGET_SYSROOT}/usr/lib )
+set( CMAKE_INSTALL_PREFIX $ENV{OECORE_TARGET_SYSROOT}/usr CACHE STRING "" FORCE)
+set( ORC_INCLUDE_DIRS $ENV{OECORE_TARGET_SYSROOT}/usr/include/orc-0.4 )
+set( ORC_LIBRARY_DIRS $ENV{OECORE_TARGET_SYSROOT}/usr/lib )


hunter_download: beautify output

hunter_download: beautify output

--- cmake/modules/hunter_download.cmake
+++ cmake/modules/hunter_download.cmake
@@ -220,7 +220,7 @@
   if(HUNTER_PACKAGE_COMPONENT)
     set(
         build_message
-        "${build_message} (component: ${HUNTER_PACKAGE_COMPONENT}"
+        "${build_message} (component: ${HUNTER_PACKAGE_COMPONENT})"
     )
   endif()
   hunter_status_print("${build_message}")


STYLE: simplify ImportGDAL

STYLE: simplify ImportGDAL

--- CMake/ImportGdal.cmake
+++ CMake/ImportGdal.cmake
@@ -11,8 +11,7 @@
   MARK_AS_ADVANCED(GDAL_CONFIG)

   IF (NOT GDAL_FOUND)
-     MESSAGE(FATAL_ERROR
-             "Cannot find GDAL. Set GDAL_INCLUDE_DIR and GDAL_LIBRARY")
+     MESSAGE(FATAL_ERROR "Cannot find GDAL. Set GDAL_INCLUDE_DIR and GDAL_LIBRARY")
   ENDIF(NOT GDAL_FOUND)

   MESSAGE(STATUS "  GDAL includes : ${GDAL_INCLUDE_DIR}")
@@ -20,8 +19,7 @@

   IF(UNIX)
     IF (NOT GDAL_CONFIG)
-      MESSAGE(FATAL_ERROR
-              "Cannot find gdal-config. Set GDAL_CONFIG")
+      MESSAGE(FATAL_ERROR "Cannot find gdal-config. Set GDAL_CONFIG")
     ENDIF(NOT GDAL_FOUND)

     EXECUTE_PROCESS(COMMAND ${GDAL_CONFIG} --version


Fix ASan build when folly is embedded as a submodule (#960)

Summary:
When folly is used as a submodule, CMAKE_SOURCE_DIR
will point to the top-level repository, resulting
in set_source_files_properties not taking effect
when compiling with ASan.

Replacing CMAKE_SOURCE_DIR with PROJECT_SOURCE_DIR points
cmake to the intended file.
Pull Request resolved: https://github.com/facebook/folly/pull/960

Reviewed By: yfeldblum

Differential Revision: D12943633

Pulled By: Orvid

fbshipit-source-id: a73560c5578062282f38dc3ff6c7a3364fb6cf6e

--- CMake/folly-deps.cmake
+++ CMake/folly-deps.cmake
@@ -189,7 +189,7 @@
     # sanitizer, but even so, gcc fails to compile them for some reason when
     # sanitization is enabled on the compile line.
     set_source_files_properties(
-      "${CMAKE_SOURCE_DIR}/folly/detail/Sse.cpp"
+      "${PROJECT_SOURCE_DIR}/folly/detail/Sse.cpp"
       PROPERTIES COMPILE_FLAGS -fno-sanitize=address,undefined
     )
   elseif ("${CMAKE_CXX_COMPILER_ID}" MATCHES Clang)


Force the READ_EXTERNAL_STORAGE permission for debug builds.

This lets us check, on all systems for sdcard/wait-for-debugger.txt

Change-Id: Ie89fdfb10abfdad16211cad79afe9af41a5397d6
Reviewed-on: https://wn-project.dnsalias.net/gerrit/264
Reviewed-by: Devon Powell <bef84a74f4a3947934cc58306a6aae518eaf1936@gmail.com>
Try: Devon Powell <bef84a74f4a3947934cc58306a6aae518eaf1936@gmail.com>
Tested-by: WNBot <efa0942020584fb66fb8bea377b59e48fa0f85ef@gmail.com>

--- Overlays/Posix/Overlays/Android/cmake/build_apk.cmake
+++ Overlays/Posix/Overlays/Android/cmake/build_apk.cmake
@@ -96,6 +96,14 @@
   set(WN_APK_LOCATION ${WN_TARGET_DIR}/bin/${WN_APK_NAME})

   get_target_property(PERMISSIONS ${PARSED_ARGS_TARGET} WN_ANDROID_PERMISSIONS)
+  if (CMAKE_BUILD_TYPE STREQUAL "Debug")
+    if (NOT PERMISSIONS)
+      set(PERMISSIONS "READ_EXTERNAL_STORAGE")
+    else()
+      list(APPEND PERMISSIONS "READ_EXTERNAL_STORAGE")
+    endif()
+  endif()
+
   if (PERMISSIONS)
     afix(APP_PERMISSIONS
       "      <uses-permission android:name=\"android.permission."


Bring in fix for install rules, .pyc files with Python 3

--- versions.cmake
+++ versions.cmake
@@ -80,7 +80,7 @@
   set(_paraview_revision "master")
 else()
   # Test the revision with OpenGL2 rendering before updating, update often!
-  set(_paraview_revision "8b6579f108a35e7cf18ccb6d19381e3256f66cd1")
+  set(_paraview_revision "b5609417888ff509a65a49f35af864992647f807")
 endif()
 add_revision(paraview
   GIT_REPOSITORY "https://gitlab.kitware.com/paraview/paraview.git"


Move ParaView forward to avoid Qt overlinking bug

--- versions.cmake
+++ versions.cmake
@@ -92,7 +92,7 @@
   set(_paraview_revision "master")
 else()
   # Test the revision with OpenGL2 rendering before updating, update often!
-  set(_paraview_revision "v5.0.0")
+  set(_paraview_revision "b9f78c78c5f8f6b6a7387712db230b6c83922a0c")
 endif()
 add_revision(paraview
   GIT_REPOSITORY "https://gitlab.kitware.com/paraview/paraview.git"


Moved ParaView forward to bring in the TIFF fix

--- versions.cmake
+++ versions.cmake
@@ -64,7 +64,7 @@
   set(_paraview_revision "master")
 else()
   # Test the revision with OpenGL2 rendering before updating, update often!
-  set(_paraview_revision "5a4e7b641c8bd886870fa8ecb4749182a50c7365")
+  set(_paraview_revision "bc6b13ad1a7094f24ce60af13ae21dc331519581")
 endif()
 add_revision(paraview
   GIT_REPOSITORY "https://gitlab.kitware.com/paraview/paraview.git"


System.Native: Make configure.cmake checks work for iOS (#42408)

Apple platforms like macOS/iOS allow targeting older operating system versions with a single SDK,
the mere presence of a symbol in the SDK doesn't tell us whether the deployment target really supports it.
The compiler raises a warning when using an unsupported API, turn that into an error so `check_symbol_exists()`
can correctly identify whether the API is supported on the target.

This fixes compile errors after https://github.com/dotnet/corefx/pull/37583 was merged since `clonefile()` is iOS10+.

Replace usages of `check_function_exists()` since it only tests for existence of functions and the CMake docs
recommend using `check_symbol_exists()`: https://cmake.org/cmake/help/v3.15/module/CheckFunctionExists.html

--- src/Native/Unix/configure.cmake
+++ src/Native/Unix/configure.cmake
@@ -1,6 +1,6 @@
+include(CheckCCompilerFlag)
 include(CheckCSourceCompiles)
 include(CheckCSourceRuns)
-include(CheckFunctionExists)
 include(CheckIncludeFiles)
 include(CheckPrototypeDefinition)
 include(CheckStructHasMember)
@@ -32,6 +32,15 @@
 # which are not distinguished from the test failing. So no error for that one.
 set(CMAKE_REQUIRED_FLAGS "-Werror -Wno-error=unused-value")

+# Apple platforms like macOS/iOS allow targeting older operating system versions with a single SDK,
+# the mere presence of a symbol in the SDK doesn't tell us whether the deployment target really supports it.
+# The compiler raises a warning when using an unsupported API, turn that into an error so check_symbol_exists()
+# can correctly identify whether the API is supported on the target.
+check_c_compiler_flag("-Wunguarded-availability" "C_SUPPORTS_WUNGUARDED_AVAILABILITY")
+if(C_SUPPORTS_WUNGUARDED_AVAILABILITY)
+  set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -Wunguarded-availability")
+endif()
+
 # in_pktinfo: Find whether this struct exists
 check_include_files(
     "sys/socket.h;linux/in.h"
@@ -90,8 +99,9 @@
     fcntl.h
     HAVE_F_DUPFD_CLOEXEC)

-check_function_exists(
+check_symbol_exists(
     getifaddrs
+    ifaddrs.h
     HAVE_GETIFADDRS)

 check_symbol_exists(
@@ -139,16 +149,19 @@
     string.h
     HAVE_STRCPY_S)

-check_function_exists(
+check_symbol_exists(
     strlcpy
+    string.h
     HAVE_STRLCPY)

-check_function_exists(
+check_symbol_exists(
     posix_fadvise
+    fcntl.h
     HAVE_POSIX_ADVISE)

-check_function_exists(
+check_symbol_exists(
     ioctl
+    sys/ioctl.h
     HAVE_IOCTL)

 check_symbol_exists(
@@ -171,12 +184,14 @@
     "sys/ioctl.h"
     HAVE_TIOCGWINSZ)

-check_function_exists(
+check_symbol_exists(
     tcgetattr
+    termios.h
     HAVE_TCGETATTR)

-check_function_exists(
+check_symbol_exists(
     tcsetattr
+    termios.h
     HAVE_TCSETATTR)

 check_symbol_exists(
@@ -264,7 +279,7 @@

 check_symbol_exists(
     "statfs"
-    STATFS_INCLUDES
+    ${STATFS_INCLUDES}
     HAVE_STATFS
 )

@@ -344,7 +359,8 @@
     "
     HAVE_SENDFILE_6)

-check_include_files(
+check_symbol_exists(
+    clonefile
     "sys/clonefile.h"
     HAVE_CLONEFILE)

@@ -360,12 +376,14 @@
      "sys/poll.h"
      HAVE_SYS_POLL_H)

-check_function_exists(
+check_symbol_exists(
     epoll_create1
+    sys/epoll.h
     HAVE_EPOLL)

-check_function_exists(
+check_symbol_exists(
     accept4
+    sys/socket.h
     HAVE_ACCEPT4)

 check_symbol_exists(
@@ -378,6 +396,7 @@
     "sys/socket.h"
     HAVE_DISCONNECTX)

+set(PREVIOUS_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS})
 set(CMAKE_REQUIRED_FLAGS "-Werror -Wsign-conversion")
 check_c_source_compiles(
      "
@@ -398,7 +417,7 @@
      }
      "
      HAVE_GETNAMEINFO_SIGNED_FLAGS)
-set(CMAKE_REQUIRED_FLAGS -Werror)
+set(CMAKE_REQUIRED_FLAGS ${PREVIOUS_CMAKE_REQUIRED_FLAGS})

 set(HAVE_SUPPORT_FOR_DUAL_MODE_IPV4_PACKET_INFO 0)

@@ -448,16 +467,19 @@
     mach/mach_time.h
     HAVE_MACH_ABSOLUTE_TIME)

-check_function_exists(
+check_symbol_exists(
     futimes
+    sys/time.h
     HAVE_FUTIMES)

-check_function_exists(
+check_symbol_exists(
     futimens
+    sys/stat.h
     HAVE_FUTIMENS)

-check_function_exists(
+check_symbol_exists(
     utimensat
+    sys/stat.h
     HAVE_UTIMENSAT)

 set (PREVIOUS_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS})
@@ -663,12 +685,14 @@
     unistd.h
     HAVE_GETPEEREID)

-check_function_exists(
+check_symbol_exists(
     getdomainname
+    unistd.h
     HAVE_GETDOMAINNAME)

-check_function_exists(
+check_symbol_exists(
     uname
+    sys/utsname.h
     HAVE_UNAME)

 # getdomainname on OSX takes an 'int' instead of a 'size_t'
@@ -689,16 +713,19 @@
 set (CMAKE_REQUIRED_LIBRARIES "-linotify -L/usr/local/lib")
 endif()

-check_function_exists(
+check_symbol_exists(
     inotify_init
+    sys/inotify.h
     HAVE_INOTIFY_INIT)

-check_function_exists(
+check_symbol_exists(
     inotify_add_watch
+    sys/inotify.h
     HAVE_INOTIFY_ADD_WATCH)

-check_function_exists(
+check_symbol_exists(
     inotify_rm_watch
+    sys/inotify.h
     HAVE_INOTIFY_RM_WATCH)
 set (CMAKE_REQUIRED_LIBRARIES ${PREVIOUS_CMAKE_REQUIRED_LIBRARIES})


Synchronize adm files

Synchronize adm files

--- adm_local_without_kernel/cmake_files/FindSphinx.cmake
+++ adm_local_without_kernel/cmake_files/FindSphinx.cmake
@@ -33,8 +33,11 @@
 # Get root dir locally, going up two levels from the exec:
 GET_FILENAME_COMPONENT(_tmp_ROOT_DIR "${SPHINX_EXECUTABLE}" PATH)
 GET_FILENAME_COMPONENT(_tmp_ROOT_DIR "${_tmp_ROOT_DIR}" PATH)
-SET(SPHINX_PYTHONPATH "${_tmp_ROOT_DIR}/lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages")
-
+IF(WIN32)
+  SET(SPHINX_PYTHONPATH "${_tmp_ROOT_DIR}/lib/site-packages")
+ELSE()
+  SET(SPHINX_PYTHONPATH "${_tmp_ROOT_DIR}/lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages")
+ENDIF()
 # Handle the standard arguments of the find_package() command:
 INCLUDE(FindPackageHandleStandardArgs)
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(Sphinx REQUIRED_VARS SPHINX_EXECUTABLE)


Version tag added for MacOS DMG binaries.

--- cmake/BALLPackageConfig.cmake
+++ cmake/BALLPackageConfig.cmake
@@ -40,6 +40,11 @@
 	SET(CPACK_NSIS_DEFINES "  RequestExecutionLevel highest")
 	SET(CPACK_NSIS_EXTRA_DEFINES "  RequestExecutionLevel highest")
 ELSEIF(APPLE)
+	EXECUTE_PROCESS(COMMAND sw_vers -productVersion OUTPUT_VARIABLE SW_VERS_OUTPUT)
+	STRING(FIND ${SW_VERS_OUTPUT} "." PATCH_VERSION_DELIM REVERSE)
+	STRING(SUBSTRING ${SW_VERS_OUTPUT} 0 ${PATCH_VERSION_DELIM} MACOS_PRODUCT_VER)
+	SET(CPACK_PACKAGE_FILE_NAME "BALL-${CF_BALL_PACKAGE_VERSION}-macOS-${MACOS_PRODUCT_VER}")
+
 	SET(CPACK_GENERATOR PackageMaker)
 	SET(CPACK_BUNDLE_NAME BALLView)
 	SET(CPACK_BUNDLE_ICON "${PROJECT_SOURCE_DIR}/cmake/installer/BALLView.icns")


Make LIBDATA_INSTALL_DIR configurable.

Make LIBDATA_INSTALL_DIR configurable.

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

--- cmake/OpenSyncPlatforms.cmake
+++ cmake/OpenSyncPlatforms.cmake
@@ -7,7 +7,7 @@
 IF (NOT WIN32)
 	SET( LIB_INSTALL_DIR  "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}" )
 	SET( LIBEXEC_INSTALL_DIR  "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}" )
-	SET( LIBDATA_INSTALL_DIR  "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}" )
+	SET( LIBDATA_INSTALL_DIR  "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}" CACHE PATH "The library data directory." )
 	SET( BIN_INSTALL_DIR  "${CMAKE_INSTALL_PREFIX}/bin" )
 	SET( SHARE_INSTALL_DIR  "${CMAKE_INSTALL_PREFIX}/share" )
 	SET( INCLUDE_INSTALL_DIR  "${CMAKE_INSTALL_PREFIX}/include" )
@@ -15,7 +15,7 @@
 	# Windows stuff goes here...
 	SET( LIB_INSTALL_DIR  "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}" )
 	SET( LIBEXEC_INSTALL_DIR  "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}" )
-	SET( LIBDATA_INSTALL_DIR  "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}" )
+	SET( LIBDATA_INSTALL_DIR  "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}" CACHE PATH "The library data directory." )
 	SET( BIN_INSTALL_DIR  "${CMAKE_INSTALL_PREFIX}/bin" )
 	SET( SHARE_INSTALL_DIR  "${CMAKE_INSTALL_PREFIX}/share" )
 	SET( INCLUDE_INSTALL_DIR  "${CMAKE_INSTALL_PREFIX}/include" )


build: temporarily use forked nana

build: temporarily use forked nana

Until original repo merges all the fixes, it is
better to just use forked repo.

--- cmake/SetupDependencies.cmake
+++ cmake/SetupDependencies.cmake
@@ -24,8 +24,8 @@

 CPMAddPackage(
     NAME nana
-    GITHUB_REPOSITORY cnjinhao/nana
-    GIT_TAG v1.7.4
+    GITHUB_REPOSITORY khrynczenko/nana
+    GIT_TAG "hotfix-1.7.4"
     OPTIONS
         "MSVC_USE_STATIC_RUNTIME OFF"
         "NANA_CMAKE_ENABLE_PNG ${NANA_PNG}"


NEW: Email test result

NEW: Email test result

--- tests/system_tests/run_system_tests.sh.cmake
+++ tests/system_tests/run_system_tests.sh.cmake
@@ -52,6 +52,8 @@
 PRIORITY=1
 CONFIG_ARG=""

+EMAIL_TO=""
+
 function print_error()
 {
     echo "ERROR!: $1" >&2
@@ -84,15 +86,42 @@
     echo  ", [EXECUTE] #SUCCESS: $NUM_SUCCESS_EXECUTE, #FAIL: $NUM_FAIL_EXECUTE."
 }

+function email_results()
+{
+	local subject="Tests report: "
+	if [ "x" = "x$FAILED_TESTS" ]; then
+		subject+="Completed successfully"
+	else
+		subject+="$(echo "$FAILED_TESTS" | wc -w) failure(s)!!!"
+	fi
+	mail -r 'Physis testing <nmaruyama@riken.jp>' -s "$subject" $EMAIL_TO <<EOF
+At $TIMESTAMP on `hostname`:
+
+$1
+EOF
+}
+
 function print_results()
 {
-    echo  "[TRANSLATE] #SUCCESS: $NUM_SUCCESS_TRANS, #FAIL: $NUM_FAIL_TRANS."
-    echo  "[COMPILE]   #SUCCESS: $NUM_SUCCESS_COMPILE, #FAIL: $NUM_FAIL_COMPILE."
-    echo  "[EXECUTE]   #SUCCESS: $NUM_SUCCESS_EXECUTE, #FAIL: $NUM_FAIL_EXECUTE."
-    if [ "x" != "x$FAILED_TESTS" ]; then echo  "Failed tests: $FAILED_TESTS"; fi
-    if [ $NUM_WARNING -gt 0 ]; then
-		echo "$NUM_WARNING warning(s)"
-    fi
+	local msg=""
+	msg+="[TRANSLATE] #SUCCESS: $NUM_SUCCESS_TRANS, #FAIL: $NUM_FAIL_TRANS."
+	msg+="\n[COMPILE]   #SUCCESS: $NUM_SUCCESS_COMPILE, #FAIL: $NUM_FAIL_COMPILE."
+	msg+="\n[EXECUTE]   #SUCCESS: $NUM_SUCCESS_EXECUTE, #FAIL: $NUM_FAIL_EXECUTE."
+	msg+="\n"
+	if [ "x" != "x$FAILED_TESTS" ]; then
+		msg+="\n!!! $(echo "$FAILED_TESTS" | wc -w) failure(s)!!!"
+		msg+="\nFailed tests: $FAILED_TESTS"
+	else
+		msg+="\nAll tests completed successfully."
+	fi
+	if [ $NUM_WARNING -gt 0 ]; then
+		msg+="$NUM_WARNING warning(s)"
+	fi
+	echo -e "$msg"
+	msg=$(echo -e "$msg")
+	if [ "$EMAIL_TO" != "" ]; then
+		email_results "$msg"
+	fi
 }

 function finish()
@@ -818,6 +847,8 @@
     echo -e "\t\tExecute the test cases with priority higher than or equal\n\t\tto the given level."
 	echo -e "\t--config <config-file-path>"
 	echo -e "\t\tRead configuration option from the file."
+	echo -e "\t--email <email-address>"
+	echo -e "\t\tEmail test result"
 	echo -e "\t-q, --quit"
 	echo -e "\t\tQuit immediately upon error."
 	echo -e "\t--clear"
@@ -885,7 +916,7 @@

     TESTS=$(get_test_cases)

-    TEMP=$(getopt -o ht:s:m:q --long help,clear,targets:,source:,translate,compile,execute,mpirun,machinefile:,proc-dim:,physis-nlp:,quit,with-valgrind:,priority:,trace,config: -- "$@")
+    TEMP=$(getopt -o ht:s:m:q --long help,clear,targets:,source:,translate,compile,execute,mpirun,machinefile:,proc-dim:,physis-nlp:,quit,with-valgrind:,priority:,trace,config:,email: -- "$@")

     if [ $? != 0 ]; then
 		print_error "Invalid options: $@"
@@ -950,6 +981,10 @@
 				;;
 			--config)
 				CONFIG_ARG=$(abs_path $2)
+				shift 2
+				;;
+			--email)
+				EMAIL_TO=$2
 				shift 2
 				;;
 			-h|--help)
@@ -1051,11 +1086,11 @@
 						echo "[EXECUTE] FAIL"
 						NUM_FAIL_EXECUTE=$(($NUM_FAIL_EXECUTE + 1))
 						fail $SHORTNAME $TARGET execute $cfg $np
-						rm $(get_exe_name $SHORTNAME $TARGET)
+						rm -f $(get_exe_name $SHORTNAME $TARGET)
 						continue
 					fi
 				done
-				rm $(get_exe_name $SHORTNAME $TARGET)
+				rm -f $(get_exe_name $SHORTNAME $TARGET)
 				print_results_short
 			done
 		done


NEW: parallel testing

NEW: parallel testing

--- tests/system_tests/run_system_tests.sh.cmake
+++ tests/system_tests/run_system_tests.sh.cmake
@@ -23,13 +23,12 @@
 ###############################################################
 set -u
 #set -e
+SELF_NAME=$(realpath $0)
+SELF_BASE=$(basename $0)
 TIMESTAMP=$(date +%m-%d-%Y_%H-%M-%S)
-LOGFILE=$PWD/${0%.sh}.log.$TIMESTAMP
+LOGFILE=$PWD/${SELF_BASE%.sh}.log.$TIMESTAMP
 WD=$WD_BASE/$TIMESTAMP
 ORIGINAL_DIRECTORY=$PWD
-mkdir -p $WD
-ORIGINAL_WD=$(pwd)
-cd $WD

 NUM_ALL_TESTS=0
 NUM_SUCCESS_TRANS=0
@@ -55,6 +54,14 @@

 EMAIL_TO=""

+RUN_PARALLEL=0
+
+RETURN_SUCCESS=0
+FAIL_TRANSLATE=1
+FAIL_COMPILE=2
+FAIL_EXECUTE=3
+###############################################################
+
 function print_error()
 {
     echo "ERROR!: $1" >&2
@@ -79,6 +86,7 @@
 		exit_error
     fi
 }
+

 function print_results_short()
 {
@@ -941,6 +949,13 @@
 	echo $tests
 }

+function get_desc()
+{
+	local TEST=$1
+	local DESC=$(grep -o '\WTEST: .*$' $TEST | sed 's/\WTEST: \(.*\)$/\1/')
+	echo $DESC
+}
+
 function is_module_test()
 {
 	echo $1 | grep 'test_.*\.module\.c' > /dev/null 2>&1
@@ -985,88 +1000,202 @@
 	echo $num
 }

+function do_test_finish()
+{
+    local pass=$1
+	echo $pass > result
+}
+
 function do_test()
 {
 	local TARGET=$1
 	local TEST=$2
-	local DESC=$3
-	local cfg=$4
-	local DIM=$5
-	local SHORTNAME=$6
-	echo "Testing with $SHORTNAME ($DESC)"
-	echo "Configuration ($cfg):"
-	echo "Dimension: $DIM"
-	cat $cfg
+	local DIM=$3
+	local SHORTNAME=$4
+	local STAGE=$5
+	local cfg=$6
+	local DESC=$(get_desc $TEST)
+
 	local test_wd=$WD/$TARGET/$SHORTNAME/$(basename $cfg)
 	mkdir -p $test_wd
+	pushd . > /dev/null
 	cd $test_wd
-	if [ $cfg = "$(basename $cfg)" ]; then
-		cfg=$WD/$cfg
+
+	{
+		echo "Testing with $SHORTNAME ($DESC)"
+		echo "Configuration ($cfg):"
+		if [ $cfg = "$(basename $cfg)" ]; then
+			cfg=$WD/$cfg
+		fi
+		cat $cfg
+		echo "Dimension: $DIM"
+
+		echo "[TRANSLATE] Processing $SHORTNAME for $TARGET target"
+		#echo $PHYSISC --$TARGET -I@CMAKE_SOURCE_DIR@/include \
+		#	--config $cfg $TEST
+		if $PHYSISC --$TARGET -I@CMAKE_SOURCE_DIR@/include \
+			--config $cfg $TEST > $(basename $TEST).$TARGET.log \
+			2>&1; then
+			echo "[TRANSLATE] SUCCESS"
+		else
+			echo "[TRANSLATE] FAIL"
+			#fail $SHORTNAME $TARGET translate $cfg
+			do_test_finish $FAIL_TRANSLATE
+			popd > /dev/null
+			return $FAIL_TRANSLATE
+		fi
+		if [ "$STAGE" = "TRANSLATE" ]; then return; fi
+		echo "[COMPILE] Processing $SHORTNAME for $TARGET target"
+		if compile $SHORTNAME $TARGET; then
+			echo "[COMPILE] SUCCESS"
+		else
+			echo "[COMPILE] FAIL"
+			#fail $SHORTNAME $TARGET compile $cfg
+			do_test_finish $FAIL_COMPILE
+			popd > /dev/null
+			return $FAIL_COMPILE
+		fi
+		if [ "$STAGE" = "COMPILE" ]; then continue; fi
+
+		case "$TARGET" in
+			mpi|mpi2|mpi-*)
+				np_target=$MPI_PROC_DIM
+				;;
+			*)
+				np_target=1
+		esac
+		echo "[EXECUTE] Trying with process configurations: $np_target"
+		for np in $np_target; do
+			if execute $SHORTNAME $TARGET $np $DIM; then
+				execute_success=1
+			else
+				execute_success=0
+			fi
+			if [ $execute_success -eq 1 ]; then
+				echo "[EXECUTE] SUCCESS"
+			else
+				echo "[EXECUTE] FAIL"
+				#fail $SHORTNAME $TARGET execute $cfg $np
+				rm -f $(get_exe_name $SHORTNAME $TARGET)
+				do_test_finish $FAIL_EXECUTE
+				popd > /dev/null
+				return $FAIL_EXECUTE
+			fi
+		done
+		do_test_finish $RETURN_SUCCESS
+	} 2>&1 | tee log
+	popd > /dev/null
+	return 0
+}
+
+function inc()
+{
+	local var=$1
+	eval $var=$(($var + 1))
+}
+
+function update_results()
+{
+	local f=$1
+	local code=$(cat $f)
+	local test_sig=$(dirname $f)
+	case $code in
+		$RETURN_SUCCESS)
+			inc NUM_SUCCESS_TRANS
+			inc NUM_SUCCESS_COMPILE
+			inc NUM_SUCCESS_EXECUTE
+			;;
+		$FAIL_TRANSLATE)
+			inc NUM_FAIL_TRANS
+			;;
+		$FAIL_COMPILE)
+			inc NUM_FAIL_COMPILE
+			;;
+		$FAIL_EXECUTE)
+			inc NUM_FAIL_EXECUTE
+			;;
+	esac
+	if [ "$code" != $RETURN_SUCCESS ]; then
+		FAILED_TESTS="$FAILED_TESTS $test_sig"
 	fi
-	echo "[TRANSLATE] Processing $SHORTNAME for $TARGET target"
-	echo $PHYSISC --$TARGET -I@CMAKE_SOURCE_DIR@/include \
-		--config $cfg $TEST
-	if $PHYSISC --$TARGET -I@CMAKE_SOURCE_DIR@/include \
-		--config $cfg $TEST > $(basename $TEST).$TARGET.log \
-		2>&1; then
-		echo "[TRANSLATE] SUCCESS"
-		NUM_SUCCESS_TRANS=$(($NUM_SUCCESS_TRANS + 1))
+}
+
+function fetch_results()
+{
+	for f in $(find $1/$2 -name result | sort -n ); do
+		update_results $f
+		mv $f $f.checked
+	done
+}
+
+function do_test_parallel()
+{
+	local TARGET=$1
+	local TEST=$2
+	local CONFIG=$3
+	local DIM=$4
+	local SHORTNAME=$5
+	local STAGE=$6
+	if [ "1" = "$RUN_PARALLEL" ]; then
+		if ! type parallel > /dev/null 2>&1; then
+			exit_error "Parallel testing requested, but parallel command is not found."
+		fi
+		parallel $SELF_NAME subcommand $WD $LOGFILE do_test $TARGET $TEST $DIM $SHORTNAME $STAGE -- $CONFIG
+		fetch_results $TARGET $SHORTNAME
+		print_results_short
+		if [ $DIE_IMMEDIATELY -eq 1 -a -n "$FAILED_TESTS" ]; then
+			exit_error
+		fi
 	else
-		echo "[TRANSLATE] FAIL"
-		NUM_FAIL_TRANS=$(($NUM_FAIL_TRANS + 1))
-		fail $SHORTNAME $TARGET translate $cfg
-		continue
+		for cfg in $CONFIG; do
+			do_test $TARGET $TEST $DIM $SHORTNAME $STAGE $cfg
+			fetch_results $TARGET $SHORTNAME
+			print_results_short
+			if [ $DIE_IMMEDIATELY -eq 1 -a -n "$FAILED_TESTS" ]; then
+				exit_error
+			fi
+		done
 	fi
-	if [ "$STAGE" = "TRANSLATE" ]; then continue; fi
-	echo "[COMPILE] Processing $SHORTNAME for $TARGET target"
-	if compile $SHORTNAME $TARGET; then
-		echo "[COMPILE] SUCCESS"
-		NUM_SUCCESS_COMPILE=$(($NUM_SUCCESS_COMPILE + 1))
+}
+
+function is_sub_command()
+{
+	if [ "subcommand" = "$1" ]; then
+		return 0
 	else
-		echo "[COMPILE] FAIL"
-		NUM_FAIL_COMPILE=$(($NUM_FAIL_COMPILE + 1))
-		fail $SHORTNAME $TARGET compile $cfg
-		continue
+		return 1
 	fi
-	if [ "$STAGE" = "COMPILE" ]; then continue; fi
+}
+
+function do_sub_command()
+{
+	shift 1
+	WD=$1
+	shift 1
+	LOGFILE=$1
+	shift 1
+	{
+		eval $@
+	} 2>&1 | tee -a $LOGFILE
+}
+
+
+if is_sub_command $@; then
+	do_sub_command $@
+	exit $?
+fi
+
+{
+	mkdir -p $WD
+	ORIGINAL_WD=$(pwd)
+	cd $WD

-	case "$TARGET" in
-		mpi|mpi2|mpi-*)
-			np_target=$MPI_PROC_DIM
-			;;
-		*)
-			np_target=1
-	esac
-	echo "[EXECUTE] Trying with process configurations: $np_target"
-	for np in $np_target; do
-		if execute $SHORTNAME $TARGET $np $DIM; then
-			execute_success=1
-		else
-			execute_success=0
-		fi
-		if [ $execute_success -eq 1 ]; then
-			echo "[EXECUTE] SUCCESS"
-			NUM_SUCCESS_EXECUTE=$(($NUM_SUCCESS_EXECUTE + 1))
-		else
-			echo "[EXECUTE] FAIL"
-			NUM_FAIL_EXECUTE=$(($NUM_FAIL_EXECUTE + 1))
-			fail $SHORTNAME $TARGET execute $cfg $np
-			rm -f $(get_exe_name $SHORTNAME $TARGET)
-			continue
-		fi
-	done
-	#rm -f $(get_exe_name $SHORTNAME $TARGET)
-	print_results_short
-	cd $WD
-}
-
-{
     TARGETS=""
     STAGE="ALL"

     TESTS=$(get_test_cases)

-    TEMP=$(getopt -o ht:s:m:q --long help,clear,targets:,source:,translate,compile,execute,mpirun,machinefile:,proc-dim:,physis-nlp:,quit,with-valgrind:,priority:,trace,config:,email:,list, -- "$@")
+    TEMP=$(getopt -o ht:s:m:q --long help,clear,targets:,source:,translate,compile,execute,mpirun,machinefile:,proc-dim:,physis-nlp:,quit,with-valgrind:,priority:,trace,config:,email:,list,parallel, -- "$@")

     if [ $? != 0 ]; then
 		print_error "Invalid options: $@"
@@ -1151,6 +1280,10 @@
 				list_tests "$TESTS"
 				exit 0
 				;;
+			--parallel)
+				RUN_PARALLEL=1
+				shift
+				;;
 			--)
 				shift
 				break
@@ -1163,7 +1296,6 @@
 		esac
     done

-	echo priority: $PRIORITY
 	TESTS=$(filter_test_case_by_priority $PRIORITY $TESTS)

     if [ "x$TARGETS" = "x" ]; then
@@ -1183,16 +1315,13 @@
 				echo "Skipping $SHORTNAME for $TARGET target"
 				continue;
 			fi
-			DESC=$(grep -o '\WTEST: .*$' $TEST | sed 's/\WTEST: \(.*\)$/\1/')
 			DIM=$(grep -o '\WDIM: .*$' $TEST | sed 's/\WDIM: \(.*\)$/\1/')
 			if [ "x$CONFIG_ARG" = "x" ]; then
 				CONFIG=$(generate_translation_configurations $TARGET)
 			else
 				CONFIG=$CONFIG_ARG
 			fi
-			for cfg in $CONFIG; do
-				do_test $TARGET $TEST "$DESC" $cfg $DIM $SHORTNAME
-			done
+			do_test_parallel $TARGET $TEST "$CONFIG" $DIM $SHORTNAME $STAGE
 		done
     done
     finish


Force LF: toolchain.info

Force LF: toolchain.info

--- cmake/modules/hunter_calculate_toolchain_sha1.cmake
+++ cmake/modules/hunter_calculate_toolchain_sha1.cmake
@@ -25,9 +25,11 @@

   set(temp_project_dir "${CMAKE_BINARY_DIR}/_3rdParty/Hunter/toolchain")
   set(create_script "${hunter_self}/scripts/create-toolchain-info.cmake")
-  set(local_toolchain_info "${temp_project_dir}/toolchain.info")

-  file(REMOVE_RECURSE "${local_toolchain_info}")
+  set(toolchain_info_nolf "${temp_project_dir}/toolchain.info.NOLF")
+  set(toolchain_info_local "${temp_project_dir}/toolchain.info")
+
+  file(REMOVE_RECURSE "${toolchain_info_nolf}")

   if(HUNTER_BINARY_DIR)
     hunter_lock_directory("${HUNTER_BINARY_DIR}" "")
@@ -56,7 +58,7 @@
   set(
       cmd
       "${CMAKE_COMMAND}"
-      "-DTOOLCHAIN_INFO_FILE=${local_toolchain_info}"
+      "-DTOOLCHAIN_INFO_FILE=${toolchain_info_nolf}"
       "${use_toolchain}"
       "-DHUNTER_SELF=${hunter_self}"
       "-G${CMAKE_GENERATOR}"
@@ -110,7 +112,16 @@
     )
   endif()

-  file(SHA1 "${local_toolchain_info}" HUNTER_GATE_TOOLCHAIN_SHA1)
+  # About '@ONLY': no substitutions expected but COPYONLY can't be
+  # used with NEWLINE_STYLE
+  configure_file(
+      "${toolchain_info_nolf}"
+      "${toolchain_info_local}"
+      @ONLY
+      NEWLINE_STYLE LF
+  )
+
+  file(SHA1 "${toolchain_info_local}" HUNTER_GATE_TOOLCHAIN_SHA1)
   set(HUNTER_GATE_TOOLCHAIN_SHA1 "${HUNTER_GATE_TOOLCHAIN_SHA1}" PARENT_SCOPE)

   hunter_make_directory("${hunter_base}" "${HUNTER_GATE_SHA1}" hunter_id_path)
@@ -121,24 +132,31 @@
       hunter_toolchain_id_path
   )

-  set(global_toolchain_info "${hunter_toolchain_id_path}/toolchain.info")
-  if(EXISTS "${global_toolchain_info}")
-    hunter_status_debug("Already exists: ${global_toolchain_info}")
+  set(toolchain_info_global "${hunter_toolchain_id_path}/toolchain.info")
+  if(EXISTS "${toolchain_info_global}")
+    hunter_status_debug("Already exists: ${toolchain_info_global}")
     return()
   endif()

   hunter_lock_directory("${hunter_toolchain_id_path}" "")
-  if(EXISTS "${global_toolchain_info}")
-    hunter_status_debug("Already exists: ${global_toolchain_info}")
+  if(EXISTS "${toolchain_info_global}")
+    hunter_status_debug("Already exists: ${toolchain_info_global}")
     return()
   endif()

-  set(temp "${hunter_toolchain_id_path}/toolchain.info.TEMP")
-  configure_file("${local_toolchain_info}" "${temp}" COPYONLY)
+  set(
+      toolchain_info_torename
+      "${hunter_toolchain_id_path}/toolchain.info.TORENAME"
+  )
+  configure_file(
+      "${toolchain_info_local}"
+      "${toolchain_info_torename}"
+      COPYONLY
+  )

-  file(RENAME "${temp}" "${global_toolchain_info}")
+  file(RENAME "${toolchain_info_torename}" "${toolchain_info_global}")

-  hunter_status_debug("Toolchain info: ${global_toolchain_info}")
+  hunter_status_debug("Toolchain info: ${toolchain_info_global}")
   hunter_status_debug("Toolchain SHA1: ${HUNTER_GATE_TOOLCHAIN_SHA1}")

   file(REMOVE_RECURSE "${temp_build_dir}")


Convert enviroment variable into CMake conversion.

Signed-off-by: Keith Rothman <1bc19627a439baf17510dc2d0b2d250c96d445a5@users.noreply.github.com>

--- xc/common/cmake/vivado.cmake
+++ xc/common/cmake/vivado.cmake
@@ -512,7 +512,6 @@
       set(HAVE_URAY_VIVADO TRUE)
   endif()

-
   if(${HAVE_RAPIDWRIGHT} AND ${HAVE_JAVA} AND ${HAVE_URAY_VIVADO})
     set_target_properties(rapidwright PROPERTIES
       RAPIDWRIGHT_INSTALLED TRUE
@@ -634,7 +633,7 @@
         ${WORK_DIR}/${NAME}_power.rpt
         ${WORK_DIR}/${NAME}_timing_summary.rpt
         ${WORK_DIR}/${NAME}_route_status.rpt
-    COMMAND ${CMAKE_COMMAND} -E env XRAY_VIVADO_SETTINGS=$$URAY_VIVADO_SETTINGS ${PRJRAY_DIR}/utils/vivado.sh -mode batch -source ${RUNME}
+    COMMAND ${CMAKE_COMMAND} -E env XRAY_VIVADO_SETTINGS=$ENV{URAY_VIVADO_SETTINGS} ${PRJRAY_DIR}/utils/vivado.sh -mode batch -source ${RUNME}
         > ${CMAKE_CURRENT_BINARY_DIR}/${WORK_DIR}/vivado.stdout.log
     WORKING_DIRECTORY ${WORK_DIR}
     DEPENDS ${RUNME_DEPS}


change curl lib to curl_imp

change curl lib to curl_imp

git-svn-id: 65dd0ccd495961f396d5302e5521154b071f0302@1302 5b2332b8-efa3-11de-8684-7d64432d61a3

--- CMakeModules/ModuleSetup.cmake
+++ CMakeModules/ModuleSetup.cmake
@@ -288,7 +288,7 @@
 macro (configure_curl)
     sagase_configure_package (CURL
         NAMES Curl curl libcurl
-        COMPONENTS curl
+        COMPONENTS curl_imp
         PREFIXES ${ENV_NAALI_DEP_PATH}
         ${ENV_NAALI_DEP_PATH}/libcurl/lib/DLL-Debug
         ${ENV_NAALI_DEP_PATH}/libcurl/lib/DLL-Release)


recovering lost change from master to copy dependencies.

--- WkTest.cmake
+++ WkTest.cmake
@@ -148,12 +148,12 @@
 			#if win32, moving all dependencies' run libraries
 			if ( WIN32 )
 				#needed for each run library dependency as well
-				foreach ( looparg ${${PROJECT_NAME}_BINDEPENDS} )
-					WkCopyDepends(${looparg} ${test_name} )
-				endforeach ( looparg ${${PROJECT_NAME}_BINDEPENDS} )
-				foreach ( looparg ${${PROJECT_NAME}_SRCDEPENDS} )
-					WkCopyDepends(${looparg} ${test_name} )
-				endforeach ( looparg ${${PROJECT_NAME}_SRCDEPENDS} )
+				foreach ( depend ${${PROJECT_NAME}_BINDEPENDS} )
+					ADD_CUSTOM_COMMAND( TARGET ${test_name} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy "$<TARGET_FILE:${depend}>" "$<TARGET_FILE_DIR:${test_name}>" COMMENT "Copying $<TARGET_FILE:${depend}> to $<TARGET_FILE_DIR:${test_name}>" )
+				endforeach ( depend ${${PROJECT_NAME}_BINDEPENDS} )
+				foreach ( depend ${${PROJECT_NAME}_SRCDEPENDS} )
+					ADD_CUSTOM_COMMAND( TARGET ${test_name} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy "$<TARGET_FILE:${depend}>" "$<TARGET_FILE_DIR:${test_name}>" COMMENT "Copying $<TARGET_FILE:${depend}> to $<TARGET_FILE_DIR:${test_name}>" )
+				endforeach ( depend ${${PROJECT_NAME}_SRCDEPENDS} )
 			endif ( WIN32 )

 		ENDIF (testsource)


fix: When looking for multiple package versions, look in user DEPENDS path first [BASIS] (#329)

--- CMake/Basis/CommonTools.cmake
+++ CMake/Basis/CommonTools.cmake
@@ -639,11 +639,13 @@
             # or "texbin" (i.e., MacTeX's "/Library/TeX/texbin" path)
             if (DEPENDS_${PKG}_DIR MATCHES "/([bB]in|sbin|texbin)/+$")
               list (INSERT CMAKE_PROGRAM_PATH 0 "${DEPENDS_${PKG}_DIR}")
+              list (REMOVE_DUPLICATES CMAKE_PROGRAM_PATH)
             # add directory to CMAKE_PREFIX_PATH otherwise as users
             # tend to specify the installation prefix instead of the
             # actual directory containing the package configuration file
             else ()
               list (INSERT CMAKE_PREFIX_PATH 0 "${DEPENDS_${PKG}_DIR}")
+              list (REMOVE_DUPLICATES CMAKE_PREFIX_PATH)
             endif ()
           endif ()
           # now look for the package using find_package
@@ -661,12 +663,24 @@
           endif ()
           if (${_BFP_VERSIONS_COUNT} GREATER 1)
             list (APPEND _BFP_FIND_PACKAGE_ARGS CONFIG)
-            foreach (_BFP_VERSION ${_BFP_VERSIONS})
-              find_package (${PKG} ${_BFP_VERSION} ${_BFP_FIND_PACKAGE_ARGS} QUIET)
-              if (${PKG}_FOUND)
-                break ()
-              endif ()
-            endforeach ()
+            if (DEPENDS_${PKG}_DIR)
+              foreach (_BFP_VERSION ${_BFP_VERSIONS})
+                find_package (${PKG} ${_BFP_VERSION} ${_BFP_FIND_PACKAGE_ARGS} QUIET
+                  PATHS ${DEPENDS_${PKG}_DIR} NO_DEFAULT_PATH
+                )
+                if (${PKG}_FOUND)
+                  break ()
+                endif ()
+              endforeach ()
+            endif ()
+            if (NOT ${PKG}_FOUND)
+              foreach (_BFP_VERSION ${_BFP_VERSIONS})
+                find_package (${PKG} ${_BFP_VERSION} ${_BFP_FIND_PACKAGE_ARGS} QUIET)
+                if (${PKG}_FOUND)
+                  break ()
+                endif ()
+              endforeach ()
+            endif ()
           else ()
             if (_BFP_ARGN_MODULE)
               list (APPEND _BFP_FIND_PACKAGE_ARGS MODULE)


STYLE: clean unused code

STYLE: clean unused code

--- CMake/External_muParser.cmake
+++ CMake/External_muParser.cmake
@@ -29,35 +29,7 @@
         ${CMAKE_SOURCE_DIR}/patches/${proj}/CMakeLists.txt
         ${MUPARSER_SB_SRC}
     )
-
-  if(FALSE)
-    ExternalProject_Add(${proj}
-      PREFIX ${proj}
-      URL "http://downloads.sourceforge.net/project/muparser/muparser/Version%202.2.3/muparser_v2_2_3.zip"
-      URL_MD5 9de40ec1dab5bd2787ee344fce5846ad
-      BINARY_DIR ${MUPARSER_SB_BUILD_DIR}
-      INSTALL_DIR ${CMAKE_INSTALL_PREFIX}
-      CONFIGURE_COMMAND
-        LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib
-        ${MUPARSER_SB_BUILD_DIR}/configure
-        --prefix=${CMAKE_INSTALL_PREFIX}
-        --enable-shared=yes
-        --enable-samples=no
-        --enable-debug=no
-      BUILD_COMMAND $(MAKE)
-      INSTALL_COMMAND $(MAKE) install
-      DEPENDS ${${proj}_DEPENDENCIES}
-    )
-
-    ExternalProject_Add_Step(${proj} copy_source
-      COMMAND ${CMAKE_COMMAND} -E copy_directory
-      ${MUPARSER_SB_SRC} ${MUPARSER_SB_BUILD_DIR}
-      DEPENDEES patch update
-      DEPENDERS configure
-    )
-
-  endif()

   message(STATUS "  Using muParser SuperBuild version")

-endif()+endif()


ENH: Move to new ANTs repository.

ENH: Move to new ANTs repository.

--- CMake/FindExternalTools.cmake
+++ CMake/FindExternalTools.cmake
@@ -468,15 +468,13 @@

 # ===== ANTS/WarpMultiTransform =====================================================
 set( SourceCodeArgs
-  SVN_REPOSITORY "http://advants.svn.sourceforge.net/svnroot/advants/trunk"
-  SVN_USERNAME slicerbot
-  SVN_PASSWORD slicer
-  SVN_REVISION -r 1685 # 12/13/2012
+  GIT_REPOSITORY "${git_protocol}://github.com/stnava/ANTs.git"
+  GIT_TAG "6cb624225fe99047b562acb1a0cb053dc98dbc50" # 2013-01-31 Move to new repository home
   )
 set( CMAKE_ExtraARGS
   -DBUILD_TESTING:BOOL=OFF
   -DBUILD_SHARED_LIBS:BOOL=OFF
-  -DANTS_SUPERBUILD:BOOL=OFF
+  #  -DANTS_SUPERBUILD:BOOL=OFF
   -DSuperBuild_ANTS_USE_GIT_PROTOCOL:BOOL=${USE_GIT_PROTOCOL}
   -DUSE_SYSTEM_ITK:BOOL=ON
   -DITK_DIR:PATH=${ITK_DIR}


cmake: compile with -std=gnu++1z by default

Summary:
Switch from `-std=gnu++14` to `-std=gnu++1z`

This is required in order to allow downstream projects that use folly to build
with `-std=gnu++1z`.  The linkage for how constexpr variables are emitted
has changed between `gnu++14` and `gnu++1z`.  If folly is compiled with
`gnu++14` but downstream dependencies try to build with `gnu++1z` they will
get link errors (multiple definitions) for constexpr variables defined in
folly header files.

The reverse (compiling folly with `gnu++1z` but downstream projects with
`gnu++14`) does not seem to cause any problems.  Nonetheless, I have provided
`CXX_STD` as a CMake option so that users can override this setting if it does
cause any problems for some reason.

Reviewed By: yfeldblum

Differential Revision: D10448691

fbshipit-source-id: c44f568a7ff175c432865badeaaa9b3ebbaf8987

--- CMake/FollyCompilerUnix.cmake
+++ CMake/FollyCompilerUnix.cmake
@@ -1,8 +1,24 @@
+# Provide an option to control the -std argument for the C++ compiler.
+# We don't use CMAKE_CXX_STANDARD since it requires at least CMake 3.8
+# to support C++17.
+#
+# Most users probably want to stick with the default here.  However, gnu++1z
+# does change the linkage of how some symbols are emitted (e.g., constexpr
+# variables defined in headers).  In case this causes problems for downstream
+# libraries that aren't using gnu++1z yet, provide an option to let them still
+# override this with gnu++14 if they need to.
+set(
+  CXX_STD "gnu++1z"
+  CACHE STRING
+  "The C++ standard argument to pass to the compiler.  Defaults to gnu++1z"
+)
+mark_as_advanced(CXX_STD)
+
 set(CMAKE_CXX_FLAGS_COMMON "-g -Wall -Wextra")
 set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_COMMON}")
 set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_COMMON} -O3")

-set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -std=gnu++14")
+set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -std=${CXX_STD}")
 function(apply_folly_compile_options_to_target THETARGET)
   target_compile_definitions(${THETARGET}
     PRIVATE
@@ -13,7 +29,7 @@
   target_compile_options(${THETARGET}
     PRIVATE
       -g
-      -std=gnu++14
+      -std=${CXX_STD}
       -finput-charset=UTF-8
       -fsigned-char
       -Werror


disable NiftyPET by default as it requires python2

--- SuperBuild.cmake
+++ SuperBuild.cmake
@@ -268,7 +268,7 @@

 # If building STIR and CUDA present, offer to build NiftyPET
 if (USE_CUDA AND NOT USE_SYSTEM_STIR)
-  set(USE_NiftyPET ON CACHE BOOL "Build STIR with NiftyPET's projectors") # FORCE)
+  set(USE_NiftyPET OFF CACHE BOOL "Build STIR with NiftyPET's projectors") # FORCE)
   if (USE_NiftyPET)
     option(USE_SYSTEM_NiftyPET "Build using an external version of NiftyPET" OFF)
   endif()


ENH: Respect dependancies for VTK build

ENH: Respect dependancies for VTK build

VTK must be added to the dependancy list
when it is choosen.

--- SuperBuild.cmake
+++ SuperBuild.cmake
@@ -97,6 +97,9 @@

 #set(${LOCAL_PROJECT_NAME}_DEPENDENCIES ${ITK_EXTERNAL_NAME} VTK SlicerExecutionModel)
 set(${LOCAL_PROJECT_NAME}_DEPENDENCIES ${ITK_EXTERNAL_NAME} )
+if(USE_VTK)
+  list(APPEND ${LOCAL_PROJECT_NAME}_DEPENDENCIES VTK)
+endif()

 if(BUILD_STYLE_UTILS)
   list(APPEND ${LOCAL_PROJECT_NAME}_DEPENDENCIES Cppcheck KWStyle Uncrustify)


BUG:  VTK dependency option based on USE_VTK not USE_ITK

--- SuperBuild.cmake
+++ SuperBuild.cmake
@@ -101,7 +101,7 @@
 option(USE_VTK "Build tools that depend on VTK" OFF)
 CMAKE_DEPENDENT_OPTION(
      USE_SYSTEM_VTK "Build using an externally defined version of VTK" OFF
-     "USE_ITK" OFF
+     "USE_VTK" OFF
      )

 option(RUN_SHORT_TESTS    "Run the quick unit tests."                                   ON  )


BUG: Fix OpenIGTLink superbuild. When project are added as ExternalProject and downloaded using SVN. SOURCE_DIR shouldn't be specified.

--- SuperBuild.cmake
+++ SuperBuild.cmake
@@ -126,7 +126,6 @@
     SVN_REPOSITORY "http://svn.na-mic.org/NAMICSandBox/trunk/OpenIGTLink"
     INSTALL_COMMAND ""
     CMAKE_GENERATOR ${gen}
-    SOURCE_DIR OpenIGTLink
     CMAKE_ARGS
       ${ep_common_args}
     )


fix the Windows build

fix the Windows build

Summary:
It looks like I also broke the Windows build of folly in D10435249, since
FollyCompilerMSVC.cmake referenced the `folly_deps` target, which is now not
defined yet when `FollyCompilerMSVC.cmake` is included.

This changes the code so that `FollyCompilerMSVC.cmake` simply updates
`${FOLLY_LINK_LIBRARIES}`, which is used in a `target_link_libraries()` call
in `folly-deps.cmake`.  (I'm slightly surprised that CMake was happy before
with multiple separate `target_link_libraries()` calls for the `folly_deps`
target.)

Reviewed By: Orvid

Differential Revision: D10445483

fbshipit-source-id: 5277785bec3fd8527d01a098e130c945077703ee

--- CMake/FollyCompilerMSVC.cmake
+++ CMake/FollyCompilerMSVC.cmake
@@ -295,8 +295,4 @@
   endif()
 endfunction()

-target_link_libraries(folly_deps
-  INTERFACE
-    Iphlpapi.lib
-    Ws2_32.lib
-)
+list(APPEND FOLLY_LINK_LIBRARIES Iphlpapi.lib Ws2_32.lib)


[iOS] Fix an issue where the wrong zziplib would be found due to different naming.

--- CMake/Packages/FindZZip.cmake
+++ CMake/Packages/FindZZip.cmake
@@ -32,7 +32,7 @@
   ZZip_INCLUDE_DIR
 )

-set(ZZip_LIBRARY_NAMES zzip zziplib)
+set(ZZip_LIBRARY_NAMES zziplib zzip)
 get_debug_names(ZZip_LIBRARY_NAMES)

 use_pkgconfig(ZZip_PKGC zziplib)


Extend regex options to accept pathname characters

--- CMake/ctkFunctionExtractOptionNameAndValue.cmake
+++ CMake/ctkFunctionExtractOptionNameAndValue.cmake
@@ -7,7 +7,7 @@
 FUNCTION(ctkFunctionExtractOptionNameAndValue my_opt var_opt_name var_opt_value)

  # Make sure option is correctly formated
-  IF(NOT "${my_opt}" MATCHES "^[/A-Za-z0-9._]+:(ON|OFF)")
+  IF(NOT "${my_opt}" MATCHES "^[- :/A-Za-z0-9._]+:(ON|OFF)$")
     MESSAGE(FATAL_ERROR "Option ${my_opt} is incorrect. Options should be specified using the following format OPT1:[ON|OFF]. For example OPT1:OFF or OPT2:ON")
   ENDIF()


up ci

up ci

--- ci_gitlab/ctest_common.cmake
+++ ci_gitlab/ctest_common.cmake
@@ -68,7 +68,7 @@

 # Set CTEST_CONFIGURE_COMMAND to cmake followed by siconos options
 set(CTEST_CONFIGURE_COMMAND ${CMAKE_COMMAND})
-foreach(option ${SICONOS_CMAKE_OPTIONS})
+foreach(option IN LISTS SICONOS_CMAKE_OPTIONS)
   set(CTEST_CONFIGURE_COMMAND "${CTEST_CONFIGURE_COMMAND} ${option}")
 endforeach()
 set(CTEST_CONFIGURE_COMMAND "${CTEST_CONFIGURE_COMMAND} ${CTEST_SOURCE_DIRECTORY}")
@@ -81,18 +81,11 @@
   message("- Results won't be submitted to a cdash server.\n")
 endif()

-if(${CMAKE_VERSION} VERSION_GREATER "3.6.3")
-  ctest_configure(
-    RETURN_VALUE CONFIGURE_RESULT
-    CAPTURE_CMAKE_ERROR CONFIGURE_STATUS
-    QUIET
-    )
-else()
-  ctest_configure(
-    RETURN_VALUE CONFIGURE_RESULT
-    QUIET)
-  set(CONFIGURE_STATUS ${CONFIGURE_RESULT})
-endif()
+ctest_configure(
+  RETURN_VALUE CONFIGURE_RESULT
+  CAPTURE_CMAKE_ERROR CONFIGURE_STATUS
+  QUIET
+  )

 message("=============== End of ctest_configure =============== ")
 message("------> Configure status/result : ${CONFIGURE_STATUS}/${CONFIGURE_RESULT}")
@@ -111,21 +104,12 @@

 message("\n\n=============== Start ctest_build =============== ")

-if(${CMAKE_VERSION} VERSION_GREATER "3.6.3")
-  ctest_build(
-      PROJECT_NAME ${current_project}
-      CAPTURE_CMAKE_ERROR BUILD_STATUS
-      RETURN_VALUE BUILD_RESULT
-      QUIET
-      )
-else()
-  ctest_build(
-      PROJECT_NAME ${current_project}
-      RETURN_VALUE BUILD_RESULT
-      QUIET
-      )
-    set(BUILD_STATUS ${BUILD_RESULT})
-  endif()
+ctest_build(
+  PROJECT_NAME ${current_project}
+  CAPTURE_CMAKE_ERROR BUILD_STATUS
+  RETURN_VALUE BUILD_RESULT
+  QUIET
+  )
 message("=============== End of ctest_build =============== ")
 message("------> Build status/result : ${BUILD_STATUS}/${BUILD_RESULT}")
 if(NOT BUILD_STATUS EQUAL 0 OR NOT BUILD_RESULT EQUAL 0)
@@ -138,23 +122,13 @@

 # -- Tests --
 message("\n\n=============== Start ctest_test (nbprocs = ${NP}) =============== ")
-if(${CMAKE_VERSION} VERSION_GREATER "3.6.3")
-  ctest_test(
-    PARALLEL_LEVEL NP
-    CAPTURE_CMAKE_ERROR TEST_STATUS
-    SCHEDULE_RANDOM ON
-    RETURN_VALUE TEST_RESULT
-    QUIET
-    )
-else()
-  ctest_test(
-    PARALLEL_LEVEL NP
-    RETURN_VALUE TEST_STATUS
-    SCHEDULE_RANDOM ON
-    QUIET
-    )
-  set(TEST_STATUS ${TEST_RESULT})
-endif()
+ctest_test(
+  PARALLEL_LEVEL NP
+  CAPTURE_CMAKE_ERROR TEST_STATUS
+  SCHEDULE_RANDOM ON
+  RETURN_VALUE TEST_RESULT
+  QUIET
+  )
 message("=============== End of ctest_test =============== ")
 message("------> Test status/result : ${TEST_STATUS}/${TEST_RESULT}")
 # error status check later, we try to submit even if tests failed.


Add IMPORTED_IMPLIB to fmilibrary for Windows CMake build

--- Dependencies/fmilibrary.cmake
+++ Dependencies/fmilibrary.cmake
@@ -4,3 +4,7 @@
 set_target_properties(fmilibrary PROPERTIES
     IMPORTED_LOCATION ${fmi_home}/lib/libfmilib_shared${CMAKE_SHARED_LIBRARY_SUFFIX}
     INTERFACE_INCLUDE_DIRECTORIES ${fmi_home}/include)
+if(WIN32)
+  set_target_properties(fmilibrary PROPERTIES
+    IMPORTED_IMPLIB ${fmi_home}/lib/libfmilib_shared${CMAKE_IMPORT_LIBRARY_SUFFIX})
+endif()


BUG: No not run ctest_empty_binary_directory on CircleCI

Fails and is not needed

--- Docker/itksoftwareguide-dashboard/dashboard.cmake
+++ Docker/itksoftwareguide-dashboard/dashboard.cmake
@@ -42,8 +42,10 @@
 set(CTEST_DROP_SITE_CDASH TRUE)
 list(APPEND CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}")

-# Start with a fresh build tree.
-ctest_empty_binary_directory(${CTEST_BINARY_DIRECTORY}/)
+if(NOT in_circleci)
+  # Start with a fresh build tree.
+  ctest_empty_binary_directory(${CTEST_BINARY_DIRECTORY}/)
+endif()

 # Initial cache.
 file(WRITE ${CTEST_BINARY_DIRECTORY}/CMakeCache.txt "


add Carbon framework under OSX for MPProcessors call in vtkMultiThreader.cxx

--- vtkCMakeOptions.cmake
+++ vtkCMakeOptions.cmake
@@ -119,7 +119,7 @@

 IF(APPLE)
   SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated")
-  SET(CMAKE_CXX_SHLIB_LINK_FLAGS "${CMAKE_CXX_SHLIB_LINK_FLAGS} -multiply_defined suppress")
+  SET(CMAKE_CXX_SHLIB_LINK_FLAGS "${CMAKE_CXX_SHLIB_LINK_FLAGS} -multiply_defined suppress -framework Carbon")
   IF (VTK_USE_CARBON)
     SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fpascal-strings")
   ENDIF (VTK_USE_CARBON)


More whitespace removal.

More whitespace removal.

--- Utilities.cmake
+++ Utilities.cmake
@@ -66,7 +66,7 @@
   cmake_parse_arguments(create_test_executable "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})

   set(exec_name ${create_test_executable_UNPARSED_ARGUMENTS})
-
+
   add_executable(${exec_name} EXCLUDE_FROM_ALL
     ${${exec_name}_SRC}
     ${${exec_name}_INC})


workaround for CeresConfig.cmake inconsistency

Change-Id: I4712d9163dcbcccf2768e0aecf402e812779a947

--- VAD_Ceres.cmake
+++ VAD_Ceres.cmake
@@ -6,6 +6,10 @@
   message("run VAD_SYSTEM for CERES")

   vad_autodep_pkg(Eigen3 "Ceres")
+
+  #seems to linger after a regular compile / which will for some reason make CeresConfig.cmake not import the ceres target of a system dep...
+  unset(Ceres_BINARY_DIR)
+  unset(Ceres_BINARY_DIR CACHE)

   # FIXME environment is not reset after this!
   find_package_plus_no_import(${ARGN} NO_CMAKE_BUILDS_PATH)


Removed whitespace.

Removed whitespace.

--- Utilities.cmake
+++ Utilities.cmake
@@ -64,7 +64,7 @@
   set(oneValueArgs "")
   set(multiValueArgs "")
   cmake_parse_arguments(create_test_executable "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
-
+
   set(exec_name ${create_test_executable_UNPARSED_ARGUMENTS})

   add_executable(${exec_name} EXCLUDE_FROM_ALL


cmake: fix Android toolchain on 64-bit hosts

--- cmake/AndroidToolchain.cmake
+++ cmake/AndroidToolchain.cmake
@@ -470,6 +470,7 @@
  endif()
 endif()

+# FIXME: properly detect 64-bit host, currently reported as 32-bit

 # detect current host platform
 if( NOT DEFINED ANDROID_NDK_HOST_X64 AND CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "amd64|x86_64|AMD64")
@@ -493,7 +494,7 @@
 endif()

 if( NOT ANDROID_NDK_HOST_X64 )
- set( ANDROID_NDK_HOST_SYSTEM_NAME ${ANDROID_NDK_HOST_SYSTEM_NAME2} )
+ #set( ANDROID_NDK_HOST_SYSTEM_NAME ${ANDROID_NDK_HOST_SYSTEM_NAME2} )
 endif()

 # see if we have path to Android NDK


cmake: Fix a typo in FindNSIS.

cmake: Fix a typo in FindNSIS.

--- cmake/Modules/FindNSIS.cmake
+++ cmake/Modules/FindNSIS.cmake
@@ -37,7 +37,7 @@
 find_program(NSIS_MAKE
     NAMES
         makensis
-    PATH
+    PATHS
         ${NSIS_ROOT_PATH}
 )


make the fail safe path actually safe   * use only supported CC in the list   * workaround of #17526

--- cmake/OpenCVDetectCUDA.cmake
+++ cmake/OpenCVDetectCUDA.cmake
@@ -162,7 +162,12 @@
       if(NOT _nvcc_res EQUAL 0)
         message(STATUS "Automatic detection of CUDA generation failed. Going to build for all known architectures.")
         # TX1 (5.3) TX2 (6.2) Xavier (7.2) V100 (7.0)
-        set(__cuda_arch_bin "5.3 6.2 7.2 7.0")
+        ocv_filter_available_architecture(__cuda_arch_bin
+            5.3
+            6.2
+            7.2
+            7.0
+        )
       else()
         set(__cuda_arch_bin "${_nvcc_out}")
       endif()


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

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

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

 # Installation directories:

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


Removed debuging message

Removed debuging message

--- cmake/Platform/Arduino.cmake
+++ cmake/Platform/Arduino.cmake
@@ -283,7 +283,6 @@
             if(CMAKE_MATCH_1 GREATER 10)
                 set(ARDUINO_VERSION_DEFINE "${ARDUINO_VERSION_DEFINE}${CMAKE_MATCH_2}")
             else()
-                message("HI")
                 set(ARDUINO_VERSION_DEFINE "${ARDUINO_VERSION_DEFINE}0${CMAKE_MATCH_2}")
             endif()
         else()


OSX: hack to make build configurations failsafe on xcode < 4.3 again by limiting to cmake_build_type

--- cmake/PlatformSpecific.cmake
+++ cmake/PlatformSpecific.cmake
@@ -114,6 +114,16 @@
 	set(LUXRAYS_NO_DEFAULT_CONFIG true)
 	set(LUXRAYS_CUSTOM_CONFIG Config_OSX)

+	### This is a hack for xcode to affect default buildtype so it matches copy pathes ###
+	### it does  work in xcode 4.3 due it defaults to "Debug" and needs this mandatory ###
+	### you must change build configuration in xcode4.3 itself until solution is found ###
+
+	if(${XCODE_VERSION} LESS 4.3 AND ${CMAKE_BUILD_TYPE} MATCHES Release)
+		SET(CMAKE_CONFIGURATION_TYPES "Release" CACHE STRING "limit configs" FORCE) # not valid for xcode 4.3
+	elseif(${CMAKE_BUILD_TYPE} MATCHES Debug)
+		SET(CMAKE_CONFIGURATION_TYPES "Debug" CACHE STRING "limit configs" FORCE) # valid for xcode 4.3
+	endif()
+
 	#OSX-flags by jensverwiebe
 	set(CMAKE_CXX_FLAGS_RELEASE "-DNDEBUG -Wall -fPIC -O3 -ftree-vectorize -msse -msse2 -msse3 -mssse3 -fvariable-expansion-in-unroller")


Prettyfied avr_crosscompile.cmake

Prettyfied avr_crosscompile.cmake

--- cmake/avr_crosscompile.cmake
+++ cmake/avr_crosscompile.cmake
@@ -42,7 +42,11 @@
 	avr_create_hex(${elf_file})

 	add_custom_target(${elf_file}_writeflash
-		COMMAND ${AVRDUDE} -c ${PROGRAMMER} -p ${PROGRAMMER_MCU} -P usb -B 8 -U flash:w:${elf_file}.hex
+		COMMAND ${AVRDUDE}
+		ARGS 	-c ${PROGRAMMER}
+				-p ${PROGRAMMER_MCU}
+				-P usb -B 8
+				-U flash:w:${elf_file}.hex
 		DEPENDS ${elf_file}_hex
 		VERBATIM
 		)


Clean up some whitespace

Clean up some whitespace

--- cmake/generate_sources.cmake
+++ cmake/generate_sources.cmake
@@ -1,3 +1,5 @@
 message(STATUS "Generating sources")
 execute_process(
-  COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/lib/generate_sources ${CMAKE_CURRENT_SOURCE_DIR} ${LLVM_ROOT_PATH})
+  COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/lib/generate_sources
+          ${CMAKE_CURRENT_SOURCE_DIR} ${LLVM_ROOT_PATH}
+)


Move the ocaml_all target into the Misc folder for cleanliness; NFC.

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

--- cmake/modules/AddOCaml.cmake
+++ cmake/modules/AddOCaml.cmake
@@ -211,3 +211,4 @@
 endfunction()

 add_custom_target("ocaml_all")
+set_target_properties(ocaml_all PROPERTIES FOLDER "Misc")


build: dereference variable as appropriate

Certain versions of CMake behave differently with variable expansion.  This may
be evaluated incorrectly in some versions.  Dereference the value explicitly.

--- cmake/modules/AddSwift.cmake
+++ cmake/modules/AddSwift.cmake
@@ -2370,7 +2370,7 @@
   # NOTE(compnerd) use the C linker language to invoke `clang` rather than
   # `clang++` as we explicitly link against the C++ runtime.  We were previously
   # actually passing `-nostdlib++` to avoid the C++ runtime linkage.
-  if(SWIFTEXE_SINGLE_SDK STREQUAL ANDROID)
+  if(${SWIFTEXE_SINGLE_SDK} STREQUAL ANDROID)
     set_property(TARGET "${name}" PROPERTY
       LINKER_LANGUAGE "C")
   else()


update lua lib name for windows

update lua lib name for windows

--- cmake/modules/BuildLua.cmake
+++ cmake/modules/BuildLua.cmake
@@ -39,7 +39,7 @@
 )

 if(WIN32)
-  set(LUA_LIBRARY "${install_dir}/lib/lua51.lib")
+  set(LUA_LIBRARY "${install_dir}/lib/liblua.lib")
   set(LUA_LIBRARIES "${LUA_LIBRARY}")
   set(LUA_INSTALL_LIBS "${install_dir}/lib/lua51.dll")
 else()


[CMake] Don't put every project's tblgen executable in the LLVM bin directory.

This changes Clang standalone builds so that clang-tblgen lives in
clang/build/bin instead of llvm/build/bin, and so that with the Xcode
generator it's in clang/build/bin/Debug instead of llvm/build/bin/Debug/Debug/.
Yes, really.

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

--- cmake/modules/TableGen.cmake
+++ cmake/modules/TableGen.cmake
@@ -79,8 +79,6 @@
 endif()

 macro(add_tablegen target project)
-  set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${LLVM_TOOLS_BINARY_DIR})
-
   set(${target}_OLD_LLVM_LINK_COMPONENTS ${LLVM_LINK_COMPONENTS})
   set(LLVM_LINK_COMPONENTS ${LLVM_LINK_COMPONENTS} TableGen)
   add_llvm_utility(${target} ${ARGN})


Fixes T22466 by providing the EXEC_NAME

Fixes T22466 by providing the EXEC_NAME

--- CMake/mitkMacroCreateExecutable.cmake
+++ CMake/mitkMacroCreateExecutable.cmake
@@ -92,6 +92,9 @@
         set(_batch_file_out_dir "${CMAKE_CURRENT_BINARY_DIR}")
       endif()
       if(NOT EXEC_NO_BATCH_FILE)
+        if(NOT EXEC_NAME)
+          set(EXEC_NAME ${MODULE_TARGET})
+        endif()
         foreach(BUILD_TYPE debug release)
           mitkFunctionCreateWindowsBatchScript(
               ${_batch_file_in} ${_batch_file_out_dir}/${MODULE_TARGET}_${BUILD_TYPE}.bat


Fix "No newline at end of file" warning

Fix "No newline at end of file" warning

--- flags/vs-nonpermissive.cmake
+++ flags/vs-nonpermissive.cmake
@@ -13,4 +13,4 @@

 # There is no macro to detect this flags on toolchain calculation so we must
 # mark this toolchain explicitly.
-list(APPEND HUNTER_TOOLCHAIN_UNDETECTABLE_ID "/permissive-")+list(APPEND HUNTER_TOOLCHAIN_UNDETECTABLE_ID "/permissive-")


removed old FindCLHEP.cmake

removed old FindCLHEP.cmake

--- FindCLHEP.cmake
+++ FindCLHEP.cmake
@@ -1,140 +0,0 @@
-###########################################
-# cmake module for finding CLHEP
-#
-# returns:
-#   CLHEP_FOUND
-#   CLHEP_INCLUDE_DIRS
-#   CLHEP_LIBRARIES
-#
-# @author Jan Engels, DESY
-###########################################
-
-SET( CLHEP_FOUND FALSE )
-MARK_AS_ADVANCED( CLHEP_FOUND )
-# is HepPDT a part of CLHEP? (CLHEP versions < 2.0.3.0/1.9.3.0)
-SET( CLHEP_includes_HepPDT TRUE )
-MARK_AS_ADVANCED( CLHEP_includes_HepPDT )
-
-# HepPDT - include dir
-#SET( HepPDT_INCLUDE_DIR HepPDT_INCLUDE_DIR-NOTFOUND )
-#MARK_AS_ADVANCED( HepPDT_INCLUDE_DIR )
-#
-## first look if it is available under CLHEP_HOME
-#FIND_PATH( HepPDT_INCLUDE_DIR
-#    NAMES CLHEP/HepPDT/ParticleID.hh
-#    PATHS ${CLHEP_HOME}
-#    PATH_SUFFIXES include
-#    NO_DEFAULT_PATH )
-#
-## if not, look in HepPDT_HOME
-#IF( NOT HepPDT_INCLUDE_DIR )
-#    # HepPDT was not found in CLHEP
-#    SET( CLHEP_includes_HepPDT FALSE )
-#
-#    IF( DEFINED HepPDT_HOME OR DEFINED ENV{HEPPDT} )
-#
-#        # write HepPDT_HOME to cache
-#        IF( NOT DEFINED HepPDT_HOME )
-#            SET( HepPDT_HOME "$ENV{HEPPDT}" )
-#        ENDIF()
-#        SET( HepPDT_HOME "${HepPDT_HOME}" CACHE PATH "Path to HepPDT" FORCE )
-#
-#        # find include dir
-#        FIND_PATH( HepPDT_INCLUDE_DIR
-#            NAMES HepPDT/ParticleID.hh
-#            PATHS ${HepPDT_HOME}
-#            PATH_SUFFIXES include
-#            NO_DEFAULT_PATH )
-#    ELSE()
-#        IF( NOT CLHEP_FIND_QUIETLY )
-#            MESSAGE( STATUS "Check for HepPDT: HepPDT_HOME not set!!" )
-#            MESSAGE( STATUS "Please define it with cmake -DHepPDT_HOME=<Path_to_HepPDT>" )
-#        ENDIF()
-#    ENDIF()
-#ENDIF()
-
-## HepPDT - libraries
-#SET( HepPDT_FINDLIB_FAILED FALSE )
-#MARK_AS_ADVANCED( HepPDT_FINDLIB_FAILED )
-#
-#IF( NOT CLHEP_includes_HepPDT )
-#    SET( HepPDT_LIB_NAMES HepPDT HepPID )
-#    MARK_AS_ADVANCED( HepPDT_LIB_NAMES )
-#
-#    FOREACH( libname ${HepPDT_LIB_NAMES} )
-#
-#        SET( HepPDT_LIB_${libname} HepPDT_LIB_${libname}-NOTFOUND )
-#        MARK_AS_ADVANCED( HepPDT_LIB_${libname} )
-#
-#        FIND_LIBRARY( HepPDT_LIB_${libname}
-#            NAMES ${libname}
-#            PATHS ${HepPDT_HOME}
-#            PATH_SUFFIXES lib
-#            NO_DEFAULT_PATH )
-#
-#        IF( NOT HepPDT_LIB_${libname} )
-#            SET( HepPDT_FINDLIB_FAILED TRUE )
-#            IF( NOT CLHEP_FIND_QUIETLY )
-#                MESSAGE( STATUS "Check for HepPDT -- failed to find ${libname} library!!" )
-#            ENDIF()
-#        ELSE()
-#            LIST( APPEND HepPDT_LIBS ${HepPDT_LIB_${libname}} )
-#        ENDIF()
-#    ENDFOREACH()
-#ENDIF()
-
-# CLHEP include dir
-SET( CLHEP_INCLUDE_DIR CLHEP_INCLUDE_DIR-NOTFOUND )
-MARK_AS_ADVANCED( CLHEP_INCLUDE_DIR )
-
-FIND_PATH( CLHEP_INCLUDE_DIR
-    NAMES CLHEP/Vector/ThreeVector.h
-    PATHS ${CLHEP_HOME}
-    PATH_SUFFIXES include
-    NO_DEFAULT_PATH )
-
-IF( NOT CLHEP_INCLUDE_DIR AND NOT CLHEP_FIND_QUIETLY )
-    MESSAGE( STATUS "Check for CLHEP: ${CLHEP_HOME}"
-            " -- failed to find CLHEP include directory!!" )
-ENDIF()
-
-# CLHEP library
-SET( CLHEP_LIB CLHEP_LIB-NOTFOUND )
-MARK_AS_ADVANCED( CLHEP_LIB )
-
-FIND_LIBRARY( CLHEP_LIB
-    NAMES CLHEP
-    PATHS ${CLHEP_HOME}
-    PATH_SUFFIXES lib
-    NO_DEFAULT_PATH )
-
-IF( NOT CLHEP_LIB AND NOT CLHEP_FIND_QUIETLY )
-    MESSAGE( STATUS "Check for CLHEP: ${CLHEP_HOME}"
-            " -- failed to find CLHEP library!!" )
-ENDIF()
-
-# set variables and display results
-IF( CLHEP_INCLUDE_DIR AND CLHEP_LIB )
-    #AND HepPDT_INCLUDE_DIR AND NOT HepPDT_FINDLIB_FAILED )
-
-    SET( CLHEP_FOUND TRUE )
-    IF( CLHEP_includes_HepPDT )
-        SET( CLHEP_LIBRARIES ${CLHEP_LIB} )
-        SET( CLHEP_INCLUDE_DIRS ${CLHEP_INCLUDE_DIR} )
-        SET( CLHEP_DEFINITIONS "-DUSE_CLHEP" )
-    ELSE()
-        SET( CLHEP_LIBRARIES ${CLHEP_LIB} ${HepPDT_LIBS} )
-        SET( CLHEP_INCLUDE_DIRS ${CLHEP_INCLUDE_DIR} ${HepPDT_INCLUDE_DIR} )
-        SET( CLHEP_DEFINITIONS "-DUSE_CLHEP -DUSE_SEPARATE_HEPPDT" )
-    ENDIF()
-    MARK_AS_ADVANCED( CLHEP_INCLUDE_DIRS CLHEP_LIBRARIES CLHEP_DEFINITIONS )
-    MESSAGE( STATUS "Check for CLHEP: ${CLHEP_HOME} -- works" )
-ELSE()
-    IF( CLHEP_FIND_REQUIRED )
-        MESSAGE( FATAL_ERROR "Check for CLHEP: ${CLHEP_HOME} -- failed!!" )
-    ENDIF()
-    IF( NOT CLHEP_FIND_QUIETLY )
-        MESSAGE( STATUS "Check for CLHEP: ${CLHEP_HOME}"
-                " -- failed!! will skip this package..." )
-    ENDIF()
-ENDIF()


Updating ITK superbuild towards v4.8.1 pending release

Change-Id: I382f994d50092fe8cd6d5308da789cbd4925bb8a

--- SuperBuild/External_ITK.cmake
+++ SuperBuild/External_ITK.cmake
@@ -35,7 +35,8 @@
 set(ITK_REPOSITORY git://itk.org/ITK.git)

 # NOTE: it is very important to update the ITK_DIR path with the ITK version
-set(ITK_TAG_COMMAND GIT_TAG 0ccdf6f19d36b812c77bfc4fa4ff9dfd6243ac66) # after v4.7.2 release
+set(ITK_TAG_COMMAND GIT_TAG 3eaba76ccecb4128e91073b1e45058675a365025)
+# right before v4.8.1 release

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


Update ITK superbuild version

Update ITK superbuild version

This include a patch to the OnePlusOne optimizer

Change-Id: I2ad8d3f7304cfe70e55bca4ab4af2d3c646a8cf7

--- SuperBuild/External_ITK.cmake
+++ SuperBuild/External_ITK.cmake
@@ -42,7 +42,7 @@
 endif()

 # NOTE: it is very important to update the ITK_DIR path with the ITK version
-set(ITK_TAG_COMMAND GIT_TAG v4.11rc02 )# ITK 4.11 under development
+set(ITK_TAG_COMMAND GIT_TAG e234d4df432387f5cd667a91c958be9d79892815 )# ITK 4.11 post rc2

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


boost use script updated for 1.75.0

boost use script updated for 1.75.0

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

--- projects/use/usexp-boost-config.cmake
+++ projects/use/usexp-boost-config.cmake
@@ -14,36 +14,33 @@
 endif()
 set(BOOST_VERSION "${BOOST_VER} [@PROJECT_NAME@]")
 if(NOT DEFINED Boost_LIBS)
-  set(Boost_LIBS # dependency order
-    log_setup  # ldd:log,regex
-    log        # ldd/cmake:filesystem,thread cmake:log_setup,regex
+  # dependencies determined by examining cmake's Modules/FindBoost.cmake
+  set(Boost_LIBS   # dependency order
+    log            # dep:thread
     ######
-    thread     # ldd/cmake:system cmake:atomic,chrono,date_time
-    timer      # ldd/cmake:chrono
-    ######
-    chrono     # ldd/cmake:system
-    filesystem # ldd/cmake:system
-    graph      # ldd:regex
-    iostreams  # cmake:regex
-    random     # ldd/cmake:system
-    wserialization # ldd/cmake:serialization
+    iostreams      # dep:regex
+    json           # dep:container
+    thread         # dep:atomic,chrono,date_time
+    timer          # dep:chrono
+    wserialization # dep:serialization
     ######
     atomic
+    chrono
     container
     date_time
     exception
-    #prg_exec_monitor # excluded because of link errors
+    filesystem
+    graph
+    log_setup
+    nowide
     program_options
+    random
     regex
     serialization
-    signals
     system
     test_exec_monitor
     unit_test_framework
     )
-  # NOTE: determined boost library dependency order by building boost on linux
-  # with link=shared and runtime-link=shared and using ldd
-  # cmake dependencies by examining cmake's Modules/FindBoost.cmake
 endif()
 list(FIND Boost_LIBS iostreams idx)
 if(NOT ${idx} EQUAL -1)
@@ -70,12 +67,6 @@
 #set(Boost_DEBUG TRUE) # enable debugging output of FindBoost.cmake
 #set(Boost_DETAILED_FAILURE_MSG) # output detailed information
 set(BOOST_ROOT ${XP_ROOTDIR})
-# TODO: remove the following once FindBoost.cmake: uses -dumpfullversion, detects clang
-if(UNIX AND TRUE) #"${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
-  include(${CMAKE_CURRENT_LIST_DIR}/xpfunmac.cmake)
-  xpGetCompilerPrefix(Boost_COMPILER GCC_TWO_VER)
-  set(Boost_COMPILER "-${Boost_COMPILER}")
-endif()
 # TODO: remove the following once CMAKE_CXX_COMPILER_ARCHITECTURE_ID is defined for all supported compilers
 #   https://gitlab.kitware.com/cmake/cmake/issues/17702
 # boost versions >= 1.66.0 add an additional modifier to the library name and some compilers don't set the
@@ -115,7 +106,8 @@
     if(TARGET Boost::iostreams)
       get_target_property(libs Boost::iostreams INTERFACE_LINK_LIBRARIES)
       if(libs)
-          list(APPEND libs ${ZLIB_LIBRARIES} ${BZIP2_LIBRARIES})
+        list(TRANSFORM libs REPLACE "^bz2$" ${BZIP2_LIBRARIES})
+        list(TRANSFORM libs REPLACE "^z$" ${ZLIB_LIBRARIES})
       else()
         set(libs ${ZLIB_LIBRARIES} ${BZIP2_LIBRARIES})
       endif()


clang: explicitly enable/disable RTTI support with the compiler

Add `-frtti` to the compiler with the base flags case so that RTTI is
enabled by default with clang. Add its inverse analog,
`cxx_no_rtti_flags` in order to test the case with RTTI off, similar to
gcc.

This reduces the amount of testing/support overhead needed in the
non-RTTI case with clang, as the tests currently fail when these two
features are off with version 1.8.1. This something I used in when
investigating test failures on FreeBSD, as the tests that rely on
RTTI were failing with googletest 1.8.1 on the OS platform.

More investigation is being done to determine how this should be fixed
on FreeBSD 11.2-RELEASE with ports, as the package doesn't currently
compile the tests, and when enabled (based on my WIP diff), the tests
fail in similar ways.

Signed-off-by: Enji Cooper <d6bb01297bdcc8d1a5e14be12c1049fd9e385b00@gmail.com>

--- googletest/cmake/internal_utils.cmake
+++ googletest/cmake/internal_utils.cmake
@@ -78,10 +78,11 @@
     # http://stackoverflow.com/questions/3232669 explains the issue.
     set(cxx_base_flags "${cxx_base_flags} -wd4702")
   elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
-    set(cxx_base_flags "-Wall -Wshadow -Werror -Wno-error=sign-conversion")
+    set(cxx_base_flags "-Wall -Wshadow -Werror -Wno-error=sign-conversion -frtti")
     set(cxx_exception_flags "-fexceptions")
     set(cxx_no_exception_flags "-fno-exceptions")
     set(cxx_strict_flags "-W -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wunused-parameter -Wcast-align -Wchar-subscripts -Winline -Wredundant-decls")
+    set(cxx_no_rtti_flags "-fno-rtti")
   elseif (CMAKE_COMPILER_IS_GNUCXX)
     set(cxx_base_flags "-Wall -Wshadow -Werror")
     if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0.0)


Make it possible to pass quoted strings to clazy

Summary:
Otherwise we may end up with:
```
[2/3] Building CXX object 'debuggers/lldb/unittests/debugees/path with
space/CMakeFiles/lldb_spacedebugee.dir/spacedebugee.cpp.o'
FAILED: debuggers/lldb/unittests/debugees/path with
space/CMakeFiles/lldb_spacedebugee.dir/spacedebugee.cpp.o
/home/kfunk/devel/install/master/bin/clazy ...
-fPIC -MD -MT 'debuggers/lldb/unittests/debugees/path with
space/CMakeFiles/lldb_spacedebugee.dir/spacedebugee.cpp.o' -MF
debuggers/lldb/unittests/debugees/path\ with\
space/CMakeFiles/lldb_spacedebugee.dir/spacedebugee.cpp.o.d -o
'debuggers/lldb/unittests/debugees/path with
space/CMakeFiles/lldb_spacedebugee.dir/spacedebugee.cpp.o' -c
"/home/kfunk/devel/src/kf5/kdevelop/debuggers/lldb/unittests/debugees/path
with space/spacedebugee.cpp"
clang: error: no such file or directory: 'with'
clang: error: no such file or directory: 'space'
clang: error: no such file or directory: 'with'
clang: error: no such file or directory: 'space'
clang: error: no such file or directory: 'with'
clang: error: no such file or directory:
'space/CMakeFiles/lldb_spacedebugee.dir/spacedebugee.cpp.o'
clang: error: no such file or directory: 'with'
clang: error: no such file or directory:
'space/CMakeFiles/lldb_spacedebugee.dir/spacedebugee.cpp.o.d'
clang: error: no such file or directory: 'with'
clang: error: no such file or directory:
'space/CMakeFiles/lldb_spacedebugee.dir/spacedebugee.cpp.o'
clang: error: no such file or directory:
'/home/kfunk/devel/src/kf5/kdevelop/debuggers/lldb/unittests/debugees/path'
clang: error: no such file or directory: 'with'
clang: error: no such file or directory: 'space/spacedebugee.cpp'
clang: error: no input files
ninja: build stopped: subcommand failed.
```

Reviewers: smartins

Reviewed By: smartins

Differential Revision: https://phabricator.kde.org/D5340

--- clazy.cmake
+++ clazy.cmake
@@ -90,4 +90,4 @@
     export DYLD_LIBRARY_PATH=$(dirname $0)/lib:$DYLD_LIBRARY_PATH
 fi

-${CLANGXX:-clang++} -Qunused-arguments -Xclang -load -Xclang $ClangLazyLib -Xclang -add-plugin -Xclang clang-lazy $@
+${CLANGXX:-clang++} -Qunused-arguments -Xclang -load -Xclang $ClangLazyLib -Xclang -add-plugin -Xclang clang-lazy "$@"


vigra.cmake: Fix syntax

vigra.cmake: Fix syntax

--- vigra.cmake
+++ vigra.cmake
@@ -81,8 +81,9 @@
         -DFFTW3F_LIBRARY=
         -DFFTW3_INCLUDE_DIR=${BUILDEM_DIR}/include
         -DFFTW3_LIBRARY=${BUILDEM_DIR}/lib/libfftw3.${BUILDEM_PLATFORM_DYLIB_EXTENSION}
-        -DCMAKE_CXX_FLAGS="${CMAKE_CXX_FLAGS} -pthread"
-        -DCMAKE_CXX_LINK_FLAGS="${CMAKE_CXX_LINK_FLAGS} -pthread"
+        -DCMAKE_CXX_FLAGS=-pthread
+
+        -DCMAKE_CXX_LINK_FLAGS=-pthread
         -DCMAKE_CXX_FLAGS_RELEASE="${CMAKE_CXX_FLAGS_RELEASE}" # On the Janelia cluster, use -DCMAKE_CXX_FLAGS_RELEASE="-O2 -DNDEBUG" (not -O3)
         -DCMAKE_CXX_FLAGS_DEBUG="${CMAKE_CXX_FLAGS_DEBUG}"
     BUILD_COMMAND       ${BUILDEM_ENV_STRING} $(MAKE)


Mark various CMake variables as advanced

Mark the toolchain and unused CMake built-in variables as advanced. Mark
the loader as advanced.

--- toolchain.cmake
+++ toolchain.cmake
@@ -15,9 +15,15 @@
 # File: toolchain.cmake
 # Description: Parallax P8X32A Propeller microcontroller CMake toolchain.

-#
+# system information
 set( CMAKE_SYSTEM_NAME "Generic" )
 set( CMAKE_SYSTEM_PROCESSOR "Parallax-P8X32A" )
+
+# mark the toolchain file as advanced
+mark_as_advanced( CMAKE_TOOLCHAIN_FILE )
+
+# mark unused, built-in CMake variables as advanced
+mark_as_advanced( CMAKE_INSTALL_PREFIX )

 # locate build tools
 find_program( CMAKE_C_COMPILER   propeller-elf-gcc )
@@ -31,6 +37,7 @@

 # locate load tools
 find_program( PARALLAX_P8X32A_LOADER propeller-load )
+mark_as_advanced( PARALLAX_P8X32A_LOADER )

 # configure the Parallax P8X32A memory model
 set(


STYLE: Remove comment in ITKImageFrequency cmake

Change-Id: I6247401f635348e69d0457c040d155a55943a7ba

--- Modules/Filtering/ImageFrequency/itk-module.cmake
+++ Modules/Filtering/ImageFrequency/itk-module.cmake
@@ -14,7 +14,6 @@
   TEST_DEPENDS
     ITKTestKernel
     ITKImageIntensity
-  # EXCLUDE_FROM_DEFAULT
   DESCRIPTION
   "${DOCUMENTATION}"
   )


Update ITK superbuild to 4.4.2

Update ITK superbuild to 4.4.2

Change-Id: Ieea67fd192f9ddd341e2b32ce332d2a66f603137

--- SuperBuild/External_ITK.cmake
+++ SuperBuild/External_ITK.cmake
@@ -26,7 +26,7 @@
 set(ITK_REPOSITORY git://itk.org/ITK.git)

 # NOTE: it is very important to update the ITK_DIR path with the
-set(ITK_TAG_COMMAND GIT_TAG v4.4.1
+set(ITK_TAG_COMMAND GIT_TAG v4.4.2
  )

 if( ${ITK_WRAPPING} OR ${BUILD_SHARED_LIBS} )


Remove out dated comment

Remove out dated comment

--- SuperBuild/External_ITK.cmake
+++ SuperBuild/External_ITK.cmake
@@ -47,7 +47,6 @@
 mark_as_advanced(ITK_GIT_REPOSITORY)
 sitk_legacy_naming(ITK_GIT_REPOSITORY ITK_REPOSITORY)

-# NOTE: it is very important to update the ITK_DIR path with the ITK version
 set(ITK_GIT_TAG "v4.12.0" CACHE STRING "Tag in ITK git repo")
 mark_as_advanced(ITK_GIT_TAG)
 set(ITK_TAG_COMMAND GIT_TAG "${ITK_GIT_TAG}")


BUG: VXL visibility must match ITK visibility

Setting target properties

Modules/ThirdParty/VNL/src/vxl/config/cmake/config/vxl_utils.cmake
  if (BUILD_SHARED_LIBS)  <-- WRONG
    # Prefer to use target properties supported by newer cmake
    set_target_properties(${LSLHVP_TARGET_NAME} PROPERTIES CXX_VISIBILITY_PRESET hidden)
    set_target_properties(${LSLHVP_TARGET_NAME} PROPERTIES C_VISIBILITY_PRESET hidden)
    set_target_properties(${LSLHVP_TARGET_NAME} PROPERTIES VISIBILITY_INLINES_HIDDEN 1)
  endif()

needs to match condition in ITK:

CMake/ITKModuleMacros.cmake:
  if( (ITK_MODULE_${itk-module}_ENABLE_SHARED AND BUILD_SHARED_LIBS) OR (APPLE AND NOT BUILD_SHARED_LIBS) )

============
Condidtion for using hidden visibility changed to:
if (BUILD_SHARED_LIBS  OR (APPLE AND NOT BUILD_SHARED_LIBS) )

Change-Id: Ia72c8c8ae6ff467d80835f62a8b1369928650f60

--- Modules/ThirdParty/VNL/src/vxl/config/cmake/config/vxl_utils.cmake
+++ Modules/ThirdParty/VNL/src/vxl/config/cmake/config/vxl_utils.cmake
@@ -181,7 +181,7 @@
         message(FATAL_ERROR "INSTALL_DIR REQUIRED when using USE_HIDDEN_VISIBILITY")
     endif()

-    if (BUILD_SHARED_LIBS)
+    if (BUILD_SHARED_LIBS OR (APPLE AND NOT BUILD_SHARED_LIBS) ) #APPLE Respects hidden visibility for static builds
       # export flags are only added when building shared libs, they cause
       # mismatched visibility warnings when building statically.
       if(CMAKE_VERSION VERSION_LESS 2.8.12)


force to add install/test step

force to add install/test step

--- cmake/InstallExternalProjects.cmake
+++ cmake/InstallExternalProjects.cmake
@@ -40,26 +40,16 @@
                 DEPENDERS   install
             )

-            ExternalProject_Get_Property(${project_name} TEST_COMMAND)
-
-            if (${TEST_COMMAND})
-                ExternalProject_Add_Step(${project_name} ${project_name}_test
-                    COMMAND     echo "\\ntravis_fold:end:${project_name}.install\r"
-                    COMMAND     echo "\\ntravis_fold:start:${project_name}.test\tTest ${project_name}"
-                    DEPENDEES   install
-                    DEPENDERS   test
-                )
-                ExternalProject_Add_Step(${project_name} ${project_name}_end
-                    COMMAND     echo "\\ntravis_fold:end:${project_name}.test\r"
-                    DEPENDEES   test
-                )
-            elseif ()
-                ExternalProject_Add_Step(${project_name} ${project_name}_end
-                    COMMAND     echo "\\ntravis_fold:end:${project_name}.install\r"
-                    DEPENDEES   install
-                    DEPENDERS   test
-                )
-            endif ()
+            ExternalProject_Add_Step(${project_name} ${project_name}_test
+                COMMAND     echo "\\ntravis_fold:end:${project_name}.install\r"
+                COMMAND     echo "\\ntravis_fold:start:${project_name}.test\tTest ${project_name}"
+                DEPENDEES   install
+                DEPENDERS   test
+            )
+            ExternalProject_Add_Step(${project_name} ${project_name}_end
+                COMMAND     echo "\\ntravis_fold:end:${project_name}.test\r"
+                DEPENDEES   test
+            )
         endif ()
     endif ()
 endmacro ()


Add missing endline

Add missing endline

--- cmake/JPetFramework-Utilities.cmake
+++ cmake/JPetFramework-Utilities.cmake
@@ -85,4 +85,4 @@
   endif()
   # return generated dictionary sources to given variable
   set(${OUT_VAR} ${dictionaries} PARENT_SCOPE)
-endfunction()+endfunction()