determine windows version from major.minor only, the patch number is irrelevant.

--- cmake/EigenDetermineOSVersion.cmake
+++ cmake/EigenDetermineOSVersion.cmake
@@ -9,18 +9,18 @@

 # - A little helper variable which should not be directly called
 function(DetermineShortWindowsName WIN_VERSION win_num_version)
-   if    (${win_num_version} VERSION_EQUAL "6.1.7600")
+   if    (${win_num_version} VERSION_EQUAL "6.1")
        set(_version "win7")
-   elseif(${win_num_version} VERSION_EQUAL "6.0.6000")
+   elseif(${win_num_version} VERSION_EQUAL "6.0")
        set(_version "winVista")
-   elseif(${win_num_version} VERSION_EQUAL "5.2.3790")
+   elseif(${win_num_version} VERSION_EQUAL "5.2")
        set(_version "winXpProf")
-   elseif(${win_num_version} VERSION_EQUAL "5.1.2600")
+   elseif(${win_num_version} VERSION_EQUAL "5.1")
        set(_version "winXp")
-   elseif(${win_num_version} VERSION_EQUAL "5.0.2195")
+   elseif(${win_num_version} VERSION_EQUAL "5.0")
        set(_version "win2000Prof")
    else()
-       set(_version "")
+       set(_version "unknownWin")
    endif()
    set(${WIN_VERSION} ${_version} PARENT_SCOPE)
 endfunction()
@@ -28,16 +28,14 @@
 function(DetermineOSVersion OS_VERSION)
   if (WIN32)
     file (TO_NATIVE_PATH "$ENV{COMSPEC}" SHELL)
-    exec_program( ${SHELL} ARGS "/c" "ver"
-      OUTPUT_VARIABLE ver_output)
+    exec_program( ${SHELL} ARGS "/c" "ver" OUTPUT_VARIABLE ver_output)

       string(REGEX MATCHALL "[0-9]+"
            ver_list "${ver_output}")
       list(GET ver_list 0 _major)
       list(GET ver_list 1 _minor)
-      list(GET ver_list 2 _patch)

-    set(win_num_version ${_major}.${_minor}.${_patch})
+    set(win_num_version ${_major}.${_minor})
     DetermineShortWindowsName(win_version "${win_num_version}")
     if(win_version)
       set(${OS_VERSION} ${win_version} PARENT_SCOPE)


CMake: target triple for MSVC on Windows 64.

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

--- cmake/modules/GetTargetTriple.cmake
+++ cmake/modules/GetTargetTriple.cmake
@@ -3,7 +3,11 @@

 function( get_target_triple var )
   if( MSVC )
