ENH: Amend Hippo compiler options

ENH: Amend Hippo compiler options

--- Hippo_Kitware_TubeTK_Nightly.cmake
+++ Hippo_Kitware_TubeTK_Nightly.cmake
@@ -128,8 +128,8 @@
 set( SITE_EXECUTABLE_DIRS "${SITE_KWSTYLE_DIR}" )
 set( ENV{PATH} "${SITE_EXECUTABLE_DIRS}:$ENV{PATH}" )

-set( SITE_C_FLAGS "-fPIC -fdiagnostics-show-option -W -Wall -Wextra -Wshadow -Wno-system-headers -Wwrite-strings -Wno-deprecated -Wno-deprecated-declarations -Wno-incompatible-pointer-types -Wno-invalid-source-encoding -Wno-sometimes-uninitialized" )
-set( SITE_CXX_FLAGS "-fPIC -fdiagnostics-show-option -W -Wall -Wextra -Wshadow -Wno-system-headers -Wwrite-strings -Wno-deprecated -Wno-deprecated-declarations -Wno-incompatible-pointer-types -Wno-invalid-source-encoding -Wno-sometimes-uninitialized -Woverloaded-virtual -Wno-unused-private-field" )
+set( SITE_C_FLAGS "-fPIC -W -Wall -Wextra -Wshadow -Wno-system-headers -Wwrite-strings -Wno-deprecated -Wno-deprecated-declarations -Wno-incompatible-pointer-types -Wno-invalid-source-encoding -Wno-sometimes-uninitialized -fno-diagnostics-fixit-info -fno-diagnostics-show-option -fno-show-column -fno-caret-diagnostics -fno-color-diagnostics" )
+set( SITE_CXX_FLAGS "-fPIC -W -Wall -Wextra -Wshadow -Wno-system-headers -Wwrite-strings -Wno-deprecated -Wno-deprecated-declarations -Wno-incompatible-pointer-types -Wno-invalid-source-encoding -Wno-sometimes-uninitialized -Woverloaded-virtual -Wno-unused-private-field -fno-diagnostics-fixit-info -fno-diagnostics-show-option -fno-show-column -fno-caret-diagnostics -fno-color-diagnostics" )
 set( SITE_EXE_LINKER_FLAGS "" )
 set( SITE_SHARED_LINKER_FLAGS "${SITE_EXE_LINKER_FLAGS}" )


Add fpie option to travis memcheck

Add fpie option to travis memcheck

--- Testing/script/travis_script.cmake
+++ Testing/script/travis_script.cmake
@@ -81,7 +81,7 @@
     #set(CTEST_MEMORYCHECK_SUPPRESSIONS_FILE ${CTEST_SCRIPT_DIRECTORY}/MercuryValgrindSuppressions.supp)
   endif()
   if(${MERCURY_MEMORYCHECK_TYPE} MATCHES "ThreadSanitizer")
-    set(MERCURY_MEMCHECK_FLAGS "-O1 -fsanitize=thread -fno-omit-frame-pointer -fPIC")
+    set(MERCURY_MEMCHECK_FLAGS "-O1 -fsanitize=thread -fno-omit-frame-pointer -fpie")
   endif()

   # needed by mercury_common.cmake


