22778: [CEA 1298] Python file compilation should be done at build time, not install time

--- salome_adm/cmake_files/SalomeMacros.cmake
+++ salome_adm/cmake_files/SalomeMacros.cmake
@@ -120,10 +120,25 @@
     INSTALL(FILES ${PREFIX}${file} DESTINATION ${path} PERMISSIONS ${PERMS})
     GET_FILENAME_COMPONENT(ext ${file} EXT)
     IF(ext STREQUAL .py)
-      INSTALL(CODE "MESSAGE(STATUS \"py compiling ${CMAKE_INSTALL_PREFIX}/${path}/${file_name}\")")
-      INSTALL(CODE "SET(CMD \"import py_compile ; py_compile.compile('${CMAKE_INSTALL_PREFIX}/${path}/${file_name}')\")")
-      INSTALL(CODE "EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c \"\${CMD}\")")
-      INSTALL(CODE "EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -O -c \"\${CMD}\")")
+      # FILE TIMESTAMP command appears in cmake-2.8.11
+      IF(${CMAKE_VERSION} VERSION_LESS "2.8.11")
+        INSTALL(CODE "MESSAGE(STATUS \"py compiling ${CMAKE_INSTALL_PREFIX}/${path}/${file_name}\")")
+        INSTALL(CODE "SET(CMD \"import py_compile ; py_compile.compile('${CMAKE_INSTALL_PREFIX}/${path}/${file_name}')\")")
+        INSTALL(CODE "EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c \"\${CMD}\")")
+        INSTALL(CODE "EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -O -c \"\${CMD}\")")
+      ELSE(${CMAKE_VERSION} VERSION_LESS "2.8.11")
+        GET_FILENAME_COMPONENT(file_we ${file_name} NAME_WE)
+        INSTALL(CODE "SET(CMD \"import py_compile ; py_compile.compile('${CMAKE_INSTALL_PREFIX}/${path}/${file_name}')\")")
+        INSTALL(CODE "FILE(TIMESTAMP \"${CMAKE_CURRENT_SOURCE_DIR}/${file}\"            py_time)")
+        INSTALL(CODE "FILE(TIMESTAMP \"${CMAKE_INSTALL_PREFIX}/${path}/${file_we}.pyc\" pyc_time)")
+        INSTALL(CODE "FILE(TIMESTAMP \"${CMAKE_INSTALL_PREFIX}/${path}/${file_we}.pyo\" pyo_time)")
+        #INSTALL(CODE "MESSAGE(STATUS \"\${py_time} \${pyc_time} \")")
+        INSTALL(CODE "STRING(COMPARE LESS \${pyc_time} \${py_time} to_install_pyc)")
+        INSTALL(CODE "STRING(COMPARE LESS \${pyo_time} \${py_time} to_install_pyo)")
+        INSTALL(CODE "IF (\${to_install_pyc} OR \${to_install_pyo}) \n MESSAGE(STATUS \"py compiling ${CMAKE_INSTALL_PREFIX}/${path}/${file_name}\") \n ENDIF()")
+        INSTALL(CODE "IF (\${to_install_pyc}) \n EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c \"\${CMD}\") \n ENDIF()")
+        INSTALL(CODE "IF (\${to_install_pyo}) \n EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -O -c \"\${CMD}\") \n ENDIF()")
+      ENDIF(${CMAKE_VERSION} VERSION_LESS "2.8.11")
     ENDIF(ext STREQUAL .py)
   ENDFOREACH(file ${file_list})
 ENDMACRO(SALOME_INSTALL_SCRIPTS)


cmake: improve warning deprecation message

The current deprecation warning could give the impression that
CROSS_COMPILE is deprecated, which is not the case.

Instead it is the behavior of defaulting to `cross-compile` when
setting CROSS_COMPILE in environment without setting
ZEPHYR_TOOLCHAIN_VARIANT that is deprecated.
Not the use of `CROSS_COMPILE` setting itself.

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

--- cmake/modules/FindDeprecated.cmake
+++ cmake/modules/FindDeprecated.cmake
@@ -62,7 +62,9 @@
   if(NOT ZEPHYR_TOOLCHAIN_VARIANT AND
      (CROSS_COMPILE OR (DEFINED ENV{CROSS_COMPILE})))
       set(ZEPHYR_TOOLCHAIN_VARIANT cross-compile CACHE STRING "Zephyr toolchain variant" FORCE)
-      message(DEPRECATION  "CROSS_COMPILE is deprecated. Please set ZEPHYR_TOOLCHAIN_VARIANT to 'cross-compile'")
+      message(DEPRECATION  "Setting CROSS_COMPILE without setting ZEPHYR_TOOLCHAIN_VARIANT is deprecated."
+                           "Please set ZEPHYR_TOOLCHAIN_VARIANT to 'cross-compile'"
+      )
   endif()
 endif()


cmake/modules: do not require server headers in FindPostgreSQL.cmake

ROOT only uses client headers, but the module considers PostgreSQL
not found if server headers are not found.

--- cmake/modules/FindPostgreSQL.cmake
+++ cmake/modules/FindPostgreSQL.cmake
@@ -84,17 +84,12 @@
         "PostgreSQL/${suffix}/lib")
     list(APPEND PostgreSQL_INCLUDE_ADDITIONAL_SEARCH_SUFFIXES
         "PostgreSQL/${suffix}/include")
-    list(APPEND PostgreSQL_TYPE_ADDITIONAL_SEARCH_SUFFIXES
-        "PostgreSQL/${suffix}/include/server")
   endif()
   if(UNIX)
     list(APPEND PostgreSQL_LIBRARY_ADDITIONAL_SEARCH_SUFFIXES
         "pgsql-${suffix}/lib")
     list(APPEND PostgreSQL_INCLUDE_ADDITIONAL_SEARCH_SUFFIXES
         "pgsql-${suffix}/include")
-    list(APPEND PostgreSQL_TYPE_ADDITIONAL_SEARCH_SUFFIXES
-        "postgresql/${suffix}/server"
-        "pgsql-${suffix}/include/server")
   endif()
 endforeach()

@@ -111,21 +106,6 @@
     postgresql
     include
     ${PostgreSQL_INCLUDE_ADDITIONAL_SEARCH_SUFFIXES}
-  # Help the user find it if we cannot.
-  DOC "The ${PostgreSQL_INCLUDE_DIR_MESSAGE}"
-)
-
-find_path(PostgreSQL_TYPE_INCLUDE_DIR
-  NAMES catalog/pg_type.h
-  PATHS
-   # Look in other places.
-   ${PostgreSQL_ROOT_DIRECTORIES}
-  PATH_SUFFIXES
-    postgresql
-    pgsql/server
-    postgresql/server
-    include/server
-    ${PostgreSQL_TYPE_ADDITIONAL_SEARCH_SUFFIXES}
   # Help the user find it if we cannot.
   DOC "The ${PostgreSQL_INCLUDE_DIR_MESSAGE}"
 )
@@ -173,15 +153,15 @@
 # Did we find anything?
 include(FindPackageHandleStandardArgs)
 find_package_handle_standard_args(PostgreSQL
-                                  REQUIRED_VARS PostgreSQL_LIBRARY PostgreSQL_INCLUDE_DIR PostgreSQL_TYPE_INCLUDE_DIR
+                                  REQUIRED_VARS PostgreSQL_LIBRARY PostgreSQL_INCLUDE_DIR
                                   VERSION_VAR PostgreSQL_VERSION_STRING)
 set(PostgreSQL_FOUND  ${POSTGRESQL_FOUND})

 # Now try to get the include and library path.
 if(PostgreSQL_FOUND)
-  set(PostgreSQL_INCLUDE_DIRS ${PostgreSQL_INCLUDE_DIR} ${PostgreSQL_TYPE_INCLUDE_DIR} )
+  set(PostgreSQL_INCLUDE_DIRS ${PostgreSQL_INCLUDE_DIR})
   set(PostgreSQL_LIBRARY_DIRS ${PostgreSQL_LIBRARY_DIR} )
   set(PostgreSQL_LIBRARIES ${PostgreSQL_LIBRARY})
 endif()

-mark_as_advanced(PostgreSQL_INCLUDE_DIR PostgreSQL_TYPE_INCLUDE_DIR PostgreSQL_LIBRARY )
+mark_as_advanced(PostgreSQL_INCLUDE_DIR PostgreSQL_LIBRARY)


[cmake] installed Windows apps can now embed plugins.

plugins from Radium Bundle.

--- cmake/radium_setup_functions.cmake
+++ cmake/radium_setup_functions.cmake
@@ -65,13 +65,13 @@
         ${ARGN}
     )
     if (NOT ARGS_NAME)
-        message(FATAL_ERROR "[configure_radium_app] You must provide the main target of the application")
+        message(FATAL_ERROR "[configure_cmdline_Radium_app] You must provide the main target of the application")
     endif ()
     # configure the application
     if (APPLE)
         get_target_property(IsMacBundle ${ARGS_NAME} MACOSX_BUNDLE)
         if (IsMacBundle)
-            message(FATAL_ERROR "[configure_radium_app] Error configuring ${ARGS_NAME} as a cmdline application. A bundle was asked for this target.")
+            message(FATAL_ERROR "[configure_cmdline_Radium_app] Error configuring ${ARGS_NAME} as a cmdline application. A bundle was asked for this target.")
         endif ()
     endif ()
     # Configure the executable installation
@@ -79,31 +79,11 @@
         TARGETS ${ARGS_NAME}
         RUNTIME DESTINATION bin
         )