-    set( ${var} "i686-pc-win32" PARENT_SCOPE )
+    if( CMAKE_CL_64 )
+      set( ${var} "x86_64-pc-win32" PARENT_SCOPE )
+    else()
+      set( ${var} "i686-pc-win32" PARENT_SCOPE )
+    endif()
   else( MSVC )
     set(config_guess ${LLVM_MAIN_SRC_DIR}/autoconf/config.guess)
     execute_process(COMMAND sh ${config_guess}


Update hunter.cmake

Update hunter.cmake

--- cmake/projects/OpenSSL/hunter.cmake
+++ cmake/projects/OpenSSL/hunter.cmake
@@ -263,4 +263,4 @@
 endif()

 hunter_cacheable(OpenSSL)
-hunter_download(PACKAGE_NAME OpenSSL PACKAGE_INTERNAL_DEPS_ID 5)
+hunter_download(PACKAGE_NAME OpenSSL PACKAGE_INTERNAL_DEPS_ID 6)


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

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

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

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

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

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

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

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

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

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

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

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

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

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

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

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

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


add .crtoolrc to list of files, if it exists

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

--- modules/xpfunmac.cmake
+++ modules/xpfunmac.cmake
@@ -960,6 +960,7 @@
   file(GLOB miscFiles LIST_DIRECTORIES false
     ${_dir}/.git ${_dir}/.gitattributes ${_dir}/.gitmodules
     ${_dir}/*clang-format
+    ${_dir}/.crtoolrc
     ${_dir}/README.md
     ${_dir}/version.cmake
     )


xpSetFlags gcc debug optimizations

xpSetFlags gcc debug optimizations

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

--- modules/xpfunmac.cmake
+++ modules/xpfunmac.cmake
@@ -1970,11 +1970,6 @@
         WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
         )
       xpStringAppendIfDne(CMAKE_CXX_FLAGS_DEBUG "--coverage")
-      # don't use debug optimizations for coverage data
-      check_cxx_compiler_flag("-O0" has_O0)
-      if(has_O0)
-        xpStringAppendIfDne(CMAKE_CXX_FLAGS_DEBUG "-O0")
-      endif()
     else()
       if(NOT XP_PATH_LCOV)
         message(AUTHOR_WARNING "lcov not found -- coverage reports will not be supported")
@@ -1983,11 +1978,10 @@
         message(AUTHOR_WARNING "genhtml not found -- coverage reports will not be supported")
       endif()
     endif()
-  else()
-    check_cxx_compiler_flag("-Og" has_Og)
-    if(has_Og)
-      xpStringAppendIfDne(CMAKE_CXX_FLAGS_DEBUG "-Og")
-    endif()
+  endif()
+  check_cxx_compiler_flag("-O0" has_O0)
+  if(has_O0) # don't use debug optimizations (coverage requires this, make it the default for all debug builds)
+    xpStringAppendIfDne(CMAKE_CXX_FLAGS_DEBUG "-O0")
   endif()
 endmacro()


Fix typo

Fix typo

--- cmake/FindEasyloggingpp.cmake
+++ cmake/FindEasyloggingpp.cmake
@@ -20,8 +20,8 @@
 # SOFTWARE.
 #==============================================================================
 #
-# Locate RapidJSON library
-# This module defines
+# Locate easylogging++ library
+# This module defines:
 # EASYLOGGINGPP_FOUND, if true, library is found
 # EASYLOGGINGPP_INCLUDE_DIR, directory path where to find
 # 	rapidjson directory with all necessary headers.


python: support Python 3.9

python: support Python 3.9

Add 3.9 to the list of accepted Python 3 versions.

--- cmake/FindPython3Interp.cmake
+++ cmake/FindPython3Interp.cmake
@@ -39,7 +39,7 @@

 unset(_Python3_NAMES)

-set(_Python3_VERSIONS 3.8 3.7 3.6 3.5 3.4 3.3 3.2 3.1 3.0)
+set(_Python3_VERSIONS 3.9 3.8 3.7 3.6 3.5 3.4 3.3 3.2 3.1 3.0)

 if(Python3Interp_FIND_VERSION)
     if(Python3Interp_FIND_VERSION_COUNT GREATER 1)


build: temporarily use forked nana

build: temporarily use forked nana

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

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

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


compile cblas library as static

compile cblas library as static

--- cmake/external/openblas.cmake
+++ cmake/external/openblas.cmake
@@ -114,11 +114,7 @@
 # linear algebra libraries for cc_library(xxx SRCS xxx.c DEPS cblas)
 SET(dummyfile ${CMAKE_CURRENT_BINARY_DIR}/cblas_dummy.c)
 FILE(WRITE ${dummyfile} "const char * dummy = \"${dummyfile}\";")
-IF("${CBLAS_PROVIDER}" STREQUAL "MKLML")
-    ADD_LIBRARY(cblas SHARED ${dummyfile})
-ELSE()
-    ADD_LIBRARY(cblas STATIC ${dummyfile})
-ENDIF()
+ADD_LIBRARY(cblas STATIC ${dummyfile})
 TARGET_LINK_LIBRARIES(cblas ${CBLAS_LIBRARIES})

 IF(NOT ${CBLAS_FOUND})


Be more careful of the case (e.g., FORCE_EXTERNAL_STATIC ON) when
wxwidgets libraries are not found.

svn path=/trunk/; revision=12065

--- cmake/modules/wxwidgets.cmake
+++ cmake/modules/wxwidgets.cmake
@@ -41,18 +41,23 @@
 endif(PLD_wxwidgets OR PLD_wxpng)

 if(PLD_wxwidgets OR PLD_wxpng)
+  if(FORCE_EXTERNAL_STATIC)
+    set(wxWidgets_USE_STATIC ON)
+  endif(FORCE_EXTERNAL_STATIC)
   find_package(wxWidgets COMPONENTS base core QUIET)
-  if(NOT wxWidgets_FOUND)
+  # Convert wxWidgets_LIBRARIES to full pathname form.
+  cmake_link_flags(wxwidgets_LINK_FLAGS "${wxWidgets_LIBRARIES}")
+  if(NOT wxWidgets_FOUND OR NOT wxwidgets_LINK_FLAGS)
     message(STATUS
-      "WARNING: wxWidgets not found so "
+      "WARNING: wxWidgets or its libraries not found so "
       "setting all wxwidgets devices to OFF."
       )
     set(PLD_wxwidgets OFF CACHE BOOL "Enable wxwidgets device" FORCE)
     set(PLD_wxpng OFF CACHE BOOL "Enable wxwidgets png device" FORCE)
-  else(NOT wxWidgets_FOUND)
+  else(NOT wxWidgets_FOUND OR NOT wxwidgets_LINK_FLAGS)
     # Check if stdint.h can be used from c++ (PL_HAVE_CXX_STDINT_H)
     include(TestForStdintCXX)
-  endif(NOT wxWidgets_FOUND)
+  endif(NOT wxWidgets_FOUND OR NOT wxwidgets_LINK_FLAGS)
 endif(PLD_wxwidgets OR PLD_wxpng)

 if(PLD_wxwidgets OR PLD_wxpng)
@@ -64,20 +69,18 @@
     wxWidgets_DEFINITIONS_wD
     "-D${wxWidgets_DEFINITIONS}"
     )
- 	set(wxWidgets_DEFINITIONS_DEBUG_wD "")
+  set(wxWidgets_DEFINITIONS_DEBUG_wD "")
   if(wxWidgets_DEFINITIONS_DEBUG)
-	  string(REGEX REPLACE ";" " -D"
-	    wxWidgets_DEFINITIONS_DEBUG_wD
-	    "-D${wxWidgets_DEFINITIONS_DEBUG}"
-	    )
+    string(REGEX REPLACE ";" " -D"
+      wxWidgets_DEFINITIONS_DEBUG_wD
+      "-D${wxWidgets_DEFINITIONS_DEBUG}"
+      )
   endif(wxWidgets_DEFINITIONS_DEBUG)
   string(REGEX REPLACE ";" " "
     wxwidgets_COMPILE_FLAGS
     ${wxwidgets_COMPILE_FLAGS}
     " ${wxWidgets_DEFINITIONS_wD} ${wxWidgets_DEFINITIONS_DEBUG_wD}"
     )
-  # Convert wxWidgets_LIBRARIES to full pathname form.
-  cmake_link_flags(wxwidgets_LINK_FLAGS "${wxWidgets_LIBRARIES}")
   message(STATUS "wxWidgets found")
   message(STATUS "wxwidgets_COMPILE_FLAGS = ${wxwidgets_COMPILE_FLAGS}")
   message(STATUS "wxwidgets_LINK_FLAGS = ${wxwidgets_LINK_FLAGS}")


Fix wrong dll copy command on windows

Fix wrong dll copy command on windows

--- cmake/submoduleOpenMesh.cmake
+++ cmake/submoduleOpenMesh.cmake
@@ -3,7 +3,7 @@
     set(OPENMESHTOOLLIBNAME OpenMeshToold)
 else()
     set(OPENMESHLIBNAME OpenMeshCore)
-    set(OPENMESHTOOLLIBNAME OpenMeshTool)
+    set(OPENMESHTOOLLIBNAME OpenMeshTools)
 endif()

 # ----------------------------------------------------------------------------------------------------------------------
@@ -15,13 +15,13 @@
     set( OPENMESH_LIBRARIES "${RADIUM_SUBMODULES_INSTALL_DIRECTORY}/lib/libOpenMeshCore.so"
                             "${RADIUM_SUBMODULES_INSTALL_DIRECTORY}/lib/libOpenMeshTools.so")
 elseif (MINGW)
-    set( OPENMESH_DLL "${RADIUM_SUBMODULES_INSTALL_DIRECTORY}/libOpenMeshCore.dll"
-                      "${RADIUM_SUBMODULES_INSTALL_DIRECTORY}/lib/libOpenMeshTools.dll")
+    set( OPENMESH_CORE_DLL  "${RADIUM_SUBMODULES_INSTALL_DIRECTORY}/libOpenMeshCore.dll")
+    set( OPENMESH_TOOLS_DLL "${RADIUM_SUBMODULES_INSTALL_DIRECTORY}/lib/libOpenMeshTools.dll")
     set( OPENMESH_LIBRARIES "${RADIUM_SUBMODULES_INSTALL_DIRECTORY}/lib/libOpenMeshCore.dll.a"
                             "${RADIUM_SUBMODULES_INSTALL_DIRECTORY}/lib/libOpenMeshTools.dll.a")
 elseif( MSVC )
-    set(OPENMESH_DLL "${RADIUM_SUBMODULES_INSTALL_DIRECTORY}/${OPENMESHLIBNAME}.dll"
-                     "${RADIUM_SUBMODULES_INSTALL_DIRECTORY}/${OPENMESHTOOLLIBNAME}.dll")
+    set(OPENMESH_CORE_DLL  "${RADIUM_SUBMODULES_INSTALL_DIRECTORY}/${OPENMESHLIBNAME}.dll")
+    set(OPENMESH_TOOLS_DLL "${RADIUM_SUBMODULES_INSTALL_DIRECTORY}/${OPENMESHTOOLLIBNAME}.dll")
     set(OPENMESH_LIBRARIES "${RADIUM_SUBMODULES_INSTALL_DIRECTORY}/lib/${OPENMESHLIBNAME}.lib"
                            "${RADIUM_SUBMODULES_INSTALL_DIRECTORY}/lib/${OPENMESHTOOLLIBNAME}.lib")
 endif()
@@ -74,8 +74,10 @@
 if( MSVC OR MINGW )

         add_custom_target( openmesh_install_compiled_dll
-            COMMAND ${CMAKE_COMMAND} -E copy_if_different ${OPENMESH_DLL} "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}"
-                COMMENT "copy openmesh dlls to bin dir" VERBATIM
+            COMMAND ${CMAKE_COMMAND} -E copy_if_different ${OPENMESH_CORE_DLL} "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}"
+                COMMENT "copy openmesh core dll to bin dir" VERBATIM
+            COMMAND ${CMAKE_COMMAND} -E copy_if_different ${OPENMESH_TOOLS_DLL} "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}"
+                COMMENT "copy openmesh tools dll to bin dir" VERBATIM
             DEPENDS openmesh create_bin_dir
         )
         add_dependencies(openmesh_lib openmesh_install_compiled_dll)


Fix C++17 requirements

Fix C++17 requirements

--- cmake/CompileFlags.cmake
+++ cmake/CompileFlags.cmake
@@ -18,6 +18,8 @@
 set(UNIX_DEFAULT_CXX_FLAGS_RELWITHDEBINFO "-g3")

 set(CMAKE_CXX_STANDARD 17)
+set(CMAKE_CXX_STANDARD_REQUIRED ON)
+set(CMAKE_CXX_EXTENSIONS OFF)

 # Compilation flag for each platforms =========================================


fix cmake variable name

fix cmake variable name

--- cmake/DetectOpenCV.cmake
+++ cmake/DetectOpenCV.cmake
@@ -5,8 +5,8 @@
 # Defines: OpenCV_FOUND, OpenCV_INCLUDE_DIRS, OpenCV_LIBS, OpenCV_LINK_LIBRARIES
 # ----------------------------------------------------------------------------
 if(DEFINED OpenCV_DIR)
-    get_filename_component(OpenCV_DIR_TYPE ${OpenCV_DIR} EXT)
-    message(STATUS "OpenCV_DIR_EXT${OpenCV_DIR_EXT}")
+    get_filename_component(OpenCV_DIR_EXT ${OpenCV_DIR} EXT)
+    message(STATUS "OpenCV_DIR_EXT${OpenCV_DIR_EXT}...")
     if(OpenCV_DIR_EXT STREQUAL ".pc")

         message(STATUS "PC file ${OpenCV_DIR}")


Added Mantella library

Added Mantella library

--- cmake/FindMantella.cmake
+++ cmake/FindMantella.cmake
@@ -1,5 +1,5 @@
-find_path(MANTELLA_INCLUDE_DIR mantella
-  PATHS "$ENV{ProgramFiles}/Mantella")
+find_path(MANTELLA_INCLUDE_DIR mantella)
+find_library(MANTELLA_LIBRARIES mantella)

 if(MANTELLA_INCLUDE_DIR)
   set(MANTELLA_VERSION_MAJOR 0)
@@ -21,8 +21,9 @@

 include(FindPackageHandleStandardArgs)
 find_package_handle_standard_args(Mantella
-  REQUIRED_VARS MANTELLA_INCLUDE_DIR
+  REQUIRED_VARS MANTELLA_LIBRARIES MANTELLA_INCLUDE_DIR
   VERSION_VAR MANTELLA_VERSION_STRING)

-mark_as_advanced(MANTELLA_INCLUDE_DIR)
-
+mark_as_advanced(
+  MANTELLA_LIBRARIES
+  MANTELLA_INCLUDE_DIR)


updated FindOskarLib.cmake to reflect latest build system changes

--- cmake/FindOskarLib.cmake
+++ cmake/FindOskarLib.cmake
@@ -144,7 +144,7 @@
         /usr/local/lib/
         /usr/local/oskar-lib/lib/
         /usr/oskar-lib/lib/
-    )
+        )
     #message("----- ${lib_name}: ${OSKAR_${_upper_oskar_module}_LIBRARY}")
     if (${OSKAR_${_upper_oskar_module}_LIBRARY} MATCHES OSKAR_${_upper_oskar_module}_LIBRARY-NOTFOUND)
         #message("oops")


cmake: allow extra compile options for tests

--- cmake/OpenCVModule.cmake
+++ cmake/OpenCVModule.cmake
@@ -1111,6 +1111,8 @@
   unset(__currentvar)
 endmacro()

+ocv_check_environment_variables(OPENCV_TEST_EXTRA_CXX_FLAGS_Release)
+
 # this is a command for adding OpenCV performance tests to the module
 # ocv_add_perf_tests(<extra_dependencies>)
 function(ocv_add_perf_tests)
@@ -1255,6 +1257,10 @@

       if(NOT BUILD_opencv_world)
         _ocv_add_precompiled_headers(${the_target})
+      endif()
+
+      if(OPENCV_TEST_EXTRA_CXX_FLAGS_Release)
+        target_compile_options(${the_target} PRIVATE "$<$<CONFIG:Release>:${OPENCV_TEST_EXTRA_CXX_FLAGS_Release}>")
       endif()

       ocv_add_test_from_target("${the_target}" "Accuracy" "${the_target}")


CMake: don't convert warnings to errors

CMake: don't convert warnings to errors

The reason is that future gfortran compilers might provide some warnings that
previous versions didn't, and so the compilation fails. Let the user decide how
to act on warnings.

--- cmake/UserOverride.cmake
+++ cmake/UserOverride.cmake
@@ -7,7 +7,7 @@
 # variables.
 if (CMAKE_Fortran_COMPILER_ID STREQUAL "GNU")
     # gfortran
-    set(common "-std=f2003 -Wall -Wextra -Wimplicit-interface -fPIC -Werror -fmax-errors=1")
+    set(common "-std=f2003 -Wall -Wextra -Wimplicit-interface -fPIC -fmax-errors=1")
     set(CMAKE_Fortran_FLAGS_RELEASE_INIT "${common} -O3 -march=native -ffast-math -funroll-loops")
     set(CMAKE_Fortran_FLAGS_DEBUG_INIT   "${common} -g -fbounds-check -fcheck-array-temporaries -fbacktrace")
 elseif (CMAKE_Fortran_COMPILER_ID STREQUAL "Intel")


Add PDAL_ADD_TEST cmake macro

Add PDAL_ADD_TEST cmake macro

This macro can be used to add test executables to the project.
Especially useful for plugins.

--- cmake/pdal_targets.cmake
+++ cmake/pdal_targets.cmake
@@ -103,3 +103,18 @@
         LIBRARY DESTINATION ${PDAL_LIB_DIR}
         ARCHIVE DESTINATION ${PDAL_LIB_DIR})
 endmacro(PDAL_ADD_PLUGIN)
+
+macro(PDAL_ADD_TEST _name _srcs)
+    include_directories(${PROJECT_SOURCE_DIR}/test/unit)
+    include_directories(${PROJECT_BINARY_DIR}/test/unit)
+    set(common_srcs
+        ${PROJECT_SOURCE_DIR}/test/unit/main.cpp
+        ${PROJECT_SOURCE_DIR}/test/unit/Support.cpp
+	${PROJECT_SOURCE_DIR}/test/unit/TestConfig.cpp
+    )
+    add_executable(${_name} ${_srcs} ${common_srcs})
+    set_target_properties(${_name} PROPERTIES COMPILE_DEFINITIONS PDAL_DLL_IMPORT)
+    add_definitions("-DBOOST_TEST_DYN_LINK")
+    target_link_libraries(${_name} ${PDAL_LINKAGE} ${PDAL_LIB_NAME})
+    add_test(${_name} "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${_name}" "${PROJECT_SOURCE_DIR}/test/data" --catch_system_errors=no)
+endmacro(PDAL_ADD_TEST)


added gcc warning flags

added gcc warning flags

but such that actually no warnings occur.
This is only used on first configure runs when no flags have been set manually.

Actually supressed:
-Wtype-limits:         17 lines (  2 warnings)
-Wunused-variable:     45 lines ( 17 warnings)
-Wsign-compare:        80 lines ( 36 warnings)
-Wignored-qualifiers:  38 lines ( 26 warnings)
-Wunused-parameter:   723 lines (292 warnings)

(these values have been determined without building vigranumpy)

--- config/VigraSetDefaults.cmake
+++ config/VigraSetDefaults.cmake
@@ -75,25 +75,24 @@
             FORCE)
     ENDIF()

-#    # initial compiler flags can be set here, this is only
-#    # executed once in the first configure run.
-#    IF(CMAKE_COMPILER_IS_GNUCXX)
-#        IF(NOT CMAKE_C_FLAGS)
-#            SET(CMAKE_C_FLAGS
-#                "-W -Wall"
-#                CACHE STRING
-#                "Flags used by the compiler during all build types."
-#                FORCE
-#            )
-#        ENDIF(NOT CMAKE_C_FLAGS)
-#        IF(NOT CMAKE_CXX_FLAGS)
-#            SET(CMAKE_CXX_FLAGS
-#                "-W -Wall"
-#                CACHE STRING
-#                "Flags used by the compiler during all build types."
-#                FORCE
-#            )
-#        ENDIF(NOT CMAKE_CXX_FLAGS)
-#    ENDIF(CMAKE_COMPILER_IS_GNUCXX)
+    # initial compiler flags can be set here, this is only
+    # executed once in the first configure run.
+    IF(CMAKE_COMPILER_IS_GNUCXX)
+        IF(NOT CMAKE_CXX_FLAGS)
+            SET(CMAKE_CXX_FLAGS "-W -Wall -Wextra -Wno-unused-parameter -Wno-ignored-qualifiers -Wno-sign-compare -Wno-unused-variable -Wno-type-limits")
+        ENDIF()
+        IF(NOT CMAKE_C_FLAGS)
+            SET(CMAKE_C_FLAGS "-W -Wall -Wextra -pedantic -std=c99 -Wno-sign-compare")
+        ENDIF()
+    ENDIF(CMAKE_COMPILER_IS_GNUCXX)
+
+    SET(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} CACHE STRING
+        "Flags used by the compiler during all build types."
+        FORCE
+    )
+    SET(CMAKE_C_FLAGS ${CMAKE_C_FLAGS} CACHE STRING
+        "Flags used by the compiler during all build types."
+        FORCE
+    )
 ENDIF(NOT VIGRA_DEFAULTS_INIT)


下载源码包的时候只需要一层

下载源码包的时候只需要一层

--- project/cmake/modules/FindConfigurePackage.cmake
+++ project/cmake/modules/FindConfigurePackage.cmake
@@ -212,7 +212,7 @@
                     if (NOT FindConfigurePackage_GIT_BRANCH)
                         set(FindConfigurePackage_GIT_BRANCH master)
                     endif()
-                    execute_process(COMMAND ${GIT_EXECUTABLE} clone -b ${FindConfigurePackage_GIT_BRANCH} ${FindConfigurePackage_GIT_URL} ${FindConfigurePackage_SRC_DIRECTORY_NAME}
+                    execute_process(COMMAND ${GIT_EXECUTABLE} clone --depth=1 -b ${FindConfigurePackage_GIT_BRANCH} ${FindConfigurePackage_GIT_URL} ${FindConfigurePackage_SRC_DIRECTORY_NAME}
                         WORKING_DIRECTORY ${FindConfigurePackage_WORKING_DIRECTORY}
                     )
                 endif()


Fix pkg-config file lookup logic.

Fix pkg-config file lookup logic.

--- cmake/bde_external_dependencies.cmake
+++ cmake/bde_external_dependencies.cmake
@@ -89,8 +89,7 @@
                    "${depPkgconfigName}"
                    "lib${depPkgconfigName}.${bde_install_ufid}"
                    "${depPkgconfigName}lib.${bde_install_ufid}"
-                   "lib${depPkgconfigName}"
-                   "${depPkgconfigName}lib")
+            )

         pkg_check_modules(${depName}_pc
                           QUIET NO_CMAKE_PATH "${pcName}")


[cmake] Remove MSVC C4180 override

[cmake] Remove MSVC C4180 override

Tested on VS2017 and VS2019 llvm/clang builds with WX enabled - its no longer necessary to disable this warning.

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

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

--- cmake/modules/HandleLLVMOptions.cmake
+++ cmake/modules/HandleLLVMOptions.cmake
@@ -502,7 +502,6 @@
       # Disabled warnings.
       -wd4141 # Suppress ''modifier' : used more than once' (because of __forceinline combined with inline)
       -wd4146 # Suppress 'unary minus operator applied to unsigned type, result still unsigned'
-      -wd4180 # Suppress 'qualifier applied to function type has no meaning; ignored'
       -wd4244 # Suppress ''argument' : conversion from 'type1' to 'type2', possible loss of data'
       -wd4267 # Suppress ''var' : conversion from 'size_t' to 'type', possible loss of data'
       -wd4291 # Suppress ''declaration' : no matching operator delete found; memory will not be freed if initialization throws an exception'


Exclude *.m and *.mm Objective-C sources from including pch

--- cmake/modules/PrecompiledHeader.cmake
+++ cmake/modules/PrecompiledHeader.cmake
@@ -51,6 +51,10 @@
 # ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
 # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 # SOFTWARE.
+
+
+# Use the new builtin CMake function if possible or fall back to the old one.
+if (CMAKE_VERSION VERSION_LESS 3.16)

 include(CMakeParseArguments)

@@ -100,9 +104,6 @@
   set(_cxx_flags "$<$<BOOL:${CMAKE_CXX_FLAGS}>:${CMAKE_CXX_FLAGS}\n>$<$<BOOL:${_build_cxx_flags}>:${_build_cxx_flags}\n>")
   file(GENERATE OUTPUT "${_filename}" CONTENT "${_compile_definitions}${_include_directories}${_compile_flags}${_compile_options}${_cxx_flags}\n")
 endfunction()
-
-# Use the new builtin CMake function if possible or fall back to the old one.
-if (CMAKE_VERSION VERSION_LESS 3.16)

 function(add_precompiled_header _target _input)

@@ -252,7 +253,17 @@
 else ()

 function(add_precompiled_header _target _input)
+    message(STATUS "Adding precompiled header ${_input} to target ${_target}.")
     target_precompile_headers(${_target} PRIVATE ${_input})
+
+    get_target_property(_sources ${_target} SOURCES)
+    list(FILTER _sources INCLUDE REGEX ".*\\.mm?")
+
+    if (_sources)
+        message(STATUS "PCH skipping sources: ${_sources}")
+    endif ()
+
+    set_source_files_properties(${_sources} PROPERTIES SKIP_PRECOMPILE_HEADERS ON)
 endfunction()

 endif (CMAKE_VERSION VERSION_LESS 3.16)


refs #4871 remove cmake warning about -Wcast-align.  It's been long enough and we're not fixing it any time soon.

git-svn-id: b5c078ec0b4d3a50497e9dd3081db18a5b4f16e5@54397 c7de825b-a66e-492c-adef-691d508d4ae1

--- cmake_modules/TokuSetupCompiler.cmake
+++ cmake_modules/TokuSetupCompiler.cmake
@@ -152,9 +152,8 @@
   #-Wvector-optimization-performance
   )

-if (CMAKE_CXX_COMPILER_ID STREQUAL Clang)
-  message(WARNING "Disabling -Wcast-align with clang.  TODO: fix casting and re-enable it.")
-else ()
+if (NOT CMAKE_CXX_COMPILER_ID STREQUAL Clang)
+  # Disabling -Wcast-align with clang.  TODO: fix casting and re-enable it, someday.
   set_cflags_if_supported(-Wcast-align)
 endif ()


[3388126] Fix Boost license file location in CMake

--HG--
branch : v1-7

--- CMake/InstallDependencies.cmake
+++ CMake/InstallDependencies.cmake
@@ -194,7 +194,7 @@
 		PATTERN "xpressive" EXCLUDE
 	  )
 	  # License
-	  install(FILES "${Boost_INCLUDE_DIR}/LICENSE_1_0.txt" DESTINATION "boost_${Boost_LIB_VERSION}")
+	  install(FILES "${Boost_INCLUDE_DIR}/../LICENSE_1_0.txt" DESTINATION "boost_${Boost_LIB_VERSION}")
 	  # libraries
 	  if (Boost_THREAD_FOUND)
 	    install(FILES ${Boost_THREAD_LIBRARY_DEBUG} DESTINATION "boost_${Boost_LIB_VERSION}/lib" CONFIGURATIONS Debug)


COMP: Correct typo in Shark banned header

--- CMake/OTBModuleHeaderTest.cmake
+++ CMake/OTBModuleHeaderTest.cmake
@@ -26,7 +26,7 @@
 	SET(BANNED_HEADERS "${BANNED_HEADERS} otbDecisionTreeMachineLearningModelFactory.h otbDecisionTreeMachineLearningModel.h otbKNearestNeighborsMachineLearningModelFactory.h otbKNearestNeighborsMachineLearningModel.h otbRandomForestsMachineLearningModelFactory.h otbRandomForestsMachineLearningModel.h otbSVMMachineLearningModelFactory.h otbSVMMachineLearningModel.h otbGradientBoostedTreeMachineLearningModelFactory.h otbGradientBoostedTreeMachineLearningModel.h otbBoostMachineLearningModelFactory.h otbBoostMachineLearningModel.h otbNeuralNetworkMachineLearningModelFactory.h otbNeuralNetworkMachineLearningModel.h otbNormalBayesMachineLearningModelFactory.h otbNormalBayesMachineLearningModel.h otbRequiresOpenCVCheck.h otbOpenCVUtils.h otbCvRTreesWrapper.h")
 endif()
 if(NOT OTB_USE_SHARK)
-  SET(BANNED_HEADERS "${BANNED_HEADERS} otbSharkRandomForestsMachineLearningModel.h otbSharkRandomForestsMachineLearningModel.txx otbSharkUtils.h otbRequiresSharkCheck.h otbSharkRandomForestsMachineLearningModelFactory.h  otbSharkKMeansMachineLearningModel.hx otbSharkKMeansMachineLearningModel.txx otbSharkKMeansMachineLearningModelFactory.h otbSharkKMeansMachineLearningModelFactory.txx")
+  SET(BANNED_HEADERS "${BANNED_HEADERS} otbSharkRandomForestsMachineLearningModel.h otbSharkRandomForestsMachineLearningModel.txx otbSharkUtils.h otbRequiresSharkCheck.h otbSharkRandomForestsMachineLearningModelFactory.h  otbSharkKMeansMachineLearningModel.h otbSharkKMeansMachineLearningModel.txx otbSharkKMeansMachineLearningModelFactory.h otbSharkKMeansMachineLearningModelFactory.txx")
 endif()
 if(NOT OTB_USE_LIBSVM)
 	SET(BANNED_HEADERS "${BANNED_HEADERS} otbLibSVMMachineLearningModel.h otbLibSVMMachineLearningModelFactory.h")
@@ -44,7 +44,7 @@

 macro( otb_module_headertest _name )
-  if( NOT ${_name}_THIRD_PARTY
+  if( NOT ${_name}_THIRD_PARTY
       AND EXISTS ${${_name}_SOURCE_DIR}/include
       AND PYTHON_EXECUTABLE
       AND NOT (PYTHON_VERSION_STRING VERSION_LESS 2.6)


[CMake] Move the -Xclang option before -fmodules-cache-path
This fixes a typo introduced in r274196.
Thanks to Vassil Vassilev for noticing!

http://reviews.llvm.org/D21827
rdar://problem/27019000

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

--- cmake/modules/HandleLLVMOptions.cmake
+++ cmake/modules/HandleLLVMOptions.cmake
@@ -465,13 +465,13 @@
   endif()
   if (LLVM_ENABLE_MODULES)
     set(OLD_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS})
-    set(module_flags "-fmodules -fmodules-cache-path=module.cache")
+    set(module_flags "-fmodules -Xclang -fmodules-cache-path=module.cache")
     if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
       # On Darwin -fmodules does not imply -fcxx-modules.
       set(module_flags "${module_flags} -fcxx-modules")
     endif()
     if (LLVM_ENABLE_LOCAL_SUBMODULE_VISIBILITY)
-      set(module_flags "${module_flags} -Xclang -fmodules-local-submodule-visibility")
+      set(module_flags "${module_flags} -fmodules-local-submodule-visibility")
     endif()
     set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} ${module_flags}")


build: prevent printing for unused variables for SDK

Reduce some of the SDK configuration printing for non-Darwin
configurations.  This simplifies the output and SDK configuration.  The
parameter reduction simplifies the setup for cross-compilation.

--- cmake/modules/SwiftConfigureSDK.cmake
+++ cmake/modules/SwiftConfigureSDK.cmake
@@ -40,21 +40,26 @@
       message(STATUS "  ${arch} Path: ${SWIFT_SDK_${prefix}_ARCH_${arch}_PATH}")
     endforeach()
   endif()
-  message(STATUS "  Version: ${SWIFT_SDK_${prefix}_VERSION}")
-  message(STATUS "  Build number: ${SWIFT_SDK_${prefix}_BUILD_NUMBER}")
-  message(STATUS "  Deployment version: ${SWIFT_SDK_${prefix}_DEPLOYMENT_VERSION}")
+  if(prefix IN_LIST SWIFT_APPLE_PLATFORMS)
+    message(STATUS "  Version: ${SWIFT_SDK_${prefix}_VERSION}")
+    message(STATUS "  Build number: ${SWIFT_SDK_${prefix}_BUILD_NUMBER}")
+    message(STATUS "  Deployment version: ${SWIFT_SDK_${prefix}_DEPLOYMENT_VERSION}")
+  endif()
   message(STATUS "  Library subdir: ${SWIFT_SDK_${prefix}_LIB_SUBDIR}")
-  message(STATUS "  Version min name: ${SWIFT_SDK_${prefix}_VERSION_MIN_NAME}")
-  message(STATUS "  Triple name: ${SWIFT_SDK_${prefix}_TRIPLE_NAME}")
+  if(prefix IN_LIST SWIFT_APPLE_PLATFORMS)
+    message(STATUS "  Version min name: ${SWIFT_SDK_${prefix}_VERSION_MIN_NAME}")
+    message(STATUS "  Triple name: ${SWIFT_SDK_${prefix}_TRIPLE_NAME}")
+  endif()
   message(STATUS "  Architectures: ${SWIFT_SDK_${prefix}_ARCHITECTURES}")
-  is_darwin_based_sdk(${prefix} IS_DARWIN_BASED_SDK)
-  if(NOT ${IS_DARWIN_BASED_SDK})
-    foreach(arch ${SWIFT_SDK_${prefix}_ARCHITECTURES})
-      message(STATUS "  ICU i18n INCLUDE (${arch}): ${SWIFT_${prefix}_${arch}_ICU_I18N_INCLUDE}")
-      message(STATUS "  ICU i18n LIB (${arch}): ${SWIFT_${prefix}_${arch}_ICU_I18N}")
-      message(STATUS "  ICU unicode INCLUDE (${arch}): ${SWIFT_${prefix}_${arch}_ICU_UC_INCLUDE}")
-      message(STATUS "  ICU unicode LIB (${arch}): ${SWIFT_${prefix}_${arch}_ICU_UC}")
-    endforeach()
+  if(NOT prefix IN_LIST SWIFT_APPLE_PLATFORMS)
+    if(SWIFT_BUILD_STDLIB)
+      foreach(arch ${SWIFT_SDK_${prefix}_ARCHITECTURES})
+        message(STATUS "  ICU i18n INCLUDE (${arch}): ${SWIFT_${prefix}_${arch}_ICU_I18N_INCLUDE}")
+        message(STATUS "  ICU i18n LIB (${arch}): ${SWIFT_${prefix}_${arch}_ICU_I18N}")
+        message(STATUS "  ICU unicode INCLUDE (${arch}): ${SWIFT_${prefix}_${arch}_ICU_UC_INCLUDE}")
+        message(STATUS "  ICU unicode LIB (${arch}): ${SWIFT_${prefix}_${arch}_ICU_UC}")
+      endforeach()
+    endif()
   endif()
   message(STATUS "  Object Format: ${SWIFT_SDK_${prefix}_OBJECT_FORMAT}")
   foreach(arch ${SWIFT_SDK_${prefix}_ARCHITECTURES})


fixed cmake for versions without generator expressions (hopefully)

--- cmake_modules/TokuSetupCompiler.cmake
+++ cmake_modules/TokuSetupCompiler.cmake
@@ -23,9 +23,16 @@
 endif ()

 ## add TOKU_PTHREAD_DEBUG for debug builds
-set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS
-  $<$<OR:$<CONFIG:DEBUG>,$<CONFIG:DRD>>:TOKU_PTHREAD_DEBUG=1>
-  $<$<CONFIG:DRD>:_FORTIFY_SOURCE=2>)
+if (CMAKE_VERSION VERSION_GREATER 2.8)
+  set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS
+    $<$<OR:$<CONFIG:DEBUG>,$<CONFIG:DRD>>:TOKU_PTHREAD_DEBUG=1>
+    $<$<CONFIG:DRD>:_FORTIFY_SOURCE=2>
+    )
+else ()
+  set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_DEBUG TOKU_PTHREAD_DEBUG=1)
+  set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_DRD TOKU_PTHREAD_DEBUG=1)
+  set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_DRD _FORTIFY_SOURCE=2)
+endif ()

 ## coverage
 option(USE_GCOV "Use gcov for test coverage." OFF)


boards: nucleo_g474re revert pyocd workaround

Pyocd couldn't flash the nucleo_g474re board with the target
stm32g474retx (issue #23351).
Therefore PR #23230 introduced a workaround changing the target
to stm32g474rbtx.

In the meantime this issue was resolved, therefore revert the
workaround.

Signed-off-by: Thomas Stranger <289fb7da2789c69f49f06a4b4e006530cf91f1de@outlook.com>

--- boards/arm/nucleo_g474re/board.cmake
+++ boards/arm/nucleo_g474re/board.cmake
@@ -1,8 +1,6 @@
 # SPDX-License-Identifier: Apache-2.0

-# use target=stm32g474rbtx instead of stm32g474retx
-# to allow board re-flashing (see PR #23230)
-board_runner_args(pyocd "--target=stm32g474rbtx")
+board_runner_args(pyocd "--target=stm32g474retx")

 include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake)
 include(${ZEPHYR_BASE}/boards/common/pyocd.board.cmake)


Fix ctest version detection logic, seem that CMake 2.4 don't have CMAKE_VERSION.

--- flies-selenium/src/test/steer.cmake
+++ flies-selenium/src/test/steer.cmake
@@ -4,9 +4,16 @@
 ####################################################################
 SET(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS ON)
 MESSAGE("CMake version=${CMAKE_VERSION}")
-IF (CMAKE_VERSION VERSION_LESS 2.6)
+
+IF(CMAKE_VERSION)
+    IF(CMAKE_VERSION VERSION_LESS 2.6)
+        MESSAGE("SET CMAKE_BACKWARDS_COMPATIBILITY ${CMAKE_VERSION}")
+        SET(CMAKE_BACKWARDS_COMPATIBILITY ${CMAKE_VERSION})
+    ENDIF()
+ELSE()
+    # CMAKE_VERSION may not available in 2.4
     MESSAGE("SET CMAKE_BACKWARDS_COMPATIBILITY ${CMAKE_VERSION}")
-    SET(CMAKE_BACKWARDS_COMPATIBILITY ${CMAKE_VERSION})
+    SET(CMAKE_BACKWARDS_COMPATIBILITY 2.4)
 ENDIF()

 SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR})


use strict-aliasing for the clang-on-windows build configs

--- cmake-toolchains/windows-clang.cmake
+++ cmake-toolchains/windows-clang.cmake
@@ -24,12 +24,12 @@
 set(CMAKE_CXX_RESPONSE_FILE_LINK_FLAG "@")

 # C++ flags
-set(CMAKE_CXX_FLAGS "-std=c++11 -fno-strict-aliasing -Wno-multichar -Wall -Wextra -Wno-unknown-pragmas -Wno-ignored-qualifiers -Wno-missing-field-initializers")
+set(CMAKE_CXX_FLAGS "-std=c++11 -fstrict-aliasing -Wno-multichar -Wall -Wextra -Wno-unknown-pragmas -Wno-ignored-qualifiers -Wno-missing-field-initializers")
 set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG")
 set(CMAKE_CXX_FLAGS_DEBUG "-O0 -D_DEBUG_ -D_DEBUG -DFIPS_DEBUG=1")

 # C flags
-set(CMAKE_C_FLAGS "-fno-strict-aliasing -Wno-multichar -Wall -Wextra -Wno-unknown-pragmas -Wno-ignored-qualifiers -Wno-missing-field-initializers")
+set(CMAKE_C_FLAGS "-fstrict-aliasing -Wno-multichar -Wall -Wextra -Wno-unknown-pragmas -Wno-ignored-qualifiers -Wno-missing-field-initializers")
 set(CMAKE_C_FLAGS_RELEASE "-O3 -DNDEBUG")
 set(CMAKE_C_FLAGS_DEBUG "-O0 -D_DEBUG_ -D_DEBUG -DFIPS_DEBUG=1")


[cxxmodules] Enable runtime_cxxmodules on UNIX by default.

ROOT has several features which interact with libraries and require implicit
header inclusion. This can be triggered by reading or writing data on disk, or
user actions at the prompt. Often, the headers are immutable and reparsing is
redundant. C++ Modules are designed to minimize the reparsing of the same header
content by providing an efficient on-disk representation of C++ Code. More
information about the C++ modules technology can be found at
README/README.CXXMODULES.md

This undertaking was successful due to the efforts of many people. Especially,
Raphael Isemann, Oksana Shadura and Yuka Takahashi.

We are grateful to Liz Sexton-Kennedy, Peter Elmer, Brian Bockelman and Ken Bloom
for putting (wo)manpower into the project and supporting it.

This work has been supported by an Intel Parallel Computing Center grant,
by U.S.National Science Foundation grants PHY-1450377, ACI-1450323 and
PHY-1624356, andby the U.S. Department of Energy, Office of Science.

Special thanks to Axel Naumann and Philippe Canal for helping and supporting
the technical efforts over the years.

We are thankful to Shahzad Malik Muzaffar, David Lange and Mircho Rodozov
from the CMSSW development team, CERN/EP-SFT and the ROOT team.

--- cmake/modules/RootBuildOptions.cmake
+++ cmake/modules/RootBuildOptions.cmake
@@ -150,7 +150,7 @@
 ROOT_BUILD_OPTION(webgui ON "Build Web-based UI components of ROOT (requires C++14 standard or higher)")
 ROOT_BUILD_OPTION(root7 ON "Build ROOT 7 components of ROOT (requires C++14 standard or higher)")
 ROOT_BUILD_OPTION(rpath OFF "Link libraries with built-in RPATH (run-time search path)")
-ROOT_BUILD_OPTION(runtime_cxxmodules OFF "Enable runtime support for C++ modules")
+ROOT_BUILD_OPTION(runtime_cxxmodules ON "Enable runtime support for C++ modules")
 ROOT_BUILD_OPTION(shadowpw OFF "Enable support for shadow passwords")
 ROOT_BUILD_OPTION(shared ON "Use shared 3rd party libraries if possible")
 ROOT_BUILD_OPTION(soversion OFF "Set version number in sonames (recommended)")
@@ -292,12 +292,14 @@
   set(memstat_defvalue OFF)
   set(roofit_defvalue OFF)
   set(roottest_defvalue OFF)
+  set(runtime_cxxmodules_defvalue OFF)
   set(testing_defvalue OFF)
   set(tmva_defvalue OFF)
   set(vdt_defvalue OFF)
   set(x11_defvalue OFF)
 elseif(APPLE)
   set(cocoa_defvalue ON)
+  set(runtime_cxxmodules_defvalue OFF)
   set(x11_defvalue OFF)
 endif()


WIP hotfix for Windows release package

WIP hotfix for Windows release package

specific VKL driver missing

--- cmake/ospray_redistribute_deps.cmake
+++ cmake/ospray_redistribute_deps.cmake
@@ -74,6 +74,9 @@
 ospray_add_dependent_lib(ospcommon::ospcommon)
 ospray_add_dependent_lib(openvkl::openvkl)
 ospray_add_dependent_lib(openvkl::openvkl_module_ispc_driver)
+ospray_add_dependent_lib(openvkl::openvkl_module_ispc_driver_4)
+ospray_add_dependent_lib(openvkl::openvkl_module_ispc_driver_8)
+ospray_add_dependent_lib(openvkl::openvkl_module_ispc_driver_16)
 if (OSPRAY_MODULE_DENOISER)
   ospray_add_dependent_lib(OpenImageDenoise)
 endif()


xtools: exclude "sources" when searching xtools output dir

When using xtools as toolchain, cmake searches the toolchain home
directory. However, if the first toolchain directory does not
begin with any character before "s", "sources" (if exists) would
become the first directory being probed. Since it does not
conform to "arch-vendor-abi" naming, cmake would fail.
So exclude "sources" from the list to avoid this issue.

Signed-off-by: Daniel Leung <d94e04d205b5962d7873a139ef298b03c1717f72@intel.com>

--- cmake/toolchain/xtools/generic.cmake
+++ cmake/toolchain/xtools/generic.cmake
@@ -12,6 +12,7 @@
 # toolchains because choosing between iamcu and non-iamcu is dependent
 # on Kconfig, not ARCH.
 file(GLOB toolchain_paths ${TOOLCHAIN_HOME}/*)
+list(REMOVE_ITEM toolchain_paths ${TOOLCHAIN_HOME}/sources)
 list(GET  toolchain_paths 0 some_toolchain_path)
 get_filename_component(some_toolchain "${some_toolchain_path}" NAME)


cmake/modules/FindFFTWWrappers.cmake: select static or shared based on GEARSHIFFT_USE_STATIC_LIBS

--- cmake/modules/FindFFTWWrappers.cmake
+++ cmake/modules/FindFFTWWrappers.cmake
@@ -20,6 +20,16 @@
 #   MKLROOT                        ... take the MKL libraries from here
 #

+if(GEARSHIFFT_USE_STATIC_LIBS)
+  set(PREFERENCE_LIBRARY_PREFIX "${CMAKE_STATIC_LIBRARY_PREFIX}")
+  set(PREFERENCE_LIBRARY_SUFFIX "${CMAKE_STATIC_LIBRARY_SUFFIX}")
+  message("FFTWWrappers will prefer libraries with prefix '${PREFERENCE_LIBRARY_PREFIX}' and suffix '${PREFERENCE_LIBRARY_SUFFIX}'")
+else()
+  set(PREFERENCE_LIBRARY_PREFIX)
+  set(PREFERENCE_LIBRARY_SUFFIX)
+  message("FFTWWrappers will prefer libraries with no prefix and no suffix")
+endif()
+
 #If environment variable FFTWWrappers_ROOT is defined, it has the same effect as the cmake variable
 if( NOT FFTWWrappers_ROOT AND DEFINED ENV{FFTWWrappers_ROOT} )
   if( EXISTS "$ENV{FFTWWrappers_ROOT}/" )
@@ -43,21 +53,21 @@
 #initialize library variables
 find_library(
   FFTWWrappers_GNU_LIBRARIES
-  NAMES fftw3xc_gnu fftw3xc_gnu.a
+  NAMES ${PREFERENCE_LIBRARY_PREFIX}fftw3xc_gnu${PREFERENCE_LIBRARY_SUFFIX} fftw3xc_gnu
   PATHS ${FFTWWrappers_ROOT}
   PATH_SUFFIXES "lib" "lib64"
   NO_DEFAULT_PATH
   )
 find_library(
   FFTWWrappers_GNU_LIBRARIES
-  NAMES fftw3xc_gnu fftw3xc_gnu.a
+  NAMES ${PREFERENCE_LIBRARY_PREFIX}fftw3xc_gnu${PREFERENCE_LIBRARY_SUFFIX} fftw3xc_gnu
   PATHS ${MKLROOT}
   PATH_SUFFIXES "lib/intel64_lin" "lib/intel64_mac" "lib/intel64"
   NO_DEFAULT_PATH
   )
 find_library(
   FFTWWrappers_GNU_LIBRARIES
-  NAMES fftw3xc_gnu fftw3xc_gnu.a
+  NAMES ${PREFERENCE_LIBRARY_PREFIX}fftw3xc_gnu${PREFERENCE_LIBRARY_SUFFIX} fftw3xc_gnu
   )

 if(EXISTS ${FFTWWrappers_GNU_LIBRARIES})
@@ -66,21 +76,21 @@

 find_library(
   FFTWWrappers_INTEL_LIBRARIES
-  NAMES fftw3xc_intel fftw3xc_intel.a
+  NAMES ${PREFERENCE_LIBRARY_PREFIX}fftw3xc_intel${PREFERENCE_LIBRARY_SUFFIX} fftw3xc_intel
   PATHS ${FFTWWrappers_ROOT}
   PATH_SUFFIXES "lib" "lib64"
   NO_DEFAULT_PATH
   )
 find_library(
   FFTWWrappers_INTEL_LIBRARIES
-  NAMES fftw3xc_intel fftw3xc_intel.a
+  NAMES ${PREFERENCE_LIBRARY_PREFIX}fftw3xc_intel${PREFERENCE_LIBRARY_SUFFIX} fftw3xc_intel
   PATHS ${MKLROOT}
   PATH_SUFFIXES "lib/intel64_lin" "lib/intel64_mac" "lib/intel64_win" "lib/intel64"
   NO_DEFAULT_PATH
 )
 find_library(
   FFTWWrappers_INTEL_LIBRARIES
-  NAMES fftw3xc_intel fftw3xc_intel.a
+  NAMES ${PREFERENCE_LIBRARY_PREFIX}fftw3xc_intel${PREFERENCE_LIBRARY_SUFFIX} fftw3xc_intel
 )

 if(EXISTS ${FFTWWrappers_INTEL_LIBRARIES})
@@ -128,7 +138,7 @@

 find_library(
   MKL_INTEL_LP64
-  NAMES mkl_intel_lp64 mkl_intel_lp64.a
+  NAMES ${PREFERENCE_LIBRARY_PREFIX}mkl_intel_lp64${PREFERENCE_LIBRARY_SUFFIX} mkl_intel_lp64
   PATHS ${MKLROOT}
   PATH_SUFFIXES "lib" "lib/intel64_lin" "lib/intel64_mac" "lib/intel64_win" "lib/intel64"
   NO_DEFAULT_PATH
@@ -142,7 +152,7 @@

 find_library(
   MKL_INTEL_THREAD
-  NAMES mkl_intel_thread mkl_intel_thread.a
+  NAMES ${PREFERENCE_LIBRARY_PREFIX}mkl_intel_thread${PREFERENCE_LIBRARY_SUFFIX} mkl_intel_thread
   PATHS ${MKLROOT}
   PATH_SUFFIXES "lib" "lib/intel64_lin" "lib/intel64_mac" "lib/intel64_win" "lib/intel64"
   NO_DEFAULT_PATH
@@ -156,7 +166,7 @@

 find_library(
   MKL_CORE
-  NAMES mkl_core mkl_core.a
+  NAMES ${PREFERENCE_LIBRARY_PREFIX}mkl_core${PREFERENCE_LIBRARY_SUFFIX} mkl_core
   PATHS ${MKLROOT}
   PATH_SUFFIXES "lib" "lib/intel64_lin" "lib/intel64_mac" "lib/intel64_win" "lib/intel64"
   NO_DEFAULT_PATH
@@ -171,6 +181,8 @@
 list(APPEND FFTWWrappers_MKL_LIBRARY_DIRS "${MKLROOT}/../compiler/lib/intel64")
 list(APPEND FFTWWrappers_MKL_LIBRARY_DIRS "${MKLROOT}/../tbb/lib/intel64/gcc4.4")

+# NOTE: According to Intel documentation, it is generally not recommended to
+# link against the static variants of the openMP libraries so we put them last:
 find_library(
   MKL_IOMP5
   NAMES iomp5 libiomp5.a libiomp5md


Removing leading space for Distributor ID and Release

--- packaging/linux/LinuxPackaging.cmake
+++ packaging/linux/LinuxPackaging.cmake
@@ -18,14 +18,14 @@

 execute_process(COMMAND lsb_release -a
   COMMAND grep "^Distributor ID:"
-  COMMAND sed -e "s/Distributor ID://ig"
+  COMMAND sed -e "s/Distributor ID:[ \t]*//ig"
   OUTPUT_VARIABLE DISTRIBUTOR_ID
   OUTPUT_STRIP_TRAILING_WHITESPACE
   )

 execute_process(COMMAND lsb_release -a
   COMMAND grep "^Release:"
-  COMMAND sed -e "s/Release://ig"
+  COMMAND sed -e "s/Release:[ \t]*//ig"
   OUTPUT_VARIABLE RELEASE
   OUTPUT_STRIP_TRAILING_WHITESPACE
   )


Issue #21: Add --expt-relaxed-constexpr for g++

--- CMake/ExternalProjects/OpenCV.cmake
+++ CMake/ExternalProjects/OpenCV.cmake
@@ -50,9 +50,13 @@
     list(APPEND _cuda_options
       -DCUDA_TOOLKIT_ROOT_DIR:PATH=${CUDA_TOOLKIT_ROOT_DIR}
       -DCUDA_ARCH_BIN:STRING=${MYPROJECT_CUDA_ARCH_BIN}
-      -DCUDA_NVCC_FLAGS:STRING=${MYPROJECT_CXX11_FLAG}
       -DCUDA_PROPAGATE_HOST_FLAGS:BOOL=OFF
     )
+    if(CMAKE_COMPILER_IS_GNUCXX)
+      list(APPEND _cuda_options -DCUDA_NVCC_FLAGS:STRING=${MYPROJECT_CXX11_FLAG}^^--expt-relaxed-constexpr)
+    else()
+      list(APPEND _cuda_options -DCUDA_NVCC_FLAGS:STRING=${MYPROJECT_CXX11_FLAG})
+    endif()
   endif()

   if(CTEST_USE_LAUNCHERS)


Allow DFU builds for out-of-tree GreatFET modules.

--- firmware/cmake/greatfet-common.cmake
+++ firmware/cmake/greatfet-common.cmake
@@ -176,7 +176,7 @@
 		COMMAND rm -f _tmp.dfu _header.bin
 		COMMAND cp ${PROJECT_NAME}_dfu.bin _tmp.dfu
 		COMMAND ${DFU_COMMAND}
-		COMMAND python ../../dfu.py ${PROJECT_NAME}
+		COMMAND python ${PATH_GREATFET_FIRMWARE}/dfu.py ${PROJECT_NAME}
 		COMMAND cat _header.bin _tmp.dfu >${PROJECT_NAME}.dfu
 	)


