minor changes

minor changes

--- cmaki.cmake
+++ cmaki.cmake
@@ -239,20 +239,30 @@
 	foreach(INCLUDE_DIR ${_INCLUDES})
 		target_include_directories(${_TEST_NAME} ${INCLUDE_DIR})
 	endforeach()
-	add_compile_options(-pthread)
+	if(HAVE_PTHREADS)
+		add_compile_options(-pthread)
+	endif()
 	add_executable(${_TEST_NAME} ${_SOURCES})
 	target_link_libraries(${_TEST_NAME} ${_DEPENDS})
-	target_link_libraries(${_TEST_NAME} -lpthread)
+	if(HAVE_PTHREADS)
+		target_link_libraries(${_TEST_NAME} -lpthread)
+	endif()
 	foreach(BUILD_TYPE ${CMAKE_BUILD_TYPE})
 		INSTALL(    TARGETS ${_TEST_NAME}
 					DESTINATION ${BUILD_TYPE}
 					CONFIGURATIONS ${BUILD_TYPE})
 	endforeach()

-	add_test(
-		NAME ${_TEST_NAME}__
-		COMMAND ${_TEST_NAME}
-		WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX}/${CMAKE_BUILD_TYPE})
+	IF(WIN32)
+		add_test(
+			NAME ${_TEST_NAME}__
+			COMMAND ${_TEST_NAME}
+			WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX}/${CMAKE_BUILD_TYPE})
+	ELSE()
+		add_test(
+			NAME ${_TEST_NAME}__
+			COMMAND ${_TEST_NAME})
+	ENDIF()

 endfunction()


Re-Add MSVC specialization

Re-Add MSVC specialization

Former-commit-id: 930ba488c7bb27ece1896eb013e92f8562996ea3

--- HalideGenerator.cmake
+++ HalideGenerator.cmake
@@ -73,8 +73,11 @@
       "-f" "${args_GENERATED_FUNCTION_NAMESPACE}${args_GENERATED_FUNCTION}"
       "-o" "${SCRATCH_DIR}" ${args_GENERATOR_ARGS}
   )
-
-  if(XCODE)
+  if(MSVC)
+    # In MSVC, the generator executable will be placed in a configuration specific
+    # directory specified by ${CMAKE_CFG_INTDIR}.
+    set(generator_exec "${CMAKE_BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/${args_GENERATOR_TARGET}${CMAKE_EXECUTABLE_SUFFIX}")
+  elseif(XCODE)
     # In Xcode, the generator executable will be placed in a configuration specific
     # directory, so the Xcode variable $(CONFIGURATION) is passed in the custom build script.
     set(generator_exec "${CMAKE_BINARY_DIR}/bin/$(CONFIGURATION)/${args_GENERATOR_TARGET}${CMAKE_EXECUTABLE_SUFFIX}")


修订 FindLibuv.cmake 用以适配libuv自带的CMakeLists.txt

--- project/cmake/modules/FindLibuv.cmake
+++ project/cmake/modules/FindLibuv.cmake
@@ -50,11 +50,33 @@
 endif()

 if(LIBUV_ROOT)
-  set(_LIBUV_SEARCH_ROOT_INC PATHS ${LIBUV_ROOT} ${LIBUV_ROOT}/include NO_DEFAULT_PATH)
+  set(_LIBUV_SEARCH_ROOT_INC PATHS ${LIBUV_ROOT} "${LIBUV_ROOT}/include" NO_DEFAULT_PATH)
   if(CMAKE_SIZEOF_VOID_P MATCHES 8)
-    set(_LIBUV_SEARCH_ROOT_LIB PATHS ${LIBUV_ROOT} ${LIBUV_ROOT}/lib64 ${LIBUV_ROOT}/lib NO_DEFAULT_PATH)
+    if(MSVC AND CMAKE_BUILD_TYPE)
+      set(_LIBUV_SEARCH_ROOT_LIB PATHS ${LIBUV_ROOT}
+        "${LIBUV_ROOT}/lib64/${CMAKE_BUILD_TYPE}"
+        "${LIBUV_ROOT}/lib/${CMAKE_BUILD_TYPE}"
+        "${LIBUV_ROOT}/lib64"
+        "${LIBUV_ROOT}/lib" NO_DEFAULT_PATH
+      )
+    else()
+      set(_LIBUV_SEARCH_ROOT_LIB PATHS ${LIBUV_ROOT}
+        "${LIBUV_ROOT}/lib64"
+        "${LIBUV_ROOT}/lib" NO_DEFAULT_PATH
+      )
+    endif()
   else()
-    set(_LIBUV_SEARCH_ROOT_LIB PATHS ${LIBUV_ROOT} ${LIBUV_ROOT}/lib NO_DEFAULT_PATH)
+    if(MSVC AND CMAKE_BUILD_TYPE)
+      set(_LIBUV_SEARCH_ROOT_LIB PATHS ${LIBUV_ROOT}
+        "${LIBUV_ROOT}/lib/${CMAKE_BUILD_TYPE}"
+        "${LIBUV_ROOT}/lib64"
+        "${LIBUV_ROOT}/lib" NO_DEFAULT_PATH
+      )
+    else()
+      set(_LIBUV_SEARCH_ROOT_LIB PATHS ${LIBUV_ROOT}
+        "${LIBUV_ROOT}/lib" NO_DEFAULT_PATH
+      )
+    endif()
   endif()
 endif()

@@ -76,5 +98,25 @@
 )

 if(Libuv_FOUND)
-    set(LIBUV_FOUND ${Libuv_FOUND})
+  set(LIBUV_FOUND ${Libuv_FOUND})
+
+  if (NOT TARGET libuv)
+    add_library(libuv STATIC IMPORTED)
+    set_target_properties(libuv PROPERTIES
+      INTERFACE_INCLUDE_DIRECTORIES ${Libuv_INCLUDE_DIRS}
+    )
+    set_target_properties(libuv PROPERTIES
+      IMPORTED_LINK_INTERFACE_LANGUAGES "C;CXX;RC"
+      IMPORTED_LOCATION ${Libuv_LIBRARIES}
+    )
+
+    if (WIN32)
+      set_target_properties(libuv PROPERTIES
+        INTERFACE_LINK_LIBRARIES "psapi;iphlpapi;userenv;ws2_32"
+      )
+    endif ()
+  endif ()
+else ()
+  unset(Libuv_INCLUDE_DIRS CACHE)
+  unset(Libuv_LIBRARIES CACHE)
 endif()


bob.cmake : modify compiler warnings for clang