nrfconnect: fix warning when compiling c files (#15565)

--- config/nrfconnect/app/enable-gnu-std.cmake
+++ config/nrfconnect/app/enable-gnu-std.cmake
@@ -1,3 +1,6 @@
 add_library(gnu17 INTERFACE)
-target_compile_options(gnu17 INTERFACE -std=gnu++17 -D_SYS__PTHREADTYPES_H_)
+target_compile_options(gnu17
+    INTERFACE
+        $<$<COMPILE_LANGUAGE:CXX>:-std=gnu++17>
+        -D_SYS__PTHREADTYPES_H_)
 target_link_libraries(app PRIVATE gnu17)


Remove default timeout value

Remove default timeout value

--- cmake/Modules/SampPluginTest.cmake
+++ cmake/Modules/SampPluginTest.cmake
@@ -28,25 +28,23 @@
 	if(NOT ARG_SCRIPT)
 		set(ARG_SCRIPT "${CMAKE_CURRENT_SOURCE_DIR}/${name}")
 	endif()
-	if(NOT ARG_TIMEOUT)
-		set(ARG_TIMEOUT "0.5")
-	endif()
 	if(NOT ARG_EXEC)
 		set(ARG_EXEC "${CMAKE_CURRENT_SOURCE_DIR}/${name}.cfg")
+	endif()
+	if(ARG_TIMEOUT)
+		list(APPEND arguments "--timeout" "${ARG_TIMEOUT}")
+	endif()
+	if(EXISTS "${ARG_EXEC}")
+		list(APPEND arguments "--exec" "${ARG_EXEC}")
 	endif()

 	get_target_property(PLUGIN_PATH ${ARG_TARGET} LOCATION)

 	list(APPEND arguments
 		"--output"
-		"--timeout"  "${ARG_TIMEOUT}"
 		"--plugin"   "${PLUGIN_PATH}"
 		"--gamemode" "${ARG_SCRIPT}"
 	)
-
-	if(EXISTS "${ARG_EXEC}")
-		list(APPEND arguments "--exec" "${ARG_EXEC}")
-	endif()

 	file(READ "${ARG_OUT_FILE}" out)


Inline documentation of configure_radium_plugin and less trace messages in cmake scripts

--- cmake/radium_setup_functions.cmake
+++ cmake/radium_setup_functions.cmake
@@ -464,26 +464,25 @@
         message(FATAL_ERROR " [configure_radium_app] You must provide the main target of the application")
     endif ()
     # configure the application
+    message(STATUS " Configuring application ${ARGS_NAME} for being relocatable after installation.")
     if (APPLE)
         get_target_property(IsMacBundle ${ARGS_NAME} MACOSX_BUNDLE)
         if (IsMacBundle)
-            message(STATUS " Configuring application ${ARGS_NAME} as a MacOs Bundled application")
             configure_bundled_Radium_app(${ARGN})
         else ()
-            message(STATUS " Configuring application ${ARGS_NAME} as a command line application")
             configure_cmdline_Radium_app(${ARGN})
         endif ()
     else ()
-        message(STATUS " Configuring application ${ARGS_NAME} as a command line application")
         configure_cmdline_Radium_app(${ARGN})
-    endif ()
-
-    get_target_property(IsUsingQt ${ARGS_NAME} LINK_LIBRARIES)
-    list(FIND IsUsingQt "Qt5::Core" QTCOREIDX)
-    if(NOT QTCOREIDX EQUAL -1)
-        if (MSVC OR MSVC_IDE OR MINGW)
-            message(STATUS " Preparing call to WinDeployQT for application ${ARGS_NAME}")
-            windeployqt( ${ARGS_NAME} bin )
+        get_target_property(IsUsingQt ${ARGS_NAME} LINK_LIBRARIES)
+        list(FIND IsUsingQt "Qt5::Core" QTCOREIDX)
+        if(NOT QTCOREIDX EQUAL -1)
+            if (MSVC OR MSVC_IDE OR MINGW)
+                message(STATUS " Preparing call to WinDeployQT for application ${ARGS_NAME}")
+                windeployqt( ${ARGS_NAME} bin )
+            else()
+                message(STATUS " Deploying QT is not yet supported for application ${ARGS_NAME} on ${CMAKE_SYSTEM_NAME}")
+            endif ()
         endif ()
     endif ()
 endfunction()
@@ -496,8 +495,10 @@
 # or, for bundled application, at install time by adding the available plugins into the bundle
 # usage :
 #   configure_radium_plugin(
-#         NAME theTargetName # <- this must be a plugin
-#         RESOURCES ResourceDir1 ResourceDir2 # <- accept a list of directories
+#         NAME pluginName                            # Name of the target (standard dynamic library) corresponding to the plugin
+#         [RESOURCES ResourceDir1 [ResourceDir2 ...] # Optional. List of resources directories (only directorizq
+#         [HELPER_LIBS lib1 [lib2 ...]]              # Optional. List of libraries (local target or imported targets) the plugin depends on
+#         [INSTALL_IN_RADIUM_BUNDLE]                 # Optional. If given, the plugin is installed into ${RADIUM_ROOT_DIR}/Plugins. If not, the installation is performed into ${CMAKE_INSTALL_PREFIX}
 # )
 function(configure_radium_plugin)
     # "declare" and parse parameters


removing toolchain file for i586 mingw32. GLFW cross compilation failed with this compiler. No time and no use to fix it

--- cmake/toolchain-i586-mingw32.cmake
+++ cmake/toolchain-i586-mingw32.cmake
@@ -1,25 +0,0 @@
-# the name of the target operating system
-set(CMAKE_SYSTEM_NAME Windows)
-set(CMAKE_SYSTEM_VERSION 1)
-
-add_definitions(-D__MSVCRT_VERSION__=0x0710)
-
-# which compilers to use for C and C++
-set(CMAKE_C_COMPILER i586-mingw32msvc-gcc)
-set(CMAKE_CXX_COMPILER i586-mingw32msvc-g++)
-set(CMAKE_RC_COMPILER i586-mingw32msvc-windres)
-set(CMAKE_RANLIB i586-mingw32msvc-ranlib)
-
-SET(WINDOWS "ON" CACHE INTERNAL "windows system")
-
-# here is the target environment located
-set(CMAKE_FIND_ROOT_PATH /usr/i586-mingw32msvc/)
-
-# adjust the default behaviour of the FIND_XXX() commands:
-# search headers and libraries in the target environment, search
-# programs in the host environment
-set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
-set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
-set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
-
-


[Build] Improved PythonLibs support on RedHat/CentOS/EPEL.

--- config/FindPythonLibsWrapper.cmake
+++ config/FindPythonLibsWrapper.cmake
@@ -2,8 +2,16 @@
 # script. Indeed, that latter does not work well on EPEL 5, where only the Python
 # static library is searched. In that latter case, the Python dynamic library is
 # searched, and the PYTHON_LIBRARIES variable re-set accordingly.
+# Moreover, on EPEL 5 and 6, only PYTHON_INCLUDE_PATH is defined, where as
+# PYTHON_INCLUDE_DIRS is expected to be set.
+
 #
+if (PYTHON_INCLUDE_PATH AND "${PYTHON_INCLUDE_DIRS}" STREQUAL "")
+  set (PYTHON_INCLUDE_DIRS ${PYTHON_INCLUDE_PATH} PARENT_SCOPE)
+  set (PYTHON_INCLUDE_DIRS ${PYTHON_INCLUDE_PATH})
+endif ()

+#
 if ("${PYTHON_LIBRARIES}" MATCHES "libpython[1-9.]*.a")
   # The PythonLibs finder has found only the static library
   message (STATUS "The Python static library has been found by the regular PythonLibs finder: ${PYTHON_LIBRARIES}")


Fixed yaml-cpp.pc file (with prefix)

Fixed yaml-cpp.pc file (with prefix)

--- yaml-cpp.pc.cmake
+++ yaml-cpp.pc.cmake
@@ -1,7 +1,7 @@
 prefix=@CMAKE_INSTALL_PREFIX@
 exec_prefix=@CMAKE_INSTALL_PREFIX@
-libdir=@LIB_INSTALL_DIR@
-includedir=@INCLUDE_INSTALL_DIR@
+libdir=${prefix}/@LIB_INSTALL_DIR@
+includedir=${prefix}/@INCLUDE_INSTALL_DIR@

 Name: Yaml-cpp
 Description: A YAML parser and emitter for C++


Update CompilerOption.cmake

Update CompilerOption.cmake

--- project/cmake/CompilerOption.cmake
+++ project/cmake/CompilerOption.cmake
@@ -276,8 +276,9 @@
             endif()
         endif()
     else()
-        if(NOT CMAKE_MSVC_RUNTIME)
+        if(NOT CMAKE_MSVC_RUNTIME AND NOT CMAKE_MSVC_RUNTIME_LIBRARY)
             set(CMAKE_MSVC_RUNTIME "MD")
+            set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>DLL")
         endif()
         add_compiler_flags_to_var(CMAKE_CXX_FLAGS_DEBUG /Od /${CMAKE_MSVC_RUNTIME}d)
         add_compiler_flags_to_var(CMAKE_CXX_FLAGS_RELEASE /O2 /${CMAKE_MSVC_RUNTIME} /D NDEBUG)


[build][cosmetic] Fix a build error message

--- other/errors.cmake
+++ other/errors.cmake
@@ -19,7 +19,7 @@
 function (show_missing_use_syscc_error)

    set(msg "")
-   string(CONCAT msg "In order to build Tilck on this host architecture"
+   string(CONCAT msg "In order to build Tilck on this host architecture "
                      "the env variables USE_SYSCC, CC and CXX *must be* set. "
                      "WARNING: this scenario is *not* supported in an official"
                      " way, even if it should work.")


Fix an Android ABI include path in android.toolchain.cmake

--- toolchains/android.toolchain.cmake
+++ toolchains/android.toolchain.cmake
@@ -1036,7 +1036,7 @@
     if( X86 )
         set( ANDROID_ABI_INCLUDE_DIRS "${ANDROID_CXX_ROOT}/gabi++/include" )
     else()
-        set( ANDROID_ABI_INCLUDE_DIRS "${ANDROID_CXX_ROOT}/llvm-libc++abi/include" )
+        set( ANDROID_ABI_INCLUDE_DIRS "${ANDROID_CXX_ROOT}/llvm-libc++abi/libcxxabi/include" )
     endif()
     set( ANDROID_STL_INCLUDE_DIRS     "${ANDROID_LLVM_ROOT}/libcxx/include" "${ANDROID_ABI_INCLUDE_DIRS}" )
     # android support sfiles


Windows does require the .pyd suffix, linux requires the .so

--- tools/cmake/ANHPythonBinding.cmake
+++ tools/cmake/ANHPythonBinding.cmake
@@ -103,12 +103,19 @@
         LINK_DIRECTORIES(${ANHPYTHONLIB_ADDITIONAL_LIBRARY_DIRS})
     ENDIF()

+    if(WIN32)
+        set(BINDING_POSTFIX .pyd)
+    else()
+        set(BINDING_POSTFIX ${CMAKE_SHARED_LIBRARY_SUFFIX})
+    endif()
+
     # Create the Common library
     ADD_LIBRARY(${name} SHARED ${ANHPYTHONLIB_SOURCES})
     SET_TARGET_PROPERTIES(${name}
         PROPERTIES OUTPUT_NAME py_${base_name}
-        LIBRARY_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
-        PREFIX "")
+        PREFIX ""
+        SUFFIX "${BINDING_POSTFIX}"
+    )

     IF(_project_deps_list_length GREATER 0)
         ADD_DEPENDENCIES(${name} ${ANHPYTHONLIB_DEPENDS})


Revert "Reverting benchmark cmake changes. They break out-of-tree benchmark builds, which is used by some bots"

This reverts commit db21063afae47d3dac2f6e00dd55157182534bcd.

--- benchmark/cmake/modules/AddSwiftBenchmarkSuite.cmake
+++ benchmark/cmake/modules/AddSwiftBenchmarkSuite.cmake
@@ -21,7 +21,7 @@
 endfunction(runcmd)

 function (add_swift_benchmark_library objfile_out sibfile_out)
-  cmake_parse_arguments(BENCHLIB "" "MODULE_PATH;SOURCE_DIR;OBJECT_DIR" "SOURCES;LIBRARY_FLAGS" ${ARGN})
+  cmake_parse_arguments(BENCHLIB "" "MODULE_PATH;SOURCE_DIR;OBJECT_DIR" "SOURCES;LIBRARY_FLAGS;DEPENDS" ${ARGN})

   precondition(BENCHLIB_MODULE_PATH)
   precondition(BENCHLIB_SOURCE_DIR)
@@ -40,7 +40,7 @@
   precondition(objfile_out)
   add_custom_command(
     OUTPUT "${objfile}"
-    DEPENDS ${stdlib_dependencies} ${sources}
+    DEPENDS ${stdlib_dependencies} ${sources} ${BENCHLIB_DEPENDS}
     COMMAND "${SWIFT_EXEC}"
       ${BENCHLIB_LIBRARY_FLAGS}
       "-force-single-frontend-invocation"
@@ -59,7 +59,7 @@
     add_custom_command(
       OUTPUT "${sibfile}"
       DEPENDS
-      ${stdlib_dependencies} ${sources}
+      ${stdlib_dependencies} ${sources} ${BENCHLIB_DEPENDS}
       COMMAND "${SWIFT_EXEC}"
         ${BENCHLIB_LIBRARY_FLAGS}
         "-force-single-frontend-invocation"
@@ -121,89 +121,47 @@
   set(bench_library_sibfiles)
   # Build libraries used by the driver and benchmarks.
   foreach(module_name_path ${BENCH_LIBRARY_MODULES})
-    get_filename_component(module_name "${module_name_path}" NAME)
-
-    set(objfile "${objdir}/${module_name}.o")
-    set(swiftmodule "${objdir}/${module_name}.swiftmodule")
-    set(source "${srcdir}/${module_name_path}.swift")
-    list(APPEND bench_library_objects "${objfile}")
-    add_custom_command(
-        OUTPUT "${objfile}"
-        DEPENDS
-          ${stdlib_dependencies} "${source}" ${extra_sources}
-        COMMAND "${SWIFT_EXEC}"
-        ${common_options}
-        "-force-single-frontend-invocation"
-        "-parse-as-library"
-        "-module-name" "${module_name}"
-        "-emit-module" "-emit-module-path" "${swiftmodule}"
-        "-o" "${objfile}"
-        "${source}" ${extra_sources})
+    set(sources "${srcdir}/${module_name_path}.swift")
+
+    add_swift_benchmark_library(objfile_out sibfile_out
+      MODULE_PATH "${module_name_path}"
+      SOURCE_DIR "${srcdir}"
+      OBJECT_DIR "${objdir}"
+      SOURCES ${sources}
+      LIBRARY_FLAGS ${common_options})
+    precondition(objfile_out)
+    list(APPEND bench_library_objects "${objfile_out}")
     if (SWIFT_BENCHMARK_EMIT_SIB)
-      set(sibfile "${objdir}/${module_name}.sib")
-      list(APPEND bench_library_sibfiles "${sibfile}")
-      add_custom_command(
-          OUTPUT "${sibfile}"
-          DEPENDS
-            ${stdlib_dependencies} "${srcdir}/${module_name_path}.swift"
-            ${extra_sources}
-          COMMAND "${SWIFT_EXEC}"
-          ${common_options}
-          "-force-single-frontend-invocation"
-          "-parse-as-library"
-          "-module-name" "${module_name}"
-          "-emit-sib"
-          "-o" "${sibfile}"
-          "${source}" ${extra_sources})
+      precondition(sibfile_out)
+      list(APPEND bench_library_sibfiles "${sibfile_out}")
     endif()
   endforeach()
+  precondition(bench_library_objects)

   set(bench_driver_objects)
   set(bench_driver_sibfiles)
   foreach(module_name_path ${BENCH_DRIVER_LIBRARY_MODULES})
+    set(sources "${srcdir}/${module_name_path}.swift")
+
     get_filename_component(module_name "${module_name_path}" NAME)
-
     if("${module_name}" STREQUAL "DriverUtils")
-      set(extra_sources "${srcdir}/utils/ArgParse.swift")
-    endif()
-
-    set(objfile "${objdir}/${module_name}.o")
-    set(swiftmodule "${objdir}/${module_name}.swiftmodule")
-    list(APPEND bench_driver_objects "${objfile}")
-    set(source "${srcdir}/${module_name_path}.swift")
-    add_custom_command(
-        OUTPUT "${objfile}"
-        DEPENDS
-          ${stdlib_dependencies} ${bench_library_objects} ${source}
-          ${extra_sources}
-        COMMAND "${SWIFT_EXEC}"
-        ${common_options_driver}
-        ${BENCH_DRIVER_LIBRARY_FLAGS}
-        "-force-single-frontend-invocation"
-        "-parse-as-library"
-        "-module-name" "${module_name}"
-        "-emit-module" "-emit-module-path" "${swiftmodule}"
-        "-I" "${objdir}"
-        "-o" "${objfile}"
-        "${source}" ${extra_sources})
-    if(SWIFT_BENCHMARK_EMIT_SIB)
-      set(sibfile "${objdir}/${module_name}.sib")
-      list(APPEND bench_driver_sibfiles "${sibfile}")
-      add_custom_command(
-          OUTPUT "${sibfile}"
-          DEPENDS
-            ${stdlib_dependencies} ${bench_library_objects} ${source}
-            ${extra_sources}
-          COMMAND "${SWIFT_EXEC}"
-          ${common_options_driver}
-          ${BENCH_DRIVER_LIBRARY_FLAGS}
-          "-force-single-frontend-invocation"
-          "-parse-as-library"
-          "-module-name" "${module_name}"
-          "-emit-sib"
-          "-I" "${objdir}"
-          "-o" "${sibfile}"
-          "${source}" ${extra_sources})
+      list(APPEND sources "${srcdir}/utils/ArgParse.swift")
+    endif()
+
+    set(objfile_out)
+    set(sibfile_out)
+    add_swift_benchmark_library(objfile_out sibfile_out
+      MODULE_PATH "${module_name_path}"
+      SOURCE_DIR "${srcdir}"
+      OBJECT_DIR "${objdir}"
+      SOURCES ${sources}
+      LIBRARY_FLAGS ${common_options_driver} ${BENCH_DRIVER_LIBRARY_FLAGS}
+      DEPENDS ${bench_library_objects})
+    precondition(objfile_out)
+    list(APPEND bench_driver_objects "${objfile_out}")
+    if (SWIFT_BENCHMARK_EMIT_SIB)
+      precondition(sibfile_out)
+      list(APPEND bench_driver_sibfiles "${sibfile_out}")
     endif()
   endforeach()


ENH: MIDAS+CTest script: only verify md5sum when the data is downloaded.  If it already exists, we assume it is correct.

SVN-Revision: 3071

--- Application/CMakeScript/MIDAS.cmake
+++ Application/CMakeScript/MIDAS.cmake
@@ -89,22 +89,23 @@
   "message(STATUS \"Data is here: ${MIDAS_REST_URL}/midas.bitstream.by.hash?hash=${checksum}&algorithm=${hash_alg}\")
 if(NOT EXISTS \"${MIDAS_DATA_DIR}/${checksum}\")
   file(DOWNLOAD ${MIDAS_REST_URL}/midas.bitstream.by.hash?hash=${checksum}&algorithm=${hash_alg} \"${MIDAS_DATA_DIR}/${testName}_${checksum}\" ${MIDAS_DOWNLOAD_TIMEOUT_STR} STATUS status)
-  file(RENAME \"${MIDAS_DATA_DIR}/${testName}_${checksum}\" \"${MIDAS_DATA_DIR}/${checksum}\")
   list(GET status 0 exitCode)
   list(GET status 1 errMsg)
   if(NOT exitCode EQUAL 0)
-    file(REMOVE \"${MIDAS_DATA_DIR}/${checksum}\")
+    file(REMOVE \"${MIDAS_DATA_DIR}/${testName}_${checksum}\")
     message(FATAL_ERROR \"Error downloading ${checksum}: \${errMsg}\")
   endif(NOT exitCode EQUAL 0)
+
+  execute_process(COMMAND \"${CMAKE_COMMAND}\" -E md5sum \"${MIDAS_DATA_DIR}/${testName}_${checksum}\" OUTPUT_VARIABLE output)
+  string(SUBSTRING \${output} 0 32 computedChecksum)
+
+  if(NOT computedChecksum STREQUAL ${checksum})
+    file(REMOVE \"${MIDAS_DATA_DIR}/${testName}_${checksum}\")
+    message(FATAL_ERROR \"Error: Computed checksum (\${computedChecksum}) did not match expected (${checksum})\")
+  else(NOT computedChecksum STREQUAL ${checksum})
+    file(RENAME \"${MIDAS_DATA_DIR}/${testName}_${checksum}\" \"${MIDAS_DATA_DIR}/${checksum}\")
+  endif(NOT computedChecksum STREQUAL ${checksum})
 endif(NOT EXISTS \"${MIDAS_DATA_DIR}/${checksum}\")
-
-execute_process(COMMAND \"${CMAKE_COMMAND}\" -E md5sum \"${MIDAS_DATA_DIR}/${checksum}\" OUTPUT_VARIABLE output)
-string(SUBSTRING \${output} 0 32 computedChecksum)
-
-if(NOT computedChecksum STREQUAL ${checksum})
-  file(REMOVE \"${MIDAS_DATA_DIR}/${checksum}\")
-  message(FATAL_ERROR \"Error: Computed checksum (\${computedChecksum}) did not match expected (${checksum})\")
-endif(NOT computedChecksum STREQUAL ${checksum})
 ")

       list(APPEND downloadScripts "${MIDAS_DATA_DIR}/FetchScripts/download_${checksum}.cmake")


Fix compilation warnings with vtkPickingManager

Issue #9

--- CMake/SuperBuild/External_VTK.cmake
+++ CMake/SuperBuild/External_VTK.cmake
@@ -50,7 +50,7 @@

   #set(revision_tag "v5.8.0")
   #set(revision_tag fea2d622cf01dfd22f727330dbace97d4af892db)
-  set(revision_tag 1542ba1809f7d87c6c88015c056af39084d00ea4)
+  set(revision_tag 0044aa72799d75a12a21daf575f83b15d038d120)
   if(${proj}_REVISION_TAG)
     set(revision_tag ${${proj}_REVISION_TAG})
   endif()


Changed libdir/includedir variables to change based on a user's system and match syntax

--- taglib-config.cmake
+++ taglib-config.cmake
@@ -16,8 +16,8 @@

 prefix=@CMAKE_INSTALL_PREFIX@
 exec_prefix=@CMAKE_INSTALL_PREFIX@
-libdir=${exec_prefix}/lib
-includedir=${prefix}/include
+libdir=@LIB_INSTALL_DIR@
+includedir=@INCLUDE_INSTALL_DIR@

 flags=""


Fix missing pcre library in FindOpenCOLLADA.cmake.

--- build/modules/FindOpenCOLLADA.cmake
+++ build/modules/FindOpenCOLLADA.cmake
@@ -111,14 +111,17 @@

         FIND_LIBRARY(OpenCOLLADA_XML_LIBRARIES NAMES xml2 PATHS ${OpenCOLLADA_LIBRARY_DIRS} NO_DEFAULT_PATH)
         IF(NOT OpenCOLLADA_XML_LIBRARIES)
-          FIND_LIBRARY(OpenCOLLADA_XML_LIBRARIES NAMES xml2 )
+          FIND_LIBRARY(OpenCOLLADA_XML_LIBRARIES NAMES xml2)
         ENDIF()

-#        FIND_LIBRARY(OpenCOLLADA_PCRE_LIBRARIES NAMES pcre PATHS ${OpenCOLLADA_LIBRARY_DIRS} NO_DEFAULT_PATH)
+        FIND_LIBRARY(OpenCOLLADA_PCRE_LIBRARIES NAMES pcre PATHS ${OpenCOLLADA_LIBRARY_DIRS} NO_DEFAULT_PATH)
+        IF(NOT OpenCOLLADA_PCRE_LIBRARIES)
+          FIND_LIBRARY(OpenCOLLADA_PCRE_LIBRARIES NAMES pcre)
+        ENDIF()

         FIND_LIBRARY(OpenCOLLADA_UTF_LIBRARIES NAMES UTF PATHS ${OpenCOLLADA_LIBRARY_DIRS} NO_DEFAULT_PATH)

-        SET(OpenCOLLADA_LIBRARIES ${OpenCOLLADA_SAXFW_LIBRARIES} ${OpenCOLLADA_FW_LIBRARIES} ${OpenCOLLADA_MML_LIBRARIES} ${OpenCOLLADA_SAX_LIBRARIES} ${OpenCOLLADA_BU_LIBRARIES} ${OpenCOLLADA_XML_LIBRARIES} ${OpenCOLLADA_UTF_LIBRARIES} ${OpenCOLLADA_SW_LIBRARIES} ${OpenCOLLADA_BUFFER_LIBRARIES} ${OpenCOLLADA_FTOA_LIBRARIES} )
+        SET(OpenCOLLADA_LIBRARIES ${OpenCOLLADA_SAXFW_LIBRARIES} ${OpenCOLLADA_FW_LIBRARIES} ${OpenCOLLADA_MML_LIBRARIES} ${OpenCOLLADA_SAX_LIBRARIES} ${OpenCOLLADA_BU_LIBRARIES} ${OpenCOLLADA_XML_LIBRARIES} ${OpenCOLLADA_PCRE_LIBRARIES} ${OpenCOLLADA_UTF_LIBRARIES} ${OpenCOLLADA_SW_LIBRARIES} ${OpenCOLLADA_BUFFER_LIBRARIES} ${OpenCOLLADA_FTOA_LIBRARIES} )
     ENDIF()

     IF(OpenCOLLADA_LIBRARIES)


Fixing preinstalled libs pathway

Fixing preinstalled libs pathway

Former-commit-id: a95226eb0493b7f907b83a7f825d15606fc49856

--- cmake-modules/Fetch_Arpack-ng.cmake
+++ cmake-modules/Fetch_Arpack-ng.cmake
@@ -30,9 +30,9 @@
             PROPERTIES
             INTERFACE_LINK_LIBRARIES "${ARPACK_LIBRARIES};blas;lapack"
             INTERFACE_INCLUDE_DIRECTORIES "${ARPACK_INCLUDE_DIRS}"
-            INTERFACE_LINK_OPTIONS "${PTHREAD_LIBRARY}"
+#            INTERFACE_LINK_OPTIONS "${PTHREAD_LIBRARY}"
             )
-    target_link_libraries(${PROJECT_NAME} PRIVATE arpack)
+#    target_link_libraries(${PROJECT_NAME} PRIVATE arpack)
     return()
 else()
     message(STATUS "Arpack-ng will be installed into ${INSTALL_DIRECTORY}/arpack-ng on first build.")


Fix potential problems with if (for CMake < 3.1.0, CMP0054)

--- cmake/modules/hunter_download.cmake
+++ cmake/modules/hunter_download.cmake
@@ -38,6 +38,10 @@
   hunter_test_string_not_empty("${HUNTER_PACKAGE_NAME}")
   hunter_test_string_not_empty("${HUNTER_TOOLCHAIN_ID_PATH}")

+  string(COMPARE NOTEQUAL "${HUNTER_BINARY_DIR}" "" hunter_has_binary_dir)
+  string(COMPARE NOTEQUAL "${HUNTER_PACKAGE_COMPONENT}" "" hunter_has_component)
+  string(COMPARE NOTEQUAL "${CMAKE_TOOLCHAIN_FILE}" "" hunter_has_toolchain)
+
   # Set <LIB>_ROOT variables
   set(h_name "${HUNTER_PACKAGE_NAME}") # Foo
   string(TOUPPER "${HUNTER_PACKAGE_NAME}" root_name) # FOO
@@ -46,6 +50,8 @@
   set(ver ${HUNTER_${h_name}_VERSION})
   set(HUNTER_PACKAGE_URL "${HUNTER_${h_name}_URL}")
   set(HUNTER_PACKAGE_SHA1 "${HUNTER_${h_name}_SHA1}")
+
+  string(COMPARE EQUAL "${HUNTER_PACKAGE_URL}" "" hunter_no_url)

   string(COMPARE EQUAL "${HUNTER_PACKAGE_SHA1}" "" version_not_found)
   if(version_not_found)
@@ -77,19 +83,19 @@
         HUNTER_PACKAGE_HOME_DIR
         "${HUNTER_PACKAGE_HOME_DIR}/${HUNTER_PACKAGE_NAME}"
     )
-    if(HUNTER_PACKAGE_COMPONENT)
+    if(hunter_has_component)
       set(
           HUNTER_PACKAGE_HOME_DIR
           "${HUNTER_PACKAGE_HOME_DIR}/${HUNTER_PACKAGE_COMPONENT}"
       )
     endif()
     set(HUNTER_PACKAGE_DONE_STAMP "${HUNTER_PACKAGE_HOME_DIR}/DONE")
-    if(HUNTER_BINARY_DIR)
+    if(hunter_has_binary_dir)
       set(
           HUNTER_PACKAGE_BUILD_DIR
           "${HUNTER_BINARY_DIR}/${HUNTER_PACKAGE_NAME}"
       )
-      if(HUNTER_PACKAGE_COMPONENT)
+      if(hunter_has_component)
         set(
             HUNTER_PACKAGE_BUILD_DIR
             "${HUNTER_PACKAGE_BUILD_DIR}/${HUNTER_PACKAGE_COMPONENT}"
@@ -121,7 +127,7 @@

   if(EXISTS "${HUNTER_PACKAGE_DONE_STAMP}")
     hunter_status_debug("Package already installed: ${HUNTER_PACKAGE_NAME}")
-    if(HUNTER_PACKAGE_COMPONENT)
+    if(hunter_has_component)
       hunter_status_debug("Component: ${HUNTER_PACKAGE_COMPONENT}")
     endif()
     return()
@@ -130,7 +136,7 @@
   hunter_lock_directory("${HUNTER_PACKAGE_DOWNLOAD_DIR}")
   if(HUNTER_DOWNLOAD_SCHEME_INSTALL)
     hunter_lock_directory("${HUNTER_TOOLCHAIN_ID_PATH}")
-    if(HUNTER_BINARY_DIR)
+    if(hunter_has_binary_dir)
       hunter_lock_directory("${HUNTER_BINARY_DIR}")
     endif()
   endif()
@@ -138,7 +144,7 @@
   # While locking other instance can finish package building
   if(EXISTS "${HUNTER_PACKAGE_DONE_STAMP}")
     hunter_status_debug("Package already installed: ${HUNTER_PACKAGE_NAME}")
-    if(HUNTER_PACKAGE_COMPONENT)
+    if(hunter_has_component)
       hunter_status_debug("Component: ${HUNTER_PACKAGE_COMPONENT}")
     endif()
     return()
@@ -161,7 +167,7 @@
   )

   # support for toolchain file forwarding
-  if(CMAKE_TOOLCHAIN_FILE)
+  if(hunter_has_toolchain)
     # Fix windows path
     get_filename_component(x "${CMAKE_TOOLCHAIN_FILE}" ABSOLUTE)
     file(APPEND "${HUNTER_DOWNLOAD_TOOLCHAIN}" "include(\"${x}\")\n")
@@ -177,7 +183,7 @@
     set(verbose_makefile "")
   endif()

-  if(NOT HUNTER_PACKAGE_URL)
+  if(hunter_no_url)
     set(avail ${HUNTER_${h_name}_VERSIONS})
     hunter_internal_error(
         "${h_name} version(${ver}) not found. Available: [${avail}]"
@@ -186,7 +192,7 @@

   # print info before start generation/run
   hunter_status_debug("Add package: ${HUNTER_PACKAGE_NAME}")
-  if(HUNTER_PACKAGE_COMPONENT)
+  if(hunter_has_component)
     hunter_status_debug("Component: ${HUNTER_PACKAGE_COMPONENT}")
   endif()
   hunter_status_debug("Download scheme: ${HUNTER_DOWNLOAD_SCHEME}")
@@ -208,7 +214,7 @@
   )

   set(build_message "Building ${HUNTER_PACKAGE_NAME}")
-  if(HUNTER_PACKAGE_COMPONENT)
+  if(hunter_has_component)
     set(
         build_message
         "${build_message} (component: ${HUNTER_PACKAGE_COMPONENT})"


toolchain/zephyr: invoke ar with -D for deterministic .a files

Quoting GNU ar man/info page:

  'D'
     Operate in _deterministic_ mode.  When adding files and the archive
     index use zero for UIDs, GIDs, timestamps, and use consistent file
     modes for all files.  When this option is used, if 'ar' is used
     with identical options and identical input files, multiple runs
     will create identical output files regardless of the input files'
     owners, groups, file modes, or modification times.

     If 'binutils' was configured with
     '--enable-deterministic-archives', then this mode is on by default.
     It can be disabled with the 'U' modifier, below.

Signed-off-by: Marc Herbert <77e7c7d746b52c6eb01119b65a031ae1f650246d@intel.com>

--- cmake/toolchain/zephyr/target.cmake
+++ cmake/toolchain/zephyr/target.cmake
@@ -1,3 +1,34 @@
 # SPDX-License-Identifier: Apache-2.0

 include(${ZEPHYR_BASE}/cmake/toolchain/zephyr/${SDK_VERSION}/target.cmake)
+
+
+# For toolchains without a deterministic 'ar' option, see
+# less ideal but tested "strip-nondeterminism" alternative at
+#  https://github.com/marc-hb/zephyr/commits/strip-nondeterminism
+
+# TODO: build future versions of the Zephyr SDK with
+#      --enable-deterministic-archives?
+
+# Ideally we'd want to _append_ -D to the list of flags and operations
+# that cmake already uses by default. However as of version 3.14 cmake
+# doesn't support addition, one can only replace the complete AR command.
+
+# To see what the default flags are and find where they're defined
+# in cmake's code:
+# - comment out the end of the foreach line like this:
+#      foreach(lang ) # ASM C CXX
+# - build any sample with:
+#       2>cmake.log  cmake --trace-expand ...
+# - Search cmake.log for:
+#      CMAKE_.*_ARCHIVE and CMAKE_.*CREATE_STATIC
+
+# CMake's documentation is at node: CMAKE_LANG_CREATE_STATIC_LIBRARY
+
+# At least one .a file needs 'ASM': arch/xtensa/core/startup/ because
+# there's no C file there.
+foreach(lang ASM C CXX)
+  # GNU ar always updates the index: no need for CMAKE_RANLIB
+  SET(CMAKE_${lang}_CREATE_STATIC_LIBRARY
+      "<CMAKE_AR> qcD <TARGET> <LINK_FLAGS> <OBJECTS>")
+endforeach()


fix HDF5 include var inconsistencies on some installations

Change-Id: I54d750bc2be7829f1c5ab71e19b741e43e5a72ef

--- external/vigra_cmake/VAD_HDF5.cmake
+++ external/vigra_cmake/VAD_HDF5.cmake
@@ -12,7 +12,7 @@

   if (NOT TARGET hdf5_cpp)
     add_library(hdf5_cpp INTERFACE IMPORTED)
-    set_target_properties(hdf5_cpp PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${HDF5_CXX_INCLUDE_DIRS}")
+    set_target_properties(hdf5_cpp PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${HDF5_CXX_INCLUDE_DIRS};${HDF5_CXX_INCLUDE_DIR}")
     set_target_properties(hdf5_cpp PROPERTIES INTERFACE_LINK_LIBRARIES "${HDF5_CXX_LIBRARIES}")
   endif()
 endfunction()


ENH: improve ImportCurl, avoid multiple find_package

--- CMake/ImportCurl.cmake
+++ CMake/ImportCurl.cmake
@@ -8,31 +8,18 @@

 MARK_AS_ADVANCED(OTB_USE_CURL)
 IF(OTB_USE_CURL)
-
-        FIND_PATH(CURL_INCLUDE_DIR NAMES curl/curl.h PATHS ${OSGEO4W_INCLUDE})
-        MARK_AS_ADVANCED(CURL_INCLUDE_DIR)
-        IF (NOT CURL_INCLUDE_DIR)
-                MESSAGE(FATAL_ERROR
-                        "Cannot find CURL include directory. Please set CURL_INCLUDE_DIR or SET OTB_USE_CURL OFF.")
-        ENDIF (NOT CURL_INCLUDE_DIR)
-
-        FIND_LIBRARY(CURL_LIBRARY NAMES curl libcurl_imp PATHS ${OSGEO4W_LIB} )
-        MARK_AS_ADVANCED(CURL_LIBRARY)
-        IF (NOT CURL_LIBRARY)
-                MESSAGE(FATAL_ERROR
-                        "Cannot find CURL library. Please set CURL_LIBRARY or SET OTB_USE_CURL OFF.")
-        ENDIF (NOT CURL_LIBRARY)
-
-        TRY_COMPILE(OTB_CURL_MULTI_AVAILABLE
+    IF(CURL_FOUND)
+      MESSAGE(STATUS "Using CURL external version")
+      TRY_COMPILE(OTB_CURL_MULTI_AVAILABLE
                     ${CMAKE_CURRENT_BINARY_DIR}/CMake
                     ${CMAKE_CURRENT_SOURCE_DIR}/CMake/TestCurlMulti.cxx
-                    CMAKE_FLAGS "-DINCLUDE_DIRECTORIES:PATH=${CURL_INCLUDE_DIR}" "-DLINK_LIBRARIES:STRING=${CURL_LIBRARY}"
+                    CMAKE_FLAGS "-DINCLUDE_DIRECTORIES:PATH=${CURL_INCLUDE_DIRS}" "-DLINK_LIBRARIES:STRING=${CURL_LIBRARIES}"
                     OUTPUT_VARIABLE OUTPUT)
-
-        MESSAGE(STATUS "  Enabling Curl support")
-        MESSAGE(STATUS "  Curl includes : ${CURL_INCLUDE_DIR}")
-        MESSAGE(STATUS "  Curl library  : ${CURL_LIBRARY}")
-
+    ELSE(CURL_FOUND)
+      MESSAGE(FATAL_ERROR "CURL required but not found. "
+                          "Turn OTB_USE_CURL to OFF to disable CURL support")
+    ENDIF(CURL_FOUND)
 ELSE(OTB_USE_CURL)
         MESSAGE(STATUS "  Disabling Curl support")
 ENDIF(OTB_USE_CURL)
+


NEW: added new configuration profile

NEW: added new configuration profile

--- CMakeLists.default.cmake
+++ CMakeLists.default.cmake
@@ -34,4 +34,8 @@
 	set(CMAKE_C_FLAGS_RELEASE "-O2 -fomit-frame-pointer -D_FORTIFY_SOURCE=1 -fstrict-aliasing ${CMAKE_USER_C_FLAGS}" CACHE STRING
 		"Flags used by the compiler during release build." FORCE
 	)
+
+	set(CMAKE_C_FLAGS_RELWITHDEBINFO "-g -O2 -D_FORTIFY_SOURCE=1 -fstrict-aliasing ${CMAKE_USER_C_FLAGS}" CACHE STRING
+		"Flags used by the compiler during release build." FORCE
+	)
 endif (CMAKE_COMPILER_IS_GNUCXX)


Removed USUICustomWidgetFactory as it is internally defined in QmitkUSAbstractCustomWidget::RegisterService()

--- Modules/USUI/files.cmake
+++ Modules/USUI/files.cmake
@@ -1,7 +1,6 @@

 set(CPP_FILES
   mitkUSUIActivator.cpp
-  mitkUSUICustomWidgetFactory.cpp
   Qmitk/QmitkUSDeviceManagerWidget.cpp
   Qmitk/QmitkUSNewVideoDeviceWidget.cpp
   Qmitk/QmitkUSControlsBModeWidget.cpp


try cmake

try cmake

--- cmake/DetectOptions.cmake
+++ cmake/DetectOptions.cmake
@@ -109,11 +109,11 @@

 # LIBPRESSIO
 if(ADIOS2_USE_LIBPRESSIO STREQUAL AUTO)
-  find_package(LibPressio)
-  find_package(std_compat)
+ find_package(LibPressio QUIET CONFIG)
+ find_package(std_compat QUIET CONFIG)
 elseif(ADIOS2_USE_LIBPRESSIO)
-  find_package(LibPressio REQUIRED)
-  find_package(std_compat REQUIRED)
+  find_package(LibPressio REQUIRED CONFIG)
+  find_package(std_compat REQUIRED CONFIG)
 endif()
 if(TARGET LibPressio::libpressio)
   set(ADIOS2_HAVE_LIBPRESSIO TRUE)


Reverted accidental custom config.

Reverted accidental custom config.

--- CMakeModules/ConfigurePackages.cmake
+++ CMakeModules/ConfigurePackages.cmake
@@ -390,7 +390,6 @@

 macro(use_package_knet)
     set(KNET_DIR ${ENV_NAALI_DEP_PATH}/kNet)
-    set(KNET_DIR C:/Projects/kNet)
     include_directories(${KNET_DIR}/include)
     link_directories(${KNET_DIR}/lib)
 endmacro()


Fix win32 numpy wheel abi tag

Fix win32 numpy wheel abi tag

The windows numpy wheel abi tag should be "cp37m" rather than
"none" (see [here](https://pypi.org/project/numpy/1.16.4/#files)).

Signed-off-by: Patrick Avery <743342299f279e7a8c3ff5eb40671fce3e95f13a@kitware.com>

--- projects/win32/numpy.cmake
+++ projects/win32/numpy.cmake
@@ -1,3 +1,3 @@
-set(numpy_platform_string "cp37-none-win_amd64")
+set(numpy_platform_string "cp37-cp37m-win_amd64")

 include(numpy.common)


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

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

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

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

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

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

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

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

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

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

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

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

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

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

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

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

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

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

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp


Bump minimum version of TelepathyQt4 required to 0.5

--- cmake/modules/FindTelepathyQt4.cmake
+++ cmake/modules/FindTelepathyQt4.cmake
@@ -17,7 +17,7 @@

 find_package(PkgConfig)
 if(PKG_CONFIG_FOUND)
-    pkg_check_modules(PC_TELEPATHY_QT4 QUIET TelepathyQt4>=0.1.9)
+    pkg_check_modules(PC_TELEPATHY_QT4 QUIET TelepathyQt4>=0.5)
 endif(PKG_CONFIG_FOUND)

 find_path(TELEPATHY_QT4_INCLUDE_DIR


Drop OPTIONAL signature for enable_language when doing initial check to see
whether a given language will work (in an independent CMake
micro-environment). It is not at all consistent with my mental model about
how CMake works, but this change appears to eliminate the unnecessary CMake
re-run issue for the single case (when the FC environment variable is not
set) where it occurs on my Debian Lenny platform. Thus, it is possible all
unnecessary CMake re-runs on all platforms and circumstances will be fixed
by this change.

svn path=/trunk/; revision=10270

--- cmake/modules/language_support.cmake
+++ cmake/modules/language_support.cmake
@@ -14,7 +14,8 @@
 set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/modules)
 cmake_minimum_required(VERSION 2.6.0)
 message(STATUS \"CMAKE_GENERATOR = ${CMAKE_GENERATOR}\")
-enable_language(${language} OPTIONAL)
+#enable_language(${language} OPTIONAL)
+enable_language(${language})
 "
     )
   file(REMOVE_RECURSE ${CMAKE_BINARY_DIR}/language_tests/${language})


Fix root path to retrieve Boost files

Fix root path to retrieve Boost files

Boost will need to get the hierarchy two levels up.
BOOST_ROOT should be retrieved "/Boost" finally.
Default --layout option value is 'versioned' when build Boost in
Windows.
Header files are installed in subdirectory of whose name contains the
version number.

--- cmake/pcl_all_in_one_installer.cmake
+++ cmake/pcl_all_in_one_installer.cmake
@@ -5,6 +5,7 @@

 if(BUILD_all_in_one_installer)
     get_filename_component(BOOST_ROOT "${Boost_INCLUDE_DIR}" PATH)
+    get_filename_component(BOOST_ROOT "${BOOST_ROOT}" PATH)
     get_filename_component(EIGEN_ROOT "${EIGEN_INCLUDE_DIRS}" PATH)
     get_filename_component(QHULL_ROOT "${QHULL_INCLUDE_DIRS}" PATH)
     get_filename_component(FLANN_ROOT "${FLANN_INCLUDE_DIRS}" PATH)


Revert "Change an option to check process"

This reverts commit 2ab1001ab1a28d80ea789fa0229d77478ea8a80e.

--- CI/sb_configure_options.cmake
+++ CI/sb_configure_options.cmake
@@ -24,7 +24,7 @@
 CMAKE_INSTALL_PREFIX:PATH=${CTEST_INSTALL_DIRECTORY}")

 set ( temporary_option
-"OTB_USE_LIBKML=ON
+"OTB_USE_LIBKML=OFF
 OTB_USE_MPI=OFF")

 set(concat_options


Only do the "Bash on Ubuntu on Windows" detection once.

--- CMake/Modules/CheckHost.cmake
+++ CMake/Modules/CheckHost.cmake
@@ -61,8 +61,11 @@
         set (HAS_LIB64 ${HAS_LIB64} CACHE INTERNAL "Multilib capability")
     endif ()
     # Test if it is a userspace bash on Windows host system
-    execute_process (COMMAND grep -cq Microsoft /proc/version RESULT_VARIABLE GREP_EXIT_CODE OUTPUT_QUIET ERROR_QUIET)
-    if (GREP_EXIT_CODE EQUAL 0)
-        set (BASH_ON_WINDOWS TRUE)
+    if (NOT DEFINED BASH_ON_WINDOWS)
+        execute_process (COMMAND grep -cq Microsoft /proc/version RESULT_VARIABLE GREP_EXIT_CODE OUTPUT_QUIET ERROR_QUIET)
+        if (GREP_EXIT_CODE EQUAL 0)
+            set (BASH_ON_WINDOWS TRUE)
+        endif ()
+        set (BASH_ON_WINDOWS ${BASH_ON_WINDOWS} CACHE INTERNAL "Bash on Ubuntu on Windows")
     endif ()
 endif ()


Remove temporary workaround which appears to be redundant now.

--- CMake/Modules/CheckHost.cmake
+++ CMake/Modules/CheckHost.cmake
@@ -81,8 +81,8 @@
     endif ()
     # Temporary workaround - test if PCH could be enabled when using Clang compiler toolchain
     if (CMAKE_CXX_COMPILER_ID MATCHES Clang)
-        # Turn off PCH when building on macOS host with ccache 3.3.1+ (the last known bad version) and when targeting Android and Web platforms
-        if ((APPLE AND NOT CCACHE_VERSION VERSION_LESS 3.3.1) OR ANDROID OR WEB)
+        # Turn off PCH when building on macOS host with ccache 3.3.1+ (the last known bad version)
+        if ((APPLE AND NOT CCACHE_VERSION VERSION_LESS 3.3.1))
             set (URHO3D_PCH FALSE CACHE INTERNAL "" FORCE)
         endif ()
     endif ()


COMP: Updated test data for segmentation correction tool.

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

 if(BUILD_TESTING)

-  set(revision_tag f5b46a38)
+  set(revision_tag fa62ded0)
 #                  ^^^^^^^^  these are just to check correct length of hash part

   ExternalProject_Add(${proj}


Fixed glew header search hints for cmake

--- CMakeModules/FindGLEWmx.cmake
+++ CMakeModules/FindGLEWmx.cmake
@@ -12,10 +12,14 @@
 # GLEWmxd_LIBRARY
 # GLEWmxs_LIBRARY

-FIND_PACKAGE(GLEW)
-FIND_PACKAGE(OpenGL)
+FIND_PACKAGE(OpenGL REQUIRED)

 OPTION(USE_GLEWmx_STATIC "Use Static GLEWmx Lib" OFF)
+
+FIND_PATH(GLEW_INCLUDE_DIR GL/glew.h
+    HINTS
+    ${GLEW_ROOT_DIR}/include
+    )

 IF (WIN32)
     FIND_LIBRARY( GLEWmxd_LIBRARY


Update Superbuild to ITK 4.13rc02

Update Superbuild to ITK 4.13rc02

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

-set(ITK_GIT_TAG "v4.13rc01" CACHE STRING "Tag in ITK git repo")
+set(ITK_GIT_TAG "v4.13rc02" CACHE STRING "Tag in ITK git repo")
 mark_as_advanced(ITK_GIT_TAG)
 set(ITK_TAG_COMMAND GIT_TAG "${ITK_GIT_TAG}")


added: disable warnings from GLI (temp, MSVC)

--- share/hugh/cmake/compiler/msvc.cmake
+++ share/hugh/cmake/compiler/msvc.cmake
@@ -12,11 +12,16 @@

 set(DISABLED_WARNINGS)

+# temp disable for glm/gli
+list(APPEND DISABLED_WARNINGS /wd4100)
+list(APPEND DISABLED_WARNINGS /wd4310)
+list(APPEND DISABLED_WARNINGS /wd4458)
+
 # unknown pragma
 #list(APPEND DISABLED_WARNINGS /wd4068)

 # nonstandard extension used : nameless struct/union
-#list(APPEND DISABLED_WARNINGS /wd4201)
+list(APPEND DISABLED_WARNINGS /wd4201)

 if("SHARED" STREQUAL "${CMAKE_LIBRARY_TYPE}")
   # 'identifier' : class 'type' needs to have dll-interface to be used by clients of class 'type2'


[GTest] correct variables

[GTest] correct variables

- needs to be GTEST_ROOT
- remove setting of GTEST_INCLUDE_DIR (not needed)

--- SuperBuild/External_GTest.cmake
+++ SuperBuild/External_GTest.cmake
@@ -57,19 +57,18 @@
   )

     set(GTEST_ROOT        ${GTest_Install_Dir})
-    set(GTEST_INCLUDE_DIR ${GTest_Install_Dir/include})

-   else()
+  else()
       if(${USE_SYSTEM_${externalProjName}})
+        message("USING the system ${externalProjName}, set GTEST_ROOT if needed.")
         find_package(${proj} ${${externalProjName}_REQUIRED_VERSION} REQUIRED)
-        message("USING the system ${externalProjName}, set ${externalProjName}_DIR=${${externalProjName}_DIR}")
     endif()
     ExternalProject_Add_Empty(${proj} DEPENDS "${${proj}_DEPENDENCIES}")
   endif()

   mark_as_superbuild(
     VARS
-      ${externalProjName}_DIR:PATH
+      GTEST_ROOT:PATH
     LABELS
       "FIND_PACKAGE"
   )


Add support for MINC transform format

Add support for MINC transform format

--- SuperBuild/External_ITKv4.cmake
+++ SuperBuild/External_ITKv4.cmake
@@ -76,6 +76,7 @@
   if(${extProjName}_BUILD_MINC_SUPPORT)
     set(${proj}_MINC_ARGS
         -DModule_ITKIOMINC:BOOL=ON
+        -DModule_ITKIOTransformMINC:BOOL=ON
         -DModule_ITKMINC:BOOL=ON
        )
   endif()


COMP: Support ITK pre/post 5.1rc02 enum class.

--- SuperBuild/External_ITKv5.cmake
+++ SuperBuild/External_ITKv5.cmake
@@ -115,7 +115,7 @@
       -DBUILD_TESTING:BOOL=OFF
       -DBUILD_EXAMPLES:BOOL=OFF
       -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_BINARY_DIR}/staging
-      -DITK_LEGACY_REMOVE:BOOL=ON
+      -DITK_LEGACY_REMOVE:BOOL=OFF # <--- NEEDED TEMPORARILY until fixes for enum-class and ITK 5.1 release are required
       -DITK_FUTURE_LEGACY_REMOVE:BOOL=ON
       -DITKV3_COMPATIBILITY:BOOL=OFF
       -DITK_BUILD_DEFAULT_MODULES:BOOL=ON


OpenMP linking on mac os X is really solved this time. Really.

git-svn-id: 4ba210d0a933e3fb1aa9ab096f190cd38965d92a@4003 fa922fa7-2fde-0310-acd8-f43f465a7996

--- CMake/hoomd/HOOMDCFlagsSetup.cmake
+++ CMake/hoomd/HOOMDCFlagsSetup.cmake
@@ -67,6 +67,7 @@
     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
     set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
     list(APPEND CMAKE_EXE_LINKER_FLAGS ${OpenMP_CXX_FLAGS})
+    list(APPEND CMAKE_SHARED_LINKER_FLAGS ${OpenMP_CXX_FLAGS})
 endif (ENABLE_OPENMP AND OPENMP_FOUND)

 # disable crazy windows warnings


Write out log on error

Write out log on error

--- CMake/vtkLoadCMakeExtensions.cmake
+++ CMake/vtkLoadCMakeExtensions.cmake
@@ -11,7 +11,8 @@
      TRY_COMPILE(COMPILE_OK
         ${BUILD_DIR}
         ${SOURCE_DIR}
-        VTK_LOADED_COMMANDS)
+        VTK_LOADED_COMMANDS
+        OUTPUT_VARIABLE OUTPUT)
      IF (COMPILE_OK)
         MESSAGE(STATUS "Compiling VTK loaded commands - done")
         # load the four extra CMake commands
@@ -22,6 +23,9 @@
      ELSE (COMPILE_OK)
         MESSAGE(STATUS "Compiling VTK loaded commands - failed")
         MESSAGE("failed to compile VTK extensions to CMake")
+        WRITE_FILE(${CMAKE_BINARY_DIR}/CMakeError.log
+        "Building of VTK extensions failed with the following output:\n"
+        "${OUTPUT}\n" APPEND)
      ENDIF (COMPILE_OK)
   ENDIF (COMMAND VTK_MAKE_INSTANTIATOR2)
   SET(VTK_USE_INSTANTIATOR_NEW "1")


Graph Control 4.0.0-rc15 Release Candidate 15

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

--- version.cmake
+++ version.cmake
@@ -6,7 +6,7 @@
 set ( HPCC_MINOR 0 )
 set ( HPCC_POINT 0 )
 set ( HPCC_MATURITY "rc" )
-set ( HPCC_SEQUENCE 14 )
+set ( HPCC_SEQUENCE 15 )
 ###
 IF ( ${HPCC_POINT} GREATER 65 )
   error ( "HPCC_POINT must be less than 66." )


Update compiler.cmake

Update compiler.cmake

Add back optimization flags (were disabled to rule out problems). Space vs tab indentation.

--- Tudat/External/CMake/compiler.cmake
+++ Tudat/External/CMake/compiler.cmake
@@ -59,26 +59,26 @@
             set ( CMAKE_CXX_FLAGS "-Wall -std=c++0x" )
         endif()
     endif()
-
-    set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-g")
-    set(CMAKE_CXX_FLAGS_RELEASE        "-g -DNDEBUG")
+
+    set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g")
+    set(CMAKE_CXX_FLAGS_RELEASE        "-O2 -DNDEBUG")
     set(CMAKE_CXX_FLAGS_DEBUG          "-g")

     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Woverloaded-virtual -Wold-style-cast -Wnon-virtual-dtor")

-	# MinGW fixes
-	if( MINGW AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.9)
-	  # MinGW fails to build with O2 or O3 optimization on several math.h function
-	  # http://ehc.ac/p/mingw/bugs/2250/
-	  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D__NO_INLINE__")
-	  # MinGW gives some c11plus.xe out of memory messages:
-	  # http://sourceforge.net/p/mingw-w64/mailman/message/33182613/
-	  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ftrack-macro-expansion=0")
-	  # MinGW32 4.8.1 has no defenitions for _aligned_malloc/realloc/free
-	  #
-	  add_definitions(-DEIGEN_MALLOC_ALREADY_ALIGNED=1)
-	  add_definitions(-DEIGEN_DONT_ALIGN=1)
-	endif()
+    # MinGW fixes
+    if( MINGW AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.9)
+      # MinGW fails to build with O2 or O3 optimization on several math.h function
+      # http://ehc.ac/p/mingw/bugs/2250/
+      set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D__NO_INLINE__")
+      # MinGW gives some c11plus.xe out of memory messages:
+      # http://sourceforge.net/p/mingw-w64/mailman/message/33182613/
+      set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ftrack-macro-expansion=0")
+      # MinGW32 4.8.1 has no defenitions for _aligned_malloc/realloc/free
+      #
+      add_definitions(-DEIGEN_MALLOC_ALREADY_ALIGNED=1)
+      add_definitions(-DEIGEN_DONT_ALIGN=1)
+    endif()

 elseif( MSVC )
     message(STATUS "Using msvc compiler.")


Follow-up for r217523: fix the dependencies for standalone compiler-rt build.

Patch by Kuba Brecka (kuba.brecka@gmail.com)

git-svn-id: c199f293c43da69278bea8e88f92242bf3aa95f7@218444 91177308-0d34-0410-b5e6-96231b3b80d8


Android toolchain: fixed ccache search

Android toolchain: fixed ccache search

--- android/android.toolchain.cmake
+++ android/android.toolchain.cmake
@@ -692,8 +692,7 @@
 # ccache support
 __INIT_VARIABLE( NDK_CCACHE ENV_NDK_CCACHE )
 if( NDK_CCACHE )
- get_filename_component(NDK_CCACHE "${NDK_CCACHE}" ABSOLUTE)
- set( NDK_CCACHE "${NDK_CCACHE}" CACHE PATH "The path to ccache binary" FORCE )
+ find_program(NDK_CCACHE "${NDK_CCACHE}" DOC "The path to ccache binary")
 else()
  unset( NDK_CCACHE )
 endif()


Add gostai_add_test.

Add gostai_add_test.

	* build-aux/cmake/modules/Gostai.cmake: Here.

--- build-aux/cmake/modules/Gostai.cmake
+++ build-aux/cmake/modules/Gostai.cmake
@@ -559,6 +559,92 @@

 endfunction(gostai_add_library name)

+
+# Add a Gostai test executable target named test-_name_.
+# Arguments:
+#  SOURCES	- the list of sources of the executable
+#  MOCS		- the list of sources of the executable that need to be moc'ed
+#  UIS		- the list of UI files used by the executable
+#  CPPFLAGS	- the list of CPPFLAGS to add
+#  INCLUDE_DIRS - the list of include directories to search in.
+#  LIBRARIES	- the list of libraries to link with.
+#  RESOURCES	- the list of resources files.
+function(gostai_add_test name)
+
+  set(prefix "test-${name}")
+  parse_arguments(
+    "${prefix}"
+    "SOURCES;MOCS;UIS;CPPFLAGS;INCLUDE_DIRS;LIBRARIES;RESOURCES"
+    "NO_CONSOLE;INSTALL_NO_DEPS"
+    ${ARGN})
+
+  # Ensure test is enabled
+  enable_testing()
+
+  # =================== #
+  # Include directories #
+  # =================== #
+  if(${prefix}_INCLUDE_DIRS)
+    include_directories(${${prefix}_INCLUDE_DIRS})
+  endif(${prefix}_INCLUDE_DIRS)
+
+  # =================== #
+  # Prepare the sources #
+  # =================== #
+  qt4_wrap_ui(${prefix}_UI_SOURCES ${${prefix}_UIS})
+  qt4_add_resources(${prefix}_RES_SOURCES ${${prefix}_RESOURCES})
+
+  set(${prefix}_MOC_OPTIONS "")
+  if(CMAKE_BUILD_TYPE STREQUAL "Release")
+    list(APPEND ${prefix}_MOC_OPTIONS "-DQT_NO_DEBUG")
+    list(APPEND ${prefix}_MOC_OPTIONS "-DNDEBUG")
+  endif(CMAKE_BUILD_TYPE STREQUAL "Release")
+  qt4_wrap_cpp(${prefix}_MOC_SOURCES ${${prefix}_MOCS}
+    OPTIONS ${${prefix}_MOC_OPTIONS})
+
+  set(${prefix}_ALL_SOURCES
+    ${${prefix}_SOURCES}
+    ${${prefix}_MOC_SOURCES}
+    ${${prefix}_RES_SOURCES}
+    ${${prefix}_UI_SOURCES}
+    )
+
+  if(NOT ${prefix}_ALL_SOURCES)
+    message(FATAL_ERROR "No sources provided for test '${name}'")
+  endif(NOT ${prefix}_ALL_SOURCES)
+
+  add_executable(${prefix} ${${prefix}_ALL_SOURCES})
+
+  if(${prefix}_CPPFLAGS)
+    set_target_properties(${prefix} PROPERTIES
+      COMPILE_DEFINITIONS "${${prefix}_CPPFLAGS}")
+  endif(${prefix}_CPPFLAGS)
+
+  # ===================== #
+  # Prepare the libraries #
+  # ===================== #
+  if(WIN32)
+    list(APPEND ${prefix}_LIBRARIES ${QT_QTMAIN_LIBRARY})
+  endif(WIN32)
+
+  if(${prefix}_LIBRARIES)
+    target_link_libraries(${prefix} ${${prefix}_LIBRARIES})
+  endif(${prefix}_LIBRARIES)
+
+  # ================= #
+  # Register the test #
+  # ================= #
+
+  add_test(${prefix} ${prefix})
+
+  # ================== #
+  # Add custom targets #
+  # ================== #
+
+  add_exec_target(${prefix})
+
+endfunction(gostai_add_test)
+
 endif(NOT GOSTAI_CMAKE_GUARD)

 # LocalWords:  docbook


RemoteModule: Update GIT_TAG for Mosaic module

--- Modules/Remote/Mosaic.remote.cmake
+++ Modules/Remote/Mosaic.remote.cmake
@@ -5,5 +5,5 @@
 https://github.com/remicres/otb-mosaic
 "
   GIT_REPOSITORY https://github.com/remicres/otb-mosaic.git
-  GIT_TAG 80637f8ede41f99b6ba147c9a5eef2346e5ae7f0
+  GIT_TAG 64cb06798fb237e10f929c1adaab37441e09fbc3
 )


zephyr: Error on missing braces

zephyr: Error on missing braces

Make missing braces an error in chroot, like it is in the gitlab build.

crrev/c/3219472 broke the gitlab build, but wasn't caught in CQ.

BRANCH=None
BUG=b:184856083
TEST=zmake configure -b zephyr/test/drivers/

Cq-Depend: chromium:3253430
Change-Id: Ie20e82bc7211bc971f838fff6258c81e8a97bdd3
Signed-off-by: Jeremy Bettis <4df7b5147fee087dca33c181f288ee7dbf56e022@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3253429
Commit-Queue: Jeremy Bettis <4df7b5147fee087dca33c181f288ee7dbf56e022@chromium.org>
Tested-by: Jeremy Bettis <4df7b5147fee087dca33c181f288ee7dbf56e022@chromium.org>
Reviewed-by: Aaron Massey <79529a820df71f45023239a3663736629646cc34@google.com>

--- zephyr/cmake/compiler/clang/compiler_flags.cmake
+++ zephyr/cmake/compiler/clang/compiler_flags.cmake
@@ -7,4 +7,4 @@
 # Disable -fno-freestanding.
 set_compiler_property(PROPERTY hosted)

-check_set_compiler_property(APPEND PROPERTY warning_extended -Wunused-variable -Werror=unused-variable)
+check_set_compiler_property(APPEND PROPERTY warning_extended -Wunused-variable -Werror=unused-variable -Werror=missing-braces)


DOC: Wrong comment in OpenCV cmake script.

Change-Id: I9fa929f45aa370193b3c5c9b8f408aff0bbf106b


Fixed download link

Fixed download link

--- CMakeExternals/Boost.cmake
+++ CMakeExternals/Boost.cmake
@@ -135,7 +135,7 @@

   ExternalProject_Add(${proj}
     LIST_SEPARATOR ${sep}
-    URL ${MITK_THIRDPARTY_DOWNLOAD_PREFIX_URL}/boost_${_boost_version}_0.tar.bz2
+    URL ${MITK_THIRDPARTY_DOWNLOAD_PREFIX_URL}/boost_${_boost_version}_0.7z
     URL_MD5 7ce7f5a4e396484da8da6b60d4ed7661
     # We use in-source builds for Boost
     BINARY_DIR ${ep_prefix}/src/${proj}


Explicitly mention the install prefix for Windows.

--- CMakeExternals/Boost.cmake
+++ CMakeExternals/Boost.cmake
@@ -81,6 +81,7 @@
     set(_build_cmd "<SOURCE_DIR>/b2"
         ${APPLE_SYSROOT_FLAG}
         --layout=tagged
+        "--prefix=<INSTALL_DIR>"
         ${_with_boost_libs}
         # Use the option below to view the shell commands (for debugging)
         #-d+4


Update GCC options for STM32L0 series (#798)

--- CMake/Modules/CHIBIOS_STM32L0xx_GCC_options.cmake
+++ CMake/Modules/CHIBIOS_STM32L0xx_GCC_options.cmake
@@ -13,16 +13,20 @@
 #################################################################

 # need to specify this for assembler
-set(CMAKE_ASM_FLAGS " -mthumb -mcpu=cortex-m0 -mabi=aapcs -x assembler-with-cpp" CACHE INTERNAL "asm compiler flags")
+#####################################################################
+# because nanoCLR is loaded the VTOR has to be init in ChibiOS CRT0
+# this define has to be placed here because it's on an assembly file
+#####################################################################
+set(CMAKE_ASM_FLAGS " -mthumb -mcpu=cortex-m0plus -mfloat-abi=soft -mabi=aapcs -mtune=cortex-m0plus -x assembler-with-cpp -DCRT0_VTOR_INIT=TRUE" CACHE INTERNAL "asm compiler flags")

 # need to specify linker flags here
-set(CMAKE_EXE_LINKER_FLAGS " -Wl,--gc-sections -Wl,--no-wchar-size-warning -mthumb -mcpu=cortex-m0 -mabi=aapcs -nostartfiles " CACHE INTERNAL "executable linker flags")
+set(CMAKE_EXE_LINKER_FLAGS " -Wl,--gc-sections -Wl,--no-wchar-size-warning -mthumb -mcpu=cortex-m0plus -mfloat-abi=soft -mabi=aapcs -mtune=cortex-m0plus -nostartfiles " CACHE INTERNAL "executable linker flags")

 function(NF_SET_COMPILER_OPTIONS TARGET)

     # include any extra options comming from any extra args?
-    target_compile_options(${TARGET} PUBLIC  ${ARGN} -mthumb -mcpu=cortex-m0 -mabi=aapcs -nostdlib -Wall -Wextra -Werror -ffunction-sections -fshort-wchar -falign-functions=16 -fdata-sections -fno-builtin -fno-common -fomit-frame-pointer -mlong-calls -fdollars-in-identifiers -fno-exceptions -fno-unroll-loops -mstructure-size-boundary=8 -ffast-math -ftree-vectorize -fcheck-new )
+    target_compile_options(${TARGET} PUBLIC  ${ARGN} -mthumb -mcpu=cortex-m0plus -mfloat-abi=soft -mabi=aapcs -mtune=cortex-m0plus -nostdlib -Wall -Wextra -Werror -ffunction-sections -fshort-wchar -falign-functions=16 -fdata-sections -fno-builtin -fno-common -fomit-frame-pointer -mlong-calls -fdollars-in-identifiers -fno-exceptions -fno-unroll-loops -mstructure-size-boundary=8 -ffast-math -ftree-vectorize -fcheck-new )

 endfunction()


Log build steps of Vc external project

Log build steps of Vc external project

--- cmake/modules/SearchInstalledSoftware.cmake
+++ cmake/modules/SearchInstalledSoftware.cmake
@@ -1283,6 +1283,7 @@
     URL_MD5 ${Vc_SRC_MD5}
     BUILD_IN_SOURCE 0
     BUILD_BYPRODUCTS ${Vc_LIBRARY}
+    LOG_DOWNLOAD 1 LOG_CONFIGURE 1 LOG_BUILD 1 LOG_INSTALL 1
     CMAKE_ARGS -G ${CMAKE_GENERATOR}
                -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
                -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}


Revert "Disable davix option rather than enabling builtin_davix by default"

This reverts commit 79150a40cd648b7ffe0885b3a896d8cf5dc434fe.

--- cmake/modules/SearchInstalledSoftware.cmake
+++ cmake/modules/SearchInstalledSoftware.cmake
@@ -1097,8 +1097,16 @@
   else()
     find_package(Davix 0.6.4)
     if(NOT DAVIX_FOUND)
-      message(STATUS "Davix not found, switching OFF 'davix' option.")
-      set(davix OFF CACHE BOOL "" FORCE)
+      find_package(libuuid)
+      find_package(LibXml2)
+      find_package(OpenSSL)
+      if(UUID_FOUND AND LIBXML2_FOUND AND (OPENSSL_FOUND OR builtin_openssl))
+        message(STATUS "Davix not found, switching ON 'builtin_davix' option.")
+        set(builtin_davix ON CACHE BOOL "" FORCE)
+      else()
+        message(STATUS "Davix dependencies not found, switching OFF 'davix' option.")
+        set(davix OFF CACHE BOOL "" FORCE)
+      endif()
     endif()
   endif()
 endif()


Revert "Do not enable builtin_afterimage if fail-on-missing=ON"

This reverts commit 2c93f75afb20fb43813f0daf49d3763907823fe3.

--- cmake/modules/SearchInstalledSoftware.cmake
+++ cmake/modules/SearchInstalledSoftware.cmake
@@ -327,17 +327,12 @@
 #---Check for AfterImage---------------------------------------------------------------
 if(asimage AND NOT builtin_afterimage)
   message(STATUS "Looking for AfterImage")
-  if(fail-on-missing)
-    find_package(AfterImage REQUIRED)
-  else()
-    find_package(AfterImage)
-    if(NOT AFTERIMAGE_FOUND)
-      message(STATUS "AfterImage not found. Switching on builtin_afterimage option")
-      set(builtin_afterimage ON CACHE BOOL "" FORCE)
-    endif()
-  endif()
-endif()
-
+  find_package(AfterImage)
+  if(NOT AFTERIMAGE_FOUND)
+    message(STATUS "AfterImage not found. Switching on builtin_afterimage option")
+    set(builtin_afterimage ON CACHE BOOL "" FORCE)
+  endif()
+endif()
 if(builtin_afterimage)
   set(AFTERIMAGE_LIBRARIES ${CMAKE_BINARY_DIR}/lib/libAfterImage${CMAKE_STATIC_LIBRARY_SUFFIX})
   if(WIN32)


Fix for ROOT-7896 - CMake: visibility inconsistency

--- cmake/modules/SearchInstalledSoftware.cmake
+++ cmake/modules/SearchInstalledSoftware.cmake
@@ -835,7 +835,7 @@
   if(MSVC)
     set(CLING_CXXFLAGS "-D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -DNOMINMAX -D_XKEYCHECK_H")
   else()
-    set(CLING_CXXFLAGS "-fvisibility-inlines-hidden -fno-strict-aliasing -Wno-unused-parameter -Wwrite-strings -Wno-long-long -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS")
+    set(CLING_CXXFLAGS "-fno-strict-aliasing -Wno-unused-parameter -Wwrite-strings -Wno-long-long -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS")
   endif()
   if (CMAKE_COMPILER_IS_GNUCXX)
     set(CLING_CXXFLAGS "${CLING_CXXFLAGS} -Wno-missing-field-initializers")


ARROW-5828: [C++] Add required Protocol Buffers versions check

This works Protobuf_SOURCE=AUTO well on environments that have old
Protocol Buffers.

Author: Sutou Kouhei <kou@clear-code.com>

Closes #4785 from kou/cpp-protobuf-version-check and squashes the following commits:

b4e9a8859 <Sutou Kouhei>  Add required Protocol Buffers versions check

--- cpp/cmake_modules/ThirdpartyToolchain.cmake
+++ cpp/cmake_modules/ThirdpartyToolchain.cmake
@@ -180,6 +180,19 @@
   endif()
 endmacro()

+macro(resolve_dependency_with_version DEPENDENCY_NAME REQUIRED_VERSION)
+  if(${DEPENDENCY_NAME}_SOURCE STREQUAL "AUTO")
+    find_package(${DEPENDENCY_NAME} ${REQUIRED_VERSION} MODULE)
+    if(NOT ${${DEPENDENCY_NAME}_FOUND})
+      build_dependency(${DEPENDENCY_NAME})
+    endif()
+  elseif(${DEPENDENCY_NAME}_SOURCE STREQUAL "BUNDLED")
+    build_dependency(${DEPENDENCY_NAME})
+  elseif(${DEPENDENCY_NAME}_SOURCE STREQUAL "SYSTEM")
+    find_package(${DEPENDENCY_NAME} ${REQUIRED_VERSION} REQUIRED)
+  endif()
+endmacro()
+
 # ----------------------------------------------------------------------
 # Thirdparty versions, environment variables, source URLs

@@ -1282,7 +1295,12 @@
 endmacro()

 if(ARROW_WITH_PROTOBUF)
-  resolve_dependency(Protobuf)
+  if(ARROW_WITH_GRPC)
+    set(ARROW_PROTOBUF_REQUIRED_VERSION "3.6.0")
+  else()
+    set(ARROW_PROTOBUF_REQUIRED_VERSION "2.6.1")
+  endif()
+  resolve_dependency_with_version(Protobuf ${ARROW_PROTOBUF_REQUIRED_VERSION})

   if(ARROW_PROTOBUF_USE_SHARED AND MSVC)
     add_definitions(-DPROTOBUF_USE_DLLS)


- improve detection of module

- improve detection of module

--- CMakeModules/FindLIBSBML.cmake
+++ CMakeModules/FindLIBSBML.cmake
@@ -27,6 +27,8 @@
           /opt/lib/cmake
           /opt/local/lib/cmake
           /sw/lib/cmake
+          ${COMBINE_DEPENDENCY_DIR}/lib/cmake
+          ${COMBINE_DEPENDENCY_DIR}/lib64/cmake
           ${CONAN_LIB_DIRS_LIBSBML}/cmake
   )
 endif()


STORM-1023 : allow non standalone and non install prebuilt to use local fmod package path in autobuild.xml

--- indra/cmake/FMOD.cmake
+++ indra/cmake/FMOD.cmake
@@ -10,22 +10,30 @@
 endif (INSTALL_PROPRIETARY)

 if (FMOD)
-  if (NOT INSTALL_PROPRIETARY)
-    # This cover the STANDALONE case and the NOT STANDALONE but not using proprietary libraries
-	# This should then be invoke by all open source devs outside LL
+  if (STANDALONE)
+    # In that case, we use the version of the library installed on the system
     set(FMOD_FIND_REQUIRED ON)
     include(FindFMOD)
-  else (NOT INSTALL_PROPRIETARY)
-	include(Prebuilt)
-	use_prebuilt_binary(fmod)
-    if (WINDOWS)
-      set(FMOD_LIBRARY fmod)
-    elseif (DARWIN)
-      set(FMOD_LIBRARY fmod)
-    elseif (LINUX)
-      set(FMOD_LIBRARY fmod-3.75)
-    endif (WINDOWS)
-    SET(FMOD_LIBRARIES ${FMOD_LIBRARY})
-    set(FMOD_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include)
-  endif (NOT INSTALL_PROPRIETARY)
+  else (STANDALONE)
+    if (FMOD_LIBRARY AND FMOD_INCLUDE_DIR)
+	  # If the path have been specified in the arguments, use that
+      set(FMOD_LIBRARIES ${FMOD_LIBRARY})
+	  MESSAGE(STATUS "Using FMOD path: ${FMOD_LIBRARIES}, ${FMOD_INCLUDE_DIR}")
+    else (FMOD_LIBRARY AND FMOD_INCLUDE_DIR)
+	  # If not, we're going to try to get the package listed in autobuild.xml
+	  # Note: if you're not using INSTALL_PROPRIETARY, the package URL should be local (file:/// URL)
+	  # as accessing the private LL location will fail if you don't have the credential
+	  include(Prebuilt)
+	  use_prebuilt_binary(fmod)
+      if (WINDOWS)
+        set(FMOD_LIBRARY fmod)
+      elseif (DARWIN)
+        set(FMOD_LIBRARY fmod)
+      elseif (LINUX)
+        set(FMOD_LIBRARY fmod-3.75)
+      endif (WINDOWS)
+      set(FMOD_LIBRARIES ${FMOD_LIBRARY})
+      set(FMOD_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include)
+    endif (FMOD_LIBRARY AND FMOD_INCLUDE_DIR)
+  endif (STANDALONE)
 endif (FMOD)


Fixed typo

Fixed typo

--- cmake/CMakeModules/FindJsonCpp.cmake
+++ cmake/CMakeModules/FindJsonCpp.cmake
@@ -15,8 +15,8 @@
 include(FindPackageHandleStandardArgs)

 if (USE_OSSIM_JSONCPP)
+   find_path( JSONCPP_INCLUDE_DIR json/json.h PATHS "${OSSIM_INCLUDE_DIR}/ossim")
    message("JSONCPP: Using amalgamated form in ${JSONCPP_INCLUDE_DIR}/json/json.h")
-   find_path( JSONCPP_INCLUDE_DIR json/json.h PATHS "${OSSIM_DEV_HOME}/ossim/include/ossim")
    set(JSONCPP_LIBRARY "")
    find_package_handle_standard_args( JSONCPP DEFAULT_MSG JSONCPP_INCLUDE_DIR )
 else(USE_OSSIM_JSONCPP)


cmake: linker: arm: utilize zephyr_linker_group(... SYMBOL SECTION)

The root cause of #38591 was region symbols being placed before the
section description for data region.

To support both schemes with the linker generator, a new
`SYMBOL SECTION` argument has been added to the zephyr_linker_group()
function.

This commit updates the arm/linker.cmake CMake linker file to use the
new `SYMBOL SECTION` argument for the data region group and text region
group so that those two groups now behave identical to the behavior when
using the cortex_m linker.ld template.

Signed-off-by: Torsten Rasmussen <a7c5b1d5a1f41fce6edfa3f7c2392ae0c59deafe@nordicsemi.no>

--- cmake/linker_script/arm/linker.cmake
+++ cmake/linker_script/arm/linker.cmake
@@ -59,9 +59,9 @@
 endif()

 zephyr_linker_group(NAME RAM_REGION VMA RAM LMA ROM_REGION)
-zephyr_linker_group(NAME TEXT_REGION GROUP ROM_REGION)
+zephyr_linker_group(NAME TEXT_REGION GROUP ROM_REGION SYMBOL SECTION)
 zephyr_linker_group(NAME RODATA_REGION GROUP ROM_REGION)
-zephyr_linker_group(NAME DATA_REGION GROUP RAM_REGION)
+zephyr_linker_group(NAME DATA_REGION GROUP RAM_REGION SYMBOL SECTION)

 # should go to a relocation.cmake - from include/linker/rel-sections.ld - start
 zephyr_linker_section(NAME  .rel.plt  HIDDEN)


Fix namelink generation for dependencies

--- cmake/ospray_redistribute_deps.cmake
+++ cmake/ospray_redistribute_deps.cmake
@@ -1,31 +1,36 @@
 ## Copyright 2009-2020 Intel Corporation
 ## SPDX-License-Identifier: Apache-2.0

-macro(ospray_install_namelink NAME TARGET_NAME)
-  set(BASE_LIB_NAME lib${NAME})
+macro(ospray_install_namelink NAME)
+  get_filename_component(TARGET_NAME ${NAME} NAME) # strip path
   set(LIB_SUFFIX ${CMAKE_SHARED_LIBRARY_SUFFIX})
-  execute_process(COMMAND "${CMAKE_COMMAND}" -E create_symlink
-                  ${TARGET_NAME} ${CMAKE_CURRENT_BINARY_DIR}/${BASE_LIB_NAME}${LIB_SUFFIX})
-  install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/lib${NAME}${LIB_SUFFIX}
-          DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT redist)
+  # strip version and lib suffix
+  if(APPLE)
+    set(LIBREGEX "(.+)[.]([0-9]+)([.][0-9]+[.][0-9]+)?${LIB_SUFFIX}")
+  else()
+    set(LIBREGEX "(.+)${LIB_SUFFIX}[.]([0-9]+)([.][0-9]+[.][0-9]+)?")
+  endif()
+  string(REGEX REPLACE ${LIBREGEX} "\\1" BASE_LIB_NAME ${TARGET_NAME})

-  # If the shared lib we're copying is named with a specific version, also
-  # create a major version suffixed symlink
-  string(REGEX MATCH "([0-9]+)[.]([0-9]+)[.]([0-9]+)" VERSION_STRING ${TARGET_NAME})
-  if (CMAKE_MATCH_0)
+  if (CMAKE_MATCH_COUNT)
+    set(SYMLINK ${CMAKE_CURRENT_BINARY_DIR}/${BASE_LIB_NAME}${LIB_SUFFIX})
+    execute_process(COMMAND "${CMAKE_COMMAND}" -E
+        create_symlink ${TARGET_NAME} ${SYMLINK})
+    install(PROGRAMS ${SYMLINK} DESTINATION ${CMAKE_INSTALL_LIBDIR}
+        COMPONENT redist)
+  endif()
+
+  if (CMAKE_MATCH_COUNT GREATER 2)
+    # also create a major version suffixed symlink
     if(APPLE)
-      execute_process(COMMAND "${CMAKE_COMMAND}" -E create_symlink
-                      ${TARGET_NAME}
-                      ${CMAKE_CURRENT_BINARY_DIR}/${BASE_LIB_NAME}.${CMAKE_MATCH_1}${LIB_SUFFIX})
-      install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/${BASE_LIB_NAME}.${CMAKE_MATCH_1}${LIB_SUFFIX}
-              DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT redist)
+      set(SYMLINK ${CMAKE_CURRENT_BINARY_DIR}/${BASE_LIB_NAME}.${CMAKE_MATCH_2}${LIB_SUFFIX})
     else()
-      execute_process(COMMAND "${CMAKE_COMMAND}" -E create_symlink
-                      ${TARGET_NAME}
-                      ${CMAKE_CURRENT_BINARY_DIR}/${BASE_LIB_NAME}${LIB_SUFFIX}.${CMAKE_MATCH_1})
-      install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/${BASE_LIB_NAME}${LIB_SUFFIX}.${CMAKE_MATCH_1}
-              DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT redist)
+      set(SYMLINK ${CMAKE_CURRENT_BINARY_DIR}/${BASE_LIB_NAME}${LIB_SUFFIX}.${CMAKE_MATCH_2})
     endif()
+    execute_process(COMMAND "${CMAKE_COMMAND}" -E
+        create_symlink ${TARGET_NAME} ${SYMLINK})
+    install(PROGRAMS ${SYMLINK} DESTINATION ${CMAKE_INSTALL_LIBDIR}
+        COMPONENT redist)
   endif()
 endmacro()

@@ -55,12 +60,8 @@
   else()
     install(PROGRAMS ${TBB_LIBRARY} ${TBB_LIBRARY_MALLOC}
             DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT redist)
-    if (NOT APPLE)
-      get_filename_component(TBB_LIBNAME ${TBB_LIBRARY} NAME)
-      get_filename_component(TBB_MALLOC_LIBNAME ${TBB_LIBRARY_MALLOC} NAME)
-      ospray_install_namelink(tbb ${TBB_LIBNAME})
-      ospray_install_namelink(tbbmalloc ${TBB_MALLOC_LIBNAME})
-    endif()
+    ospray_install_namelink(${TBB_LIBRARY})
+    ospray_install_namelink(${TBB_LIBRARY_MALLOC})
   endif()
 endif()

@@ -70,6 +71,7 @@
     list(GET CONFIGURATIONS 0 CONFIGURATION)
     get_target_property(LIBRARY ${TARGET_NAME} IMPORTED_LOCATION_${CONFIGURATION})
     list(APPEND DEPENDENT_LIBS ${LIBRARY})
+    ospray_install_namelink(${LIBRARY})
   else()
     message(STATUS "Skipping target '${TARGET_NAME}")
   endif()
@@ -103,10 +105,7 @@
   list(APPEND DEPENDENT_LIBS ${EMBREE_LIBRARY})
   install(PROGRAMS ${DEPENDENT_LIBS}
           DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT redist)
-  if (NOT APPLE)
-    get_filename_component(EMBREE_LIBNAME ${EMBREE_LIBRARY} NAME)
-    ospray_install_namelink(embree ${EMBREE_LIBNAME})
-  endif()
+  ospray_install_namelink(${EMBREE_LIBRARY})
 endif()

 # Install MSVC runtime


ENH: Update the tag of KWStyle

ENH: Update the tag of KWStyle

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

 # KWStyle
 set( KWStyle_URL ${git_protocol}://github.com/Kitware/KWStyle.git )
-set( KWStyle_HASH_OR_TAG 0fc7fd8 )
+set( KWStyle_HASH_OR_TAG 0620fdd )

 # LIBSVM
 set( LIBSVM_URL ${git_protocol}://github.com/KitwareMedical/libsvm.git )


windows.cmake fixes:

windows.cmake fixes:

- on UWP, always set /INCREMENTAL:NO as the cmake default
  is YES, which clashes with other UWP linker options
- make stack size configurable via cmake option

--- cmake-toolchains/windows.cmake
+++ cmake-toolchains/windows.cmake
@@ -2,6 +2,8 @@
 #	windows.cmake
 #	fips cmake settings file for Windows platform with MSVC.
 #-------------------------------------------------------------------------------
+
+set(FIPS_WINDOWS_STACK_SIZE 4194304 CACHE STRING "Windows process stack size (/STACK:xxx)")

 # detect 32-bit or 64-bit target platform
 if (CMAKE_CL_64)
@@ -65,7 +67,11 @@
 set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} ${FIPS_VS_CRT_FLAGS}")

 # define exe linker/librarian flags
-set(CMAKE_EXE_LINKER_FLAGS "/STACK:5000000 /machine:${FIPS_WINDOWS_PLATFORM_NAME}")
+set(CMAKE_EXE_LINKER_FLAGS "/STACK:${FIPS_WINDOWS_STACK_SIZE} /machine:${FIPS_WINDOWS_PLATFORM_NAME}")
+# cmake sets INCREMENTAL:YES, but UWP doesn't like that
+if (FIPS_UWP)
+    set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /INCREMENTAL:NO")
+endif()
 set(CMAKE_EXE_LINKER_FLAGS_DEBUG "/DEBUG")

 # librarian flags


fix uriparser md5sum

fix uriparser md5sum

--- cmake/External_uriparser.cmake
+++ cmake/External_uriparser.cmake
@@ -1,7 +1,7 @@
 ExternalProject_Add(URIPARSER
   PREFIX URIPARSER
   URL "http://sourceforge.net/projects/uriparser/files/Sources/0.8.2/uriparser-0.8.2.tar.bz2/download"
-  URL_MD5 d41d8cd98f00b204e9800998ecf8427e
+  URL_MD5 c5cf6b3941d887deb7defc2a86c40f1d
   BINARY_DIR ${CMAKE_BINARY_DIR}/URIPARSER/build
   DOWNLOAD_DIR ${DOWNLOAD_LOCATION}
   PATCH_COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/cmake/UriParser_cmake_lists_txt ${CMAKE_BINARY_DIR}/URIPARSER/src/URIPARSER


added more search paths for protobuf

added more search paths for protobuf

--- cmake/FindProtocolBuffer.cmake
+++ cmake/FindProtocolBuffer.cmake
@@ -252,10 +252,11 @@
 ENDIF (PROTOBUF_LIBRARIES AND PROTOBUF_INCLUDE_DIR)

 FIND_PATH(PROTOBUF_INCLUDE_DIR google/protobuf/service.h
-          PATHS "${HOME}/include"
-                "${HOME}/usr/include"
-                "${HOME}/protobuf"
-                "${HOME}/protobuf/include"
+          PATHS "$ENV{HOME}/include"
+                "$ENV{HOME}/usr/include"
+                "$ENV{HOME}/protobuf"
+                "$ENV{HOME}/protobuf/include"
+                "$ENV{PROTOBUF_ROOT}/include"
                 "${PROTOBUF_ROOT}/include"
                 "/usr/include"
                 "/usr/local/include"
@@ -275,10 +276,11 @@
 FIND_LIBRARY(PROTOBUF_LIBRARY
 			 NAMES "protobuf" "libprotobuf" "libprotobufd"
              PATHS
-              "${HOME}/lib"
-              "${HOME}/usr/lib"
-              "${HOME}/protobuf"
-              "${HOME}/protobuf/lib"
+              "$ENV{HOME}/lib"
+              "$ENV{HOME}/usr/lib"
+              "$ENV{HOME}/protobuf"
+              "$ENV{HOME}/protobuf/lib"
+              "$ENV{PROTOBUF_ROOT}/lib"
               "${PROTOBUF_ROOT}/lib"
               "/usr/lib"
               "/usr/local/lib"
@@ -288,10 +290,11 @@
 FIND_LIBRARY(PROTOBUF_PROTOC_LIBRARY
 			 NAMES "protoc" "libprotoc" "libprotocd"
              PATHS
-              "${HOME}/lib"
-              "${HOME}/usr/lib"
-              "${HOME}/protobuf"
-              "${HOME}/protobuf/lib"
+              "$ENV{HOME}/lib"
+              "$ENV{HOME}/usr/lib"
+              "$ENV{HOME}/protobuf"
+              "$ENV{HOME}/protobuf/lib"
+              "$ENV{PROTOBUF_ROOT}/lib"
               "${PROTOBUF_ROOT}/lib"
               "/usr/lib"
               "/usr/local/lib"
@@ -301,10 +304,11 @@
 FIND_PROGRAM(PROTOBUF_PROTOC_EXECUTABLE
 			 NAMES protoc
              PATHS
-              "${HOME}/bin"
-              "${HOME}/usr/bin"
-              "${HOME}/protobuf"
-              "${HOME}/protobuf/bin"
+              "$ENV{HOME}/bin"
+              "$ENV{HOME}/usr/bin"
+              "$ENV{HOME}/protobuf"
+              "$ENV{HOME}/protobuf/bin"
+              "$ENV{PROTOBUF_ROOT}/bin"
               "${PROTOBUF_ROOT}/bin"
               "/bin"
               "/usr/bin"


Add path_suffixes for finding cudnn.lib (#11513)

--- cmake/FirstClassLangCuda.cmake
+++ cmake/FirstClassLangCuda.cmake
@@ -38,6 +38,7 @@

   find_library(CUDNN_LIBRARY NAMES libcudnn.so cudnn.lib # libcudnn_static.a
                              PATHS ${CUDNN_ROOT} $ENV{CUDNN_ROOT} ${CUDNN_INCLUDE}
+                             PATH_SUFFIXES lib lib/x64
                              DOC "Path to cuDNN library.")

   if(CUDNN_INCLUDE AND CUDNN_LIBRARY)


Search python libs exactly matching to python executable on cmake 2.8.9 and newer

--- cmake/OpenCVDetectPython.cmake
+++ cmake/OpenCVDetectPython.cmake
@@ -30,7 +30,11 @@
   endif()

   if(NOT ANDROID AND NOT IOS)
-    find_host_package(PythonLibs ${PYTHON_VERSION_FULL})
+    if(CMAKE_VERSION VERSION_GREATER 2.8.8)
+      find_host_package(PythonLibs ${PYTHON_VERSION_FULL} EXACT)
+    else()
+      find_host_package(PythonLibs ${PYTHON_VERSION_FULL})
+    endif()
     # cmake 2.4 (at least on Ubuntu 8.04 (hardy)) don't define PYTHONLIBS_FOUND
     if(NOT PYTHONLIBS_FOUND AND PYTHON_INCLUDE_PATH)
       set(PYTHONLIBS_FOUND ON)


[LLDB][MIPS] Move it into HandleLLVMOptions.cmake.

The revison https://reviews.llvm.org/D32125 will fixed the off_t for GNU specific 32 bit platform. This fixed the difference in definition of off_t in LLDB and LLVM

Subscribers: jaydeep, bhushan, lldb-commits, slthakur, llvm-commits, krytarowski, emaste, zturner

git-svn-id: 4c4cc70b1ef44ba2b7963015e681894188cea27e@301172 91177308-0d34-0410-b5e6-96231b3b80d8

--- cmake/modules/LLDBConfig.cmake
+++ cmake/modules/LLDBConfig.cmake
@@ -250,12 +250,6 @@
 set(LLDB_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
 set(LLDB_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR})

-# If building on a 32-bit system, make sure off_t can store offsets > 2GB
-if( CMAKE_SIZEOF_VOID_P EQUAL 4 )
-  add_definitions( -D_LARGEFILE_SOURCE )
-  add_definitions( -D_FILE_OFFSET_BITS=64 )
-endif()
-
 if (CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR)
   message(FATAL_ERROR "In-source builds are not allowed. CMake would overwrite "
 "the makefiles distributed with LLDB. Please create a directory and run cmake "


Updated the GenLibDeps -> LLVMLibDeps.cmake transformation example.

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

--- cmake/modules/LLVMConfig.cmake
+++ cmake/modules/LLVMConfig.cmake
@@ -151,13 +151,13 @@

 # The format generated by GenLibDeps.pl

-# LLVMARMAsmPrinter.o: LLVMARMCodeGen.o libLLVMAsmPrinter.a libLLVMCodeGen.a libLLVMCore.a libLLVMSupport.a libLLVMTarget.a
+# libLLVMARMAsmPrinter.a: libLLVMMC.a libLLVMSupport.a

 # is translated to:

-# set(MSVC_LIB_DEPS_LLVMARMAsmPrinter LLVMARMCodeGen LLVMAsmPrinter LLVMCodeGen LLVMCore LLVMSupport LLVMTarget)
+# set(MSVC_LIB_DEPS_LLVMARMAsmPrinter LLVMMC LLVMSupport)

-# It is necessary to remove the `lib' prefix and the `.a'.
+# It is necessary to remove the `lib' prefix and the `.a' suffix.

 # This 'sed' script should do the trick:
 # sed -e s'#\.a##g' -e 's#libLLVM#LLVM#g' -e 's#: # #' -e 's#\(.*\)#set(MSVC_LIB_DEPS_\1)#' ~/llvm/tools/llvm-config/LibDeps.txt


Remove 'hunter_cacheable(wt)'

Remove 'hunter_cacheable(wt)'

--- cmake/projects/wt/hunter.cmake
+++ cmake/projects/wt/hunter.cmake
@@ -31,7 +31,9 @@
         ENABLE_LIBWTTEST=OFF
 )

-# Pick a download scheme
 hunter_pick_scheme(DEFAULT url_sha1_cmake)
-hunter_cacheable(wt)
+
+# FIXME: https://github.com/ruslo/hunter/pull/1655#issuecomment-446963534
+# hunter_cacheable(wt)
+
 hunter_download(PACKAGE_NAME wt)


ENH: Bump RandomForest version to address std::multiplies bug

--- CMake/Superbuild/ExternalProjectsConfig.cmake
+++ CMake/Superbuild/ExternalProjectsConfig.cmake
@@ -56,7 +56,7 @@
 # RandomForest
 set( RandomForest_URL
   ${git_protocol}://github.com/KitwareMedical/random-forest.git )
-set( RandomForest_HASH_OR_TAG 34642670791f3a2a3b5462534bfabaa24459c7a0 )
+set( RandomForest_HASH_OR_TAG d09ef57ab9b2289638bf4b6ba4240f5313862c2d )

 ###########################################################
 # ITK Modules


Replace custom GIT_IS_REPO macro with `git rev-parse --is-inside-work-tree`

--- CMake/mitkFunctionGetVersionDescription.cmake
+++ CMake/mitkFunctionGetVersionDescription.cmake
@@ -32,9 +32,13 @@

     find_package(Git)

-    if(GIT_FOUND)
-      GIT_IS_REPO(${source_dir} _is_git_repo)
-      if(_is_git_repo)
+    if(Git_FOUND)
+      execute_process(COMMAND ${GIT_EXECUTABLE} rev-parse --is-inside-work-tree
+        WORKING_DIRECTORY "${source_dir}"
+        RESULT_VARIABLE _result_var
+        OUTPUT_QUIET
+        ERROR_QUIET)
+      if(NOT _result_var)
         execute_process(COMMAND ${GIT_EXECUTABLE} describe --exact-match --dirty=${_dirty_repo_str}
                         WORKING_DIRECTORY ${source_dir}
                         OUTPUT_VARIABLE _project_git_tagname


bumping tarball version

bumping tarball version

--- SCOREC_StandAlone.cmake
+++ SCOREC_StandAlone.cmake
@@ -88,5 +88,5 @@

 #binary distribution package
 set(CPACK_GENERATOR "TGZ")
-set(CPACK_PACKAGE_VERSION "1.1.0")
+set(CPACK_PACKAGE_VERSION "1.2.0")
 include(CPack)


More correct ninja detection.

More correct ninja detection.

--- src/inserts/build.cmake
+++ src/inserts/build.cmake
@@ -87,9 +87,16 @@
 # TODO: replace other make calls with ${CMAKE_MAKE_PROGRAM} ?

 if (NINJA)
-    cppan_debug_message("COMMAND ${CMAKE_MAKE_PROGRAM} -C ${BUILD_DIR}")
+    set(cmd ninja)
+    if (CMAKE_MAKE_PROGRAM)
+        find_program(cmd2 ${CMAKE_MAKE_PROGRAM})
+        if (NOT ${cmd2} STREQUAL "cmd2-NOTFOUND")
+            set(cmd ${CMAKE_MAKE_PROGRAM})
+        endif()
+    endif()
+    cppan_debug_message("COMMAND ${cmd} -C ${BUILD_DIR}")
     execute_process(
-        COMMAND ${CMAKE_MAKE_PROGRAM} -C ${BUILD_DIR}
+        COMMAND ${cmd} -C ${BUILD_DIR}
         ${OUTPUT_QUIET}
         ${ERROR_QUIET}
         RESULT_VARIABLE ret


Transmit link flags to start using ld.gold

Former-commit-id: 4f1652c153570dfeda034f4f01b39c17f7097fa4

--- cmake-modules/BuildDependency.cmake
+++ cmake-modules/BuildDependency.cmake
@@ -11,6 +11,7 @@
     execute_process(
             COMMAND  ${CMAKE_COMMAND}
             --parallel ${num_threads}
+            -DCMAKE_EXE_LINKER_FLAGS_INIT=${CMAKE_EXE_LINKER_FLAGS}
             -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
             -DCMAKE_Fortran_COMPILER=${CMAKE_Fortran_COMPILER}
             -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}


Fix location of version_not_found check

Fix location of version_not_found check

If a hunter_config() call specifies a VERSION that isn’t defined in a hunter_add_version() call (hunter/cmake/<package>/hunter.cmake), then a call to hunter_download_server_url() is made with an empty VERSION, and the reported error looks like this:

```
-- [hunter *** DEBUG *** 2018-02-03T17:12:33] FunctionalPlus versions available: [B.A.D]

[hunter ** INTERNAL **] 'hunter_download_server_url' incorrect usage
[hunter ** INTERNAL **]  option 'SHA1' with one argument is mandatory.
```

This PR moves the existing HUNTER_PACKAGE_SHA1 version_not_found test above the call to hunter_download_server_url, such that the more intuitive error:

```
"Version not found: ${ver}. See 'hunter_config' command.")
```

occurs first, instead of the indirect error that is reported inside hunter_download_server_url.

The error then becomes more human readable:

```
-- [hunter *** DEBUG *** 2018-02-03T17:15:09] FunctionalPlus versions available: [B.A.D]

[hunter ** FATAL ERROR **] Version not found: 1.0.0. See 'hunter_config' command.
```

--- cmake/modules/hunter_download.cmake
+++ cmake/modules/hunter_download.cmake
@@ -80,6 +80,12 @@
   set(HUNTER_PACKAGE_VERSION "${HUNTER_${h_name}_VERSION}")
   set(ver "${HUNTER_PACKAGE_VERSION}")
   set(HUNTER_PACKAGE_SHA1 "${HUNTER_${h_name}_SHA1}")
+
+  string(COMPARE EQUAL "${HUNTER_PACKAGE_SHA1}" "" version_not_found)
+  if(version_not_found)
+    hunter_user_error("Version not found: ${ver}. See 'hunter_config' command.")
+  endif()
+
   # set download URL, either direct download or redirected if HUNTER_DOWNLOAD_SERVER is set
   hunter_download_server_url(
     PACKAGE "${HUNTER_PACKAGE_NAME}"
@@ -110,11 +116,6 @@
   hunter_test_string_not_empty("${HUNTER_PACKAGE_CONFIGURATION_TYPES}")

   string(COMPARE EQUAL "${HUNTER_PACKAGE_URL}" "" hunter_no_url)
-
-  string(COMPARE EQUAL "${HUNTER_PACKAGE_SHA1}" "" version_not_found)
-  if(version_not_found)
-    hunter_user_error("Version not found: ${ver}. See 'hunter_config' command.")
-  endif()

   hunter_test_string_not_empty("${HUNTER_PACKAGE_URL}")
   hunter_test_string_not_empty("${HUNTER_PACKAGE_SHA1}")


Fix path for mkdir command (MinGW generator)

--- cmake/modules/hunter_try_lock.cmake
+++ cmake/modules/hunter_try_lock.cmake
@@ -32,6 +32,10 @@
   # `cmake -E make_directory` is not fit here because this command succeed
   # even if directory already exists
   if(WIN32)
+    if(MINGW)
+      # He-he :)
+      string(REPLACE "/" "\\" lock_path "${lock_path}")
+    endif()
     execute_process(
         COMMAND cmd /C mkdir "${lock_path}"
         RESULT_VARIABLE lock_result


- Fix OSX symlink issues with SDL2 and Brew

--- cmake/Find/FindSDL2.cmake
+++ cmake/Find/FindSDL2.cmake
@@ -93,7 +93,7 @@
     PATHS ${SDL2_SEARCH_PATHS}
     )

-get_filename_component ( SDL2_INCLUDE_DIR "${SDL2_INCLUDE_DIR}" ABSOLUTE )
+get_filename_component ( SDL2_INCLUDE_DIR "${SDL2_INCLUDE_DIR}" REALPATH )

 FIND_LIBRARY(SDL2_LIBRARY_TEMP
   NAMES


Fix build.

Fix build.

--- cmake/FindLeptonica.cmake
+++ cmake/FindLeptonica.cmake
@@ -19,7 +19,7 @@
     /opt/local/include
     ${Leptonica_DIR}/include
 )
-if("${Leptonica_INCLUDE_DIR}" EQUAL "Leptonica_INCLUDE_DIR-NOTFOUND")
+if(NOT "${Leptonica_INCLUDE_DIR}" EQUAL "Leptonica_INCLUDE_DIR-NOTFOUND")
     set(Leptonica_INCLUDE_DIRS ${Leptonica_INCLUDE_DIR}/leptonica)
     file(STRINGS ${Leptonica_INCLUDE_DIRS}/allheaders.h Leptonica_MAJOR_VERSION REGEX "LIBLEPT_MAJOR_VERSION")
     file(STRINGS ${Leptonica_INCLUDE_DIRS}/allheaders.h Leptonica_MINOR_VERSION REGEX "LIBLEPT_MINOR_VERSION")


Added 1.58.0-p0 boost version (works)

Added 1.58.0-p0 boost version (works)

--- cmake/Hunter/config.cmake
+++ cmake/Hunter/config.cmake
@@ -4,7 +4,7 @@
 #build.py --toolchain android-ndk-r10e-api-16-armeabi-v7a-neon-clang-35 --verbose --fwd HUNTER_CONFIGURATION_TYPES=Release ANDROID=TRUE --clear

 # This works with above compilation
-#hunter_config(Boost VERSION 1.58.0-p0-android-zlib CMAKE_ARGS IOSTREAMS_NO_BZIP2=1)
+#hunter_config(Boost VERSION 1.58.0-p0 CMAKE_ARGS IOSTREAMS_NO_BZIP2=1)

 # This doesn't work with above compilation
 hunter_config(Boost VERSION 1.58.0-p1 CMAKE_ARGS IOSTREAMS_NO_BZIP2=1)


Fix MacOS compile (#6062)

Fix MacOS compile (#6062)

--- cmake/external/grpc.cmake
+++ cmake/external/grpc.cmake
@@ -24,9 +24,9 @@
 SET(GRPC_INCLUDE_DIR "${GRPC_INSTALL_DIR}/include/" CACHE PATH "grpc include directory." FORCE)
 SET(GRPC_CPP_PLUGIN "${GRPC_INSTALL_DIR}/bin/grpc_cpp_plugin" CACHE FILEPATH "GRPC_CPP_PLUGIN" FORCE)
 IF(APPLE)
-  SET(BUILD_CMD make -n | sed "s/-Werror//g" | sh)
+  SET(BUILD_CMD make -n HAS_SYSTEM_PROTOBUF=false -s -j8 static grpc_cpp_plugin | sed "s/-Werror//g" | sh)
 ELSE()
-  SET(BUILD_CMD make)
+  SET(BUILD_CMD make HAS_SYSTEM_PROTOBUF=false -s -j8 static grpc_cpp_plugin)
 ENDIF()

 ExternalProject_Add(
@@ -42,7 +42,7 @@
     # Disable -Werror, otherwise the compile will fail in MacOS.
     # It seems that we cannot configure that by make command.
     # Just dry run make command and remove `-Werror`, then use a shell to run make commands
-    BUILD_COMMAND  ${BUILD_CMD} HAS_SYSTEM_PROTOBUF=false -s -j8 static grpc_cpp_plugin
+    BUILD_COMMAND  ${BUILD_CMD}
     INSTALL_COMMAND make prefix=${GRPC_INSTALL_DIR} install
 )


do not look for examples in PCLConfig.cmake

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

--- cmake/pcl_pclconfig.cmake
+++ cmake/pcl_pclconfig.cmake
@@ -1,6 +1,6 @@

 set(PCL_SUBSYSTEMS_MODULES ${PCL_SUBSYSTEMS})
-list(REMOVE_ITEM PCL_SUBSYSTEMS_MODULES tools cuda_apps global_tests proctor gpu_kinfu)
+list(REMOVE_ITEM PCL_SUBSYSTEMS_MODULES tools cuda_apps global_tests proctor examples)

 set(PCLCONFIG_AVAILABLE_COMPONENTS)
 set(PCLCONFIG_AVAILABLE_COMPONENTS_LIST)


build: enable "filter_throttle" on Windows (#1833)

I can confirm that filter_throttle can be compiled and linked
on Windows.

So this turns on the build flag, and lets Windows users use it.

Signed-off-by: Fujimoto Seiji <ef879192bb1e41d519c82cf76440dc8e9a530806@clear-code.com>

--- cmake/windows-setup.cmake
+++ cmake/windows-setup.cmake
@@ -74,7 +74,7 @@
 set(FLB_FILTER_STDOUT         Yes)
 set(FLB_FILTER_PARSER         Yes)
 set(FLB_FILTER_KUBERNETES     Yes)
-set(FLB_FILTER_THROTTLE        No)
+set(FLB_FILTER_THROTTLE       Yes)
 set(FLB_FILTER_NEST           Yes)
 set(FLB_FILTER_LUA            Yes)
 set(FLB_FILTER_RECORD_MODIFIER Yes)


cmake: modules: Remove duplicates only from existing ZEPHYR_MODULE_NAMES

Remove duplicates from ZEPHYR_MODULE_NAMES only if that list
exists. That avoids cmake error "list sub-command REMOVE_DUPLICATES
requires list to be present" if ZEPHYR_MODULE_NAMES is empty.

Signed-off-by: Wolfgang Puffitsch <f148e6efbb74c70a1ee845a87fa7616913a99a4b@demant.com>

--- cmake/zephyr_module.cmake
+++ cmake/zephyr_module.cmake
@@ -123,4 +123,6 @@

 endif()

-list(REMOVE_DUPLICATES ZEPHYR_MODULE_NAMES)
+if(DEFINED ZEPHYR_MODULE_NAMES)
+  list(REMOVE_DUPLICATES ZEPHYR_MODULE_NAMES)
+endif()


Added key for linux target.

Added key for linux target.

--- scripts/generator-key.cmake
+++ scripts/generator-key.cmake
@@ -2,6 +2,8 @@
   SET(GENERATOR_KEY android)
 elseif (MINGW)
   SET(GENERATOR_KEY mingw)
+elseif (UNIX)
+  SET(GENERATOR_KEY linux)
 elseif (MSVC)
   SET(GENERATOR_KEY msvc)
 elseif (IOS)


Fixup boost

Fixup boost

libelous actually needs libboost_chrono


Adding gflags for glog and ceres

Adding gflags for glog and ceres

Former-commit-id: 950f3f8caaf50d92f7bcf2634e2a1b45e46a428a

--- cmake-modules/Fetch_Ceres.cmake
+++ cmake-modules/Fetch_Ceres.cmake
@@ -46,7 +46,7 @@
             -DEIGEN_INCLUDE_DIR:PATH=${EIGEN3_INCLUDE_DIR}
             -DEIGEN_INCLUDE_DIR_HINTS:PATH=${EIGEN3_INCLUDE_DIR}
             -DEIGEN_PREFER_EXPORTED_EIGEN_CMAKE_CONFIGURATION:BOOL=OFF
-            -Dglog_DIR:PATH=${glog_DIR}
+            #-Dglog_DIR:PATH=${glog_DIR}
             -DGLOG_INCLUDE_DIR:PATH=${GLOG_INCLUDE_DIR}
             -DGLOG_LIBRARY:PATH=${GLOG_LIBRARY}
             -DLAPACK:BOOL=OFF


Fix CPack creating -qtX packages

Fix CPack creating -qtX packages

--- cmake/modules/CPackConfig.cmake
+++ cmake/modules/CPackConfig.cmake
@@ -2,7 +2,7 @@
 set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "A Web Framework built on top of Qt, using the simple and elegant approach of Catalyst (Perl) framework.")
 set(CPACK_RESOURCE_FILE_README "${CMAKE_CURRENT_SOURCE_DIR}/README.md")
 set(CPACK_PACKAGE_CONTACT "Daniel Nicoletti <dantti12@gmail.com>")
-set(CPACK_PACKAGE_NAME "${PROJECT_NAME}${PROJECT_VERSION_MAJOR}")
+set(CPACK_PACKAGE_NAME "${PROJECT_NAME}${PROJECT_VERSION_MAJOR}-qt${QT_VERSION_MAJOR}")

 if(UNIX)
   if(NOT CPACK_GENERATOR)


give this cmake module a nice refresh:
- query pkg-config and use its results as start for the find_{path,library} calls
- compile and run the test application in the Proper Way(tm), instead of hardcoding the compiler compiling line
- less output

svn path=/trunk/KDE/kdenetwork/cmake/modules/FindLiboRTP.cmake; revision=896356

--- cmake/modules/FindLiboRTP.cmake
+++ cmake/modules/FindLiboRTP.cmake
@@ -1,34 +1,52 @@
 # cmake macro to test LiboRTP

 # Copyright (c) 2008, Detlev Casanova <detlev.casanova @ gmail.com>
+# Copyright (c) 2008, Pino Toscano <pino@kde.org>
 #
 # Redistribution and use is allowed according to the terms of the BSD license.
 # For details see the accompanying COPYING-CMAKE-SCRIPTS file.

 INCLUDE( FindPackageHandleStandardArgs )
-
-FIND_PATH( LIBORTP_INCLUDE_DIR ortp/ortp.h ${KDE4_INCLUDE_DIR} )
-
-FIND_LIBRARY( LIBORTP_LIBRARY NAMES ortp )
+include( FindPkgConfig )

 SET( LIBORTP_FOUND FALSE )

+pkg_check_modules(ortp ortp)
+
+FIND_PATH( LIBORTP_INCLUDE_DIR
+           ortp/ortp.h
+           PATHS ${ortp_INCLUDEDIR} ${KDE4_INCLUDE_DIR}
+)
+
+FIND_LIBRARY( LIBORTP_LIBRARY
+              NAMES ortp
+              PATHS ${ortp_LIBDIR}
+)
+
 IF( LIBORTP_INCLUDE_DIR AND LIBORTP_LIBRARY )
-  EXECUTE_PROCESS( COMMAND gcc -o ortpversion -lortp -L${LIBORTP_INCLUDE_DIR} ${CMAKE_SOURCE_DIR}/cmake/modules/ortpversion.c OUTPUT_QUIET ERROR_QUIET RESULT_VARIABLE compileErr )
-  if ( NOT compileErr )
-    EXECUTE_PROCESS(COMMAND ./ortpversion 0 13 RESULT_VARIABLE resultErr )
-    if ( NOT resultErr )
+  # we need to save and disable the C flags currently set, as they can conflict
+  # with ortp's requirements (c99)
+  set(save_cmake_c_flags ${CMAKE_C_FLAGS})
+  set(CMAKE_C_FLAGS)
+  try_run( run_result compile_result
+           ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/ortpversion.c
+           CMAKE_FLAGS -DINCLUDE_DIRECTORIES:STRING=${LIBORTP_INCLUDE_DIR} -DLINK_LIBRARIES=${LIBORTP_LIBRARY}
+           COMPILE_DEFINITIONS "${ortp_CFLAGS}"
+           ARGS "0 13"
+  )
+  set(CMAKE_C_FLAGS ${save_cmake_c_flags})
+
+  if ( compile_result )
+    if ( run_result EQUAL 0 )
 #     Version OK
       SET( LIBORTP_FOUND TRUE )
       MESSAGE( STATUS "Found libortp: ${LIBORTP_LIBRARY}" )
-    endif( NOT resultErr )
-  endif( NOT compileErr )
+    endif ( run_result EQUAL 0 )
+  endif( compile_result )
 ENDIF( LIBORTP_INCLUDE_DIR AND LIBORTP_LIBRARY )

-IF( resultErr OR compileErr )
+if( NOT LIBORTP_FOUND )
   if( LiboRTP_FIND_REQUIRED )
-    message( FATAL_ERROR "You need ortp version 0.13 minimum.\nPlease build and install it first." )
-  else ( LiboRTP_FIND_REQUIRED )
-    message( "LiboRTP not found on your system !" )
+    message( FATAL_ERROR "You need ortp, minimum version 0.13." )
   endif ( LiboRTP_FIND_REQUIRED )
-endif( resultErr OR compileErr )
+endif( NOT LIBORTP_FOUND )


Use an empty endmacro() command.

Use an empty endmacro() command.

--- cmake/modules/GrantleeUse.cmake
+++ cmake/modules/GrantleeUse.cmake
@@ -53,4 +53,4 @@
   target_link_libraries(${pluginname}
     grantlee_core
   )
-endmacro(GRANTLEE_ADD_PLUGIN)
+endmacro()


compile *.c files in external modules

compile *.c files in external modules

--- cmake_modules/ZorbaModule.cmake
+++ cmake_modules/ZorbaModule.cmake
@@ -213,7 +213,7 @@
         SET (_src_dir "${CMAKE_CURRENT_SOURCE_DIR}/${_src_dir}")
       ENDIF (NOT IS_ABSOLUTE "${_src_dir}")
       FILE(GLOB_RECURSE _srcs RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
-        "${_src_dir}/*.cpp")
+        "${_src_dir}/*.cpp" "${_src_dir}/*.c")
       LIST (APPEND SRC_FILES ${_srcs})
     ENDFOREACH (_src_dir)


[builtins] Make sure builtin compile tests respect CMAKE_C_COMPILER_TARGET

Summary:
Since we generate the compiler invocation on our own, we need to
manually add -target if CMAKE_C_COMPILER_TARGET has been specified.

Reviewers: compnerd, beanz

Subscribers: llvm-commits

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

git-svn-id: c199f293c43da69278bea8e88f92242bf3aa95f7@279747 91177308-0d34-0410-b5e6-96231b3b80d8

--- cmake/Modules/BuiltinTests.cmake
+++ cmake/Modules/BuiltinTests.cmake
@@ -11,7 +11,13 @@
   file(WRITE ${SIMPLE_C} "${ARG_SOURCE}\n")
   string(REGEX MATCHALL "<[A-Za-z0-9_]*>" substitutions
          ${CMAKE_C_COMPILE_OBJECT})
-  string(REPLACE ";" " " extra_flags "${ARG_FLAGS}")
+
+  set(TRY_COMPILE_FLAGS "${ARG_FLAGS}")
+  if(CMAKE_C_COMPILER_ID MATCHES Clang AND CMAKE_C_COMPILER_TARGET)
+    list(APPEND TRY_COMPILE_FLAGS "-target ${CMAKE_C_COMPILER_TARGET}")
+  endif()
+
+  string(REPLACE ";" " " extra_flags "${TRY_COMPILE_FLAGS}")

   set(test_compile_command "${CMAKE_C_COMPILE_OBJECT}")
   foreach(substitution ${substitutions})


quiet for pkg_config messages

quiet for pkg_config messages

--- cmake/Modules/FindCppUTest.cmake
+++ cmake/Modules/FindCppUTest.cmake
@@ -1,19 +1,25 @@
 # - Find CPPUTest library
+#
 # It defines:
 # CPPUTEST_FOUND               If the CPPUTest is found
 # CPPUTEST_INCLUDE_DIRS        PATH to the include directory
 # CPPUTEST_LIBRARIES           libraries
+#
+# CPPUTEST_DIR is used for guessing the installed path.
+#

-find_package(PkgConfig)
+find_package(PkgConfig QUIET)

-pkg_check_modules(PC_CPPUTEST cpputest>=3.7)
+pkg_check_modules(PC_CPPUTEST cpputest QUIET)

 find_path(CPPUTEST_INCLUDE_DIR CppUTest/CppUTestConfig.h
   HINTS ${PC_CPPUTEST_INCLUDEDIR} ${PC_CPPUTEST_INCLUDE_DIRS}
+  ${CPPUTEST_DIR}/include
 )

 find_library(CPPUTEST_LIBRARY NAMES CppUTest libCppUTest
   HINTS ${PC_CPPUTEST_LIBDIR} ${PC_CPPUTEST_LIBRARY_DIRS}
+  ${CPPUTEST_DIR}/lib ${CPPUTEST_DIR}/lib64
 )

 include(FindPackageHandleStandardArgs)


Botan: Remove useless whitespace from CMake code

--- cmake/Modules/FindLibBotan.cmake
+++ cmake/Modules/FindLibBotan.cmake
@@ -7,7 +7,7 @@
 #  BOTAN_INCLUDE_DIRS - the path to the include files of the Botan library
 #
 # Copyright (c) 2017 Peter Nirschl <peter.nirschl@gmail.com>
-#
+#
 # Redistribution and use is allowed according to the terms of the BSD license.
 # For details see the accompanying COPYING-CMAKE-SCRIPTS file.
 #
@@ -18,7 +18,7 @@
 endif ()

 if (BOTAN_FOUND)
-  # try to compile and link a minimal sample program against libbotan
+  # try to compile and link a minimal sample program against libbotan
   try_compile (HAS_BOTAN_4SURE
     "${CMAKE_BINARY_DIR}"
     "${PROJECT_SOURCE_DIR}/src/plugins/crypto/compile_botan.cpp"


From Pere:
Add -Od compiler option (disable optimisation) when building in Debug mode.

git-svn-id: 9d02132d8e1217b86764d694e1605987040d84e5@48232 27541ba8-7e3a-0410-8455-c3a389f83636

--- cmake/modules/SetUpWindows.cmake
+++ cmake/modules/SetUpWindows.cmake
@@ -15,10 +15,10 @@
 #---Select compiler flags----------------------------------------------------------------
 set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -Z7")
 set(CMAKE_CXX_FLAGS_RELEASE        "-O2")
-set(CMAKE_CXX_FLAGS_DEBUG          "-Z7")
+set(CMAKE_CXX_FLAGS_DEBUG          "-Od -Z7")
 set(CMAKE_C_FLAGS_RELWITHDEBINFO   "-O2 -Z7")
 set(CMAKE_C_FLAGS_RELEASE          "-O2")
-set(CMAKE_C_FLAGS_DEBUG            "-Z7")
+set(CMAKE_C_FLAGS_DEBUG            "-Od -Z7")

 if(winrtdebug)
   set(BLDCXXFLAGS "-MDd -GR")


build: add a dependency on the swift compiler

Add a dependency on the swift compiler to ensure that a change to the
compiler will rebuild the swift portions.

Signed-off-by: Daniel A. Steffen <bc823475b60dbcbd7be1bbdfe095b5f1939d5bd2@apple.com>

--- cmake/modules/SwiftSupport.cmake
+++ cmake/modules/SwiftSupport.cmake
@@ -57,6 +57,7 @@
                        ${module_directory}/${ASL_MODULE_NAME}.swiftdoc
                      DEPENDS
                        ${ASL_SOURCES}
+                       ${CMAKE_SWIFT_COMPILER}
                      COMMAND
                        ${CMAKE_COMMAND} -E make_directory ${module_directory}
                      COMMAND


fix linking on Windows

fix linking on Windows

--- rosidl_typesupport_opensplice_cpp/cmake/rosidl_typesupport_opensplice_cpp_generate_interfaces.cmake
+++ rosidl_typesupport_opensplice_cpp/cmake/rosidl_typesupport_opensplice_cpp_generate_interfaces.cmake
@@ -105,6 +105,10 @@

 link_directories(${OpenSplice_LIBRARY_DIRS})
 add_library(${rosidl_generate_interfaces_TARGET}${_target_suffix} SHARED ${_generated_files})
+if(WIN32)
+  target_compile_definitions(${rosidl_generate_interfaces_TARGET}${_target_suffix}
+    PRIVATE "ROSIDL_BUILDING_DLL")
+endif()
 target_include_directories(${rosidl_generate_interfaces_TARGET}${_target_suffix}
   PUBLIC
   ${CMAKE_CURRENT_BINARY_DIR}/rosidl_generator_cpp