Revert "ENH: forward superbuild compilation option to muparserx"

This reverts commit aa6cdb03380b0940e725077993783fe268f172b9.

--- SuperBuild/CMake/External_muparserx.cmake
+++ SuperBuild/CMake/External_muparserx.cmake
@@ -12,16 +12,6 @@
  list(APPEND MUPARSERX_FLAGS -DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS:BOOL=ON)
 endif()

-# forward compilation flags (muparserx has to be compile with cxx11 and muparserx CMakeLists.txt does not seem to add this flag automatically...)
-set(MUPARSERX_SB_COMPILATION_FLAGS
-   -DCMAKE_C_FLAGS:STRING=${CMAKE_C_FLAGS}
-   -DCMAKE_CXX_FLAGS:STRING=${CMAKE_CXX_FLAGS}
-   -DCMAKE_EXE_LINKER_FLAGS:STRING=${CMAKE_EXE_LINKER_FLAGS}
-   -DCMAKE_MODULE_LINKER_FLAGS:STRING=${CMAKE_MODULE_LINKER_FLAGS}
-   -DCMAKE_SHARED_LINKER_FLAGS:STRING=${CMAKE_SHARED_LINKER_FLAGS}
-   -DCMAKE_STATIC_LINKER_FLAGS:STRING=${CMAKE_STATIC_LINKER_FLAGS}
-   )
-
 ExternalProject_Add(MUPARSERX
   PREFIX MUPARSERX
   URL "https://github.com/beltoforion/muparserx/archive/v4.0.7.zip"
@@ -31,7 +21,6 @@
   DOWNLOAD_DIR ${DOWNLOAD_LOCATION}
   CMAKE_CACHE_ARGS
   ${SB_CMAKE_CACHE_ARGS}
-  ${MUPARSERX_SB_COMPILATION_FLAGS}
   ${MUPARSERX_FLAGS}
   CMAKE_COMMAND ${SB_CMAKE_COMMAND}
   DEPENDS ${MUPARSERX_DEPENDENCIES}
@@ -39,3 +28,5 @@

 #Patch mpParserMessageProvider.cpp. This patch is integrated upstream but not yet released (last release is 4.0.7)
 SUPERBUILD_PATCH_SOURCE(MUPARSERX)
+
+SUPERBUILD_UPDATE_CMAKE_VARIABLES(MUPARSERX FALSE)


[cmake] fixes tbb debug mode linking

[cmake] fixes tbb debug mode linking

--- cmake/modules/DuneStuffMacros.cmake
+++ cmake/modules/DuneStuffMacros.cmake
@@ -146,7 +146,7 @@
 find_package(TBB)
 if(TBB_FOUND)
   if(CMAKE_BUILD_TYPE MATCHES DEBUG)
-    list(APPEND DUNE_DEFAULT_LIBS "${TBB_DEBUG_LIBRARIES}")
+    list(APPEND DUNE_DEFAULT_LIBS "${TBB_LIBRARIES}" "${TBB_DEBUG_LIBRARIES}")
   elseif(CMAKE_BUILD_TYPE MATCHES DEBUG)
     list(APPEND DUNE_DEFAULT_LIBS "${TBB_LIBRARIES}")
   endif(CMAKE_BUILD_TYPE MATCHES DEBUG)


fix for bug #2989199. Avoid "There is already a project called Winhelp" error message when generating visual studio projects on Windows.

--- cmake_modules/CMakeUseDoxygen.cmake
+++ cmake_modules/CMakeUseDoxygen.cmake
@@ -86,8 +86,8 @@
         SET (TMP "${DOXYGEN_BINARY}\\Doc\\html\\index.hhp")
         STRING(REGEX REPLACE "[/]" "\\\\" HHP_FILE ${TMP} )
         # MESSAGE(SEND_ERROR "DBG  HHP_FILE=${HHP_FILE}")
-        ADD_CUSTOM_TARGET(winhelp ${HTML_HELP_COMPILER} ${HHP_FILE})
-        ADD_DEPENDENCIES (winhelp doc)
+        ADD_CUSTOM_TARGET(winhelp_${DOXYGEN_TARGET_NAME} ${HTML_HELP_COMPILER} ${HHP_FILE})
+        ADD_DEPENDENCIES (winhelp_${DOXYGEN_TARGET_NAME} ${DOXYGEN_TARGET_NAME})

         IF (NOT TARGET_DOC_SKIP_INSTALL)
         # install windows help?


fptu-cmake: fallback to '%ci' if '%cI' not available from git < 2.0

--- cmake.fptu/utils.cmake
+++ cmake.fptu/utils.cmake
@@ -61,7 +61,14 @@
       WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
       RESULT_VARIABLE rc)
     if(rc OR "${name}_GIT_TIMESTAMP" STREQUAL "%cI")