We now set the GNU and Clang compiler warnings to be equal
in bob.cmake to `-Werror -Wall -Wextra'.

--- cmake/bob.cmake
+++ cmake/bob.cmake
@@ -50,10 +50,7 @@
   endif()
   if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
     if (${PROJECT_NAME}_CXX_WARNINGS)
-      set(FLAGS "${FLAGS} -Werror -Weverything")
-      set(FLAGS "${FLAGS} -Wno-padded")
-      set(FLAGS "${FLAGS} -Wno-float-equal")
-      set(FLAGS "${FLAGS} -Wno-weak-template-vtables")
+      set(FLAGS "${FLAGS} -Werror -Wall -Wextra")
     endif()
   elseif(${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU")
     if (${PROJECT_NAME}_CXX_WARNINGS)


cmake: Fix remaining C++20 property

cmake: Fix remaining C++20 property

--- cmake/cpp.cmake
+++ cmake/cpp.cmake
@@ -114,7 +114,7 @@

 # Compile options
 set_target_properties(${PROJECT_NAME} PROPERTIES
-  CXX_STANDARD 20
+  CXX_STANDARD 17
   CXX_STANDARD_REQUIRED ON
   CXX_EXTENSIONS OFF
   )


CMake env: fix copyright

CMake env: fix copyright

--- cmake/env.cmake
+++ cmake/env.cmake
@@ -1,3 +1,4 @@
+# Copyright (c) 2020 ARM Limited. All rights reserved.
 # SPDX-License-Identifier: Apache-2.0

 # Compiler setup


fixed matlab root parsing on linux

fixed matlab root parsing on linux

git-svn-id: cf55bc44fb097054a32fc70455a459c940dbbffc@6776 c9849af7-e679-4ec6-a44e-fc146a885bd3

--- cmake/mex.cmake
+++ cmake/mex.cmake
@@ -28,7 +28,7 @@
   if ( matlab-NOTFOUND )
      message(FATAL_ERROR "Could not find matlab executable")
   endif()
-  execute_process(COMMAND ${matlab} -n COMMAND grep "MATLAB " COMMAND cut -d "=" -f2 OUTPUT_VARIABLE _matlab_root)
+  execute_process(COMMAND ${matlab} -n COMMAND grep -e "MATLAB \\+=" COMMAND cut -d "=" -f2 OUTPUT_VARIABLE _matlab_root)
   if (NOT _matlab_root)
     message(FATAL_ERROR "Failed to extract MATLAB_ROOT from running matlab -n")
   endif()


[KP] fix compilation bug in phi (#40805)

* [KP] fix compilation bug in phi

* delete the comment

* delete useless comment

--- cmake/phi.cmake
+++ cmake/phi.cmake
@@ -118,7 +118,7 @@
         if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${TARGET}.cc)
             list(APPEND common_srcs ${CMAKE_CURRENT_SOURCE_DIR}/${TARGET}.cc)
         endif()
-        if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/cpu/${TARGET}.cc)
+        if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/cpu/${TARGET}.cc AND NOT WITH_XPU_KP)
             list(APPEND cpu_srcs ${CMAKE_CURRENT_SOURCE_DIR}/cpu/${TARGET}.cc)
         endif()
         if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/selected_rows/${TARGET}.cc)
@@ -150,6 +150,9 @@
                 file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/kps/${TARGET}.cu DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/kps)
                 file(RENAME ${CMAKE_CURRENT_BINARY_DIR}/kps/${TARGET}.cu ${CMAKE_CURRENT_BINARY_DIR}/kps/${TARGET}.kps)
                 list(APPEND kps_srcs ${CMAKE_CURRENT_BINARY_DIR}/kps/${TARGET}.kps)
+            endif()
+            if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/cpu/${TARGET}.cc )
+                list(APPEND kps_srcs ${CMAKE_CURRENT_SOURCE_DIR}/cpu/${TARGET}.cc)
             endif()
         endif()
     else()


Fixed armadillo cmake script

Fixed armadillo cmake script

Former-commit-id: 80bb14825f12c61554488958758e8d327fbfd268

--- cmake-modules/Fetch_Armadillo.cmake
+++ cmake-modules/Fetch_Armadillo.cmake
@@ -10,8 +10,8 @@
         )
 endif()
 if(ARMADILLO_INCLUDE_DIRS)
-    message(STATUS "ARMADILLO found in system: ${ARMADILLO_LIBRARIES}")
-    add_library(armadillo STATIC IMPORTED)
+    message(STATUS "ARMADILLO found in system: ${ARMADILLO_INCLUDE_DIRS}")
+    add_library(armadillo INTERFACE)
 endif()

 # Install from source if not found


update

update

--- cmake/DCS08961_SetupVariables.cmake
+++ cmake/DCS08961_SetupVariables.cmake
@@ -17,6 +17,17 @@
   set(AntTweakBar_ROOT_DIR "C:/Tools/anttweakbar/1.16")
 endif()

+# Freeglut
+set(FREEGLUT_MINIMUM_VERSION "2.8")
+if(CMAKE_HOST_WIN32)
+  set(FreeGLUT_ROOT_DIR "C:/Tools/freeglut/3.0.0-src/install/${ARCH}")
+endif()
+
+# GLEW
+if(CMAKE_HOST_WIN32)
+  set(GLEW_ROOT_DIR "C:/Tools/glew/1.12.0")
+endif()
+
 # GL[I|M]
 set(GLI_MINIMUM_VERSION "0.6.0")
 set(GLM_MINIMUM_VERSION "0.9.7")
@@ -28,27 +39,13 @@
   set(GLM_ROOT_DIR "~/Projects/others/glm-git")
 endif()

-# freeglut
-set(FREEGLUT_MINIMUM_VERSION "2.8")
-if(CMAKE_HOST_WIN32)
-  set(FreeGLUT_ROOT_DIR "C:/Tools/freeglut/3.0.0-src/install/${ARCH}")
-endif()
-
 # OGLplus
 if(CMAKE_HOST_WIN32)
-  set(OGLplus_ROOT_DIR "C:/Tools/oglplus/oglplus-git")
+  set(OGLplus_ROOT_DIR "C:/Tools/oglplus/oglplus-git/_install")
 else()
   if(UNIX)
     set(OGLplus_ROOT_DIR "~/Projects/others/oglplus-develop-git/_install")
   endif()
-endif()
-
-# GLEW
-# keeping this last because of 'CMAKE_*_PATH' tinkering
-if(CMAKE_HOST_WIN32)
-  set(GLEW_ROOT_PATH "C:/Tools/glew/1.12.0")
-  set(CMAKE_PREFIX_PATH  "${GLEW_ROOT_PATH}")
-  set(CMAKE_LIBRARY_PATH "${GLEW_ROOT_PATH}/lib/Release/${ARCH}")
 endif()

 if(DCS08961_TRACE_ALL)


workaround for 32-bit OS on 64-bit x86 CPU

--- cmake/OpenCVDetectCXXCompiler.cmake
+++ cmake/OpenCVDetectCXXCompiler.cmake
@@ -116,6 +116,12 @@
   set(AARCH64 1)
 endif()

+# Workaround for 32-bit operating systems on 64-bit x86_64 processor
+if(X86_64 AND CMAKE_SIZEOF_VOID_P EQUAL 4 AND NOT FORCE_X86_64)
+  message(STATUS "sizeof(void) = 4 on x86 / x86_64 processor. Assume 32-bit compilation mode (X86=1)")
+  unset(X86_64)
+  set(X86 1)
+endif()

 # Similar code exists in OpenCVConfig.cmake
 if(NOT DEFINED OpenCV_STATIC)


[cmake] tighten Eigen test

[cmake] tighten Eigen test

--- cmake/modules/DuneStuffMacros.cmake
+++ cmake/modules/DuneStuffMacros.cmake
@@ -106,12 +106,14 @@
 endif(HAVE_BLAS)

 pkg_check_modules(EIGEN eigen3)
-if(EIGEN_FOUND)
+set(CMAKE_REQUIRED_INCLUDES ${EIGEN_INCLUDE_DIRS})
+check_include_file_cxx("Eigen/SparseLU" HAVE_EIGEN_SPARSE)
+if(EIGEN_FOUND AND HAVE_EIGEN_SPARSE)
+  include_directories(${EIGEN_INCLUDE_DIRS})
   set(HAVE_EIGEN 1)
-  include_directories(${EIGEN_INCLUDE_DIRS})
-else(EIGEN_FOUND)
+else(EIGEN_FOUND AND HAVE_EIGEN_SPARSE)
   set(HAVE_EIGEN 0)
-endif(EIGEN_FOUND)
+endif(EIGEN_FOUND AND HAVE_EIGEN_SPARSE)

 pkg_check_modules(LIBAMA libama)
 if(LIBAMA_FOUND)


TranslateDesktop: Remove lupdate absolute option

Not needed, it's the default behaviour.

--- cmake/modules/LXQtTranslateTs.cmake
+++ cmake/modules/LXQtTranslateTs.cmake
@@ -98,7 +98,6 @@
             qt5_patched_create_translation(QM
                 ${TR_SOURCES}
                 ${tsFiles}
-                OPTIONS -locations absolute
             )
         else()
             qt5_patched_add_translation(QM ${tsFiles})
@@ -114,7 +113,6 @@
             qt4_create_translation(QM
                 ${TR_SOURCES}
                 ${tsFiles}
-                OPTIONS -locations absolute
             )
         else()
             qt4_add_translation(QM ${tsFiles})


[clang-proto-fuzzer] Use ToT protobuf-mutator.

git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@316103 91177308-0d34-0410-b5e6-96231b3b80d8

--- cmake/modules/ProtobufMutator.cmake
+++ cmake/modules/ProtobufMutator.cmake
@@ -6,7 +6,7 @@
 ExternalProject_Add(${PBM_PREFIX}
   PREFIX ${PBM_PREFIX}
   GIT_REPOSITORY https://github.com/google/libprotobuf-mutator.git
-  GIT_TAG e4eae60
+  GIT_TAG master
   CONFIGURE_COMMAND ${CMAKE_COMMAND} -G${CMAKE_GENERATOR}
     -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
     -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}


libpcre: Add unrelocatable files

libpcre: Add unrelocatable files

--- cmake/projects/libpcre/hunter.cmake
+++ cmake/projects/libpcre/hunter.cmake
@@ -42,4 +42,5 @@
     "lib/pkgconfig/libpcre.pc"
     "lib/pkgconfig/libpcrecpp.pc"
     "lib/pkgconfig/libpcreposix.pc"
+    "bin/pcre-config"
 )


Add error code 18

Add error code 18

--- cmake/modules/hunter_check_download_error_message.cmake
+++ cmake/modules/hunter_check_download_error_message.cmake
@@ -40,6 +40,8 @@
     endif()
   elseif(x_ERROR_CODE EQUAL 56)
     set(expected_message "\"Failure when receiving data from the peer\"")
+  elseif(x_ERROR_CODE EQUAL 18)
+    set(expected_message "\"Transferred a partial file\"")
   else()
     file(REMOVE "${x_REMOVE_ON_ERROR}")
     hunter_internal_error(


boards: arm64: fvp_baser_aemv8_r: change FVP startup parameters

Eliminate GICv3 warning messages printed by FVP_BaseR_AEMv8R.
And "cluster0.NUM_CORES" depends on CONFIG_MP_NUM_CPUS now.

Signed-off-by: Huifeng Zhang <c84a74091eb68cac0f7b3af5f0cb16144b6a68b3@arm.com>

--- boards/arm64/fvp_baser_aemv8r/board.cmake
+++ boards/arm64/fvp_baser_aemv8r/board.cmake
@@ -7,7 +7,11 @@
 set(ARMFVP_FLAGS
   -C cluster0.has_aarch64=1
   -C cluster0.VMSA_supported=0
-  -C cluster0.NUM_CORES=1
+  -C cluster0.NUM_CORES=${CONFIG_MP_NUM_CPUS}
+  -C cluster0.gicv3.cpuintf-mmap-access-level=2
+  -C cluster0.gicv3.SRE-enable-action-on-mmap=2
+  -C cluster0.gicv3.SRE-EL2-enable-RAO=1
+  -C cluster0.gicv3.extended-interrupt-range-support=1
   -C bp.dram.enable_atomic_ops=1
   -C bp.sram.enable_atomic_ops=1
   -C gic_distributor.GICD_CTLR-DS-1-means-secure-only=1
@@ -18,4 +22,4 @@
   -C bp.terminal_0.start_telnet=0
   -C bp.vis.disable_visualisation=1
   -C bp.vis.rate_limit-enable=0
-  )
+  )


Add tag-release target.

Add tag-release target.

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

--- build-aux/cmake/modules/ProjectInfo.cmake
+++ build-aux/cmake/modules/ProjectInfo.cmake
@@ -290,4 +290,36 @@
   set(PROJECT_STRING "${PROJECT_LONGNAME} ${PROJECT_VERSION}")
   set(PROJECT_TARNAME "${PROJECT_NAME}-${PROJECT_VERSION}")

+  # ========================== #
+  # Add the tag release target #
+  # ========================== #
+
+  # Format the next tag name.
+  string(REGEX REPLACE
+    "-([0-9]+)-([0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]+)$"
+    ""
+    PROJECT_TAG_NAME
+    ${PROJECT_VERSION})
+
+  # Format the next tag message.
+  set(PROJECT_PROJECT_TAG_MSG "Release ")
+  if(PROJECT_VENDOR)
+    set(PROJECT_TAG_MSG "${PROJECT_TAG_MSG} for Gostai")
+  else(PROJECT_VENDOR)
+    set(PROJECT_TAG_MSG
+      "${PROJECT_TAG_MSG} ${PROJECT_VENDOR_VERSION} for ${PROJECT_VENDOR}")
+  endif(PROJECT_VENDOR)
+  set(PROJECT_TAG_MSG
+    "${PROJECT_TAG_MSG} version ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}")
+  if(RELEASE_CANDIDATE)
+    set(PROJECT_TAG_MSG "${PROJECT_TAG_MSG} candidate ${PROJECT_VERSION_RC}")
+  endif(RELEASE_CANDIDATE)
+  set(PROJECT_TAG_MSG "${PROJECT_TAG_MSG}.")
+
+  add_custom_target(tag-release
+    COMMAND
+    ${GIT_EXECUTABLE} tag -a -m ${PROJECT_TAG_MSG} ${PROJECT_TAG_NAME} HEAD
+    WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
+    COMMENT "Tagging release ${PROJECT_TAG_NAME}")
+
 endif(NOT PROJECT_INFO_CMAKE)


Remove depends on writeable file.

Remove depends on writeable file.

--- src/inserts/functions.cmake
+++ src/inserts/functions.cmake
@@ -1325,7 +1325,6 @@

     add_custom_command(OUTPUT ${parser_include}
         COMMAND ${CMAKE_COMMAND} -E copy_if_different ${parser_include_in} ${parser_include}
-        DEPENDS ${parser_include_in}
     )
     target_sources(${this} PRIVATE ${parser_include})


[CMake] [darwin] [builtins] Refactoring darwin_find_excluded_builtins_list to parse arguments instead of only handling positional arguments.

OS and ARCH must be specified, but minimum version may not. Excluding the minimum version will only apply the filters for builtins not supported by the OS and OS-Arch pair.

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

--- cmake/Modules/CompilerRTDarwinUtils.cmake
+++ cmake/Modules/CompilerRTDarwinUtils.cmake
@@ -113,30 +113,42 @@

 # this function takes an OS, architecture and minimum version and provides a
 # list of builtin functions to exclude
-function(darwin_find_excluded_builtins_list os arch min_version)
-  darwin_read_exclude_file(${os}_BUILTINS ${os})
-  darwin_read_exclude_file(${os}_${arch}_BASE_BUILTINS ${os}-${arch})
-
-  file(GLOB builtin_lists ${DARWIN_EXCLUDE_DIR}/${os}*-${arch}.txt)
-  foreach(builtin_list ${builtin_lists})
-    string(REGEX MATCH "${os}([0-9\\.]*)-${arch}.txt" VERSION_MATCHED "${builtin_list}")
-    if (VERSION_MATCHED AND NOT CMAKE_MATCH_1 VERSION_LESS min_version)
-      if(NOT smallest_version)
-        set(smallest_version ${CMAKE_MATCH_1})
-      elseif(CMAKE_MATCH_1 VERSION_LESS smallest_version)
-        set(smallest_version ${CMAKE_MATCH_1})
+function(darwin_find_excluded_builtins_list output_var)
+  cmake_parse_arguments(LIB
+    ""
+    "OS;ARCH;MIN_VERSION"
+    ""
+    ${ARGN})
+
+  if(NOT LIB_OS OR NOT LIB_ARCH)
+    message(FATAL_ERROR "Must specify OS and ARCH to darwin_find_excluded_builtins_list!")
+  endif()
+
+  darwin_read_exclude_file(${LIB_OS}_BUILTINS ${LIB_OS})
+  darwin_read_exclude_file(${LIB_OS}_${LIB_ARCH}_BASE_BUILTINS ${LIB_OS}-${LIB_ARCH})
+
+  if(LIB_MIN_VERSION)
+    file(GLOB builtin_lists ${DARWIN_EXCLUDE_DIR}/${LIB_OS}*-${LIB_ARCH}.txt)
+    foreach(builtin_list ${builtin_lists})
+      string(REGEX MATCH "${LIB_OS}([0-9\\.]*)-${LIB_ARCH}.txt" VERSION_MATCHED "${builtin_list}")
+      if (VERSION_MATCHED AND NOT CMAKE_MATCH_1 VERSION_LESS LIB_MIN_VERSION)
+        if(NOT smallest_version)
+          set(smallest_version ${CMAKE_MATCH_1})
+        elseif(CMAKE_MATCH_1 VERSION_LESS smallest_version)
+          set(smallest_version ${CMAKE_MATCH_1})
+        endif()
       endif()
+    endforeach()
+
+    if(smallest_version)
+      darwin_read_exclude_file(${LIB_ARCH}_${LIB_OS}_BUILTINS ${LIB_OS}${smallest_version}-${LIB_ARCH})
     endif()
-  endforeach()
+  endif()

-  if(smallest_version)
-    darwin_read_exclude_file(${arch}_${os}_BUILTINS ${os}${smallest_version}-${arch})
-  endif()
-
-  set(${arch}_${os}_EXCLUDED_BUILTINS
-      ${${arch}_${os}_BUILTINS}
-      ${${os}_${arch}_BASE_BUILTINS}
-      ${${os}_BUILTINS} PARENT_SCOPE)
+  set(${output_var}
+      ${${LIB_ARCH}_${LIB_OS}_BUILTINS}
+      ${${LIB_OS}_${LIB_ARCH}_BASE_BUILTINS}
+      ${${LIB_OS}_BUILTINS} PARENT_SCOPE)
 endfunction()

 # adds a single builtin library for a single OS & ARCH
@@ -231,8 +243,11 @@
                               PARENT_TARGET builtins)

-      darwin_find_excluded_builtins_list(${os} ${arch} ${DARWIN_${os}_BUILTIN_MIN_VER})
-
+      darwin_find_excluded_builtins_list(${arch}_${os}_EXCLUDED_BUILTINS
+                              OS ${os}
+                              ARCH ${arch}
+                              MIN_VERSION ${DARWIN_${os}_BUILTIN_MIN_VER})
+
       darwin_filter_builtin_sources(filtered_sources ${arch}_${os}_EXCLUDED_BUILTINS ${${arch}_SOURCES})

       darwin_add_builtin_library(clang_rt builtins


Adding more convenience to the doc.cmake

--- cmake/doc.cmake
+++ cmake/doc.cmake
@@ -80,23 +80,27 @@
 # PATH(s) -> paths to prepend to the PYTHONPATH for the execution of sphinx-build
 #
 macro(sphinx TARGET_NAME SOURCE_DIR BUILD_DIR)
-  set(_PYTHONPATH )
-  #put user path first
-  list(APPEND _PYTHONPATH ${ARGN})
-  list(APPEND _PYTHONPATH  ${ecto_PYTHONPATH})
-  #transform the cmake list to a sh path list
-  string(REPLACE ";" ":"
-      _PYTHONPATH
-      "${_PYTHONPATH}"
-  )
-  add_custom_target(${TARGET_NAME})
-  add_custom_command(TARGET ${TARGET_NAME}
-    COMMAND
-    /usr/bin/env
-    PYTHONPATH=${_PYTHONPATH}
-    ${SPHINX_BUILD} -aE ${SOURCE_DIR} ${BUILD_DIR}
-    WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+  find_sphinx()
+  if(SPHINX_BUILD)
+    set(_PYTHONPATH )
+    #put user path first
+    list(APPEND _PYTHONPATH ${ARGN})
+    list(APPEND _PYTHONPATH  ${ecto_PYTHONPATH})
+    #transform the cmake list to a sh path list
+    string(REPLACE ";" ":"
+        _PYTHONPATH
+        "${_PYTHONPATH}"
     )
+    add_custom_target(${TARGET_NAME})
+    add_custom_command(TARGET ${TARGET_NAME}
+      COMMAND
+      /usr/bin/env
+      PYTHONPATH=${_PYTHONPATH}
+      ${SPHINX_BUILD} -aE ${SOURCE_DIR} ${BUILD_DIR}
+      WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+      )
+    add_dependencies(doc ${TARGET_NAME})
+  endif()
 endmacro()

 ##


modules: properly list modifications done to the FindOpenAL module.

--- modules/FindOpenAL.cmake
+++ modules/FindOpenAL.cmake
@@ -87,6 +87,12 @@
 # OPENAL_LIBRARY to override this selection or set the CMake environment
 # CMAKE_INCLUDE_PATH to modify the search paths.

+# This version is modified for Magnum and was forked from
+# https://github.com/Kitware/CMake/blob/v3.6.1/Modules/FindOpenAL.cmake
+# The file was modified to add a new path suffix for finding OpenAL for
+# Emscripten on OSX and, in case of Emscripten, the library is not looked for
+# as it is linked in implicitly.
+
 find_path(OPENAL_INCLUDE_DIR al.h
   HINTS
     ENV OPENALDIR


cmake: fix install in cpp.cmake

cmake: fix install in cpp.cmake

--- cmake/cpp.cmake
+++ cmake/cpp.cmake
@@ -298,7 +298,7 @@
   target_link_libraries(${SAMPLE_NAME} PRIVATE ortools::ortools)

   include(GNUInstallDirs)
-  install(TARGETS ${EXECUTABLE})
+  install(TARGETS ${SAMPLE_NAME})

   if(BUILD_TESTING)
     add_test(NAME cxx_${COMPONENT_NAME}_${SAMPLE_NAME} COMMAND ${SAMPLE_NAME})


- fixed setting of CMAKE_INSTALL_PREFIX to allow    installation in 'usr/local'

--- cmake/ilcsoft_default_install_prefix.cmake
+++ cmake/ilcsoft_default_install_prefix.cmake
@@ -1,9 +1,8 @@
 # set default install prefix to project root directory
 # instead of the cmake default /usr/local
-IF( CMAKE_INSTALL_PREFIX STREQUAL "/usr/local" )
-    SET( CMAKE_INSTALL_PREFIX "${PROJECT_SOURCE_DIR}" )
-ENDIF()

-# write this variable to cache
-SET( CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}" CACHE PATH "Where to install ${PROJECT_NAME}" FORCE )
+IF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
+ 	SET(CMAKE_INSTALL_PREFIX "${PROJECT_SOURCE_DIR}" CACHE PATH "Where to install ${PROJECT_NAME}" FORCE)
+ENDIF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)

+


fix(cmake): Suppress -Wnoexcept-type warning on GCC

There is no way to avoid this error in the code itself, so we must
suppress this warning if we wish to keep -Werror.

--- cmake/01-core.cmake
+++ cmake/01-core.cmake
@@ -22,6 +22,11 @@
 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wextra")
 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror")
+if (CMAKE_CXX_COMPILER_ID MATCHES "GNU")
+  # there's no way to modify the code to avoid this warning, so we must
+  # suppress it if we use -Werror
+  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-noexcept-type")
+endif()
 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2")
 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic")
 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic-errors")


Fix RPATH when CMAKE_INSTALL_LIBDIR != lib.

In some platforms ${CMAKE_INSTALL_LIBDIR} expands to `lib64`. The libraries
are correctly installed in that directory, but the RPATH is set to point to
`$ORIGIN/../lib`, where it should be `$ORIGIN/../lib64`.

--- cmake/install.cmake
+++ cmake/install.cmake
@@ -33,7 +33,7 @@
     RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT protoc)
   if (UNIX AND NOT APPLE)
     set_property(TARGET protoc
-      PROPERTY INSTALL_RPATH "$ORIGIN/../lib")
+      PROPERTY INSTALL_RPATH "$ORIGIN/../${CMAKE_INSTALL_LIBDIR}")
   elseif (APPLE)
     set_property(TARGET protoc
       PROPERTY INSTALL_RPATH "@loader_path/../lib")


[docs] Fix for builds (pod2man --stderr) on CentOS 5

--- cmake/pod2man.cmake
+++ cmake/pod2man.cmake
@@ -19,7 +19,7 @@
         add_custom_command(
             OUTPUT ${OUTPATH_NEW}/${MANFILE}.${SECTION}
             COMMAND ${POD2MAN} --section ${SECTION} --center ${CENTER}
-                --release --stderr --name ${MANFILE} ${PODFILE}
+                --release --name ${MANFILE} ${PODFILE}
                 ${OUTPATH_NEW}/${MANFILE}.${SECTION}
         )
         set(MANPAGE_TARGET "man-${MANFILE}")


ENH: Added compatability for projects using VTK_SOURCE_DIR, TCL_LIBRARY, and TK_LIBRARY from VTK's cache.  These settings should not be used by new projects.

--- vtkGenerateVTKConfig.cmake
+++ vtkGenerateVTKConfig.cmake
@@ -95,6 +95,24 @@
 # Configure VTKConfig.cmake for the build tree.
 CONFIGURE_FILE(${VTK_SOURCE_DIR}/VTKConfig.cmake.in
                ${VTK_BINARY_DIR}/VTKConfig.cmake @ONLY IMMEDIATE)
+
+# Hack to give source tree access for a build tree configuration.
+IF(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 1.4)
+  STRING(ASCII 35 VTK_STRING_POUND)
+  STRING(ASCII 64 VTK_STRING_AT)
+  WRITE_FILE(${VTK_BINARY_DIR}/VTKConfig.cmake
+    "\n"
+    "${VTK_STRING_POUND} For backward compatability.  DO NOT USE.\n"
+    "SET(VTK_SOURCE_DIR \"${VTK_SOURCE_DIR}\")\n"
+    "IF(NOT TCL_LIBRARY)\n"
+    "  SET(TCL_LIBRARY \"${TCL_LIBRARY}\" CACHE FILEPATH \"Location of Tcl library imported from VTK.  This may mean your project is depending on VTK to get this setting.  Consider using FindTCL.cmake.\")\n"
+    "ENDIF(NOT TCL_LIBRARY)\n"
+    "IF(NOT TK_LIBRARY)\n"
+    "  SET(TK_LIBRARY \"${TK_LIBRARY}\" CACHE FILEPATH \"Location of Tk library imported from VTK.  This may mean your project is depending on VTK to get this setting.  Consider using FindTCL.cmake.\")\n"
+    "ENDIF(NOT TK_LIBRARY)\n"
+    APPEND
+  )
+ENDIF(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 1.4)

 #-----------------------------------------------------------------------------
 # Settings specific to the install tree.


CI: Android - build JNI sample

CI: Android - build JNI sample

--- ci-build.cmake
+++ ci-build.cmake
@@ -67,6 +67,7 @@
         ${CROSS}
         "-DCMAKE_CXX_FLAGS=-std=c++11 -Werror"
         -DOGRE_CONFIG_THREAD_PROVIDER=std
+        -DOGRE_BUILD_ANDROID_JNI_SAMPLE=TRUE
         -DOGRE_DEPENDENCIES_DIR=${CMAKE_CURRENT_SOURCE_DIR}/ogredeps)
     set(BUILD_DEPS TRUE)


Fix build break in cmake 3.22.0-rc2 (#837)

 cmake 3.22.0-rc2 - Adding quotes to LIB_SEARCH_PATH to ensure there is always a string to compare to.

Co-authored-by: David Watson <de2aa9f8299202aaa32c007e14b383069c83003e@hotmail.co.uk>

--- cmake/AWSSDKConfig.cmake
+++ cmake/AWSSDKConfig.cmake
@@ -129,7 +129,7 @@
 get_filename_component(TEMP_PATH "${AWSSDK_CORE_LIB_FILE}" PATH)
 get_filename_component(TEMP_NAME "${TEMP_PATH}" NAME)

-while (NOT TEMP_NAME STREQUAL ${LIB_SEARCH_PREFIX})
+while (NOT TEMP_NAME STREQUAL "${LIB_SEARCH_PREFIX}")
     set(TEMP_PLATFORM_PREFIX "${TEMP_NAME}/${TEMP_PLATFORM_PREFIX}")
     get_filename_component(TEMP_PATH "${TEMP_PATH}" PATH)
     get_filename_component(TEMP_NAME "${TEMP_PATH}" NAME)


Cmake: Avoid Redefining message() Multiple Times

--- cmake/ColorMessage.cmake
+++ cmake/ColorMessage.cmake
@@ -1,5 +1,3 @@
-
-
 #Very non-portable workaround to detect if the current cmake process is
 #outputing to a valid looking terminal (on LINUX only)
 if(EXISTS /proc/self/fd/1)
@@ -47,22 +45,24 @@

 # Module Based Off Of
 # https://stackoverflow.com/questions/18968979/how-to-get-colorized-output-with-cmake
-
-function(message)
-    list(GET ARGV 0 MessageType)
-    if(MessageType STREQUAL FATAL_ERROR OR MessageType STREQUAL SEND_ERROR)
-        list(REMOVE_AT ARGV 0)
-        _message(${MessageType} "${BoldRed}${ARGV}${ColorReset}")
-    elseif(MessageType STREQUAL WARNING)
-        list(REMOVE_AT ARGV 0)
-        _message(${MessageType} "${BoldYellow}${ARGV}${ColorReset}")
-    elseif(MessageType STREQUAL AUTHOR_WARNING)
-        list(REMOVE_AT ARGV 0)
-        _message(${MessageType} "${BoldCyan}${ARGV}${ColorReset}")
-    elseif(MessageType STREQUAL STATUS)
-        list(REMOVE_AT ARGV 0)
-        _message(${MessageType} "${ARGV}")
-    else()
-        _message("${ARGV}")
-    endif()
-endfunction()
+if(NOT DEFINED MESSAGE_REDEFINED)
+    function(message)
+        list(GET ARGV 0 MessageType)
+        if(MessageType STREQUAL FATAL_ERROR OR MessageType STREQUAL SEND_ERROR)
+            list(REMOVE_AT ARGV 0)
+            _message(${MessageType} "${BoldRed}${ARGV}${ColorReset}")
+        elseif(MessageType STREQUAL WARNING)
+            list(REMOVE_AT ARGV 0)
+            _message(${MessageType} "${BoldYellow}${ARGV}${ColorReset}")
+        elseif(MessageType STREQUAL AUTHOR_WARNING)
+            list(REMOVE_AT ARGV 0)
+            _message(${MessageType} "${BoldCyan}${ARGV}${ColorReset}")
+        elseif(MessageType STREQUAL STATUS)
+            list(REMOVE_AT ARGV 0)
+            _message(${MessageType} "${ARGV}")
+        else()
+            _message("${ARGV}")
+        endif()
+    endfunction()
+    set(MESSAGE_REDEFINED TRUE)
+endif()


Fixing package order

Fixing package order

I pasted below the CMake error log that Irina was getting.

CMake Error at
cmake/tribits/core/package_arch/TribitsAdjustPackageEnables.cmake:141 (MESSAGE):
  Error, the package 'DataTransferKitC_API' is listed as a dependency of the
  package 'DataTransferKitSTKMeshAdapters' is in the list
  'DataTransferKitSTKMeshAdapters_TEST_REQUIRED_DEP_PACKAGES' but the package
  'DataTransferKitC_API' is either not defined or is listed later in the
  package order.  Check the spelling of 'DataTransferKitC_API' or see how it
  is listed in Trilinos_PACKAGES_AND_DIRS_AND_CLASSIFICATIONS in relationship
  to 'DataTransferKitSTKMeshAdapters'.

--- cmake/Dependencies.cmake
+++ cmake/Dependencies.cmake
@@ -5,10 +5,10 @@
     BasicGeometryAdapters packages/Adapters/BasicGeometry SS  OPTIONAL
     IntrepidAdapters      packages/Adapters/Intrepid      SS  OPTIONAL
     Operators             packages/Operators              SS  REQUIRED
+    C_API                 packages/Adapters/C_API         SS  OPTIONAL
+    Fortran_API           packages/Adapters/Fortran_API   SS  OPTIONAL
     STKMeshAdapters       packages/Adapters/STKMesh       SS  OPTIONAL
     MoabAdapters          packages/Adapters/Moab          SS  OPTIONAL
     LibmeshAdapters       packages/Adapters/Libmesh       SS  OPTIONAL
     ClassicDTKAdapters    packages/Adapters/ClassicDTK    SS  OPTIONAL
-    C_API                 packages/Adapters/C_API         SS  OPTIONAL
-    Fortran_API           packages/Adapters/Fortran_API   SS  OPTIONAL
   )


Python module wildcard

Python module wildcard

--- cmake/DevBaseMacro.cmake
+++ cmake/DevBaseMacro.cmake
@@ -298,7 +298,7 @@
     endif()

     file(GLOB PYTHON_UNIT_TEST_MODULES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
-        "*_test.py")
+        "*.py")

     foreach(MODULE ${PYTHON_UNIT_TEST_MODULES})
         set(PYTHON_UNIT_TEST_MODULE ${CMAKE_CURRENT_SOURCE_DIR}/${MODULE})


Fix casing bug.

Fix casing bug.

--- cmake/FindPrimitiv.cmake
+++ cmake/FindPrimitiv.cmake
@@ -86,7 +86,7 @@
   #message("-- primitiv C API libraries: " ${PRIMITIV_C_LIBRARIES})
   set(PRIMITIV_C_FOUND ON)
 else()
-  message(STATUS "Primitiv C API is not installed.")
+  message(STATUS "primitiv C API is not installed.")
   set(PRIMITIV_C_FOUND OFF)
 endif()

@@ -124,7 +124,7 @@

 set(PRIMITIV_VERSION "${PRIMITIV_VERSION_MAJOR}.${PRIMITIV_VERSION_MINOR}.${PRIMITIV_VERSION_PATCH}")

-#message("primitiv version requested: ${PRIMITIV_FIND_VERSION}")
+#message("primitiv version requested: ${Primitiv_FIND_VERSION}")
 #message("primitiv version found: ${PRIMITIV_VERSION}")

 if(${PRIMITIV_VERSION} VERSION_LESS ${Primitiv_FIND_VERSION})


rewrite add_test command for accuracy tests:

* use new syntax introduced in CMake 2.8.0
* set OPENCV_TEST_DATA_PATH enviroment property

--- cmake/OpenCVModule.cmake
+++ cmake/OpenCVModule.cmake
@@ -812,11 +812,15 @@
         set_target_properties(${the_target} PROPERTIES FOLDER "tests accuracy")
       endif()

-      enable_testing()
-      get_target_property(LOC ${the_target} LOCATION)
-      add_test(${the_target} "${LOC}")
-
       ocv_add_precompiled_headers(${the_target})
+
+      if(CMAKE_VERSION VERSION_GREATER "2.8" AND OPENCV_TEST_DATA_PATH)
+        add_test(NAME ${the_target} COMMAND ${the_target})
+
+        set_tests_properties(${the_target} PROPERTIES
+          ENVIRONMENT "OPENCV_TEST_DATA_PATH=${OPENCV_TEST_DATA_PATH}")
+      endif()
+
     else(OCV_DEPENDENCIES_FOUND)
       # TODO: warn about unsatisfied dependencies
     endif(OCV_DEPENDENCIES_FOUND)


modify xpu.cmake *test=kunlun (#42928)

modify xpu.cmake *test=kunlun (#42928)

--- cmake/external/xpu.cmake
+++ cmake/external/xpu.cmake
@@ -17,7 +17,7 @@
 # ubuntu and centos: use output by XDNN API team
 if(NOT DEFINED XPU_XDNN_BASE_URL)
   SET(XPU_XDNN_BASE_URL_WITHOUT_DATE "https://klx-sdk-release-public.su.bcebos.com/xdnn/dev")
-  SET(XPU_XDNN_BASE_URL "${XPU_XDNN_BASE_URL_WITHOUT_DATE}/20220511")
+  SET(XPU_XDNN_BASE_URL "${XPU_XDNN_BASE_URL_WITHOUT_DATE}/20220520")
 else()
   SET(XPU_XDNN_BASE_URL "${XPU_XDNN_BASE_URL}")
 endif()


CMake: add option for include-what-you-use

--- cmake/globalconfig.cmake
+++ cmake/globalconfig.cmake
@@ -333,6 +333,18 @@
     add_definitions(-DIVW_PROFILING)
 endif(IVW_PROFILING)

+#--------------------------------------------------------------------
+# Add option to enable include-what-you-use
+# https://github.com/include-what-you-use/include-what-you-use
+if (${CMAKE_GENERATOR} STREQUAL "Unix Makefiles")
+    find_program(iwyu_path NAMES include-what-you-use iwyu)
+    if(iwyu_path)
+        option(IVW_ENABLE_INCLUDE_WHAT_YOU_USE "Enable include-what-you-use" OFF)
+        if(IVW_ENABLE_INCLUDE_WHAT_YOU_USE)
+            set(CMAKE_CXX_INCLUDE_WHAT_YOU_USE ${iwyu_path})
+        endif()
+    endif()
+endif()

 #--------------------------------------------------------------------
 # Precompile headers


disabled native for now, as we have an error while interacting with nvcc, per http://dev.pointclouds.org/issues/927

git-svn-id: 5398946ba177a3e438c2dae55e2cdfc2fb96c905@8257 a9d63959-f2ad-4865-b262-bf0e56cfafb6

--- cmake/pcl_find_sse.cmake
+++ cmake/pcl_find_sse.cmake
@@ -4,11 +4,11 @@
     set(SSE_FLAGS)

     # Test CLANG
-    if(CMAKE_COMPILER_IS_CLANG)
-      if(APPLE)
-        SET(SSE_FLAGS "${SSE_FLAGS} -march=native")
-      endif(APPLE)
-    endif(CMAKE_COMPILER_IS_CLANG)
+    #if(CMAKE_COMPILER_IS_CLANG)
+    #  if(APPLE)
+    #    SET(SSE_FLAGS "${SSE_FLAGS} -march=native")
+    #  endif(APPLE)
+    #endif(CMAKE_COMPILER_IS_CLANG)

     # Test GCC/G++
     if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)


cmake: Re-enable stripped binary option

cmake: Re-enable stripped binary option

--- cmake/post.service.cmake
+++ cmake/post.service.cmake
@@ -521,19 +521,23 @@
 file(WRITE ${CMAKE_BINARY_DIR}/binary.txt ${BINARY})

 # old behavior: remove all symbols after elfsym
-if (NOT debug)
+if (stripped)
+  set(STRIP_LV ${CMAKE_STRIP} --strip-all ${BINARY})
+elseif (NOT debug)
   set(STRIP_LV ${CMAKE_STRIP} --strip-debug ${BINARY})
 else()
   set(STRIP_LV true)
 endif()

-add_custom_target(
-  pruned_elf_symbols ALL
-  COMMAND ${INSTALL_LOC}/bin/elf_syms ${BINARY}
-  COMMAND ${CMAKE_OBJCOPY} --update-section .elf_symbols=_elf_symbols.bin ${BINARY} ${BINARY}
-  COMMAND ${STRIP_LV}
-  DEPENDS service
-  )
+if (NOT stripped)
+  add_custom_target(
+    pruned_elf_symbols ALL
+    COMMAND ${INSTALL_LOC}/bin/elf_syms ${BINARY}
+    COMMAND ${CMAKE_OBJCOPY} --update-section .elf_symbols=_elf_symbols.bin ${BINARY} ${BINARY}
+    COMMAND ${STRIP_LV}
+    DEPENDS service
+    )
+endif()

 # create bare metal .img: make legacy_bootloader
 add_custom_target(


Hack around.

Hack around.

--- tests/macro_add_test.cmake
+++ tests/macro_add_test.cmake
@@ -170,7 +170,8 @@
           COMPILE_DEFINITIONS
             SOURCE_DIR="${CMAKE_CURRENT_SOURCE_DIR}"
           )
-        TARGET_LINK_LIBRARIES(${_target} ${DEAL_II_TARGET_${_build}} ${APP_TARGET}lib)
+	FIND_LIBRARY(APP_LIB ${APP_TARGET}lib ${APP_BINARY_DIR}/tests/)
+        TARGET_LINK_LIBRARIES(${_target} ${DEAL_II_TARGET_${_build}} ${APP_LIB})
       ENDIF()

       #


fix for building gtest on systems w/ svn < v1.8

--- common/build_gtest.cmake
+++ common/build_gtest.cmake
@@ -37,7 +37,6 @@
     SVN_REPOSITORY http://googletest.googlecode.com/svn/trunk/
     SVN_REVISION -r 660
     TIMEOUT 10
-    PATCH_COMMAND svn patch ${CMAKE_BINARY_DIR}/gtest.patch ${CMAKE_BINARY_DIR}/third_party/src/googletest
     # Force separate output paths for debug and release builds to allow easy
     # identification of correct lib in subsequent TARGET_LINK_LIBRARIES commands
     CMAKE_ARGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}


[cmake] optionally add mpi flags

[cmake] optionally add mpi flags

--- cmake/DuneUtils.cmake
+++ cmake/DuneUtils.cmake
@@ -213,12 +213,24 @@
 #INCLUDE_SYS_DIR(${CMAKE_CURRENT_SOURCE_DIR}/dune/stuff/test/)
 LINK_DIRECTORIES(${Boost_LIBRARY_DIRS})

+find_package(MPI)
+find_package(Threads)
+set(ENABLE_MPI "0" CACHE STRING "set to 1 to enalbe mpi")
+if(MPI_FOUND AND ENABLE_MPI)
+  set(HAVE_MPI MPI_CXX_FOUND)
+  set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} ${MPI_CXX_COMPILE_FLAGS})
+  include_directories(${MPI_CXX_INCLUDE_PATH})
+  # currently results in an
+  list( APPEND CMAKE_EXE_LINKER_FLAGS ${MPI_CXX_LINK_FLAGS})
+  LIST( APPEND DUNE_LIBS ${MPI_LIBRARY})
+endif(MPI_FOUND AND ENABLE_MPI)
+
 #try to enable link-time-optimization
 if (CMAKE_COMPILER_IS_GNUCC)
 	if (GCC_VERSION VERSION_GREATER 4.5 OR GCC_VERSION VERSION_EQUAL 4.5)
-		set (CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS} -flto")
-		set (CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS} -flto")
-		set (CMAKE_MODULE_LINKER_FLAGS_RELEASE "${CMAKE_MODULE_LINKER_FLAGS} -flto")
+		set (CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} -flto")
+		set (CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} -flto")
+		set (CMAKE_MODULE_LINKER_FLAGS_RELEASE "${CMAKE_MODULE_LINKER_FLAGS_RELEASE} -flto")
 	endif()
 endif()


Define protobuf files as GENERATED

Define protobuf files as GENERATED

--HG--
branch : no_ign_msgs

--- cmake/TestUtils.cmake
+++ cmake/TestUtils.cmake
@@ -7,6 +7,9 @@
     if(USE_LOW_MEMORY_TESTS)
       add_definitions(-DUSE_LOW_MEMORY_TESTS=1)
     endif(USE_LOW_MEMORY_TESTS)
+
+    set_source_files_properties(${PROTO_SRC} PROPERTIES GENERATED TRUE)
+
     add_executable(${BINARY_NAME} ${GTEST_SOURCE_file} ${PROTO_SRC})

     add_dependencies(${BINARY_NAME}


cmake bug fix

cmake bug fix

--- cmake/gsInstall.cmake
+++ cmake/gsInstall.cmake
@@ -24,11 +24,11 @@

 # Set CMake installation directory
 if(WIN32 AND NOT CYGWIN)
-  set(DEF_INSTALL_CMAKE_DIR ${LIB_INSTALL_DIR}/cmake)
+  set(DEF_CMAKE_INSTALL_DIR ${LIB_INSTALL_DIR}/cmake)
 else()
-   set(DEF_INSTALL_CMAKE_DIR ${LIB_INSTALL_DIR})
+   set(DEF_CMAKE_INSTALL_DIR ${LIB_INSTALL_DIR})
 endif()
-set(CMAKE_INSTALL_DIR ${DEF_INSTALL_CMAKE_DIR} CACHE STRING
+set(CMAKE_INSTALL_DIR ${DEF_CMAKE_INSTALL_DIR} CACHE STRING
     "Installation directory for CMake files")

 # Make relative paths absolute (needed later on)
@@ -68,7 +68,7 @@
 # ... for the install tree
 set(CONF_INCLUDE_DIRS "${CMAKE_INSTALL_PREFIX}/${INCLUDE_INSTALL_DIR}/${PROJECT_NAME}")
 set(CONF_LIB_DIRS     "${CMAKE_INSTALL_PREFIX}/${LIB_INSTALL_DIR}")
-set(CONF_USE_FILE     "${INSTALL_CMAKE_DIR}/gismoUse.cmake")
+set(CONF_USE_FILE     "${CMAKE_INSTALL_DIR}/gismoUse.cmake")
 configure_file(${PROJECT_SOURCE_DIR}/cmake/gismoConfig.cmake.in
                "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/gismoConfig.cmake" @ONLY)

@@ -130,11 +130,11 @@
         "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/gismoConfig.cmake"
         "${CMAKE_BINARY_DIR}/gismoConfigVersion.cmake"
         "${PROJECT_SOURCE_DIR}/cmake/gismoUse.cmake"
-        DESTINATION "${INSTALL_CMAKE_DIR}" COMPONENT devel)
+        DESTINATION "${CMAKE_INSTALL_DIR}" COMPONENT devel)

 # Install the export set for use with the install-tree
 #install(EXPORT gismoTargets DESTINATION
-#  "${INSTALL_CMAKE_DIR}" COMPONENT devel)
+#  "${CMAKE_INSTALL_DIR}" COMPONENT devel)

 else(GISMO_BUILD_LIB)
    message ("Configure with -DGISMO_BUILD_LIB=ON to compile the library")


Add the VC11 and Later Versions to Installer Name

Add the VC11 and later versions to PCL all-in-one installer name.
("-msvc2012", "-msvc2013", "-msvc2015")

--- cmake/pcl_cpack.cmake
+++ cmake/pcl_cpack.cmake
@@ -39,9 +39,15 @@
   endif(BUILD_all_in_one_installer)
   if(MSVC10)
     set(CPACK_NSIS_PACKAGE_NAME "${CPACK_NSIS_PACKAGE_NAME}-msvc2010-${win_system_name}")
-  else(MSVC10)
+  elseif(MSVC11)
+    set(CPACK_NSIS_PACKAGE_NAME "${CPACK_NSIS_PACKAGE_NAME}-msvc2012-${win_system_name}")
+  elseif(MSVC12)
+    set(CPACK_NSIS_PACKAGE_NAME "${CPACK_NSIS_PACKAGE_NAME}-msvc2013-${win_system_name}")
+  elseif(MSVC14)
+    set(CPACK_NSIS_PACKAGE_NAME "${CPACK_NSIS_PACKAGE_NAME}-msvc2015-${win_system_name}")
+  else()
     set(CPACK_NSIS_PACKAGE_NAME "${CPACK_NSIS_PACKAGE_NAME}-${win_system_name}")
-  endif(MSVC10)
+  endif()
   set(CPACK_PACKAGE_FILE_NAME ${CPACK_NSIS_PACKAGE_NAME})
   # force CPACK_PACKAGE_INSTALL_REGISTRY_KEY because of a known limitation in cmake/cpack to be fixed in next releases
   # http://public.kitware.com/Bug/view.php?id=9094


Removed unused macros

Removed unused macros

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

--- cmake/pcl_utils.cmake
+++ cmake/pcl_utils.cmake
@@ -40,85 +40,6 @@
         list(APPEND ${_output} "${_prefix}${_item}")
     endforeach(_item)
 endmacro(PREFIX_LIST)
-
-
-###############################################################################
-# Find a pkg-config file and use it.
-# _pkg The name of the package to search for.
-# _required Set to "REQUIRED" to cause an error if the package is not found.
-include(FindPkgConfig)
-macro(GET_PKG_CONFIG_INFO _pkg _required)
-    if(PKG_CONFIG_FOUND)
-        pkg_check_modules(${_pkg}_PKG ${_required} ${_pkg})
-        if(${_pkg}_PKG_CFLAGS_OTHER)
-            LIST_TO_STRING("${${_pkg}_PKG_CFLAGS_OTHER}" ${_pkg}_CFLAGS)
-        else(${_pkg}_PKG_CFLAGS_OTHER)
-            set(${_pkg}_CFLAGS "")
-        endif(${_pkg}_PKG_CFLAGS_OTHER)
-        set(${_pkg}_INCLUDE_DIRS ${${_pkg}_PKG_INCLUDE_DIRS})
-        set(${_pkg}_LINK_LIBS ${${_pkg}_PKG_LIBRARIES})
-        set(${_pkg}_LIBRARY_DIRS ${${_pkg}_PKG_LIBRARY_DIRS})
-        if(${_pkg}_PKG_LDFLAGS_OTHER)
-            LIST_TO_STRING("${${_pkg}_PKG_LDFLAGS_OTHER}" ${_pkg}_LINK_FLAGS)
-        else(${_pkg}_PKG_LDFLAGS_OTHER)
-            set(${_pkg}_LINK_FLAGS "")
-        endif(${_pkg}_PKG_LDFLAGS_OTHER)
-    else(PKG_CONFIG_FOUND)
-        message(STATUS "Could not find pkg-config.")
-        message(STATUS
-            "You will need to set the following variables manually:")
-        message(STATUS "${_pkg}_INCLUDE_DIRS ${_pkg}_CFLAGS_OTHER ${_pkg}_LINK_LIBS ${_pkg}_LIBRARY_DIRS ${_pkg}_LINK_FLAGS")
-    endif(PKG_CONFIG_FOUND)
-endmacro(GET_PKG_CONFIG_INFO)
-
-
-###############################################################################
-# Apply the results of a pkg-config search to the include and link directory
-# settings.
-# _pkg The name of the package who's settings should be applied.
-macro(APPLY_PKG_CONFIG_DIRS _pkg)
-    if(${_pkg}_INCLUDE_DIRS)
-        include_directories(${${_pkg}_INCLUDE_DIRS})
-    endif(${_pkg}_INCLUDE_DIRS)
-    if(${_pkg}_LIBRARY_DIRS)
-        link_directories(${${_pkg}_LIBRARY_DIRS})
-    endif(${_pkg}_LIBRARY_DIRS)
-endmacro(APPLY_PKG_CONFIG_DIRS)
-
-
-###############################################################################
-# Apply the results of a pkg-config search to a list of targets, setting the
-# link flags and libraries to link to on each target based on the information
-# from the pkg-config file.
-# _pkg The name of the package who's settings should be applied.
-# Extra arguments: The targets to apply to.
-macro(APPLY_PKG_CONFIG_TO_TGTS _pkg)
-    if(${_pkg}_LINK_FLAGS)
-        foreach(_tgt ${ARGN})
-            set_target_properties(${_tgt} PROPERTIES
-                LINK_FLAGS "${${_pkg}_LINK_FLAGS}")
-        endforeach(_tgt)
-    endif(${_pkg}_LINK_FLAGS)
-    if(${_pkg}_LINK_LIBS)
-        foreach(_tgt ${ARGN})
-            target_link_libraries(${_tgt} ${${_pkg}_LINK_LIBS})
-        endforeach(_tgt)
-    endif(${_pkg}_LINK_LIBS)
-endmacro(APPLY_PKG_CONFIG_TO_TGTS)
-
-
-###############################################################################
-# Apply the results of a pkg-config search to a list of source files, setting
-# the compile flags on each file based on the information from the pkg-config
-# file.
-# _pkg The name of the package who's settings should be applied.
-# Extra arguments: The files to apply to.
-macro(APPLY_PKG_CONFIG_TO_SRCS _pkg)
-    if(${_pkg}_CFLAGS)
-        set_source_files_properties(${ARGN}
-            PROPERTIES COMPILE_FLAGS "${${_pkg}_CFLAGS}")
-    endif(${_pkg}_CFLAGS)
-endmacro(APPLY_PKG_CONFIG_TO_SRCS)

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


Removed unused macros

Removed unused macros

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


Revert "add /MT for MSVC static lib (#278)" (#279)

This reverts commit ab76fc32c02f063f9f8d0daaefc41c28f5a1e69a.

--- Build.cmake
+++ Build.cmake
@@ -116,10 +116,6 @@
       ENDIF()
       ADD_LIBRARY(${G3LOG_LIBRARY} SHARED ${SRC_FILES})
    ELSE()
-      IF (MSVC)
-          set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MT")
-          set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MTd")
-      ENDIF()
       ADD_LIBRARY(${G3LOG_LIBRARY} STATIC ${SRC_FILES})
    ENDIF()


disable RTCc

disable RTCc

--- cmake/CompileOptions.cmake
+++ cmake/CompileOptions.cmake
@@ -75,9 +75,9 @@
         /wd4592       # -> disable warning: 'identifier': symbol will be dynamically initialized (implementation limitation)
         /wd4127       # -> disable warning: conditional expression is constant (caused by Qt)

-        $<$<CONFIG:Debug>:
-        /RTCc         # -> value is assigned to a smaller data type and results in a data loss
-        >
+        #$<$<CONFIG:Debug>:
+        #/RTCc         # -> value is assigned to a smaller data type and results in a data loss
+        #>

         $<$<CONFIG:Release>:
         /Gw           # -> whole program global optimization


with no-as-needed

with no-as-needed

--- cmake/CompilerConfig.cmake
+++ cmake/CompilerConfig.cmake
@@ -41,7 +41,8 @@
     message(STATUS "*** GCC>7 Compiler is too awesome. The following warnings are disabled:")
     message(STATUS "       no-implicit-fallthrough")
     message(STATUS "       no-aligned-new")
-    set(EXTRA_CXX_FLAGS "${EXTRA_CXX_FLAGS} -Wno-implicit-fallthrough -Wno-aligned-new")
+#    add_linker_flags(${module_name} "--no-as-needed")
+    set(EXTRA_CXX_FLAGS "${EXTRA_CXX_FLAGS} -Wno-implicit-fallthrough -Wno-aligned-new --no-as-needed")
   endif()
 endif()


Added another ACG path to search for gtest

git-svn-id: b66b41e514ff40863ef1aa95df2dbf63dd8d6be1@624 fdac6126-5c0c-442c-9429-916003d36597

--- cmake/FindGoogleTest.cmake
+++ cmake/FindGoogleTest.cmake
@@ -42,22 +42,31 @@
   else(GTEST_PREFIX)
     find_path(_GTEST_INCLUDE_DIR "gtest/gtest.h"
       PATHS
+      /ACG/acgdev/gcc-4.7-x86_64/gtest/include
       ~/sw/gtest/include
       /opt/local/include
       /usr/local/include
-	  "C:/libs/win32/gtest/include")
+      /usr/include
+      "C:/libs/win32/gtest/include"
+      NO_DEFAULT_PATH )
     find_library(_GTEST_LIBRARY gtest
       PATHS
+      /ACG/acgdev/gcc-4.7-x86_64/gtest/lib
       ~/sw/gtest/lib
       /opt/local/lib
       /usr/local/lib
-	  "C:/libs/win32/gtest/lib")
+      /usr/include
+      "C:/libs/win32/gtest/lib"
+      NO_DEFAULT_PATH )
     find_library(_GTEST_MAIN_LIBRARY gtest_main
       PATHS
+      /ACG/acgdev/gcc-4.7-x86_64/gtest/lib
       ~/sw/gtest/lib
       /opt/local/lib
       /usr/local/lib
-	  "C:/libs/win32/gtest/lib")
+      /usr/include
+      "C:/libs/win32/gtest/lib"
+      NO_DEFAULT_PATH )

      if ( _GTEST_LIBRARY )
         get_filename_component(_GTEST_LIBRARY_DIR ${_GTEST_LIBRARY} PATH CACHE )


Updated OpenVINO for 2019 R1 version on Linux

--- cmake/ModuleOpenVINO.cmake
+++ cmake/ModuleOpenVINO.cmake
@@ -4,14 +4,17 @@
         set(InferenceEngine_BASE "C:/Program Files (x86)/IntelSWTools/openvino/inference_engine")
         set(InferenceEngine_DIR ${InferenceEngine_BASE}/share)
     else()
-        set(InferenceEngine_BASE /opt/intel/computer_vision_sdk/inference_engine)
+        set(InferenceEngine_BASE /opt/intel/openvino/inference_engine)
         set(InferenceEngine_DIR ${InferenceEngine_BASE}/share)
-        set(IntelOpenMPLibrary ${InferenceEngine_BASE}/external/omp/lib/libiomp5.so)
-        set(IntelMKLLibrary ${InferenceEngine_BASE}/external/mkltiny_lnx/lib/libmkl_tiny_omp.so)
+        if("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
+            set(IntelTBB ${InferenceEngine_BASE}/external/tbb/lib/libtbb_debug.so)
+        else()
+            set(IntelTBB ${InferenceEngine_BASE}/external/tbb/lib/libtbb.so)
+        endif()
     endif()
     find_package(InferenceEngine REQUIRED)

     list(APPEND FAST_INCLUDE_DIRS ${InferenceEngine_INCLUDE_DIRS})
-    list(APPEND LIBRARIES ${InferenceEngine_LIBRARIES} ${IntelOpenMPLibrary} ${IntelMKLLibrary})
+    list(APPEND LIBRARIES ${InferenceEngine_LIBRARIES} ${IntelTBB})
     list(APPEND FAST_EXTERNAL_DEPENDENCIES IE::ie_cpu_extension)
 endif()


Add AT_ONCE and GENERATE_SCHEMA_ONLY options.

Closes #4

--- cmake/Modules/UseODB.cmake
+++ cmake/Modules/UseODB.cmake
@@ -13,7 +13,7 @@
 		message(FATAL_ERROR "odb compiler executable not found")
 	endif()

-	set(options GENERATE_QUERY GENERATE_SESSION GENERATE_SCHEMA GENERATE_PREPARED)
+	set(options AT_ONCE GENERATE_QUERY GENERATE_SESSION GENERATE_SCHEMA GENERATE_SCHEMA_ONLY GENERATE_PREPARED)
 	set(oneValueParams SCHEMA_FORMAT SCHEMA_NAME TABLE_PREFIX
 		STANDARD SLOC_LIMIT
 		HEADER_PROLOGUE INLINE_PROLOGUE SOURCE_PROLOGUE
@@ -43,6 +43,10 @@
 		list(APPEND ODB_ARGS -d "${db}")
 	endforeach()

+	if(PARAM_AT_ONCE)
+		list(APPEND ODB_ARGS --at-once)
+	endif()
+
 	if(PARAM_GENERATE_QUERY)
 		list(APPEND ODB_ARGS --generate-query)
 	endif()
@@ -53,6 +57,10 @@

 	if(PARAM_GENERATE_SCHEMA)
 		list(APPEND ODB_ARGS --generate-schema)
+	endif()
+
+	if(PARAM_GENERATE_SCHEMA_ONLY)
+		list(APPEND ODB_ARGS --generate-schema-only)
 	endif()

 	if(PARAM_GENERATE_PREPARED)


CMake: specify -Wl,--as-needed

CMake: specify -Wl,--as-needed

--- cmake/compiler-flags.cmake
+++ cmake/compiler-flags.cmake
@@ -22,6 +22,22 @@
   add_definitions(-DDEBUG)
 endif()

+set(linkerflags "-Wl,--as-needed")
+# NOT CMAKE_STATIC_LINKER_FLAGS
+SET(CMAKE_SHARED_LINKER_FLAGS
+    "${CMAKE_SHARED_LINKER_FLAGS} ${linkerflags}"
+    CACHE STRING "" FORCE )
+SET(CMAKE_EXE_LINKER_FLAGS
+    "${CMAKE_EXE_LINKER_FLAGS} ${linkerflags}"
+    CACHE STRING "" FORCE )
+SET(CMAKE_MODULE_LINKER_FLAGS
+    "${CMAKE_MODULE_LINKER_FLAGS} ${linkerflags}"
+    CACHE STRING "" FORCE )
+MARK_AS_ADVANCED(
+    CMAKE_SHARED_LINKER_FLAGS
+    CMAKE_EXE_LINKER_FLAGS
+    CMAKE_MODULE_LINKER_FLAGS )
+
 set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -O0")
 set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O0")

@@ -43,7 +59,7 @@
     "${coverage_compilation} ${coverage_link}"
     CACHE STRING "Flags used by the shared libraries linker during coverage builds."
     FORCE )
-SET(CMAKE_SHARED_MODULE_FLAGS_COVERAGE
+SET(CMAKE_MODULE_LINKER_FLAGS_COVERAGE
     "${coverage_compilation} ${coverage_link}"
     CACHE STRING "Flags used by the module linker during coverage builds."
     FORCE )
@@ -52,7 +68,7 @@
     CMAKE_C_FLAGS_COVERAGE
     CMAKE_EXE_LINKER_FLAGS_COVERAGE
     CMAKE_SHARED_LINKER_FLAGS_COVERAGE
-    CMAKE_SHARED_MODULE_FLAGS_COVERAGE )
+    CMAKE_MODULE_LINKER_FLAGS_COVERAGE )

 # -fstack-protector-all
 set(SANITIZATION_DEFAULTS "-O1 -fno-optimize-sibling-calls")


Fixing the REQUIRED feature

Fixing the REQUIRED feature

--- cmake/doxygen_catkin.cmake
+++ cmake/doxygen_catkin.cmake
@@ -40,17 +40,21 @@
   if(DOXYGEN_FOUND)
     # Stop the automatic inclusion of the doc target
     if(add_dox_args_NOT_AUTOMATIC)
-      set(ALL "")
+      # add a target to generate API documentation with Doxygen
+      add_custom_target(doc
+        ${DOXYGEN_EXECUTABLE} ${DEVEL_DOC_PATH}/Doxyfile
+        WORKING_DIRECTORY ${DEVEL_DOC_PATH}
+        COMMENT "Generating API documentation with Doxygen" VERBATIM
+        )
     else()
-      set(ALL "ALL")
+      # add a target to generate API documentation with Doxygen
+      add_custom_target(doc ALL
+        ${DOXYGEN_EXECUTABLE} ${DEVEL_DOC_PATH}/Doxyfile
+        WORKING_DIRECTORY ${DEVEL_DOC_PATH}
+        COMMENT "Generating API documentation with Doxygen" VERBATIM
+        )
     endif()

-    # add a target to generate API documentation with Doxygen
-    add_custom_target(doc ${ALL}
-      COMMAND ${DOXYGEN_EXECUTABLE} ${DEVEL_DOC_PATH}/Doxyfile
-      WORKING_DIRECTORY ${DEVEL_DOC_PATH}
-      COMMENT "Generating API documentation with Doxygen" VERBATIM
-      )
     install(DIRECTORY ${DEVEL_DOC_PATH} DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION})
   else()
     message("Unable to find Doxygen. API Documentation will not be generated")


fixed compiler flags to make all CUDA plugins work again

--- cmake/megamol_config.cmake
+++ cmake/megamol_config.cmake
@@ -31,17 +31,30 @@
 add_compile_definitions("$<$<CONFIG:DEBUG>:_DEBUG>")

 # Compiler flags
+# Note: special C++ and C-Compiler flags should be set for each language seperately as done below.
+# Otherwise, a possible compilation with CUDA will propagate those flags to the CUDA-Compiler and lead to a crash.
+# For certain systems, those flags should be set for both C++ and C compilers to work properly
 if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
   # nothing to do
 elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
-  add_compile_options("-fsized-deallocation") # TODO git history suggests this was required for cuda in 2019, still required?
-  add_compile_options("-Wno-narrowing" "-Wno-non-pod-varargs") # Prevent build fail.
+  # TODO git history suggests this was required for cuda in 2019, still required?
+  add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-fsized-deallocation>)
+  add_compile_options($<$<COMPILE_LANGUAGE:C>:-fsized-deallocation>)
+
+   # Prevent build fail.
+  add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-Wno-narrowing>)
+  add_compile_options($<$<COMPILE_LANGUAGE:C>:-Wno-narrowing>)
+  add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-Wno-non-pod-vararg>)
+  add_compile_options($<$<COMPILE_LANGUAGE:C>:-Wno-non-pod-vararg>)
 elseif (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
-  #add_compile_options("/MP" "/permissive-" "/Zc:twoPhase-" "/utf-8")
   add_compile_options($<$<COMPILE_LANGUAGE:CXX>:/MP>)
+  add_compile_options($<$<COMPILE_LANGUAGE:C>:/MP>)
   add_compile_options($<$<COMPILE_LANGUAGE:CXX>:/permissive->)
+  add_compile_options($<$<COMPILE_LANGUAGE:C>:/permissive->)
   add_compile_options($<$<COMPILE_LANGUAGE:CXX>:/Zc:twoPhase->)
+  add_compile_options($<$<COMPILE_LANGUAGE:C>:/Zc:twoPhase->)
   add_compile_options($<$<COMPILE_LANGUAGE:CXX>:/utf-8>)
+  add_compile_options($<$<COMPILE_LANGUAGE:C>:/utf-8>)
   add_compile_definitions("NOMINMAX")
 else ()
   message(FATAL_ERROR "Unsupported compiler specified: '${CMAKE_CXX_COMPILER_ID}'")


Do not use BYPRODUCTS on cmake < 3.20

Do not use BYPRODUCTS on cmake < 3.20

--- cmake_toolchain/vita.cmake
+++ cmake_toolchain/vita.cmake
@@ -160,15 +160,27 @@
   )

   ## SELF target
-  add_custom_target(${target}-self
-    ALL
-    DEPENDS ${self_outfile}
-    COMMAND ${CMAKE_COMMAND} -E copy ${self_outfile} ${target}
-    BYPRODUCTS ${target}
-  )
-
-  if(TARGET ${source})
-    add_dependencies(${target}-self ${source})
+  if(${CMAKE_VERSION} VERSION_LESS "3.20.0")
+    add_custom_target(${target}
+      ALL
+      DEPENDS ${self_outfile}
+      COMMAND ${CMAKE_COMMAND} -E copy ${self_outfile} ${target}
+    )
+  else()
+    add_custom_target(${target}-self
+      ALL
+      DEPENDS ${self_outfile}
+      COMMAND ${CMAKE_COMMAND} -E copy ${self_outfile} ${target}
+      BYPRODUCTS ${target}
+    )
+  endif()
+
+  if(TARGET ${source})
+    if(${CMAKE_VERSION} VERSION_LESS "3.20.0")
+      add_dependencies(${target} ${source})
+    else()
+      add_dependencies(${target}-self ${source})
+    endif()
   endif()
 endmacro(vita_create_self)
 ##################################################
@@ -348,15 +360,27 @@
   )

   ## VPK target
-  add_custom_target(${target}-vpk
-    ALL
-    DEPENDS ${vpk_outfile}
-    COMMAND ${CMAKE_COMMAND} -E copy ${vpk_outfile} ${target}
-    BYPRODUCTS ${target}
-  )
+  if(${CMAKE_VERSION} VERSION_LESS "3.20.0")
+    add_custom_target(${target}
+      ALL
+      DEPENDS ${vpk_outfile}
+      COMMAND ${CMAKE_COMMAND} -E copy ${vpk_outfile} ${target}
+    )
+  else()
+    add_custom_target(${target}-vpk
+      ALL
+      DEPENDS ${vpk_outfile}
+      COMMAND ${CMAKE_COMMAND} -E copy ${vpk_outfile} ${target}
+      BYPRODUCTS ${target}
+    )
+  endif()

   if(TARGET ${eboot})
-    add_dependencies(${target}-vpk ${eboot})
+    if(${CMAKE_VERSION} VERSION_LESS "3.20.0")
+      add_dependencies(${target} ${eboot})
+    else()
+      add_dependencies(${target}-vpk ${eboot})
+    endif()
   endif()
 endmacro(vita_create_vpk)
 ##################################################


trying to compile on PIZDaint with gpu

trying to compile on PIZDaint with gpu

--- util/cmake/load_cuda.cmake
+++ util/cmake/load_cuda.cmake
@@ -6,13 +6,13 @@
 	set(CUDA_PROPAGATE_HOST_FLAGS off) # if flags are passed with -Xcompiler, they also affect NVCC which doesn't understand all g++ flags we use
 	set(CUDA_HOST_COMPILER ${CMAKE_CXX_COMPILER}) # without this, cc is used instead of CC and all include paths have to be specified manually
 	string(TOUPPER "${CMAKE_BUILD_TYPE}" BUILD_TYPE_UPPER)
-	set(CUDA_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-vla ${CMAKE_CXX_FLAGS_${BUILD_TYPE_UPPER}}") # add flags specific to build type
+	set(CUDA_CXX_FLAGS "${CMAKE_CXX_FLAGS}  -lcusparse -Wno-vla ${CMAKE_CXX_FLAGS_${BUILD_TYPE_UPPER}}") # add flags specific to build type
 	string(REPLACE "-std=c++11" "" CUDA_CXX_FLAGS ${CUDA_CXX_FLAGS}) # remove C++11 from options
 	string(REPLACE "-Wall" "" CUDA_CXX_FLAGS ${CUDA_CXX_FLAGS}) # remove Wall from options

 	set(FLAGS_DEF "-USE_CUDA ${FLAGS_DEF}")
 	set(FLAGS_DEF_D "-DUSE_CUDA ${FLAGS_DEF_D}")
-	set(LIBRARIES_DEF "${LIBRARIES_DEF} -lcusparse")
+	set(LIBRARIES_DEF "${LIBRARIES_DEF}")
 endif()


Remove distutils which are deprecated in python3.10

--- cmake/modules/FindPythonInstDir.cmake
+++ cmake/modules/FindPythonInstDir.cmake
@@ -1,6 +1,6 @@
 EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c "
 from sys import stdout
-from distutils import sysconfig
-path=sysconfig.get_python_lib(True, prefix='${CMAKE_INSTALL_PREFIX}')
+from sysconfig import get_path
+path=get_path(name='platlib', vars={'platbase':'${CMAKE_INSTALL_PREFIX}'})
 stdout.write(path)"
 OUTPUT_VARIABLE PYTHON_INSTALL_DIR)


Re-apply r296730, "cmake: Configure the ThinLTO cache directory when using ELF lld or gold."

All known cache-related bugs observed when self hosting have been fixed (r296907
and r297853).

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

--- cmake/modules/HandleLLVMOptions.cmake
+++ cmake/modules/HandleLLVMOptions.cmake
@@ -715,11 +715,20 @@
   if(NOT LINKER_IS_LLD_LINK)
     append("-flto=thin" CMAKE_EXE_LINKER_FLAGS CMAKE_SHARED_LINKER_FLAGS)
   endif()
-  # On darwin, enable the lto cache. This improves initial build time a little
-  # since we re-link a lot of the same objects, and significantly improves
-  # incremental build time.
-  append_if(APPLE "-Wl,-cache_path_lto,${PROJECT_BINARY_DIR}/lto.cache"
-            CMAKE_EXE_LINKER_FLAGS CMAKE_SHARED_LINKER_FLAGS)
+  # If the linker supports it, enable the lto cache. This improves initial build
+  # time a little since we re-link a lot of the same objects, and significantly
+  # improves incremental build time.
+  # FIXME: We should move all this logic into the clang driver.
+  if(APPLE)
+    append("-Wl,-cache_path_lto,${PROJECT_BINARY_DIR}/lto.cache"
+           CMAKE_EXE_LINKER_FLAGS CMAKE_SHARED_LINKER_FLAGS)
+  elseif(UNIX AND LLVM_USE_LINKER STREQUAL "lld")
+    append("-Wl,--thinlto-cache-dir=${PROJECT_BINARY_DIR}/lto.cache"
+           CMAKE_EXE_LINKER_FLAGS CMAKE_SHARED_LINKER_FLAGS)
+  elseif(LLVM_USE_LINKER STREQUAL "gold")
+    append("-Wl,--plugin-opt,cache-dir=${PROJECT_BINARY_DIR}/lto.cache"
+           CMAKE_EXE_LINKER_FLAGS CMAKE_SHARED_LINKER_FLAGS)
+  endif()
 elseif(uppercase_LLVM_ENABLE_LTO STREQUAL "FULL")
   append("-flto=full" CMAKE_CXX_FLAGS CMAKE_C_FLAGS)
   if(NOT LINKER_IS_LLD_LINK)


[CMake] Add LLVM_BUILD_INSTRUMENTED option to enable building with -fprofile-instr-generate

This is the first step in supporting PGO data generation via CMake. I've marked the option as advanced and experimental until it is fleshed out further.

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

--- cmake/modules/HandleLLVMOptions.cmake
+++ cmake/modules/HandleLLVMOptions.cmake
@@ -587,6 +587,14 @@
   message(FATAL_ERROR "Exception handling requires RTTI. You must set LLVM_ENABLE_RTTI to ON")
 endif()

+option(LLVM_BUILD_INSTRUMENTED "Build LLVM and tools with PGO instrumentation (experimental)" Off)
+mark_as_advanced(LLVM_BUILD_INSTRUMENTED)
+append_if(LLVM_BUILD_INSTRUMENTED "-fprofile-instr-generate"
+  CMAKE_CXX_FLAGS
+  CMAKE_C_FLAGS
+  CMAKE_EXE_LINKER_FLAGS
+  CMAKE_SHARED_LINKER_FLAGS)
+
 # Plugin support
 # FIXME: Make this configurable.
 if(WIN32 OR CYGWIN)


Always use UNIX line endings (allowing to execute scripts in cygwin shell)

--- cmake/modules/RootConfiguration.cmake
+++ cmake/modules/RootConfiguration.cmake
@@ -477,28 +477,28 @@
 set(pythonvers ${PYTHON_VERSION})

 #---RConfigure.h---------------------------------------------------------------------------------------------
-configure_file(${PROJECT_SOURCE_DIR}/config/RConfigure.in include/RConfigure.h)
+configure_file(${PROJECT_SOURCE_DIR}/config/RConfigure.in include/RConfigure.h NEWLINE_STYLE UNIX)
 install(FILES ${CMAKE_BINARY_DIR}/include/RConfigure.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})

 #---Configure and install various files----------------------------------------------------------------------
 execute_Process(COMMAND hostname OUTPUT_VARIABLE BuildNodeInfo OUTPUT_STRIP_TRAILING_WHITESPACE )

-configure_file(${CMAKE_SOURCE_DIR}/config/rootrc.in ${CMAKE_BINARY_DIR}/etc/system.rootrc @ONLY)
-configure_file(${CMAKE_SOURCE_DIR}/config/RConfigOptions.in include/RConfigOptions.h)
+configure_file(${CMAKE_SOURCE_DIR}/config/rootrc.in ${CMAKE_BINARY_DIR}/etc/system.rootrc @ONLY NEWLINE_STYLE UNIX)
+configure_file(${CMAKE_SOURCE_DIR}/config/RConfigOptions.in include/RConfigOptions.h NEWLINE_STYLE UNIX)
 if(ruby)
   file(APPEND ${CMAKE_BINARY_DIR}/include/RConfigOptions.h "\#define R__RUBY_MAJOR ${RUBY_MAJOR_VERSION}\n\#define R__RUBY_MINOR ${RUBY_MINOR_VERSION}\n")
 endif()

-configure_file(${CMAKE_SOURCE_DIR}/config/Makefile-comp.in config/Makefile.comp)
-configure_file(${CMAKE_SOURCE_DIR}/config/Makefile.in config/Makefile.config)
-configure_file(${CMAKE_SOURCE_DIR}/config/mimes.unix.in ${CMAKE_BINARY_DIR}/etc/root.mimes)
+configure_file(${CMAKE_SOURCE_DIR}/config/Makefile-comp.in config/Makefile.comp NEWLINE_STYLE UNIX)
+configure_file(${CMAKE_SOURCE_DIR}/config/Makefile.in config/Makefile.config NEWLINE_STYLE UNIX)
+configure_file(${CMAKE_SOURCE_DIR}/config/mimes.unix.in ${CMAKE_BINARY_DIR}/etc/root.mimes NEWLINE_STYLE UNIX)

 #---Generate the ROOTConfig files to be used by CMake projects-----------------------------------------------
 ROOT_SHOW_OPTIONS(ROOT_ENABLED_OPTIONS)
 configure_file(${CMAKE_SOURCE_DIR}/cmake/scripts/ROOTConfig-version.cmake.in
-               ${CMAKE_BINARY_DIR}/ROOTConfig-version.cmake @ONLY)
+               ${CMAKE_BINARY_DIR}/ROOTConfig-version.cmake @ONLY NEWLINE_STYLE UNIX)
 configure_file(${CMAKE_SOURCE_DIR}/cmake/scripts/RootUseFile.cmake.in
-               ${CMAKE_BINARY_DIR}/ROOTUseFile.cmake @ONLY)
+               ${CMAKE_BINARY_DIR}/ROOTUseFile.cmake @ONLY NEWLINE_STYLE UNIX)

 #---Compiler flags (because user apps are a bit dependent on them...)----------------------------------------
 set(ROOT_COMPILER_FLAG_HINTS "#
@@ -526,7 +526,7 @@
 get_property(exported_targets GLOBAL PROPERTY ROOT_EXPORTED_TARGETS)
 export(TARGETS ${exported_targets} FILE ${PROJECT_BINARY_DIR}/ROOTConfig-targets.cmake)
 configure_file(${CMAKE_SOURCE_DIR}/cmake/scripts/ROOTConfig.cmake.in
-               ${CMAKE_BINARY_DIR}/ROOTConfig.cmake @ONLY)
+               ${CMAKE_BINARY_DIR}/ROOTConfig.cmake @ONLY NEWLINE_STYLE UNIX)

 #---To be used from the install tree--------------------------------------------------------------------------
 # Need to calculate actual relative paths from CMAKEDIR to other locations
@@ -551,7 +551,7 @@
 set(CMAKE_MODULE_PATH \${CMAKE_MODULE_PATH}  \${_thisdir}/modules)
 ")
 configure_file(${CMAKE_SOURCE_DIR}/cmake/scripts/ROOTConfig.cmake.in
-               ${CMAKE_BINARY_DIR}/installtree/ROOTConfig.cmake @ONLY)
+               ${CMAKE_BINARY_DIR}/installtree/ROOTConfig.cmake @ONLY NEWLINE_STYLE UNIX)
 install(FILES ${CMAKE_BINARY_DIR}/ROOTConfig-version.cmake
               ${CMAKE_BINARY_DIR}/ROOTUseFile.cmake
               ${CMAKE_BINARY_DIR}/installtree/ROOTConfig.cmake DESTINATION ${CMAKE_INSTALL_CMAKEDIR})
@@ -569,7 +569,7 @@
 #---compiledata.h--------------------------------------------------------------------------------------------
 if(WIN32)
   # We cannot use the compiledata.sh script for windows
-  configure_file(${CMAKE_SOURCE_DIR}/cmake/scripts/compiledata.win32.in include/compiledata.h)
+  configure_file(${CMAKE_SOURCE_DIR}/cmake/scripts/compiledata.win32.in include/compiledata.h NEWLINE_STYLE UNIX)
 else()
   execute_process(COMMAND ${CMAKE_SOURCE_DIR}/build/unix/compiledata.sh include/compiledata.h "${CXX}" ""
        "${CMAKE_CXX_FLAGS_${uppercase_CMAKE_BUILD_TYPE}}"
@@ -577,17 +577,17 @@
         "${libdir}" "-lCore" "-lRint" "${incdir}" "" "" "${ROOT_ARCHITECTURE}" "" "${explicitlink}" )
 endif()

-configure_file(${CMAKE_SOURCE_DIR}/config/root-config.in ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/root-config @ONLY)
-configure_file(${CMAKE_SOURCE_DIR}/config/memprobe.in ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/memprobe @ONLY)
-configure_file(${CMAKE_SOURCE_DIR}/config/thisroot.sh ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/thisroot.sh @ONLY)
-configure_file(${CMAKE_SOURCE_DIR}/config/thisroot.csh ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/thisroot.csh @ONLY)
+configure_file(${CMAKE_SOURCE_DIR}/config/root-config.in ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/root-config @ONLY NEWLINE_STYLE UNIX)
+configure_file(${CMAKE_SOURCE_DIR}/config/memprobe.in ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/memprobe @ONLY NEWLINE_STYLE UNIX)
+configure_file(${CMAKE_SOURCE_DIR}/config/thisroot.sh ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/thisroot.sh @ONLY NEWLINE_STYLE UNIX)
+configure_file(${CMAKE_SOURCE_DIR}/config/thisroot.csh ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/thisroot.csh @ONLY NEWLINE_STYLE UNIX)
 configure_file(${CMAKE_SOURCE_DIR}/config/setxrd.csh ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/setxrd.csh COPYONLY)
 configure_file(${CMAKE_SOURCE_DIR}/config/setxrd.sh ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/setxrd.sh COPYONLY)
-configure_file(${CMAKE_SOURCE_DIR}/config/proofserv.in ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/proofserv @ONLY)
-configure_file(${CMAKE_SOURCE_DIR}/config/roots.in ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/roots @ONLY)
-configure_file(${CMAKE_SOURCE_DIR}/config/root-help.el.in root-help.el @ONLY)
+configure_file(${CMAKE_SOURCE_DIR}/config/proofserv.in ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/proofserv @ONLY NEWLINE_STYLE UNIX)
+configure_file(${CMAKE_SOURCE_DIR}/config/roots.in ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/roots @ONLY NEWLINE_STYLE UNIX)
+configure_file(${CMAKE_SOURCE_DIR}/config/root-help.el.in root-help.el @ONLY NEWLINE_STYLE UNIX)
 if (XROOTD_FOUND AND XROOTD_NOMAIN)
-  configure_file(${CMAKE_SOURCE_DIR}/config/xproofd.in ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/xproofd @ONLY)
+  configure_file(${CMAKE_SOURCE_DIR}/config/xproofd.in ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/xproofd @ONLY NEWLINE_STYLE UNIX)
 endif()
 if(WIN32)
   set(thisrootbat ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/thisroot.bat)


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

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

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

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


Necessary change for the new pdf driver

Necessary change for the new pdf driver

svn path=/trunk/; revision=7288

--- config.h.cmake
+++ config.h.cmake
@@ -214,6 +214,9 @@
 /* Define if pbm driver is present */
 #cmakedefine PLD_pbm

+/* Define if pdf driver is present */
+#cmakedefine PLD_pdf
+
 /* Define if plmeta driver is present */
 #cmakedefine PLD_plmeta


do not use -z defs on Solaris, it complains about libc.so implicit dependency

--- configure.cmake
+++ configure.cmake
@@ -164,9 +164,6 @@
   SET(LINK_FLAG_NO_UNDEFINED "--Wl,--no-undefined")
 ENDIF()

-IF(CMAKE_SYSTEM_NAME MATCHES "SunOS")
-  SET(LINK_FLAG_NO_UNDEFINED "-z defs")
-ENDIF()

 #Some OS specific hacks
 IF(CMAKE_SYSTEM_NAME MATCHES "FreeBSD")


Added post build size report

Added post build size report

--- toolchain/post-build.cmake
+++ toolchain/post-build.cmake
@@ -5,4 +5,6 @@

 add_custom_command(TARGET ${TARGET} POST_BUILD COMMAND ${OBJCOPY} -O ihex ${TARGET} ${TARGET}.hex)

-add_custom_command(TARGET ${TARGET} POST_BUILD COMMAND ${OBJDUMP} -d -S ${TARGET} > ${TARGET}.dmp)+add_custom_command(TARGET ${TARGET} POST_BUILD COMMAND ${OBJDUMP} -d -S ${TARGET} > ${TARGET}.dmp)
+
+add_custom_command(TARGET ${TARGET} POST_BUILD COMMAND ${OBJSIZE} ${TARGET})


[cmake] update architecture optimisation for recent models

--- src/cmakeFindModules/OptimizeForArchitecture.cmake
+++ src/cmakeFindModules/OptimizeForArchitecture.cmake
@@ -37,11 +37,24 @@
       string(REGEX REPLACE ".* Family ([0-9]+) .*" "\\1" _cpu_family "${_cpu_id}")
       string(REGEX REPLACE ".* Model ([0-9]+) .*" "\\1" _cpu_model "${_cpu_id}")
    endif(CMAKE_SYSTEM_NAME STREQUAL "Linux")
+   message(STATUS "Detected: Vendor ID '${_vendor_id}'   CPU Family '${_cpu_family}'  CPU Model '${_cpu_model}'  CPU Flags  '${_cpu_flags}'")
    if(_vendor_id STREQUAL "GenuineIntel")
       if(_cpu_family EQUAL 6)
          # Any recent Intel CPU except NetBurst
-         if(_cpu_model EQUAL 58)
+         if(_cpu_model EQUAL 70) #intel core i7-3720qm MacBook Pro Retina
             set(TARGET_ARCHITECTURE "ivy-bridge")
+         elseif( cpu_model EQUAL 69) # Core i5/i7-4xxxU CPUs
+            set(TARGET_ARCHITECTURE "haswell")
+         elseif(_cpu_model EQUAL 63) # Xeon E5 series
+            set(TARGET_ARCHITECTURE "sandy-bridge")
+         elseif(_cpu_model EQUAL 62)
+            set(TARGET_ARCHITECTURE "ivy-bridge")
+         elseif(_cpu_model EQUAL 60)
+            set(TARGET_ARCHITECTURE "haswell")
+         elseif(_cpu_model EQUAL 58)
+            set(TARGET_ARCHITECTURE "ivy-bridge")
+         elseif(_cpu_model EQUAL 47) # Xeon E7 4860
+            set(TARGET_ARCHITECTURE "westmere")
          elseif(_cpu_model EQUAL 46) # Xeon 7500 series
             set(TARGET_ARCHITECTURE "westmere")
          elseif(_cpu_model EQUAL 45) # Xeon TNG
@@ -84,9 +97,16 @@
          endif(_cpu_model GREATER 2)
       endif(_cpu_family EQUAL 6)
    elseif(_vendor_id STREQUAL "AuthenticAMD")
-      if(_cpu_family EQUAL 21) # 15h
+      if(_cpu_family EQUAL 22) # 16h
+         set(TARGET_ARCHITECTURE "AMD 16h")
+      elseif(_cpu_family EQUAL 21) # 15h
+         if(_cpu_model LESS 2)
          set(TARGET_ARCHITECTURE "bulldozer")
+         else()
+            set(TARGET_ARCHITECTURE "piledriver")
+         endif()
       elseif(_cpu_family EQUAL 20) # 14h
+         set(TARGET_ARCHITECTURE "AMD 14h")
       elseif(_cpu_family EQUAL 18) # 12h
       elseif(_cpu_family EQUAL 16) # 10h
          set(TARGET_ARCHITECTURE "barcelona")
@@ -100,7 +120,7 @@
 endmacro()

 macro(OptimizeForArchitecture)
-   set(TARGET_ARCHITECTURE "auto" CACHE STRING "CPU architecture to optimize for. Using an incorrect setting here can result in crashes of the resulting binary because of invalid instructions used.\nSetting the value to \"auto\" will try to optimize for the architecture where cmake is called.\nOther supported values are: \"none\", \"generic\", \"core\", \"merom\" (65nm Core2), \"penryn\" (45nm Core2), \"nehalem\", \"westmere\", \"sandy-bridge\", \"ivy-bridge\", \"atom\", \"k8\", \"k8-sse3\", \"barcelona\", \"istanbul\", \"magny-cours\", \"bulldozer\", \"interlagos\".")
+   set(TARGET_ARCHITECTURE "auto" CACHE STRING "CPU architecture to optimize for. Using an incorrect setting here can result in crashes of the resulting binary because of invalid instructions used.\nSetting the value to \"auto\" will try to optimize for the architecture where cmake is called.\nOther supported values are: \"none\", \"generic\", \"core\", \"merom\" (65nm Core2), \"penryn\" (45nm Core2), \"nehalem\", \"westmere\", \"sandy-bridge\", \"ivy-bridge\", \"haswell\", \"atom\", \"k8\", \"k8-sse3\", \"barcelona\", \"istanbul\", \"magny-cours\", \"bulldozer\", \"interlagos\", \"piledriver\", \"AMD 14h\", \"AMD 16h\".")
    set(_force)
    if(NOT _last_target_arch STREQUAL "${TARGET_ARCHITECTURE}")
       message(STATUS "target changed from \"${_last_target_arch}\" to \"${TARGET_ARCHITECTURE}\"")
@@ -160,6 +180,12 @@
       list(APPEND _march_flag_list "corei7")
       list(APPEND _march_flag_list "core2")
       list(APPEND _available_vector_units_list "sse" "sse2" "sse3" "ssse3" "sse4.1" "sse4.2")
+   elseif(TARGET_ARCHITECTURE STREQUAL "haswell")
+      list(APPEND _march_flag_list "core-avx2")
+      list(APPEND _march_flag_list "core-avx-i")
+      list(APPEND _march_flag_list "corei7-avx")
+      list(APPEND _march_flag_list "core2")
+      list(APPEND _available_vector_units_list "sse" "sse2" "sse3" "ssse3" "sse4.1" "sse4.2" "avx" "avx2" "rdrnd" "f16c" "fma")
    elseif(TARGET_ARCHITECTURE STREQUAL "ivy-bridge")
       list(APPEND _march_flag_list "core-avx-i")
       list(APPEND _march_flag_list "corei7-avx")
@@ -181,6 +207,20 @@
       list(APPEND _march_flag_list "k8-sse3")
       list(APPEND _march_flag_list "k8")
       list(APPEND _available_vector_units_list "sse" "sse2" "sse3")
+   elseif(TARGET_ARCHITECTURE STREQUAL "AMD 16h")
+      list(APPEND _march_flag_list "btver2")
+      list(APPEND _march_flag_list "btver1")
+      list(APPEND _available_vector_units_list "sse" "sse2" "sse3" "ssse3" "sse4a" "sse4.1" "sse4.2" "avx" "f16c")
+   elseif(TARGET_ARCHITECTURE STREQUAL "AMD 14h")
+      list(APPEND _march_flag_list "btver1")
+      list(APPEND _available_vector_units_list "sse" "sse2" "sse3" "ssse3" "sse4a")
+   elseif(TARGET_ARCHITECTURE STREQUAL "piledriver")
+      list(APPEND _march_flag_list "bdver2")
+      list(APPEND _march_flag_list "bdver1")
+      list(APPEND _march_flag_list "bulldozer")
+      list(APPEND _march_flag_list "barcelona")
+      list(APPEND _march_flag_list "core2")
+      list(APPEND _available_vector_units_list "sse" "sse2" "sse3" "ssse3" "sse4a" "sse4.1" "sse4.2" "avx" "xop" "fma4" "fma" "f16c")
    elseif(TARGET_ARCHITECTURE STREQUAL "interlagos")
       list(APPEND _march_flag_list "bdver1")
       list(APPEND _march_flag_list "bulldozer")
@@ -227,6 +267,7 @@
          set(AVX_FOUND false)
          set(XOP_FOUND false)
          set(FMA4_FOUND false)
+         set(AVX2_FOUND false)
       else()
          _my_find(_available_vector_units_list "avx" AVX_FOUND)
          _my_find(_available_vector_units_list "fma4" FMA4_FOUND)
@@ -236,6 +277,12 @@
          else()
             _my_find(_available_vector_units_list "xop" XOP_FOUND)
          endif()
+         if(DEFINED Vc_AVX2_INTRINSICS_BROKEN AND Vc_AVX2_INTRINSICS_BROKEN)
+            UserWarning("AVX2 disabled per default because of old/broken compiler")
+            set(AVX2_FOUND false)
+         else()
+            _my_find(_available_vector_units_list "avx2" AVX2_FOUND)
+         endif()
       endif()
       set(USE_SSE2   ${SSE2_FOUND}   CACHE BOOL "Use SSE2. If SSE2 instructions are not enabled the SSE implementation will be disabled." ${_force})
       set(USE_SSE3   ${SSE3_FOUND}   CACHE BOOL "Use SSE3. If SSE3 instructions are not enabled they will be emulated." ${_force})
@@ -244,9 +291,10 @@
       set(USE_SSE4_2 ${SSE4_2_FOUND} CACHE BOOL "Use SSE4.2. If SSE4.2 instructions are not enabled they will be emulated." ${_force})
       set(USE_SSE4a  ${SSE4a_FOUND}  CACHE BOOL "Use SSE4a. If SSE4a instructions are not enabled they will be emulated." ${_force})
       set(USE_AVX    ${AVX_FOUND}    CACHE BOOL "Use AVX. This will double some of the vector sizes relative to SSE." ${_force})
+      set(USE_AVX2   ${AVX2_FOUND}   CACHE BOOL "Use AVX2. This will double all of the vector sizes relative to SSE." ${_force})
       set(USE_XOP    ${XOP_FOUND}    CACHE BOOL "Use XOP." ${_force})
       set(USE_FMA4   ${FMA4_FOUND}   CACHE BOOL "Use FMA4." ${_force})
-      mark_as_advanced(USE_SSE2 USE_SSE3 USE_SSSE3 USE_SSE4_1 USE_SSE4_2 USE_SSE4a USE_AVX USE_XOP USE_FMA4)
+      mark_as_advanced(USE_SSE2 USE_SSE3 USE_SSSE3 USE_SSE4_1 USE_SSE4_2 USE_SSE4a USE_AVX USE_AVX2 USE_XOP USE_FMA4)
       if(USE_SSE2)
          list(APPEND _enable_vector_unit_list "sse2")
       else(USE_SSE2)
@@ -295,6 +343,11 @@
          list(APPEND _enable_vector_unit_list "fma4")
       else()
          list(APPEND _disable_vector_unit_list "fma4")
+      endif()
+      if(USE_AVX2)
+         list(APPEND _enable_vector_unit_list "avx2")
+      else()
+         list(APPEND _disable_vector_unit_list "avx2")
       endif()
       if(MSVC)
          # MSVC on 32 bit can select /arch:SSE2 (since 2010 also /arch:AVX)
@@ -387,6 +440,8 @@
                   set(_header "ammintrin.h")
                elseif(_flag STREQUAL "avx")
                   set(_header "immintrin.h")
+               elseif(_flag STREQUAL "avx2")
+                  set(_header "immintrin.h")
                elseif(_flag STREQUAL "fma4")
                   set(_header "x86intrin.h")
                elseif(_flag STREQUAL "xop")


NaCl: Fix NaCl support

NaCl: Fix NaCl support

--- cmake/os.cmake
+++ cmake/os.cmake
@@ -354,12 +354,18 @@
   target_link_libraries(${TARGET}${TARGET_POSTFIX} --whole-archive config_json_${TARGET} --no-whole-archive)
 endfunction()

-#TODO fix nacl
 function(os_add_nacl TARGET FILENAME)
-  set(NACL_PATH ${CONAN_RES_DIRS_INCLUDEOS}/tools/NaCl)
+  find_program(PYTHON2_EXECUTABLE python)
+  if (PYTHON2_EXECUTABLE-NOTFOUND)
+    message(FATAL_ERROR "Python not found")
+  endif()
+  find_program(NACL_SCRIPT NaCl.py)
+  if (NACL_SCRIPT-NOTFOUND)
+    message(FATAL_ERROR "NaCl.py not found")
+  endif()
   add_custom_command(
      OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/nacl_content.cpp
-     COMMAND cat ${CMAKE_CURRENT_SOURCE_DIR}/${FILENAME} | ${PYTHON3_EXECUTABLE} ${NACL_PATH}/NaCl.py ${CMAKE_CURRENT_BINARY_DIR}/nacl_content.cpp
+     COMMAND cat ${CMAKE_CURRENT_SOURCE_DIR}/${FILENAME} | ${PYTHON2_EXECUTABLE} ${NACL_SCRIPT} ${CMAKE_CURRENT_BINARY_DIR}/nacl_content.cpp
      DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${FILENAME}
    )
    add_library(nacl_content STATIC ${CMAKE_CURRENT_BINARY_DIR}/nacl_content.cpp)


remove the implicit -fPIC: it breaks the ICC optimizer

--- cmake/FindMIC.cmake
+++ cmake/FindMIC.cmake
@@ -181,7 +181,7 @@
       endforeach()

       add_custom_command(OUTPUT "${${_output}}"
-         COMMAND "${_compiler}" -mmic -fPIC
+         COMMAND "${_compiler}" -mmic
          -DVC_IMPL=MIC
          ${_flags} -c -o "${${_output}}" "${_abs}"
          DEPENDS "${_abs}"


Respect the INTR_QTDIR (env)variable

Respect the INTR_QTDIR (env)variable

--- cmake/FindQt5.cmake
+++ cmake/FindQt5.cmake
@@ -12,6 +12,8 @@
     NAMES qmake qmake5 qmake-qt5
     PATH_SUFFIXES bin
     PATHS
+      ${INTR_QTDIR}
+      $ENV{INTR_QTDIR}
       ${QT_SEARCH_PATH}
       $ENV{QTDIR}
       ~/Library/Frameworks


cmake: fix kconfig targets

cmake: fix kconfig targets

Commit 269f35048770cc981a1db1ecc770ded62e141291 introduced a new
mechanism for loading the edtlib.EDT representation of the devicetree
from kconfigfunctions.py.

While this works for running kconfig.py from kconfig.cmake using
execute_process(), it doesn't work when kconfigfunctions.py is loaded
by the menuconfig target or any other Kconfig targets that use
add_custom_target().

The reason why is that these targets' environments do not have the
location of the EDT pickle file available. This is unlike kconfig.py,
which executes using the same environment as cmake itself, where
edt.pickle's location is already available in the environment.

Fix that by adding EDT_PICKLE to the environment for menuconfig and
friends.

Reported-by: Simon Guinot <3ab4e30ada880520f74922b979fc5ca34d9375bb@seagate.com>
Signed-off-by: Martí Bolívar <9d90ac4c7bf6a305f6bfd81a23c7859bc883380e@nordicsemi.no>

--- cmake/kconfig.cmake
+++ cmake/kconfig.cmake
@@ -94,6 +94,7 @@
     EXTRA_DTC_FLAGS=${EXTRA_DTC_FLAGS}
     DTS_POST_CPP=${DTS_POST_CPP}
     DTS_ROOT_BINDINGS=${DTS_ROOT_BINDINGS}
+    EDT_PICKLE=${EDT_PICKLE}
     ${PYTHON_EXECUTABLE}
     ${EXTRA_KCONFIG_TARGET_COMMAND_FOR_${kconfig_target}}
     ${KCONFIG_ROOT}


Fixed config option.

Fixed config option.

--- cmake/ConfigOptions.cmake
+++ cmake/ConfigOptions.cmake
@@ -47,8 +47,7 @@
 	CMAKE_DEPENDENT_OPTION(WITH_SANITIZE_LEAK "Compile with gcc/clang leak sanitizer." OFF "NOT WITH_VALGRIND_MEMCHECK; NOT WITH_SANITIZE_ADDRESS" OFF)
 else()
 	if(NOT UWP)
-		option(WITH_MEDIA_FOUNDATION "Enable H264 media foundation decoder." ON
-			"WITH_GFX_H264" OFF)
+		option(WITH_MEDIA_FOUNDATION "Enable H264 media foundation decoder." ON)
 	endif()
 endif()
 CMAKE_DEPENDENT_OPTION(WITH_GFX_H264 "Build GFX H264 support. A backend (OpenH264|FFMPEG|X264|MediaFoundation) must also be compiled in." ON


Make directory before getting dependencies to avoid errors of directory not existing.

--- cmake/Depdendencies.cmake
+++ cmake/Depdendencies.cmake
@@ -1,5 +1,10 @@
 # Setup all dependencies for FAST, both internal (have to be installed on the system)
 # and external (downloaded and built automatically)
+
+file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/lib/)
+file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/bin/)
+file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/include/)
+file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/licenses/)

 ## OpenCL
 if(WIN32)


FindPortAudio.cmake: adjust variable name prefix to PORTAUDIO_.

--- cmake/FindPortAudio.cmake
+++ cmake/FindPortAudio.cmake
@@ -1,77 +1,77 @@
 # - Try to find portaudio
 # Once done this will define
-#  LIBPORTAUDIO_FOUND - System has portaudio
-#  LIBPORTAUDIO_INCLUDE_DIRS - The portaudio include directories
-#  LIBPORTAUDIO_LIBRARIES - The libraries needed to use portaudio
-#  LIBPORTAUDIO_DEFINITIONS - Compiler switches required for using portaudio
+#  PORTAUDIO_FOUND - System has portaudio
+#  PORTAUDIO_INCLUDE_DIRS - The portaudio include directories
+#  PORTAUDIO_LIBRARIES - The libraries needed to use portaudio
+#  PORTAUDIO_DEFINITIONS - Compiler switches required for using portaudio

-set(LIBPORTAUDIO_SEARCH_LIBS libportaudio portaudio libportaudio-2 portaudio-2
+set(PORTAUDIO_SEARCH_LIBS libportaudio portaudio libportaudio-2 portaudio-2
 	libportaudio19 portaudio19 libportaudio-19 portaudio-19 libportaudio2
 	portaudio2)
-set(LIBPORTAUDIO_SEARCH_HEADERS portaudio.h)
+set(PORTAUDIO_SEARCH_HEADERS portaudio.h)

 if (MSVC)
-	if(NOT DEFINED LIBPORTAUDIO_DIR)
-		if(DEFINED LIBPORTAUDIO_ROOT)
-			set(LIBPORTAUDIO_DIR ${LIBPORTAUDIO_ROOT})
-		elseif(DEFINED ENV{LIBPORTAUDIO_ROOT})
-			set(LIBPORTAUDIO_DIR $ENV{LIBPORTAUDIO_ROOT})
+	if(NOT DEFINED PORTAUDIO_DIR)
+		if(DEFINED PORTAUDIO_ROOT)
+			set(PORTAUDIO_DIR ${PORTAUDIO_ROOT})
+		elseif(DEFINED ENV{PORTAUDIO_ROOT})
+			set(PORTAUDIO_DIR $ENV{PORTAUDIO_ROOT})
 		endif()
 	endif()
-	set(LIBPORTAUDIO_DIR ${LIBPORTAUDIO_DIR} CACHE
+	set(PORTAUDIO_DIR ${PORTAUDIO_DIR} CACHE
 		PATH "Installation folder of portaudio")

 	if (CMAKE_CL_64)
-		set(_subdirs ${LIBPORTAUDIO_DIR}/x64 ${LIBPORTAUDIO_DIR}/x64/lib
-			${LIBPORTAUDIO_DIR}/lib/x64 ${LIBPORTAUDIO_DIR}/lib64
-			${LIBPORTAUDIO_DIR}/lib ${LIBPORTAUDIO_DIR})
+		set(_subdirs ${PORTAUDIO_DIR}/x64 ${PORTAUDIO_DIR}/x64/lib
+			${PORTAUDIO_DIR}/lib/x64 ${PORTAUDIO_DIR}/lib64
+			${PORTAUDIO_DIR}/lib ${PORTAUDIO_DIR})
 		set(_suffix _x64)
 	else()
-		set(_subdirs ${LIBPORTAUDIO_DIR}/x86 ${LIBPORTAUDIO_DIR}/x86/lib
-			${LIBPORTAUDIO_DIR}/lib/x86 ${LIBPORTAUDIO_DIR}/lib32
-			${LIBPORTAUDIO_DIR}/lib ${LIBPORTAUDIO_DIR})
+		set(_subdirs ${PORTAUDIO_DIR}/x86 ${PORTAUDIO_DIR}/x86/lib
+			${PORTAUDIO_DIR}/lib/x86 ${PORTAUDIO_DIR}/lib32
+			${PORTAUDIO_DIR}/lib ${PORTAUDIO_DIR})
 		set(_suffix _x86)
 	endif()

-	foreach(_lib ${LIBPORTAUDIO_SEARCH_LIBS})
+	foreach(_lib ${PORTAUDIO_SEARCH_LIBS})
 		list(APPEND _libs ${_lib})
 		list(APPEND _libs "${_lib}${_suffix}")
 	endforeach()

-	find_library(LIBPORTAUDIO_LIBRARY
+	find_library(PORTAUDIO_LIBRARY
 		NAMES ${_libs}
 		PATHS ${_subdirs})

-#	message("LIBPORTAUDIO_LIBRARY: ${LIBPORTAUDIO_LIBRARY}")
+#	message("PORTAUDIO_LIBRARY: ${PORTAUDIO_LIBRARY}")

-	find_path(LIBPORTAUDIO_INCLUDE_DIR ${LIBPORTAUDIO_SEARCH_HEADERS}
+	find_path(PORTAUDIO_INCLUDE_DIR ${PORTAUDIO_SEARCH_HEADERS}
 		PATHS ${_subdirs}
 		PATH_SUFFIXES include)

-#	message("LIBPORTAUDIO_INCLUDE_DIR: ${LIBPORTAUDIO_LIBRARY}")
+#	message("PORTAUDIO_INCLUDE_DIR: ${PORTAUDIO_LIBRARY}")

 else ()
 	find_package(PkgConfig)
-	pkg_check_modules(PC_LIBPORTAUDIO QUIET portaudio)
-	set(LIBPORTAUDIO_DEFINITIONS ${PC_LIBPORTAUDIO_CFLAGS_OTHER})
+	pkg_check_modules(PC_PORTAUDIO QUIET portaudio)
+	set(PORTAUDIO_DEFINITIONS ${PC_PORTAUDIO_CFLAGS_OTHER})

-	find_path(LIBPORTAUDIO_INCLUDE_DIR portaudio.h
-		HINTS ${PC_LIBPORTAUDIO_INCLUDEDIR} ${PC_LIBPORTAUDIO_INCLUDE_DIRS})
+	find_path(PORTAUDIO_INCLUDE_DIR portaudio.h
+		HINTS ${PC_PORTAUDIO_INCLUDEDIR} ${PC_PORTAUDIO_INCLUDE_DIRS})

-	find_library(LIBPORTAUDIO_LIBRARY NAMES libportaudio portaudio
-		HINTS ${PC_LIBPORTAUDIO_LIBDIR} ${PC_LIBPORTAUDIO_LIBRARY_DIRS})
+	find_library(PORTAUDIO_LIBRARY NAMES libportaudio portaudio
+		HINTS ${PC_PORTAUDIO_LIBDIR} ${PC_PORTAUDIO_LIBRARY_DIRS})

-	set(LIBPORTAUDIO_VERSION ${PC_LIBPORTAUDIO_VERSION})
+	set(PORTAUDIO_VERSION ${PC_PORTAUDIO_VERSION})
 endif()

-set(LIBPORTAUDIO_LIBRARIES ${LIBPORTAUDIO_LIBRARY})
-set(LIBPORTAUDIO_INCLUDE_DIRS ${LIBPORTAUDIO_INCLUDE_DIR})
+set(PORTAUDIO_LIBRARIES ${PORTAUDIO_LIBRARY})
+set(PORTAUDIO_INCLUDE_DIRS ${PORTAUDIO_INCLUDE_DIR})

 include(FindPackageHandleStandardArgs)
-# handle the QUIETLY and REQUIRED arguments and set LIBPORTAUDIO_FOUND to TRUE
+# handle the QUIETLY and REQUIRED arguments and set PORTAUDIO_FOUND to TRUE
 # if all listed variables are TRUE
-find_package_handle_standard_args(LIBPORTAUDIO
-	REQUIRED_VARS LIBPORTAUDIO_LIBRARIES LIBPORTAUDIO_INCLUDE_DIRS
-	VERSION_VAR LIBPORTAUDIO_VERSION)
+find_package_handle_standard_args(PORTAUDIO
+	REQUIRED_VARS PORTAUDIO_LIBRARIES PORTAUDIO_INCLUDE_DIRS
+	VERSION_VAR PORTAUDIO_VERSION)

-mark_as_advanced(LIBPORTAUDIO_INCLUDE_DIRS LIBPORTAUDIO_LIBRARIES)
+mark_as_advanced(PORTAUDIO_INCLUDE_DIRS PORTAUDIO_LIBRARIES)


Fix bug in DeployQt4.

Fix bug in DeployQt4.

--- cmake/DeployQt4.cmake
+++ cmake/DeployQt4.cmake
@@ -250,7 +250,11 @@
         endif()

         get_filename_component(executable_absolute "${executable}" ABSOLUTE)
-        gp_file_type("${executable_absolute}" "${QT_QTCORE_LIBRARY}" qtcore_type)
+        if(EXISTS "${QT_QTCORE_LIBRARY_RELEASE}")
+            gp_file_type("${executable_absolute}" "${QT_QTCORE_LIBRARY_RELEASE}" qtcore_type)
+        elseif(EXISTS "${QT_QTCORE_LIBRARY_DEBUG}")
+            gp_file_type("${executable_absolute}" "${QT_QTCORE_LIBRARY_DEBUG}" qtcore_type)
+        endif()
         if(qtcore_type STREQUAL "system")
                 set(qt_plugins_dir "")
         endif()


Do not double check it the library during find_package command

find_library command fails if selected library type not found.

--- cmake/NewbaseConfig.cmake
+++ cmake/NewbaseConfig.cmake
@@ -16,10 +16,6 @@
         find_library (Newbase_SHARED_LIB "libNewbase.so" ${INSTALLED_PREFIX})
         set(Newbase_LIBRARIES  ${Newbase_SHARED_LIB})
     endif()
-
-    if(NOT EXISTS ${Newbase_LIBRARIES})
-        message(FATAL_ERROR "Library ${Newbase_LIBRARIES} not found.")
-    endif()
 else()
     set(Newbase_LIBRARIES  ${INSTALLED_PREFIX}/lib/Newbase.lib)
 endif()


Updated SHA for swig

Updated SHA for swig

--- cmake/FetchSwig.cmake
+++ cmake/FetchSwig.cmake
@@ -6,7 +6,7 @@
     FetchContent_Declare(
       swig
       URL ${FAST_PREBUILT_DEPENDENCY_DOWNLOAD_URL_NEW}/${FILENAME}
-      URL_HASH SHA256=a4eea185e04634c8d9cb2e5655bef6bf68a921a3790dae09f7f7289f5b916e1b
+      URL_HASH SHA256=56c1f0eae1e25643cc98b2489a22e78c2970a04007d02849eb355e865384ad18
     )
 else()
     FetchContent_Declare(


Set RPATHCMD.

Set RPATHCMD.

svn path=/trunk/; revision=6790

--- cmake/modules/rpath.cmake
+++ cmake/modules/rpath.cmake
@@ -25,4 +25,5 @@
 option(USE_RPATH "use -rpath when linking libraries" ON)
 if(USE_RPATH)
   set(CMAKE_INSTALL_RPATH ${LIB_DIR})
+  set(RPATHCMD "-Wl,-rpath -Wl,${LIB_DIR}")
 endif(USE_RPATH)