-    # TODO, this Windows only bundle fix might be adapted to Linux also ... perhaps with the same code ?
-    if (MSVC OR MSVC_IDE OR MINGW)
-        # Construction of the  dependency paths
-        set(FIX_LIBRARY_DIR "${CMAKE_INSTALL_PREFIX}")
-        list(APPEND FIX_LIBRARY_DIR "${RadiumDlls_Location}")
-        # Add the Qt bin dir ...
-        list(APPEND FIX_LIBRARY_DIR "${QtDlls_location}")
-        # Add the Radium externals's dll location
-        list(APPEND FIX_LIBRARY_DIR "${RadiumExternalDlls_location}")
-        list(REMOVE_DUPLICATES FIX_LIBRARY_DIR)
-        # Fix the bundled directory
-        install(CODE "message(STATUS \"Fixing application with Qt base directory at ${FIX_LIBRARY_DIR} !!\")
-                       include(BundleUtilities)
-                       fixup_bundle( ${CMAKE_INSTALL_PREFIX}/bin/${ARGS_NAME}.exe \"\" \"${FIX_LIBRARY_DIR}\")
-                     "
-            )
-        if (CMAKE_BUILD_TYPE STREQUAL "Debug")
-            install(FILES $<TARGET_PDB_FILE:${ARGS_NAME}> DESTINATION bin)
-        endif()
-    endif ()
-
+
     # Configure the application own resources installation
     if (ARGS_RESOURCES)
         foreach (resLocation ${ARGS_RESOURCES})
-            message(STATUS "[configure_radium_app] Installing resources ${resLocation} for ${ARGS_NAME} ")
+            message(STATUS "[configure_cmdline_Radium_app] Installing resources ${resLocation} for ${ARGS_NAME} ")
             installTargetResources(
                 TARGET ${ARGS_NAME}
                 DIRECTORY ${resLocation}
@@ -151,12 +131,12 @@
         ${ARGN}
     )
     if (NOT ARGS_NAME)
-        message(FATAL_ERROR "[configure_radium_app] You must provide the main target of the application")
+        message(FATAL_ERROR "[configure_bundled_Radium_app] You must provide the main target of the application")
     endif ()
     # configure the application
     get_target_property(IsMacBundle ${ARGS_NAME} MACOSX_BUNDLE)
     if (NOT IsMacBundle)
-        message(FATAL_ERROR "[configure_radium_app] Error configuring ${ARGS_NAME} as a Bundled application. Only MacOsX is supported")
+        message(FATAL_ERROR "[configure_bundled_Radium_app] Error configuring ${ARGS_NAME} as a Bundled application. Only MacOsX is supported")
     endif ()

     set_target_properties(${ARGS_NAME} PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME ${ARGS_NAME})
@@ -243,7 +223,7 @@
     # Configure the resources installation
     if (ARGS_RESOURCES)
         foreach (resLocation ${ARGS_RESOURCES})
-            message(STATUS "[configure_radium_app] Installing resources ${resLocation} for ${ARGS_NAME} ")
+            message(STATUS "[configure_bundled_Radium_app] Installing resources ${resLocation} for ${ARGS_NAME} ")
             installTargetResources(
                 TARGET ${ARGS_NAME}
                 DIRECTORY ${resLocation}
@@ -504,12 +484,80 @@
     # Configure the executable installation
     install(
         TARGETS ${ARGS_NAME}
-        BUNDLE DESTINATION "bin/"
-    )
+        RUNTIME DESTINATION "bin/"
+    )
+
     message(STATUS "[configure_Windows_Radium_app] Installing  ${ARGS_NAME} (Radium dll from ${RADIUM_ROOT_DIR}/bin)")
     SET(RadiumDlls_Location ${RADIUM_ROOT_DIR}/bin)
-    configure_cmdline_Radium_app(${ARGN})
-    # install qtPlugins (QPA plugin name found here https://doc.qt.io/qt-5/qpa.html)
+
+    # Construction of the  dependency paths
+    set(FIX_LIBRARY_DIR "${CMAKE_INSTALL_PREFIX}")
+    list(APPEND FIX_LIBRARY_DIR "${RadiumDlls_Location}")
+    # Add the Qt bin dir ...
+    list(APPEND FIX_LIBRARY_DIR "${QtDlls_location}")
+    # Add the Radium externals's dll location
+    list(APPEND FIX_LIBRARY_DIR "${RadiumExternalDlls_location}")
+    list(REMOVE_DUPLICATES FIX_LIBRARY_DIR)
+
+    # build the list of resource directory from the linked libraries to copy into the bundle
+    get_target_property(linkedLibs ${ARGS_NAME} LINK_LIBRARIES)
+    set(depsRsc "")
+    foreach(lib ${linkedLibs})
+        get_target_property(rscPrefix ${lib} RADIUM_TARGET_RESOURCES_PREFIX)
+        if (NOT ${rscPrefix} STREQUAL "rscPrefix-NOTFOUND")
+            get_target_property(rscLocation ${lib} RADIUM_TARGET_INSTALLED_RESOURCES)
+            list(APPEND depsRsc ${rscLocation})
+        endif ()
+    endforeach()
+
+    #install Radium plugins
+    if (ARGS_USE_PLUGINS)
+        install(CODE "
+        message(STATUS \"Installing ${ARGS_NAME} with plugins\")
+        include(BundleUtilities)
+        set(BU_CHMOD_BUNDLE_ITEMS TRUE)
+        file(COPY ${RADIUM_RESOURCES_DIR} DESTINATION ${CMAKE_INSTALL_PREFIX})
+        set(instRsc ${depsRsc})
+        foreach( rsc \${instRsc})
+            file(COPY \${rsc} DESTINATION ${CMAKE_INSTALL_PREFIX}/Resources)
+        endforeach()
+        if (EXISTS ${RADIUM_PLUGINS_DIR})
+            if (EXISTS ${RADIUM_PLUGINS_DIR}/Resources)
+                file(COPY \"${RADIUM_PLUGINS_DIR}/Resources\" DESTINATION \"${CMAKE_INSTALL_PREFIX}\")
+            endif()
+            file(MAKE_DIRECTORY \"${CMAKE_INSTALL_PREFIX}/Plugins/lib\")
+        endif()
+        file(MAKE_DIRECTORY \"${CMAKE_INSTALL_PREFIX}/Plugins/lib\")
+        file(GLOB RadiumAvailablePlugins
+                RELATIVE ${RADIUM_PLUGINS_DIR}/lib/
+                ${RADIUM_PLUGINS_DIR}/lib/*.dll )
+        set(InstalledPlugins)
+        foreach (plugin \${RadiumAvailablePlugins})
+            file(COPY \"${RADIUM_PLUGINS_DIR}/lib/\${plugin}\" DESTINATION \"${CMAKE_INSTALL_PREFIX}/Plugins/lib\")
+            file(COPY \"${RADIUM_PLUGINS_DIR}/lib/\${plugin}\" DESTINATION \"${CMAKE_INSTALL_PREFIX}/bin\")
+            list( APPEND InstalledPlugins ${CMAKE_INSTALL_PREFIX}/Plugins/lib/\${plugin} )
+        endforeach ()
+        fixup_bundle(${CMAKE_INSTALL_PREFIX}/bin/${ARGS_NAME}.exe \"\${InstalledPlugins}\" \"${FIX_LIBRARY_DIR};${CMAKE_INSTALL_PREFIX}/Plugins/lib\")
+        ")
+    else ()
+        install(CODE "
+            message(STATUS \"Installing ${ARGS_NAME} without plugins\")
+            include(BundleUtilities)
+            set(BU_CHMOD_BUNDLE_ITEMS TRUE)
+            file(COPY ${RADIUM_RESOURCES_DIR} DESTINATION ${CMAKE_INSTALL_PREFIX})
+            set(instRsc ${depsRsc})
+            foreach( rsc \${instRsc})
+                file(COPY \${rsc} DESTINATION ${CMAKE_INSTALL_PREFIX}/Resources)
+            endforeach()
+            fixup_bundle(${CMAKE_INSTALL_PREFIX}/bin/${ARGS_NAME}.exe \"\" \"${FIX_LIBRARY_DIR}\")
+            "
+            )
+    endif ()
+    if (CMAKE_BUILD_TYPE STREQUAL "Debug")
+        install(FILES $<TARGET_PDB_FILE:${ARGS_NAME}> DESTINATION bin)
+    endif()
+
+    # deploy qt
     get_target_property(IsUsingQt ${ARGS_NAME} LINK_LIBRARIES)
     list(FIND IsUsingQt "Qt5::Core" QTCOREIDX)
     if(NOT QTCOREIDX EQUAL -1)
@@ -517,17 +565,20 @@
         windeployqt( ${ARGS_NAME} bin )
     endif()

-    #install Radium plugins
-    if (ARGS_USE_PLUGINS)
-         message(STATUS "[configure_Windows_Radium_app] Plugins are not yet supported for windows app ${ARGS_NAME} ")
-    endif ()
-    if (NOT ${RADIUM_RESOURCES_DIR} STREQUAL "${CMAKE_INSTALL_PREFIX}/Resources")
-        # Configure the resources installation
-        # TODO : do we have to call installTargetResources here ?
-        install(DIRECTORY ${RADIUM_RESOURCES_DIR}  DESTINATION ${CMAKE_INSTALL_PREFIX}/)
-    endif()
-endfunction()
-
+    # Configure the application own resources installation
+    if (ARGS_RESOURCES)
+        foreach (resLocation ${ARGS_RESOURCES})
+            message(STATUS "[configure_cmdline_Radium_app] Installing resources ${resLocation} for ${ARGS_NAME} ")
+            installTargetResources(
+                TARGET ${ARGS_NAME}
+                DIRECTORY ${resLocation}
+                PREFIX ${ARGS_PREFIX}
+                BUILD_LOCATION ${CMAKE_CURRENT_BINARY_DIR}/Resources
+            )
+        endforeach ()
+    endif ()
+
+endfunction()

 # Configuration of the build and installation procedure for Radium application
 # Allows to install application with dependent resources
@@ -615,10 +666,13 @@
     else ()
         set(${ARGS_NAME}_INSTALL_DIR ${CMAKE_INSTALL_PREFIX})
     endif ()
+    # On windows, plugins (dlls) are runtime and not libraries
     install(
         TARGETS ${ARGS_NAME}
         DESTINATION ${${ARGS_NAME}_INSTALL_DIR}
         LIBRARY DESTINATION ${${ARGS_NAME}_INSTALL_DIR}/lib
+        RUNTIME DESTINATION ${${ARGS_NAME}_INSTALL_DIR}/lib
+        ARCHIVE DESTINATION ${${ARGS_NAME}_INSTALL_DIR}/lib
     )
     # Configure the plugin helper library
     if (ARGS_HELPER_LIBS)
@@ -661,6 +715,8 @@
                 install(TARGETS ${OriginalLib}
                     DESTINATION ${${ARGS_NAME}_INSTALL_DIR}
                     LIBRARY DESTINATION ${${ARGS_NAME}_INSTALL_DIR}/lib
+                    RUNTIME DESTINATION ${${ARGS_NAME}_INSTALL_DIR}/lib
+                    ARCHIVE DESTINATION ${${ARGS_NAME}_INSTALL_DIR}/lib
                     )
             endif ()
         endforeach ()


[cmake] refactor

[cmake] refactor

 * Use local var, rename var to upcase
 * refactor if apple, add comments
 * refactor copy file loop
 * merge ifs ...
 * factorise set dir
 * use var instead of dup code

--- cmake/radium_setup_functions.cmake
+++ cmake/radium_setup_functions.cmake
@@ -368,50 +368,65 @@
     if (NOT ARGS_RESOURCES_DIR)
         message(FATAL_ERROR "[install_target_resources] You must provide a resource directory")
     endif ()
+
     if (ARGS_RESOURCES_INSTALL_DIR)
-        set(ARGS_RESOURCES_INSTALL_DIR "${ARGS_RESOURCES_INSTALL_DIR}")
+        set(RESOURCES_INSTALL_DIR "${ARGS_RESOURCES_INSTALL_DIR}")
         set_target_properties(${ARGS_TARGET}
             PROPERTIES
-            RADIUM_TARGET_RESOURCES_PREFIX ${ARGS_RESOURCES_INSTALL_DIR}
-            )
-    else()
-        set(ARGS_RESOURCES_INSTALL_DIR "")
-    endif ()
-    get_target_property(targetType ${ARGS_TARGET} TYPE)
-    # compute resources dir for build tree and install tree
-    get_filename_component(rsc_dir ${ARGS_RESOURCES_DIR} NAME)
+            RADIUM_TARGET_RESOURCES_PREFIX ${RESOURCES_INSTALL_DIR}
+            )
+    else ()
+        set(RESOURCES_INSTALL_DIR "")
+    endif ()
+
+    get_target_property(TARGET_TYPE ${ARGS_TARGET} TYPE)
+    # get resrouces last directory from ${ARGS_RESOURCES_DIR}
+    get_filename_component(RESOURCES_LAST_DIR ${ARGS_RESOURCES_DIR} NAME)

     # compute where to link the resources in the buildtree (as in a bundle : ${CMAKE_CURRENT_BINARY_DIR}/../Resources
-    if (${targetType} STREQUAL "EXECUTABLE")
+    # also set RESOURCES_DESTINATION_DIR
+    if (${TARGET_TYPE} STREQUAL "EXECUTABLE")
         if (APPLE)
-            set( buildtree_dir ${CMAKE_CURRENT_BINARY_DIR}/${ARGS_NAME}.app/Contents/Resources)
+            set(RESOURCES_DESTINATION_DIR "bin/${ARGS_TARGET}.app/Contents/Resources/")
+            set(RESOURCES_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/${ARGS_NAME}.app/Contents/Resources)
             install(CODE "
                 # remove the link installed from the build-tree to copy the corresponding resources
-                file(REMOVE_RECURSE ${CMAKE_INSTALL_PREFIX}/bin/${ARGS_TARGET}.app/Contents/Resources/${ARGS_RESOURCES_INSTALL_DIR}/${rsc_dir})
+                file(REMOVE_RECURSE ${CMAKE_INSTALL_PREFIX}/${RESOURCES_DESTINATION_DIR}/${RESOURCES_INSTALL_DIR}/${RESOURCES_LAST_DIR})
             ")
-        else()
-            set(buildtree_dir ${CMAKE_CURRENT_BINARY_DIR}/../Resources)
-        endif()
-    else()
-        set(buildtree_dir ${CMAKE_CURRENT_BINARY_DIR}/../Resources)
-    endif()
-    set(buildtree_dir "${buildtree_dir}/${ARGS_RESOURCES_INSTALL_DIR}")
+        else ()
+            set(RESOURCES_DESTINATION_DIR "Resources/")
+            set(RESOURCES_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/../Resources)
+        endif ()
+    elseif (${TARGET_TYPE} STREQUAL "SHARED_LIBRARY")
+        set(RESOURCES_DESTINATION_DIR "Resources/")
+        set(RESOURCES_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/../Resources)
+        set_target_properties(${ARGS_TARGET}
+            PROPERTIES
+            RADIUM_TARGET_INSTALLED_RESOURCES "${CMAKE_INSTALL_PREFIX}/Resources/${RESOURCES_INSTALL_DIR}"
+            )
+    else ()
+        message(FATAL_ERROR "[install_target_resources] Unknown target type ${TARGET_TYPE} for target ${ARGS_TARGET} ")
+    endif ()
+
+    # append target specific resrouces install dir
+    set(RESOURCES_DESTINATION_DIR "${RESOURCES_DESTINATION_DIR}/${RESOURCES_INSTALL_DIR}/${RESOURCES_LAST_DIR}")
+    set(RESOURCES_BINARY_DIR "${RESOURCES_BINARY_DIR}/${RESOURCES_INSTALL_DIR}")

     # installing resources in the buildtree (link if available, copy if not)
-    message(STATUS "[install_target_resources] Linking resources directory ${ARGS_RESOURCES_DIR} for target ${ARGS_TARGET} into ${buildtree_dir}/${rsc_dir}")
-    file(MAKE_DIRECTORY "${buildtree_dir}")
+    message(STATUS "[install_target_resources] BINARY_DIR Linking resources directory ${ARGS_RESOURCES_DIR} for target ${ARGS_TARGET} into ${RESOURCES_BINARY_DIR}/${RESOURCES_LAST_DIR}")
+    file(MAKE_DIRECTORY "${RESOURCES_BINARY_DIR}")
     if (MSVC OR MSVC_IDE OR MINGW)
         add_custom_command(
             TARGET ${ARGS_TARGET}
             POST_BUILD
-            COMMAND ${CMAKE_COMMAND} -E copy_directory ${ARGS_RESOURCES_DIR} "${buildtree_dir}/${rsc_dir}"
+            COMMAND ${CMAKE_COMMAND} -E copy_directory ${ARGS_RESOURCES_DIR} "${RESOURCES_BINARY_DIR}/${RESOURCES_LAST_DIR}"
             VERBATIM
             )
     else ()
         add_custom_command(
             TARGET ${ARGS_TARGET}
             POST_BUILD
-            COMMAND ${CMAKE_COMMAND} -E create_symlink ${ARGS_RESOURCES_DIR} "${buildtree_dir}/${rsc_dir}"
+            COMMAND ${CMAKE_COMMAND} -E create_symlink ${ARGS_RESOURCES_DIR} "${RESOURCES_BINARY_DIR}/${RESOURCES_LAST_DIR}"
             VERBATIM
             )
     endif ()
@@ -423,6 +438,8 @@
         PROPERTIES
         RADIUM_TARGET_RESOURCES_DIRECTORY ${ARGS_RESOURCES_DIR}
         )
+
+    #why do not set tgt prop if files is not set, even if there is files in resources directory ?
     if (ARGS_FILES)
         set_target_properties(${ARGS_TARGET}
             PROPERTIES
@@ -433,36 +450,18 @@
     endif ()

     #install resource for application or shared library
-    message(STATUS "[install_target_resources] Installing resources for target ${ARGS_TARGET} into Resources/${ARGS_RESOURCES_INSTALL_DIR}/${rsc_dir}")
-    if (${targetType} STREQUAL "EXECUTABLE")
-        foreach (file ${ARGS_FILES})
-            get_filename_component(file_dir ${file} DIRECTORY)
-            if (APPLE)
-                install(
-                    FILES ${ARGS_RESOURCES_DIR}/${file}
-                    DESTINATION bin/${ARGS_TARGET}.app/Contents/Resources/${ARGS_RESOURCES_INSTALL_DIR}/${rsc_dir}/${file_dir}
-                    )
-            else ()
-                install(
-                    FILES ${ARGS_RESOURCES_DIR}/${file}
-                    DESTINATION Resources/${ARGS_RESOURCES_INSTALL_DIR}/${rsc_dir}/${file_dir}
-                    )
-            endif ()
-        endforeach ()
-    elseif (${targetType} STREQUAL "SHARED_LIBRARY")
-        set_target_properties(${ARGS_TARGET}
-            PROPERTIES
-            RADIUM_TARGET_INSTALLED_RESOURCES "${CMAKE_INSTALL_PREFIX}/Resources/${ARGS_RESOURCES_INSTALL_DIR}"
-            )
-        foreach (file ${ARGS_FILES})
-            get_filename_component(file_dir ${file} DIRECTORY)
+    message(STATUS "[install_target_resources] Installing resources for target ${ARGS_TARGET} into Resources/${RESOURCES_INSTALL_DIR}/${RESOURCES_LAST_DIR}")
+
+    if (${TARGET_TYPE} STREQUAL "EXECUTABLE" OR ${TARGET_TYPE} STREQUAL "SHARED_LIBRARY")
+        foreach (FILE ${ARGS_FILES})
+            get_filename_component(FILE_DIR ${FILE} DIRECTORY)
             install(
-                FILES ${ARGS_RESOURCES_DIR}/${file}
-                DESTINATION Resources/${ARGS_RESOURCES_INSTALL_DIR}/${rsc_dir}/${file_dir}
+                FILES ${ARGS_RESOURCES_DIR}/${FILE}
+                DESTINATION ${RESOURCES_DESTINATION_DIR}/${FILE_DIR}
                 )
         endforeach ()
     else ()
-        message(FATAL_ERROR "[install_target_resources] Unknown target type ${targetType} for target ${ARGS_TARGET} ")
+        message(FATAL_ERROR "[install_target_resources] Unknown target type ${TARGET_TYPE} for target ${ARGS_TARGET} ")
     endif ()
 endfunction()


[Analysis] Only run plugins tests if plugins are actually enabled

When plugins aren't enabled, don't try to run plugins tests. Don't
enable plugins unconditionally based on the platform, instead check
if LLVM shared library is actually being built which may not be the
case for every host configuration, even if the host itself supports
plugins.

This addresses test failures introduced by r360891/D59464.

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

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

--- cmake/modules/HandleLLVMOptions.cmake
+++ cmake/modules/HandleLLVMOptions.cmake
@@ -920,14 +920,10 @@

 # Plugin support
 # FIXME: Make this configurable.
-if(WIN32 OR CYGWIN)
-  if(BUILD_SHARED_LIBS OR LLVM_BUILD_LLVM_DYLIB)
-    set(LLVM_ENABLE_PLUGINS ON)
-  else()
-    set(LLVM_ENABLE_PLUGINS OFF)
-  endif()
+if(BUILD_SHARED_LIBS OR LLVM_BUILD_LLVM_DYLIB)
+  set(LLVM_ENABLE_PLUGINS ON)
 else()
-  set(LLVM_ENABLE_PLUGINS ON)
+  set(LLVM_ENABLE_PLUGINS OFF)
 endif()

 # By default we should enable LLVM_ENABLE_IDE only for multi-configuration


zookeeper package should now work on mingw

--- cmake/projects/zookeeper/hunter.cmake
+++ cmake/projects/zookeeper/hunter.cmake
@@ -13,11 +13,11 @@
     PACKAGE_NAME
     zookeeper
     VERSION
-    "3.4.9-p1"
+    "3.4.9-p2"
     URL
-    "https://github.com/hunter-packages/zookeeper/archive/3.4.9-p1.tar.gz"
+    "https://github.com/hunter-packages/zookeeper/archive/3.4.9-p2.tar.gz"
     SHA1
-    477ddb59d7071e83fc1acc9f8f0425f97ccfa56a
+    ed8167bdc0eb08b967e091a4503f3373aad5dddc
 )

 # Pick a download scheme


qt5-tools: fix using qi_generate_qt_conf in some corner cases

In our cross toolchains we rewrote the cmake finders, and do not
use imported targes as upstream does it in their /lib/cmake files,
thus we cannot assume that QT5_CORE_LIBRARIES always is a target,
when cross-compiling it's a simple path

Change-Id: Ic3274ee42fd0fe0c5f612a45a20eee4ace07edbe
Reviewed-on: http://gerrit.aldebaran.lan/60663
Tested-by: gerrit
Reviewed-by: smartin <edaf33f3e53483e687d304aa81a03bb5a17b9ddf@aldebaran-robotics.com>
Reviewed-by: dmerejkowsky <1e4b13000fa8777df4cefd2fd8215187e3deb062@aldebaran-robotics.com>

--- cmake/qibuild/modules/qt5-tools.cmake
+++ cmake/qibuild/modules/qt5-tools.cmake
@@ -27,8 +27,11 @@
         OR "${_lib}" STREQUAL "general")
       list(GET QT5_CORE_LIBRARIES 1 _lib)
     endif()
-
-    get_target_property(_lib_loc ${_lib} LOCATION)
+    if(TARGET ${_lib})
+      get_target_property(_lib_loc ${_lib} LOCATION)
+    else()
+      set(_lib_loc ${_lib})
+    endif()
     get_filename_component(_lib_path ${_lib_loc} PATH)
     if(APPLE)
       # location is: <prefix>/lib/QtCore.framework/QtCore


`CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS`: removed unnecessary flags.

	modified:   w64.cmake

--- w64.cmake
+++ w64.cmake
@@ -24,4 +24,4 @@
 set(CMAKE_CXX_FLAGS "-std=c++11 -DSFML_STATIC -DSFML_STATIC_LIBRARIES -DSFML_USE_STATIC_STD_LIBS -static -static-libgcc -static-libstdc++ -lpthread -O3 -s")
 set(CMAKE_C_FLAGS "-static-libgcc -static-libstdc++ -O3 -s")
 set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "-static -static-libgcc -static-libstdc++ -O3 -s")
-set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "-DSFML_STATIC -DSFML_STATIC_LIBRARIES -DSFML_USE_STATIC_STD_LIBS -static -std=c++11 -static-libgcc -static-libstdc++ -lpthread -O3 -s")
+set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "-static -std=c++11 -static-libgcc -static-libstdc++ -O3 -s")


[Build] 1. Added (N)Curses support. 2. Improved documentation generation support. 3. Renamed DSim into TvlSim.

--- config/project_config_embeddable.cmake
+++ config/project_config_embeddable.cmake
@@ -95,6 +95,14 @@
   # Documentation
   option (INSTALL_DOC "Set to OFF to skip build/install Documentation"
     ${_build_doc})
+
+  # Initialise a few variables
+  set (DOXYGEN_OUTPUT_REL)
+  set (REFMAN_TEX)
+  set (REFMAN_PDF)
+  set (CSS_ALL_TARGETS)
+  set (IMG_ALL_TARGETS)
+  set (MAN_ALL_TARGETS)

   # Set the library installation directory (either 32 or 64 bits)
   set (LIBDIR "lib${LIB_SUFFIX}" CACHE PATH
@@ -255,13 +263,15 @@
     "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}"
     CACHE INTERNAL "tarball basename")
   set (AUTOTOOLS_IGNRD "/tmp/;/tmp2/;/autom4te\\\\.cache/;autogen\\\\.sh$")
-  set (PACK_IGNRD "${CMAKE_CURRENT_BINARY_DIR};${CPACK_PACKAGE_NAME}\\\\.spec;\\\\.gz$;\\\\.bz2$")
+  set (PACK_IGNRD
+	"${CMAKE_CURRENT_BINARY_DIR};${CPACK_PACKAGE_NAME}\\\\.spec;\\\\.gz$;\\\\.bz2$")
   set (EDIT_IGNRD "\\\\.swp$;\\\\.#;/#;~$")
   set (SCM_IGNRD
     "/CVS/;/\\\\.svn/;/\\\\.bzr/;/\\\\.hg/;/\\\\.git/;\\\\.gitignore$")
   set (PYTHON_IGNRD "\\\\.pyc$;\\\\.pyo$")
+  set (JS_IGNRD "/browser/js/libs;/browser/js/mylibs;/browser/libs")
   set (CPACK_SOURCE_IGNORE_FILES
-    "${AUTOTOOLS_IGNRD};${SCM_IGNRD};${EDIT_IGNRD};${PACK_IGNRD};${PYTHON_IGNRD}"
+    "${AUTOTOOLS_IGNRD};${SCM_IGNRD};${EDIT_IGNRD};${PACK_IGNRD};${PYTHON_IGNRD};${JS_IGNRD}"
     CACHE STRING "CPACK will ignore these files")
   #set (CPACK_SOURCE_IGNORE_DIRECTORY ${CPACK_SOURCE_IGNORE_FILES} .git)

@@ -337,6 +347,10 @@
       get_readline (${_arg_version})
     endif (${_arg_lower} STREQUAL "readline")

+    if (${_arg_lower} STREQUAL "curses")
+      get_curses (${_arg_version})
+    endif (${_arg_lower} STREQUAL "curses")
+
     if (${_arg_lower} STREQUAL "mysql")
       get_mysql (${_arg_version})
     endif (${_arg_lower} STREQUAL "mysql")
@@ -393,9 +407,9 @@
       get_simcrs (${_arg_version})
     endif (${_arg_lower} STREQUAL "simcrs")

-    if (${_arg_lower} STREQUAL "dsim")
-      get_dsim (${_arg_version})
-    endif (${_arg_lower} STREQUAL "dsim")
+    if (${_arg_lower} STREQUAL "tvlsim")
+      get_tvlsim (${_arg_version})
+    endif (${_arg_lower} STREQUAL "tvlsim")

     if (${_arg_lower} STREQUAL "doxygen")
       get_doxygen (${_arg_version})
@@ -670,6 +684,34 @@

 endmacro (get_readline)

+# ~~~~~~~~~~ (N)Curses ~~~~~~~~~
+macro (get_curses)
+  unset (_required_version)
+  if (${ARGC} GREATER 0)
+    set (_required_version ${ARGV0})
+    message (STATUS "Requires (N)Curses-${_required_version}")
+  else (${ARGC} GREATER 0)
+    message (STATUS "Requires (N)Curses without specifying any version")
+  endif (${ARGC} GREATER 0)
+
+  set (CURSES_FOUND False)
+
+  set (CURSES_NEED_NCURSES True)
+  find_package (Curses ${_required_version} REQUIRED)
+  if (CURSES_LIBRARY)
+    set (CURSES_FOUND True)
+  endif (CURSES_LIBRARY)
+
+  if (CURSES_FOUND)
+    # Update the list of include directories for the project
+    include_directories (${CURSES_INCLUDE_DIR})
+
+    # Update the list of dependencies for the project
+    list (APPEND PROJ_DEP_LIBS_FOR_LIB ${CURSES_LIBRARY})
+  endif (CURSES_FOUND)
+
+endmacro (get_curses)
+
 # ~~~~~~~~~~ MySQL ~~~~~~~~~
 macro (get_mysql)
   unset (_required_version)
@@ -1122,37 +1164,37 @@

 endmacro (get_simcrs)

-# ~~~~~~~~~~ DSim ~~~~~~~~~
-macro (get_dsim)
+# ~~~~~~~~~~ TvlSim ~~~~~~~~~
+macro (get_tvlsim)
   unset (_required_version)
   if (${ARGC} GREATER 0)
     set (_required_version ${ARGV0})
-    message (STATUS "Requires DSim-${_required_version}")
+    message (STATUS "Requires TvlSim-${_required_version}")
   else (${ARGC} GREATER 0)
-    message (STATUS "Requires DSim without specifying any version")
+    message (STATUS "Requires TvlSim without specifying any version")
   endif (${ARGC} GREATER 0)

-  find_package (DSim ${_required_version} REQUIRED
-	HINTS ${WITH_DSIM_PREFIX})
-  if (DSim_FOUND)
+  find_package (TvlSim ${_required_version} REQUIRED
+	HINTS ${WITH_TVLSIM_PREFIX})
+  if (TvlSim_FOUND)
     #
-    message (STATUS "Found DSim version: ${DSIM_VERSION}")
+    message (STATUS "Found TvlSim version: ${TVLSIM_VERSION}")

     # Update the list of include directories for the project
-    include_directories (${DSIM_INCLUDE_DIRS})
+    include_directories (${TVLSIM_INCLUDE_DIRS})

     # Update the list of dependencies for the project
-    set (PROJ_DEP_LIBS_FOR_LIB ${PROJ_DEP_LIBS_FOR_LIB} ${DSIM_LIBRARIES})
-
-  else (DSim_FOUND)
-    set (ERROR_MSG "The DSim library cannot be found. If it is installed in")
+    set (PROJ_DEP_LIBS_FOR_LIB ${PROJ_DEP_LIBS_FOR_LIB} ${TVLSIM_LIBRARIES})
+
+  else (TvlSim_FOUND)
+    set (ERROR_MSG "The TvlSim library cannot be found. If it is installed in")
     set (ERROR_MSG "${ERROR_MSG} a in a non standard directory, just invoke")
-    set (ERROR_MSG "${ERROR_MSG} 'cmake' specifying the -DWITH_DSIM_PREFIX=")
-    set (ERROR_MSG "${ERROR_MSG}<DSim install path> variable.")
+    set (ERROR_MSG "${ERROR_MSG} 'cmake' specifying the -DWITH_TVLSIM_PREFIX=")
+    set (ERROR_MSG "${ERROR_MSG}<TvlSim install path> variable.")
     message (FATAL_ERROR "${ERROR_MSG}")
-  endif (DSim_FOUND)
-
-endmacro (get_dsim)
+  endif (TvlSim_FOUND)
+
+endmacro (get_tvlsim)

 ##############################################
@@ -1862,16 +1904,25 @@
   set (REFMAN refman)
   set (TEX_GEN_DIR ${CMAKE_CURRENT_BINARY_DIR}/latex)
   set (REFMAN_TEX ${REFMAN}.tex)
+  set (REFMAN_TEX ${REFMAN_TEX} PARENT_SCOPE)
   set (REFMAN_TEX_FULL ${TEX_GEN_DIR}/${REFMAN_TEX})
+  set (REFMAN_TEX_OTHERS ${TEX_GEN_DIR}/index.tex ${TEX_GEN_DIR}/namespaces.tex
+	${TEX_GEN_DIR}/annotated.tex ${TEX_GEN_DIR}/hierarchy.tex
+	${TEX_GEN_DIR}/files.tex)

   # Add the build rule for Doxygen
-  set (DOXYGEN_OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/html/index.html)
-  add_custom_command (OUTPUT ${DOXYGEN_OUTPUT} ${REFMAN_TEX_FULL}
+  set (DOXYGEN_OUTPUT_REL html/index.html)
+  set (DOXYGEN_OUTPUT_REL ${DOXYGEN_OUTPUT_REL} PARENT_SCOPE)
+  set (DOXYGEN_OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${DOXYGEN_OUTPUT_REL})
+  set (DOXYGEN_OUTPUT ${DOXYGEN_OUTPUT} PARENT_SCOPE)
+  add_custom_command (
+	OUTPUT ${DOXYGEN_OUTPUT} ${REFMAN_TEX_FULL} ${REFMAN_TEX_OTHERS}
 	COMMAND ${DOXYGEN_EXECUTABLE} ARGS ${DOXYGEN_CFG}
 	DEPENDS ${DOXYGEN_CFG} ${doc_SOURCES}
 	COMMENT "Generating documentation with Doxygen, from '${DOXYGEN_CFG}'...")
   # Add the 'doc' target, depending on the generated HTML documentation
-  add_custom_target (doc ALL DEPENDS ${DOXYGEN_OUTPUT})
+  add_custom_target (doc ALL DEPENDS
+	${DOXYGEN_OUTPUT} ${REFMAN_TEX_FULL} ${REFMAN_TEX_OTHERS})

   ##
   # Copy the needed files into the generated HTML directory
@@ -1885,10 +1936,17 @@
 	add_custom_command (OUTPUT ${CSS_GEN_FULL_DIR}
 	  COMMAND ${CMAKE_COMMAND}
 	  ARGS -E copy ${CSS_SRC_FULL_DIR} ${CSS_GEN_FULL_DIR}
-	  DEPENDS ${DOXYGEN_OUTPUT} ${CSS_SRC_FULL_DIR}
+	  DEPENDS doc ${CSS_SRC_FULL_DIR}
 	  COMMENT "Copying style '${CSS_SRC_FULL_DIR}' into '${htmldoc_DIR}'...")
+
+	# Transpose the CSS-related operation into a target, so that CMake
+	# can handle it properly
 	add_custom_target (css_${style_SRC} ALL DEPENDS ${CSS_GEN_FULL_DIR})
+	list (APPEND CSS_ALL_TARGETS css_${style_SRC})
   endforeach (style_SRC)
+  set (CSS_ALL_TARGETS ${CSS_ALL_TARGETS} PARENT_SCOPE)
+  add_custom_target (css_style)
+  add_dependencies (css_style ${CSS_ALL_TARGETS})

   # Images
   foreach (image_SRC ${image_SOURCES})
@@ -1897,10 +1955,17 @@
 	add_custom_command (OUTPUT ${IMG_GEN_FULL_DIR}
 	  COMMAND ${CMAKE_COMMAND}
 	  ARGS -E copy ${IMG_SRC_FULL_DIR} ${IMG_GEN_FULL_DIR}
-	  DEPENDS ${DOXYGEN_OUTPUT} ${IMG_SRC_FULL_DIR}
+	  DEPENDS doc ${IMG_SRC_FULL_DIR}
 	  COMMENT "Copying image '${IMG_SRC_FULL_DIR}' into '${htmldoc_DIR}'...")
+
+	# Transpose the image-related operation into a target, so that CMake
+	# can handle it properly
 	add_custom_target (img_${image_SRC} ALL DEPENDS ${IMG_GEN_FULL_DIR})
+	list (APPEND IMG_ALL_TARGETS img_${image_SRC})
   endforeach (image_SRC)
+  set (IMG_ALL_TARGETS ${IMG_ALL_TARGETS} PARENT_SCOPE)
+  add_custom_target (img_style)
+  add_dependencies (img_style ${IMG_ALL_TARGETS})

   ##
   # PDF, generated by (Pdf)Latex from the Latex source file, itself generated
@@ -1908,27 +1973,28 @@
   set (REFMAN_IDX ${REFMAN}.idx)
   set (REFMAN_IDX_FULL ${TEX_GEN_DIR}/${REFMAN_IDX})
   set (REFMAN_PDF ${REFMAN}.pdf)
+  set (REFMAN_PDF ${REFMAN_PDF} PARENT_SCOPE)
   set (REFMAN_PDF_FULL ${TEX_GEN_DIR}/${REFMAN_PDF})
+  set (WARNING_PDF_MSG "Warning: the PDF reference manual ('${REFMAN_PDF_FULL}') has failed to build. You can perform a simple re-build ('make' in the 'doc/latex' sub-directory).")
   # Note the "|| echo" addition to the pdflatex command, as that latter returns
   # as if there were an error.
   add_custom_command (OUTPUT ${REFMAN_IDX_FULL} ${REFMAN_PDF_FULL}
-	DEPENDS ${DOXYGEN_OUTPUT} ${REFMAN_TEX_FULL}
 	COMMAND ${CMAKE_COMMAND}
-	ARGS -E chdir ${TEX_GEN_DIR} pdflatex -interaction batchmode ${REFMAN_TEX} || echo "First PDF generation done."
+	ARGS -E chdir ${TEX_GEN_DIR} pdflatex -interaction batchmode ${REFMAN_TEX} && echo 'First PDF generation done.' || echo 'First PDF generation done.'
 	COMMAND ${CMAKE_COMMAND}
-	ARGS -E chdir ${TEX_GEN_DIR} makeindex -q ${REFMAN_IDX}
+	ARGS -E chdir ${TEX_GEN_DIR} egrep -s -e 'Fatal error occurred' -e 'Rerun to get cross-references right' refman.log && (cd ${TEX_GEN_DIR} && pdflatex -interaction batchmode ${REFMAN_TEX} && echo 'Second PDF generation done.') || echo 'Second PDF generation was not necessary'
 	COMMAND ${CMAKE_COMMAND}
-	ARGS -E chdir ${TEX_GEN_DIR} pdflatex -interaction batchmode ${REFMAN_TEX} || echo "Second PDF generation done."
+	ARGS -E chdir ${TEX_GEN_DIR} egrep -s -e 'Fatal error occurred' -e 'Rerun to get cross-references right' refman.log && (cd ${TEX_GEN_DIR} && pdflatex -interaction batchmode ${REFMAN_TEX} && echo 'Third PDF generation done.') || echo 'Third PDF generation was not necessary'
 	COMMAND ${CMAKE_COMMAND}
-	ARGS -E chdir ${TEX_GEN_DIR} makeindex -q ${REFMAN_IDX}
+	ARGS -E chdir ${TEX_GEN_DIR} test ! -f ${REFMAN_PDF} && (cd ${TEX_GEN_DIR} && echo '${WARNING_PDF_MSG}' > ${REFMAN_PDF} && echo '${WARNING_PDF_MSG}') || echo 'The PDF reference manual has been successfully built'
 	COMMAND ${CMAKE_COMMAND}
-	ARGS -E chdir ${TEX_GEN_DIR} pdflatex -interaction batchmode ${REFMAN_TEX} || echo "Third PDF generation done."
-	COMMENT "Generating PDF Reference Manual ('${REFMAN_PDF}')..."
-	COMMAND ${CMAKE_COMMAND}
-	ARGS -E chdir ${TEX_GEN_DIR} test -f ${REFMAN_PDF} || (touch ${REFMAN_PDF} && echo "Warning: the PDF reference manual \\\('${REFMAN_PDF_FULL}'\\\) has failed to build. You can perform a simple re-build \\\('make' in the 'doc/latex' sub-directory\\\).")
-	COMMENT "Checking whether the PDF Reference Manual ('${REFMAN_PDF}') has been built...")
+	ARGS -E chdir ${TEX_GEN_DIR} echo 'The file size of the PDF reference manual is: ' && (cd ${TEX_GEN_DIR} && du -sh ${REFMAN_PDF} | cut -f1)
+	DEPENDS doc
+	COMMENT "Generating PDF Reference Manual ('${REFMAN_TEX}' => '${REFMAN_PDF}')...")
+
   # Add the 'pdf' target, depending on the generated PDF manual
-  add_custom_target (pdf ALL DEPENDS ${REFMAN_PDF_FULL})
+  add_custom_target (pdf ALL DEPENDS ${REFMAN_IDX_FULL} ${REFMAN_PDF_FULL})
+  add_dependencies (pdf css_style img_style)

   # Clean-up $build/html and $build/latex on 'make clean'
   set_property (DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES
@@ -1966,12 +2032,11 @@
   endforeach (_idx RANGE 1 9)

   # Initialise the lists gathering information for each valid manual section
-  set (man_doxy_output_list "")
-  set (man_dir_list "")
+  set (man_dir_list)

   # Parse the arguments
-  set (options "")
-  set (oneValueArgs "")
+  set (options)
+  set (oneValueArgs)

   # Added one argument option for every manual section
   foreach (man_sect ${man_section_list})
@@ -2034,9 +2099,11 @@
 		DEPENDS ${DOXYGEN_CFG${man_sect}} ${man${man_sect}_SOURCES}
 		COMMENT "Generating section ${man_sect} manual pages with Doxygen, from '${DOXYGEN_CFG${man_sect}}'...")

-	  # Add the current manual section output to the dedicated list,
-	  # so that it can then be added to the corresponding target (see below).
-	  list (APPEND man_doxy_output_list ${DOXYGEN_OUTPUT${man_sect}})
+	  # Transpose the man-page-related operation into a target, so that CMake
+	  # can handle it properly
+	  add_custom_target (man_${man_sect}
+		ALL DEPENDS ${DOXYGEN_OUTPUT${man_sect}})
+	  list (APPEND MAN_ALL_TARGETS man_${man_sect})

 	  # Specifiy what to do for the installation of the manual pages
 	  install (DIRECTORY "${man${man_sect}_DIR}" DESTINATION ${MAN_PATH})
@@ -2045,7 +2112,9 @@
   endforeach (man_sect ${man_section_list})

   # Add the 'man' target, depending on the generated manual page documentation
-  add_custom_target (man ALL DEPENDS ${man_doxy_output_list})
+  set (MAN_ALL_TARGETS ${MAN_ALL_TARGETS} PARENT_SCOPE)
+  add_custom_target (man)
+  add_dependencies (${MAN_ALL_TARGETS})

   # Clean-up $build/man1 and $build/man3 on 'make clean'
   set_property (DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES
@@ -2064,18 +2133,18 @@
 	  "${CMAKE_BINARY_DIR}/${PROJECT_NAME}/CMakeFiles/${PROJECT_NAME}lib.dir")
     set (GCDA_FILE "${GCDA_GCNO_PATH}/command/CmdBomSerialiser.cpp.gcda")
     set (GCNO_FILE "${GCDA_GCNO_PATH}/command/CmdBomSerialiser.cpp.gcno")
-    # Removed generated gcda and gcno files relative to the CmdBomSerialiser
+	# Removed generated gcda and gcno files relative to the CmdBomSerialiser
 	# object: gcov failed processing the CmdBomSerialiser.cpp.gcda file
 	# without displaying a clear message
     add_custom_command (TARGET check
-      # This task is post-build and post-check
+	  # This task is post-build and post-check
       POST_BUILD
       # Because the "-f" option is given, the commands do not fail
 	  # when the files are missing
 	  COMMAND "rm" "-f" "${GCDA_FILE}"
       COMMAND "rm" "-f" "${GCNO_FILE}"
       )
-    # Build a coverage report info and html pages using gcda and gcno files
+	# Build a coverage report info and html pages using gcda and gcno files
     add_custom_command (TARGET check
       # This task is post-build and post-check
       POST_BUILD
@@ -2261,6 +2330,17 @@
   endif (READLINE_FOUND)
 endmacro (display_readline)

+# (N)Curses
+macro (display_curses)
+  if (CURSES_FOUND)
+    message (STATUS)
+    message (STATUS "* (N)Curses:")
+    message (STATUS "  - CURSES_VERSION .............. : ${CURSES_VERSION}")
+    message (STATUS "  - CURSES_INCLUDE_DIR .......... : ${CURSES_INCLUDE_DIR}")
+    message (STATUS "  - CURSES_LIBRARY .............. : ${CURSES_LIBRARY}")
+  endif (CURSES_FOUND)
+endmacro (display_curses)
+
 # MySQL
 macro (display_mysql)
   if (MYSQL_FOUND)
@@ -2456,19 +2536,19 @@
   endif (SimCRS_FOUND)
 endmacro (display_simcrs)

-# DSim
-macro (display_dsim)
-  if (DSim_FOUND)
+# TvlSim
+macro (display_tvlsim)
+  if (TvlSim_FOUND)
     message (STATUS)
-    message (STATUS "* DSim:")
-    message (STATUS "  - DSIM_VERSION .................. : ${DSIM_VERSION}")
-    message (STATUS "  - DSIM_BINARY_DIRS .............. : ${DSIM_BINARY_DIRS}")
-    message (STATUS "  - DSIM_EXECUTABLES .............. : ${DSIM_EXECUTABLES}")
-    message (STATUS "  - DSIM_LIBRARY_DIRS ............. : ${DSIM_LIBRARY_DIRS}")
-    message (STATUS "  - DSIM_LIBRARIES ................ : ${DSIM_LIBRARIES}")
-    message (STATUS "  - DSIM_INCLUDE_DIRS ............. : ${DSIM_INCLUDE_DIRS}")
-  endif (DSim_FOUND)
-endmacro (display_dsim)
+    message (STATUS "* TvlSim:")
+    message (STATUS "  - TVLSIM_VERSION .................. : ${TVLSIM_VERSION}")
+    message (STATUS "  - TVLSIM_BINARY_DIRS .............. : ${TVLSIM_BINARY_DIRS}")
+    message (STATUS "  - TVLSIM_EXECUTABLES .............. : ${TVLSIM_EXECUTABLES}")
+    message (STATUS "  - TVLSIM_LIBRARY_DIRS ............. : ${TVLSIM_LIBRARY_DIRS}")
+    message (STATUS "  - TVLSIM_LIBRARIES ................ : ${TVLSIM_LIBRARIES}")
+    message (STATUS "  - TVLSIM_INCLUDE_DIRS ............. : ${TVLSIM_INCLUDE_DIRS}")
+  endif (TvlSim_FOUND)
+endmacro (display_tvlsim)

 ##
 macro (display_status_all_modules)
@@ -2493,6 +2573,19 @@
     message (STATUS "  + Tests to perform .............. : ${${_test_suite}_ALL_TESTS}")
   endforeach (_test_suite)
 endmacro (display_status_all_test_suites)
+
+##
+macro (display_doc_generation)
+  message (STATUS)
+    message (STATUS "* Documentation to be generated ... :")
+	if (INSTALL_DOC)
+      message (STATUS "  + HTML main page ................ : ${DOXYGEN_OUTPUT_REL}")
+      message (STATUS "  + CSS-related files ............. : ${CSS_ALL_TARGETS}")
+      message (STATUS "  + Image-related files ........... : ${IMG_ALL_TARGETS}")
+      message (STATUS "  + PDF reference manual .......... : ${REFMAN_TEX} => ${REFMAN_PDF}")
+	endif (INSTALL_DOC)
+    message (STATUS "  + Man page sections ............. : ${MAN_ALL_TARGETS}")
+endmacro (display_doc_generation)

 ##
 macro (display_status)
@@ -2520,6 +2613,7 @@
   message (STATUS "Binaries to test .................. : ${PROJ_ALL_TST_TARGETS}")
   display_status_all_modules ()
   display_status_all_test_suites ()
+  display_doc_generation ()
   message (STATUS)
   message (STATUS "BUILD_SHARED_LIBS ................. : ${BUILD_SHARED_LIBS}")
   message (STATUS "CMAKE_BUILD_TYPE .................. : ${CMAKE_BUILD_TYPE}")
@@ -2571,6 +2665,7 @@
   display_boost ()
   display_xapian ()
   display_readline ()
+  display_curses ()
   display_mysql ()
   display_soci ()
   display_stdair ()
@@ -2585,7 +2680,7 @@
   display_simfqt ()
   display_simlfs ()
   display_simcrs ()
-  display_dsim ()
+  display_tvlsim ()
   #
   message (STATUS)
   message (STATUS "Change a value with: cmake -D<Variable>=<Value>" )


ENH: add global var for static lib extension

--- Packaging/PackageGlobals.cmake
+++ Packaging/PackageGlobals.cmake
@@ -28,6 +28,8 @@
 set(SCRIPT_EXT ".sh")
 set(LIB_EXT ".so")
 set(PYMODULE_EXT ".so")
+set(STATIC_LIB_EXT ".a")
+
 if(WIN32)
   set(LIB_PREFIX)
   set(DEST_LIB_DIR bin)
@@ -35,6 +37,7 @@
   set(LIB_EXT ".dll")
   set(SCRIPT_EXT ".bat")
   set(PYMODULE_EXT ".pyd")
+  set(STATIC_LIB_EXT ".lib")
 elseif(APPLE)
   set(LIB_EXT ".dylib")
 endif()


添加cetty-redis alp-route依赖

添加cetty-redis alp-route依赖

--- FindCetty.cmake
+++ FindCetty.cmake
@@ -50,4 +50,4 @@
 mark_as_advanced(CETTY_LIBRARY CETTY_INCLUDE_DIR)

 SET(CETTY_INCLUDE_DIRS ${CETTY_INCLUDE_DIR})
-SET(CETTY_LIBRARYS cetty-craft cetty-service cetty-protobuf cetty-protobuf-serialization cetty-config cetty)
+SET(CETTY_LIBRARYS cetty-redis cetty-craft cetty-service cetty-protobuf cetty-protobuf-serialization cetty-config cetty)


ENH: superbuild: USE_SYSTEM_XXX always in upper case

--- SuperBuild/CMake/External_libsvm.cmake
+++ SuperBuild/CMake/External_libsvm.cmake
@@ -5,7 +5,7 @@

 message(STATUS "Setup LibSVM...")

-if(USE_SYSTEM_LibSVM)
+if(USE_SYSTEM_LIBSVM)
   find_package ( LibSVM )
   add_custom_target(${proj})
   message(STATUS "  Using LibSVM system version")


CMake: Print version numbers into detailed.log

git-svn-id: 31d9d2f6432a47c86a3640814024c107794ea77c@30321 0785d39b-7218-0410-832d-ea1e28bc413d

--- deal.II/cmake/setup_finalize.cmake
+++ deal.II/cmake/setup_finalize.cmake
@@ -185,6 +185,13 @@
     STRING(REGEX REPLACE "^DEAL_II_WITH_" "" _feature ${_var})
     IF(FEATURE_${_feature}_EXTERNAL_CONFIGURED)
       _both("#        ${_var} set up with external dependencies\n")
+
+      #
+      # Print out version number:
+      #
+      IF(DEFINED ${_feature}_VERSION)
+        _detailed("#            ${_feature}_VERSION = ${${_feature}_VERSION}\n")
+      ENDIF()

       #
       # Print the feature configuration:


修正计算md5时使用绝对路径计算md5错误的问题

修正计算md5时使用绝对路径计算md5错误的问题

--- build/cmake/dxm_module/dxm_module_md5.cmake
+++ build/cmake/dxm_module/dxm_module_md5.cmake
@@ -40,13 +40,18 @@
 # 计算工程下载文件夹MD5
 #
 macro(dxm_module_add_directory_md5 MODULE DIRECTORY)
-	if(EXISTS ${DXM_MODULE_${MODULE}_DIRECTORY}/${DIRECTORY})
+
+	if(IS_ABSOLUTE ${DIRECTORY})
+		dxm_file_md5dir(${DIRECTORY} DXM_MODULE_${MODULE}_MD5)
+	elseif(EXISTS ${DXM_MODULE_${MODULE}_DIRECTORY}/${DIRECTORY})
 		dxm_file_md5dir(${DXM_MODULE_${MODULE}_DIRECTORY}/${DIRECTORY} DXM_MODULE_${MODULE}_MD5)
 	endif()
 endmacro()

 macro(dxm_module_add_file_md5 MODULE FILE_PATH)
-	if(EXISTS ${DXM_MODULE_${MODULE}_DIRECTORY}/${FILE_PATH})
+	if(IS_ABSOLUTE ${FILE_PATH})
+		dxm_file_md5file(${FILE_PATH} DXM_MODULE_${MODULE}_MD5)
+	elseif(EXISTS ${DXM_MODULE_${MODULE}_DIRECTORY}/${FILE_PATH})
 		dxm_file_md5file(${DXM_MODULE_${MODULE}_DIRECTORY}/${FILE_PATH} DXM_MODULE_${MODULE}_MD5)
 	endif()
 endmacro()


Squashed '3rdparty/github/cmake-utils/' changes from 2c004ca8..0377618d

0377618d Added inttypes.h and sys/inttypes.h

git-subtree-dir: 3rdparty/github/cmake-utils
git-subtree-split: 0377618ddf7901ced2dc329270f4fae5a8ef89b3

--- cmake/MyPackageCheckCommonIncludeFiles.cmake
+++ cmake/MyPackageCheckCommonIncludeFiles.cmake
@@ -1,17 +1,19 @@
 MACRO (MYPACKAGECHECKCOMMONINCLUDEFILES)
   INCLUDE (CheckIncludeFile)
-  CHECK_INCLUDE_FILE ("stdio.h"      HAVE_STDIO_H)
-  CHECK_INCLUDE_FILE ("stddef.h"     HAVE_STDDEF_H)
-  CHECK_INCLUDE_FILE ("stdlib.h"     HAVE_STDLIB_H)
-  CHECK_INCLUDE_FILE ("stdarg.h"     HAVE_STDARG_H)
-  CHECK_INCLUDE_FILE ("stdint.h"     HAVE_STDINT_H)
-  CHECK_INCLUDE_FILE ("sys/time.h"   HAVE_SYS_TIME_H)
-  CHECK_INCLUDE_FILE ("sys/types.h"  HAVE_SYS_TYPES_H)
-  CHECK_INCLUDE_FILE ("sys/stat.h"   HAVE_SYS_STAT_H)
-  CHECK_INCLUDE_FILE ("errno.h"      HAVE_ERRNO_H)
-  CHECK_INCLUDE_FILE ("string.h"     HAVE_STRING_H)
-  CHECK_INCLUDE_FILE ("unistd.h"     HAVE_UNISTD_H)
-  CHECK_INCLUDE_FILE ("io.h"         HAVE_IO_H)
-  CHECK_INCLUDE_FILE ("time.h"       HAVE_TIME_H)
-  CHECK_INCLUDE_FILE ("fcntl.h"      HAVE_FCNTL_H)
+  CHECK_INCLUDE_FILE ("stdio.h"        HAVE_STDIO_H)
+  CHECK_INCLUDE_FILE ("stddef.h"       HAVE_STDDEF_H)
+  CHECK_INCLUDE_FILE ("stdlib.h"       HAVE_STDLIB_H)
+  CHECK_INCLUDE_FILE ("stdarg.h"       HAVE_STDARG_H)
+  CHECK_INCLUDE_FILE ("stdint.h"       HAVE_STDINT_H)
+  CHECK_INCLUDE_FILE ("inttypes.h"     HAVE_INTTYPES_H)
+  CHECK_INCLUDE_FILE ("sys/inttypes.h" HAVE_SYS_INTTYPES_H)
+  CHECK_INCLUDE_FILE ("sys/time.h"     HAVE_SYS_TIME_H)
+  CHECK_INCLUDE_FILE ("sys/types.h"    HAVE_SYS_TYPES_H)
+  CHECK_INCLUDE_FILE ("sys/stat.h"     HAVE_SYS_STAT_H)
+  CHECK_INCLUDE_FILE ("errno.h"        HAVE_ERRNO_H)
+  CHECK_INCLUDE_FILE ("string.h"       HAVE_STRING_H)
+  CHECK_INCLUDE_FILE ("unistd.h"       HAVE_UNISTD_H)
+  CHECK_INCLUDE_FILE ("io.h"           HAVE_IO_H)
+  CHECK_INCLUDE_FILE ("time.h"         HAVE_TIME_H)
+  CHECK_INCLUDE_FILE ("fcntl.h"        HAVE_FCNTL_H)
 ENDMACRO()


Build: warn for incompatible OpenVDB 8.0 vs C++11 (#2860)

--- src/cmake/externalpackages.cmake
+++ src/cmake/externalpackages.cmake
@@ -178,10 +178,24 @@
                       RECOMMEND_MIN_REASON "for ACES support and better camera metadata"
                       PRINT LibRaw_r_LIBRARIES )
 checked_find_package (OpenJpeg VERSION_MIN 2.0)
+
 checked_find_package (OpenVDB
                       VERSION_MIN 5.0
                       DEPS         TBB
                       DEFINITIONS  -DUSE_OPENVDB=1)
+if (OpenVDB_FOUND AND OpenVDB_VERSION VERSION_GREATER_EQUAL 8.0
+        AND CMAKE_CXX_STANDARD VERSION_LESS 14)
+    set (OpenVDB_FOUND OFF)
+    add_definitions (-UUSE_OPENVDB)
+    message (WARNING
+             "${ColorYellow}OpenVDB 8.0+ requires C++14 or higher (was ${CMAKE_CXX_STANDARD}). "
+             "To build against this OpenVDB ${OpenVDB_VERSION}, you need to set "
+             "build option CMAKE_CXX_STANDARD=14 (or higher). The minimum requirements "
+             "for that are gcc >= 5.1, clang >= 3.5, Apple clang >= 7, icc >= 7, MSVS >= 2017. "
+             "If you must use C++11, you need to build against OpenVDB 7 or earlier. ${ColorReset}")
+    message (STATUS "${ColorRed}Not using OpenVDB -- OpenVDB ${OpenVDB_VERSION} requires C++14 or later. ${ColorReset}")
+endif ()
+
 checked_find_package (PTex)
 checked_find_package (WebP)


FeatureTracker: Add support for 4k/12MP inputs

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

 # "full commit hash of device side binary"
-set(DEPTHAI_DEVICE_SIDE_COMMIT "165ade159396e09389e2c66572b15edc1770d1f8")
+set(DEPTHAI_DEVICE_SIDE_COMMIT "28471d4d80ffe0dcd9c251544e5da2aecfc2ec48")

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


Disable FrSky for FMUv2

Disable FrSky for FMUv2

--- cmake/configs/nuttx_px4fmu-v2_default.cmake
+++ cmake/configs/nuttx_px4fmu-v2_default.cmake
@@ -37,7 +37,7 @@
 	drivers/airspeed
 	drivers/ets_airspeed
 	drivers/meas_airspeed
-	drivers/frsky_telemetry
+	#drivers/frsky_telemetry
 	modules/sensors
 	#drivers/mkblctrl
 	drivers/px4flow


testsuite: ztest: fix the linker generator not working of new ztest

Fix the linking error when CONFIG_CMAKE_LINKER_GENERATOR=y when
applying the new ztest API.

Signed-off-by: Enjia Mai <7a2de2448a1c31432e87f79c5f6556ebbe33f656@intel.com>

--- cmake/linker_script/common/common-ram.cmake
+++ cmake/linker_script/common/common-ram.cmake
@@ -105,4 +105,10 @@

 if(CONFIG_ZTEST)
   zephyr_iterable_section(NAME ztest_suite_node GROUP DATA_REGION ${XIP_ALIGN_WITH_INPUT} SUBALIGN 4)
+  zephyr_iterable_section(NAME ztest_suite_stats GROUP DATA_REGION ${XIP_ALIGN_WITH_INPUT} SUBALIGN 4)
 endif()
+
+if(CONFIG_ZTEST_NEW_API)
+  zephyr_iterable_section(NAME ztest_unit_test GROUP DATA_REGION ${XIP_ALIGN_WITH_INPUT} SUBALIGN 4)
+  zephyr_iterable_section(NAME ztest_test_rule GROUP DATA_REGION ${XIP_ALIGN_WITH_INPUT} SUBALIGN 4)
+endif()


emscripten: remove the new WASM_OBJECT_FILES param since this will go away in the next emscripten version

--- cmake-toolchains/emscripten.toolchain.cmake
+++ cmake-toolchains/emscripten.toolchain.cmake
@@ -110,12 +110,12 @@
 if (NOT FIPS_RTTI)
     set(EMSC_CXX_FLAGS "${EMSC_CXX_FLAGS} -fno-rtti")
 endif()
-set(EMSC_LINKER_FLAGS_RELEASE "${EMSC_LINKER_FLAGS_RELEASE} --llvm-lto ${FIPS_EMSCRIPTEN_LTO_LEVEL}")
+if (FIPS_EMSCRIPTEN_LTO_LEVEL GREATER 0)
+    set(EMSC_LINKER_FLAGS_RELEASE "${EMSC_LINKER_FLAGS_RELEASE} --llvm-lto ${FIPS_EMSCRIPTEN_LTO_LEVEL}")
+    set(EMSC_COMMON_FLAGS "${EMSC_COMMON_FLAGS} -flto")
+endif()
 if (FIPS_EMSCRIPTEN_USE_WASM)
     set(EMSC_LINKER_FLAGS "${EMSC_LINKER_FLAGS} -s WASM=1")
-    if (FIPS_EMSCRIPTEN_LTO_LEVEL GREATER 0)
-        set(EMSC_COMMON_FLAGS "${EMSC_COMMON_FLAGS} -flto -s WASM_OBJECT_FILES=0")
-    endif()
 else()
     set(EMSC_LINKER_FLAGS "${EMSC_LINKER_FLAGS} -s WASM=0")
 endif()


Build googletest with the same cmake flags.

--- cmake/modules/SearchInstalledSoftware.cmake
+++ cmake/modules/SearchInstalledSoftware.cmake
@@ -1387,10 +1387,6 @@
     ${_byproduct_binary_dir}/libgmock_main.a
     )

-  # Workaround clang/gcc ABI compatiability issue.
-  if(gcctoolchain)
-    set(GTEST_CMAKE_ARGS "CMAKE_ARGS -DCMAKE_CXX_FLAGS=--gcc-toolchain=${gcctoolchain}")
-  endif(gcctoolchain)
   ExternalProject_Add(
     googletest
     GIT_REPOSITORY https://github.com/google/googletest.git
@@ -1401,7 +1397,13 @@
     # CMAKE_ARGS -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG:PATH=DebugLibs
     #            -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE:PATH=ReleaseLibs
     #            -Dgtest_force_shared_crt=ON
-    ${GTEST_CMAKE_ARGS}
+    CMAKE_ARGS -G ${CMAKE_GENERATOR}
+                  -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
+                  -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
+                  -DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}
+                  -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
+                  -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS}
+                  -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}
     # Disable install step
     INSTALL_COMMAND ""
     BUILD_BYPRODUCTS ${_byproducts}


[cmake] Spelling (NFC).

[cmake] Spelling (NFC).

--- cmake/modules/SearchInstalledSoftware.cmake
+++ cmake/modules/SearchInstalledSoftware.cmake
@@ -74,8 +74,8 @@
   else()
     find_package(nlohmann_json QUIET)
     if(nlohmann_json_FOUND)
-      get_target_property(_nlohmann_json_inlc nlohmann_json::nlohmann_json INTERFACE_INCLUDE_DIRECTORIES)
-      message(STATUS "Found nlohmann/json.hpp in ${_nlohmann_json_inlc} (found version ${nlohmann_json_VERSION})")
+      get_target_property(_nlohmann_json_incl nlohmann_json::nlohmann_json INTERFACE_INCLUDE_DIRECTORIES)
+      message(STATUS "Found nlohmann/json.hpp in ${_nlohmann_json_incl} (found version ${nlohmann_json_VERSION})")
     else()
       message(STATUS "nlohmann/json.hpp not found. Switching on builtin_nlohmannjson option")
       set(builtin_nlohmannjson ON CACHE BOOL "Enabled because nlohmann/json.hpp not found" FORCE)
@@ -965,7 +965,7 @@
   if(NOT XROOTD_FOUND)
     if(fail-on-missing)
       message(FATAL_ERROR "XROOTD not found. Set environment variable XRDSYS to point to your XROOTD installation, "
-                          "or inlcude the installation of XROOTD in the CMAKE_PREFIX_PATH. "
+                          "or include the installation of XROOTD in the CMAKE_PREFIX_PATH. "
                           "Alternatively, you can also enable the option 'builtin_xrootd' to build XROOTD internally")
     else()
       message(STATUS "XROOTD not found, enabling 'builtin_xrootd' option")


Revert "Add VecCore as external project"

This reverts commit 5d3a1150015057bcdb7bb90481fea78782857647.

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

-if(vc AND NOT Vc_FOUND AND NOT (veccore OR builtin_veccore))
+if(vc AND NOT Vc_FOUND)
   set(Vc_VERSION "1.3.0")
   set(Vc_PROJECT "Vc-${Vc_VERSION}")
   set(Vc_SRC_URI "${lcgpackages}/${Vc_PROJECT}.tar.gz")
@@ -1313,90 +1313,6 @@
 if(Vc_FOUND)
   # Missing from VcConfig.cmake
   set(Vc_INCLUDE_DIRS ${Vc_INCLUDE_DIR})
-endif()
-
-#---Check for VecCore--------------------------------------------------------------------
-if(veccore AND builtin_vc)
-  message(WARNING "Vc is not relocatable, so 'builtin_vc' requires 'builtin_veccore' to set up Vc properly.")
-  set(builtin_veccore ON CACHE BOOL "" FORCE)
-endif()
-
-if(builtin_veccore)
-  unset(VecCore_FOUND)
-  unset(VecCore_FOUND CACHE)
-  set(veccore ON CACHE BOOL "" FORCE)
-elseif(veccore)
-  if(fail-on-missing)
-    find_package(VecCore 0.4.0 CONFIG QUIET REQUIRED)
-  else()
-    find_package(VecCore 0.4.0 CONFIG QUIET)
-    if(NOT VecCore_FOUND)
-      message(STATUS "VecCore not found, support for it disabled.")
-      message(STATUS "Please enable the option 'builtin_veccore' to build VecCore internally.")
-      set(veccore OFF CACHE BOOL "" FORCE)
-    endif()
-  endif()
-endif()
-
-if(veccore AND NOT VecCore_FOUND)
-  set(VecCore_VERSION "0.4.0")
-  set(VecCore_PROJECT "VecCore-${VecCore_VERSION}")
-  set(VecCore_DESTDIR "${CMAKE_BINARY_DIR}/${VecCore_PROJECT}")
-  set(VecCore_ROOTDIR "${VecCore_DESTDIR}/${CMAKE_INSTALL_PREFIX}")
-
-  if(builtin_vc)
-    set(Vc_LIBNAME "${CMAKE_STATIC_LIBRARY_PREFIX}Vc${CMAKE_STATIC_LIBRARY_SUFFIX}")
-    set(Vc_LIBRARY "${VecCore_ROOTDIR}/${_LIBDIR_DEFAULT}/${Vc_LIBNAME}")
-  endif()
-
-  ExternalProject_Add(${VecCore_PROJECT}
-    GIT_REPOSITORY https://gitlab.cern.ch/VecGeom/VecCore.git
-    GIT_TAG v${VecCore_VERSION}
-    BUILD_IN_SOURCE 0
-    BUILD_BYPRODUCTS ${Vc_LIBRARY}
-    LOG_DOWNLOAD 1 LOG_CONFIGURE 1 LOG_BUILD 1 LOG_INSTALL 1
-    CMAKE_ARGS -G ${CMAKE_GENERATOR}
-               -DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH}
-               -DBUILD_TESTING=OFF -DVC=${vc} -DBUILD_VC=${builtin_vc}
-               -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-               -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
-               -DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}
-               -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
-               -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS}
-               -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}
-    INSTALL_COMMAND env DESTDIR=${VecCore_DESTDIR} ${CMAKE_COMMAND} --build . --target install
-  )
-
-  if(builtin_vc)
-    add_library(Vc STATIC IMPORTED)
-    set_property(TARGET Vc PROPERTY IMPORTED_LOCATION ${Vc_LIBRARY})
-    add_dependencies(Vc ${VecCore_PROJECT})
-
-    set(Vc_LIBRARIES Vc)
-    set(Vc_INCLUDE_DIR ${VecCore_ROOTDIR}/include)
-    set(Vc_INCLUDE_DIRS ${VecCore_ROOTDIR}/include)
-    set(Vc_CMAKE_MODULES_DIR "${VecCore_ROOTDIR}/${_LIBDIR_DEFAULT}/cmake/Vc")
-
-    find_package_handle_standard_args(Vc
-      FOUND_VAR Vc_FOUND
-      REQUIRED_VARS Vc_INCLUDE_DIR Vc_LIBRARIES Vc_CMAKE_MODULES_DIR
-      VERSION_VAR Vc_VERSION)
-  endif()
-
-  if (vc OR builtin_vc)
-    set(VecCore_ENABLE_VC True)
-    set(VecCore_INCLUDE_DIRS ${Vc_INCLUDE_DIRS})
-    set(VecCore_LIBRARIES ${Vc_LIBRARIES})
-  endif()
-
-  set(VecCore_INCLUDE_DIRS ${VecCore_INCLUDE_DIRS} ${VecCore_ROOTDIR}/include)
-
-  find_package_handle_standard_args(VecCore
-    FOUND_VAR VecCore_FOUND
-    REQUIRED_VARS VecCore_INCLUDE_DIRS
-    VERSION_VAR VecCore_VERSION)
-
-  install(DIRECTORY ${VecCore_ROOTDIR}/ DESTINATION ".")
 endif()

 #---Check for Vdt--------------------------------------------------------------------


cmake: fix custom bootloader issue

cmake: fix custom bootloader issue

Issue is that when users creates a custom bootloader from
$IDF_PATH/components/bootloader. Parent project build uses the copy but
bootloader subproject build uses the original still. The issue is solved
by passing the custom bootloader as extra component directory so
bootloader build knows to use the new copy (itself) in the build.

--- components/bootloader/project_include.cmake
+++ components/bootloader/project_include.cmake
@@ -57,11 +57,12 @@
     idf_build_get_property(idf_target IDF_TARGET)
     externalproject_add(bootloader
         # TODO: support overriding the bootloader in COMPONENT_PATHS
-        SOURCE_DIR "${idf_path}/components/bootloader/subproject"
+        SOURCE_DIR "${CMAKE_CURRENT_LIST_DIR}/subproject"
         BINARY_DIR "${BOOTLOADER_BUILD_DIR}"
         CMAKE_ARGS  -DSDKCONFIG=${sdkconfig} -DIDF_PATH=${idf_path} -DIDF_TARGET=${idf_target}
                     -DSECURE_BOOT_SIGNING_KEY=${secure_boot_signing_key}
                     -DPYTHON_DEPS_CHECKED=1
+                    -DEXTRA_COMPONENT_DIRS=${CMAKE_CURRENT_LIST_DIR}
         INSTALL_COMMAND ""
         BUILD_ALWAYS 1  # no easy way around this...
         BUILD_BYPRODUCTS ${bootloader_binary_files}


Cosmetic change to .pc.cmake file

Cosmetic change to .pc.cmake file

git-svn-id: 81c7e36bba88e1c415c184412f72132ebfb74002@202 de72303c-5753-0410-9a76-25d1066b02d0

--- yaml-cpp.pc.cmake
+++ yaml-cpp.pc.cmake
@@ -4,7 +4,7 @@
 includedir=@INCLUDE_INSTALL_DIR@

 Name: Yaml-cpp
-Description: A YAML parser for C++
+Description: A YAML parser and emitter for C++
 Version: @YAML_CPP_VERSION@
 Requires:
 Libs: -L${libdir} -lyaml-cpp


ARROW-4989: [C++] Find re2 on Ubuntu if asked to

This allows `cmake -DRE2_SOURCE=SYSTEM` to work from a Conda environment.

Author: Antoine Pitrou <antoine@python.org>

Closes #4007 from pitrou/ARROW-4989-find-ubuntu-re2 and squashes the following commits:

60ecc3a6 <Antoine Pitrou> ARROW-4989:  Find re2 on Ubuntu if asked to

--- cpp/cmake_modules/ThirdpartyToolchain.cmake
+++ cpp/cmake_modules/ThirdpartyToolchain.cmake
@@ -35,25 +35,28 @@
 # ----------------------------------------------------------------------
 # Resolve the dependencies

+# TODO: add uriparser here when it gets a conda package
 set(ARROW_THIRDPARTY_DEPENDENCIES
+    benchmark
+    BOOST
+    Brotli
+    BZip2
+    c-ares
     double-conversion
-    BROTLI
+    Flatbuffers
+    gflags
+    GLOG
+    gRPC
+    GTest
+    LLVM
+    Lz4
+    RE2
+    Protobuf
+    RapidJSON
     Snappy
-    gflags
     Thrift
-    Protobuf
-    GTEST
-    benchmark
-    RapidJSON
-    Flatbuffers
     ZLIB
-    BZip2
-    LZ4
-    ZSTD
-    RE2
-    c-ares
-    LLVM
-    BOOST)
+    ZSTD)

 message(STATUS "Using ${ARROW_DEPENDENCY_SOURCE} approach to find dependencies")

@@ -74,75 +77,64 @@
   message(STATUS "Setting (unset) dependency *_ROOT variables: ${ARROW_PACKAGE_PREFIX}")
   set(ENV{PKG_CONFIG_PATH} "${ARROW_PACKAGE_PREFIX}/lib/pkgconfig/")

-  if(NOT BOOST_ROOT)
-    set(BOOST_ROOT ${ARROW_PACKAGE_PREFIX})
-  endif()
   if(NOT ENV{BOOST_ROOT})
     set(ENV{BOOST_ROOT} ${ARROW_PACKAGE_PREFIX})
   endif()
   if(NOT ENV{Boost_ROOT})
     set(ENV{Boost_ROOT} ${ARROW_PACKAGE_PREFIX})
   endif()
-
-  foreach(DEPENDENCY ${ARROW_THIRDPARTY_DEPENDENCIES})
-    if(NOT ${DEPENDENCY}_ROOT)
+endif()
+
+# For each dependency, set dependency source to global default, if unset
+foreach(DEPENDENCY ${ARROW_THIRDPARTY_DEPENDENCIES})
+  if("${${DEPENDENCY}_SOURCE}" STREQUAL "")
+    set(${DEPENDENCY}_SOURCE ${ARROW_ACTUAL_DEPENDENCY_SOURCE})
+    # If no ROOT was supplied and we have a global prefix, use it
+    if(NOT ${DEPENDENCY}_ROOT AND ARROW_PACKAGE_PREFIX)
       set(${DEPENDENCY}_ROOT ${ARROW_PACKAGE_PREFIX})
     endif()
-  endforeach()
-endif()
-
-function(get_dependency_source DEPENDENCY_NAME)
-  if("${${DEPENDENCY_NAME}_SOURCE}" STREQUAL "")
-    set(${DEPENDENCY_NAME}_SOURCE ${ARROW_ACTUAL_DEPENDENCY_SOURCE} PARENT_SCOPE)
-  endif()
-
-  # If AUTO was specified and a ROOT was supplied, use this root.
-  if(${DEPENDENCY_NAME}_ROOT AND ${DEPENDENCY_NAME}_SOURCE STREQUAL "AUTO")
-    set(${DEPENDENCY_NAME}_SOURCE "SYSTEM" PARENT_SCOPE)
-  endif()
-endfunction()
+  endif()
+endforeach()

 macro(build_dependency DEPENDENCY_NAME)
-  if("${DEPENDENCY_NAME}" STREQUAL "Brotli")
+  if("${DEPENDENCY_NAME}" STREQUAL "benchmark")
+    build_benchmark()
+  elseif("${DEPENDENCY_NAME}" STREQUAL "Brotli")
     build_brotli()
+  elseif("${DEPENDENCY_NAME}" STREQUAL "BZip2")
+    build_bzip2()
+  elseif("${DEPENDENCY_NAME}" STREQUAL "c-ares")
+    build_cares()
+  elseif("${DEPENDENCY_NAME}" STREQUAL "Flatbuffers")
+    build_flatbuffers()
+  elseif("${DEPENDENCY_NAME}" STREQUAL "gflags")
+    build_gflags()
   elseif("${DEPENDENCY_NAME}" STREQUAL "GLOG")
     build_glog()
-  elseif("${DEPENDENCY_NAME}" STREQUAL "gflags")
-    build_gflags()
+  elseif("${DEPENDENCY_NAME}" STREQUAL "gRPC")
+    build_grpc()
+  elseif("${DEPENDENCY_NAME}" STREQUAL "GTest")
+    build_gtest()
+  elseif("${DEPENDENCY_NAME}" STREQUAL "Lz4")
+    build_lz4()
+  elseif("${DEPENDENCY_NAME}" STREQUAL "Protobuf")
+    build_protobuf()
+  elseif("${DEPENDENCY_NAME}" STREQUAL "RE2")
+    build_re2()
   elseif("${DEPENDENCY_NAME}" STREQUAL "Thrift")
     build_thrift()
-  elseif("${DEPENDENCY_NAME}" STREQUAL "Protobuf")
-    build_protobuf()
-  elseif("${DEPENDENCY_NAME}" STREQUAL "GTest")
-    build_gtest()
-  elseif("${DEPENDENCY_NAME}" STREQUAL "benchmark")
-    build_benchmark()
-  elseif("${DEPENDENCY_NAME}" STREQUAL "Flatbuffers")
-    build_flatbuffers()
+  elseif("${DEPENDENCY_NAME}" STREQUAL "uriparser")
+    build_uriparser()
   elseif("${DEPENDENCY_NAME}" STREQUAL "ZLIB")
     build_zlib()
-  elseif("${DEPENDENCY_NAME}" STREQUAL "Lz4")
-    build_lz4()
   elseif("${DEPENDENCY_NAME}" STREQUAL "ZSTD")
     build_zstd()
-  elseif("${DEPENDENCY_NAME}" STREQUAL "RE2")
-    build_re2()
-  elseif("${DEPENDENCY_NAME}" STREQUAL "c-ares")
-    build_cares()
-  elseif("${DEPENDENCY_NAME}" STREQUAL "gRPC")
-    build_grpc()
-  elseif("${DEPENDENCY_NAME}" STREQUAL "BZip2")
-    build_bzip2()
-  elseif("${DEPENDENCY_NAME}" STREQUAL "uriparser")
-    build_uriparser()
   else()
     message(FATAL_ERROR "Unknown thirdparty dependency to build: ${DEPENDENCY_NAME}")
   endif()
 endmacro()

 macro(resolve_dependency DEPENDENCY_NAME)
-  get_dependency_source(${DEPENDENCY_NAME})
-
   if(${DEPENDENCY_NAME}_SOURCE STREQUAL "AUTO")
     find_package(${DEPENDENCY_NAME} QUIET)
     if(NOT ${DEPENDENCY_NAME}_FOUND)
@@ -492,8 +484,6 @@
 const int flags_ = double_conversion::StringToDoubleConverter::ALLOW_CASE_INSENSIBILITY;
       }" DOUBLE_CONVERSION_HAS_CASE_INSENSIBILITY)
 endmacro()
-
-get_dependency_source(double-conversion)

 if(double-conversion_SOURCE STREQUAL "AUTO")
   # Debian does not ship cmake configs for double-conversion
@@ -682,7 +672,6 @@
 endmacro()

 if(ARROW_WITH_SNAPPY)
-  get_dependency_source(Snappy)
   if(Snappy_SOURCE STREQUAL "AUTO")
     # Normally *Config.cmake files reside in /usr/lib/cmake but Snappy
     # errornously places them in ${CMAKE_ROOT}/Modules/
@@ -921,7 +910,6 @@
 endmacro()

 if(ARROW_NEED_GFLAGS)
-  get_dependency_source(gflags)
   if(gflags_SOURCE STREQUAL "AUTO")
     find_package(gflags QUIET)
     if(NOT gflags_FOUND)
@@ -1479,7 +1467,6 @@

 # TODO: Check for 1.1.0+
 if(ARROW_WITH_RAPIDJSON)
-  get_dependency_source(RapidJSON)
   if(RapidJSON_SOURCE STREQUAL "AUTO")
     # Fedora packages place the package information at the wrong location.
     # https://bugzilla.redhat.com/show_bug.cgi?id=1680400
@@ -1557,7 +1544,6 @@
 endmacro()

 if(ARROW_WITH_FLATBUFFERS)
-  get_dependency_source(Flatbuffers)
   if(Flatbuffers_SOURCE STREQUAL "AUTO")
     find_package(Flatbuffers QUIET)
     # Older versions of Flatbuffers (that are not built using CMake)
@@ -1918,7 +1904,6 @@
 endmacro()

 if(ARROW_WITH_GRPC)
-  get_dependency_source(c-ares)
   if(c-ares_SOURCE STREQUAL "AUTO")
     find_package(c-ares QUIET)
     if(NOT c-ares_FOUND)
@@ -2095,7 +2080,6 @@
                                      "${OPENSSL_INCLUDE_DIR}")
   endif()

-  get_dependency_source(gRPC)
   if(gRPC_SOURCE STREQUAL "AUTO")
     find_package(gRPC QUIET)
     if(NOT gRPC_FOUND)


Split core functionality into a library.

--- catkin.cmake
+++ catkin.cmake
@@ -20,8 +20,7 @@

 add_definitions(--std=c++0x)

-openrave_plugin("${PROJECT_NAME}_plugin"
-    src/or_interactivemarker_plugin.cpp
+add_library(${PROJECT_NAME} SHARED
     src/or_interactivemarker.cpp
     src/or_conversions.cpp
     src/KinBodyMarker.cpp
@@ -31,6 +30,14 @@
     src/JointMarker.cpp
     src/ManipulatorMarker.cpp
 )
-target_link_libraries("${PROJECT_NAME}_plugin"
+target_link_libraries(${PROJECT_NAME}
     ${catkin_LIBRARIES}
 )
+
+openrave_plugin(${PROJECT_NAME}_plugin
+    src/or_interactivemarker_plugin.cpp
+)
+target_link_libraries(${PROJECT_NAME}_plugin
+    ${PROJECT_NAME}
+    ${catkin_LIBRARIES}
+)


ARROW-4889: [C++] Add STATUS messages for Protobuf in CMake

This allows for better information when users report problems with Protobuf detection.

Author: Korn, Uwe <Uwe.Korn@blue-yonder.com>

Closes #3913 from xhochy/ARROW-4889 and squashes the following commits:

3a84ea391 <Korn, Uwe> ARROW-4889:  Add STATUS messages for Protobuf in CMake

--- cpp/cmake_modules/ThirdpartyToolchain.cmake
+++ cpp/cmake_modules/ThirdpartyToolchain.cmake
@@ -974,6 +974,7 @@

 if (ARROW_WITH_PROTOBUF)
   resolve_dependency(Protobuf)
+
   # TODO: Don't use global includes but rather target_include_directories
   include_directories(SYSTEM ${PROTOBUF_INCLUDE_DIR})

@@ -1001,6 +1002,16 @@
             IMPORTED_LOCATION "${PROTOBUF_PROTOC_EXECUTABLE}"
     )
   endif()
+
+  # Log protobuf paths as we often see issues with mixed sources for
+  # the libraries and protoc.
+  get_target_property(PROTOBUF_PROTOC_EXECUTABLE protobuf::protoc IMPORTED_LOCATION)
+  message(STATUS "Found protoc: ${PROTOBUF_PROTOC_EXECUTABLE}")
+  # Protobuf_PROTOC_LIBRARY is set by all versions of FindProtobuf.cmake
+  message(STATUS "Found libprotoc: ${Protobuf_PROTOC_LIBRARY}")
+  get_target_property(PROTOBUF_LIBRARY protobuf::libprotobuf IMPORTED_LOCATION)
+  message(STATUS "Found libprotobuf: ${PROTOBUF_LIBRARY}")
+  message(STATUS "Found protobuf headers: ${PROTOBUF_INCLUDE_DIR}")
 endif()

 if (MSVC)


Replace tabs with spaces.

Replace tabs with spaces.

Change-Id: Ic79c883050515991b7f18e32e737cce3a45ebd4e

--- CMake/GetGitRevisionDescription.cmake
+++ CMake/GetGitRevisionDescription.cmake
@@ -31,7 +31,7 @@
 # http://www.boost.org/LICENSE_1_0.txt)

 if(__get_git_revision_description)
-	return()
+  return()
 endif()
 set(__get_git_revision_description YES)

@@ -42,56 +42,56 @@
 find_package(Git QUIET)

 function(get_git_head_revision _refvar _hashvar)
-	if(NOT GIT_EXECUTABLE)
-		set(${_refvar} "GIT-NOTFOUND" PARENT_SCOPE)
-		set(${_hashvar} "GIT-NOTFOUND" PARENT_SCOPE)
-		return()
-	endif()
+  if(NOT GIT_EXECUTABLE)
+    set(${_refvar} "GIT-NOTFOUND" PARENT_SCOPE)
+    set(${_hashvar} "GIT-NOTFOUND" PARENT_SCOPE)
+    return()
+  endif()

-	set(src_dir ${PROJECT_SOURCE_DIR})
-	set(bin_dir ${PROJECT_BINARY_DIR})
+  set(src_dir ${PROJECT_SOURCE_DIR})
+  set(bin_dir ${PROJECT_BINARY_DIR})

-	execute_process(COMMAND ${GIT_EXECUTABLE} rev-parse --git-dir
-		WORKING_DIRECTORY ${src_dir}
-		OUTPUT_VARIABLE GIT_DIR
-		ERROR_VARIABLE error
-		RESULT_VARIABLE failed
-		OUTPUT_STRIP_TRAILING_WHITESPACE
-		)
-	if(NOT IS_ABSOLUTE "${GIT_DIR}")
-		set(GIT_DIR "${src_dir}/${GIT_DIR}")
-	endif()
-	if(failed OR NOT EXISTS "${GIT_DIR}/HEAD")
-		# not in git
-		set(${_refvar} "GITDIR-NOTFOUND" PARENT_SCOPE)
-		set(${_hashvar} "GITDIR-NOTFOUND" PARENT_SCOPE)
-		return()
-	endif()
-	set(GIT_DATA "${bin_dir}/CMakeFiles/git-data")
-	if(NOT EXISTS "${GIT_DATA}")
-		file(MAKE_DIRECTORY "${GIT_DATA}")
-	endif()
-	configure_file("${GIT_DIR}/HEAD" "${GIT_DATA}/HEAD" COPYONLY)
+  execute_process(COMMAND ${GIT_EXECUTABLE} rev-parse --git-dir
+    WORKING_DIRECTORY ${src_dir}
+    OUTPUT_VARIABLE GIT_DIR
+    ERROR_VARIABLE error
+    RESULT_VARIABLE failed
+    OUTPUT_STRIP_TRAILING_WHITESPACE
+    )
+  if(NOT IS_ABSOLUTE "${GIT_DIR}")
+    set(GIT_DIR "${src_dir}/${GIT_DIR}")
+  endif()
+  if(failed OR NOT EXISTS "${GIT_DIR}/HEAD")
+    # not in git
+    set(${_refvar} "GITDIR-NOTFOUND" PARENT_SCOPE)
+    set(${_hashvar} "GITDIR-NOTFOUND" PARENT_SCOPE)
+    return()
+  endif()
+  set(GIT_DATA "${bin_dir}/CMakeFiles/git-data")
+  if(NOT EXISTS "${GIT_DATA}")
+    file(MAKE_DIRECTORY "${GIT_DATA}")
+  endif()
+  configure_file("${GIT_DIR}/HEAD" "${GIT_DATA}/HEAD" COPYONLY)

-	file(STRINGS "${GIT_DIR}/HEAD" head LIMIT_COUNT 1 LIMIT_INPUT 1024)
-	if("${head}" MATCHES "^ref: (.*)$")
-		set(HEAD_REF "${CMAKE_MATCH_1}")
-		if(EXISTS "${GIT_DIR}/${HEAD_REF}")
-			configure_file("${GIT_DIR}/${HEAD_REF}" "${GIT_DATA}/HEAD-REF" COPYONLY)
-		endif()
-	else()
-		set(HEAD_REF "")
-	endif()
-	execute_process(COMMAND ${GIT_EXECUTABLE} rev-parse HEAD
-		WORKING_DIRECTORY ${src_dir}
-		OUTPUT_VARIABLE HEAD_HASH OUTPUT_STRIP_TRAILING_WHITESPACE
-		ERROR_VARIABLE error
-		RESULT_VARIABLE failed)
-	if(failed)
-		set(HEAD_HASH "HEAD-HASH-NOTFOUND")
-	endif()
-	set(${_refvar} "${HEAD_REF}" PARENT_SCOPE)
-	set(${_hashvar} "${HEAD_HASH}" PARENT_SCOPE)
+  file(STRINGS "${GIT_DIR}/HEAD" head LIMIT_COUNT 1 LIMIT_INPUT 1024)
+  if("${head}" MATCHES "^ref: (.*)$")
+    set(HEAD_REF "${CMAKE_MATCH_1}")
+    if(EXISTS "${GIT_DIR}/${HEAD_REF}")
+      configure_file("${GIT_DIR}/${HEAD_REF}" "${GIT_DATA}/HEAD-REF" COPYONLY)
+    endif()
+  else()
+    set(HEAD_REF "")
+  endif()
+  execute_process(COMMAND ${GIT_EXECUTABLE} rev-parse HEAD
+    WORKING_DIRECTORY ${src_dir}
+    OUTPUT_VARIABLE HEAD_HASH OUTPUT_STRIP_TRAILING_WHITESPACE
+    ERROR_VARIABLE error
+    RESULT_VARIABLE failed)
+  if(failed)
+    set(HEAD_HASH "HEAD-HASH-NOTFOUND")
+  endif()
+  set(${_refvar} "${HEAD_REF}" PARENT_SCOPE)
+  set(${_hashvar} "${HEAD_HASH}" PARENT_SCOPE)
 endfunction()

 # get the number of commits since the file has last been modified
@@ -128,42 +128,42 @@
 endfunction()

 function(git_describe _var)
-	get_git_head_revision(refspec hash)
-	if(NOT GIT_FOUND)
-		set(${_var} "GIT-NOTFOUND"  PARENT_SCOPE)
-		return()
-	endif()
-	if(NOT hash)
-		set(${_var} "HEAD-HASH-NOTFOUND"  PARENT_SCOPE)
-		return()
-	endif()
+  get_git_head_revision(refspec hash)
+  if(NOT GIT_FOUND)
+    set(${_var} "GIT-NOTFOUND"  PARENT_SCOPE)
+    return()
+  endif()
+  if(NOT hash)
+    set(${_var} "HEAD-HASH-NOTFOUND"  PARENT_SCOPE)
+    return()
+  endif()

-	set(src_dir ${PROJECT_SOURCE_DIR})
+  set(src_dir ${PROJECT_SOURCE_DIR})

-	# TODO sanitize
-	#if((${ARGN}" MATCHES "&&") OR
-	#	(ARGN MATCHES "||") OR
-	#	(ARGN MATCHES "\\;"))
-	#	message("Please report the following error to the project!")
-	#	message(FATAL_ERROR "Looks like someone's doing something nefarious with git_describe! Passed arguments ${ARGN}")
-	#endif()
+  # TODO sanitize
+  #if((${ARGN}" MATCHES "&&") OR
+  #	(ARGN MATCHES "||") OR
+  #	(ARGN MATCHES "\\;"))
+  #	message("Please report the following error to the project!")
+  #	message(FATAL_ERROR "Looks like someone's doing something nefarious with git_describe! Passed arguments ${ARGN}")
+  #endif()

-	#message(STATUS "Arguments to execute_process: ${ARGN}")
+  #message(STATUS "Arguments to execute_process: ${ARGN}")

-	execute_process(COMMAND "${GIT_EXECUTABLE}" describe ${hash} ${ARGN}
-		WORKING_DIRECTORY "${src_dir}"
-		RESULT_VARIABLE res
-		OUTPUT_VARIABLE out
-		ERROR_QUIET
-		OUTPUT_STRIP_TRAILING_WHITESPACE)
-	if(NOT res EQUAL 0)
-		set(out "${out}-${res}-NOTFOUND")
-	endif()
+  execute_process(COMMAND "${GIT_EXECUTABLE}" describe ${hash} ${ARGN}
+    WORKING_DIRECTORY "${src_dir}"
+    RESULT_VARIABLE res
+    OUTPUT_VARIABLE out
+    ERROR_QUIET
+    OUTPUT_STRIP_TRAILING_WHITESPACE)
+  if(NOT res EQUAL 0)
+    set(out "${out}-${res}-NOTFOUND")
+  endif()

-	set(${_var} "${out}" PARENT_SCOPE)
+  set(${_var} "${out}" PARENT_SCOPE)
 endfunction()

 function(git_get_exact_tag _var)
-	git_describe(out --exact-match ${ARGN})
-	set(${_var} "${out}" PARENT_SCOPE)
+  git_describe(out --exact-match ${ARGN})
+  set(${_var} "${out}" PARENT_SCOPE)
 endfunction()


Still a strange behavior on Appveyor

Still a strange behavior on Appveyor

--- CMake/FindEigen.cmake
+++ CMake/FindEigen.cmake
@@ -89,13 +89,13 @@
   /opt/local/include
   /usr/include)
 # Additional suffixes to try appending to each search path.
-file(GLOB EIGEN_CANDIDATES ${EIGEN_ROOT}*)
+file(GLOB EIGEN_CANDIDATES ${EIGEN_ROOT}/*)
 LIST(APPEND EIGEN_CHECK_PATH_SUFFIXES
+  /
   eigen3 # Default root directory for Eigen.
   Eigen/include/eigen3 ) # Windows (for C:/Program Files prefix).
 MESSAGE(status ${EIGEN_ROOT})
 MESSAGE(status ${EIGEN_CANDIDATES})
-MESSAGE(status ${EIGEN_ROOT}eigen*)
 # Search supplied hint directories first if supplied.
 FIND_PATH(EIGEN_INCLUDE_DIR
   NAMES Eigen/Core


Set `REALM_HAVE_CONFIG` when building core.

Object store and the bindings always require that core be built with it set.

--- CMake/RealmCore.cmake
+++ CMake/RealmCore.cmake
@@ -22,8 +22,10 @@
     set(MAKE_EQUAL_MAKE "MAKE=$(MAKE)")
 endif()

+set(MAKE_FLAGS "REALM_HAVE_CONFIG=1")
+
 if(SANITIZER_FLAGS)
-  set(MAKE_FLAGS "EXTRA_CFLAGS=${SANITIZER_FLAGS}" "EXTRA_LDFLAGS=${SANITIZER_FLAGS}")
+  set(MAKE_FLAGS ${MAKE_FLAGS} "EXTRA_CFLAGS=${SANITIZER_FLAGS}" "EXTRA_LDFLAGS=${SANITIZER_FLAGS}")
 endif()

 if (${CMAKE_VERSION} VERSION_GREATER "3.4.0")


Use _INIT to set linker flags in toolchain file

For whatever reason, using CMAKE_EXE_LINKER_FLAGS_INIT works in earlier
CMake versions.

--- firmware/cmake/toolchain-arm-cortex-m.cmake
+++ firmware/cmake/toolchain-arm-cortex-m.cmake
@@ -8,7 +8,7 @@

 set(CMAKE_C_COMPILER arm-none-eabi-gcc)
 set(CMAKE_CXX_COMPILER arm-none-eabi-g++)
-set(CMAKE_EXE_LINKER_FLAGS "--specs=nosys.specs")
+set(CMAKE_EXE_LINKER_FLAGS_INIT "--specs=nosys.specs")

 execute_process(
   COMMAND ${CMAKE_C_COMPILER} -print-file-name=libc.a


cmake: unit test build dir is created prior to compile to silence linker warnings

--- test/min-lib-unittest.cmake
+++ test/min-lib-unittest.cmake
@@ -26,6 +26,13 @@
 if (APPLE)
 	target_link_libraries(${PROJECT_NAME} "-weak_framework JitterAPI")
 	set_target_properties(${PROJECT_NAME} PROPERTIES LINK_FLAGS "-Wl,-F'${C74_MAX_API_DIR}/lib/mac'")
+
+    # The build dir won't be present the first time the test is compiled.
+    # This isn't a problem but it does generate linker warnings about the folder not existing.
+    # So we create the folder in advance.
+
+    file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/Debug")
+    file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/Release")
 endif ()
 if (WIN32)
 	add_custom_command(	TARGET ${PROJECT_NAME}


hunter_find_helper: Fix INTERFACE_INCLUDE_DIRECTORIES

[skip ci]

--- cmake/modules/hunter_find_helper.cmake
+++ cmake/modules/hunter_find_helper.cmake
@@ -103,7 +103,7 @@
       PROPERTIES
       IMPORTED_LINK_INTERFACE_LANGUAGE "CXX"
       IMPORTED_LOCATION "${_hunter_library}"
-      INTERFACE_INCLUDE_DIRECTORIES ""
+      INTERFACE_INCLUDE_DIRECTORIES "${_hunter_header}"
   )

   unset(_hunter_library CACHE)


tests.cmake: Relax some of the Planimeter tests for 32-bit compiles with Visual Studio.

--- tools/tests.cmake
+++ tools/tests.cmake
@@ -562,11 +562,11 @@
 add_test (NAME Planimeter24 COMMAND Planimeter
   --input-string "${_t};${_t};${_t}" -r -s)
 set_tests_properties (Planimeter21 Planimeter22 PROPERTIES
-  PASS_REGULAR_EXPRESSION " 118301654599714\\.[234]") # 3*r
+  PASS_REGULAR_EXPRESSION " 118301654599714\\.[2-5]") # 3*r
 set_tests_properties (Planimeter23 PROPERTIES
-  PASS_REGULAR_EXPRESSION " -118301654599714\\.[234]") # -3*r
+  PASS_REGULAR_EXPRESSION " -118301654599714\\.[2-5]") # -3*r
 set_tests_properties (Planimeter24 PROPERTIES
-  PASS_REGULAR_EXPRESSION " 391763967124374\\.[0123]") # -3*r+a0
+  PASS_REGULAR_EXPRESSION " 391763967124374\\.[0-3]") # -3*r+a0
 add_test (NAME Planimeter25 COMMAND Planimeter
   --input-string "${_t};${_t};${_t};${_t}")
 add_test (NAME Planimeter26 COMMAND Planimeter
@@ -579,9 +579,9 @@
 # Planimeter27 returned 4*r-a0 and -4*r+a0, resp.  Fixed in 1.50 to
 # return +/-4*r
 set_tests_properties (Planimeter25 Planimeter26 PROPERTIES
-  PASS_REGULAR_EXPRESSION " 157735539466285\\.[678]") # 4*r
+  PASS_REGULAR_EXPRESSION " 157735539466285\\.[6-9]") # 4*r
 set_tests_properties (Planimeter27 PROPERTIES
-  PASS_REGULAR_EXPRESSION " -157735539466285\\.[678]") # -4*r
+  PASS_REGULAR_EXPRESSION " -157735539466285\\.[6-9]") # -4*r
 set_tests_properties (Planimeter28 PROPERTIES
   PASS_REGULAR_EXPRESSION " 352330082257802\\.[5-9]") # -4*r+a0


Using the environmental variable ROS_ROOT (commit by rober)

--- omip/third_party/bflConfig.cmake
+++ omip/third_party/bflConfig.cmake
@@ -83,8 +83,8 @@
 # flag project as catkin-based to distinguish if a find_package()-ed project is a catkin project
 set(bfl_FOUND_CATKIN_PROJECT TRUE)

-set(bfl_INCLUDE_DIRS ${ROS_ROOT}/../../include/bfl)
-set(bfl_LIBRARIES_DIRS ${ROS_ROOT}/../../lib)
+set(bfl_INCLUDE_DIRS $ENV{ROS_ROOT}/../../include/bfl)
+set(bfl_LIBRARIES_DIRS $ENV{ROS_ROOT}/../../lib)
 set(bfl_LIBRARIES ${bfl_LIBRARIES_DIRS}/liborocos-bfl.so)

 set(pkg_cfg_extras "")


new namespace for formatting

new namespace for formatting

--- src/cmake/sources.cmake
+++ src/cmake/sources.cmake
@@ -8,6 +8,8 @@
 set(SRC_DIRS
     But
     But/Container
+    But/Format
+    But/Format/detail
     But/Log
     But/Log/Backend
     But/Log/Destination


cmake: hopefully fix qtcreator include issue with -isystem vs -I

--- cmake/DuneUtils.cmake
+++ cmake/DuneUtils.cmake
@@ -23,30 +23,27 @@

 MACRO(INCLUDE_DIR)
 	FOREACH( ARG ${ARGN} )
-# 		INCLUDE_DIRECTORIES(${ARG})
 		LIST(APPEND MY_CXX_FLAGS "-I${ARG}" )
+		INCLUDE_DIRECTORIES(${ARG})
     ENDFOREACH( ARG )
 ENDMACRO(INCLUDE_DIR)

 MACRO(INCLUDE_SYS_DIR)
 	FOREACH( ARG ${ARGN} )
-# 		INCLUDE_DIRECTORIES(${ARG})
-		LIST(APPEND MY_CXX_FLAGS "-isystem${ARG}" "-I${ARG}")
+		LIST(APPEND MY_CXX_FLAGS "-isystem${ARG}")
+        INCLUDE_DIRECTORIES(${ARG})
     ENDFOREACH( ARG )
 ENDMACRO(INCLUDE_SYS_DIR)

 MACRO( HEADERCHECK )
-	ADD_CUSTOM_TARGET( headercheck ALL SOURCES ${ARGN} )
+	ADD_CUSTOM_TARGET( headercheck SOURCES ${ARGN} )
 	FOREACH( HEADER ${ARGN} )
 		GET_FILENAME_COMPONENT( fn ${HEADER} NAME )
 		SET( TEST_NAME "headercheck_${fn}")
 		#LISTTOSTRING( MY_CXX_FLAGS TEST_NAME_FLAGS )
 		TO_LIST_SPACES( MY_CXX_FLAGS TEST_NAME_FLAGS )
 		SET(XARGS ${TEST_NAME_FLAGS} -c ${HEADER} -o ${CMAKE_CURRENT_BINARY_DIR}/${TEST_NAME}.o )
-		ADD_CUSTOM_COMMAND(  TARGET headercheck
-			PRE_BUILD
-			COMMAND ${CMAKE_CXX_COMPILER} ${XARGS}
-			VERBATIM )
+		ADD_CUSTOM_TARGET(  ${TEST_NAME} ${CMAKE_CXX_COMPILER} ${XARGS} )
 		ADD_TEST( ${TEST_NAME} ${CMAKE_CXX_COMPILER} ${XARGS} )
 		add_dependencies( headercheck ${TEST_NAME} )
 	ENDFOREACH( HEADER )


Add Github Actions support.

Add Github Actions support.

--- run_ctest.cmake
+++ run_ctest.cmake
@@ -172,6 +172,9 @@
     set(CTEST_SITE "Circle CI")
 elseif(DEFINED ENV{DRONE})
     set(CTEST_SITE "Drone CI")
+elseif(DEFINED ENV{GITHUB_WORKSPACE})
+    set(CTEST_SITE "Github CI")
+    set(CTEST_SOURCE_DIRECTORY "$ENV{GITHUB_WORKSPACE}")
 elseif(DEFINED ENV{GITLAB_CI})
     set(CTEST_SITE "GitLab CI")
 elseif(DEFINED ENV{MAGNUM})


Removing blocked out CMake code

Removing blocked out CMake code

--- Resources/CMake/MXA_CMakeMacros.cmake
+++ Resources/CMake/MXA_CMakeMacros.cmake
@@ -80,23 +80,7 @@
 # --------------------------------------------------------------------

 macro(LibraryProperties targetName )
-message(STATUS "Adding Install support for ${targetName}")
-if (0)
-    if (WIN32 AND NOT MINGW)
-        SET (DEBUG_EXTENSION "_d")
-    else()
-        SET (DEBUG_EXTENSION "_debug")
-    endif()
-
-    IF (WIN32 AND NOT MINGW)
-        SET(LIBRARY_RELEASE_NAME "lib${targetName}" CACHE INTERNAL "" FORCE)
-        SET(LIBRARY_DEBUG_NAME "lib${targetName}${DEBUG_EXTENSION}" CACHE INTERNAL "" FORCE)
-    ELSE (WIN32 AND NOT MINGW)
-        SET(LIBRARY_RELEASE_NAME "${targetName}" CACHE INTERNAL "" FORCE)
-        SET(LIBRARY_DEBUG_NAME "${targetName}${DEBUG_EXTENSION}" CACHE INTERNAL "" FORCE)
-    ENDIF(WIN32 AND NOT MINGW)
- endif()
-
+    message(STATUS "Adding Install support for ${targetName}"
     if ( NOT BUILD_SHARED_LIBS AND MSVC)
       SET_TARGET_PROPERTIES( ${targetName}
         PROPERTIES


Fix the hardcoded Debian package dependencies

--- src/gop/cmake/cpack_settings.cmake
+++ src/gop/cmake/cpack_settings.cmake
@@ -2,7 +2,7 @@

 if (${CPACK_GENERATOR} STREQUAL "DEB")
    #set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
-   set(CPACK_DEBIAN_PACKAGE_DEPENDS "libc6 (>=2.7-18), openssl (>=1.0.1f), zlib (>=1.2.8), czmq (>=1.4.1), apr-accre (>= 1.5.0), apr-util-ACCRE (>=1.5.3), zeromq (=>4.0.1)")
+   set(CPACK_DEBIAN_PACKAGE_DEPENDS "libc6 (>=2.7-18), openssl (>=1.0.1f), zlib1g (>= 1:1.1.4), czmq (>=1.4.1), libapr-accre1 (>= 1.5.0), libapr-accre-util1 (>=1.5.3), libzmq3 (>=4.0.1)")
 elseif (${CPACK_GENERATOR} STREQUAL "RPM")
    set(CPACK_RPM_PACKAGE_DEPENDS "libc6 (>=2.7-18), openssl (>=1.0.1f), zlib (>=1.2.8), czmq (>=1.4.1), apr-accre (>= 1.5.0), apr-util-ACCRE (>=1.5.3), zeromq (=>4.0.1)")
    #set(CPACK_RPM_PACKAGE_AUTOREQPROV " no")


Adding support for easybuild

Adding support for easybuild

Former-commit-id: 4959f150edf1637e26da375645830640325300bf

--- cmake-modules/Fetch_Glog.cmake
+++ cmake-modules/Fetch_Glog.cmake
@@ -15,7 +15,7 @@
     # In addition, the library may be .so
     get_filename_component(glog_dir ${GLOG_LIBRARIES} DIRECTORY)
     get_filename_component(glog_we  ${GLOG_LIBRARIES} NAME_WE)
-    set(GLOG_LIBRARIES "${glog_dir}/glog_we${CUSTOM_SUFFIX}")
+    set(GLOG_LIBRARIES "${glog_dir}/${glog_we}${CUSTOM_SUFFIX}")

     set_target_properties(glog::glog PROPERTIES INTERFACE_LINK_LIBRARIES "${GLOG_LIBRARIES}")
     set_target_properties(glog::glog PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${GLOG_INCLUDE_DIR}")


unwind::full needs to be an interface target to avoid it being "NOTFOUND"

Former-commit-id: 9407c61f12b3d9b2e6f055c0cdc8e857f81f02c4

--- cmake-modules/Fetch_glog.cmake
+++ cmake-modules/Fetch_glog.cmake
@@ -14,7 +14,7 @@
 find_package(Unwind) # If found defines target unwind::unwind
 find_library(LZMA_LIB NAMES lzma)
 find_library(GCC_EH_LIB NAMES gcc_eh)
-add_library(unwind::full ${LINK_TYPE} IMPORTED)
+add_library(unwind::full INTERFACE IMPORTED)
 if(TARGET unwind::unwind AND LZMA_LIB AND GCC_EH_LIB)
     target_link_libraries(unwind::full INTERFACE gcc_eh unwind::unwind lzma)
 endif()


Add option to build with C++20.

Add option to build with C++20.

--- cmake/CubBuildTargetList.cmake
+++ cmake/CubBuildTargetList.cmake
@@ -18,7 +18,7 @@
 #   - <prop_var> is any valid cmake identifier.
 #   - <target_name> is the name of a CUB target.
 #   - <prop> is one of the following:
-#     - DIALECT: The C++ dialect. Valid values: 11, 14, 17.
+#     - DIALECT: The C++ dialect. Valid values: 11, 14, 17, 20.
 #     - PREFIX: A unique prefix that should be used to name all
 #       targets/tests/examples that use this configuration.
 #
@@ -35,7 +35,7 @@

 # Dialects:
 set(CUB_CPP_DIALECT_OPTIONS
-  11 14 17
+  11 14 17 20
   CACHE INTERNAL "C++ dialects supported by CUB." FORCE
 )


cmake: HextEnableWarnings: add warning switch -Wunsafe-loop-optimizations

--- cmake/HextEnableWarnings.cmake
+++ cmake/HextEnableWarnings.cmake
@@ -23,7 +23,7 @@
     "-Wsign-compare" "-Wsign-promo" "-Wstack-protector" "-Wstrict-aliasing=2"
     "-Wstrict-null-sentinel" "-Wstrict-overflow=5" "-Wswitch"
     "-Wtrigraphs" "-Wundef" "-Wuninitialized" "-Wunknown-pragmas"
-    "-Wunreachable-code" "-Wunused"
+    "-Wunreachable-code" "-Wunused" "-Wunsafe-loop-optimizations"
     "-Wunused-function" "-Wunused-label" "-Wunused-parameter" "-Wunused-value"
     "-Wunused-variable" "-Wvariadic-macros" "-Wvolatile-register-var"
     "-Wwrite-strings" "-Wmissing-noreturn" "-Wsign-conversion"
@@ -32,7 +32,6 @@
     # "-Wswitch-default": generated ragel code uses switch without default,
     #                     we cannot do anything about that
     # "-Wpadded": also warns when it's impossible to shrink padding
-    # "-Wunsafe-loop-optimizations": emits a warning for each for-range loop
   )
 ENDIF(CMAKE_COMPILER_IS_GNUCXX)


adding support for using OPENNI_ROOT cmake and environment variables to find OpenNI

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

--- cmake/Modules/FindOpenNI.cmake
+++ cmake/Modules/FindOpenNI.cmake
@@ -18,14 +18,15 @@

 #add a hint so that it can find it without the pkg-config
 find_path(OPENNI_INCLUDE_DIR XnStatus.h
-          HINTS ${PC_OPENNI_INCLUDEDIR} ${PC_OPENNI_INCLUDE_DIRS} /usr/include/openni
+          HINTS ${PC_OPENNI_INCLUDEDIR} ${PC_OPENNI_INCLUDE_DIRS} /usr/include/openni "${OPENNI_ROOT}" "$ENV{OPENNI_ROOT}"
           PATHS "$ENV{PROGRAMFILES}/OpenNI/Include" "$ENV{PROGRAMW6432}/OpenNI/Include"
-          PATH_SUFFIXES openni)
+          PATH_SUFFIXES openni include Include)
 #add a hint so that it can find it without the pkg-config
 find_library(OPENNI_LIBRARY
              NAMES OpenNI64 OpenNI
-             HINTS ${PC_OPENNI_LIBDIR} ${PC_OPENNI_LIBRARY_DIRS} /usr/lib
-             PATHS "$ENV{PROGRAMFILES}/OpenNI/Lib" "$ENV{PROGRAMW6432}/OpenNI/Lib64")
+             HINTS ${PC_OPENNI_LIBDIR} ${PC_OPENNI_LIBRARY_DIRS} /usr/lib "${OPENNI_ROOT}" "$ENV{OPENNI_ROOT}"
+             PATHS "$ENV{PROGRAMFILES}/OpenNI/Lib" "$ENV{PROGRAMW6432}/OpenNI/Lib64"
+			 PATH_SUFFIXES lib Lib Lib64)

 set(OPENNI_INCLUDE_DIRS ${OPENNI_INCLUDE_DIR})
 if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")


Update: try to fix where the found library is usb-2 on Mac using OS name

git-svn-id: 1af002208e930b4d920e7c2b948d1e98a012c795@1037 a9d63959-f2ad-4865-b262-bf0e56cfafb6

--- cmake/Modules/FindOpenNI.cmake
+++ cmake/Modules/FindOpenNI.cmake
@@ -28,7 +28,7 @@
              PATHS "$ENV{PROGRAMFILES}/OpenNI/Lib${OPENNI_SUFFIX}" "$ENV{PROGRAMW6432}/OpenNI/Lib${OPENNI_SUFFIX}")

 set(OPENNI_INCLUDE_DIRS ${OPENNI_INCLUDE_DIR})
-if(APPLE)
+if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
   set(OPENNI_LIBRARIES ${OPENNI_LIBRARY} usb-1.0)
 else()
   set(OPENNI_LIBRARIES ${OPENNI_LIBRARY})


python hack for slackware

python hack for slackware

git-svn-id: 39e099a8ed5324aded674b764a67f7a08796d9a7@2723 662fdd30-d327-0410-a531-f549c87e1e9e

--- cmake/TestForPythonEmbed.cmake
+++ cmake/TestForPythonEmbed.cmake
@@ -8,6 +8,9 @@
 if(PYTHONLIBS_FOUND)
 	MESSAGE(STATUS "Checking if Python is Embedable")
 	SET(CMAKE_REQUIRED_INCLUDES ${PYTHON_INCLUDE_PATH})
+	# If on Slackware, uncomment the next line to fix a missing library issue
+	# As of 11/22/2009 this is needed for Slackware 13
+	# SET(PYTHON_LIBRARIES ${PYTHON_LIBRARIES} -ldl -lm -lpthread -lutil)
 	SET(CMAKE_REQUIRED_LIBRARIES ${PYTHON_LIBRARIES})
 	CHECK_C_SOURCE_COMPILES(
 "#include <Python.h>


Update cmake build setup so lldb doesn't link against the DebugSymbols
framework on macOS, in line with the source/xcode project changes in
r364243.
<rdar://problem/49458356>

git-svn-id: 4c4cc70b1ef44ba2b7963015e681894188cea27e@364979 91177308-0d34-0410-b5e6-96231b3b80d8
(cherry picked from commit fa11dcdb73c63e0e7570c43592a74066183b7bfa)

--- cmake/modules/LLDBConfig.cmake
+++ cmake/modules/LLDBConfig.cmake
@@ -400,7 +400,6 @@
   if(NOT IOS)
     find_library(CARBON_LIBRARY Carbon)
     find_library(CORE_SERVICES_LIBRARY CoreServices)
-    find_library(DEBUG_SYMBOLS_LIBRARY DebugSymbols PATHS "/System/Library/PrivateFrameworks")
   endif()
   find_library(FOUNDATION_LIBRARY Foundation)
   find_library(CORE_FOUNDATION_LIBRARY CoreFoundation)


reverse whitespace removal + add small comment

--- cmake/modules/RootMacros.cmake
+++ cmake/modules/RootMacros.cmake
@@ -1445,7 +1445,7 @@
 #
 function(ROOT_ADD_TEST test)
   CMAKE_PARSE_ARGUMENTS(ARG "DEBUG;WILLFAIL;CHECKOUT;CHECKERR;RUN_SERIAL"
-    "TIMEOUT;BUILD;INPUT;OUTPUT;ERROR;SOURCE_DIR;BINARY_DIR;WORKING_DIR;PROJECT;PASSRC;RESOURCE_LOCK"
+                            "TIMEOUT;BUILD;INPUT;OUTPUT;ERROR;SOURCE_DIR;BINARY_DIR;WORKING_DIR;PROJECT;PASSRC;RESOURCE_LOCK"
                             "COMMAND;COPY_TO_BUILDDIR;DIFFCMD;OUTCNV;OUTCNVCMD;PRECMD;POSTCMD;ENVIRONMENT;COMPILEMACROS;DEPENDS;PASSREGEX;OUTREF;ERRREF;FAILREGEX;LABELS;PYTHON_DEPS;FIXTURES_SETUP;FIXTURES_CLEANUP;FIXTURES_REQUIRED"
                             ${ARGN})

@@ -1623,6 +1623,7 @@
     endif()
   endif()

+  #- provided fixtures and resource lock are set here
   if (ARG_FIXTURES_SETUP)
     set_property(TEST ${test} PROPERTY
       FIXTURES_SETUP ${ARG_FIXTURES_SETUP})


[cmake] Tone down macOS ranlib/CMake FATAL_ERROR to WARNING:

We wanted FATAL_ERROR for our Jenkins. That has been running for many
months now; switch to WARNING for the release as this still allows
users to get a proper ROOT build.

--- cmake/modules/SetUpMacOS.cmake
+++ cmake/modules/SetUpMacOS.cmake
@@ -18,7 +18,7 @@
         RESULT_VARIABLE NINJAVERSIONRES)
       if(${NINJAVERSIONRES} EQ 0)
         if(${NINJAVERSION} VERSION_GREATER 1.8.2)
-          message(FATAL_ERROR "You have hit https://gitlab.kitware.com/cmake/cmake/issues/19222\n"
+          message(WARNING "You have hit https://gitlab.kitware.com/cmake/cmake/issues/19222\n"
             "Your build will be indeterministic, i.e. unreliable for incremental builds."
             "To fix this, please install CMake >= 3.14.4!")
         endif()


Adjust for internal CMake-3.1 pkg-config change.

There is a report from Greg Jung <gvjung@gmail.com> that the
internal CMake command

_pkg_check_modules_internal(0 0 ${_prefix} "${_package}")

must be changed to

_pkg_check_modules_internal(0 0 0 0 ${_prefix} "${_package}")

for CMake-3.1 in order to build the cairo device properly.  Accordingly, I have made that adjustment.

Tested by Alan W. Irwin <airwin@users> on Linux using CMake-3.0.2
by building the cairo device.

N.B. currently untested for CMake-3.1.

ToDo:

Extensive tests on CMake-3.1 (once that version is closer to release)
still need to be done since the change in the pkg-config support by
CMake may need other adjustments as well.

--- cmake/modules/pkg-config.cmake
+++ cmake/modules/pkg-config.cmake
@@ -1,6 +1,6 @@
 # cmake/modules/pkg-config.cmake
 #
-# Copyright (C) 2006-2014 Alan W. Irwin
+# Copyright (C) 2006-2015 Alan W. Irwin
 #
 # This file is part of PLplot.
 #
@@ -94,7 +94,12 @@
     set(_xprefix ${_prefix})
   endif(FORCE_EXTERNAL_STATIC)

-  _pkg_check_modules_internal(0 0 ${_prefix} "${_package}")
+  if(CMAKE_VERSION VERSION_LESS "3.1")
+    _pkg_check_modules_internal(0 0 ${_prefix} "${_package}")
+  else(CMAKE_VERSION VERSION_LESS "3.1")
+    _pkg_check_modules_internal(0 0 0 0 ${_prefix} "${_package}")
+  endif(CMAKE_VERSION VERSION_LESS "3.1")
+
   if(${_prefix}_FOUND)
     cmake_link_flags(${_link_FLAGS} "${${_xprefix}_LDFLAGS}")
     # If libraries cannot be not found, then that is equivalent to whole


Add link to the bug

Add link to the bug

--- cmake/projects/Qt/hunter.cmake
+++ cmake/projects/Qt/hunter.cmake
@@ -9,6 +9,7 @@

 include(hunter_add_version)
 include(hunter_cacheable)
+include(hunter_cmake_args)
 include(hunter_configuration_types)

 hunter_add_version(
@@ -28,4 +29,9 @@
   hunter_configuration_types(Qt CONFIGURATION_TYPES Release)
 endif()

+if(ANDROID)
+  # Static variant is not supported: https://bugreports.qt.io/browse/QTBUG-47455
+  hunter_cmake_args(Qt CMAKE_ARGS BUILD_SHARED_LIBS=ON)
+endif()
+
 include("${CMAKE_CURRENT_LIST_DIR}/qtbase/hunter.cmake")


fixed: osg support qt setup for external projects

--- CMake/OSGExternalProjectHelper.cmake
+++ CMake/OSGExternalProjectHelper.cmake
@@ -307,6 +307,14 @@
     #### QT
     #############

+    IF(WIN32)
+      IF(EXISTS ${OSG_SUPPORT_ROOT}/qt5)
+        SET(QT5_CMAKE_DIR "${OSG_SUPPORT_ROOT}/qt5/lib/cmake" CACHE PATH "" FORCE)
+      ELSEIF(EXISTS ${OSG_SUPPORT_ROOT}/qt4)
+        SET(QT_QMAKE_EXECUTABLE "${OSG_SUPPORT_ROOT}/qt4/bin/qmake.exe" CACHE FILEPATH "" FORCE)
+      ENDIF()
+    ENDIF()
+
     OSG_CONFIGURE_QT()
   ENDIF()


[Java] Addressed PR feedback on CMake

[Java] Addressed PR feedback on CMake

--- cmake/Config.cmake
+++ cmake/Config.cmake
@@ -199,6 +199,10 @@
     "FALSE"
     CACHE BOOL "If TRUE, then skip Bond Core tests and examples")

+set (BOND_SKIP_COMPAT_TESTS
+    "FALSE"
+    CACHE BOOL "If TRUE, then skip Bond Compat tests")
+
 if (((BOND_ENABLE_COMM) OR (BOND_ENABLE_GRPC)) AND ((CXX_STANDARD LESS 11) OR (MSVC_VERSION LESS 1800)))
     message(FATAL_ERROR "BOND_ENABLE_COMM and/or BOND_ENABLE_GRPC is TRUE but compiler specified does not support C++11 standard")
 endif()


Update msp430.cmake

Update msp430.cmake

--- cmake/msp430.cmake
+++ cmake/msp430.cmake
@@ -1,4 +1,17 @@
 include(CMakeForceCompiler)
+
+#---------------------------------------------------------------------------------------------------------
+# CMake Toolchain File for the MSP430
+#
+# Author: Matthew Iannucci
+#
+# NOTE: A lot of the paths here are hard coded. The reason is that this depends on the Energia App being installed on
+# OSX which should have the same path on every computer. On Windows, it could be installed anywhere and its not
+# worth the effort to find it rather than the user just writing it for themselves. Lastly, on Linux it assumes
+# that all of the binaries are in /usr/bin and thus in the system path. It is assumed on linux the toolchain is
+# installed by a package manager at /usr.
+#
+#---------------------------------------------------------------------------------------------------------

 # The name of the target operating system
 set(CMAKE_SYSTEM_NAME Generic)
@@ -60,4 +73,4 @@
         COMMAND ${MSPDEBUG_PATH} ${DRIVER} 'prog ${TARGET_NAME}'
         DEPENDS ${TARGET_NAME}
     )
-endfunction()+endfunction()


Syntax fix

Syntax fix

--- cmake/system.cmake
+++ cmake/system.cmake
@@ -41,9 +41,11 @@
   endif ()
 endif ()

-if (DEFINED TARGET AND ${TARGET} STREQUAL "SKYLAKEX" AND NOT NO_AVX512)
+if (DEFINED TARGET)
+if (${TARGET} STREQUAL "SKYLAKEX" AND NOT NO_AVX512)
   set (CCOMMON_OPT "${CCOMMON_OPT} -march=skylake-avx512")
   set (FCOMMON_OPT "${FCOMMON_OPT} -march=skylake-avx512")
+endif()
 endif()

 if (DEFINED TARGET)