-      message(FATAL_ERROR "Please install latest version of git ('show --no-patch --format=%cI HEAD' failed)")
+      execute_process(COMMAND ${GIT} show --no-patch --format=%ci HEAD
+        OUTPUT_VARIABLE ${name}_GIT_TIMESTAMP
+        OUTPUT_STRIP_TRAILING_WHITESPACE
+        WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+        RESULT_VARIABLE rc)
+      if(rc OR "${name}_GIT_TIMESTAMP" STREQUAL "%ci")
+        message(FATAL_ERROR "Please install latest version of git ('show --no-patch --format=%cI HEAD' failed)")
+      endif()
     endif()

     execute_process(COMMAND ${GIT} show --no-patch --format=%T HEAD


update FindCyclus.cmake to find gtest locally first

--- cmake/FindCyclus.cmake
+++ cmake/FindCyclus.cmake
@@ -75,8 +75,9 @@

 # Look for the library
 FIND_LIBRARY(CYCLUS_GTEST_LIBRARY NAMES gtest
-    HINTS "${CYCLUS_ROOT_DIR}" "${CYCLUS_ROOT_DIR}/cyclus"
-    "${CYCLUS_ROOT_DIR}/lib"  "${CYCLUS_CORE_SHARE_DIR}/../lib"
+    HINTS "${CYCLUS_ROOT_DIR}/lib/cyclus"
+    "${CYCLUS_ROOT_DIR}" "${CYCLUS_ROOT_DIR}/cyclus"
+    "${CYCLUS_ROOT_DIR}/lib"  "${CYCLUS_CORE_SHARE_DIR}/../lib"
     /usr/local/cyclus/lib /usr/local/cyclus
     /opt/local/lib /opt/local/cyclus/lib
     PATH_SUFFIXES cyclus/lib lib)
@@ -86,12 +87,12 @@
         AND CYCLUS_CORE_LIBRARY AND CYCLUS_GTEST_LIBRARY AND CYCLUS_CORE_SHARE_DIR
         AND CYCLUS_AGENT_TEST_LIBRARY)
     SET(CYCLUS_CORE_FOUND 1)
