explicitly run python.
look for cookie file: if not there ask user to run upload.py manually,
and use a new CR_ISSUE arg to update later.

SVN-Revision: 492

--- make/codereview.cmake
+++ make/codereview.cmake
@@ -64,6 +64,9 @@
 #   DR_ISSUE:BOOL   = Set to ON to create a DynamoRIO Issue to cover the review
 #                     task.  This is no longer recommended as we use Rietveld
 #                     and don't want to pollute the DR issue tracker.
+#   CR_ISSUE:STRING = Gives the codereview.appspot.com issue number to use, if
+#                     the diff was uploaded manually and thus the number is not
+#                     stored at the top of the diff itself.
 #
 # Examples:
 #
@@ -135,6 +138,11 @@
 if (NOT EXISTS "make/upload.py")
   message(FATAL_ERROR "cannot find make/upload.py")
 endif ()
+
+find_program(PYTHON python DOC "subversion client")
+if (NOT PYTHON)
+  message(FATAL_ERROR "python not found")
+endif (NOT PYTHON)

 find_program(SVN svn DOC "subversion client")
 if (NOT SVN)
@@ -234,19 +242,28 @@
   # If someone manually created these files then this script
   # will fail: we assume not already there if haven't been
   # added to svn yet.
-  set(cur_issue )
+  if (CR_ISSUE)
+    set(cur_issue -i ${CR_ISSUE})
+  else (CR_ISSUE)
+    set(cur_issue )
+  endif (CR_ISSUE)
   if (NOT EXISTS "${DIFF_FILE}")
     file(WRITE "${DIFF_FILE}" "")
     run_svn("add;${DIFF_LOCAL}")
   else (NOT EXISTS "${DIFF_FILE}")
-    # Get Rietveld issue #
-    file(READ "${DIFF_FILE}" curdiff)
-    string(REGEX MATCHALL "http://codereview.appspot.com/[0-9]*" issue "${curdiff}")
-    string(REGEX REPLACE "http://codereview.appspot.com/" "" inum "${issue}")
-    if (NOT "${inum}" STREQUAL "")
-      set(cur_issue -i ${inum})
-    endif ()
+    if (NOT CR_ISSUE)
+      # Get Rietveld issue #
+      file(READ "${DIFF_FILE}" curdiff)
+      string(REGEX MATCH "http://codereview.appspot.com/[0-9]*" issue "${curdiff}")
+      string(REGEX REPLACE "http://codereview.appspot.com/" "" inum "${issue}")
+      if (NOT "${inum}" STREQUAL "")
+        set(cur_issue -i ${inum})
+      endif (NOT "${inum}" STREQUAL "")
+    endif (NOT CR_ISSUE)
   endif (NOT EXISTS "${DIFF_FILE}")
+  if ("${inum}" STREQUAL "")
+    set(issue "Not auto-uploaded to codereview.appspot.com")
+  endif ("${inum}" STREQUAL "")

   file(READ "${NOTES}" string)
   string(REGEX REPLACE "^.*\ntoreview:\r?\n" "" pubnotes "${string}")
@@ -455,18 +472,40 @@

  if (COMMIT)
     # Upload to Rietveld with notes as description
-    execute_process(COMMAND "make/upload.py" -y
+    # Unfortunately there's no way in CMake to execute upload.py when it
+    # asks for a password (it needs control over the terminal to do that)
+    # so we only automate when cookies are in place.
+    set(home "$ENV{HOME}")
+    if (WIN32 AND "${home}" STREQUAL "")
+      set(home "$ENV{USERPROFILE}")
+    endif ()
+    set(cookie_file "${home}/.codereview_upload_cookies")
+    set(upload_cmd "${PYTHON}" "make/upload.py" -y
       -e "${AUTHOR}" -r "${REVIEWER}" -m "${first_line}" -f "${DIFF_FILE}"
       --send_mail --cc=dynamorio-devs@googlegroups.com
-      ${cur_issue} ${DIFFARGS}
-      RESULT_VARIABLE cmd_result
-      ERROR_VARIABLE cmd_err
-      OUTPUT_VARIABLE cmd_out)
-    if (cmd_result OR cmd_err)
-      message(FATAL_ERROR "*** upload.py failed: ***\n${cmd_out}\n${cmd_err}")
-    endif (cmd_result OR cmd_err)
-    string(REGEX MATCHALL "http://codereview.appspot.com/[0-9]*" issue "${cmd_out}")
-    message(STATUS "Issue is uploaded to: ${issue}")
+      ${cur_issue} ${DIFFARGS})
+    # list to string
+    foreach(arg ${upload_cmd})
+      if (arg MATCHES " ")
+        set(upload_cmd_str "${upload_cmd_str} \"${arg}\"")
+      else (arg MATCHES " ")
+        set(upload_cmd_str "${upload_cmd_str} ${arg}")
+      endif (arg MATCHES " ")
+    endforeach(arg ${upload_cmd})
+    if (NOT EXISTS "${cookie_file}")
+      message(STATUS "It looks like upload.py does not have cookies in place and will prompt you for a password.  To do so you must run it separately (and then use -DCR_ISSUE=<issue#> arg with future invocations of this script in order to update the same issue).\nPlease run:\n\t${upload_cmd_str}")
+    else (NOT EXISTS "${cookie_file}")
+      message(STATUS "running ${upload_cmd_str}")
+      execute_process(COMMAND ${upload_cmd}
+        RESULT_VARIABLE cmd_result
+        OUTPUT_VARIABLE cmd_out
+        ERROR_VARIABLE cmd_err)
+      if (cmd_result OR cmd_err)
+        message(FATAL_ERROR "*** upload.py failed: ***\n${cmd_out}\n${cmd_err}.")
+      endif (cmd_result OR cmd_err)
+      string(REGEX MATCHALL "http://codereview.appspot.com/[0-9]*" issue "${cmd_out}")
+      message(STATUS "Issue is uploaded to: ${issue}")
+    endif (NOT EXISTS "${cookie_file}")
   endif (COMMIT)
   # Save issue for next time
   file(APPEND "${DIFF_FILE}" "\n${issue}\n")


ADD lock simple mechanism for prevent simultaneous launch of continuous build

git-svn-id: 8b72b58fb31a931b6e9a2bd3bb08bc6614045fb1@3537 c330d7e9-fc0c-0410-a5b3-fd85c6f5aa8f

--- test/openVibeTests.cmake
+++ test/openVibeTests.cmake
@@ -73,6 +73,8 @@

 ## -- DashBoard Root
 set(CTEST_DASHBOARD_ROOT                "${CMAKE_CURRENT_SOURCE_DIR}")
+
+

 # -----------------------------------------------------------
 # -- commands
@@ -147,6 +149,8 @@
 set( $ENV{LC_MESSAGES}      "en_EN" )

+
+
 # -----------------------------------------------------------
 # -- Run CTest
 # -----------------------------------------------------------
@@ -154,6 +158,15 @@
 ## -- Start
 message(" -- Start dashboard ${MODEL} - ${CTEST_BUILD_NAME} --")
 ctest_start(${MODEL} TRACK ${MODEL})
+
+## Test if another continuous test is not finished
+IF(${MODEL} MATCHES Continuous)
+	IF(NOT EXISTS "lock")
+		FILE(WRITE "lock" "remove if needed")
+	ELSE(NOT EXISTS "lock")
+		RETURN()
+	ENDIF(NOT EXISTS "lock")
+ENDIF(${MODEL} MATCHES Continuous)

 set(ALL_OK TRUE)
 ## -- Update
@@ -165,9 +178,11 @@
 		set(ALL_OK FALSE)
 	ENDIF(res EQUAL -1)
 	##  run build and test for continuous integration model only if there was a new update
-	#~ IF(res EQUAL 0 AND ${MODEL} MATCHES Continuous)
-		#~ RETURN()
-	#~ ENDIF(res EQUAL 0 AND ${MODEL} MATCHES Continuous)
+	IF(res EQUAL 0 AND ${MODEL} MATCHES Continuous)
+		# unlock before exit
+		FILE(REMOVE "lock")
+		RETURN()
+	ENDIF(res EQUAL 0 AND ${MODEL} MATCHES Continuous)
 ENDIF(ALL_OK)

@@ -204,7 +219,7 @@
 ## -- SUBMIT
 message(" -- Submit ${MODEL} - ${CTEST_BUILD_NAME} --")

-#ctest_submit(                                              RETURN_VALUE res)
+ctest_submit(                                              RETURN_VALUE res)
 message(STATUS "  INFO : submit(...) returned '${res}'")

 message(" -- Finished ${MODEL}  - ${CTEST_BUILD_NAME} --")
@@ -216,4 +231,7 @@
 	exec_program("rm" ARGS "-rf ${CTEST_SOURCE_DIRECTORY}" OUTPUT_VARIABLE "cleanScript")
 ENDIF(${MODEL} MATCHES Nightly)

-
+## unlock if continous build
+IF(${MODEL} MATCHES Continuous)
+	FILE(REMOVE "lock")
+ENDIF(${MODEL} MATCHES Continuous)


Fix hard coded Ogre path to look under OGRE_ROOT instead.

--- build/modules/FindOGRE.cmake
+++ build/modules/FindOGRE.cmake
@@ -58,7 +58,7 @@
   IF(NOT PKG_CONFIG_FOUND)
     MESSAGE("Could not find pkg-config (to search for OGRE)")
   ELSE(NOT PKG_CONFIG_FOUND)
-    SET(ENV{PKG_CONFIG_PATH} /home/daniel/sirikata/dependencies/lib/pkgconfig)
+    SET(ENV{PKG_CONFIG_PATH} ${OGRE_ROOT}/lib/pkgconfig)
     IF(OGRE_MINIMUM_VERSION)
       PKG_CHECK_MODULES( OGRE OGRE >= ${OGRE_MINIMUM_VERSION})  # will set OGRE_FOUND
     ELSE(OGRE_MINIMUM_VERSION)