-    SET(CYCLUS_CORE_LIBRARIES ${CYCLUS_CORE_LIBRARY})
-    SET(CYCLUS_TEST_LIBRARIES ${CYCLUS_GTEST_LIBRARY} ${CYCLUS_AGENT_TEST_LIBRARY})
-    SET(CYCLUS_AGENT_TEST_LIBRARIES ${CYCLUS_AGENT_TEST_LIBRARY})
+    SET(CYCLUS_CORE_LIBRARIES "${CYCLUS_CORE_LIBRARY}")
+    SET(CYCLUS_TEST_LIBRARIES "${CYCLUS_GTEST_LIBRARY}" "${CYCLUS_AGENT_TEST_LIBRARY}")
+    SET(CYCLUS_AGENT_TEST_LIBRARIES "${CYCLUS_AGENT_TEST_LIBRARY}")
     SET(CYCLUS_CORE_INCLUDE_DIRS "${CYCLUS_CORE_INCLUDE_DIR}")
     SET(CYCLUS_CORE_TEST_INCLUDE_DIRS "${CYCLUS_CORE_TEST_INCLUDE_DIR}")
-    SET(CYCLUS_CORE_SHARE_DIRS ${CYCLUS_CORE_SHARE_DIR})
+    SET(CYCLUS_CORE_SHARE_DIRS "${CYCLUS_CORE_SHARE_DIR}")
     SET(CYCLUS_DEFAULT_TEST_DRIVER "${CYCLUS_CORE_SHARE_DIR}/cyclus_default_unit_test_driver.cc")
 ELSE()
     SET(CYCLUS_CORE_FOUND 0)
@@ -128,7 +129,7 @@
         MESSAGE(STATUS "${CYCLUS_CORE_DIR_MESSAGE}")
         MESSAGE(STATUS "CYCLUS_CORE_SHARE_DIR was set to : ${CYCLUS_CORE_SHARE_DIR}")
         MESSAGE(STATUS "CYCLUS_CORE_LIBRARY was set to : ${CYCLUS_CORE_LIBRARY}")
-        MESSAGE(STATUS "CYCLUS_TEST_LIBRARIES was set to : ${CYCLUS_GTEST_LIBRARIES}")
+        MESSAGE(STATUS "CYCLUS_TEST_LIBRARIES was set to : ${CYCLUS_GTEST_LIBRARY}")
         IF(Cyclus_FIND_REQUIRED)
             MESSAGE(FATAL_ERROR "${cyclus_DIR_MESSAGE}")
         ENDIF(Cyclus_FIND_REQUIRED)


Fix: Feel sorry to last commit

Fix: Feel sorry to last commit

--- CMake/Modules/FindLua.cmake
+++ CMake/Modules/FindLua.cmake
@@ -1,188 +0,0 @@
-# Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
-# file Copyright.txt or https://cmake.org/licensing for details.
-
-#.rst:
-# FindLua
-# -------
-#
-#
-#
-# Locate Lua library This module defines
-#
-# ::
-#
-#   LUA_FOUND          - if false, do not try to link to Lua
-#   LUA_LIBRARIES      - both lua and lualib
-#   LUA_INCLUDE_DIR    - where to find lua.h
-#   LUA_VERSION_STRING - the version of Lua found
-#   LUA_VERSION_MAJOR  - the major version of Lua
-#   LUA_VERSION_MINOR  - the minor version of Lua
-#   LUA_VERSION_PATCH  - the patch version of Lua
-#
-#
-#
-# Note that the expected include convention is
-#
-# ::
-#
-#   #include "lua.h"
-#
-# and not
-#
-# ::
-#
-#   #include <lua/lua.h>
-#
-# This is because, the lua location is not standardized and may exist in
-# locations other than lua/
-
-unset(_lua_include_subdirs)
-unset(_lua_library_names)
-unset(_lua_append_versions)
-
-# this is a function only to have all the variables inside go away automatically
-function(_lua_set_version_vars)
-    set(LUA_VERSIONS5 5.3 5.2 5.1 5.0)
-
-    if (Lua_FIND_VERSION_EXACT)
-        if (Lua_FIND_VERSION_COUNT GREATER 1)
-            set(_lua_append_versions ${Lua_FIND_VERSION_MAJOR}.${Lua_FIND_VERSION_MINOR})
-        endif ()
-    elseif (Lua_FIND_VERSION)
-        # once there is a different major version supported this should become a loop
-        if (NOT Lua_FIND_VERSION_MAJOR GREATER 5)
-            if (Lua_FIND_VERSION_COUNT EQUAL 1)
-                set(_lua_append_versions ${LUA_VERSIONS5})
-            else ()
-                foreach (subver IN LISTS LUA_VERSIONS5)
-                    if (NOT subver VERSION_LESS ${Lua_FIND_VERSION})
-                        list(APPEND _lua_append_versions ${subver})
-                    endif ()
-                endforeach ()
-            endif ()
-        endif ()
-    else ()
-        # once there is a different major version supported this should become a loop
-        set(_lua_append_versions ${LUA_VERSIONS5})
-    endif ()
-
-    list(APPEND _lua_include_subdirs "include/lua" "include")
-
-    foreach (ver IN LISTS _lua_append_versions)
-        string(REGEX MATCH "^([0-9]+)\\.([0-9]+)$" _ver "${ver}")
-        list(APPEND _lua_include_subdirs
-             include/lua${CMAKE_MATCH_1}${CMAKE_MATCH_2}
-             include/lua${CMAKE_MATCH_1}.${CMAKE_MATCH_2}
-             include/lua-${CMAKE_MATCH_1}.${CMAKE_MATCH_2}
-        )
-        list(APPEND _lua_library_names
-             lua${CMAKE_MATCH_1}${CMAKE_MATCH_2}
-             lua${CMAKE_MATCH_1}.${CMAKE_MATCH_2}
-             lua-${CMAKE_MATCH_1}.${CMAKE_MATCH_2}
-             lua.${CMAKE_MATCH_1}.${CMAKE_MATCH_2}
-        )
-    endforeach ()
-
-    set(_lua_include_subdirs "${_lua_include_subdirs}" PARENT_SCOPE)
-    set(_lua_library_names "${_lua_library_names}" PARENT_SCOPE)
-    set(_lua_append_versions "${_lua_append_versions}" PARENT_SCOPE)
-endfunction(_lua_set_version_vars)
-
-function(_lua_check_header_version _hdr_file)
-    # At least 5.[012] have different ways to express the version
-    # so all of them need to be tested. Lua 5.2 defines LUA_VERSION
-    # and LUA_RELEASE as joined by the C preprocessor, so avoid those.
-    file(STRINGS "${_hdr_file}" lua_version_strings
-         REGEX "^#define[ \t]+LUA_(RELEASE[ \t]+\"Lua [0-9]|VERSION([ \t]+\"Lua [0-9]|_[MR])).*")
-
-    string(REGEX REPLACE ".*;#define[ \t]+LUA_VERSION_MAJOR[ \t]+\"([0-9])\"[ \t]*;.*" "\\1" LUA_VERSION_MAJOR ";${lua_version_strings};")
-    if (LUA_VERSION_MAJOR MATCHES "^[0-9]+$")
-        string(REGEX REPLACE ".*;#define[ \t]+LUA_VERSION_MINOR[ \t]+\"([0-9])\"[ \t]*;.*" "\\1" LUA_VERSION_MINOR ";${lua_version_strings};")
-        string(REGEX REPLACE ".*;#define[ \t]+LUA_VERSION_RELEASE[ \t]+\"([0-9])\"[ \t]*;.*" "\\1" LUA_VERSION_PATCH ";${lua_version_strings};")
-        set(LUA_VERSION_STRING "${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}.${LUA_VERSION_PATCH}")
-    else ()
-        string(REGEX REPLACE ".*;#define[ \t]+LUA_RELEASE[ \t]+\"Lua ([0-9.]+)\"[ \t]*;.*" "\\1" LUA_VERSION_STRING ";${lua_version_strings};")
-        if (NOT LUA_VERSION_STRING MATCHES "^[0-9.]+$")
-            string(REGEX REPLACE ".*;#define[ \t]+LUA_VERSION[ \t]+\"Lua ([0-9.]+)\"[ \t]*;.*" "\\1" LUA_VERSION_STRING ";${lua_version_strings};")
-        endif ()
-        string(REGEX REPLACE "^([0-9]+)\\.[0-9.]*$" "\\1" LUA_VERSION_MAJOR "${LUA_VERSION_STRING}")
-        string(REGEX REPLACE "^[0-9]+\\.([0-9]+)[0-9.]*$" "\\1" LUA_VERSION_MINOR "${LUA_VERSION_STRING}")
-        string(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]).*" "\\1" LUA_VERSION_PATCH "${LUA_VERSION_STRING}")
-    endif ()
-    foreach (ver IN LISTS _lua_append_versions)
-        if (ver STREQUAL "${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}")
-            set(LUA_VERSION_MAJOR ${LUA_VERSION_MAJOR} PARENT_SCOPE)
-            set(LUA_VERSION_MINOR ${LUA_VERSION_MINOR} PARENT_SCOPE)
-            set(LUA_VERSION_PATCH ${LUA_VERSION_PATCH} PARENT_SCOPE)
-            set(LUA_VERSION_STRING ${LUA_VERSION_STRING} PARENT_SCOPE)
-            return()
-        endif ()
-    endforeach ()
-endfunction(_lua_check_header_version)
-
-_lua_set_version_vars()
-
-if (LUA_INCLUDE_DIR AND EXISTS "${LUA_INCLUDE_DIR}/lua.h")
-    _lua_check_header_version("${LUA_INCLUDE_DIR}/lua.h")
-endif ()
-
-if (NOT LUA_VERSION_STRING)
-    foreach (subdir IN LISTS _lua_include_subdirs)
-        unset(LUA_INCLUDE_PREFIX CACHE)
-        find_path(LUA_INCLUDE_PREFIX ${subdir}/lua.h
-          HINTS
-            ENV LUA_DIR
-          PATHS
-          ~/Library/Frameworks
-          /Library/Frameworks
-          /sw # Fink
-          /opt/local # DarwinPorts
-          /opt/csw # Blastwave
-          /opt
-        )
-        if (LUA_INCLUDE_PREFIX)
-            _lua_check_header_version("${LUA_INCLUDE_PREFIX}/${subdir}/lua.h")
-            if (LUA_VERSION_STRING)
-                set(LUA_INCLUDE_DIR "${LUA_INCLUDE_PREFIX}/${subdir}")
-                break()
-            endif ()
-        endif ()
-    endforeach ()
-endif ()
-unset(_lua_include_subdirs)
-unset(_lua_append_versions)
-
-find_library(LUA_LIBRARY
-  NAMES ${_lua_library_names} lua
-  HINTS
-    ENV LUA_DIR
-  PATH_SUFFIXES lib
-  PATHS
-  ~/Library/Frameworks
-  /Library/Frameworks
-  /sw
-  /opt/local
-  /opt/csw
-  /opt
-)
-unset(_lua_library_names)
-
-if (LUA_LIBRARY)
-    # include the math library for Unix
-    if (UNIX AND NOT APPLE AND NOT BEOS)
-        find_library(LUA_MATH_LIBRARY m)
-        set(LUA_LIBRARIES "${LUA_LIBRARY};${LUA_MATH_LIBRARY}")
-    # For Windows and Mac, don't need to explicitly include the math library
-    else ()
-        set(LUA_LIBRARIES "${LUA_LIBRARY}")
-    endif ()
-endif ()
-
-include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
-# handle the QUIETLY and REQUIRED arguments and set LUA_FOUND to TRUE if
-# all listed variables are TRUE
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(Lua
-                                  REQUIRED_VARS LUA_LIBRARIES LUA_INCLUDE_DIR
-                                  VERSION_VAR LUA_VERSION_STRING)
-
-mark_as_advanced(LUA_INCLUDE_DIR LUA_LIBRARY LUA_MATH_LIBRARY)


Add CBSE-templates to cmake DEPENDS, to force regeneration on template change

--- cmake/DaemonCBSE.cmake
+++ cmake/DaemonCBSE.cmake
@@ -49,6 +49,10 @@
         OUTPUT ${GENERATED_CBSE}
         COMMENT "Generating CBSE entities for ${definition}"
         DEPENDS ${definition}
+                ${CMAKE_SOURCE_DIR}/src/utils/cbse/templates/Backend.cpp
+                ${CMAKE_SOURCE_DIR}/src/utils/cbse/templates/Backend.h
+                ${CMAKE_SOURCE_DIR}/src/utils/cbse/templates/Component.cpp
+                ${CMAKE_SOURCE_DIR}/src/utils/cbse/templates/Component.h
         WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/src/utils/cbse
         COMMAND
                 ${PYTHON_EXECUTABLE}


add openssl if available

add openssl if available

--- cmake/FindLIBZIP.cmake
+++ cmake/FindLIBZIP.cmake
@@ -16,6 +16,7 @@

 find_package(ZLIB REQUIRED)
 find_package(BZip2)
+find_package(OpenSSL COMPONENTS Crypto SSL)

 find_path(LIBZIP_INCLUDE_DIR NAMES zip.h)
 mark_as_advanced(LIBZIP_INCLUDE_DIR)
@@ -48,6 +49,9 @@
         if (BZip2_FOUND)
             list(APPEND INTERFACE_LINK_LIBRARIES BZip2::BZip2)
         endif()