Fix API_Hardware.Stm32 text (#1247)

Fix API_Hardware.Stm32 text (#1247)

--- CMake/Modules/NF_NativeAssemblies.cmake
+++ CMake/Modules/NF_NativeAssemblies.cmake
@@ -30,7 +30,7 @@

 # Stm32 only
-option(API_Hardware.Stm32                       "option for Hardware.Esp32")
+option(API_Hardware.Stm32                       "option for Hardware.Stm32")

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


Fix OSX and iOS builds.

Fix OSX and iOS builds.

--- CMake/Modules/Urho3D-CMake-common.cmake
+++ CMake/Modules/Urho3D-CMake-common.cmake
@@ -1558,9 +1558,9 @@
             endif ()
         elseif (APPLE)
             if (IOS OR TVOS)
-                list (APPEND LIBS "-framework AudioToolbox" "-framework CoreAudio" "-framework CoreGraphics" "-framework CoreMotion" "-framework Foundation" "-framework GameController" "-framework OpenGLES" "-framework QuartzCore" "-framework UIKit")
+                list (APPEND LIBS "-framework AudioToolbox" "-framework AVFoundation" "-framework CoreAudio" "-framework CoreGraphics" "-framework CoreMotion" "-framework Foundation" "-framework GameController" "-framework OpenGLES" "-framework QuartzCore" "-framework UIKit")
             else ()
-                list (APPEND LIBS "-framework AudioUnit" "-framework Carbon" "-framework Cocoa" "-framework CoreAudio" "-framework CoreServices" "-framework CoreVideo" "-framework ForceFeedback" "-framework IOKit" "-framework OpenGL")
+                list (APPEND LIBS "-framework AudioToolbox" "-framework Carbon" "-framework Cocoa" "-framework CoreAudio" "-framework CoreServices" "-framework CoreVideo" "-framework ForceFeedback" "-framework IOKit" "-framework OpenGL")
             endif ()
         endif ()


cmake: fix issues with build process

cmake: fix issues with build process

Fix issue when COMPONENTS are is not specified for idf_build_process,
no component is included in the build.

--- tools/cmake/build.cmake
+++ tools/cmake/build.cmake
@@ -367,15 +367,20 @@
     __build_check_python()

     idf_build_set_property(__COMPONENT_REQUIRES_COMMON ${target} APPEND)
-    __component_get_requirements()

     # Perform early expansion of component CMakeLists.txt in CMake scripting mode.
     # It is here we retrieve the public and private requirements of each component.
     # It is also here we add the common component requirements to each component's
     # own requirements.
+    __component_get_requirements()
+
+    idf_build_get_property(component_targets __COMPONENT_TARGETS)

     # Finally, do component expansion. In this case it simply means getting a final list
     # of build component targets given the requirements set by each component.
+
+    # Check if we need to trim the components first, and build initial components list
+    # from that.
     if(__COMPONENTS)
         unset(component_targets)
         foreach(component ${__COMPONENTS})
@@ -390,7 +395,7 @@
     foreach(component_target ${component_targets})
         __build_expand_requirements(${component_target})
     endforeach()
-    unset(__COMPONENT_TARGETS_SEEN)
+    idf_build_unset_property(__COMPONENT_TARGETS_SEEN)

     # Get a list of common component requirements in component targets form (previously
     # we just have a list of component names)


Update to compile on FreeBSD 12

Update to compile on FreeBSD 12

--- build/cmake/macros/SystemSpecificInformations.cmake
+++ build/cmake/macros/SystemSpecificInformations.cmake
@@ -265,6 +265,7 @@
     set( SYSTEM_NAME "freebsd_${FREEBSD_RELEASE}" )
     set( CONDOR_FREEBSD ON )
     set( BSD_UNIX ON )
+    # FIXME: Is there a >= to replace all the MATCHES operators below?
     if(FREEBSD_MAJOR MATCHES "4" )
       set( CONDOR_FREEBSD4 ON )
     elseif(FREEBSD_MAJOR MATCHES "5" )
@@ -284,6 +285,9 @@
     elseif(FREEBSD_MAJOR MATCHES "11" )
       set( CONDOR_FREEBSD11 ON )
       set( CONDOR_UTMPX ON )
+    elseif(FREEBSD_MAJOR MATCHES "12" )
+      set( CONDOR_FREEBSD11 ON )
+      set( CONDOR_UTMPX ON )
     endif()
     if( CMAKE_SYSTEM_PROCESSOR MATCHES "amd64" )
       set( SYS_ARCH "x86_64")


Improve REGEX

Improve REGEX

--- cmake/modules/hunter_download_cache_meta_file.cmake
+++ cmake/modules/hunter_download_cache_meta_file.cmake
@@ -104,7 +104,7 @@
         string(
             REGEX
             REPLACE
-            "/cache.sha1$"
+            "/cache\.sha1$"
             "/cache_sha1"
             local_url
             "${local_url}"


Removed variable forwarding in hunter_install_libsodium_config()

--- cmake/modules/hunter_install_libsodium_config.cmake
+++ cmake/modules/hunter_install_libsodium_config.cmake
@@ -10,9 +10,6 @@
     set(templates "${HUNTER_SELF}/cmake/templates")
     set(configs "${HUNTER_PACKAGE_INSTALL_PREFIX}/lib/cmake/libsodium")

-    # Forward some variables
-    set(BUILD_SHARED_LIBS "${BUILD_SHARED_LIBS}")
-
     write_basic_package_version_file("${configs}/libsodiumConfig.cmake" VERSION "${HUNTER_libsodium_VERSION}" COMPATIBILITY ExactVersion)

     configure_file(


Apply CUDA-RT libraries.

Apply CUDA-RT libraries.

--- libtbag/project.cmake
+++ libtbag/project.cmake
@@ -39,6 +39,11 @@
     list (APPEND TBAG_PROJECT_LDFLAGS      ${OpenCL_LIBRARY})
 endif ()

+if (CUDA_FOUND)
+    tbag_modules__check_cuda ()
+    tbag_modules__apply_cuda ()
+endif ()
+
 if (WIN32)
     list (APPEND TBAG_PROJECT_LDFLAGS shlwapi.lib) # filesystem with windows.
 endif ()


SetFlags.cmake: don't use ${} expansion on if STREQUAL

See http://stackoverflow.com/questions/19982340/cmake-compare-to-empty-string-with-strequal-failed

--- SetFlags.cmake
+++ SetFlags.cmake
@@ -28,7 +28,8 @@
 macro(set_flags)
 	# Add coverage processing, if requested:
 	if (NOT MSVC)
-		if (${CMAKE_BUILD_TYPE} STREQUAL "COVERAGE")
+
+		if (CMAKE_BUILD_TYPE STREQUAL "COVERAGE")
 			message("Including CodeCoverage")
 			set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/lib/cmake-coverage/")
 			include(CodeCoverage)


PARQUET-868: Build snappy with optimizations

Author: Uwe L. Korn <uwelk@xhochy.com>

Closes #237 from xhochy/PARQUET-868 and squashes the following commits:

90a296f [Uwe L. Korn] PARQUET-868: Build snappy with optimizations

--- cmake_modules/ThirdpartyToolchain.cmake
+++ cmake_modules/ThirdpartyToolchain.cmake
@@ -103,10 +103,18 @@
   set(SNAPPY_STATIC_LIB "${SNAPPY_PREFIX}/lib/libsnappy.a")
   set(SNAPPY_VENDORED 1)

+  if (${UPPERCASE_BUILD_TYPE} EQUAL "RELEASE")
+    if (APPLE)
+      set(SNAPPY_CXXFLAGS "CXXFLAGS='-DNDEBUG -O1'")
+    else()
+      set(SNAPPY_CXXFLAGS "CXXFLAGS='-DNDEBUG -O2'")
+    endif()
+  endif()
+
   if (CMAKE_VERSION VERSION_GREATER "3.2")
     # BUILD_BYPRODUCTS is a 3.2+ feature
     ExternalProject_Add(snappy_ep
-      CONFIGURE_COMMAND ./configure --with-pic "--prefix=${SNAPPY_PREFIX}"
+      CONFIGURE_COMMAND ./configure --with-pic "--prefix=${SNAPPY_PREFIX}" ${SNAPPY_CXXFLAGS}
       BUILD_IN_SOURCE 1
       BUILD_COMMAND ${MAKE}
       INSTALL_DIR ${SNAPPY_PREFIX}
@@ -115,7 +123,7 @@
       )
   else()
     ExternalProject_Add(snappy_ep
-      CONFIGURE_COMMAND ./configure --with-pic "--prefix=${SNAPPY_PREFIX}"
+      CONFIGURE_COMMAND ./configure --with-pic "--prefix=${SNAPPY_PREFIX}" ${SNAPPY_CXXFLAGS}
       BUILD_IN_SOURCE 1
       BUILD_COMMAND ${MAKE}
       INSTALL_DIR ${SNAPPY_PREFIX}


update fmt to 6.1.2

update fmt to 6.1.2

--- cmake/Conan.cmake
+++ cmake/Conan.cmake
@@ -18,7 +18,7 @@
   ${CONAN_EXTRA_REQUIRES}
   catch2/2.11.0
   docopt.cpp/0.6.2
-  fmt/6.0.0
+  fmt/6.1.2
   spdlog/1.5.0
   OPTIONS
   ${CONAN_EXTRA_OPTIONS}


Updated WSREP_PATCH_REVNO.

Updated WSREP_PATCH_REVNO.

--- cmake/wsrep.cmake
+++ cmake/wsrep.cmake
@@ -23,7 +23,7 @@
 # MariaDB addition: Revision number of the last revision merged from
 # codership branch visible in @@visible_comment.
 # Branch : codership-mysql/5.5
-SET(WSREP_PATCH_REVNO "3928")  # Should be updated on every merge.
+SET(WSREP_PATCH_REVNO "3968")  # Should be updated on every merge.

 # MariaDB: Obtain patch revision number:
 # Update WSREP_PATCH_REVNO if WSREP_REV environment variable is set.


Fix project_expand_list_for_command_line_to_file

--- project/cmake/modules/ProjectBuildTools.cmake
+++ project/cmake/modules/ProjectBuildTools.cmake
@@ -286,11 +286,11 @@
       set(project_expand_list_for_command_line_to_file_OUTPUT "${ARG}")
     else()
       if(project_expand_list_for_command_line_to_file_ENABLE_CONVERT)
-        string(REPLACE "\\" "\\\\" project_expand_list_for_command_line_OUT_VAR ${ARG})
+        string(REPLACE "\\" "\\\\" project_expand_list_for_command_line_OUT_VAR "${ARG}")
         string(REPLACE "\"" "\\\"" project_expand_list_for_command_line_OUT_VAR
-                       ${project_expand_list_for_command_line_OUT_VAR})
+                       "${project_expand_list_for_command_line_OUT_VAR}")
       else()
-        set(project_expand_list_for_command_line_OUT_VAR ${ARG})
+        set(project_expand_list_for_command_line_OUT_VAR "${ARG}")
       endif()
       if(project_expand_list_for_command_line_to_file_LINE)
         set(project_expand_list_for_command_line_to_file_LINE


Added requirement for windows build

Added requirement for windows build

--- CMakeModules/KrisLibraryDependencies.cmake
+++ CMakeModules/KrisLibraryDependencies.cmake
@@ -141,7 +141,7 @@
     SET(KRISLIBRARY_LIBRARIES ${KRISLIBRARY_LIBRARIES} ${CURL_LIBRARY})
     IF(WIN32)
       SET(KRISLIBRARY_DEFINITIONS ${KRISLIBRARY_DEFINITIONS} -DCURL_STATICLIB)
-      SET(KRISLIBRARY_LIBRARIES ${KRISLIBRARY_LIBRARIES} wldap32.lib)
+      SET(KRISLIBRARY_LIBRARIES ${KRISLIBRARY_LIBRARIES} wldap32.lib Advapi32.lib)
     ENDIF(WIN32)
   ELSE(CURL_FOUND)
     MESSAGE("GLPK library not found, setting DHAVE_CURL=0")


Add DISABLE_WRAP_PYTHONQT option to ctkMacroBuildLib

Enabling this option will explicitly disable the pythonQt wrapping for
the considered library.

--- CMake/ctkMacroBuildLib.cmake
+++ CMake/ctkMacroBuildLib.cmake
@@ -26,7 +26,7 @@
 MACRO(ctkMacroBuildLib)
   ctkMacroParseArguments(MY
     "NAME;EXPORT_DIRECTIVE;SRCS;MOC_SRCS;UI_FORMS;INCLUDE_DIRECTORIES;TARGET_LIBRARIES;RESOURCES;LIBRARY_TYPE"
-    ""
+    "DISABLE_WRAP_PYTHONQT"
     ${ARGN}
     )

@@ -147,7 +147,7 @@
     DESTINATION ${CTK_INSTALL_INCLUDE_DIR} COMPONENT Development
     )

-  IF(CTK_WRAP_PYTHONQT_LIGHT OR CTK_WRAP_PYTHONQT_FULL)
+  IF((CTK_WRAP_PYTHONQT_LIGHT OR CTK_WRAP_PYTHONQT_FULL) AND NOT ${MY_DISABLE_WRAP_PYTHONQT})
     set(KIT_PYTHONQT_SRCS) # Clear variable
     ctkMacroWrapPythonQt("org.commontk" ${lib_name}
       KIT_PYTHONQT_SRCS "${MY_SRCS}" ${CTK_WRAP_PYTHONQT_FULL})


STYLE: The FFTW libs should be co-located with ITK

When building FFTW internal to ITK, the fftw headers/libs
should be co-located with the ITK headers.  This patch
makes installation of FFTW and ITK consistent.

Change-Id: If2d4a429057c195bfb06056e8c68b8f827dbfe7a

--- CMake/itkExternal_FFTW.cmake
+++ CMake/itkExternal_FFTW.cmake
@@ -100,13 +100,13 @@
     # copy libraries into install tree
     install(CODE
       "file(GLOB FFTW_LIBS ${ITK_BINARY_DIR}/fftw/lib/*fftw3*)
-file(INSTALL DESTINATION \"\${CMAKE_INSTALL_PREFIX}/lib/InsightToolkit-${ITK_VERSION_MAJOR}.${ITK_VERSION_MINOR}\"
+file(INSTALL DESTINATION \"\${CMAKE_INSTALL_PREFIX}/lib/ITK-${ITK_VERSION_MAJOR}.${ITK_VERSION_MINOR}\"
 TYPE FILE FILES \${FFTW_LIBS})" COMPONENT Development)
     #
     # copy headers into install tree
     install(CODE
       "file(GLOB FFTW_INC ${ITK_BINARY_DIR}/fftw/include/*fftw3*)
-file(INSTALL DESTINATION \"\${CMAKE_INSTALL_PREFIX}/include/InsightToolkit-${ITK_VERSION_MAJOR}.${ITK_VERSION_MINOR}/Algorithms\"
+file(INSTALL DESTINATION \"\${CMAKE_INSTALL_PREFIX}/include/ITK-${ITK_VERSION_MAJOR}.${ITK_VERSION_MINOR}/Algorithms\"
 TYPE FILE FILES \${FFTW_INC})" COMPONENT Development)

   endif()


Add missing MatchPoint libraries

Add missing MatchPoint libraries

This is a workaround, that assumes MatchPoint has been installed to the ep
directory and guesses which libraries to install based on the MatchPoint
naming conventions.

--- CMake/mitkInstallRules.cmake
+++ CMake/mitkInstallRules.cmake
@@ -106,3 +106,15 @@
   endif()

 endif()
+
+#install Matchpoint algorithms if matchpoint is present
+if(MITK_USE_MatchPoint)
+  install(DIRECTORY "${MITK_EXTERNAL_PROJECT_PREFIX}/bin/"
+            DESTINATION "bin"
+            FILES_MATCHING PATTERN "MAPUtilities*")
+  install(DIRECTORY "${MITK_EXTERNAL_PROJECT_PREFIX}/bin/"
+            DESTINATION "bin"
+            FILES_MATCHING PATTERN "MAPAlgorithms*")
+  install(DIRECTORY "${MITK_EXTERNAL_PROJECT_PREFIX}/deployed/"
+            DESTINATION "bin")
+endif()


fix Conan compiler.libcxx detection

fix Conan compiler.libcxx detection

--- build_env/cmake/toolchain_armv7hf.cmake
+++ build_env/cmake/toolchain_armv7hf.cmake
@@ -14,3 +14,9 @@
 set(CMAKE_CXX_COMPILER_VERSION ${CMAKE_MATCH_1})

 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D__STDC_CONSTANT_MACROS -DMACHINE_ARCH_ARM -fPIC -DLINUX=1 -UMMX")
+
+# indicate Conan to use C++11
+# this may be required for cross compiling on x86 when the standard GCC compiler is also installed and the Conan compiler detection overrules the compiler.libcxx setting defined in the Conan profile replacing libstdc++11 with libstdc++
+if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "5.1")
+	set(_GLIBCXX_USE_CXX11_ABI ON)
+endif()


HUNTER_JOBS_NUMBER for Ninja generator

HUNTER_JOBS_NUMBER for Ninja generator

--- cmake/modules/hunter_jobs_number.cmake
+++ cmake/modules/hunter_jobs_number.cmake
@@ -50,13 +50,14 @@
   string(COMPARE NOTEQUAL "${XCODE_VERSION}" "" is_xcode)
   string(COMPARE EQUAL "${CMAKE_GENERATOR}" "MSYS Makefiles" is_msys)
   string(COMPARE EQUAL "${CMAKE_GENERATOR}" "Unix Makefiles" is_makefiles)
+  string(COMPARE EQUAL "${CMAKE_GENERATOR}" "Ninja" is_ninja)

   if(MSVC_IDE AND (MSVC_VERSION VERSION_LESS 1800))
     # No /maxcpucount:N support
     set(jobs_number "")
   endif()

-  if(MINGW OR is_msys OR is_xcode OR is_makefiles OR MSVC_IDE)
+  if(MINGW OR is_msys OR is_xcode OR is_makefiles OR MSVC_IDE OR is_ninja)
     set("${jobs_options_varname}" "${jobs_number}" PARENT_SCOPE)
     return()
   endif()


[Exmaples] do not use the siconos script to run the Examples

If the script is used, during the DynamicalAnalysis, valgrind checks
whether the Bourne Shell has memleak or not, which is not that useful.
By calling the executable directly, we should be able to have useful
data from valgrind

--- Numerics/cmake/CMakeListsForExamples.cmake
+++ Numerics/cmake/CMakeListsForExamples.cmake
@@ -7,7 +7,21 @@

 MACRO(ADD_EXAMPLE _N _EX)
   MESSAGE("Adding example ${_N} (${_EX})")
-  ADD_TEST(${_N} ${SiconosKernel_EXE_DIR}/siconos --nocomp ${_EX}.cpp)
+
+  IF(CROSSCOMPILING_LINUX_TO_WINDOWS)
+    ADD_TEST(${_N} wine ${_EX})
+  ELSE()
+    ADD_TEST(${_N} ${_EX})
+  ENDIF()
+
+  IF (APPLE)
+    SET_TESTS_PROPERTIES(${_N} PROPERTIES ENVIRONMENT DYLD_LIBRARY_PATH=$ENV{DYLD_LIBRARY_PATH}:SiconosKernel_LIBRARY_DIRS:.)
+  ELSEIF(CROSSCOMPILING_LINUX_TO_WINDOWS OR WINDOWS)
+    SET_TESTS_PROPERTIES(\${_EXE} PROPERTIES ENVIRONMENT Path=SiconosKernel_LIBRARY_DIRS\;.)
+  ELSE() # unix
+    SET_TESTS_PROPERTIES(${_N} PROPERTIES ENVIRONMENT LD_LIBRARY_PATH=$ENV{LD_LIBRARY_PATH}:SiconosKernel_LIBRARY_DIRS:.)
+  ENDIF()
+
   SET_TESTS_PROPERTIES(${_N} PROPERTIES FAIL_REGULAR_EXPRESSION "FAILURE;Exception;failed;ERROR")
 ENDMACRO(ADD_EXAMPLE _N _EX)


Fix comments

Fix comments

--- Modules/Wrappers/SWIG/otb-module-init.cmake
+++ Modules/Wrappers/SWIG/otb-module-init.cmake
@@ -39,8 +39,11 @@
     endif()
   endif()
 endmacro()
+# this macro should be removed

-# thi macro should be removed
+#
+# Python SWIG configuration
+#
 if ( OTB_WRAP_PYTHON )
   check_PIC_flag ( Python )
   find_package(Numpy)


Add fat_chan defines in storage unit tests cmake

--- UNITTESTS/features/storage/blockdevice/HeapBlockDevice/unittest.cmake
+++ UNITTESTS/features/storage/blockdevice/HeapBlockDevice/unittest.cmake
@@ -17,3 +17,84 @@
 set(unittest-test-sources
   features/storage/blockdevice/HeapBlockDevice/test.cpp
 )
+
+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FFS_DBG=0")
+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_FS_READONLY=0")
+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_FS_MINIMIZE=0")
+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_USE_STRFUNC=0")
+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_USE_FIND=0")
+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_USE_MKFS=1")
+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_USE_FASTSEEK=0")
+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_USE_EXPAND=0")
+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_USE_CHMOD=0")
+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_USE_LABEL=0")
+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_USE_FORWARD=0")
+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_CODE_PAGE=437")
+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_USE_LFN=3")
+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_MAX_LFN=255")
+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_LFN_UNICODE=0")
+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_LFN_BUF=255")
+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_SFN_BUF=12")
+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_STRF_ENCODE=3")
+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_FS_RPATH=1")
+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_VOLUMES=4")
+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_STR_VOLUME_ID=0")
+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_VOLUME_STRS=\"RAM\",\"NAND\",\"CF\",\"SD\",\"SD2\",\"USB\",\"USB2\",\"USB3\"")
+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_MULTI_PARTITION=0")
+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_MIN_SS=512")
+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_MAX_SS=4096")
+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_USE_TRIM=1")
+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_FS_NOFSINFO=0")
+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_FS_TINY=1")
+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_FS_EXFAT=0")
+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_FS_HEAPBUF=1")
+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_FS_NORTC=0")
+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_NORTC_MON=1")
+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_NORTC_MDAY=1")
+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_NORTC_YEAR=2017")
+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_FS_LOCK=0")
+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_FS_REENTRANT=0")
+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_FS_TIMEOUT=1000")
+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FF_SYNC_t=HANDLE")
+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FLUSH_ON_NEW_CLUSTER=0")
+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_FAT_CHAN_FLUSH_ON_NEW_SECTOR=1")
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FFS_DBG=0")
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_FS_READONLY=0")
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_FS_MINIMIZE=0")
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_USE_STRFUNC=0")
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_USE_FIND=0")
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_USE_MKFS=1")
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_USE_FASTSEEK=0")
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_USE_EXPAND=0")
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_USE_CHMOD=0")
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_USE_LABEL=0")
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_USE_FORWARD=0")
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_CODE_PAGE=437")
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_USE_LFN=3")
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_MAX_LFN=255")
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_LFN_UNICODE=0")
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_LFN_BUF=255")
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_SFN_BUF=12")
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_STRF_ENCODE=3")
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_FS_RPATH=1")
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_VOLUMES=4")
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_STR_VOLUME_ID=0")
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_VOLUME_STRS=\"RAM\",\"NAND\",\"CF\",\"SD\",\"SD2\",\"USB\",\"USB2\",\"USB3\"")
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_MULTI_PARTITION=0")
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_MIN_SS=512")
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_MAX_SS=4096")
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_USE_TRIM=1")
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_FS_NOFSINFO=0")
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_FS_TINY=1")
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_FS_EXFAT=0")
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_FS_HEAPBUF=1")
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_FS_NORTC=0")
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_NORTC_MON=1")
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_NORTC_MDAY=1")
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_NORTC_YEAR=2017")
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_FS_LOCK=0")
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_FS_REENTRANT=0")
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_FS_TIMEOUT=1000")
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FF_SYNC_t=HANDLE")
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FLUSH_ON_NEW_CLUSTER=0")
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_FAT_CHAN_FLUSH_ON_NEW_SECTOR=1")


cmake: Remove obsolete DefineCompilerFlags.cmake

--- cmake/Modules/DefineCompilerFlags.cmake
+++ cmake/Modules/DefineCompilerFlags.cmake
@@ -1,79 +0,0 @@
-# define system dependent compiler flags
-
-include(CheckCCompilerFlag)
-include(CheckCCompilerFlagSSP)
-
-if (UNIX AND NOT WIN32)
-    #
-    # Define GNUCC compiler flags
-    #
-    if (${CMAKE_C_COMPILER_ID} MATCHES "(GNU|Clang)")
-
-        # add -Wconversion ?
-        set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99 -pedantic -pedantic-errors")
-        set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wshadow -Wmissing-prototypes -Wdeclaration-after-statement")
-        set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wunused -Wfloat-equal -Wpointer-arith -Wwrite-strings -Wformat-security")
-        set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wmissing-format-attribute -Wundef -Wstrict-prototypes")
-
-        # with -fPIC
-        check_c_compiler_flag("-fPIC" WITH_FPIC)
-        if (WITH_FPIC)
-            set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
-        endif (WITH_FPIC)
-
-        check_c_compiler_flag_ssp("-fstack-protector" WITH_STACK_PROTECTOR)
-        if (WITH_STACK_PROTECTOR)
-            set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fstack-protector")
-        endif (WITH_STACK_PROTECTOR)
-
-        if (CMAKE_BUILD_TYPE)
-            string(TOLOWER "${CMAKE_BUILD_TYPE}" CMAKE_BUILD_TYPE_LOWER)
-            if (CMAKE_BUILD_TYPE_LOWER MATCHES (release|relwithdebinfo|minsizerel))
-                check_c_compiler_flag("-Wp,-D_FORTIFY_SOURCE=2" WITH_FORTIFY_SOURCE)
-                if (WITH_FORTIFY_SOURCE)
-                    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wp,-D_FORTIFY_SOURCE=2")
-                endif (WITH_FORTIFY_SOURCE)
-            endif()
-        endif()
-
-        set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_GNU_SOURCE")
-    endif (${CMAKE_C_COMPILER_ID} MATCHES "(GNU|Clang)")
-
-    #
-    # Check for large filesystem support
-    #
-    if (CMAKE_SIZEOF_VOID_P MATCHES "8")
-        # with large file support
-        execute_process(
-            COMMAND
-                getconf LFS64_CFLAGS
-            OUTPUT_VARIABLE
-                _lfs_CFLAGS
-            ERROR_QUIET
-            OUTPUT_STRIP_TRAILING_WHITESPACE
-        )
-    else (CMAKE_SIZEOF_VOID_P MATCHES "8")
-        # with large file support
-        execute_process(
-            COMMAND
-                getconf LFS_CFLAGS
-            OUTPUT_VARIABLE
-                _lfs_CFLAGS
-            ERROR_QUIET
-            OUTPUT_STRIP_TRAILING_WHITESPACE
-        )
-    endif (CMAKE_SIZEOF_VOID_P MATCHES "8")
-    if (_lfs_CFLAGS)
-        string(REGEX REPLACE "[\r\n]" " " "${_lfs_CFLAGS}" "${${_lfs_CFLAGS}}")
-        set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${_lfs_CFLAGS}")
-    endif (_lfs_CFLAGS)
-
-endif (UNIX AND NOT WIN32)
-
-if (MSVC)
-    # Use secure functions by defaualt and suppress warnings about
-    #"deprecated" functions
-    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /D _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1")
-    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /D _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES_COUNT=1")
-    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /D _CRT_NONSTDC_NO_WARNINGS=1 /D _CRT_SECURE_NO_WARNINGS=1")
-endif (MSVC)


Print message when configuring for standalone build.

git-svn-id: 756ef344af921d95d562d9e9f9389127a89a6314@243737 91177308-0d34-0410-b5e6-96231b3b80d8

--- cmake/Modules/HandleOutOfTreeLLVM.cmake
+++ cmake/Modules/HandleOutOfTreeLLVM.cmake
@@ -58,6 +58,7 @@

 if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
   set(LIBCXX_BUILT_STANDALONE 1)
+  message(STATUS "Configuring for standalone build.")

   find_llvm_parts()


typechecker-regex-prototype: improve build process; avoid artifacts in the source folder

--- cmake/Modules/LibAddHaskellPlugin.cmake
+++ cmake/Modules/LibAddHaskellPlugin.cmake
@@ -365,3 +365,73 @@

 	mark_as_advanced (GHC_FFI_LIB GHC_RTS_LIB GHC_BASE_LIB GHC_GMP_LIB GHC_PRIM_LIB)
 endmacro (add_haskell_plugin)
+
+# ~~~
+# Allows adding sandbox sources for haskell plugins which will be executed in a serial manner
+# to avoid cabal concurrency issues https://github.com/haskell/cabal/issues/2220. Also initializes
+# sandboxes and will install the dependencies into them.
+#
+# SANDBOX_ADD_SOURCES:
+#  additional source paths which should be added to the cabal sandbox
+#  required if the build should depend on haskell libraries not available on hackage
+# WORKING_DIRECTORY:
+#  in case your plugin depends on other files than *.hs and *.lhs haskell files and the default
+#  cabal file and c test file and setup file, you can specify them here
+# DEPENDS:
+#  additional targets this call should be dependent on
+# ~~~
+macro (configure_haskell_sandbox)
+	cmake_parse_arguments (ARG
+			       "" # optional keywords
+			       "SHARED_SANDBOX" # one value keywords
+			       "SANDBOX_ADD_SOURCES;DEPENDS" # multi value keywords
+			       ${ARGN})
+
+	get_property (HASKELL_SANDBOX_DEP_IDX GLOBAL PROPERTY HASKELL_SANDBOX_DEP_IDX)
+	if (NOT HASKELL_SANDBOX_DEP_IDX)
+		set (HASKELL_SANDBOX_DEP_IDX 1)
+		add_custom_command (OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/cabal.sandbox.config"
+				    COMMAND ${CABAL_EXECUTABLE} sandbox init --sandbox "${ARG_SHARED_SANDBOX}" -v0
+				    WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+				    DEPENDS ${ARG_DEPENDS})
+		set (HASKELL_ADD_SOURCES_TARGET haskell-add-sources-${HASKELL_SANDBOX_DEP_IDX})
+	else (NOT HASKELL_SANDBOX_DEP_IDX)
+		add_custom_command (OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/cabal.sandbox.config"
+				    COMMAND ${CABAL_EXECUTABLE} sandbox init --sandbox "${ARG_SHARED_SANDBOX}" -v0
+				    WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+				    DEPENDS haskell-add-sources-${HASKELL_SANDBOX_DEP_IDX}
+					    ${ARG_DEPENDS})
+		math (EXPR HASKELL_SANDBOX_DEP_IDX "${HASKELL_SANDBOX_DEP_IDX} + 1")
+		set (HASKELL_ADD_SOURCES_TARGET haskell-add-sources-${HASKELL_SANDBOX_DEP_IDX})
+	endif (NOT HASKELL_SANDBOX_DEP_IDX)
+
+	if (ARG_SANDBOX_ADD_SOURCES)
+		foreach (SANDBOX_ADD_SOURCE ${ARG_SANDBOX_ADD_SOURCES})
+
+			# to avoid generating files in the source folders, copy over the
+			# add-sources  to the build directory if they are not already there
+			get_filename_component (SANDBOX_ADD_SOURCE_PARENT "${SANDBOX_ADD_SOURCE}" DIRECTORY)
+			file (COPY "${CMAKE_SOURCE_DIR}/${SANDBOX_ADD_SOURCE}/" DESTINATION "${CMAKE_BINARY_DIR}/${SANDBOX_ADD_SOURCE}")
+
+			add_custom_command (OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/cabal.sandbox.config"
+					    COMMAND ${CABAL_EXECUTABLE} sandbox add-source "${CMAKE_BINARY_DIR}/${SANDBOX_ADD_SOURCE}" -v0
+					    APPEND)
+		endforeach (SANDBOX_ADD_SOURCE ${ARG_SANDBOX_ADD_SOURCES})
+	endif (ARG_SANDBOX_ADD_SOURCES)
+
+	if (BUILD_SHARED OR BUILD_FULL)
+		set (CABAL_OPTS "--enable-shared")
+	endif (BUILD_SHARED OR BUILD_FULL)
+
+	# This only takes care about building the internal dependencies
+	# Everything should already be preinstalled when setting up the shared sandbox
+	# Therefore we use the --offline flag to make the build guaranteed independent
+	# Furthermore we implicitly add the haskell bindings as they are always required
+	add_custom_command (OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/cabal.sandbox.config"
+			    COMMAND ${CABAL_EXECUTABLE} sandbox add-source ${CMAKE_BINARY_DIR}/src/bindings/haskell/ -v0
+			    COMMAND ${CABAL_EXECUTABLE} install ${CABAL_OPTS} --only-dependencies --offline -v0 || true
+			    APPEND)
+	add_custom_target (${HASKELL_ADD_SOURCES_TARGET} ALL DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/cabal.sandbox.config")
+
+	set_property (GLOBAL PROPERTY HASKELL_SANDBOX_DEP_IDX "${HASKELL_SANDBOX_DEP_IDX}")
+endmacro (configure_haskell_sandbox)


remove latomic to clang (#1412)

remove latomic to clang (#1412)

Signed-off-by: Karsten Knese <d4e5fc478ea2b73d152b4d8c1f28419b8ad7a63b@users.noreply.github.com>

--- cmake/modules/FindThirdpartyBoost.cmake
+++ cmake/modules/FindThirdpartyBoost.cmake
@@ -19,10 +19,6 @@
     set(THIRDPARTY_BOOST_LINK_LIBS ${CMAKE_THREAD_LIBS_INIT} rt)
 endif()

-if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
-    list(APPEND THIRDPARTY_BOOST_LINK_LIBS atomic)
-endif()
-
 try_compile(IS_THIRDPARTY_BOOST_OK
         ${CMAKE_BINARY_DIR}
         ${PROJECT_SOURCE_DIR}/thirdparty/boost/test/ThirdpartyBoostCompile_test.cpp


- Fix subprojects dependency loading

- Fix subprojects dependency loading

--- toolchain/cmake/Modules/SubprojectFunctions.cmake
+++ toolchain/cmake/Modules/SubprojectFunctions.cmake
@@ -199,12 +199,7 @@
 ################################################################################

 function( IMPORT_COFFEE_LIB LIBNAME DEPENDENCY )
-    if( ${${LIBNAME}_DIR} )
-        include( ${${LIBNAME}_DIR}/${LIBNAME}Config.cmake )
-        return()
-    endif()
-
-    if( ${COFFEE_ROOT_DIR} )
+    if( DEFINED COFFEE_ROOT_DIR )
         include( ${COFFEE_ROOT_DIR}/share/${LIBNAME}Config.cmake )
         return()
     endif()


cmake: utility func 'system' to easily get output of shell command

--- bootstrap/cmake/utils.cmake
+++ bootstrap/cmake/utils.cmake
@@ -185,4 +185,7 @@
 endmacro()

-
+macro(system varname)
+	execute_process(COMMAND ${ARGN} OUTPUT_VARIABLE ${varname}
+		OUTPUT_STRIP_TRAILING_WHITESPACE)
+endmacro()


emscripten: remove FULL_ES3 from USE_WEBGL2

--- cmake-toolchains/emscripten.toolchain.cmake
+++ cmake-toolchains/emscripten.toolchain.cmake
@@ -106,7 +106,7 @@
     set(EMSC_LINKER_FLAGS "${EMSC_LINKER_FLAGS} -s SAFE_HEAP=1")
 endif()
 if (FIPS_EMSCRIPTEN_USE_WEBGL2)
-    set(EMSC_LINKER_FLAGS "${EMSC_LINKER_FLAGS} -s USE_WEBGL2=1 -s FULL_ES3=1")
+    set(EMSC_LINKER_FLAGS "${EMSC_LINKER_FLAGS} -s USE_WEBGL2=1")
 endif()
 if (FIPS_EMSCRIPTEN_USE_EMMALLOC)
     set(EMSC_LINKER_FLAGS "${EMSC_LINKER_FLAGS} -s \"MALLOC='emmalloc'\"")


Update FW: increase_manual_exposure_limits

--- cmake/Depthai/DepthaiDeviceSideConfig.cmake
+++ cmake/Depthai/DepthaiDeviceSideConfig.cmake
@@ -2,7 +2,7 @@
 set(DEPTHAI_DEVICE_SIDE_MATURITY "snapshot")

 # "full commit hash of device side binary"
-set(DEPTHAI_DEVICE_SIDE_COMMIT "140e154fc21a851daeb1d2ecee29d5dfb16f6847")
+set(DEPTHAI_DEVICE_SIDE_COMMIT "a0dff2324e17e367fc49d3e93a56d5085c300a59")

 # "version if applicable"
 set(DEPTHAI_DEVICE_SIDE_VERSION "")


FMUv4: Build all apps (because we can!)

FMUv4: Build all apps (because we can!)

--- cmake/configs/nuttx_px4fmu-v4_default.cmake
+++ cmake/configs/nuttx_px4fmu-v4_default.cmake
@@ -42,6 +42,7 @@
 	drivers/gimbal
 	drivers/pwm_input
 	drivers/camera_trigger
+	drivers/bst

 	#
 	# System commands


Update builtin version of VecCore to 0.6.0

--- cmake/modules/SearchInstalledSoftware.cmake
+++ cmake/modules/SearchInstalledSoftware.cmake
@@ -1274,7 +1274,7 @@
 endif()

 if(builtin_veccore)
-  set(VecCore_VERSION "0.5.2")
+  set(VecCore_VERSION "0.6.0")
   set(VecCore_PROJECT "VecCore-${VecCore_VERSION}")
   set(VecCore_SRC_URI "${lcgpackages}/${VecCore_PROJECT}.tar.gz")
   set(VecCore_DESTDIR "${CMAKE_BINARY_DIR}/externals")
@@ -1282,7 +1282,7 @@

   ExternalProject_Add(VECCORE
     URL     ${VecCore_SRC_URI}
-    URL_HASH SHA256=6c8740342bfa1d9c6ef55a19f57b95674a94e5f9ea156e9b329635718b0b4049
+    URL_HASH SHA256=db404d745906efec2a76175995e847af9174df5a8da1e5ccdb241c773d7c8df9
     BUILD_IN_SOURCE 0
     LOG_DOWNLOAD 1 LOG_CONFIGURE 1 LOG_BUILD 1 LOG_INSTALL 1
     CMAKE_ARGS -G ${CMAKE_GENERATOR}


Enable asimage on Windows (and set correct AFTERIMAGE_INCLUDE_DIR)

--- cmake/modules/SearchInstalledSoftware.cmake
+++ cmake/modules/SearchInstalledSoftware.cmake
@@ -342,7 +342,7 @@

 #---Check for all kind of graphics includes needed by libAfterImage--------------------
 if(asimage)
-  if(NOT x11 AND NOT cocoa)
+  if(NOT x11 AND NOT cocoa AND NOT WIN32)
     message(STATUS "Switching off 'asimage' because neither 'x11' nor 'cocoa' are enabled")
     set(asimage OFF CACHE BOOL "" FORCE)
   endif()
@@ -395,6 +395,7 @@
       INSTALL_COMMAND  ${CMAKE_COMMAND} -E copy_if_different libAfterImage.lib <INSTALL_DIR>/lib/.
       LOG_DOWNLOAD 1 LOG_CONFIGURE 1 LOG_BUILD 1 LOG_INSTALL 1 BUILD_IN_SOURCE 1
       BUILD_BYPRODUCTS ${AFTERIMAGE_LIBRARIES})
+    set(AFTERIMAGE_INCLUDE_DIR ${CMAKE_BINARY_DIR}/AFTERIMAGE-prefix/src/AFTERIMAGE)
   else()
     message(STATUS "Building AfterImage library included in ROOT itself")
     if(JPEG_FOUND)
@@ -434,11 +435,11 @@
                         CC=${CMAKE_C_COMPILER} CFLAGS=${_after_cflags}
       LOG_DOWNLOAD 1 LOG_CONFIGURE 1 LOG_BUILD 1 LOG_INSTALL 1 BUILD_IN_SOURCE 1
       BUILD_BYPRODUCTS ${AFTERIMAGE_LIBRARIES})
+    set(AFTERIMAGE_INCLUDE_DIR ${CMAKE_BINARY_DIR}/include/libAfterImage)
   endif()
   if(builtin_freetype)
     add_dependencies(AFTERIMAGE FREETYPE)
   endif()
-  set(AFTERIMAGE_INCLUDE_DIR ${CMAKE_BINARY_DIR}/include/libAfterImage)
   set(AFTERIMAGE_TARGET AFTERIMAGE)
 endif()


[cmake] Specify CMAKE_OSX_SYSROOT to freetype:

Because parts of freetype do not obey CFLAGS (apinames), we need to instead pass it through CC.

--- cmake/modules/SearchInstalledSoftware.cmake
+++ cmake/modules/SearchInstalledSoftware.cmake
@@ -94,8 +94,12 @@
       BUILD_BYPRODUCTS ${FREETYPE_LIBRARY})
   else()
     set(_freetype_cflags -O)
+    set(_freetype_cc ${CMAKE_C_COMPILER})
     if(ROOT_ARCHITECTURE MATCHES aix)
       set(_freetype_zlib --without-zlib)
+    endif()
+    if(CMAKE_OSX_SYSROOT)
+      set(_freetype_cc "${_freetype_cc} -isysroot ${CMAKE_OSX_SYSROOT}")
     endif()
     ExternalProject_Add(
       FREETYPE
@@ -104,7 +108,7 @@
       CONFIGURE_COMMAND ./configure --prefix <INSTALL_DIR> --with-pic
                          --disable-shared --with-png=no --with-bzip2=no
                          --with-harfbuzz=no ${_freetype_zlib}
-                          CC=${CMAKE_C_COMPILER} CFLAGS=${_freetype_cflags}
+                          "CC=${_freetype_cc}" CFLAGS=${_freetype_cflags}
       INSTALL_COMMAND ""
       LOG_DOWNLOAD 1 LOG_CONFIGURE 1 LOG_BUILD 1 LOG_INSTALL 1 BUILD_IN_SOURCE 1
       BUILD_BYPRODUCTS ${FREETYPE_LIBRARY})


fix libevent on visual studio

fix libevent on visual studio

Change-Id: Iaf40206710173cea72ac6cb7a3636d91a4454096
Reviewed-on: http://gerrit.aldebaran.lan:8080/76
Reviewed-by: Dimitri Merejkowsky <1e4b13000fa8777df4cefd2fd8215187e3deb062@aldebaran-robotics.com>
Tested-by: Dimitri Merejkowsky <1e4b13000fa8777df4cefd2fd8215187e3deb062@aldebaran-robotics.com>

--- cmake/qibuild/modules/libevent-config.cmake
+++ cmake/qibuild/modules/libevent-config.cmake
@@ -4,7 +4,14 @@

 clean(LIBEVENT)

-fpath(LIBEVENT event.h PATH_SUFFIXES event2)
-flib(LIBEVENT NAMES event event_core)
-
+fpath(LIBEVENT event2/event.h)
+if (WIN32)
+  flib(LIBEVENT DEBUG     NAMES event_core_d)
+  flib(LIBEVENT DEBUG     NAMES event_d)
+  flib(LIBEVENT OPTIMIZED NAMES event_core)
+  flib(LIBEVENT OPTIMIZED NAMES event)
+else()
+  flib(LIBEVENT NAMES event)
+  flib(LIBEVENT NAMES event_core)
+endif()
 export_lib(LIBEVENT)


added the individually installed DLLs to the correct component

--- cmake_modules/Windows/ProxyFindModule.cmake
+++ cmake_modules/Windows/ProxyFindModule.cmake
@@ -29,7 +29,19 @@
   ELSE (${LOCATION_VAR})
     MESSAGE (STATUS "*********** DONE (not found) ***********")
   ENDIF (${LOCATION_VAR})
-ENDMACRO (PRINT_FIND_END_TITLE MODULE_NAME)
+ENDMACRO (PRINT_FIND_END_TITLE)
+
+
+MACRO (INSTALL_DLL DLL_PATH)
+  IF (${PROJECT_NAME} STREQUAL "zorba")
+    # for zorba core requirements, install this DLL
+    INSTALL (PROGRAMS ${DLL_PATH} DESTINATION bin)
+  ELSE (${PROJECT_NAME} STREQUAL "zorba")
+    # for zorba non-core requirements, install this DLL only if the component is spcified
+    STRING (REPLACE "-" "_"  component_name ${PROJECT_NAME})
+    INSTALL (PROGRAMS ${DLL_PATH} DESTINATION bin COMPONENT ${component_name})
+  ENDIF (${PROJECT_NAME} STREQUAL "zorba")
+ENDMACRO (INSTALL_DLL)

 MACRO (PRINT_FIND_TITLE MODULE_NAME)
@@ -242,15 +254,7 @@
       FILE (TO_NATIVE_PATH ${PATH} NATIVE_PATH)
       LIST (APPEND paths "${NATIVE_PATH}")
       MESSAGE (STATUS "Added dll to ZORBA_REQUIRED_DLLS cache variable: ${TMP_DLL_VAR}")
-
-      IF (${PROJECT_NAME} STREQUAL "zorba")
-        # for zorba core requirements, install this DLL
-        INSTALL (PROGRAMS ${TMP_DLL_VAR} DESTINATION bin)
-      ELSE (${PROJECT_NAME} STREQUAL "zorba")
-        # for zorba non-core requirements, install this DLL only if the component is spcified
-        STRING (REPLACE "-" "_"  component_name ${PROJECT_NAME})
-        INSTALL (PROGRAMS ${TMP_DLL_VAR} DESTINATION bin COMPONENT ${component_name})
-      ENDIF (${PROJECT_NAME} STREQUAL "zorba")
+      INSTALL_DLL (${TMP_DLL_VAR})

       # we break the loop if we found one DLL
       BREAK ()
@@ -272,9 +276,6 @@
   IF (${LEN} GREATER 0)
     LIST (REMOVE_DUPLICATES paths)
   ENDIF (${LEN} GREATER 0)
-
-  # make sure we don't leave garbage in the cache and don't influence other logic with this
-  SET (TMP_DLL_VAR TMP_DLL_VAR-NOTFOUND CACHE FILEPATH "Path to a file." FORCE)

   # set the current DLLs and their paths in a variable
   SET (ZORBA_REQUIRED_DLLS "${dlls}"
@@ -317,16 +318,7 @@
       FILE (TO_NATIVE_PATH ${PATH} NATIVE_PATH)
       LIST (APPEND paths "${NATIVE_PATH}")
       MESSAGE (STATUS "Added dll to ZORBA_REQUIRED_DLLS cache variable: ${TMP_DLL_VAR}")
-
-      IF (${PROJECT_NAME} STREQUAL "zorba")
-        # for zorba core requirements, install this DLL
-        INSTALL (PROGRAMS ${TMP_DLL_VAR} DESTINATION bin)
-      ELSE (${PROJECT_NAME} STREQUAL "zorba")
-        # for zorba non-core requirements, install this DLL only if the component is spcified
-        STRING (REPLACE "-" "_"  component_name ${PROJECT_NAME})
-        INSTALL (PROGRAMS ${TMP_DLL_VAR} DESTINATION bin COMPONENT ${component_name})
-      ENDIF (${PROJECT_NAME} STREQUAL "zorba")
-
+      INSTALL_DLL (${TMP_DLL_VAR})
     ELSE (TMP_DLL_VAR)
       MESSAGE (WARNING "${NAME} was not found in: ${LIBRARY_LOCATION}. Zorba will not run properly unless you have it in the path.")
     ENDIF (TMP_DLL_VAR)
@@ -341,9 +333,6 @@
   IF (${LEN} GREATER 0)
     LIST (REMOVE_DUPLICATES paths)
   ENDIF (${LEN} GREATER 0)
-
-  # make sure we don't leave garbage in the cache and don't influence other logic with this
-  SET (TMP_DLL_VAR TMP_DLL_VAR-NOTFOUND CACHE FILEPATH "Path to a file." FORCE)

   # set the current DLLs and their paths in a variable
   SET (ZORBA_REQUIRED_DLLS "${dlls}"
@@ -390,7 +379,7 @@
     FILE(TO_NATIVE_PATH ${PATH} NATIVE_PATH)
     LIST (APPEND paths "${NATIVE_PATH}")
     MESSAGE (STATUS "Added dll to ZORBA_REQUIRED_DLLS cache variable: ${TMP_DLL_VAR}")
-    INSTALL (PROGRAMS "${TMP_DLL_VAR}" DESTINATION bin)
+    INSTALL_DLL (${TMP_DLL_VAR})
   ELSE (TMP_DLL_VAR)
     MESSAGE (STATUS "Did not find ${DLL_NAME}")
     MESSAGE (WARNING "You will not be able to run zorba unless you have ${DLL_NAME} in your path.")
@@ -426,11 +415,12 @@
   SET (dlls "${ZORBA_REQUIRED_DLLS}")
   SET (paths "${ZORBA_REQUIRED_DLL_PATHS}")

-  LIST (APPEND dlls "${DLL_PATH}/${DLL_NAME}")
+  SET (DLL_FULL_PATH ${DLL_PATH}/${DLL_NAME})
+  LIST (APPEND dlls "${DLL_FULL_PATH}")
   FILE(TO_NATIVE_PATH ${DLL_PATH} NATIVE_PATH)
   LIST (APPEND paths "${NATIVE_PATH}")
-  MESSAGE (STATUS "Added dll to ZORBA_REQUIRED_DLLS cache variable: ${DLL_PATH}/${DLL_NAME}")
-  INSTALL (PROGRAMS "${DLL_PATH}/${DLL_NAME}" DESTINATION bin)
+  MESSAGE (STATUS "Added dll to ZORBA_REQUIRED_DLLS cache variable: ${DLL_FULL_PATH}")
+  INSTALL_DLL (${DLL_FULL_PATH})

   # set the current DLLs and their paths in a variable
   SET (ZORBA_REQUIRED_DLLS "${dlls}"


change to 0.16.0-dev in develop

change to 0.16.0-dev in develop

--- conan.cmake
+++ conan.cmake
@@ -33,7 +33,7 @@
 # but it is only necessary on the end-user side. It is not necessary to create conan
 # packages, in fact it shouldn't be use for that. Check the project documentation.

-# version: 0.15.0-dev
+# version: 0.16.0-dev

 include(CMakeParseArguments)


Do not set CMAKE_REQUIRED_DEFINES

Do not set CMAKE_REQUIRED_DEFINES

The variable _KDE4_PLATFORM_DEFINITIONS is no longer set by
KDEFrameworkCompilerSettings.cmake / KDECompilerSettings.cmake, but
CMAKE_REQUIRED_DEFINES is set properly by it.

REVIEW: 115295

--- src/kjs/ConfigureChecks.cmake
+++ src/kjs/ConfigureChecks.cmake
@@ -7,10 +7,6 @@
 include(CheckCXXSymbolExists)
 include(CheckFunctionExists)
 include(CheckStructHasMember)
-
-# The FindKDE4.cmake module sets _KDE4_PLATFORM_DEFINITIONS with
-# definitions like _GNU_SOURCE that are needed on each platform.
-set(CMAKE_REQUIRED_DEFINITIONS ${_KDE4_PLATFORM_DEFINITIONS})

 check_library_exists(pthread pthread_attr_get_np "" HAVE_PTHREAD_ATTR_GET_NP)
 check_library_exists(pthread pthread_getattr_np "" HAVE_PTHREAD_GETATTR_NP)


[cmake] fix typo

[cmake] fix typo

--- cmake/CXXCompilerSetup.cmake
+++ cmake/CXXCompilerSetup.cmake
@@ -62,7 +62,7 @@
   # -- warnings to errors --
   add_cxx_options("-Werror=implicit-function-declaration")
   # should be supported only by Clang. The last statement is important, otherwise nothing compiles ...
-  add_cxx_options("-Werror=conversion -Wno-sign-conversion -Wno-error=sign-conversion Wno-shorten-64-to-32 -Wno-error=shorten-64-to-32")
+  add_cxx_options("-Werror=conversion -Wno-sign-conversion -Wno-error=sign-conversion -Wno-shorten-64-to-32 -Wno-error=shorten-64-to-32")
   # ADD_C_OPTIONS("-Wno-error=shorten-64-to-32") # for clang
   add_cxx_options("-Werror=switch-bool")
   add_cxx_options("-Werror=logical-not-parentheses")


Update cmake code to find Irrlicht so that it matches what unit_IRRLICHT uses to find Irrlicht

--- cmake/FindChronoEngine.cmake
+++ cmake/FindChronoEngine.cmake
@@ -349,13 +349,8 @@
     ##### ADDITIONAL DEPENDENCIES FOR CHRONOENGINE COMPONENTS

     if (${CH_USE_UNIT_IRRLICHT})
-        SET(CH_IRRLICHTDIR ""  CACHE PATH   "Where is your Irrlicht SDK installed? You must set this path to compile demos with 3D display.")
-        IF(EXISTS "${CH_IRRLICHTDIR}/include")
-            SET(CH_IRRLICHTINC "${CH_IRRLICHTDIR}/include")
-        ELSE()
-            SET(CH_IRRLICHTINC "${CH_IRRLICHTDIR}")
-        ENDIF()
         IF(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
+            SET(CH_IRRLICHTDIR ""  CACHE PATH   "Where is your Irrlicht SDK installed? You must set this path to compile demos with 3D display.")
             IF ("${CH_COMPILER}" STREQUAL "COMPILER_MSVC")
                 FIND_LIBRARY( CH_IRRLICHTLIB NAMES Irrlicht PATHS "${CH_IRRLICHTDIR}/lib/Win32-visualstudio")
             ELSEIF ("${CH_COMPILER}" STREQUAL "COMPILER_MSVC_X64")
@@ -366,11 +361,24 @@
                 FIND_LIBRARY( CH_IRRLICHTLIB NAMES Irrlicht PATHS "${CH_IRRLICHTDIR}/lib/Win64-gcc")
             ENDIF()
         ELSEIF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
-            FIND_LIBRARY( CH_IRRLICHTLIB NAMES Irrlicht PATHS "/usr/local/lib" ${CH_IRRLICHTDIR}/lib/Linux)
+            FIND_PATH(CH_IRRLICHTDIR NAMES irrlicht.h PATHS "/usr/include/irrlicht" "/usr/local/include/irrlicht")
+            FIND_LIBRARY(CH_IRRLICHTLIB NAMES Irrlicht PATHS "/usr/local/lib" ${CH_IRRLICHTDIR}/lib/Linux)
             SET (CH_IRRLICHTLIB "${CH_IRRLICHTLIB}" -lXxf86vm -lglut -lX11 -lGL)
         ELSEIF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
+            FIND_PATH(CH_IRRLICHTDIR NAMES irrlicht.h PATHS "/usr/include/irrlicht" "/usr/local/include/irrlicht")
             FIND_LIBRARY( CH_IRRLICHTLIB NAMES Irrlicht PATHS "/usr/local/lib" ${CH_IRRLICHTDIR}/lib/Linux)
-            SET (CH_IRRLICHTLIB "${CH_IRRLICHTLIB}")
+            INCLUDE_DIRECTORIES ( /System/Library/Frameworks )
+            FIND_LIBRARY(COCOA_LIBRARY Cocoa)
+            FIND_LIBRARY(OPENGL_LIBRARY OpenGL)
+            FIND_LIBRARY(IOKIT_LIBRARY IOKit)
+            SET(MAC_LIBS ${COCOA_LIBRARY} ${OPENGL_LIBRARY} ${IOKIT_LIBRARY})
+            SET(CH_IRRLICHTLIB ${CH_IRRLICHTLIB} ${MAC_LIBS})
+        ENDIF()
+
+        IF(EXISTS "${CH_IRRLICHTDIR}/include")
+            SET(CH_IRRLICHTINC "${CH_IRRLICHTDIR}/include")
+        ELSE()
+            SET(CH_IRRLICHTINC "${CH_IRRLICHTDIR}")
         ENDIF()

         MARK_AS_ADVANCED(CH_IRRLICHTLIB)


cmake: Added macOS xterm support

cmake: Added macOS xterm support

--- cmake/Platform/Arduino.cmake
+++ cmake/Platform/Arduino.cmake
@@ -1478,14 +1478,8 @@
     separate_arguments(ARGUMENTS)

     # Detect terminal
-    if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux")
-        file(GLOB TERMINALS "/usr/bin/gnome-terminal" "/usr/bin/konsole" "/usr/bin/xterm")
-        list(GET TERMINALS 0 TERMINAL)
-    elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin")
-        set(TERMINAL "open -b com.apple.terminal")
-    else()
-        message(FATAL_ERROR "${CMAKE_HOST_SYSTEM_NAME} not supported yet." )
-    endif()
+    file(GLOB TERMINALS "/usr/bin/gnome-terminal" "/usr/bin/konsole" "/usr/bin/xterm" "/opt/X11/bin/xterm")
+    list(GET TERMINALS 0 TERMINAL)

     add_custom_target(${TARGET_NAME}-serial
             COMMAND ${TERMINAL} ${ARGUMENTS})


OSX compile fixes and adaptions

OSX compile fixes and adaptions

--- cmake/PlatformSpecific.cmake
+++ cmake/PlatformSpecific.cmake
@@ -194,7 +194,8 @@
 	set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${OSX_FLAGS_RELEASE}")

 	SET(CMAKE_XCODE_ATTRIBUTE_DEPLOYMENT_POSTPROCESSING YES) # strip symbols in whole project, disabled in pylux target
-	SET(CMAKE_XCODE_ATTRIBUTE_DEAD_CODE_STRIPPING YES) #  -dead_strip
+	#SET(CMAKE_XCODE_ATTRIBUTE_DEAD_CODE_STRIPPING YES) #  -dead_strip, disabled for clang 3.4 lto bug
+	SET(CMAKE_XCODE_ATTRIBUTE_LLVM_LTO YES)

 	MESSAGE(STATUS "")
 	MESSAGE(STATUS "################ GENERATED XCODE PROJECT INFORMATION ################")


cmake: need to link swiftrt.o for libswift-executables on linux

Otherwise dynamic metadata/conformance lookup does not work.

--- cmake/modules/AddSwift.cmake
+++ cmake/modules/AddSwift.cmake
@@ -973,6 +973,7 @@
       INSTALL_RPATH "${RPATH_LIST}")

   elseif(SWIFT_HOST_VARIANT_SDK STREQUAL "LINUX" AND ASHT_HAS_LIBSWIFT AND LIBSWIFT_BUILD_MODE)
+    set(swiftrt "swiftImageRegistrationObject${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK}_OBJECT_FORMAT}-${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK}_LIB_SUBDIR}-${SWIFT_HOST_VARIANT_ARCH}")
     if(LIBSWIFT_BUILD_MODE STREQUAL "HOSTTOOLS")
       # At build time and and run time, link against the swift libraries in the
       # installed host toolchain.
@@ -980,6 +981,7 @@
       get_filename_component(swift_dir ${swift_bin_dir} DIRECTORY)
       set(host_lib_dir "${swift_dir}/lib/swift/linux")

+      target_link_libraries(${executable} PRIVATE ${swiftrt})
       target_link_libraries(${executable} PRIVATE "swiftCore")

       target_link_directories(${executable} PRIVATE ${host_lib_dir})
@@ -993,6 +995,7 @@
       if (NOT "${ASHT_BOOTSTRAPPING}" STREQUAL "0")
         get_bootstrapping_swift_lib_dir(bs_lib_dir "${ASHT_BOOTSTRAPPING}")
         target_link_directories(${executable} PRIVATE ${bs_lib_dir})
+        target_link_libraries(${executable} PRIVATE ${swiftrt})
         target_link_libraries(${executable} PRIVATE "swiftCore")
       endif()


build: remove ICU references in `_add_swift_host_library_single`

--- cmake/modules/AddSwift.cmake
+++ cmake/modules/AddSwift.cmake
@@ -933,9 +933,7 @@
         "SHELL:-Xclang --dependent-lib=msvcrt$<$<CONFIG:Debug>:d>")
     endif()
   endif()
-  target_include_directories(${target} SYSTEM PRIVATE
-    ${SWIFT_${SWIFTLIB_SINGLE_SDK}_${SWIFTLIB_SINGLE_ARCHITECTURE}_ICU_UC_INCLUDE}
-    ${SWIFT_${SWIFTLIB_SINGLE_SDK}_${SWIFTLIB_SINGLE_ARCHITECTURE}_ICU_I18N_INCLUDE})
+
   target_compile_options(${target} PRIVATE
     ${c_compile_flags})
   target_link_options(${target} PRIVATE


fix the detection of fftw

fix the detection of fftw

--- cmake/modules/FindFFTW.cmake
+++ cmake/modules/FindFFTW.cmake
@@ -2,13 +2,15 @@

 find_path(FFTW_INCLUDE_DIR
   NAMES fftw3.h
-  PATH_SUFFIXES include/fftw
+  PATH_SUFFIXES include include/fftw
   HINTS ENV MKLROOT
   HINTS ENV FFTWROOT
   HINTS ENV FFTW_INC
   )

-find_library(FFTW_LIBRARIES NAMES fftw3
+find_library(FFTW_LIBRARIES
+  NAMES fftw3
+  PATH_SUFFIXES lib
   HINTS ENV MKLROOT
   HINTS ENV FFTW_DIR
   HINTS ENV FFTWROOT


CMake: don't install tablegen

CMake: don't install tablegen

Since it's an llvm-internal tool, we shouldn't install it.

(This depends on Clang r189127 and lld r189128.)

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

--- cmake/modules/TableGen.cmake
+++ cmake/modules/TableGen.cmake
@@ -126,6 +126,4 @@
   if( LLVM_ENABLE_THREADS AND HAVE_LIBPTHREAD AND NOT BEOS )
     target_link_libraries(${target} pthread)
   endif()
-
-  install(TARGETS ${target} RUNTIME DESTINATION bin)
 endmacro()


Updated LIBXSMM and introduced environment variables LIBXSMMROOT=/path/to/libxsmm-make-install and LIBXSMMFETCH=0|1.

--- cmake/third_party/xsmm.cmake
+++ cmake/third_party/xsmm.cmake
@@ -1,21 +1,40 @@
-message("Fetching xsmm")
-FetchContent_Declare(
-  xsmm
-  URL      https://github.com/libxsmm/libxsmm/archive/394294d7f62efdd25033ee46e73abd4ccb3ded59.zip
-  URL_HASH SHA256=b2307f0374fac07f74414dc4365e078aa97d7abc59204c7955a658ad4e8a676e
+# Use LIBXSMM (make PREFIX=/path/to/libxsmm) given by LIBXSMMROOT
+set(LIBXSMMROOT $ENV{LIBXSMMROOT})
+# Fetch LIBXSMM (even if LIBXSMMROOT is present)
+set(LIBXSMMFETCH $ENV{LIBXSMMFETCH})
+
+if(LIBXSMMROOT AND NOT LIBXSMMFETCH)
+  message(STATUS "Found LIBXSMM (${LIBXSMMROOT})")
+  file(GLOB _GLOB_XSMM_SRCS LIST_DIRECTORIES false CONFIGURE_DEPENDS ${LIBXSMMROOT}/include/libxsmm/*.c)
+  list(REMOVE_ITEM _GLOB_XSMM_SRCS ${LIBXSMMROOT}/include/libxsmm/libxsmm_generator_gemm_driver.c)
+else()
+  message(STATUS "Fetching LIBXSMM")
+  include(FetchContent)
+
+  FetchContent_Declare(
+    xsmm
+    URL https://github.com/libxsmm/libxsmm/archive/96806053cbc9a19c25318965498553f3a935ede2.tar.gz
+    URL_HASH SHA256=2afc21069f2b329d52b554f52ffab83866b06e040a1113f39a11caeb7523b420
+  )
+
+  FetchContent_GetProperties(xsmm)
+  if(NOT xsmm_POPULATED)
+    FetchContent_Populate(xsmm)
+  endif()
+
+  set(LIBXSMMROOT ${xsmm_SOURCE_DIR})
+  file(GLOB _GLOB_XSMM_SRCS LIST_DIRECTORIES false CONFIGURE_DEPENDS ${LIBXSMMROOT}/src/*.c)
+  list(REMOVE_ITEM _GLOB_XSMM_SRCS ${LIBXSMMROOT}/src/libxsmm_generator_gemm_driver.c)
+endif()
+set(XSMM_INCLUDE_DIRS ${LIBXSMMROOT}/include)
+
+add_library(xsmm STATIC ${_GLOB_XSMM_SRCS})
+target_include_directories(xsmm PUBLIC ${XSMM_INCLUDE_DIRS})
+target_compile_definitions(xsmm PUBLIC
+  LIBXSMM_DEFAULT_CONFIG
+)
+target_compile_definitions(xsmm PRIVATE
+  __BLAS=0
 )

-FetchContent_GetProperties(xsmm)
-if(NOT xsmm_POPULATED)
-  FetchContent_Populate(xsmm)
-endif()
-
-file(GLOB _GLOB_XSMM_SRCS LIST_DIRECTORIES false CONFIGURE_DEPENDS ${xsmm_SOURCE_DIR}/src/*.c)
-list(REMOVE_ITEM _GLOB_XSMM_SRCS ${xsmm_SOURCE_DIR}/src/libxsmm_generator_gemm_driver.c)
-
-add_library(xsmm STATIC ${_GLOB_XSMM_SRCS})
-target_include_directories(xsmm PUBLIC ${xsmm_SOURCE_DIR}/include)
-target_compile_definitions(xsmm PRIVATE
-  __BLAS=0
-  LIBXSMM_DEFAULT_CONFIG
-)
+#target_link_libraries(xsmm PUBLIC m)


C: linux link fix. enet enet64 added to finddeps

--- cmake_support/FindDeps.cmake
+++ cmake_support/FindDeps.cmake
@@ -73,7 +73,7 @@

 my_find_package( PORTAUDIO portaudio.h portaudio portaudio_x86 portaudio_static_x86 portaudio_x64 portaudio_static_x64 )

-my_find_package( ENET enet/enet.h enet.lib enet64.lib )
+my_find_package( ENET enet/enet.h enet enet64 enet.lib enet64.lib )

 if(WIN32)
     set( PLATFORM_LIBS "" )


idl-config: New macros for final workflow.

Change-Id: Ice74a67e4179cec8a01bc260e85599a25df7b84a

--- codegen/src/idl-config.cmake
+++ codegen/src/idl-config.cmake
@@ -14,12 +14,32 @@
   endif()
   find_program(IDLPY
     name idl.py
-    PATHS ${cdir}/../../bin ${cdir}/../bin
+    PATHS ${cdir} ${cdir}/../../bin ${cdir}/../bin
     )
   if (NOT IDLPY)
     qi_error("idl.py not found")
   endif()
   qi_persistent_set(${where} ${IDLPY})
+endfunction()
+
+#! Find IDL file for given class name, in filesystem or in targets
+function(qi_find_idl_for classname where)
+  string(REPLACE "::" "/" idlname ${classname})
+  set(genname "${CMAKE_CURRENT_BINARY_DIR}/share/idl/${idlname}.xml")
+  get_source_file_property(isgenerated ${genname} GENERATED)
+  if (TARGET ${genname} OR isgenerated)
+    qi_persistent_set(${where} ${genname})
+  else()
+    find_path(idlfile "${idlname}.xml"
+      PATHS ${CMAKE_CURRENT_BINARY_DIR} $ENV{IDL_PATH}
+    )
+    if(idlfile)
+      qi_persistent_set(${where} idlfile)
+    else()
+      qi_error("Could not find IDL file for ${classname}")
+    endif()
+  endif()
+
 endfunction()

@@ -71,6 +91,50 @@
       -c ${class_name}
       -o ${output_dir}/${_filename}
       -m interface)
+endfunction()
+
+#! Create client support library for given classes
+function(qi_create_client_lib libname)
+  cmake_parse_arguments(ARG "" "PREFIX" "CLASSES;INCLUDE" ${ARGN})
+  if (NOT ARG_PREFIX)
+    set(ARG_PREFIX ${CMAKE_CURRENT_BINARY_DIR})
+  endif()
+  set(sources "")
+  foreach(c ${ARG_CLASSES})
+    string(REPLACE "::" "-" class ${c})
+    string(REPLACE "::" "/" idlname ${c})
+    set(target "${ARG_PREFIX}/client-${class}.cc")
+    # we need to find the IDL file for proper dependency tracking
+    qi_find_idl_for(${c} idlfile)
+    qi_generate_src(${target}
+      SRC ${idlfile}
+      COMMAND  ${_python_executable} ${IDL}
+      -p ${ARG_PREFIX} # IDLS might be around here
+      -c ${c}
+      -o "${target}"
+      --cxx-signature-mapping "'${_type_map}'"
+      -m client)
+    list(APPEND sources "${target}")
+  endforeach()
+  qi_create_lib(${libname} MODULE SRC ${sources})
+endfunction()
+
+#! Create a skeleton implementation of given class
+function(qi_create_skeleton target)
+  cmake_parse_arguments(ARG "" "CLASS" "INCLUDE" ${ARGN})
+  # we need to find the IDL file for proper dependency tracking
+  string(REPLACE "::" "/" idlname ${ARG_CLASS})
+  find_path(idlfile ${idlname}
+    PATHS ${CMAKE_CURRENT_BINARY_DIR}
+  )
+  qi_generate_src(${target}
+    SRC ${idlfile}
+    COMMAND ${_python_executable} ${IDL}
+     -m cxxskel
+     -o ${target}
+     -c ${ARG_CLASS}
+     -i "'${ARG_INCLUDE}'"
+     )
 endfunction()

 #! Create type/factory registration file
@@ -134,12 +198,17 @@
    )
 endfunction()

-#! Create an IDL file by parsing C++ header files.
+#! Create IDL files by parsing C++ header files.
 # \group:SRC C++ source/headers file to parse
-# \group:CLASSES name of the classes for which to generate idl
+#                those will also be used as buid dependencies, so
+#                you should list all relevant headers here
+# \group:CLASSES fully qualified name of the classes for which to generate idl
+#                IDL files will be generated for this classes and all their
+#                dependencies
 # \group:TYPE_MAP Extra c++ types to signature mapping (cxxtype=signature)
 # \param:PREFIX path where to generate IDL files
 # \param:files name of variable that is filled by generated file names
+#              note that other files might be also generated
 function(qi_create_idl files)
   cmake_parse_arguments(ARG
     ""
@@ -148,22 +217,30 @@
     ${ARGN})
   _qi_find_idl(IDL)
   set(names "")
+  # If we are building qiclang, pass it along
+  if (TARGET qiclang)
+    get_target_property(qiclangname qiclang OUTPUT_NAME)
+    if (NOT qiclangname)
+      set(qiclangname "qiclang")
+    endif()
+    get_target_property(qiclangdir qiclang RUNTIME_OUTPUT_DIRECTORY)
+    set(qiclangopt "--qiclang;${qiclangdir}/${qiclangname}")
+  endif()
   if (NOT ARG_PREFIX)
-    set(ARG_PREFIX ".")
+    set(ARG_PREFIX ${CMAKE_CURRENT_BINARY_DIR}/share/idl)
   endif()
   string(REPLACE ";" "," _type_map "${ARG_TYPE_MAP}")
   foreach(c ${ARG_CLASSES})
-    string(REPLACE "::" ";" split_class ${c})
-    list(REVERSE split_class)
-    list(GET split_class 0 class)
+    string(REPLACE "::" "/" class ${c})
     set(target "${ARG_PREFIX}/${class}.xml")
     qi_generate_src(${target}
       SRC ${ARG_SRC}
       COMMAND  ${_python_executable} ${IDL}
       ${ARG_SRC}
       -c ${c}
-      -o ${target}
+      -p "${ARG_PREFIX}"
       --cxx-signature-mapping "'${_type_map}'"
+      ${qiclangopt}
       -m idl)
     list(APPEND names "${target}")
   endforeach(c)


[Config] Fixed the delivery directory of Python modules and libraries

--- config/project_config_embeddable.cmake
+++ config/project_config_embeddable.cmake
@@ -497,7 +497,7 @@

     # Set the Python installation directory
     set (INSTALL_PY_LIB_DIR
-      ${INSTALL_LIB_DIR}/python${Python3_VERSION_MAJOR}${Python3_VERSION_MINOR}/site-packages/py${PROJECT_NAME}
+      ${INSTALL_LIB_DIR}/python${Python3_VERSION_MAJOR}.${Python3_VERSION_MINOR}/site-packages/py${PROJECT_NAME}
       CACHE PATH "Installation directory for Python libraries")

     # Update the list of include directories for the project
@@ -1461,7 +1461,7 @@
   set (exec_prefix   ${prefix})
   set (bindir        ${exec_prefix}/bin)
   set (libdir        ${exec_prefix}/${LIBDIR})
-  set (pylibdir	     ${libdir}/python${Python3_VERSION_MAJOR}${Python3_VERSION_MINOR}/site-packages/py${PACKAGE})
+  set (pylibdir	     ${libdir}/python${Python3_VERSION_MAJOR}.${Python3_VERSION_MINOR}/site-packages/py${PACKAGE})
   set (libexecdir    ${exec_prefix}/libexec)
   set (sbindir       ${exec_prefix}/sbin)
   set (sysconfdir    ${prefix}/etc)


script cleaning

script cleaning

--- client/client-multi/client-c/toolchains/cc32xx.cmake
+++ client/client-multi/client-c/toolchains/cc32xx.cmake
@@ -24,15 +24,6 @@
   set(CC32XX_SDK "${KAA_TOOLCHAIN_PATH}/cc3200_sdk")
 endif()

-set(CMAKE_C_COMPILER   "${KAA_ARM_TOOLCHAIN}/bin/arm-none-eabi-gcc")
-#set(CMAKE_AR           "${KAA_ARM_TOOLCHAIN}/bin/arm-none-eabi-ar")
-#set(CMAKE_LINKER       "${KAA_ARM_TOOLCHAIN}/bin/arm-none-eabi-ld")
-#set(CMAKE_OBJCOPY      "${KAA_ARM_TOOLCHAIN}/bin/arm-none-eabi-objcopy")
-#set(CMAKE_OBJDUMP      "${KAA_ARM_TOOLCHAIN}/bin/arm-none-eabi-objdump")
-#set(CMAKE_NM           "${KAA_ARM_TOOLCHAIN}/bin/arm-none-eabi-nm")
-#set(CMAKE_RANLIB       "${KAA_ARM_TOOLCHAIN}/bin/arm-none-eabi-ranlib")
-#set(CMAKE_STRIP        "${KAA_ARM_TOOLCHAIN}/bin/arm-none-eabi-strip")
-
 CMAKE_FORCE_C_COMPILER(${KAA_ARM_TOOLCHAIN}/bin/arm-none-eabi-gcc GNU)

 set(CMAKE_C_FLAGS "-mthumb -mcpu=cortex-m4 -ffunction-sections -fdata-sections -MD -std=c99 -g -O0 -static"  CACHE STRING "" FORCE)


BUG: do not set "Wall" flag for window compilation

The "-Wall" compiler flag produces way too many warnings for ITK and
SimpleITK. This flag will not be automatically added any more.

--- CMake/CompilerFlagSettings.cmake
+++ CMake/CompilerFlagSettings.cmake
@@ -1,3 +1,9 @@
+# trict-null-sentinel Check the set of common warning flags supported by C and C++ compilers
+# check_compiler_warning_flags(<c_flags_var> <cxx_flags_var>)
+#  <c_flags_var> - variable to store valid C warning flags
+#  <cxx_flags_var> - variable to store valid CXX warning flags
+# This internally calls the check_c_compiler_flag and check_cxx_compiler_flag macros.
+
 # To create a portable build system, it is best to not
 # test for platforms, but to test for features.
 #
@@ -37,22 +43,36 @@
   set(${cxx_flag_var} "${local_cxx_flags}" PARENT_SCOPE)
 endfunction(test_cxx_flags)

+
+# On windows, the most verbose compiler options
+# is reporting 1000's of wanings in windows
+# header files, for now, limit the number of
+# warnings to level 3
+if( WIN32 )
+  set(VerboseWarningsFlag -W3 )
+  # A better solution would be to use -Wall,
+  # and then disable warnings one by one
+  # set(VerboseWarningsFlag -Wall -wd4820 -wd4682 )
+else()
+  set(VerboseWarningsFlag -Wall )
+endif()
+
 set(common_flags_to_test
--Wlong-long
--Wno-deprecated
--Wall
--Wextra
--Wformat=2
--Wno-format-nonliteral
--Wunused
--Wpointer-arith
--Winvalid-pch
--Wcast-align
--Wdisabled-optimization
--Woverloaded-virtual
--Wshadow
--Wwrite-strings
--Wstrict-null-sentinel
+  ${VerboseWarningsFlag}
+  -Wno-long-double        #Needed on APPLE
+  -Wno-long-long          # needed on gcc 4.5.2
+  -Wextra
+  -Wformat=2
+  -Wno-format-nonliteral
+  -Wunused
+  -Wpointer-arith
+  -Winvalid-pch
+  -Wcast-align
+  -Wdisabled-optimization
+  -Woverloaded-virtual
+  -Wshadow
+  -Wwrite-strings
+  -Wstrict-null-sentinel
 )

 # Detection does not appear to work correctly for C


ENH: typo in otbGenerateOTBConfig

ENH: typo in otbGenerateOTBConfig

--- CMake/otbGenerateOTBConfig.cmake
+++ CMake/otbGenerateOTBConfig.cmake
@@ -80,7 +80,7 @@
 STRING(REGEX REPLACE "/" ";" OTB_INSTALL_PACKAGE_DIR_COUNT
   "${OTB_INSTALL_PACKAGE_DIR}")
 SET(OTB_CONFIG_CODE "
-# Compute the installation prefix from this ITKConfig.cmake file location.
+# Compute the installation prefix from this OTBConfig.cmake file location.
 GET_FILENAME_COMPONENT(OTB_INSTALL_PREFIX \"\${CMAKE_CURRENT_LIST_FILE}\" PATH)")
 FOREACH(p ${OTB_INSTALL_PACKAGE_DIR_COUNT})
   SET(OTB_CONFIG_CODE


Travis CI seems to have changes the build paths, adapt it.

--- CMake/usCTestScript_travis.cmake
+++ CMake/usCTestScript_travis.cmake
@@ -11,7 +11,7 @@
 set(CTEST_BUILD_CONFIGURATION Release)

-set(US_SOURCE_DIR "~/builds/saschazelzer/CppMicroServices")
+set(US_SOURCE_DIR "~/build/saschazelzer/CppMicroServices")

 set(US_BUILD_CONFIGURATION $ENV{BUILD_CONFIGURATION})
 include(${US_SOURCE_DIR}/CMake/usCTestScript.cmake)


cosmetics

cosmetics

--- WkBuild.cmake
+++ WkBuild.cmake
@@ -405,8 +405,7 @@
 			"Copying ${PROJECT_SOURCE_DIR}/${${PROJECT_NAME}_INCLUDE_DIR}/${target_name} to ${PROJECT_BINARY_DIR}/${${PROJECT_NAME}_INCLUDE_DIR}/${target_name}"
 		)
 	else()
-		message ( WARNING "Directory ${PROJECT_SOURCE_DIR}/${${PROJECT_NAME}_INCLUDE_DIR}/${target_name} NOT FOUND !" )
-		message ( WARNING "Headers for ${target_name} cannot be copied !" )
+		message ( WARNING "Directory ${PROJECT_SOURCE_DIR}/${${PROJECT_NAME}_INCLUDE_DIR}/${target_name} NOT FOUND ! Headers for ${target_name} cannot be copied !" )
 	endif()

 	#generating configured Header for detected packages and lib export definition


Renamed configuration variables.

Renamed configuration variables.

--- cmake/eb.cmake
+++ cmake/eb.cmake
@@ -1,9 +1,8 @@
 message(STATUS "Binary elliptic curve arithmetic configuration (EB module):\n")

 message("   ** Options for the binary elliptic curve module (default = on, w = 4):")
-message("      EB_ORDIN=[off|on] Support for ordinary curves.")
-message("      EB_SUPER=[off|on] Support for supersingular curves.")
-message("      EB_KBLTZ=[off|on] Special support for Koblitz curves.")
+message("      EB_PLAIN=[off|on] Support for ordinary curves without endomorphisms.")
+message("      EB_KBLTZ=[off|on] Support for Koblitz anomalous binary curves.")
 message("      EB_MIXED=[off|on] Use mixed coordinates.")
 message("      EB_PRECO=[off|on] Build precomputation table for generator.")
 message("      EB_DEPTH=w        Width w in [2,6] of precomputation table for fixed point methods.")


devenv: Fix fw_stack_size on linux

devenv: Fix fw_stack_size on linux

--- cmake/fw.cmake
+++ cmake/fw.cmake
@@ -46,13 +46,13 @@
   return 0;
 }
 ")
-  file(WRITE "${CMAKE_BINARY_DIR}/getpagesize.c" "${getpagesize}")
+  file(WRITE "${CMAKE_BINARY_DIR}/getpagesize/main.c" "${getpagesize}")
   enable_language(C)
   try_run(
     run_result_unused
     compile_result_unused
-    "${CMAKE_BINARY_DIR}"
-    "${CMAKE_BINARY_DIR}/getpagesize.c"
+    "${CMAKE_BINARY_DIR}/getpagesize"
+    "${CMAKE_BINARY_DIR}/getpagesize/main.c"
     RUN_OUTPUT_VARIABLE page_size)
   set(${out} ${page_size} PARENT_SCOPE)
 endfunction()
@@ -72,14 +72,14 @@
   return 0;
 }
 ")
-  file(WRITE "${CMAKE_BINARY_DIR}/getstacksize.c" "${getstacksize}")
+  file(WRITE "${CMAKE_BINARY_DIR}/getstacksize/main.c" "${getstacksize}")
   enable_language(C)
   try_run(
     run_result_unused
     compile_result_unused
-    "${CMAKE_BINARY_DIR}"
-    "${CMAKE_BINARY_DIR}/getstacksize.c"
-    CMAKE_FLAGS -DCMAKE_EXE_LINKER_FLAGS=-lpthread
+    "${CMAKE_BINARY_DIR}/getstacksize"
+    "${CMAKE_BINARY_DIR}/getstacksize/main.c"
+    CMAKE_FLAGS "-DLINK_LIBRARIES=pthread"
     RUN_OUTPUT_VARIABLE stack_size)
   set(${out} ${stack_size} PARENT_SCOPE)
 endfunction()


Remove debug print

Remove debug print

--- cmake/OpenCVPCHSupport.cmake
+++ cmake/OpenCVPCHSupport.cmake
@@ -113,7 +113,6 @@
             SET(${out_command}
               ${CMAKE_CXX_COMPILER} ${pchsupport_compiler_cxx_arg1} ${_compile_FLAGS} -x c++-header -o ${_output} ${_input}
               )
-            message("!!!!!!!!!!!!!!!!${${out_command}}!!!!")
         ELSE(CMAKE_CXX_COMPILER_ARG1)
             SET(${out_command}
               ${CMAKE_CXX_COMPILER}  ${_compile_FLAGS} -x c++-header -o ${_output} ${_input}


Fix pch generation when linker flags used with GCC

-c is required to avoid linking (and the associated missing "main" message)
when linker flags like "-Wl,-z,relro" are passed to GCC

--- cmake/OpenCVPCHSupport.cmake
+++ cmake/OpenCVPCHSupport.cmake
@@ -125,11 +125,11 @@
             STRING(REGEX REPLACE "^ +" "" pchsupport_compiler_cxx_arg1 ${CMAKE_CXX_COMPILER_ARG1})

             SET(${out_command}
-              ${CMAKE_CXX_COMPILER} ${pchsupport_compiler_cxx_arg1} ${_compile_FLAGS} -x c++-header -o ${_output} ${_input}
+              ${CMAKE_CXX_COMPILER} ${pchsupport_compiler_cxx_arg1} ${_compile_FLAGS} -x c++-header -o ${_output} -c ${_input}
               )
         ELSE(CMAKE_CXX_COMPILER_ARG1)
             SET(${out_command}
-              ${CMAKE_CXX_COMPILER}  ${_compile_FLAGS} -x c++-header -o ${_output} ${_input}
+              ${CMAKE_CXX_COMPILER}  ${_compile_FLAGS} -x c++-header -o ${_output} -c ${_input}
               )
         ENDIF(CMAKE_CXX_COMPILER_ARG1)
     ELSE()


[cmake] add sanitiser flags to CMAKE_EXE_LINKER_FLAGS as well — Xcode fails to link sanitised executables otherwise

--- cmake/axl_std_settings.cmake
+++ cmake/axl_std_settings.cmake
@@ -266,6 +266,11 @@
 		)

 	if (NOT "${GCC_SANITIZER}" STREQUAL " ")
+		if (CMAKE_GENERATOR MATCHES "Xcode")
+			# Xcode fires unresolved externals otherwise
+			set (CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} ${GCC_SANITIZER}")
+		endif ()
+
 		set (CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} ${GCC_SANITIZER}")
 		set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${GCC_SANITIZER}")
 	endif ()


build: allow compilation for Windows ARM

The Windows ARM SDK is incomplete.  However, the headers are complete
enough to support building the runtime.  Add the necessary definitions
to permit the stdlib to be built.

--- cmake/modules/AddSwift.cmake
+++ cmake/modules/AddSwift.cmake
@@ -241,6 +241,9 @@
     list(APPEND result "-D_CRT_USE_BUILTIN_OFFSETOF")
     # TODO(compnerd) permit building for different families
     list(APPEND result "-D_CRT_USE_WINAPI_FAMILY_DESKTOP_APP")
+    if("${CFLAGS_ARCH}" MATCHES arm)
+      list(APPEND result "-D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE")
+    endif()
     # TODO(compnerd) handle /MT
     list(APPEND result "-D_DLL")
     # NOTE: We assume that we are using VS 2015 U2+
@@ -730,6 +733,9 @@
     foreach(directory ${SWIFTLIB_INCLUDE})
       list(APPEND SWIFTLIB_SINGLE_SWIFT_COMPILE_FLAGS -Xfrontend;-I${directory})
     endforeach()
+    if("${SWIFTLIB_SINGLE_ARCHITECTURE}" MATCHES arm)
+      list(APPEND SWIFTLIB_SINGLE_SWIFT_COMPILE_FLAGS -Xcc;-D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE)
+    endif()
     list(APPEND SWIFTLIB_SINGLE_SWIFT_COMPILE_FLAGS -Xfrontend;-autolink-library;-Xfrontend;oldnames)
     # TODO(compnerd) handle /MT and /MTd
     if("${CMAKE_BUILD_TYPE}" STREQUAL "RELEASE")


Modify a CMake rule: executables generated by Swift depend on swiftSwiftOnoneSupport.

This makes sure that such executables are only built after swiftSwiftOnoneSupport is built.

--- cmake/modules/AddSwift.cmake
+++ cmake/modules/AddSwift.cmake
@@ -1859,6 +1859,8 @@

   # All Swift executables depend on the standard library.
   list(APPEND SWIFTEXE_TARGET_LINK_FAT_LIBRARIES swiftCore)
+  # All Swift executables depend on the swiftSwiftOnoneSupport library.
+  list(APPEND SWIFTEXE_TARGET_DEPENDS swiftSwiftOnoneSupport)

   if(NOT "${SWIFT_BUILD_STDLIB}")
     list(REMOVE_ITEM SWIFTEXE_TARGET_LINK_FAT_LIBRARIES


P4 to Git Change 1410638 by lmoriche@lmoriche_palamida on 2017/05/17 11:34:07

	SWDEV-102733 - [OCL-LC-ROCm] Cmake build Write CMakeLists.txt to enable building with and without the DK environment
	- Add FindROCR.cmake, and use find_package() to locate the ROCR

Affected files ...

... //depot/stg/opencl/drivers/opencl/cmake/modules/FindROCR.cmake#2 edit

--- cmake/modules/FindROCR.cmake
+++ cmake/modules/FindROCR.cmake
@@ -8,8 +8,8 @@
           HINTS /opt/rocm/include /opt/rocm/hsa/include
           PATH_SUFFIXES hsa)

-find_library(ROCR_LIBRARY libhsa-runtime64
-             HINTS /opt/rocm/lib /opt/rocm/hsa/lib)
+find_library(ROCR_LIBRARY hsa-runtime64
+             HINTS /opt/rocm/lib  /opt/rocm/hsa/lib)

 include(FindPackageHandleStandardArgs)
 # handle the QUIETLY and REQUIRED arguments and set ROCR_FOUND to TRUE


- take FindRuby.cmake from cmake - we're recent enough - fix build with ruby 1.9

--- cmake/modules/FindRuby.cmake
+++ cmake/modules/FindRuby.cmake
@@ -1,84 +0,0 @@
-# - Find Ruby
-# This module finds if Ruby is installed and determines where the include files
-# and libraries are. It also determines what the name of the library is. This
-# code sets the following variables:
-#
-#  RUBY_INCLUDE_PATH = path to where ruby.h can be found
-#  RUBY_EXECUTABLE   = full path to the ruby binary
-
-# Copyright (c) 2002 Kitware, Inc., Insight Consortium.  All rights reserved.
-# See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
-
-
-if(RUBY_LIBRARY AND RUBY_INCLUDE_PATH)
-   # Already in cache, be silent
-   set(RUBY_FIND_QUIETLY TRUE)
-endif (RUBY_LIBRARY AND RUBY_INCLUDE_PATH)
-
-#   RUBY_ARCHDIR=`$RUBY -r rbconfig -e 'printf("%s",Config::CONFIG@<:@"archdir"@:>@)'`
-#   RUBY_SITEARCHDIR=`$RUBY -r rbconfig -e 'printf("%s",Config::CONFIG@<:@"sitearchdir"@:>@)'`
-#   RUBY_SITEDIR=`$RUBY -r rbconfig -e 'printf("%s",Config::CONFIG@<:@"sitelibdir"@:>@)'`
-#   RUBY_LIBDIR=`$RUBY -r rbconfig -e 'printf("%s",Config::CONFIG@<:@"libdir"@:>@)'`
-#   RUBY_LIBRUBYARG=`$RUBY -r rbconfig -e 'printf("%s",Config::CONFIG@<:@"LIBRUBYARG_SHARED"@:>@)'`
-
-FIND_PROGRAM(RUBY_EXECUTABLE NAMES ruby ruby1.8 ruby18 )
-
-EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print Config::CONFIG['archdir']"
-   OUTPUT_VARIABLE RUBY_ARCH_DIR)
-
-EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print Config::CONFIG['libdir']"
-   OUTPUT_VARIABLE RUBY_POSSIBLE_LIB_PATH)
-
-EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print Config::CONFIG['rubylibdir']"
-   OUTPUT_VARIABLE RUBY_RUBY_LIB_PATH)
-
-# site_ruby
-EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print Config::CONFIG['sitearchdir']"
-   OUTPUT_VARIABLE RUBY_SITEARCH_DIR)
-
-EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print Config::CONFIG['sitelibdir']"
-   OUTPUT_VARIABLE RUBY_SITELIB_DIR)
-
-
-# vendor_ruby
-EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r vendor-specific -e "print '-rvendor-specific'"
-   OUTPUT_VARIABLE RUBY_VENDOR_ARG)
-
-IF(RUBY_VENDOR_ARG)
-    EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print Config::CONFIG['vendorarchdir']"
-       OUTPUT_VARIABLE RUBY_VENDORARCH_DIR)
-
-    EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print Config::CONFIG['vendorlibdir']"
-       OUTPUT_VARIABLE RUBY_VENDORLIB_DIR)
-ELSE(RUBY_VENDOR_ARG)
-    # fall back to site*dir
-    EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print Config::CONFIG['sitearchdir']"
-       OUTPUT_VARIABLE RUBY_VENDORARCH_DIR)
-
-    EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print Config::CONFIG['sitelibdir']"
-       OUTPUT_VARIABLE RUBY_VENDORLIB_DIR)
-ENDIF(RUBY_VENDOR_ARG)
-
-# this is not needed if you use "print" inside the ruby statements
-# remove the new lines from the output by replacing them with empty strings
-#STRING(REPLACE "\n" "" RUBY_ARCH_DIR "${RUBY_ARCH_DIR}")
-#STRING(REPLACE "\n" "" RUBY_POSSIBLE_LIB_PATH "${RUBY_POSSIBLE_LIB_PATH}")
-#STRING(REPLACE "\n" "" RUBY_RUBY_LIB_PATH "${RUBY_RUBY_LIB_PATH}")
-
-
-FIND_PATH(RUBY_INCLUDE_PATH
-   NAMES ruby.h
-  PATHS
-   ${RUBY_ARCH_DIR}
-  /usr/lib/ruby/1.8/i586-linux-gnu/ )
-
-FIND_LIBRARY(RUBY_LIBRARY
-  NAMES ruby ruby1.8
-  PATHS ${RUBY_POSSIBLE_LIB_PATH}
-  )
-
-MARK_AS_ADVANCED(
-  RUBY_EXECUTABLE
-  RUBY_LIBRARY
-  RUBY_INCLUDE_PATH
-  )


Fixing dependencies for native tablegen.

The dependencies for cross-built tablegen were a bit confused. This fixes that. The following dependencies are now enforced:

(1) Tablegen tasks depend on the native tablegen
(2) Native tablegen depends on the cross-compiled tablegen

Although the native tablegen doesn't actually require the cross tablegen, having this dependency forces the native tablegen to rebuild whenever the cross tablegen changes.

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

--- cmake/modules/TableGen.cmake
+++ cmake/modules/TableGen.cmake
@@ -97,14 +97,12 @@
       set(${project}_TABLEGEN_EXE ${${project}_TABLEGEN_EXE} PARENT_SCOPE)

       add_custom_command(OUTPUT ${${project}_TABLEGEN_EXE}
-        COMMAND ${CMAKE_COMMAND} --build . --target ${target} --config $<CONFIGURATION>
-        DEPENDS ${LLVM_NATIVE_BUILD}/CMakeCache.txt
+        COMMAND ${CMAKE_COMMAND} --build . --target ${target} --config Release
+        DEPENDS CONFIGURE_LLVM_NATIVE ${target}
         WORKING_DIRECTORY ${LLVM_NATIVE_BUILD}
         COMMENT "Building native TableGen...")
       add_custom_target(${project}NativeTableGen DEPENDS ${${project}_TABLEGEN_EXE})
       add_dependencies(${project}NativeTableGen CONFIGURE_LLVM_NATIVE)
-
-      add_dependencies(${target} ${project}NativeTableGen)
     endif()
   endif()


nodev6 needs another directory deduped

nodev6 needs another directory deduped

--- projects/node.cmake
+++ projects/node.cmake
@@ -90,6 +90,7 @@
     elseif(${ver} STREQUAL v6)
       set(dedupeDirs
         ${npmDst}/${nm}/init-package-json/${nm}/glob/${nm}
+        ${npmDst}/${nm}/node-gyp/${nm}/npmlog/${nm}
         ${npmDst}/${nm}/read-package-json/${nm}/glob/${nm}
         )
     endif()


build: do not enforce specific instruction set

Fixes: #2047

We should not enforce specific instruction set target (-m<inst-set>
option) since end-users might experience crashes with sigill at
least for the following reasons:
1. msdk lib might be probed at runtime even on non-intel CPUs if it
is included into some plugin based framework (like gstreamer)
2. unit tests included into build system might be run on the system
where build had happenned which might be non-intel

So, this change remove msdk global instruction set flags. We still
have few places in the library tight to the particular instruction
set. These are optimization specific algorithms such as ipp, asc
(scene change detection) and memory copy operations. In these cases
we use runtime checks to detect underlying instruction sets. If we
don't support particular one - we are supposed to gracefully fail.

Signed-off-by: Dmitry Rogozhkin <01f0df9cc32cbf6a7f0faa5c8376e6cf28354d70@intel.com>

--- builder/ConfTargets.cmake
+++ builder/ConfTargets.cmake
@@ -20,23 +20,7 @@

 message( STATUS "Global Configuration of Targets" )

-set( T_ARCH "sse4.2" )
-message( STATUS "Target Architecture to compile: ${T_ARCH}" )
-
 append("-std=c++11" CMAKE_CXX_FLAGS)
-
-# SW HEVC decoder & encoder require SSE4.2
-  if (CMAKE_C_COMPILER MATCHES icc)
-    append("-xSSE4.2 -static-intel" CMAKE_C_FLAGS)
-  else()
-    append("-m${T_ARCH}" CMAKE_C_FLAGS)
-  endif()
-
-  if (CMAKE_CXX_COMPILER MATCHES icpc)
-    append("-xSSE4.2 -static-intel" CMAKE_CXX_FLAGS)
-  else()
-    append("-m${T_ARCH}" CMAKE_CXX_FLAGS)
-  endif()

 if (ENABLE_TEXTLOG)
   append("-DMFX_TRACE_ENABLE_TEXTLOG" CMAKE_C_FLAGS)


Improved arch/platform detection. (4)

Improved arch/platform detection. (4)

--- run_ctest.cmake
+++ run_ctest.cmake
@@ -29,20 +29,8 @@
             set(CC_NAME "tcc")
             exec_program($ENV{CC} ARGS -v OUTPUT_VARIABLE CC_VERSION_VERBOSE)
             string(REGEX REPLACE ".*tcc version ([0-9]+\\.[0-9]+).*" "\\1" CC_VERSION ${CC_VERSION_VERBOSE})
-            set(CC_ARCH "${CC_VERSION_VERBOSE}")
-            set(CC_PLATFORM "${CC_VERSION_VERBOSE}")
-        elseif(CC STREQUAL "x86_64-w64-mingw32-gcc" OR CC STREQUAL "i686-w64-mingw32-gcc" OR CC STREQUAL "x86_64-w64-mingw32.static-gcc" OR CC STREQUAL "i686-w64-mingw32.static-gcc")
-            set(CC_NAME "mingw")
-            exec_program($ENV{CC} ARGS -dumpversion OUTPUT_VARIABLE CC_VERSION)
-            if((CC_VERSION VERSION_GREATER 5) OR (CC_VERSION VERSION_EQUAL 5))
-                string(SUBSTRING "${CC_VERSION}" 0 1 CC_VERSION)
-            else()
-                string(SUBSTRING "${CC_VERSION}" 0 3 CC_VERSION)
-            endif()
-            exec_program($ENV{CC} ARGS -dumpmachine OUTPUT_VARIABLE CC_ARCH)
-            #Warmup wine or test timings are going to be wrong
-            exec_program(wine ARGS version OUTPUT_VARIABLE WINE_VERSION)
-            set(CC_PLATFORM "${CC_ARCH}")
+            set(CC_ARCH "x86_64")
+            set(CC_PLATFORM "linux")
         elseif(CC STREQUAL "emcc")
             set(CC_NAME "emscripten")
             exec_program($ENV{CC} ARGS --version OUTPUT_VARIABLE CC_VERSION_VERBOSE)
@@ -50,9 +38,16 @@
             set(CC_ARCH "asmjs")
             set(CC_PLATFORM "web")
         else()
-            string(SUBSTRING "$ENV{CC}" 0 3 CC)
-            if(CC STREQUAL "gcc")
-                set(CC_NAME "gcc")
+            string(FIND "${CC}" "gcc" CC_GCC)
+            if(CC_GCC GREATER_EQUAL 0)
+                string(FIND "${CC}" "mingw" CC_MINGW)
+                if(CC_MINGW GREATER_EQUAL 0)
+                    #Warmup wine or test timings are going to be wrong
+                    exec_program(wine ARGS version OUTPUT_VARIABLE WINE_VERSION)
+                    set(CC_NAME "mingw")
+                else()
+                    set(CC_NAME "gcc")
+                endif()
                 exec_program($ENV{CC} ARGS -dumpversion OUTPUT_VARIABLE CC_VERSION)
                 if((CC_VERSION VERSION_GREATER 5) OR (CC_VERSION VERSION_EQUAL 5))
                     string(SUBSTRING "${CC_VERSION}" 0 1 CC_VERSION)
@@ -62,8 +57,8 @@
                 exec_program($ENV{CC} ARGS -dumpmachine OUTPUT_VARIABLE CC_ARCH)
                 set(CC_PLATFORM "${CC_ARCH}")
             endif()
-            string(SUBSTRING "$ENV{CC}" 0 5 CC)
-            if(CC STREQUAL "clang")
+            string(FIND "${CC}" "clang" CC_CLANG)
+            if(CC_CLANG GREATER_EQUAL 0)
                 if(APPLE)
                     set(CC_NAME "xcode")
                     exec_program(xcodebuild ARGS -version OUTPUT_VARIABLE CC_VERSION_VERBOSE)


Added error message in case OpenCppCoverage is not found.

--- run_ctest.cmake
+++ run_ctest.cmake
@@ -199,7 +199,10 @@
     set(CTEST_COVERAGE_COMMAND codecov)
     set(CTEST_COVERAGE_EXTRA_FLAGS "${CTEST_COVERAGE_EXTRA_FLAGS} -txtlcov")
 elseif(CC_NAME STREQUAL "msvc")
-    find_program(CTEST_COVERAGE_COMMAND NAMES OpenCppCoverage)
+    find_program(CTEST_COVERAGE_COMMAND NAMES OpenCppCoverage)
+    if(NOT CTEST_COVERAGE_COMMAND)
+        message(FATAL_ERROR "OpenCppCoverage not found!")
+    endif()
 endif()
 if(CTEST_COVERAGE_COMMAND)
     if(CC_NAME STREQUAL "gcc" OR CC_NAME STREQUAL "clang" OR CC_NAME STREQUAL "xcode")


prefix invocation of python script with PYTHON_EXECUTABLE (ros/genpy#23)

--- cmake/test/catkin_download_test_data.cmake
+++ cmake/test/catkin_download_test_data.cmake
@@ -43,7 +43,7 @@
   endif()
   set(output "${ARG_DESTINATION}/${ARG_FILENAME}")
   add_custom_command(OUTPUT ${output}
-    COMMAND ${catkin_EXTRAS_DIR}/test/download_checkmd5.py ${url} ${output} ${ARG_MD5}
+    COMMAND ${PYTHON_EXECUTABLE} ${catkin_EXTRAS_DIR}/test/download_checkmd5.py ${url} ${output} ${ARG_MD5}
     VERBATIM)
   add_custom_target(${target} DEPENDS ${output})
   if(TARGET tests)


[OS X] Remove unnecessary dependency lib copies. Resolves strange errors during CMake configuration.

--- CMake/InstallDependencies.cmake
+++ CMake/InstallDependencies.cmake
@@ -114,13 +114,6 @@
 		install(FILES ${OIS_LIBRARY_REL} DESTINATION lib/release CONFIGURATIONS Release)
 		install(FILES ${OIS_LIBRARY_REL} DESTINATION lib/minsizerel CONFIGURATIONS MinSizeRel)
 	  endif ()
-	elseif(APPLE)
-#        install(FILES
-#          ${OGRE_DEP_DIR}/lib/$(PLATFORM_NAME)/$(CONFIGURATION)/libOIS.a
-#          DESTINATION lib/$(PLATFORM_NAME)/$(CONFIGURATION)
-#        )
-      install_debug(libOIS.a)
-      install_release(libOIS.a)
 	endif ()
 	  endif ()

@@ -155,15 +148,6 @@
     if (OGRE_BUILD_RENDERSYSTEM_GLES2)
       install_debug(libGLESv2.dll)
 	  install_release(libEGL.dll)
-    endif ()
-  elseif(APPLE)
-    # copy the dependency libs to the right places
-    install_debug(libOIS.a)
-    install_release(libOIS.a)
-
-    if (OGRE_BUILD_PLUGIN_CG)
-      install_debug(Cg.framework)
-      install_release(Cg.framework)
     endif ()
   endif ()

@@ -284,16 +268,6 @@
       copy_release(libEGL.dll)
       copy_release(libGLESv2.dll)
     endif ()
-
-  elseif(APPLE AND NOT OGRE_BUILD_PLATFORM_APPLE_IOS)
-    # copy the required libs and frameworks to the build directory (configure_file is the only copy-like op I found in CMake)
-    copy_debug(libOIS.a)
-    copy_release(libOIS.a)
-
-    if (OGRE_BUILD_PLUGIN_CG)
-      copy_debug(Cg.framework)
-      copy_release(Cg.framework)
-    endif ()
   endif ()

 endif ()


CSharp: Enable only in shared library builds.

--- CMake/Modules/UrhoOptions.cmake
+++ CMake/Modules/UrhoOptions.cmake
@@ -131,8 +131,14 @@
 _option(URHO3D_PACKAGING "Package resources")
 _option(URHO3D_FILEWATCHER "Watch filesystem for resource changes")
 _option(URHO3D_TASKS "Enable coroutine subsystem")
-_option(URHO3D_CSHARP "Enable C# support")
-set (URHO3D_CSHARP OFF) # Disabled until swig branch is merged
+if (BUILD_SHARED_LIBS)
+    _option(URHO3D_CSHARP "Enable C# support")
+else ()
+    if (URHO3D_CSHARP)
+        message (WARNING "CSharp is supported only when building with -DBUILD_SHARED_LIBS=ON")
+    endif ()
+    set (URHO3D_CSHARP OFF)
+endif ()
 if (MSVC)
     _option(URHO3D_MINIDUMPS "Enable writing minidumps on crash")
 else ()


Fix FindPythonLibs handling in CTK

Fix FindPythonLibs handling in CTK

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

   if(NOT DEFINED CTK_DIR)

-    set(revision_tag da3fd76)
+    set(revision_tag "kislinsk_fix-pythonlibs-handling") # Switch back to official CTK repo when PR874 was merged

     set(ctk_optional_cache_args )
     if(MITK_USE_Python3)
@@ -52,7 +52,7 @@
     ExternalProject_Add(${proj}
       LIST_SEPARATOR ${sep}
       URL ${MITK_THIRDPARTY_DOWNLOAD_PREFIX_URL}/CTK_${revision_tag}.tar.gz
-      URL_MD5 A413BE11D3E9970E0EBB71181A5F2B90
+      URL_MD5 2ef6dd6dfcefd0aee905f256116b026f
       UPDATE_COMMAND ""
       INSTALL_COMMAND ""
       CMAKE_GENERATOR ${gen}


Updated to a special CTK version

Updated to a special CTK version

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

   IF(NOT DEFINED CTK_DIR)

-    SET(revision_tag 21b1a4ef36d9ecb14750cdbf7aca0d697ee26e36)
+    SET(revision_tag 436795b904f69929149d3cdb7c4352516a1a85cd)
     IF(${proj}_REVISION_TAG)
       SET(revision_tag ${${proj}_REVISION_TAG})
     ENDIF()


FIX: use Debug as the default build mode if unset

--- CMakeLists.default.cmake
+++ CMakeLists.default.cmake
@@ -10,6 +10,13 @@
 set(RUNTIME_DIR "bin")
 set(CPP_INCLUDE_DIR "include")
 set(SHARED_DIR "share")
+
+if (NOT CMAKE_BUILD_TYPE)
+	set(CMAKE_BUILD_TYPE Debug CACHE STRING
+      	"Choose the type of build, options are: Debug Release."
+      	FORCE
+	)
+endif(NOT CMAKE_BUILD_TYPE)

 if (CMAKE_COMPILER_IS_GNUCXX)
         if (BUILD_WITH_EXTRA_DEBUG)


Fixed CMake script for file extraction

Fixed CMake script for file extraction

--- CMakeTools/MacroExtractArchive.cmake
+++ CMakeTools/MacroExtractArchive.cmake
@@ -1,20 +1,24 @@
 # This macro is used to extract zip file contents
 MACRO( EXTRACT_ARCHIVE fileName targetName workingDirectory )
 	IF ( NOT EXISTS ${workingDirectory}/${targetName} )
+		MESSAGE( "Extracting " ${fileName} )
+
 		EXECUTE_PROCESS (
 			COMMAND ${CMAKE_COMMAND}
 			-E tar -x
 			${workingDirectory}/${fileName}
 			WORKING_DIRECTORY ${workingDirectory} )

-		string(REGEX REPLACE "\\.[^.]*$" "" outputFileName ${fileName})
+		STRING( FIND ${fileName} ".tar.gz" IS_TAR_GZ )

-
-		#GET_FILENAME_COMPONENT( outputFileName ${fileName} NAME_WE )
-
-		MESSAGE( "lalalal " ${fileName} ${outputFileName} ${targetName} )
+		IF ( ${IS_TAR_GZ} GREATER -1 )
+			STRING( REPLACE ".tar.gz" "" outputFileName ${fileName})
+		ELSE ()
+			STRING( REPLACE ".zip" "" outputFileName ${fileName})
+		ENDIF ()

 		IF ( NOT ${outputFileName} STREQUAL ${targetName} )
+			MESSAGE( "Renaming " ${outputFileName} " to " ${targetName} )
 			FILE( RENAME ${workingDirectory}/${outputFileName} ${workingDirectory}/${targetName} )
 		ENDIF ( NOT ${outputFileName} STREQUAL ${targetName} )


Add support for explicitly cross compiling.

--- cmake/CXXFeatureCheck.cmake
+++ cmake/CXXFeatureCheck.cmake
@@ -24,7 +24,7 @@
   message("-- Performing Test ${FEATURE}")
   try_run(RUN_${FEATURE} COMPILE_${FEATURE}
           ${CMAKE_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/cmake/${FILE}.cpp)
-  if(RUN_${FEATURE} EQUAL 0)
+  if(RUN_${FEATURE} EQUAL 0 OR (COMPILE_${FEATURE} AND CROSS_COMPILING))
     message("-- Performing Test ${FEATURE} -- success")
     set(HAVE_${VAR} 1 PARENT_SCOPE)
     add_definitions(-DHAVE_${VAR})


loader: Further ImageMagick detection fix

Karl discovered an issue with the last change to FindImageMagick.cmake.

--- cmake/FindImageMagick.cmake
+++ cmake/FindImageMagick.cmake
@@ -155,7 +155,7 @@
     LIST(APPEND ImageMagick_INCLUDE_DIRS
       ${ImageMagick_${component}_INCLUDE_DIR}
       )
-    LIST(APPEND ImageMagick_${component}_INCLUDE_DIRS
+    LIST(APPEND ImageMagick_INCLUDE_DIRS
       ${ImageMagick_${component}_ARCH_INCLUDE_DIR}
       )
     LIST(REMOVE_DUPLICATES ImageMagick_INCLUDE_DIRS)


CLANG_OPENMP_FLAG is now the empty string

The OpenMP-compatible version of Clang installed by homebrew on macOS
does not need the fopenmp argument.

--- cmake/PVConfigProject.cmake
+++ cmake/PVConfigProject.cmake
@@ -20,7 +20,7 @@
   set(ICC_CPP_11X_FLAGS "")

   # Clang Compiler defaults
-  set(CLANG_OPENMP_FLAG -fopenmp=libiomp5)
+  set(CLANG_OPENMP_FLAG "")
   set(CLANG_CPP_11X_FLAGS "-std=c++11 -stdlib=libc++")
   set(CLANG_SANITIZE_ADDRESS_CXX_FLAGS "-g -fsanitize=address -fno-omit-frame-pointer")
   set(CLANG_SANITIZE_ADDRESS_LINKER_FLAGS -g;-fsanitize=address)


added PostgreSQL to configs/default

added PostgreSQL to configs/default

--- cmake/configs/default.cmake
+++ cmake/configs/default.cmake
@@ -62,6 +62,7 @@
 hunter_config(OpenCV-Extra VERSION 3.0.0)
 hunter_config(OpenSSL VERSION 1.0.2d)
 hunter_config(PNG VERSION 1.6.16-p4)
+hunter_config(PostgreSQL VERSION 9.5.0)
 hunter_config(Qt VERSION 5.5.1-hunter-p1)
 hunter_config(QtAndroidCMake VERSION 1.0.6)
 hunter_config(QtCMakeExtra VERSION 1.0.6)


Update default.cmake

Update default.cmake

--- cmake/configs/default.cmake
+++ cmake/configs/default.cmake
@@ -24,7 +24,7 @@

 # NOTE: no names with spaces!

-hunter_config(Buffer VERSION 0.1.4)
+hunter_config(buffer VERSION 0.1.4)
 hunter_config(AllTheFlopsThreads VERSION 0.1-p0)
 hunter_config(Android-Apk VERSION 1.1.13)
 hunter_config(Android-Build-Tools VERSION 22.0.1)


[CMake] Add install targets for utilities to LLVM exports if LLVM_INSTALL_UTILS=ON

Summary: D56606 was only appending target names to the `LLVM_EXPORTS`/`LLVM_EXPORTS_BUILDTREE_ONLY` properties. Targets showed up correctly in the build-tree `LLVMExports.cmake`, but they were missing in the installed one (as we found in https://bugs.llvm.org/show_bug.cgi?id=40443), because install did not register them explicitly.

Reviewers: mgorny, smeenai, beanz, gottesmm, dschuff, tstellar, serge-sans-paille

Reviewed By: smeenai

Subscribers: llvm-commits

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

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

--- cmake/modules/AddLLVM.cmake
+++ cmake/modules/AddLLVM.cmake
@@ -911,18 +911,28 @@

   add_llvm_executable(${name} DISABLE_LLVM_LINK_LLVM_DYLIB ${ARGN})
   set_target_properties(${name} PROPERTIES FOLDER "Utils")
-  if( LLVM_INSTALL_UTILS AND LLVM_BUILD_UTILS )
-    install (TARGETS ${name}
-      RUNTIME DESTINATION ${LLVM_UTILS_INSTALL_DIR}
-      COMPONENT ${name})
-    if (NOT LLVM_ENABLE_IDE)
-      add_llvm_install_targets(install-${name}
-                               DEPENDS ${name}
-                               COMPONENT ${name})
-    endif()
-    set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS ${name})
-  elseif( LLVM_BUILD_UTILS )
-    set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS_BUILDTREE_ONLY ${name})
+  if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
+    if (LLVM_INSTALL_UTILS AND LLVM_BUILD_UTILS)
+      if (${name} IN_LIST LLVM_DISTRIBUTION_COMPONENTS OR
+          NOT LLVM_DISTRIBUTION_COMPONENTS)
+        set(export_to_llvmexports EXPORT LLVMExports)
+        set_property(GLOBAL PROPERTY LLVM_HAS_EXPORTS True)
+      endif()
+
+      install(TARGETS ${name}
+              ${export_to_llvmexports}
+              RUNTIME DESTINATION ${LLVM_UTILS_INSTALL_DIR}
+              COMPONENT ${name})
+
+      if (NOT LLVM_ENABLE_IDE)
+        add_llvm_install_targets(install-${name}
+                                 DEPENDS ${name}
+                                 COMPONENT ${name})
+      endif()
+      set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS ${name})
+    elseif(LLVM_BUILD_UTILS)
+      set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS_BUILDTREE_ONLY ${name})
+    endif()
   endif()
 endmacro(add_llvm_utility name)