+         if (OpenSSL_FOUND)
+            list(APPEND INTERFACE_LINK_LIBRARIES OpenSSL::SSL OpenSSL::Crypto)
+        endif()
         set_property(TARGET  LIBZIP::LIBZIP
                 APPEND
                 PROPERTY INTERFACE_LINK_LIBRARIES


Add version mapping for MATLAB R2016a

Add version mapping for MATLAB R2016a

--- cmake/FindMatlab.cmake
+++ cmake/FindMatlab.cmake
@@ -251,6 +251,7 @@
 endif()

 set(MATLAB_VERSIONS_MAPPING
+  "R2016a=9.0"
   "R2015b=8.6"
   "R2015a=8.5"
   "R2014b=8.4"


Improved check for ZeroMQ: check version too

ZeroMQ is enabled by default if the correct version is found. If a ZeroMQ path
is explicitly passed and it is not found there, CMake now stops with a fatal
error. If ZeroMQ is not found but was not requested explicitly, support is
disabled but bootstrap continues. Version number is parsed from the headers.

--- cmake/FindZeroMQ.cmake
+++ cmake/FindZeroMQ.cmake
@@ -13,60 +13,88 @@
 # * provided "as is" without express or implied warranty.                  *
 # **************************************************************************

-# Checks for a ZeroMQ installation
-# ZeroMQ custom installation can be pointed using -DZEROMQ
-#       - ZEROMQ_INCLUDE_DIR - Where to find zeromq include sub-directory.
-#       - ZEROMQ_LIBRARIES   - List of libraries when using zeromq.
-#       - ZEROMQ_FOUND       - True if zeromq found.
+# Checks for a ZeroMQ installation. Enables ZeroMQ by default if found on the
+# system and with the right version.
+#
+# Point to a custom ZeroMQ installation with -DZEROMQ=<path>: in that case, if
+# ZeroMQ is not found or has not the right version, a fatal error is raised.
+#
+# Variables set:
+#
+#  - ZEROMQ_FOUND          True if ZeroMQ is found
+#  - ZEROMQ_INCLUDE_DIR    Where to find ZeroMQ include directory
+#  - ZEROMQ_LIBRARIES      List of libraries when using ZeroMQ
+#  - ZEROMQ_VERSION        ZeroMQ version, major.minor.patches
+#  - ZEROMQ_VERSION_MAJOR  Major component of version
+#  - ZEROMQ_VERSION_MINOR  Minor component of version
+#  - ZEROMQ_VERSION_MAJOR  Patches component of version
+
+set(ZEROMQ_VERSION_MIN "4.0.0")

 message(STATUS "Checking for ZeroMQ ${ZEROMQ}")

 set(ZEROMQ_FOUND FALSE)

 if(ZEROMQ)
-    # ZeroMQ is installed in a custom place
-    find_library(ZEROMQ_LIBRARIES NAMES zmq
-                PATHS ${ZEROMQ}/lib
-                NO_DEFAULT_PATH
-                DOC "Path to libzmq)"
-            )
-    find_path(ZEROMQ_INCLUDE_DIR NAMES zmq.h zmq_utils.h zmq.hpp
-                PATHS ${ZEROMQ}/include
-                NO_DEFAULT_PATH
-                DOC "Path to ZeroMQ include header files."
-            )
-else(ZEROMQ)
-    # Check is the library is installed on the system
-    find_library(ZEROMQ_LIBRARIES NAMES zmq
-                DOC "Path to libzmq)"
-            )
-
-    find_path(ZEROMQ_INCLUDE_DIR NAMES zmq.hpp zmq_utils.h
-                DOC "Path to ZeroMQ include header files."
-            )
-endif(ZEROMQ)
+  # Custom ZeroMQ installation specified.
+  find_library(ZEROMQ_LIBRARIES NAMES zmq
+                                PATHS ${ZEROMQ}/lib ${ZEROMQ}/lib/x86_64-linux-gnu
+                                NO_DEFAULT_PATH
+                                DOC "Path to libzmq.")
+  find_path(ZEROMQ_INCLUDE_DIR NAMES zmq.h zmq_utils.h zmq.hpp
+                               PATHS ${ZEROMQ}/include
+                               NO_DEFAULT_PATH
+                               DOC "Path to ZeroMQ include header files.")
+else()
+  # No custom ZeroMQ specified. Searching for ZeroMQ system-wide.
+  find_library(ZEROMQ_LIBRARIES NAMES zmq
+                                DOC "Path to libzmq.")
+  find_path(ZEROMQ_INCLUDE_DIR NAMES zmq.h zmq.hpp zmq_utils.h
+                               DOC "Path to ZeroMQ include header files.")
+endif()

 mark_as_advanced(ZEROMQ_LIBRARIES ZEROMQ_INCLUDE_DIR)

-set(ZEROMQ_DISABLED FALSE)
+# Did we find ZeroMQ? We need to parse its version.
+if(ZEROMQ_INCLUDE_DIR)
+  message(STATUS "ZeroMQ include path: ${ZEROMQ_INCLUDE_DIR}")
+endif()
+if(ZEROMQ_LIBRARIES)
+  message(STATUS "ZeroMQ libraries: ${ZEROMQ_LIBRARIES}")
+endif()
+if(ZEROMQ_INCLUDE_DIR AND ZEROMQ_LIBRARIES)
+  file(READ "${ZEROMQ_INCLUDE_DIR}/zmq.h" zmqh)

-if(NOT ZEROMQ_LIBRARIES)
-    message(STATUS "ZeroMQ library not found. Disabling ZeroMQ support")
-    set(ZEROMQ_DISABLED TRUE)
+  string(REGEX MATCH "#define +ZMQ_VERSION_MAJOR +([0-9]+)" zmqv "${zmqh}")
+  set(ZEROMQ_VERSION_MAJOR "${CMAKE_MATCH_1}")
+  string(REGEX MATCH "#define +ZMQ_VERSION_MINOR +([0-9]+)" zmqv "${zmqh}")
+  set(ZEROMQ_VERSION_MINOR "${CMAKE_MATCH_1}")
+  string(REGEX MATCH "#define +ZMQ_VERSION_PATCH +([0-9]+)" zmqv "${zmqh}")
+  set(ZEROMQ_VERSION_PATCH "${CMAKE_MATCH_1}")
+
+  unset(zmqh)
+  unset(zmqv)
+
+  set(ZEROMQ_VERSION "${ZEROMQ_VERSION_MAJOR}.${ZEROMQ_VERSION_MINOR}.${ZEROMQ_VERSION_PATCH}")
+  message(STATUS "ZeroMQ version: ${ZEROMQ_VERSION}")
+
+  if(ZEROMQ_VERSION VERSION_GREATER "${ZEROMQ_VERSION_MIN}")
+    # Version OK.
+    set(ZEROMQ_FOUND TRUE)
+    add_definitions(-DZMQ)
+    message(STATUS "ZeroMQ version ${ZEROMQ_VERSION} (> ${ZEROMQ_VERSION_MIN}) found")
+  elseif(ZEROMQ)
+    # Version not OK and explicitly requested: fatal.
+    message(FATAL_ERROR "ZeroMQ in ${ZEROMQ} has version ${ZEROMQ_VERSION} <= ${ZEROMQ_VERSION_MIN}")
+  else()
+    message(STATUS "ZeroMQ found but version ${ZEROMQ_VERSION} <= ${ZEROMQ_VERSION_MIN}. Disabling ZeroMQ support.")
+  endif()
+elseif(ZEROMQ)
+  # ZeroMQ not found and explicitly requested: fatal.
+  message(FATAL_ERROR "ZeroMQ not found in ${ZEROMQ}.")
+elseif(ZEROMQ_LIBRARIES)
+  # ZeroMQ libraries found in system, but headers were not.
+  message(STATUS "ZeroMQ headers not found. Please install the development package and the cppzmq interface. Disabling ZeroMQ support.")
+else()
+  message(STATUS "ZeroMQ not found. Disabling ZeroMQ support.")
 endif()
-
-if(NOT ZEROMQ_INCLUDE_DIR AND NOT ZEROMQ_DISABLED)
-    message(STATUS "ZeroMQ headers not found. Please install development package + cppzmq interface. Disabling ZeroMQ support")
-    set(ZEROMQ_DISABLED TRUE)
-endif()
-
-if(ZEROMQ_LIBRARIES AND ZEROMQ_INCLUDE_DIR)
-    message(STATUS "Found ZeroMQ ${ZEROMQ_LIBRARIES}")
-    set(ZEROMQ_FOUND TRUE)
-endif()
-
-if(ZEROMQ_FOUND)
-    add_definitions(-DZMQ)
-ENDIF(ZEROMQ_FOUND)
-
-


cmake: Extend cc-option support to C++

cmake: Extend cc-option support to C++

The target_cc_option[_fallback]() CMake extentions are now C++
aware. This means that they will now test options with both C and C++
compiler and include flags appropriately.

This fixes a warning that was issued when -Wno-pointer-sign was used
 with .cpp files.

cc1plus: warning: command line option ‘-Wno-pointer-sign’ is valid for
C/ObjC but not for C++

NB: This patch is designed to only affect CONFIG_CPLUSPLUS builds in
case there are any adverse affects with using generator expressions.

Signed-off-by: Sebastian Bøe <edee888afd63e94916688495334700803eba20a0@nordicsemi.no>

--- cmake/extensions.cmake
+++ cmake/extensions.cmake
@@ -644,6 +644,8 @@
 #
 # lang must be C or CXX
 #
+# TODO: Support ASM
+#
 # Usage:
 #
 # check_compiler_flag(C "-Wall" my_check)
@@ -667,20 +669,36 @@
 endfunction()

 function(target_cc_option target scope option)
-  string(MAKE_C_IDENTIFIER check${option} check)
-  check_c_compiler_flag(${option} ${check})
-  target_compile_option_ifdef(${check} ${target} ${scope} ${option})
-endfunction()
-
-# Support an optional second option for when the first option is
-# not supported.
+  target_cc_option_fallback(${target} ${scope} ${option} "")
+endfunction()
+
+# Support an optional second option for when the first option is not
+# supported.
 function(target_cc_option_fallback target scope option1 option2)
-  string(MAKE_C_IDENTIFIER check${option1} check)
-  check_c_compiler_flag(${option1} ${check})
-  if(${check})
-    target_compile_options(${target} ${scope} ${option1})
+  if(CONFIG_CPLUSPLUS)
+    foreach(lang C CXX)
+      # For now, we assume that all flags that apply to C/CXX also
+      # apply to ASM.
+      check_compiler_flag(${lang} ${option1} check)
+      if(${check})
+        target_compile_options(${target} ${scope}
+          $<$<COMPILE_LANGUAGE:${lang}>:${option1}>
+          $<$<COMPILE_LANGUAGE:ASM>:${option1}>
+          )
+      elseif(option2)
+        target_compile_options(${target} ${scope}
+          $<$<COMPILE_LANGUAGE:${lang}>:${option2}>
+          $<$<COMPILE_LANGUAGE:ASM>:${option2}>
+          )
+      endif()
+    endforeach()
   else()
-    target_compile_options(${target} ${scope} ${option2})
+    check_compiler_flag(C ${option1} check)
+    if(${check})
+      target_compile_options(${target} ${scope} ${option1})
+    elseif(option2)
+      target_compile_options(${target} ${scope} ${option2})
+    endif()
   endif()
 endfunction()


Added missing unsets

Added missing unsets

--- cmake/nvcc-check.cmake
+++ cmake/nvcc-check.cmake
@@ -16,11 +16,13 @@
 # Return the result in argument 1, empty if not found
 FUNCTION(FIND_GCC GCC_PATH GCC_MAJOR GCC_MINOR)
   # Search for gcc-x.y
+  UNSET(EXACT_GCC)
   FIND_PROGRAM(EXACT_GCC "gcc-${GCC_MAJOR}.${GCC_MINOR}")
   IF(EXACT_GCC)
     SET(GCC_PATH "${EXACT_GCC}" PARENT_SCOPE)
   ELSE(EXACT_GCC)
     # gcc-x.y not found, check default gcc
+    UNSET(DEFAULT_GCC)
     FIND_PROGRAM(DEFAULT_GCC gcc)
     EXEC_PROGRAM(${DEFAULT_GCC} ARGS "-dumpversion" OUTPUT_VARIABLE GCCVER)


cmake: use symbol export lists

cmake: use symbol export lists

--- cmake/DPF-plugin.cmake
+++ cmake/DPF-plugin.cmake
@@ -206,6 +206,7 @@

   dpf__add_module("${NAME}-ladspa" ${_no_srcs})
   dpf__add_plugin_main("${NAME}-ladspa" "ladspa")
+  dpf__set_module_export_list("${NAME}-ladspa" "ladspa")
   target_link_libraries("${NAME}-ladspa" PRIVATE "${NAME}-dsp")
   set_target_properties("${NAME}-ladspa" PROPERTIES
     LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/bin/$<0:>"
@@ -234,6 +235,7 @@

   dpf__add_module("${NAME}-dssi" ${_no_srcs})
   dpf__add_plugin_main("${NAME}-dssi" "dssi")
+  dpf__set_module_export_list("${NAME}-dssi" "dssi")
   target_link_libraries("${NAME}-dssi" PRIVATE "${NAME}-dsp")
   set_target_properties("${NAME}-dssi" PROPERTIES
     LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/bin/$<0:>"
@@ -264,6 +266,11 @@

   dpf__add_module("${NAME}-lv2" ${_no_srcs})
   dpf__add_plugin_main("${NAME}-lv2" "lv2")
+  if(DGL_LIBRARY AND MONOLITHIC)
+    dpf__set_module_export_list("${NAME}-lv2" "lv2")
+  else()
+    dpf__set_module_export_list("${NAME}-lv2" "lv2-dsp")
+  endif()
   target_link_libraries("${NAME}-lv2" PRIVATE "${NAME}-dsp")
   set_target_properties("${NAME}-lv2" PROPERTIES
     LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/bin/${NAME}.lv2/$<0:>"
@@ -280,6 +287,7 @@
     else()
       dpf__add_module("${NAME}-lv2-ui" ${_no_srcs})
       dpf__add_ui_main("${NAME}-lv2-ui" "lv2" "${DGL_LIBRARY}")
+      dpf__set_module_export_list("${NAME}-lv2-ui" "lv2-ui")
       target_link_libraries("${NAME}-lv2-ui" PRIVATE "${NAME}-ui")
       set_target_properties("${NAME}-lv2-ui" PROPERTIES
         LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/bin/${NAME}.lv2/$<0:>"
@@ -311,6 +319,7 @@
   dpf__add_module("${NAME}-vst2" ${_no_srcs})
   dpf__add_plugin_main("${NAME}-vst2" "vst2")
   dpf__add_ui_main("${NAME}-vst2" "vst2" "${DGL_LIBRARY}")
+  dpf__set_module_export_list("${NAME}-vst2" "vst2")
   target_link_libraries("${NAME}-vst2" PRIVATE "${NAME}-dsp" "${NAME}-ui")
   set_target_properties("${NAME}-vst2" PROPERTIES
     LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/bin/$<0:>"
@@ -566,6 +575,24 @@
   dpf__set_target_defaults("${NAME}")
 endfunction()

+# dpf__set_module_export_list
+# ------------------------------------------------------------------------------
+#
+# Applies a list of exported symbols to the module target.
+#
+function(dpf__set_module_export_list NAME EXPORTS)
+  if(WIN32)
+    target_sources("${NAME}" PRIVATE "${DPF_ROOT_DIR}/utils/symbols/${EXPORTS}.def")
+  elseif(APPLE)
+    set_property(TARGET "${NAME}" APPEND PROPERTY LINK_OPTIONS
+      "-Xlinker" "-exported_symbols_list"
+      "-Xlinker" "${DPF_ROOT_DIR}/utils/symbols/${EXPORTS}.exp")
+  else()
+    set_property(TARGET "${NAME}" APPEND PROPERTY LINK_OPTIONS
+      "-Xlinker" "--version-script=${DPF_ROOT_DIR}/utils/symbols/${EXPORTS}.version")
+  endif()
+endfunction()
+
 # dpf__set_target_defaults
 # ------------------------------------------------------------------------------
 #


Added instlling of the main .h file of the module.

--- cmake/ROCSMacros.cmake
+++ cmake/ROCSMacros.cmake
@@ -72,6 +72,7 @@

 	# Install
 	install(TARGETS rocs_${ARG_NAME} LIBRARY DESTINATION ${ROCS_DIR}/lib ARCHIVE DESTINATION lib)
+	install(FILES cpp/rocs/${ARG_NAME}.h DESTINATION ${ROCS_DIR}/include/rocs)
 	install(FILES ${_HEADERS_} DESTINATION ${ROCS_DIR}/include/rocs/${ARG_NAME})

 	# Make the module available to others


warn about need for instrumented libs when MSan is used with clang

when clang is invoked with -fsanitize=memory, all libraries, including
the standard library has to be built with that instrumentation to avoid
false positives

https://github.com/google/sanitizers/wiki/MemorySanitizerLibcxxHowTo

--- cmake/Sanitizers.cmake
+++ cmake/Sanitizers.cmake
@@ -36,6 +36,7 @@

     option(ENABLE_SANITIZER_MEMORY "Enable memory sanitizer" FALSE)
     if(ENABLE_SANITIZER_MEMORY AND CMAKE_CXX_COMPILER_ID MATCHES ".*Clang")
+      message(WARNING "Memory sanitizer reports false positives when running against libraries that are not MSan-instrumented (including libc++)")
       if("address" IN_LIST SANITIZERS
          OR "thread" IN_LIST SANITIZERS
          OR "leak" IN_LIST SANITIZERS)


Fix accidental disabling of ASAN

Fix accidental disabling of ASAN

--- cmake/Sanitizers.cmake
+++ cmake/Sanitizers.cmake
@@ -9,14 +9,14 @@
       target_link_libraries(project_options INTERFACE --coverage)
     endif()

+    set(SANITIZERS "")
+
     option(ENABLE_SANITIZER_ADDRESS "Enable address sanitizer" FALSE)
-    set(SANITIZERS "")
     if(ENABLE_SANITIZER_ADDRESS)
       list(APPEND SANITIZERS "address")
     endif()

     option(ENABLE_SANITIZER_MEMORY "Enable memory sanitizer" FALSE)
-    set(SANITIZERS "")
     if(ENABLE_SANITIZER_MEMORY)
       list(APPEND SANITIZERS "memory")
     endif()


move UseDoxygen from navier/stokes

move UseDoxygen from navier/stokes

--- cmake/UseDoxygen.cmake
+++ cmake/UseDoxygen.cmake
@@ -1,3 +1,26 @@
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# 1. Redistributions of source code must retain the copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+# 3. The name of the author may not be used to endorse or promote products
+#    derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
 # - Run Doxygen
 #
 # Adds a doxygen target that runs doxygen to generate the html


Disable checking -Wzero-as-null-pointer-constant.

Qt use zero in the autogenerated files, so we have huge such warnings.

--- cmake/build_type.cmake
+++ cmake/build_type.cmake
@@ -27,7 +27,7 @@
     set ( CMAKE_BUILD_TYPE Release )
 endif (NOT CMAKE_BUILD_TYPE)

-set(CMAKE_CXX_FLAGS "-Wall -Wextra -Wzero-as-null-pointer-constant -Wpedantic ${CMAKE_CXX_FLAGS}")
+set(CMAKE_CXX_FLAGS "-Wall -Wextra -Wpedantic ${CMAKE_CXX_FLAGS}")
 set(CMAKE_CXX_FLAGS_DEBUG "-g ${CMAKE_CXX_FLAGS_DEBUG}")
 set(CMAKE_CXX_FLAGS_RELEASE "-O2 -DNDEBUG ${CMAKE_CXX_FLAGS_RELEASE}")


Added a fix for if there is no tag in the history, shouldn't happen after some point...

--- cmake/versioning.cmake
+++ cmake/versioning.cmake
@@ -15,6 +15,9 @@
     OUTPUT_VARIABLE TABLE_VERSION
     OUTPUT_STRIP_TRAILING_WHITESPACE
     )
+  if (TABLE_VERSION STREQUAL "")
+    set(TABLE_VERSION "0.0.0")
+  endif()
   string(REGEX REPLACE "^([0-9]+)\\..*" "\\1" TABLE_MAJOR_VERSION "${TABLE_VERSION}")
   string(REGEX REPLACE "^[0-9]+\\.([0-9]+).*" "\\1" TABLE_MINOR_VERSION "${TABLE_VERSION}")
   string(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1" TABLE_PATCH_VERSION "${TABLE_VERSION}")


Fix dependency typo in V2X path.

Fix dependency typo in V2X path.

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

--- common/cmake/v2x.cmake
+++ common/cmake/v2x.cmake
@@ -193,7 +193,7 @@
     OUTPUT "${YOSYS_OUTPUT_BLIF}"
     DEPENDS
       ${YOSYS} ${YOSYS_TARGET}
-      ${DEPENS_EBLIF} ${TECHMAP_DEP}
+      ${DEPENDS_EBLIF} ${TECHMAP_DEP}
     COMMAND
     ${YOSYS} -p "read_verilog ${PB_TYPE_VERILOG}\; hierarchy -top ${VPR_TEST_PB_TYPE_TOP_MODULE}\; techmap -map ${PB_TYPE_TECHMAP}\; flatten\; proc\; opt\; write_blif ${YOSYS_OUTPUT_BLIF}"
     WORKING_DIRECTORY


FIX: FindPythonModule.cmake not found behaviour

--- cmake/Modules/FindPythonModule.cmake
+++ cmake/Modules/FindPythonModule.cmake
@@ -5,7 +5,7 @@
 	string(TOUPPER ${module} module_upper)
 	if(NOT PY_${module_upper})
 		if(ARGC GREATER 1 AND ARGV1 STREQUAL "REQUIRED")
-			set(${module}_FIND_REQUIRED TRUE)
+			set(PY_${module}_FIND_REQUIRED TRUE)
 		endif()
 		# A module's location is usually a directory, but for binary modules
 		# it's a .so file.


Adapt the build options to the current state of ROOT on Windows

--- cmake/modules/RootBuildOptions.cmake
+++ cmake/modules/RootBuildOptions.cmake
@@ -188,6 +188,14 @@
   set(x11_defvalue OFF)
   set(memstat_defvalue OFF)
   set(davix_defvalue OFF)
+  set(cxx11_defvalue OFF)
+  set(cxx14_defvalue ON)
+  set(root7_defvalue ON)
+  set(imt_defvalue OFF)
+  set(builtin_tbb_defvalue OFF)
+  set(tmva_defvalue OFF)
+  set(roottest_defvalue OFF)
+  set(testing_defvalue OFF)
 elseif(APPLE)
   set(x11_defvalue OFF)
   set(cocoa_defvalue ON)


[cmake] Disable xrootd on windows

[cmake] Disable xrootd on windows

--- cmake/modules/RootBuildOptions.cmake
+++ cmake/modules/RootBuildOptions.cmake
@@ -303,6 +303,7 @@
   set(tmva_defvalue OFF)
   set(vdt_defvalue OFF)
   set(x11_defvalue OFF)
+  set(xrootd_defvalue OFF)
 elseif(APPLE)
   set(cocoa_defvalue ON)
   set(runtime_cxxmodules_defvalue OFF)


enable XP_USE_LATEST_NODE cmake option, default OFF

--- projects/use/usexp-node-config.cmake
+++ projects/use/usexp-node-config.cmake
@@ -8,9 +8,8 @@
 get_filename_component(XP_ROOTDIR ${CMAKE_CURRENT_LIST_DIR}/../.. ABSOLUTE)
 get_filename_component(XP_ROOTDIR ${XP_ROOTDIR} ABSOLUTE) # remove relative parts
 string(TOUPPER ${prj} PRJ)
-set(XP_USE_LATEST_NODE ON)
 if(NOT DEFINED XP_USE_LATEST_NODE)
-  option(XP_USE_LATEST_NODE "build with node @NODE_NEWVER@ instead of @NODE_OLDVER@" ON)
+  option(XP_USE_LATEST_NODE "build with node @NODE_NEWVER@ instead of @NODE_OLDVER@" OFF)
 endif()
 if(XP_USE_LATEST_NODE)
   set(ver @NODE_NEWVER@)


ulp: fix ulp external project args

ulp: fix ulp external project args

Closes https://github.com/espressif/esp-idf/issues/4713

--- components/ulp/project_include.cmake
+++ components/ulp/project_include.cmake
@@ -47,10 +47,9 @@
             INSTALL_COMMAND ""
             CMAKE_ARGS  -DCMAKE_GENERATOR=${CMAKE_GENERATOR}
                         -DCMAKE_TOOLCHAIN_FILE=${TOOLCHAIN_FLAG}
-                        -DULP_S_SOURCES=${sources} -DULP_APP_NAME=${app_name}
+                        -DULP_S_SOURCES=$<TARGET_PROPERTY:${app_name},ULP_SOURCES>
+                        -DULP_APP_NAME=${app_name}
                         -DCOMPONENT_DIR=${COMPONENT_DIR}
-                        # Even though this resolves to a ';' separated list, this is fine. This must be special behavior
-                        # for generator expressions.
                         -DCOMPONENT_INCLUDES=$<TARGET_PROPERTY:${COMPONENT_TARGET},INTERFACE_INCLUDE_DIRECTORIES>
                         -DIDF_PATH=${idf_path}
                         -DSDKCONFIG=${SDKCONFIG_HEADER}
@@ -60,8 +59,9 @@
             BUILD_BYPRODUCTS ${ulp_artifacts} ${ulp_artifacts_extras} ${ulp_ps_sources}
                             ${CMAKE_CURRENT_BINARY_DIR}/${app_name}/${app_name}
             BUILD_ALWAYS 1
-            LIST_SEPARATOR |
             )
+
+        set_property(TARGET ${app_name} PROPERTY ULP_SOURCES "${sources}")

         spaces2list(exp_dep_srcs)
         set_source_files_properties(${exp_dep_srcs} PROPERTIES OBJECT_DEPENDS ${ulp_artifacts})


Fix code_coverage target for correct results

--- cmake/AddCodeCoverage.cmake
+++ cmake/AddCodeCoverage.cmake
@@ -66,6 +66,13 @@
         COMMAND ${LCOV_COMMAND}
             --zerocounters
             --directory .
+        COMMAND ${LCOV_COMMAND}
+            --capture
+            --initial
+            --gcov-tool ${GCOV_COMMAND}
+            --base-directory ${CMAKE_SOURCE_DIR}
+            --directory .
+            --output-file coverage.base
         COMMAND ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR} --target test
         COMMAND ${LCOV_COMMAND}
             --capture
@@ -74,11 +81,14 @@
             --directory .
             --output-file coverage.run
         COMMAND ${LCOV_COMMAND}
+            --add-tracefile coverage.base
+            --add-tracefile coverage.run
+            --output-file coverage.total
+        COMMAND ${LCOV_COMMAND}
             --gcov-tool ${GCOV_COMMAND}
-            --base-directory ${CMAKE_SOURCE_DIR}
-            --extract coverage.run */src/*.cpp
-            --extract coverage.run */src/*.hpp
-            --extract coverage.run */include/utest/*.hpp
+            --extract coverage.total */src/*.cpp
+            --extract coverage.total */src/*.hpp
+            --extract coverage.total */include/utest/*.hpp
             --output-file coverage.info
         COMMAND ${GENHTML_COMMAND}
             --legend


fficonfig: Fix HAVE_AS_CFI_PSEUDO_OP test

This commit basically integrates the existing test found
in Modules/_ctypes/libffi/configure.

On Ubuntu 15.10 using g++ 5.2.1 20151010, it gives the expected
result:

[...]
-- Checking whether assembler supports .cfi_* directives
-- Checking whether assembler supports .cfi_* directives - yes
[...]

--- cmake/ConfigureChecks.cmake
+++ cmake/ConfigureChecks.cmake
@@ -1019,9 +1019,9 @@

 # libffi specific: Check whether assembler supports .cfi_* directives
 set(check_src ${PROJECT_BINARY_DIR}/CMakeFiles/have_as_cfi_pseudo_op.c)
-file(WRITE ${check_src} "int main() {
-    __asm__ __volatile__ (\".cfi_startproc\n\t.cfi_endproc\");
-}
+file(WRITE ${check_src} "
+asm(\".cfi_startproc\\n\\t.cfi_endproc\");
+int main (){return 0;}
 ")
 python_platform_test(
   HAVE_AS_CFI_PSEUDO_OP


Remove -Wfloat-equal

Remove -Wfloat-equal

--- cmake/DevBaseCompiler.cmake
+++ cmake/DevBaseCompiler.cmake
@@ -65,7 +65,7 @@
     # -Wconversion
     # -Wsign-conversion
     set(CMAKE_CXX_FLAGS
-        "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wpedantic -Wcast-qual -Wwrite-strings -Werror=strict-aliasing -fno-strict-overflow -ftemplate-backtrace-limit=0 -Wfloat-equal"
+        "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wpedantic -Wcast-qual -Wwrite-strings -Werror=strict-aliasing -fno-strict-overflow -ftemplate-backtrace-limit=0"
     )

     # This results in an error on mingw/gcc 4.8/windows. Some warning about


Use RPATH by default for build and install trees

Change-Id: Ic6ce227d54c16cd5eaf4e2482f761dd248cc723e

--- cmake/InstallLocation.cmake
+++ cmake/InstallLocation.cmake
@@ -22,3 +22,14 @@
 if(NOT INSTALL_DOC_DIR)
   set(INSTALL_DOC_DIR "doc")
 endif()
+
+# Set up RPATH for the project too.
+option(ENABLE_RPATH "Enable rpath support on Linux and Mac" ON)
+if(UNIX AND ENABLE_RPATH)
+  if(APPLE)
+    set(CMAKE_INSTALL_NAME_DIR "@executable_path/../${INSTALL_LIBRARY_DIR}")
+  endif()
+  set(CMAKE_SKIP_BUILD_RPATH FALSE)
+  set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
+  set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
+endif()


Remove SSL from PETSc configuration

Remove SSL from PETSc configuration

--- cmake/ThirdPartyPETSc.cmake
+++ cmake/ThirdPartyPETSc.cmake
@@ -40,6 +40,7 @@
                 --with-shared-libraries=0
                 --with-pic=1
                 --with-x=0
+                --with-ssl=0
                 --prefix=${TPDIST}
                 --with-petsc-arch=c-opt
                 --with-fc=0


* Speculative shader path logic fix, which fixes an issue where engine-side demos/tests etc couldn't be built from a game build directory

--- cmake/shader_compiler.cmake
+++ cmake/shader_compiler.cmake
@@ -66,11 +66,11 @@
 			add_shader_vulkan()
 		endif()
 		# `output_path` is the path to the built shader (i.e glsl (ogl) or spv (vk)).
-		STRING(REGEX REPLACE "^${CMAKE_SOURCE_DIR}/" "" built_shader_offset_path ${output_path})
+		STRING(REGEX REPLACE "^${PROJECT_BINARY_DIR}/" "" built_shader_offset_path ${output_path})
 		add_text(
 			TARGET ${ADD_SHADER_TARGET}
-			INPUT_DIR ${PROJECT_SOURCE_DIR}
-			OUTPUT_DIR ${PROJECT_SOURCE_DIR}
+			INPUT_DIR ${PROJECT_BINARY_DIR}
+			OUTPUT_DIR ${PROJECT_BINARY_DIR}
 			TEXT_FILES ${built_shader_offset_path}
 		)


[Platform-Android]: Link GLES3 Library.

[Platform-Android]: Link GLES3 Library.

--- SPEC_PSXPC_N/PLATFORM/Android.cmake
+++ SPEC_PSXPC_N/PLATFORM/Android.cmake
@@ -6,13 +6,13 @@

 set(SDL2MAIN_LIBRARY SDL2main)
 set(SDL2_LIBRARY SDL2)
-#set(GLES3_LIBRARY GLESv2)
+set(GLES3_LIBRARY GLESv3)
 set(EGL_LIBRARY EGL)

 target_link_libraries(${PROJECT_NAME}
   ${SDL2MAIN_LIBRARY}
   ${SDL2_LIBRARY}
-#  ${GLES3_LIBRARY}
+  ${GLES3_LIBRARY}
   ${EGL_LIBRARY}
 )


Reorganize flags

Reorganize flags

Former-commit-id: e7ec94a54150641d478296b27c621fde1d2ec436

--- cmake-modules/CompilerFlags.cmake
+++ cmake-modules/CompilerFlags.cmake
@@ -51,14 +51,15 @@
 # The bug was hard to track down, and could be fixed by various other flags that
 # hurt performance more, like -mno-avx, removing -DNDEBUG, or lowering -O3 to -O2.
 ######################################################################################
+
 if(CXX_MARCH)
     message(STATUS "Using microarchitechture: ${CXX_MARCH}")
     list(APPEND CMAKE_CXX_FLAGS            -march=${CXX_MARCH} -mtune=${CXX_MARCH})
 endif()

 list(APPEND CMAKE_CXX_FLAGS                )
-list(APPEND CMAKE_CXX_FLAGS_RELEASE  -g -O3 -fno-omit-frame-pointer -fno-strict-aliasing -fstack-protector -D_FORTIFY_SOURCE=2 -Wall -Wextra -Wpedantic)
-list(APPEND CMAKE_CXX_FLAGS_DEBUG    -g -O0 -fno-omit-frame-pointer -fno-strict-aliasing -fstack-protector -D_FORTIFY_SOURCE=2 -Wall -Wextra -Wpedantic) #-D_GLIBCXX_DEBUG -D_GLIBCXX_DEBUG_PEDANTIC
+list(APPEND CMAKE_CXX_FLAGS_RELEASE  -g -O3 -fno-strict-aliasing -Wall -Wextra -Wpedantic)
+list(APPEND CMAKE_CXX_FLAGS_DEBUG    -g -O0 -fno-strict-aliasing -Wall -Wextra -Wpedantic -fstack-protector -D_FORTIFY_SOURCE=2 -fno-omit-frame-pointer) #-D_GLIBCXX_DEBUG -D_GLIBCXX_DEBUG_PEDANTIC
 list(APPEND CMAKE_CXX_FLAGS_RELWITHDEBINFO )
 list(APPEND CMAKE_CXX_FLAGS_MINSIZEREL)


[cmake] Do NOT strip full paths:

[cmake] Do NOT strip full paths:

It is essential to keep the notion of non-relocatable headers, passed to
ROOT_GENERATE_DICTIONARY with full paths. The dictionary will remember them
with their original location, making sure that headers can be found at
runtime without -I or $ROOT_INCLUDE_PATH.

ROOT's headers will never be passed as full path; users as well as ROOT
itself (in contrast to the non-relocatable roottest) MUST pass relative
paths, as if they were to #include the header, together with a matching -I.

--- cmake/modules/RootNewMacros.cmake
+++ cmake/modules/RootNewMacros.cmake
@@ -242,10 +242,6 @@
           list(APPEND _list_of_header_dependencies ${f})
         endif()
       endforeach()
-    elseif(IS_ABSOLUTE ${fp})
-      string(REGEX REPLACE "^${CMAKE_CURRENT_SOURCE_DIR}/" "" fp_no_csd ${fp})
-      list(APPEND headerfiles ${fp_no_csd})
-      list(APPEND _list_of_header_dependencies ${fp})
     else()
       find_file(headerFile ${fp} HINTS ${incdirs} NO_DEFAULT_PATH NO_SYSTEM_ENVIRONMENT_PATH)
       if(NOT headerFile)
@@ -878,10 +874,10 @@
 #---ROOT_STANDARD_LIBRARY_PACKAGE(libname
 #                                 [NO_INSTALL_HEADERS]         : don't install headers for this package
 #                                 [STAGE1]                     : use rootcling_stage1 for generating
-#                                 HEADERS header1 header2      : if not specified, globbing for *.h is used)
+#                                 HEADERS header1 header2      : relative header path as #included; pass -I to find them. If not specified, globbing for *.h is used
 #                                 NODEPHEADERS header1 header2 : like HEADERS, but no dependency is generated
 #                                 [NO_HEADERS]                 : don't glob to fill HEADERS variable
-#                                 SOURCES source1 source2      : if not specified, globbing for *.cxx is used)
+#                                 SOURCES source1 source2      : if not specified, globbing for *.cxx is used
 #                                 [NO_SOURCES]                 : don't glob to fill SOURCES variable
 #                                 [OBJECT_LIBRARY]             : use ROOT_OBJECT_LIBRARY to generate object files
 #                                                                and then use those for linking.


PS-5110: Fix configuration error with MySQL 8.0.16

"-lpthread" is passed as a dependency to to library merge functions,
causing a CMake error because of a non existent target. This patch
excludes anything that isn't a target, fixing this issue.

--- cmake_modules/TokuMergeLibs.cmake
+++ cmake_modules/TokuMergeLibs.cmake
@@ -6,7 +6,7 @@
   IF(deps)
    FOREACH(lib ${deps})
     # Filter out keywords for used for debug vs optimized builds
-    IF(NOT lib MATCHES "general" AND NOT lib MATCHES "debug" AND NOT lib MATCHES "optimized")
+    IF(TARGET ${lib})
       GET_TARGET_PROPERTY(lib_location ${lib} LOCATION)
       IF(NOT lib_location)
         SET(ret ${ret} ${lib})


Added additional cmake variable for specific include paths

--- test/cmake/base.cmake
+++ test/cmake/base.cmake
@@ -2,6 +2,7 @@
 target_link_libraries(${TESTNAME} QMetaOrm ${EXTRA_LIBS})
 target_compile_features(${TESTNAME} PRIVATE ${NEEDED_FEATURES})
 target_include_directories(${TESTNAME} PRIVATE
+							${EXTRA_INCLUDEPATHS}
                             ${CMAKE_CURRENT_BINARY_DIR}
                             ${CMAKE_CURRENT_SOURCE_DIR}/../../include)


ThriftCppLibrary.cmake: fixup deps

ThriftCppLibrary.cmake: fixup deps

Summary:
this adds the include and library dirs for generated thrift targets;
these are important when those dependencies are not installed into a default
prefix.

Reviewed By: strager

Differential Revision: D14683957

fbshipit-source-id: ed47ffac5c8732810afe77e6947584b7a2f05155

--- build/fbcode_builder/CMake/ThriftCppLibrary.cmake
+++ build/fbcode_builder/CMake/ThriftCppLibrary.cmake
@@ -107,11 +107,14 @@
     PUBLIC
       ${CMAKE_SOURCE_DIR}
       ${CMAKE_BINARY_DIR}
+      ${FOLLY_INCLUDE_DIR}
+      ${FBTHRIFT_INCLUDE_DIR}
   )
   target_link_libraries(
     ${LIB_NAME}
     PUBLIC
       ${DEPENDS}
       FBThrift::thriftcpp2
+      Folly::folly
   )
 endfunction()


Fixed Ubx CMake find script.

Fixed Ubx CMake find script.

--- external/cmake_modules/FindUbx.cmake
+++ external/cmake_modules/FindUbx.cmake
@@ -0,0 +1,64 @@
+# - Try to find the Microblox (=UBX) library
+# Once done this will define
+#
+#  UBX_FOUND - if UBX was found
+#  UBX_INCLUDE_DIR - the UBX include directory (-I)
+#  UBX_LINK_DIRECTORIES - the UBX linker directories (-L)
+#  UBX_LIBRARIES - UBX libraries
+#
+# You can set an environment variable "UBX_ROOT" to help CMake to find the UBX library,
+# in case it is not installed in one of the standard paths.
+#
+# Authors: Sabastian Blumenthal, Enea Scioni
+#
+
+FIND_PATH(UBX_INCLUDE_DIR NAMES ubx.h
+  PATHS
+  $ENV{UBX_ROOT}/src
+  ENV CPATH
+  /usr/include/
+  /usr/local/include/
+  NO_DEFAULT_PATH
+)
+
+FIND_LIBRARY(UBX_LIBRARY NAMES "ubx"
+  PATHS
+  $ENV{UBX_ROOT}/src
+  $ENV{UBX_ROOT}/lib
+  ENV LD_LIBRARY_PATH
+  ENV LIBRARY_PATH
+  /usr/lib
+  /usr/local/lib
+  NO_DEFAULT_PATH
+)
+
+IF(UBX_LIBRARY)
+  GET_FILENAME_COMPONENT(UBX_LINK_DIRECTORIES ${UBX_LIBRARY} PATH CACHE)
+ENDIF(UBX_LIBRARY)
+
+
+SET(UBX_LIBRARIES_TMP
+)
+
+
+IF(UBX_LIBRARY)
+  SET(UBX_LIBRARIES
+    ${UBX_LIBRARY}
+    CACHE STRING "Microblx library"
+  )
+ENDIF(UBX_LIBRARY)
+
+
+
+
+
+include(FindPackageHandleStandardArgs)
+# handle the QUIETLY and REQUIRED arguments and set UBX_FOUND to TRUE
+# if all listed variables are TRUE
+find_package_handle_standard_args(UBX  DEFAULT_MSG
+                                  UBX_INCLUDE_DIR UBX_LINK_DIRECTORIES UBX_LIBRARIES)
+
+# show the UBX_INCLUDE_DIR and UBX_LIBRARIES variables only in the advanced view
+IF(UBX_FOUND)
+  MARK_AS_ADVANCED(UBX_INCLUDE_DIR UBX_LINK_DIRECTORIES UBX_LIBRARIES)
+ENDIF(UBX_FOUND)


Generate .wasm files as part of contracts/ build

--- CMakeModules/wasm.cmake
+++ CMakeModules/wasm.cmake
@@ -157,6 +157,16 @@
     VERBATIM
   )
   set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES ${target}.wast)
+
+  add_custom_command(OUTPUT ${DESTINATION_FOLDER}/${target}.wasm
+    DEPENDS ${target}.wast
+    COMMAND $<TARGET_FILE:eosio-wast2wasm> ${DESTINATION_FOLDER}/${target}.wast ${DESTINATION_FOLDER}/${target}.wasm -n
+    COMMENT "Generating WASM ${target}.wasm"
+    WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+    VERBATIM
+  )
+  set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES ${target}.wasm)
+
   STRING (REPLACE "." "_" TARGET_VARIABLE "${target}")

   add_custom_command(OUTPUT ${DESTINATION_FOLDER}/${target}.wast.hpp
@@ -183,6 +193,7 @@
   endif()

   add_custom_target(${target} ALL DEPENDS ${DESTINATION_FOLDER}/${target}.wast.hpp ${extra_target_dependency})
+  add_custom_target(${target}_wasm ALL DEPENDS ${DESTINATION_FOLDER}/${target}.wasm)

   set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES ${DESTINATION_FOLDER}/${target}.wast.hpp)


minor formatting for multi-line cmake calls


temporary hack removed

temporary hack removed

--- CMakeModules/wasm.cmake
+++ CMakeModules/wasm.cmake
@@ -147,7 +147,7 @@
 endmacro(add_wast_library)

 macro(add_wast_executable)
-  cmake_parse_arguments(ARG "" "TARGET;DESTINATION_FOLDER" "SOURCE_FILES;INCLUDE_FOLDERS;LIBRARIES;EXTERNAL_LIBRARIES" ${ARGN})
+  cmake_parse_arguments(ARG "" "TARGET;DESTINATION_FOLDER" "SOURCE_FILES;INCLUDE_FOLDERS;LIBRARIES" ${ARGN})
   set(target ${ARG_TARGET})
   set(DESTINATION_FOLDER ${ARG_DESTINATION_FOLDER})

@@ -156,10 +156,9 @@
   foreach(lib ${ARG_LIBRARIES})
      list(APPEND LIBRARIES ${${lib}_BC_FILENAME})
   endforeach()
-message("${target} DEPENDS ${outfiles} ${ARG_LIBRARIES} ${LIBRARIES}")
   add_custom_command(OUTPUT ${target}.bc
     DEPENDS ${outfiles} "${ARG_LIBRARIES}" ${LIBRARIES}
-    COMMAND ${WASM_LLVM_LINK} -only-needed -o ${target}.bc ${outfiles} ${LIBRARIES} ${ARG_EXTERNAL_LIBRARIES} ${LIBRARIES}
+    COMMAND ${WASM_LLVM_LINK} -only-needed -o ${target}.bc ${outfiles} ${LIBRARIES}
     COMMENT "Linking LLVM bitcode executable ${target}.bc"
     WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
     VERBATIM


COMP: Wrap Image< bool, D > for FlatStructuringElement.

This addresses:

  /home/kevin/kitware/ITK_Build/Wrapping/Modules/ITKMathematicalMorphology/itkFlatStructuringElement.xml:
  warning(4): ITK type not wrapped, or currently not known: itk::Image< bool,
  2 >
  /home/kevin/kitware/ITK_Build/Wrapping/Modules/ITKMathematicalMorphology/itkFlatStructuringElement.xml:
  warning(4): ITK type not wrapped, or currently not known: itk::Image< bool,
  3 >

introduced in 5a7b3ea33cf0f9b31f6dd97b82b0ab6152e15546.

Change-Id: Ie6e6a9834157f0dfb73a7b457aaa57c48b95ba78

--- Wrapping/WrapITKTypes.cmake
+++ Wrapping/WrapITKTypes.cmake
@@ -205,8 +205,8 @@
 WRAP_TYPE("itk::Image" "I")
   # Make a list of all of the selected image pixel types and also double (for
   # BSplineDeformableTransform), uchar (for 8-bit image output), ulong
-  # (for the watershed and relabel filters)
-  UNIQUE(wrap_image_types "${WRAP_ITK_ALL_TYPES};D;UC;UL;RGBUC;RGBAUC;VD")
+  # (for the watershed and relabel filters), bool for (FlatStructuringElement)
+  UNIQUE(wrap_image_types "${WRAP_ITK_ALL_TYPES};D;UC;UL;RGBUC;RGBAUC;VD;B")

   set(defined_vector_list )
   foreach(d ${ITK_WRAP_IMAGE_DIMS})


i#3272: fix DynamoRIO_get_full_path in Windows (#3273)

Fix how the target path is derived differently on Windows if target is a shared .dll library. This fixes a DrM test when pulling in the recent DR version.

Fixes #3272

--- make/utils_exposed.cmake
+++ make/utils_exposed.cmake
@@ -170,15 +170,28 @@
       set(suffix ${CMAKE_${target_type}_SUFFIX})
     endif ()
     set(output_dir "")
-    if (target_type STREQUAL "SHARED_LIBRARY" OR target_type STREQUAL "MODULE_LIBRARY")
-      get_target_property(library_dir ${target} LIBRARY_OUTPUT_DIRECTORY${loc_suffix})
-      set(output_dir ${library_dir})
-    elseif (target_type STREQUAL "STATIC_LIBRARY")
-      get_target_property(archive_dir ${target} ARCHIVE_OUTPUT_DIRECTORY${loc_suffix})
-      set(output_dir ${archive_dir})
-    elseif (target_type STREQUAL "EXECUTABLE")
-      get_target_property(runtime_dir ${target} RUNTIME_OUTPUT_DIRECTORY${loc_suffix})
-      set(output_dir ${runtime_dir})
+    if (WIN32)
+      if (target_type STREQUAL "MODULE_LIBRARY")
+        get_target_property(library_dir ${target} LIBRARY_OUTPUT_DIRECTORY${loc_suffix})
+        set(output_dir ${library_dir})
+      elseif (target_type STREQUAL "STATIC_LIBRARY")
+        get_target_property(archive_dir ${target} ARCHIVE_OUTPUT_DIRECTORY${loc_suffix})
+        set(output_dir ${archive_dir})
+      elseif (target_type STREQUAL "EXECUTABLE" OR target_type STREQUAL "SHARED_LIBRARY")
+        get_target_property(runtime_dir ${target} RUNTIME_OUTPUT_DIRECTORY${loc_suffix})
+        set(output_dir ${runtime_dir})
+      endif ()
+    else ()
+      if (target_type STREQUAL "SHARED_LIBRARY" OR target_type STREQUAL "MODULE_LIBRARY")
+        get_target_property(library_dir ${target} LIBRARY_OUTPUT_DIRECTORY${loc_suffix})
+        set(output_dir ${library_dir})
+      elseif (target_type STREQUAL "STATIC_LIBRARY")
+        get_target_property(archive_dir ${target} ARCHIVE_OUTPUT_DIRECTORY${loc_suffix})
+        set(output_dir ${archive_dir})
+      elseif (target_type STREQUAL "EXECUTABLE")
+        get_target_property(runtime_dir ${target} RUNTIME_OUTPUT_DIRECTORY${loc_suffix})
+        set(output_dir ${runtime_dir})
+      endif ()
     endif ()
     if (output_name)
       set(${out} "${output_dir}/${prefix}${output_name}${suffix}" PARENT_SCOPE)