ENH: Simplify the internal _MACRO_SETUP_PLUGIN_DEPENDENCIES macro by using CMake 2.6 features. This should speed up the configuration process.

--- openCherry/CMake/cherryPluginHelpers.cmake
+++ openCherry/CMake/cherryPluginHelpers.cmake
@@ -20,7 +20,7 @@

   SET(${output_name} ${_name_with_points})

-ENDMACRO(_MACRO_CREATE_PLUGIN_NAME)
+ENDMACRO()

 # sets pluginpath to the absolut path of the plugins source directory
@@ -39,7 +39,7 @@

   #MESSAGE(STATUS "Found plugin src dir: ${${pluginpath}}")

-ENDMACRO(_MACRO_FIND_PLUGIN_SRC_DIR)
+ENDMACRO()

 # sets pluginpath to the absolut path of the plugins binary output directory
 #
@@ -56,11 +56,13 @@

   #MESSAGE(STATUS "Found plugin bin dir: ${${pluginpath}}")

-ENDMACRO(_MACRO_FIND_PLUGIN_BIN_DIR)
+ENDMACRO()

-MACRO(_MACRO_REQUIRED_BUNDLES_LIST output_list input_string)
+MACRO(_MACRO_REQUIRED_BUNDLES_LIST output_list input_file)

-  SET(_reqb_input ${input_string})
+  SET(_file "${input_file}")
+  FILE(STRINGS "${_file}" _mfline LENGTH_MINIMUM 1 REGEX " *Require-Bundle *: *[^ ]+")
+  STRING(REGEX REPLACE "^[^:]*[:](.*)" "\\1" _reqb_input "${_mfline}")

   SET(_reqb_dependencies )
   IF(_reqb_input)
@@ -69,10 +71,10 @@

   FOREACH(_dep ${_reqb_dependencies})
     # remove leading and trailing whitespace
-    STRING(REGEX MATCH "[^ ]+" _trimeddep ${_dep})
+    STRING(STRIP ${_dep} _trimeddep)
     LIST(APPEND ${output_list} ${_trimeddep})
   ENDFOREACH(_dep ${_reqb_dependencies})
-ENDMACRO(_MACRO_REQUIRED_BUNDLES_LIST output_list input_string)
+ENDMACRO()

 # _MACRO_SETUP_PLUGIN_DEPENDENCIES(
 #      _explicit_libs
@@ -86,87 +88,75 @@
   SET(_plugin_src_dir )
   _MACRO_FIND_PLUGIN_SRC_DIR(_plugin_src_dir ${_FIND_DEPS_PLUGIN_NAME})

-  MACRO_PARSE_MANIFEST(${_plugin_src_dir}/META-INF/MANIFEST.MF)
-
   SET(_plugin_dependencies )
-  _MACRO_REQUIRED_BUNDLES_LIST(_plugin_dependencies "${REQUIRE-BUNDLE}")
-
-  SET(_plugin_depends_all )
+  _MACRO_REQUIRED_BUNDLES_LIST(_plugin_dependencies "${_plugin_src_dir}/META-INF/MANIFEST.MF")
+
   FOREACH(_dep ${_plugin_dependencies})
-
     STRING(REPLACE . _ _dep_target ${_dep})
     SET(${_explicit_libs} ${${_explicit_libs}} ${_dep_target})
+  ENDFOREACH()

-    # build a list of all explicit and implicit dependencies
-    LIST(FIND _plugin_depends_all ${_dep} _depall_index)
-    IF(_depall_index EQUAL -1)
-      LIST(APPEND _plugin_depends_all ${_dep})
-      SET(_added_dep 1)
-    ENDIF(_depall_index EQUAL -1)
-
-    WHILE(_added_dep)
-      SET(_added_dep 0)
-      FOREACH(_depdep ${_plugin_depends_all})
+  SET(_plugin_old_dependencies "")
+  SET(_dep_error 0)
+  WHILE(NOT "${_plugin_dependencies}" STREQUAL "${_plugin_old_dependencies}")
+    SET(_plugin_old_dependencies ${_plugin_dependencies})
+
+    FOREACH(_dep ${_plugin_dependencies})

         SET(_plugin_src_dir )
-        _MACRO_FIND_PLUGIN_SRC_DIR(_plugin_src_dir ${_depdep})
+        _MACRO_FIND_PLUGIN_SRC_DIR(_plugin_src_dir ${_dep})

         IF(NOT _plugin_src_dir)
-          MESSAGE(SEND_ERROR "EMPTY DIR found for dep: \"${_depdep}\"")
-        ENDIF(NOT _plugin_src_dir)
+          MESSAGE(SEND_ERROR "Plug-in dependency \"${_dep}\" does not seem to exist.")
+          SET(_dep_error 1)
+          BREAK()
+        ENDIF()

-        MACRO_PARSE_MANIFEST("${_plugin_src_dir}/META-INF/MANIFEST.MF")
-        SET(_plugin_dependencies )
-        _MACRO_REQUIRED_BUNDLES_LIST(_plugin_dependencies "${REQUIRE-BUNDLE}")
+        _MACRO_REQUIRED_BUNDLES_LIST(_plugin_dependencies "${_plugin_src_dir}/META-INF/MANIFEST.MF")

-        FOREACH(_depdepdep ${_plugin_dependencies})
-          LIST(FIND _plugin_depends_all ${_depdepdep} _depdepdep_index)
-          IF(_depdepdep_index EQUAL -1)
-            LIST(APPEND _plugin_depends_all ${_depdepdep})
-            SET(_added_dep 1)
-          ENDIF(_depdepdep_index EQUAL -1)
-        ENDFOREACH(_depdepdep ${_plugin_dependencies})
+    ENDFOREACH()
+
+    LIST(REMOVE_DUPLICATES _plugin_dependencies)
+    LIST(SORT _plugin_dependencies)
+
+  ENDWHILE()

-      ENDFOREACH(_depdep ${_plugin_depends_all})
-
-    ENDWHILE(_added_dep)
-
-  ENDFOREACH(_dep ${_plugin_dependencies})
-
-  # iterator over all dependencies
-  SET(_plugins_turned_off )
-  SET(PLUGIN_LINK_LIBRARIES )
-  FOREACH(_dep ${_plugin_depends_all})
-
-    # collect the ids of plugins we will have to build
-    IF(NOT _BUILD_${_dep})
-      LIST(APPEND _plugins_turned_off ${_dep})
-    ENDIF()
-
-    # set include and link directories
-    SET(_dep_src_dir )
-    SET(_dep_bin_dir )
-    _MACRO_FIND_PLUGIN_SRC_DIR(_dep_src_dir ${_dep})
-    _MACRO_FIND_PLUGIN_BIN_DIR(_dep_bin_dir ${_dep})
-
-    LINK_DIRECTORIES(${_dep_bin_dir}/bin)
-    INCLUDE_DIRECTORIES(${_dep_src_dir}/src)
-
-    IF(EXISTS ${_dep_src_dir}/includes.cmake)
-      INCLUDE(${_dep_src_dir}/includes.cmake)
-      FOREACH(_added_incldir ${ADDITIONAL_INCLUDE_DIRECTORIES})
-        INCLUDE_DIRECTORIES(${_dep_src_dir}/${_added_incldir})
-      ENDFOREACH(_added_incldir ${ADDITIONAL_INCLUDE_DIRECTORIES})
-    ENDIF(EXISTS ${_dep_src_dir}/includes.cmake)
-
-    STRING(REPLACE . _ _dep_target ${_dep})
-    LIST(APPEND PLUGIN_LINK_LIBRARIES ${_dep_target})
-
-  ENDFOREACH(_dep ${_plugin_depends_all})
-
-  IF(_plugins_turned_off)
-    MESSAGE(SEND_ERROR "Unmet dependencies: The plugin ${_FIND_DEPS_PLUGIN_NAME} depends on the following plugins:\n${_plugins_turned_off}.\nSwitch them on in order to build ${_FIND_DEPS_PLUGIN_NAME}.")
-  ENDIF(_plugins_turned_off)
+  IF(NOT _dep_error)
+      # iterator over all dependencies
+      SET(_plugins_turned_off )
+      SET(PLUGIN_LINK_LIBRARIES )
+      FOREACH(_dep ${_plugin_dependencies})
+
+        # collect the ids of plugins we will have to build
+        IF(NOT _BUILD_${_dep})
+          LIST(APPEND _plugins_turned_off ${_dep})
+        ENDIF()
+
+        # set include and link directories
+        SET(_dep_src_dir )
+        SET(_dep_bin_dir )
+        _MACRO_FIND_PLUGIN_SRC_DIR(_dep_src_dir ${_dep})
+        _MACRO_FIND_PLUGIN_BIN_DIR(_dep_bin_dir ${_dep})
+
+        LINK_DIRECTORIES(${_dep_bin_dir}/bin)
+        INCLUDE_DIRECTORIES(${_dep_src_dir}/src)
+
+        IF(EXISTS ${_dep_src_dir}/includes.cmake)
+          INCLUDE(${_dep_src_dir}/includes.cmake)
+          FOREACH(_added_incldir ${ADDITIONAL_INCLUDE_DIRECTORIES})
+            INCLUDE_DIRECTORIES(${_dep_src_dir}/${_added_incldir})
+          ENDFOREACH(_added_incldir ${ADDITIONAL_INCLUDE_DIRECTORIES})
+        ENDIF(EXISTS ${_dep_src_dir}/includes.cmake)
+
+        STRING(REPLACE . _ _dep_target ${_dep})
+        LIST(APPEND PLUGIN_LINK_LIBRARIES ${_dep_target})
+
+      ENDFOREACH(_dep ${_plugin_dependencies})
+
+      IF(_plugins_turned_off)
+        MESSAGE(SEND_ERROR "Unmet dependencies: The plugin ${_FIND_DEPS_PLUGIN_NAME} depends on the following plugins:\n${_plugins_turned_off}.\nSwitch them on in order to build ${_FIND_DEPS_PLUGIN_NAME}.")
+      ENDIF(_plugins_turned_off)
+  ENDIF()

 ENDMACRO(_MACRO_SETUP_PLUGIN_DEPENDENCIES)


Update FW with usb2 patch

Update FW with usb2 patch

--- 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 "b8541a692c4bad67884849905a328229114504e8")
+set(DEPTHAI_DEVICE_SIDE_COMMIT "d83f43039de57e658f83813ebbf51290a2d54a71")

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


Fix handling of cuda and cudnn

Fix handling of cuda and cudnn

 - when cuda or tmva-gpu is on : look by default for cuda and cudnn
 - if cuda is not found set tmva-gpu to OFF
 - if cudnn is not found set tmva-cudnn to OFF

- if cuda is OFF set also cudnn to OFF

--- cmake/modules/SearchInstalledSoftware.cmake
+++ cmake/modules/SearchInstalledSoftware.cmake
@@ -1431,6 +1431,9 @@

     enable_language(CUDA)

+    set(cuda ON CACHE BOOL "Found Cuda for TMVA GPU" FORCE)
+
+
     ### look for package CuDNN
     if (cudnn )
       find_package(CuDNN)
@@ -1449,6 +1452,8 @@
     message(FATAL_ERROR "CUDA not found. Ensure that the installation of CUDA is in the CMAKE_PREFIX_PATH")
   endif()

+else()
+  set(cudnn OFF)
 endif()

 #---TMVA and its dependencies------------------------------------------------------------


spelling mistake was introduced

spelling mistake was introduced

--- test/cpymadtest/CTestTestfile.cmake
+++ test/cpymadtest/CTestTestfile.cmake
@@ -1,5 +1,5 @@

-foreach(PYTEST clic aperture urvey)
+foreach(PYTEST clic aperture survey)
    add_test(test_${PYTEST} ${PYTHON} test_${PYTEST}.py)
 endforeach()


Check CUDA support for specified C++ standard

C++14 support in CUDA is only available beginning with CUDA 9.0.
https://devblogs.nvidia.com/parallelforall/cuda-9-features-revealed

--- cmake/modules/SearchInstalledSoftware.cmake
+++ cmake/modules/SearchInstalledSoftware.cmake
@@ -1504,7 +1504,16 @@
 #---Check for CUDA and BLAS ---------------------------------------------------------
 if(tmva AND cuda)
   message(STATUS "Looking for CUDA for optional parts of TMVA")
-  find_package(CUDA 7.5)
+
+  if(cxx11)
+    find_package(CUDA 7.5)
+  elseif(cxx14)
+    message(STATUS "Detected request for c++14, requiring minimum version CUDA 9.0 (default 7.5)")
+    find_package(CUDA 9.0)
+  elseif(cxx17)
+    message(FATAL_ERROR "Using CUDA with c++17 currently not supported")
+  endif()
+
   if(NOT CUDA_FOUND)
     if(fail-on-missing)
       message(FATAL_ERROR "CUDA not found. Ensure that the installation of CUDA is in the CMAKE_PREFIX_PATH")


Register Meshfree optional dependency on BoostOrg

--- packages/Meshfree/cmake/Dependencies.cmake
+++ packages/Meshfree/cmake/Dependencies.cmake
@@ -5,4 +5,6 @@
   Kokkos
   Teuchos
   Tpetra
+  TEST_OPTIONAL_TPLS
+  BoostOrg
   )


Use regex for more clear string manipulation. (#207)

I think this reads better. If you don't agree feel free to reject PR
Signed-off-by: Dan Rose <2591e5f46f28d303f9dc027d475a5c60d8dea17a@digilabs.io>

--- ament_cmake_core/cmake/environment_hooks/ament_environment_hooks.cmake
+++ ament_cmake_core/cmake/environment_hooks/ament_environment_hooks.cmake
@@ -39,22 +39,21 @@
     get_filename_component(hook_filename "${hook}" NAME)

     # check if the file is a template
-    string_ends_with("${hook_filename}" ".in" is_template)
-    if(is_template)
-      # cut of .in extension
-      string(LENGTH "${hook_filename}" length)
-      math(EXPR offset "${length} - 3")
-      string(SUBSTRING "${hook_filename}" 0 ${offset} hook_filename)
+    if(hook_filename MATCHES "^(.*)\\.in$")
+      set(is_template TRUE)
+      # cut off .in extension
+      set(hook_filename "${CMAKE_MATCH_1}")
+    else()
+      set(is_template FALSE)
     endif()

-    # extract the extension
-    string(FIND "${hook_filename}" "." index REVERSE)
-    if(index EQUAL -1)
+    if(hook_filename MATCHES "^.*\\.([^\\.]+)$")
+      # extract the extension
+      set(hook_extension "${CMAKE_MATCH_1}")
+    else()
       message(FATAL_ERROR "ament_environment_hooks() called with the hook "
         "'${hook}' which doesn't have a file extension")
     endif()
-    math(EXPR index "${index} + 1")
-    string(SUBSTRING "${hook_filename}" ${index} -1 hook_extension)

     if(is_template)
       # expand template


ARROW-14246: [C++] Fix wrong find_package() usage in build_google_cloud_cpp_storage()

Error message:

    CMake Error at /usr/share/cmake-3.18/Modules/FindCURL.cmake:163 (message):
      CURL: Required feature 7.47.0 is not found
    Call Stack (most recent call first):
      cmake_modules/ThirdpartyToolchain.cmake:3585 (find_package)
      cmake_modules/ThirdpartyToolchain.cmake:156 (build_google_cloud_cpp_storage)
      cmake_modules/ThirdpartyToolchain.cmake:232 (build_dependency)
      cmake_modules/ThirdpartyToolchain.cmake:3697 (resolve_dependency)
      CMakeLists.txt:535 (include)

find_package() signature:

https://cmake.org/cmake/help/latest/command/find_package.html

    find_package(<PackageName> [version] [EXACT] [QUIET] [MODULE]
                 [REQUIRED] [[COMPONENTS] [components...]]
                 [OPTIONAL_COMPONENTS components...]
                 [NO_POLICY_SCOPE])

Closes #11348 from kou/cpp-fix-find-curl-usage

Authored-by: Sutou Kouhei <73218711cdd5d5c30ac66da3cc4d9d9204caf34b@clear-code.com>
Signed-off-by: Sutou Kouhei <73218711cdd5d5c30ac66da3cc4d9d9204caf34b@clear-code.com>

--- cpp/cmake_modules/ThirdpartyToolchain.cmake
+++ cpp/cmake_modules/ThirdpartyToolchain.cmake
@@ -3591,7 +3591,7 @@

   # Curl is required on all platforms, but building it internally might also trip over S3's copy.
   # For now, force its inclusion from the underlying system or fail.
-  find_package(CURL REQUIRED 7.47.0)
+  find_package(CURL 7.47.0 REQUIRED)

   # Build google-cloud-cpp, with only storage_client


Epic bugfix #2

Epic bugfix #2

git-svn-id: fbbf69ba8011aca0e74e1c67904b11cccbdbe66b@28792 0785d39b-7218-0410-832d-ea1e28bc413d

--- deal.II/cmake/macros/macro_strip_flag.cmake
+++ deal.II/cmake/macros/macro_strip_flag.cmake
@@ -20,8 +20,8 @@
 #

 MACRO(STRIP_FLAG _variable _flag)
-  SET(${_variable} " ${${_variable}} ")
-  STRING(REPLACE " ${_flag} " "" "${_variable}" ${${_variable}})
+  SET(${_variable} "${${_variable}} ")
+  STRING(REPLACE "${_flag} " "" "${_variable}" ${${_variable}})
   STRING(STRIP "${${_variable}}" ${_variable})
 ENDMACRO()


adding the toplevel universal include dir to see which number systems you include

--- tools/cmake/UNIVERSALCommon.cmake
+++ tools/cmake/UNIVERSALCommon.cmake
@@ -1,10 +1,10 @@
 ############################
 #This configuration file defines some cmake variables:
-#UNIVERSAL_INCLUDE_DIRS: list of include directories for the universal library
-#UNIVERSAL_LIBRARIES: libraries needed for interfaces like umfpack and arprec, see below
-#UNIVERSAL_CXX_DEFINITIONS: definitions to enable the requested interfaces
-#UNIVERSAL_VERSION: version (current: 1)
-#UNIVERSAL_MINOR_VERSION: minor version
+# UNIVERSAL_INCLUDE_DIRS: list of include directories for the universal library
+# UNIVERSAL_LIBRARIES: libraries needed for interfaces like umfpack and arprec, see below
+# UNIVERSAL_CXX_DEFINITIONS: definitions to enable the requested interfaces
+# UNIVERSAL_VERSION: version (current: 1)
+# UNIVERSAL_MINOR_VERSION: minor version
 #
 #supported components:
 #
@@ -22,9 +22,10 @@
 endif()

 if(EXISTS ${UNIVERSAL_DIR}/include/universal/posit/posit.hpp)
-	list(APPEND UNIVERSAL_INCLUDE_DIRS "${UNIVERSAL_DIR}/include/universal/posit")
+  list(APPEND UNIVERSAL_INCLUDE_DIRS "${UNIVERSAL_DIR}/include")
+  list(APPEND UNIVERSAL_INCLUDE_DIRS "${UNIVERSAL_DIR}/include/universal/posit")
 else()
-	list(APPEND UNIVERSAL_INCLUDE_DIRS "${UNIVERSAL_DIR}/../../include")
+  message(STATUS "Couldn't find the posit include directory at ${UNIVERSAL_DIR}/include")
 endif(EXISTS ${UNIVERSAL_DIR}/include/universal/posit/posit.hpp)

 macro(unum_check_cxx_compiler_flag FLAG RESULT)


Enhance FindUrho3D module to auto-reconfigure when URHO3D_HOME changes.

--- CMake/Modules/FindUrho3D.cmake
+++ CMake/Modules/FindUrho3D.cmake
@@ -43,11 +43,22 @@
 # For example: set URHO3D_HOME=/home/john/usr/local, if the SDK is installed using DESTDIR=/home/john and CMAKE_INSTALL_PREFIX=/usr/local
 #

-# If the URHO3D_LIB_TYPE build option changes then invalidate the found library cache
-if (NOT URHO3D_LIB_TYPE STREQUAL URHO3D_FOUND_LIB_TYPE)
+# Library location would be searched (based on URHO3D_HOME variable if provided and in system-wide default location)
+if (NOT URHO3D_HOME AND DEFINED ENV{URHO3D_HOME})
+    file (TO_CMAKE_PATH "$ENV{URHO3D_HOME}" URHO3D_HOME)
+endif ()
+
+# If either of the URHO3D_LIB_TYPE or URHO3D_HOME build options changes then invalidate all the caches
+set (PATH_SUFFIX Urho3D)
+if (NOT URHO3D_LIB_TYPE STREQUAL URHO3D_FOUND_LIB_TYPE OR (DEFINED URHO3D_BASE_INCLUDE_DIR AND NOT URHO3D_BASE_INCLUDE_DIR MATCHES "^${URHO3D_HOME}/include/${PATH_SUFFIX}"))
+    unset (URHO3D_BASE_INCLUDE_DIR CACHE)
     unset (URHO3D_LIBRARIES CACHE)
+    if (WIN32)
+        unset (URHO3D_LIBRARIES_DBG CACHE)
+        unset (URHO3D_DLL_REL CACHE)
+        unset (URHO3D_DLL_DBG CACHE)
+    endif ()
     set (URHO3D_FOUND_LIB_TYPE ${URHO3D_LIB_TYPE} CACHE INTERNAL "Lib type when Urho3D library was last found")
-
     # Urho3D prefers static library type by default while CMake prefers shared one, so we need to change CMake preference to agree with Urho3D
     if (NOT URHO3D_LIB_TYPE STREQUAL SHARED)
         list (REVERSE CMAKE_FIND_LIBRARY_SUFFIXES)
@@ -58,9 +69,8 @@
     endif ()
 endif ()

-set (PATH_SUFFIX Urho3D)
 if (CMAKE_PROJECT_NAME STREQUAL Urho3D AND TARGET Urho3D)
-    # Library location is already known to be in the build tree
+    # A special case where library location is already known to be in the build tree
     set (URHO3D_HOME ${CMAKE_BINARY_DIR})
     set (URHO3D_INCLUDE_DIRS ${URHO3D_HOME}/include ${URHO3D_HOME}/include/${PATH_SUFFIX}/ThirdParty)
     if (URHO3D_PHYSICS)
@@ -75,10 +85,6 @@
     set (URHO3D_LIBRARIES Urho3D)
     set (FOUND_MESSAGE "Found Urho3D: as CMake target")
 else ()
-    # Library location would be searched (based on URHO3D_HOME variable if provided and in system-wide default location)
-    if (NOT URHO3D_HOME AND DEFINED ENV{URHO3D_HOME})
-        file (TO_CMAKE_PATH "$ENV{URHO3D_HOME}" URHO3D_HOME)
-    endif ()
     # URHO3D_HOME variable should be an absolute path, so use a non-rooted search even when we are cross-compiling
     if (URHO3D_HOME)
         list (APPEND CMAKE_PREFIX_PATH ${URHO3D_HOME})
@@ -165,4 +171,4 @@
         "Use URHO3D_HOME environment variable or build option to specify the location of the build tree or SDK installation. ${NOT_FOUND_MESSAGE}")
 endif ()

-mark_as_advanced (URHO3D_BASE_INCLUDE_DIR URHO3D_LIBRARIES URHO3D_LIBRARIES_REL URHO3D_LIBRARIES_DBG URHO3D_DLL URHO3D_DLL_REL URHO3D_DLL_DBG URHO3D_HOME)
+mark_as_advanced (URHO3D_BASE_INCLUDE_DIR URHO3D_LIBRARIES URHO3D_LIBRARIES_DBG URHO3D_DLL_REL URHO3D_DLL_DBG URHO3D_HOME)


remove unnecessary include

remove unnecessary include

--- CMake/hoomd/FindCUDALibs.cmake
+++ CMake/hoomd/FindCUDALibs.cmake
@@ -42,12 +42,11 @@
         PATH_SUFFIXES lib
         NO_DEFAULT_PATH)
     mark_as_advanced(HIP_hiprtc_LIBRARY)
-
+
     if(HIP_hip_hcc_LIBRARY AND NOT TARGET HIP::hiprt)
       add_library(HIP::hiprt UNKNOWN IMPORTED)
       set_target_properties(HIP::hiprt PROPERTIES
         IMPORTED_LOCATION "${HIP_hip_hcc_LIBRARY}"
-        INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_HIP_TOOLKIT_INCLUDE_DIRECTORIES}"
         INTERFACE_LINK_LIBRARIES ${HIP_hiprtc_LIBRARY}
       )
     endif()


Use dynamic project source dir [set (INTERNAL_MODULE_DIR ${PROJECT_SOURCE_DIR})] instead of hard-coded dir [set (INTERNAL_MODULE_DIR "..")]. This way the cmake finds libs nicely from e.g. trunk/EntityComponents/EC_XXX, and EC_XXX finds the other include directories correctly.

git-svn-id: 65dd0ccd495961f396d5302e5521154b071f0302@2668 5b2332b8-efa3-11de-8684-7d64432d61a3

--- CMakeModules/ModuleSetup.cmake
+++ CMakeModules/ModuleSetup.cmake
@@ -102,9 +102,9 @@
 # include local module headers
 macro (use_modules)
     message (STATUS "-- using modules:")
-    set (INTERNAL_MODULE_DIR "..")
+    set (INTERNAL_MODULE_DIR ${PROJECT_SOURCE_DIR})
     foreach (module_ ${ARGN})
-		message (STATUS "       " ${module_})
+        message (STATUS "       " ${module_})
         include_directories (${INTERNAL_MODULE_DIR}/${module_})
         link_directories (${INTERNAL_MODULE_DIR}/${module_})
     endforeach ()


Latest MSVC libraries requires linking against zlib

--- src/cmake/precompiled_libs.cmake
+++ src/cmake/precompiled_libs.cmake
@@ -46,6 +46,14 @@
 	# Glew
 	_set_default(GLEW_ROOT_DIR "${_lib_DIR}/glew")
 elseif(MSVC)
+	set(ZLIB_INCLUDE_DIRS ${_lib_DIR}/zlib/include)
+	set(ZLIB_LIBRARIES ${_lib_DIR}/zlib/lib/libz_st.lib)
+	set(ZLIB_INCLUDE_DIR ${_lib_DIR}/zlib/include)
+	set(ZLIB_LIBRARY ${_lib_DIR}/zlib/lib/libz_st.lib)
+	set(ZLIB_DIR ${_lib_DIR}/zlib)
+	find_package(ZLIB REQUIRED)
+	list(APPEND PLATFORM_LINKLIBS ${ZLIB_LIBRARIES})
+
 	# TODO(sergey): On Windows llvm-config doesn't give proper results for the
 	# library names, use hardcoded libraries for now.
 	file(GLOB LLVM_LIBRARIES ${LLVM_ROOT_DIR}/lib/*.lib)


Revert "Remove USE_D3D9_SUBSURFACE_BLIT as it is buggy."

This reverts commit c3dc30dd3c85d5d776ecaeebc7b3ba540f93ff31.

--- CMakeModules/ConfigurePackages.cmake
+++ CMakeModules/ConfigurePackages.cmake
@@ -156,7 +156,7 @@
         sagase_configure_report (OGRE)
     else()
         # DX blitting define for naali
-#        add_definitions(-DUSE_D3D9_SUBSURFACE_BLIT)
+        add_definitions(-DUSE_D3D9_SUBSURFACE_BLIT)
         include_directories($ENV{OGRE_HOME})
         # Ogre built from sources
         include_directories($ENV{OGRE_HOME}/include)


Search openexr includes also in subfolder

--- DevIL/src-IL/cmake/FindOpenEXR.cmake
+++ DevIL/src-IL/cmake/FindOpenEXR.cmake
@@ -11,6 +11,7 @@

 FIND_PATH(OPENEXR_INCLUDE_DIR ImfIO.h
+    $ENV{OPENEXR_DIR}/include/OpenEXR
     $ENV{OPENEXR_DIR}/include
     $ENV{OPENEXR_DIR}
     ~/Library/Frameworks


remove unused file check-svn.cmake

remove unused file check-svn.cmake

--- standalone/superbuild/cmake/check-svn.cmake
+++ standalone/superbuild/cmake/check-svn.cmake
@@ -1,32 +0,0 @@
-# This script executes an "svn info" command in order to test
-# read access on a csail svn server.  The purpose is to make
-# sure that svn authentication is working, since svn authentication
-# is required to checkout many of the svn externals.
-#
-# Users who fail the authentication test should run svn manually,
-# enter their password at the prompt, and allow svn to store the
-# credentials.  For shared machines without stored credentials,
-# you can set the DRC_SVN_PASSWORD cmake variable in order to use
-# the drc read-only user for svn authentication.
-
-if(NOT DEFINED DRC_SVN_PASSWORD)
-  set(DRC_SVN_PASSWORD "" CACHE STRING "Optional password for svn checkout as drc user.")
-endif()
-
-set(svn_credentials)
-if(DRC_SVN_PASSWORD)
-  set(svn_credentials --username drc --password ${DRC_SVN_PASSWORD})
-endif()
-
-
-set(svn_test_command svn info --non-interactive ${svn_credentials} https://svn.csail.mit.edu/drc)
-
-execute_process(COMMAND ${svn_test_command}
-                RESULT_VARIABLE svn_failed
-                OUTPUT_QUIET
-                ERROR_VARIABLE svn_error_output)
-
-if(svn_failed)
-  string (REPLACE ";" " " svn_test_command "${svn_test_command}")
-  message(FATAL_ERROR "\nRunning \"${svn_test_command}\" failed with:\n${svn_error_output}\nIf this is an authentication issue, you have two options:  1) run the svn command manually and remove the --non-interactive flag, type your password, and allow svn to store these credentials for future use, or 2) set the DRC_SVN_PASSWORD cmake variable in order to use the drc read-only user for svn authentication.\n")
-endif()


Minor touch-ups in externalpackages.cmake

--- src/cmake/externalpackages.cmake
+++ src/cmake/externalpackages.cmake
@@ -66,7 +66,9 @@
 ###########################################################################
 # IlmBase setup

-find_package (IlmBase REQUIRED)
+if (NOT ILMBASE_INCLUDE_DIR)
+    find_package (IlmBase REQUIRED)
+endif ()

 include_directories ("${ILMBASE_INCLUDE_DIR}")
 include_directories ("${ILMBASE_INCLUDE_DIR}/OpenEXR")
@@ -82,7 +84,9 @@
 ###########################################################################
 # OpenEXR setup

-find_package (OpenEXR REQUIRED)
+if (NOT OPENEXR_INCLUDE_DIR)
+    find_package (OpenEXR REQUIRED)
+endif ()

 if (EXISTS "${OPENEXR_INCLUDE_DIR}/OpenEXR/ImfMultiPartInputFile.h")
     add_definitions (-DUSE_OPENEXR_VERSION2=1)
@@ -101,6 +105,11 @@
 include_directories ("${OPENEXR_INCLUDE_DIR}")
 # OpenEXR 1.x had weird #include dirctives, this is also necessary:
 include_directories ("${OPENEXR_INCLUDE_DIR}/OpenEXR")
+
+if (NOT OpenEXR_FIND_QUIETLY)
+    message (STATUS "OPENEXR_INCLUDE_DIR = ${OPENEXR_INCLUDE_DIR}")
+    message (STATUS "OPENEXR_LIBRARIES = ${OPENEXR_LIBRARIES}")
+endif ()

 macro (LINK_OPENEXR target)
     target_link_libraries (${target} ${OPENEXR_LIBRARIES})
@@ -418,16 +427,16 @@
     else ()
     	find_package (LibRaw)
     endif ()
-	if (LibRaw_r_LIBRARIES AND LibRaw_INCLUDE_DIR)
-		set (LIBRAW_FOUND TRUE)
-		include_directories (${LibRaw_INCLUDE_DIR})
+    if (LibRaw_r_LIBRARIES AND LibRaw_INCLUDE_DIR)
+        set (LIBRAW_FOUND TRUE)
+        include_directories (${LibRaw_INCLUDE_DIR})
         if (NOT LibRaw_FIND_QUIETLY)
             message (STATUS "Found LibRaw, include ${LibRaw_INCLUDE_DIR}")
         endif ()
-	else ()
-		set (LIBRAW_FOUND FALSE)
+    else ()
+        set (LIBRAW_FOUND FALSE)
         message (STATUS "LibRaw not found!")
-	endif()
+    endif()
 else ()
     message (STATUS "Not using LibRaw")
 endif()


i#58 MacOS: fix detection of cores on Mac OSX 10.9 where the output from
"system_profiler" is too large for CMake

SVN-Revision: 2556

--- suite/runsuite_common_pre.cmake
+++ suite/runsuite_common_pre.cmake
@@ -1,5 +1,5 @@
 # **********************************************************
-# Copyright (c) 2011-2013 Google, Inc.    All rights reserved.
+# Copyright (c) 2011-2014 Google, Inc.    All rights reserved.
 # Copyright (c) 2009-2010 VMware, Inc.    All rights reserved.
 # **********************************************************

@@ -241,8 +241,8 @@
   if(APPLE)
     find_program(cmd_sys_pro "system_profiler")
     if(cmd_sys_pro)
-      execute_process(COMMAND ${cmd_sys_pro} OUTPUT_VARIABLE info)
-      string(REGEX REPLACE "^.*Total Number Of Cores: ([0-9]+).*$" "\\1"
+      execute_process(COMMAND ${cmd_sys_pro} SPHardwareDataType OUTPUT_VARIABLE info)
+      string(REGEX REPLACE "^.*Total Number [Oo]f Cores: ([0-9]+).*$" "\\1"
         PROCESSOR_COUNT "${info}")
     endif()
   endif()


Crazyeddie dynamic preprocessor fix

Crazyeddie dynamic preprocessor fix

--- cmake/FindGLFW.cmake
+++ cmake/FindGLFW.cmake
@@ -11,8 +11,8 @@
 if (WIN32)
     find_library(GLFW_LIB_STATIC NAMES glfw PATH_SUFFIXES static)
     find_library(GLFW_LIB_STATIC_DBG NAMES glfw_d PATH_SUFFIXES static)
-    set( GLFW_DEFINITIONS_STATIC "GLFW_STATIC" CACHE STRING "preprocessor definitions" )
-    mark_as_advanced(GLFW_DEFINITIONS_STATIC GLFW_LIB_STATIC GLFW_LIB_STATIC_DBG)
+    set( GLFW_DEFINITIONS_DYNAMIC "GLFW_DLL" CACHE STRING "preprocessor definitions" )
+    mark_as_advanced(GLFW_DEFINITIONS_DYNAMIC GLFW_LIB_STATIC GLFW_LIB_STATIC_DBG)
 endif()

 find_package_handle_standard_args(GLFW DEFAULT_MSG GLFW_LIB GLFW_H_PATH)


Revert "Fix CMAKE_MODULE_INSTALL_PATH for Windows", doesn't work.

This reverts commit 118cab2b040f3728ced55acf43869b07fc5ff2b4.

--- Common.cmake
+++ Common.cmake
@@ -43,13 +43,8 @@
 file(MAKE_DIRECTORY ${OUTPUT_INCLUDE_DIR})
 include_directories(BEFORE ${CMAKE_SOURCE_DIR} ${OUTPUT_INCLUDE_DIR})

-if(MSVC)
-  set(CMAKE_MODULE_INSTALL_PATH
-    "../CMake ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}/share/cmake-${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}/Modules")
-else()
-  string(REGEX REPLACE ".*\\/(share\\/.*)" "\\1/Modules"
-    CMAKE_MODULE_INSTALL_PATH ${CMAKE_ROOT})
-endif()
+string(REGEX REPLACE ".*\\/(share\\/.*)" "\\1/Modules" CMAKE_MODULE_INSTALL_PATH
+  ${CMAKE_ROOT})

 # Boost settings
 if(MSVC)


fix typos

fix typos

--- reg_tests/CTestList.cmake
+++ reg_tests/CTestList.cmake
@@ -49,7 +49,7 @@
        ${CMAKE_Fortran_COMPILER_ID}     # [Intel,GNU]
        ${PLOT_FLAG}                     # empty or "-p"
   )
-  # limit each test to 45 minutes: 2700s
+  # limit each test to 90 minutes: 5400s
   set_tests_properties(${testname} PROPERTIES TIMEOUT 5400 WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}" LABELS "${LABELS}")
 endfunction(of_regression)

@@ -85,32 +85,32 @@
 #===============================================================================

 # OpenFAST regression tests
-of_Regression("AWT_YFix_WSt"                    "openfast;elastodyn;aerodyn14;servodyn")
-of_Regression("AWT_WSt_StartUp_HighSpShutDown"  "openfast;elastodyn;aerodyn15;servodyn")
-of_Regression("AWT_YFree_WSt"                   "openfast;elastodyn;aerodyn15;servodyn")
-of_Regression("AWT_YFree_WTurb"                 "openfast;elastodyn;aerodyn14;servodyn")
-of_Regression("AWT_WSt_StartUpShutDown"         "openfast;elastodyn;aerodyn15;servodyn")
-of_Regression("AOC_WSt"                         "openfast;elastodyn;aerodyn14;servodyn")
-of_Regression("AOC_YFree_WTurb"                 "openfast;elastodyn;aerodyn15;servodyn")
-of_Regression("AOC_YFix_WSt"                    "openfast;elastodyn;aerodyn15;servodyn")
-of_Regression("UAE_Dnwind_YRamp_WSt"            "openfast;elastodyn;aerodyn14;servodyn")
-of_Regression("UAE_Upwind_Rigid_WRamp_PwrCurve" "openfast;elastodyn;aerodyn15;servodyn")
-of_Regression("WP_VSP_WTurb_PitchFail"          "openfast;elastodyn;aerodyn14;servodyn")
-of_Regression("WP_VSP_ECD"                      "openfast;elastodyn;aerodyn15;servodyn")
-of_Regression("WP_VSP_WTurb"                    "openfast;elastodyn;aerodyn15;servodyn")
-of_Regression("WP_Stationary_Linear"            "openfast;elastodyn;aerodyn15")
-of_Regression("SWRT_YFree_VS_EDG01"             "openfast;elastodyn;aerodyn15;servodyn")
-of_Regression("SWRT_YFree_VS_EDC01"             "openfast;elastodyn;aerodyn15;servodyn")
-of_Regression("SWRT_YFree_VS_WTurb"             "openfast;elastodyn;aerodyn14;servodyn")
-of_Regression("5MW_Land_DLL_WTurb"              "openfast;elastodyn;aerodyn15;servodyn")
-of_Regression("5MW_OC3Mnpl_DLL_WTurb_WavesIrr"  "openfast;elastodyn;aerodyn15;servodyn;hydrodyn;subdyn")
-of_Regression("5MW_OC3Trpd_DLL_WSt_WavesReg"    "openfast;elastodyn;aerodyn15;servodyn;hydrodyn;subdyn")
-of_Regression("5MW_OC4Jckt_DLL_WTurb_WavesIrr_MGrowth" "openfast;elastodyn;aerodyn15;servodyn;hydrodyn;subdyn")
-of_Regression("5MW_ITIBarge_DLL_WTurb_WavesIrr"        "openfast;elastodyn;aerodyn14;servodyn;hydrodyn;map")
-of_Regression("5MW_TLP_DLL_WTurb_WavesIrr_WavesMulti"  "openfast;elastodyn;aerodyn15;servodyn;hydrodyn;map")
-of_Regression("5MW_OC3Spar_DLL_WTurb_WavesIrr"         "openfast;elastodyn;aerodyn15;servodyn;hydrodyn;map")
-of_Regression("5MW_OC4Semi_WSt_WavesWN"                "openfast;elastodyn;aerodyn15;servodyn;hydrodyn;moordyn")
-of_Regression("5MW_Land_BD_DLL_WTurb"                  "openfast;beamdyn;aerodyn15;servodyn")
+of_regression("AWT_YFix_WSt"                    "openfast;elastodyn;aerodyn14;servodyn")
+of_regression("AWT_WSt_StartUp_HighSpShutDown"  "openfast;elastodyn;aerodyn15;servodyn")
+of_regression("AWT_YFree_WSt"                   "openfast;elastodyn;aerodyn15;servodyn")
+of_regression("AWT_YFree_WTurb"                 "openfast;elastodyn;aerodyn14;servodyn")
+of_regression("AWT_WSt_StartUpShutDown"         "openfast;elastodyn;aerodyn15;servodyn")
+of_regression("AOC_WSt"                         "openfast;elastodyn;aerodyn14;servodyn")
+of_regression("AOC_YFree_WTurb"                 "openfast;elastodyn;aerodyn15;servodyn")
+of_regression("AOC_YFix_WSt"                    "openfast;elastodyn;aerodyn15;servodyn")
+of_regression("UAE_Dnwind_YRamp_WSt"            "openfast;elastodyn;aerodyn14;servodyn")
+of_regression("UAE_Upwind_Rigid_WRamp_PwrCurve" "openfast;elastodyn;aerodyn15;servodyn")
+of_regression("WP_VSP_WTurb_PitchFail"          "openfast;elastodyn;aerodyn14;servodyn")
+of_regression("WP_VSP_ECD"                      "openfast;elastodyn;aerodyn15;servodyn")
+of_regression("WP_VSP_WTurb"                    "openfast;elastodyn;aerodyn15;servodyn")
+of_regression("WP_Stationary_Linear"            "openfast;elastodyn;aerodyn15")
+of_regression("SWRT_YFree_VS_EDG01"             "openfast;elastodyn;aerodyn15;servodyn")
+of_regression("SWRT_YFree_VS_EDC01"             "openfast;elastodyn;aerodyn15;servodyn")
+of_regression("SWRT_YFree_VS_WTurb"             "openfast;elastodyn;aerodyn14;servodyn")
+of_regression("5MW_Land_DLL_WTurb"              "openfast;elastodyn;aerodyn15;servodyn")
+of_regression("5MW_OC3Mnpl_DLL_WTurb_WavesIrr"  "openfast;elastodyn;aerodyn15;servodyn;hydrodyn;subdyn")
+of_regression("5MW_OC3Trpd_DLL_WSt_WavesReg"    "openfast;elastodyn;aerodyn15;servodyn;hydrodyn;subdyn")
+of_regression("5MW_OC4Jckt_DLL_WTurb_WavesIrr_MGrowth" "openfast;elastodyn;aerodyn15;servodyn;hydrodyn;subdyn")
+of_regression("5MW_ITIBarge_DLL_WTurb_WavesIrr"        "openfast;elastodyn;aerodyn14;servodyn;hydrodyn;map")
+of_regression("5MW_TLP_DLL_WTurb_WavesIrr_WavesMulti"  "openfast;elastodyn;aerodyn15;servodyn;hydrodyn;map")
+of_regression("5MW_OC3Spar_DLL_WTurb_WavesIrr"         "openfast;elastodyn;aerodyn15;servodyn;hydrodyn;map")
+of_regression("5MW_OC4Semi_WSt_WavesWN"                "openfast;elastodyn;aerodyn15;servodyn;hydrodyn;moordyn")
+of_regression("5MW_Land_BD_DLL_WTurb"                  "openfast;beamdyn;aerodyn15;servodyn")

 # BeamDyn regression tests
 bd_regression(isotropic_rollup)


use lcm/lcm.h as header name for LCM module search

--- software/ddapp/cmake/modules/FindLCM.cmake
+++ software/ddapp/cmake/modules/FindLCM.cmake
@@ -32,4 +32,4 @@
 endmacro()

-pkg_config_find_module(LCM lcm lcm.h lcm lcm)
+pkg_config_find_module(LCM lcm lcm/lcm.h lcm lcm)


Extract path to JNI library from the add_library target.

--- ament_cmake_export_jni_libraries/cmake/ament_export_jni_libraries.cmake
+++ ament_cmake_export_jni_libraries/cmake/ament_export_jni_libraries.cmake
@@ -40,7 +40,8 @@
           list(APPEND _AMENT_CMAKE_EXPORT_JNI_LIBRARIES "${_arg}")
         endif()
       elseif(TARGET "${_arg}")
-        list(APPEND _AMENT_CMAKE_EXPORT_JNI_LIBRARIES "${_arg}")
+        get_target_property(_library_path "${_arg}" OUTPUT_NAME)
+        list(APPEND _AMENT_CMAKE_EXPORT_JNI_LIBRARIES "${_library_path}")
       else()
         set(_arg "\${${PROJECT_NAME}_DIR}/../../../${_arg}")
         list(APPEND _AMENT_CMAKE_EXPORT_JNI_LIBRARIES "${_arg}")


ctest: submit build results before testing

Signed-off-by: Matthias Kretz <372ea4eca737a13cd010ee806d4ce7b98ee71550@kde.org>

--- test.cmake
+++ test.cmake
@@ -341,12 +341,13 @@
                BUILD "${CTEST_BINARY_DIRECTORY}"
                APPEND
                RETURN_VALUE res)
+            ctest_submit(PARTS Build)
             ctest_test(
                BUILD "${CTEST_BINARY_DIRECTORY}"
                APPEND
                RETURN_VALUE test_results
                PARALLEL_LEVEL ${number_of_processors})
-            ctest_submit(PARTS Build Test)
+            ctest_submit(PARTS Test)
          else()
             foreach(label other Scalar SSE AVX AVX2 MIC)
                set_property(GLOBAL PROPERTY Label ${label})


fix cmake code

fix cmake code

--- test.cmake
+++ test.cmake
@@ -48,7 +48,7 @@
       set(COMPILER_VERSION "${COMPILER_VERSION} x86 32bit")
    endif()
    set(number_of_processors "$ENV{NUMBER_OF_PROCESSORS}")
-   if(not number_of_processors)
+   if(NOT number_of_processors)
       execute_process(COMMAND
 	 reg query "HKLM\\HARDWARE\\DESCRIPTION\\System\\CentralProcessor"
 	 OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE number_of_processors)


CTest: No "install/fast" with ninja

CTest: No "install/fast" with ninja

Signed-off-by: Matthias Kretz <372ea4eca737a13cd010ee806d4ce7b98ee71550@kde.org>

--- test.cmake
+++ test.cmake
@@ -488,7 +488,7 @@
                      endif()
                   endif()
                endif()
-               if(label STREQUAL "other")
+               if(label STREQUAL "other" AND CTEST_CMAKE_GENERATOR MATCHES "Make")
                   set(CTEST_BUILD_TARGET "install/fast")
                   set(CTEST_BUILD_COMMAND "${CMAKE_MAKE_PROGRAM} ${MAKE_ARGS} ${CTEST_BUILD_TARGET}")
                   ctest_build(


Incorporating changes from Slicer and improve style

Adding changes in Slicer's version of the file which have a include
guard and a sanity check for Swig_DIR.

Additionally renamed version variable to be prefixed with SWIG.

Added variable with define the SWIG version, and the hash in one place
to aid in all getting updated when a version changes.

Change-Id: I5bc26b2ec425f6e21e9822df08d28342352f6252

--- SuperBuild/External_Swig.cmake
+++ SuperBuild/External_Swig.cmake
@@ -1,19 +1,39 @@
-set( TARGET_SWIG_VERSION 2.0.9 )
+
+
+# Make sure this file is included only once
+get_filename_component(CMAKE_CURRENT_LIST_FILENAME ${CMAKE_CURRENT_LIST_FILE} NAME_WE)
+if(${CMAKE_CURRENT_LIST_FILENAME}_FILE_INCLUDED)
+  return()
+endif()
+set(${CMAKE_CURRENT_LIST_FILENAME}_FILE_INCLUDED 1)
+
+# Sanity checks
+if(DEFINED Swig_DIR AND NOT EXISTS ${Swig_DIR})
+  message(FATAL_ERROR "Swig_DIR variable is defined but corresponds to non-existing directory")
+endif()
+
 if(NOT SWIG_DIR)
+
+  set(SWIG_TARGET_VERSION 2.0.9)
+  set(SWIG_DOWNLOAD_SOURCE_HASH "54d534b14a70badc226129159412ea85")
+  set(SWIG_DOWNLOAD_WIN_HASH "a1dc34766cf599f49e2092f7973c85f4" )
+
+
   if(WIN32)
     # swig.exe available as pre-built binary on Windows:
     ExternalProject_Add(Swig
-      URL http://prdownloads.sourceforge.net/swig/swigwin-${TARGET_SWIG_VERSION}.zip
-      URL_MD5 a1dc34766cf599f49e2092f7973c85f4
-      SOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR}/swigwin-${TARGET_SWIG_VERSION}
+      URL http://prdownloads.sourceforge.net/swig/swigwin-${SWIG_TARGET_VERSION}.zip
+      URL_MD5 ${SWIG_DOWNLOAD_WIN_HASH}
+      SOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR}/swigwin-${SWIG_TARGET_VERSION}
       CONFIGURE_COMMAND ""
       BUILD_COMMAND ""
       INSTALL_COMMAND ""
       )

-    set(SWIG_DIR ${CMAKE_CURRENT_BINARY_DIR}/swigwin-${TARGET_SWIG_VERSION}) # ??
-    set(SWIG_EXECUTABLE ${CMAKE_CURRENT_BINARY_DIR}/swigwin-${TARGET_SWIG_VERSION}/swig.exe)
+    set(SWIG_DIR ${CMAKE_CURRENT_BINARY_DIR}/swigwin-${SWIG_TARGET_VERSION}) # ??
+    set(SWIG_EXECUTABLE ${CMAKE_CURRENT_BINARY_DIR}/swigwin-${SWIG_TARGET_VERSION}/swig.exe)
   else()
+
     #
     #  PCRE (Perl Compatible Regular Expressions)
     #
@@ -57,13 +77,13 @@
     set ( swig_CONFIGURE_COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/swig_configure_step.cmake )

     ExternalProject_add(Swig
-      URL http://prdownloads.sourceforge.net/swig/swig-${TARGET_SWIG_VERSION}.tar.gz
-      URL_MD5 54d534b14a70badc226129159412ea85
+      URL http://prdownloads.sourceforge.net/swig/swig-${SWIG_TARGET_VERSION}.tar.gz
+      URL_MD5 ${SWIG_DOWNLOAD_SOURCE_HASH}
       CONFIGURE_COMMAND ${swig_CONFIGURE_COMMAND}
       DEPENDS PCRE
       )

-    set(SWIG_DIR ${swig_install_dir}/share/swig/${TARGET_SWIG_VERSION})
+    set(SWIG_DIR ${swig_install_dir}/share/swig/${SWIG_TARGET_VERSION})
     set(SWIG_EXECUTABLE ${swig_install_dir}/bin/swig)

     ExternalProject_Add_Step(Swig cpvec


CI: disable UCX with TSan builds for now

--- Testing/script/gh_script.cmake
+++ Testing/script/gh_script.cmake
@@ -63,6 +63,7 @@
 endif()
 if(MERCURY_BUILD_CONFIGURATION MATCHES "Tsan")
   set(MERCURY_MEMORYCHECK_TYPE "ThreadSanitizer")
+  set(USE_UCX OFF) # Disable for now to prevent errors
 endif()
 if(MERCURY_BUILD_CONFIGURATION MATCHES "Ubsan")
   set(MERCURY_MEMORYCHECK_TYPE "UndefinedBehaviorSanitizer")
@@ -210,7 +211,9 @@
   set(USE_MPI ON)
   set(USE_OFI ON)
   set(USE_SM ON)
-  set(USE_UCX ON)
+  if(NOT DEFINED USE_UCX)
+    set(USE_UCX ON)
+  endif()
   set(CMAKE_FIND_ROOT_PATH $ENV{DEPS_PREFIX} ${CMAKE_FIND_ROOT_PATH})
 endif()


BUG: Error in configure command for GLEW

--- SuperBuild/CMake/External_glew.cmake
+++ SuperBuild/CMake/External_glew.cmake
@@ -10,7 +10,7 @@
   BINARY_DIR ${GLEW_SB_BUILD_DIR}
   DOWNLOAD_DIR ${DOWNLOAD_LOCATION}
   INSTALL_DIR ${SB_INSTALL_PREFIX}
-  CONFIGURE_COMMAND ${SB_CMAKE_COMMAND} ${GLEW_SB_SRC}/build/cmake/ ${SB_CMAKE_CACHE_ARGS} -DBUILD_UTILS:BOOL=OFF
+  CONFIGURE_COMMAND ${SB_CMAKE_COMMAND} ${SB_CMAKE_CACHE_ARGS} -DBUILD_UTILS:BOOL=OFF ${GLEW_SB_SRC}/build/cmake/
   )

 set(_SB_GLEW_INCLUDE_DIR ${SB_INSTALL_PREFIX}/include)


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

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

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

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

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

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

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

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

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

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

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

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

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

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

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

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

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


Changed method of cleaning up output files to work with Windows.

--- Tests/VisualTests/PostTest.cmake
+++ Tests/VisualTests/PostTest.cmake
@@ -7,10 +7,17 @@
 #-------------------------------------------------------------------

 if (UNIX)
-  set(USER_HOME_DIRECTORY $ENV{HOME})
+  # escape spaces
+  string(REPLACE " " "\ " USER_HOME_DIRECTORY "$ENV{HOMEDRIVE}$ENV{HOMEPATH}")
 elseif (WIN32)
   string(REPLACE "\\" "/" USER_HOME_DIRECTORY "$ENV{HOMEDRIVE}$ENV{HOMEPATH}")
 # other platforms?
 endif ()

-exec_program("cmake -E remove ${USER_HOME_DIRECTORY}/TestResults_*RenderingSubsystem.txt")
+# Use platform-specific utils, since 'cmake -E remove' didn't seem to handle wildcards in Windows
+if (UNIX)
+  exec_program("rm ${USER_HOME_DIRECTORY}/TestResults_*RenderingSubsystem.txt")
+elseif (WIN32)
+  exec_program("cmd /c del \"${USER_HOME_DIRECTORY}\TestResults_*RenderingSubsystem.txt\"")
+# other platforms?
+endif ()


Fix BUILD_FMT_FORCE accidently left in the wrong position during debug

--- src/cmake/externalpackages.cmake
+++ src/cmake/externalpackages.cmake
@@ -316,7 +316,7 @@
 ###########################################################################
 # fmtlib

-option (BUILD_FMT_FORCE "Force local download/build of fmt even if installed" ON)
+option (BUILD_FMT_FORCE "Force local download/build of fmt even if installed" OFF)
 option (BUILD_MISSING_FMT "Local download/build of fmt if not installed" ON)
 set (BUILD_FMT_VERSION "6.1.2" CACHE STRING "Preferred fmtlib/fmt version, when downloading/building our own")


Added genetic.cc to buildlist

Added genetic.cc to buildlist

--- eugenics/build_list.cmake
+++ eugenics/build_list.cmake
@@ -1,6 +1,7 @@
 # rest of .cc's, prepended with 'src/'
 set(SRCS
     src/circuit.cc
+    src/genetic.cc
     src/utility.cc
     src/algorithm.cc
     src/traditional_algorithm.cc


cmake: print status message if Thrust is found

--- thrust/cmake/thrust-config.cmake
+++ thrust/cmake/thrust-config.cmake
@@ -650,3 +650,9 @@
 endforeach()

 thrust_update_system_found_flags()
+
+include(FindPackageHandleStandardArgs)
+if (NOT Thrust_CONFIG)
+  set(Thrust_CONFIG "${CMAKE_CURRENT_LIST_FILE}")
+endif()
+find_package_handle_standard_args(Thrust CONFIG_MODE)


ENH: Change the default dashboard URL to HTTPS.

In they do not have a github account.

--- Utilities/Dashboard/itkexamples_common.cmake
+++ Utilities/Dashboard/itkexamples_common.cmake
@@ -133,7 +133,7 @@

 # Select Git source to use.
 if(NOT DEFINED dashboard_git_url)
-  set(dashboard_git_url "git@github.com:InsightSoftwareConsortium/ITKExamples.git")
+  set(dashboard_git_url "https://github.com/InsightSoftwareConsortium/ITKExamples.git")
 endif()
 if(NOT DEFINED dashboard_git_branch)
   if("${dashboard_model}" STREQUAL "Nightly")


set cmp0026 to OLD until we can migrate to use $<TARGET_FILE:...>

--- ament_cmake_core/cmake/symlink_install/ament_cmake_symlink_install_targets.cmake
+++ ament_cmake_core/cmake/symlink_install/ament_cmake_symlink_install_targets.cmake
@@ -71,6 +71,10 @@
       endif()
       # TODO consider using a generator expression instead
       # $<TARGET_FILE:target>
+      # Until them use the old policy.
+      if(POLICY CMP0026)
+        cmake_policy(SET CMP0026 OLD)
+      endif()
       get_property(location TARGET ${target} PROPERTY LOCATION)
       list(APPEND target_files "${location}")
     endforeach()


Fixed typo in TEST configuration which lead to BALL_CONCEPT_TESTS not being built

--- source/TEST/cmake/BALLTestExecutables.cmake
+++ source/TEST/cmake/BALLTestExecutables.cmake
@@ -70,7 +70,7 @@
 	ContourSurface_test
 )

-SET(BALL_CONCEPTS_TEST
+SET(BALL_CONCEPTS_TESTS
 	LogStream_test
 	AutoDeletable_test
 	Factory_test


CPPFLAGS and MOC_OPTS are not the same.

CPPFLAGS and MOC_OPTS are not the same.

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

--- build-aux/cmake/modules/Gostai.cmake
+++ build-aux/cmake/modules/Gostai.cmake
@@ -446,20 +446,20 @@
   # Prepare the sources #
   # =================== #
   if(${name}_QTPLUGIN)
-    set(${name}_OPTS
+    set(${name}_MOC_OPTS
       -DQT_PLUGIN
       -DQT_SHARED
       )
   else(${name}_QTPLUGIN)
-    set(${name}_OPTS "")
+    set(${name}_MOC_OPTS "")
   endif(${name}_QTPLUGIN)
   if(CMAKE_BUILD_TYPE STREQUAL "Release")
-    list(APPEND ${name}_OPTS -DQT_NO_DEBUG)
+    list(APPEND ${name}_MOC_OPTS -DQT_NO_DEBUG)
   endif(CMAKE_BUILD_TYPE STREQUAL "Release")
   qt4_wrap_ui(${name}_UI_SOURCES ${${name}_UIS})
   qt4_add_resources(${name}_SOURCES ${${name}_RESOURCES})
   qt4_wrap_cpp(${name}_MOC_SOURCES ${${name}_MOCS}
-    OPTIONS ${${name}_OPTS})
+    OPTIONS ${${name}_MOC_OPTS})

   set(${name}_ALL_SOURCES
     ${${name}_SOURCES}
@@ -490,10 +490,10 @@
     set(${name}_CPPFLAGS "")
   endif(NOT ${name}_CPPFLAGS)
   if(${name}_QTPLUGIN)
-    list(APPEND ${name}_QTPLUGIN QT_PLUGIN QT_SHARED)
+    list(APPEND ${name}_CPPFLAGS QT_PLUGIN QT_SHARED)
   endif(${name}_QTPLUGIN)
   if(CMAKE_BUILD_TYPE STREQUAL "Release")
-    list(APPEND ${name}_QTPLUGIN QT_NO_DEBUG)
+    list(APPEND ${name}_CPPFLAGS QT_NO_DEBUG)
   endif(CMAKE_BUILD_TYPE STREQUAL "Release")
   set_target_properties(${name} PROPERTIES
     COMPILE_DEFINITIONS "${${name}_CPPFLAGS}")


Add VERSION argument support for FindSampgdk3

--- cmake/Modules/FindSampgdk3.cmake
+++ cmake/Modules/FindSampgdk3.cmake
@@ -1,6 +1,7 @@
 # Find sampgdk 3.x library and headers
 #
 # Defined variables:
+#
 #   Sampgdk3_FOUND
 #   Sampgdk3_LIBRARY_DIRS
 #   Sampgdk3_LIBRARY (cached)
@@ -9,8 +10,31 @@
 #   Sampgdk3_LIBRARIES
 #   Sampgdk3_INCLUDE_DIR (cached)
 #   Sampgdk3_INCLUDE_DIRS
+#   Sampgdk3_VERSION
+#   Sampgdk3_VERSION_MAJOR
+#   Sampgdk3_VERSION_MINOR
+#   Sampgdk3_VERSION_PATCH
+#   Sampgdk3_VERSION_TWEAK
+#
+# Using this module:
+#
+#   find_package(Sampgdk3 VERSION 3.2.1)
+#   if(Sampgk3_FOUND)
+#     link_directories(${Sampgdk3_LIBRARY_DIRS})
+#     include_directories(${Sampgdk3_INCLUDE_DIRS})
+#     target_link_libraries(your_target ${Sampgdk_LIBRARIES})
+#   else()
+#     ... do something about this ...
+#   endif()
+#
+#   or:
+#
+#   find_package(Sampgdk3 VERSION 3.2.1 REQUIRED)
+#   link_directories(${Sampgdk3_LIBRARY_DIRS})
+#   include_directories(${Sampgdk3_INCLUDE_DIRS})
+#   target_link_libraries(your_target ${Sampgdk_LIBRARIES})

-find_path(Sampgdk3_INCLUDE_DIR NAMES "sampgdk/a_samp.h")
+find_path(Sampgdk3_INCLUDE_DIR NAMES "sampgdk/version.h")

 find_library(Sampgdk3_LIBRARY_DEBUG NAMES "sampgdk3_d" "libsampgdk_d.so.3")
 find_library(Sampgdk3_LIBRARY_RELEASE NAMES "sampgdk3" "libsampgdk.so.3")
@@ -58,7 +82,35 @@
 	Sampgdk3_INCLUDE_DIRS
 )

+function(get_version name text)
+	string(REGEX MATCH "#define[ \t]+SAMPGDK_VERSION_${name}[ \t]+[0-9]+" match "${text}")
+	if(match)
+		string(REGEX REPLACE ".* ([0-9]+)" "\\1" number "${match}")
+		set(Sampgdk3_VERSION_${name} ${number} PARENT_SCOPE)
+	endif()
+endfunction()
+
+if(Sampgdk3_INCLUDE_DIR)
+	file(READ "${Sampgdk3_INCLUDE_DIR}/sampgdk/version.h" text)
+
+	get_version(MAJOR "${text}")
+	get_version(MINOR "${text}")
+	get_version(PATCH "${text}")
+	get_version(TWEAK "${text}")
+
+	if(NOT Sampgdk3_VERSION_TWEAK OR Sampgdk3_VERSION_TWEAK EQUAL 0)
+		if(NOT Sampgdk3_VERSION_PATCH OR Sampgdk3_VERSION_PATCH EQUAL 0)
+			set(Sampgdk3_VERSION "${Sampgdk3_VERSION_MAJOR}.${Sampgdk3_VERSION_MINOR}")
+		else()
+			set(Sampgdk3_VERSION "${Sampgdk3_VERSION_MAJOR}.${Sampgdk3_VERSION_MINOR}.${Sampgdk3_VERSION_PATCH}")
+		endif()
+	else()
+		set(Sampgdk3_VERSION "${Sampgdk3_VERSION_MAJOR}.${Sampgdk3_VERSION_MINOR}.${Sampgdk3_VERSION_PATCH}.${Sampgdk3_VERSION_TWEAK}")
+	endif()
+endif()
+
 include(FindPackageHandleStandardArgs)
 find_package_handle_standard_args(Sampgdk3
 	REQUIRED_VARS Sampgdk3_INCLUDE_DIRS Sampgdk3_LIBRARY_DIRS Sampgdk3_LIBRARIES
-)+	VERSION_VAR Sampgdk3_VERSION
+)


Add Plugin: Reformat CMake code

Add Plugin: Reformat CMake code

--- cmake/Modules/LibAddPlugin.cmake
+++ cmake/Modules/LibAddPlugin.cmake
@@ -124,13 +124,13 @@
 		add_executable (${testexename} ${TEST_SOURCES})
 		add_dependencies (${testexename} kdberrors_generated)

-		if(BUILD_SHARED)
+		if (BUILD_SHARED)
 			if (ARG_LINK_PLUGIN)
 				add_dependencies (${testexename} elektra-${ARG_LINK_PLUGIN})
 			else ()
 				add_dependencies (${testexename} elektra-${testname})
 			endif ()
-		endif()
+		endif ()

 		# ~~~
 		# alternative approach to restore_variable


gmock debug library

gmock debug library

--- cmake-modules/FindGoogleMock.cmake
+++ cmake-modules/FindGoogleMock.cmake
@@ -66,6 +66,26 @@
 	   ${KDE4_LIB_DIR}
 	   $ENV{GMOCK_ROOT}/msvc/Release
 	)
+
+	if( WIN32 AND GOOGLEMOCK_LIBRARY)
+		find_library( GOOGLEMOCK_LIBRARY_DEBUG NAMES gmockd
+			PATHS
+			~/usr/lib
+		   /opt/local/lib
+		   /usr/lib
+		   /usr/lib64
+		   /usr/local/lib
+		   /opt/kde4/lib
+		   ${KDE4_LIB_DIR}
+		   $ENV{GMOCK_ROOT}/msvc/Debug
+		)
+
+		if( GOOGLEMOCK_LIBRARY_DEBUG )
+			set(GOOGLEMOCK_LIBRARY debug ${GOOGLEMOCK_LIBRARY_DEBUG} optimized ${GOOGLEMOCK_LIBRARY})
+		else(GOOGLEMOCK_LIBRARY_DEBUG )
+			set(GOOGLEMOCK_LIBRARY "")
+		endif(GOOGLEMOCK_LIBRARY_DEBUG)
+	endif( WIN32 AND GOOGLEMOCK_LIBRARY)

 	if( GMOCK_CMAKE_DEBUG )
 		message("gmock root:  $ENV{GMOCK_ROOT}")


Bump the fallback version

Bump the fallback version

--- cmake/DetermineTomvizVersion.cmake
+++ cmake/DetermineTomvizVersion.cmake
@@ -7,7 +7,7 @@
 #   tomviz_version
 #   tomviz_version_long

-set(hardcoded_tomviz_version "1.0.0-rc1")
+set(hardcoded_tomviz_version "1.0.0")

 function(_set_version_vars versiontext)
   string(REGEX MATCH "([0-9]+)\\.([0-9]+)\\.([0-9]+)[-]*(.*)" version_matches "${versiontext}")


[CMAKE] Fix FindBerkeleyDB for FreeBSD

[CMAKE] Fix FindBerkeleyDB for FreeBSD

Summary:
The files are located under `/usr/local/<include|lib>/db5/` on FreeBSD 12.
Using `PATH_SUFFIXES` allow to search with the `db5` directory in the
path.

Test Plan:
On FreeBSD (tested on FreeBSD 12):
  cmake -GNinja -DBUILD_BITCOIN_QT=OFF ..
Check that cmake finds the library.

Reviewers: #bitcoin_abc, deadalnix, jasonbcox

Reviewed By: #bitcoin_abc, jasonbcox

Differential Revision: https://reviews.bitcoinabc.org/D4709

--- cmake/modules/FindBerkeleyDB.cmake
+++ cmake/modules/FindBerkeleyDB.cmake
@@ -11,19 +11,23 @@
 find_path(BDB_INCLUDE_DIR
 	NAMES db.h
 	HINTS ${BREW_HINT}
+	PATH_SUFFIXES db5
 )
 find_library(BDB_LIBRARY
 	NAMES db libdb
 	HINTS ${BREW_HINT}
+	PATH_SUFFIXES db5
 )

 find_path(BDBXX_INCLUDE_DIR
 	NAMES db_cxx.h
 	HINTS ${BREW_HINT}
+	PATH_SUFFIXES db5
 )
 find_library(BDBXX_LIBRARY
 	NAMES db_cxx libdb_cxx db5_cxx
 	HINTS ${BREW_HINT}
+	PATH_SUFFIXES db5
 )

 MESSAGE(STATUS "BerkeleyDB libs: " ${BDB_LIBRARY} " " ${BDBXX_LIBRARY})


updated build system

updated build system

--- cmake/modules/FindGoogleTest.cmake
+++ cmake/modules/FindGoogleTest.cmake
@@ -29,25 +29,25 @@

 find_library(
     GOOGLETEST_LIBRARY NAMES gtest
-    HINTS ${BUILD_DEPS_DIR}/${GOOGLETEST_DEPS_DIR}/build/googlemock/gtest/
+    PATHS ${BUILD_DEPS_DIR}/${GOOGLETEST_DEPS_DIR}/build/googlemock/gtest/
     NO_DEFAULT_PATH
 )

 find_library(
     GOOGLETEST_MAIN_LIBRARY NAMES gtest_main
-    HINTS ${BUILD_DEPS_DIR}/${GOOGLETEST_DEPS_DIR}/build/googlemock/gtest/
+    PATHS ${BUILD_DEPS_DIR}/${GOOGLETEST_DEPS_DIR}/build/googlemock/gtest/
     NO_DEFAULT_PATH
 )

 find_library(
     GOOGLEMOCK_LIBRARY NAMES gmock
-    HINTS ${BUILD_DEPS_DIR}/${GOOGLETEST_DEPS_DIR}/build/googlemock/
+    PATHS ${BUILD_DEPS_DIR}/${GOOGLETEST_DEPS_DIR}/build/googlemock/
     NO_DEFAULT_PATH
 )

 find_library(
     GOOGLEMOCK_MAIN_LIBRARY NAMES gmock_main
-    HINTS ${BUILD_DEPS_DIR}/${GOOGLETEST_DEPS_DIR}/build/googlemock/
+    PATHS ${BUILD_DEPS_DIR}/${GOOGLETEST_DEPS_DIR}/build/googlemock/
     NO_DEFAULT_PATH
 )


Fix for PostgreSQL server installation can not be found in MacOSX 10.9 (ROOT-7026)

--- cmake/modules/FindPostgreSQL.cmake
+++ cmake/modules/FindPostgreSQL.cmake
@@ -19,13 +19,33 @@

 find_path(POSTGRESQL_INCLUDE_DIR NAMES libpq-fe.h
    PATHS ${POSTGRESQL_DIR}/include $ENV{POSTGRESQL_DIR}/include
-   /usr/include/pgsql/
-   /usr/local/include/pgsql/
-   /usr/include/postgresql/
+   "/usr/include/pgsql/"
+   "/usr/local/include/pgsql/"
+   "/usr/include/postgresql/"
+   "/usr/local/include/pgsql/server"
+   "/usr/local/include/postgresql/server"
+   "/usr/local/include/postgresql/*/server"
+   "/usr/local/pgsql/postgresql/server"
+   "/usr/local/pgsql/postgresql/*/server"
+   "/usr/local/*/include/"
+   "/usr/local/*/include/postgresql/"
+   "/usr/local/*/include/postgresql/server"
+   "/usr/include/server"
+   "/usr/include/pgsql/server"
+   "/usr/include/postgresql/server"
+   "/usr/include/postgresql/*/server"
 )

 find_library(POSTGRESQL_LIBRARIES NAMES pq
    PATHS ${POSTGRESQL_DIR}/lib $ENV{POSTGRESQL_DIR}/lib
+    "/usr/lib/"
+    "/usr/lib64/"
+    "/usr/local/lib/"
+    "/usr/local/lib64/"
+    "/usr/lib/*/"
+    "/usr/local/*/"
+    "/usr/lib/posgresql/"
+    "/usr/lib64/posgresql/"
 )

 include(FindPackageHandleStandardArgs)


[CMake] Don't explicitly use LLVM_LIBRARY_DIR in standalone builds

Summary:
This line is unnecessary because add_llvm_executable will handle
linking the correct LLVM libraries for you. LLDB standalone builds are totally
fine without this.

In the best case, having this line here is harmless. In the worst case it can
cause link issues.

If you build lldb-server for android using the standalone build, this line
will cause LLVM_LIBRARY_DIR to be the first place you look for libraries.
This is an issue because if you built libc++, it will try to link against
that one instead of the one from the android NDK.  Meanwhile, the LLVM libraries
you're linking against were linked against the libc++ from the NDK.

Ideally, we would take advantage of the AFTER option for link_directories(), but
that was not available in LLDB's minimum supported version of CMake (CMake 3.4.3).

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

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

--- cmake/modules/LLDBStandalone.cmake
+++ cmake/modules/LLDBStandalone.cmake
@@ -24,7 +24,6 @@

   set(LLVM_MAIN_SRC_DIR ${LLVM_BUILD_MAIN_SRC_DIR} CACHE PATH "Path to LLVM source tree")
   set(LLVM_MAIN_INCLUDE_DIR ${LLVM_MAIN_INCLUDE_DIR} CACHE PATH "Path to llvm/include")
-  set(LLVM_LIBRARY_DIR ${LLVM_LIBRARY_DIR} CACHE PATH "Path to llvm/lib")
   set(LLVM_BINARY_DIR ${LLVM_BINARY_DIR} CACHE PATH "Path to LLVM build tree")

   set(lit_file_name "llvm-lit")
@@ -110,8 +109,6 @@
     "${LLDB_PATH_TO_SWIFT_SOURCE}/include"
     "${CMAKE_CURRENT_SOURCE_DIR}/source")

-  link_directories("${LLVM_LIBRARY_DIR}")
-
   set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
   set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX})
   set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX})


cmake: test CMake and issue error if using 3.22.1 / 3.22.2 from PyPI

Fixes: #43099

The CMake 3.22.1 / 3.22.2 PyPI version suffers a bug in the
`cmake_path(... PARENT_PATH)` implementation.

Therefore, when CMake version 3.22.1 / 3.22.2 is detected, test if the
CMake version is suffering from the bug, and in case the bug is present,
fail with an error regarding the issue.

The reason for failing, and not implementing work arounds is that Zephyr
already uses `cmake_path()` at two locations, and we cannot prevent
contributors from adding code which uses this function.

Secondly, Zephyr modules may also use `cmake_path()`, and thus be
affected by said bug.
It is impractical to implement work arounds at all possible locations
for something that is a CMake bug.

Therefore the safest solution is to test CMake itself, to check if the
version in use suffers said bug, and fail with a proper error message
if an affected CMake version is used.

See more here:
https://gitlab.kitware.com/cmake/cmake/-/issues/23187
https://github.com/scikit-build/cmake-python-distributions/issues/221

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

--- cmake/modules/zephyr_default.cmake
+++ cmake/modules/zephyr_default.cmake
@@ -30,6 +30,21 @@
   NO_CMAKE_SYSTEM_PATH
   NO_CMAKE_SYSTEM_PACKAGE_REGISTRY
 )
+
+# Test and error-out if we are affected by the PyPI CMake 3.22.1 / 3.22.2 bug
+if(${CMAKE_VERSION} VERSION_EQUAL 3.22.1 OR ${CMAKE_VERSION} VERSION_EQUAL 3.22.2)
+  # It seems only pip-installed builds are affected so we test to see if we are affected
+  cmake_path(GET ZEPHYR_BASE PARENT_PATH test_cmake_path)
+  if(ZEPHYR_BASE STREQUAL test_cmake_path)
+    message(FATAL_ERROR "The CMake version ${CMAKE_VERSION} installed suffers"
+            " the \n 'cmake_path(... PARENT_PATH)' bug, see: \n"
+	    "https://gitlab.kitware.com/cmake/cmake/-/issues/23187\n"
+	    "https://github.com/scikit-build/cmake-python-distributions/issues/221\n"
+	    "Please install another CMake version or use a build of CMake that"
+	    " does not come from PyPI."
+    )
+  endif()
+endif()

 # Prepare user cache
 list(APPEND zephyr_cmake_modules python)


stage: better deprecated/internal messages (with file location)

--- cmake/qibuild/internal/stage.cmake
+++ cmake/qibuild/internal/stage.cmake
@@ -359,6 +359,18 @@

 endfunction()

+function(_qi_internal_append_deprecated OUT_RESULT target)
+  cmake_parse_arguments(ARG "INTERNAL" "" "DEPRECATED" ${ARGN})
+  set(_result)
+  set(_result "${_result}\nmessage(STATUS \"\")\n")
+  if (ARG_INTERNAL)
+    set(_result "${_result}\nmessage(STATUS \"## INTERNAL: ${CMAKE_CURRENT_LIST_FILE}: ${target} is internal\")\n")
+  else()
+    set(_result "${_result}\nmessage(STATUS \"## DEPRECATED: ${CMAKE_CURRENT_LIST_FILE}: ${target} is deprecated: ${ARG_DEPRECATED}\")\n")
+  endif()
+  set(_result "${_result}\nmessage(STATUS \"\")\n")
+  set("${OUT_RESULT}" "${${OUT_RESULT}}${_result}" PARENT_SCOPE)
+endfunction()

 function(_qi_internal_stage_lib target)
   cmake_parse_arguments(ARG "INTERNAL" "STAGED_NAME" "DEPRECATED;INCLUDE_DIRS;DEFINITIONS;PATH_SUFFIXES;DEPENDS" ${ARGN})
@@ -379,14 +391,10 @@
     _qi_gen_code_lib_redist(_redist ${target})
     set(_redist_file "${CMAKE_BINARY_DIR}/${QI_SDK_CMAKE_MODULES}/sdk/${_l_target}-config.cmake")
     if (ARG_DEPRECATED)
-      set(_redist "${_redist}\nmessage(STATUS \"\")\n")
-      set(_redist "${_redist}\nmessage(STATUS \"## Warning ##: ${target} is deprecated: ${ARG_DEPRECATED}\")\n")
-      set(_redist "${_redist}\nmessage(STATUS \"\")\n")
+      _qi_internal_append_deprecated(_redist ${target} DEPRECATED ${ARG_DEPRECATED})
     endif()
     if (ARG_INTERNAL)
-      set(_redist "${_redist}\nmessage(STATUS \"\")\n")
-      set(_redist "${_redist}\nmessage(STATUS \"## Warning ##: ${target} is internal.\")\n")
-      set(_redist "${_redist}\nmessage(STATUS \"\")\n")
+      _qi_internal_append_deprecated(_redist ${target} INTERNAL)
     endif()
     file(WRITE "${_redist_file}" "${_redist}")
     qi_install_cmake(${_redist_file} SUBFOLDER ${target})
@@ -395,9 +403,7 @@
   _qi_gen_code_lib_sdk(_sdk ${target})
   set(_sdk_file "${QI_SDK_DIR}/${QI_SDK_CMAKE_MODULES}/${_l_target}-config.cmake")
   if (ARG_DEPRECATED)
-    set(_sdk "${_sdk}\nmessage(STATUS \"\")\n")
-    set(_sdk "${_sdk}\nmessage(STATUS \"## Warning ##: ${target} is deprecated: ${ARG_DEPRECATED}\")\n")
-    set(_sdk "${_sdk}\nmessage(STATUS \"\")\n")
+    _qi_internal_append_deprecated(_sdk ${target} DEPRECATED ${ARG_DEPRECATED})
   endif()
   file(WRITE "${_sdk_file}" "${_sdk}")

@@ -438,7 +444,7 @@
   if(_staged_name)
     set(_warning_message
 "
-message(WARNING \"
+message(WARNING \${CMAKE_CURRENT_LIST_FILE}\"
   Usage of :
     use_lib(... ${_staged_name})
   is deprecated
@@ -496,14 +502,10 @@
     _qi_gen_code_header_only_lib_redist(_redist ${target})
     set(_redist_file "${CMAKE_BINARY_DIR}/${QI_SDK_CMAKE_MODULES}/sdk/${_l_target}-config.cmake")
     if (ARG_DEPRECATED)
-      set(_redist "${_redist}\nmessage(STATUS \"\")\n")
-      set(_redist "${_redist}\nmessage(STATUS \"## Warning ##: ${target} is deprecated: ${ARG_DEPRECATED}\")\n")
-      set(_redist "${_redist}\nmessage(STATUS \"\")\n")
+      _qi_internal_append_deprecated(_redist ${target} DEPRECATED ${ARG_DEPRECATED})
     endif()
     if (ARG_INTERNAL)
-      set(_redist "${_redist}\nmessage(STATUS \"\")\n")
-      set(_redist "${_redist}\nmessage(STATUS \"## Warning ##: ${target} is internal.\")\n")
-      set(_redist "${_redist}\nmessage(STATUS \"\")\n")
+      _qi_internal_append_deprecated(_redist ${target} INTERNAL)
     endif()
     file(WRITE "${_redist_file}" "${_redist}")
     qi_install_cmake(${_redist_file} SUBFOLDER ${target})
@@ -512,9 +514,7 @@
   _qi_gen_code_header_only_lib_sdk(_sdk ${target})
   set(_sdk_file "${QI_SDK_DIR}/${QI_SDK_CMAKE_MODULES}/${_l_target}-config.cmake")
   if (ARG_DEPRECATED)
-    set(_sdk "${_sdk}\nmessage(STATUS \"\")\n")
-    set(_sdk "${_sdk}\nmessage(STATUS \"## Warning ##: ${target} is deprecated: ${ARG_DEPRECATED}\")\n")
-    set(_sdk "${_sdk}\nmessage(STATUS \"\")\n")
+    _qi_internal_append_deprecated(_sdk ${target} DEPRECATED ${ARG_DEPRECATED})
   endif()
   file(WRITE "${_sdk_file}" "${_sdk}")


cmake: internal_stage_lib: remove blackmagic with arguments. Only parse argument we know

--- cmake/qibuild/internal/stage.cmake
+++ cmake/qibuild/internal/stage.cmake
@@ -251,18 +251,15 @@

 function(_qi_internal_stage_lib target)
-  cmake_parse_arguments(ARG "" "DEPRECATED;STAGED_NAME" ${ARGN})
+  cmake_parse_arguments(ARG "INTERNAL" "STAGED_NAME" "DEPRECATED;INCLUDE_DIRS;DEFINITIONS;PATH_SUFFIXES;DEPENDS" ${ARGN})
   string(TOUPPER ${target} _U_target)
   string(TOLOWER ${target} _l_target)
-
   set(_staged_name ${ARG_STAGED_NAME})
-
   set(_new_args)
-  foreach(_arg ${ARGN})
-    if(${_arg} STREQUAL "STAGED_NAME")
-      break()
+  foreach(_arg INCLUDE_DIRS DEFINITIONS PATH_SUFFIXES DEPENDS)
+    if (DEFINED ARG_${_arg})
+      list(APPEND _new_args "ARG_${_arg}" "${ARG_${_arg}}")
     endif()
-    list(APPEND _new_args ${_arg})
   endforeach()

   _qi_set_vars(${target} ${_new_args})


don't warn about missing test data files if you aren't going to test

--- cmake_modules/TokuSetupCTest.cmake
+++ cmake_modules/TokuSetupCTest.cmake
@@ -82,13 +82,14 @@
 include(CTest)

 set(TOKUDB_DATA "${TokuDB_SOURCE_DIR}/../tokudb.data" CACHE FILEPATH "Path to data files for tests")
-set(WARNED_ABOUT_DATA 0)
-if (NOT EXISTS "${TOKUDB_DATA}/" AND NOT WARNED_ABOUT_DATA)
-  message(WARNING "Test data files are missing from ${TOKUDB_DATA}, which will cause some tests to fail.  Please put them there or modify TOKUDB_DATA to avoid this.")
-  set(WARNED_ABOUT_DATA 1)
-endif ()

 if (BUILD_TESTING OR BUILD_FT_TESTS OR BUILD_SRC_TESTS)
+  set(WARNED_ABOUT_DATA 0)
+  if (NOT EXISTS "${TOKUDB_DATA}/" AND NOT WARNED_ABOUT_DATA)
+    message(WARNING "Test data files are missing from ${TOKUDB_DATA}, which will cause some tests to fail.  Please put them there or modify TOKUDB_DATA to avoid this.")
+    set(WARNED_ABOUT_DATA 1)
+  endif ()
+
   ## set up full valgrind suppressions file (concatenate the suppressions files)
   file(READ ft/valgrind.suppressions valgrind_suppressions)
   file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/valgrind.suppressions" "${valgrind_suppressions}")


require dependency

require dependency

--- build/modules/FindChrome.cmake
+++ build/modules/FindChrome.cmake
@@ -1,3 +1,4 @@
+INCLUDE(FindPkgConfig)
 SET(CHROME_FOUND TRUE)
 SET(CHROMIUMDIR ${CHROME_ROOT})
 IF(NOT CHROME_MODE)


[cmake] Ensure include dirs for plugins exist.

--- cmake/Modules/WintermutePlugin.cmake
+++ cmake/Modules/WintermutePlugin.cmake
@@ -38,8 +38,10 @@
   WINTERMUTE_ADD_TARGET_PROPERTIES(${_wpd_TARGET})
   TARGET_LINK_LIBRARIES(${_wpd_TARGET} wintermute-core)

-  SET(_include_dirs ${_wpd_INCLUDE_DIRECTORIES})
-  SET(_libs )
+  SET(_include_dirs
+    ${_wpd_INCLUDE_DIRECTORIES}
+    ${WINTERMUTE_INCLUDE_DIRS}
+    ${WINTERMUTE_SOURCE_INCLUDE_DIRS})

   # TODO: Handle extra inclusion directories via WintermuteSourceBuild.


Disable warnings caused by a bug in Debian's openmpi library.

--- cmake/setup_compiler_flags_gnu.cmake
+++ cmake/setup_compiler_flags_gnu.cmake
@@ -76,6 +76,11 @@
 # Disable deprecation warnings
 #
 ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-Wno-deprecated-declarations")
+
+#
+# Disable warning generated by Debian version of openmpi
+#
+ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-Wno-literal-suffix")

 IF(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
   #


Copy files from libpack to build or install directory: Windows- copy plugins/styles and plugins/printsupport to bin copy libpack/bin/QtWebEngineProcess.exe and libpack/bin/qt.conf to build/bin copy assistant.exe to build/bin

--- cMake/FreeCAD_Helpers/PrintFinalReport.cmake
+++ cMake/FreeCAD_Helpers/PrintFinalReport.cmake
@@ -208,10 +208,16 @@
             if(FREECAD_COPY_DEPEND_DIRS_TO_BUILD)
                 message(STATUS "=======================================\n"
                     "Copying libpack dependency directories to build directory for Windows MSVC build.\n")
+                file(COPY ${FREECAD_LIBPACK_DIR}/bin/assistant.exe DESTINATION ${CMAKE_BINARY_DIR}/bin)
+                file(COPY ${FREECAD_LIBPACK_DIR}/bin/QtWebEngineProcess.exe DESTINATION ${CMAKE_BINARY_DIR}/bin)
+                file(COPY ${FREECAD_LIBPACK_DIR}/bin/QtWebEngineProcessd.exe DESTINATION ${CMAKE_BINARY_DIR}/bin)
+                file(COPY ${FREECAD_LIBPACK_DIR}/bin/qt.conf DESTINATION ${CMAKE_BINARY_DIR}/bin)
                 file(COPY ${FREECAD_LIBPACK_DIR}/plugins/platforms DESTINATION ${CMAKE_BINARY_DIR}/bin)
                 file(COPY ${FREECAD_LIBPACK_DIR}/plugins/imageformats DESTINATION ${CMAKE_BINARY_DIR}/bin)
                 file(COPY ${FREECAD_LIBPACK_DIR}/plugins/iconengines DESTINATION ${CMAKE_BINARY_DIR}/bin)
                 file(COPY ${FREECAD_LIBPACK_DIR}/plugins/sqldrivers DESTINATION ${CMAKE_BINARY_DIR}/bin)
+                file(COPY ${FREECAD_LIBPACK_DIR}/plugins/styles DESTINATION ${CMAKE_BINARY_DIR}/bin)
+                file(COPY ${FREECAD_LIBPACK_DIR}/plugins/printsupport DESTINATION ${CMAKE_BINARY_DIR}/bin)
                 file(COPY ${FREECAD_LIBPACK_DIR}/resources DESTINATION ${CMAKE_BINARY_DIR})
                 file(COPY ${FREECAD_LIBPACK_DIR}/bin/Lib/site-packages/PySide2/translations/qtwebengine_locales
                     DESTINATION ${CMAKE_BINARY_DIR}/bin)
@@ -234,6 +240,8 @@
                 install(DIRECTORY ${FREECAD_LIBPACK_DIR}/plugins/imageformats DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
                 install(DIRECTORY ${FREECAD_LIBPACK_DIR}/plugins/iconengines DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
                 install(DIRECTORY ${FREECAD_LIBPACK_DIR}/plugins/sqldrivers DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
+                install(DIRECTORY ${FREECAD_LIBPACK_DIR}/plugins/styles DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
+                install(DIRECTORY ${FREECAD_LIBPACK_DIR}/plugins/printsupport DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
                 install(DIRECTORY ${FREECAD_LIBPACK_DIR}/bin/Lib/site-packages/PySide2/translations/qtwebengine_locales DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
                 install(DIRECTORY ${FREECAD_LIBPACK_DIR}/resources DESTINATION ${CMAKE_INSTALL_PREFIX})
                 install(DIRECTORY ${FREECAD_LIBPACK_DIR}/bin DESTINATION ${CMAKE_INSTALL_PREFIX})


Upgraded cmake/FindEigen.cmake to a version from Google Ceres.

--- cmake/FindEigen.cmake
+++ cmake/FindEigen.cmake
@@ -1,6 +1,173 @@
-set(Eigen_FOUND 0)
-set(Eigen_DIR @Eigen_DIR@)
-if(Eigen_DIR)
-  set(Eigen_INCLUDE_DIR ${Eigen_DIR})
-  set(Eigen_FOUND 1)
-endif()
+# Borrowed from:
+# Ceres Solver - A fast non-linear least squares minimizer
+# Copyright 2015 Google Inc. All rights reserved.
+# http://ceres-solver.org/
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+#
+# * Redistributions of source code must retain the above copyright notice,
+#   this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice,
+#   this list of conditions and the following disclaimer in the documentation
+#   and/or other materials provided with the distribution.
+# * Neither the name of Google Inc. nor the names of its contributors may be
+#   used to endorse or promote products derived from this software without
+#   specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+# Author: alexs.mac@gmail.com (Alex Stewart)
+#
+
+# FindEigen.cmake - Find Eigen library, version >= 3.
+#
+# This module defines the following variables:
+#
+# EIGEN_FOUND: TRUE iff Eigen is found.
+# EIGEN_INCLUDE_DIRS: Include directories for Eigen.
+#
+# EIGEN_VERSION: Extracted from Eigen/src/Core/util/Macros.h
+# EIGEN_WORLD_VERSION: Equal to 3 if EIGEN_VERSION = 3.2.0
+# EIGEN_MAJOR_VERSION: Equal to 2 if EIGEN_VERSION = 3.2.0
+# EIGEN_MINOR_VERSION: Equal to 0 if EIGEN_VERSION = 3.2.0
+#
+# The following variables control the behaviour of this module:
+#
+# EIGEN_INCLUDE_DIR_HINTS: List of additional directories in which to
+#                          search for eigen includes, e.g: /timbuktu/eigen3.
+#
+# The following variables are also defined by this module, but in line with
+# CMake recommended FindPackage() module style should NOT be referenced directly
+# by callers (use the plural variables detailed above instead).  These variables
+# do however affect the behaviour of the module via FIND_[PATH/LIBRARY]() which
+# are NOT re-called (i.e. search for library is not repeated) if these variables
+# are set with valid values _in the CMake cache_. This means that if these
+# variables are set directly in the cache, either by the user in the CMake GUI,
+# or by the user passing -DVAR=VALUE directives to CMake when called (which
+# explicitly defines a cache variable), then they will be used verbatim,
+# bypassing the HINTS variables and other hard-coded search locations.
+#
+# EIGEN_INCLUDE_DIR: Include directory for CXSparse, not including the
+#                    include directory of any dependencies.
+
+# Called if we failed to find Eigen or any of it's required dependencies,
+# unsets all public (designed to be used externally) variables and reports
+# error message at priority depending upon [REQUIRED/QUIET/<NONE>] argument.
+MACRO(EIGEN_REPORT_NOT_FOUND REASON_MSG)
+  UNSET(EIGEN_FOUND)
+  UNSET(EIGEN_INCLUDE_DIRS)
+  # Make results of search visible in the CMake GUI if Eigen has not
+  # been found so that user does not have to toggle to advanced view.
+  MARK_AS_ADVANCED(CLEAR EIGEN_INCLUDE_DIR)
+  # Note <package>_FIND_[REQUIRED/QUIETLY] variables defined by FindPackage()
+  # use the camelcase library name, not uppercase.
+  IF (Eigen_FIND_QUIETLY)
+    MESSAGE(STATUS "Failed to find Eigen - " ${REASON_MSG} ${ARGN})
+  ELSEIF (Eigen_FIND_REQUIRED)
+    MESSAGE(FATAL_ERROR "Failed to find Eigen - " ${REASON_MSG} ${ARGN})
+  ELSE()
+    # Neither QUIETLY nor REQUIRED, use no priority which emits a message
+    # but continues configuration and allows generation.
+    MESSAGE("-- Failed to find Eigen - " ${REASON_MSG} ${ARGN})
+  ENDIF ()
+ENDMACRO(EIGEN_REPORT_NOT_FOUND)
+
+# Search user-installed locations first, so that we prefer user installs
+# to system installs where both exist.
+#
+# TODO: Add standard Windows search locations for Eigen.
+LIST(APPEND EIGEN_CHECK_INCLUDE_DIRS
+  /usr/local/include/eigen3
+  /usr/local/homebrew/include/eigen3 # Mac OS X
+  /opt/local/var/macports/software/eigen3 # Mac OS X.
+  /opt/local/include/eigen3
+  /usr/include/eigen3)
+
+# Search supplied hint directories first if supplied.
+FIND_PATH(EIGEN_INCLUDE_DIR
+  NAMES Eigen/Core
+  PATHS ${EIGEN_INCLUDE_DIR_HINTS}
+  ${EIGEN_CHECK_INCLUDE_DIRS})
+IF (NOT EIGEN_INCLUDE_DIR)
+  # Handle case where user / CMAKE_PREFIX_PATH does not specify the
+  # required eigen3 subdirectory, prepend it to search target and retry.
+  FIND_PATH(EIGEN_INCLUDE_DIR
+    NAMES eigen3/Eigen/Core
+    PATHS ${EIGEN_INCLUDE_DIR_HINTS}
+    ${EIGEN_CHECK_INCLUDE_DIRS})
+  IF (EIGEN_INCLUDE_DIR AND EXISTS ${EIGEN_INCLUDE_DIR})
+    UPDATE_CACHE_VARIABLE(EIGEN_INCLUDE_DIR "${EIGEN_INCLUDE_DIR}/eigen3")
+  ENDIF (EIGEN_INCLUDE_DIR AND EXISTS ${EIGEN_INCLUDE_DIR})
+ENDIF(NOT EIGEN_INCLUDE_DIR)
+
+IF (NOT EIGEN_INCLUDE_DIR OR
+    NOT EXISTS ${EIGEN_INCLUDE_DIR})
+  EIGEN_REPORT_NOT_FOUND(
+    "Could not find eigen3 include directory, set EIGEN_INCLUDE_DIR to "
+    "path to eigen3 include directory, e.g. /usr/local/include/eigen3.")
+ENDIF (NOT EIGEN_INCLUDE_DIR OR
+       NOT EXISTS ${EIGEN_INCLUDE_DIR})
+
+# Mark internally as found, then verify. EIGEN_REPORT_NOT_FOUND() unsets
+# if called.
+SET(EIGEN_FOUND TRUE)
+
+# Extract Eigen version from Eigen/src/Core/util/Macros.h
+IF (EIGEN_INCLUDE_DIR)
+  SET(EIGEN_VERSION_FILE ${EIGEN_INCLUDE_DIR}/Eigen/src/Core/util/Macros.h)
+  IF (NOT EXISTS ${EIGEN_VERSION_FILE})
+    EIGEN_REPORT_NOT_FOUND(
+      "Could not find file: ${EIGEN_VERSION_FILE} "
+      "containing version information in Eigen install located at: "
+      "${EIGEN_INCLUDE_DIR}.")
+  ELSE (NOT EXISTS ${EIGEN_VERSION_FILE})
+    FILE(READ ${EIGEN_VERSION_FILE} EIGEN_VERSION_FILE_CONTENTS)
+
+    STRING(REGEX MATCH "#define EIGEN_WORLD_VERSION [0-9]+"
+      EIGEN_WORLD_VERSION "${EIGEN_VERSION_FILE_CONTENTS}")
+    STRING(REGEX REPLACE "#define EIGEN_WORLD_VERSION ([0-9]+)" "\\1"
+      EIGEN_WORLD_VERSION "${EIGEN_WORLD_VERSION}")
+
+    STRING(REGEX MATCH "#define EIGEN_MAJOR_VERSION [0-9]+"
+      EIGEN_MAJOR_VERSION "${EIGEN_VERSION_FILE_CONTENTS}")
+    STRING(REGEX REPLACE "#define EIGEN_MAJOR_VERSION ([0-9]+)" "\\1"
+      EIGEN_MAJOR_VERSION "${EIGEN_MAJOR_VERSION}")
+
+    STRING(REGEX MATCH "#define EIGEN_MINOR_VERSION [0-9]+"
+      EIGEN_MINOR_VERSION "${EIGEN_VERSION_FILE_CONTENTS}")
+    STRING(REGEX REPLACE "#define EIGEN_MINOR_VERSION ([0-9]+)" "\\1"
+      EIGEN_MINOR_VERSION "${EIGEN_MINOR_VERSION}")
+
+    # This is on a single line s/t CMake does not interpret it as a list of
+    # elements and insert ';' separators which would result in 3.;2.;0 nonsense.
+    SET(EIGEN_VERSION "${EIGEN_WORLD_VERSION}.${EIGEN_MAJOR_VERSION}.${EIGEN_MINOR_VERSION}")
+  ENDIF (NOT EXISTS ${EIGEN_VERSION_FILE})
+ENDIF (EIGEN_INCLUDE_DIR)
+
+# Set standard CMake FindPackage variables if found.
+IF (EIGEN_FOUND)
+  SET(EIGEN_INCLUDE_DIRS ${EIGEN_INCLUDE_DIR})
+ENDIF (EIGEN_FOUND)
+
+# Handle REQUIRED / QUIET optional arguments and version.
+INCLUDE(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(Eigen
+  REQUIRED_VARS EIGEN_INCLUDE_DIRS
+  VERSION_VAR EIGEN_VERSION)
+
+# Only mark internal variables as advanced if we found Eigen, otherwise
+# leave it visible in the standard GUI for the user to set manually.
+IF (EIGEN_FOUND)
+  MARK_AS_ADVANCED(FORCE EIGEN_INCLUDE_DIR)
+ENDIF (EIGEN_FOUND)


Missing include CheckCXXSourceCompiles

Missing include CheckCXXSourceCompiles

--- cmake/FindIconv.cmake
+++ cmake/FindIconv.cmake
@@ -25,6 +25,8 @@
 #

 include(CheckFunctionExists)
+include(CheckCXXSourceCompiles)
+
 if(ICONV_INCLUDE_DIR)
   set(ICONV_FIND_QUIETLY TRUE)
 endif()
@@ -111,9 +113,7 @@
         # Display a useful message first time we come through here
         message(STATUS "One (and only one) of the ICONV_ACCEPTS_... tests must pass")
     endif()
-
-    include(CheckCXXSourceCompiles)
-
+
     check_cxx_source_compiles(
         "#include <iconv.h>
          int main() {


macro install dir fix

macro install dir fix

--- cmake/UseCyclus.cmake
+++ cmake/UseCyclus.cmake
@@ -263,15 +263,16 @@
     TARGET_LINK_LIBRARIES(${lib_name} dl ${LIBS})
     SET(CYCLUS_LIBRARIES ${CYCLUS_LIBRARIES} ${lib_root})
     ADD_DEPENDENCIES(${lib_name} ${lib_src} ${lib_h})
-    SET_TARGET_PROPERTIES(${lib_name}
-      PROPERTIES INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib/cyclus"
-      INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib/cyclus"
-    )

     set(dest_ "lib/cyclus")
-    if (inst_dir)
+    string(COMPARE EQUAL "${inst_dir}" "" is_empty)
+    if (NOT is_empty)
       set(dest_ "${dest_}/${inst_dir}")
     endif()
+
+    SET_TARGET_PROPERTIES(${lib_name}
+      PROPERTIES INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/${dest_}"
+    )

     # install library
     INSTALL(


MDEV-6886 - Add RHEL7 RPM layout

MDEV-6886 - Add RHEL7 RPM layout

Set proper alternative names on RHEL7: they should match Fedora names.

--- cmake/cpack_rpm.cmake
+++ cmake/cpack_rpm.cmake
@@ -182,7 +182,7 @@
 ELSEIF(RPM MATCHES "(rhel|centos)6")
   ALTERNATIVE_NAME("client" "mysql")
   ALTERNATIVE_NAME("shared" "mysql-libs")
-ELSEIF(RPM MATCHES "fedora")
+ELSEIF(RPM MATCHES "fedora" OR RPM MATCHES "(rhel|centos)7")
   SET(epoch 1) # this is fedora
   ALTERNATIVE_NAME("client" "mariadb")
   ALTERNATIVE_NAME("client" "mysql")


Attempt to fix strange rpm dependency issue following prior patch

--- cmake/cpack_rpm.cmake
+++ cmake/cpack_rpm.cmake
@@ -223,6 +223,9 @@
   "perl(mtr_io.pl)"
   "perl(mtr_match)"
   "perl(mtr_misc.pl)"
+  "perl(mtr_gcov.pl)"
+  "perl(mtr_gprof.pl)"
+  "perl(mtr_process.pl)"
   "perl(mtr_report)"
   "perl(mtr_results)"
   "perl(mtr_unique)")


Fix: add double qutoes around string else MacOS cries

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


Add HAVE_LOCALE_H

Add HAVE_LOCALE_H

--- cmake/MyPackageCheckCommonIncludeFiles.cmake
+++ cmake/MyPackageCheckCommonIncludeFiles.cmake
@@ -18,4 +18,5 @@
   CHECK_INCLUDE_FILE ("fcntl.h"        HAVE_FCNTL_H)
   CHECK_INCLUDE_FILE ("math.h"         HAVE_MATH_H)
   CHECK_INCLUDE_FILE ("float.h"        HAVE_FLOAT_H)
+  CHECK_INCLUDE_FILE ("locale.h"       HAVE_LOCALE_H)
 ENDMACRO()


build: sort warning options

build: sort warning options

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

--- cmake/modules/DispatchCompilerWarnings.cmake
+++ cmake/modules/DispatchCompilerWarnings.cmake
@@ -8,38 +8,39 @@
     add_compile_options(-Werror)
     add_compile_options(-Wall)
     add_compile_options(-Wextra)
-    add_compile_options(-Wmissing-prototypes)
-    add_compile_options(-Wdocumentation)
-    add_compile_options(-Wunreachable-code)
-    add_compile_options(-Wshadow)
-    add_compile_options(-Wconversion)
+
+    add_compile_options(-Warray-bounds-pointer-arithmetic)
     add_compile_options(-Wassign-enum)
-    add_compile_options(-Wshorten-64-to-32)
-    add_compile_options(-Wnewline-eof)
-    add_compile_options(-Wsign-conversion)
-    add_compile_options(-Winfinite-recursion)
-    add_compile_options(-Warray-bounds-pointer-arithmetic)
     add_compile_options(-Watomic-properties)
     add_compile_options(-Wcomma)
     add_compile_options(-Wconditional-uninitialized)
+    add_compile_options(-Wconversion)
     add_compile_options(-Wcovered-switch-default)
     add_compile_options(-Wdate-time)
     add_compile_options(-Wdeprecated)
+    add_compile_options(-Wdocumentation)
     add_compile_options(-Wdouble-promotion)
     add_compile_options(-Wduplicate-enum)
     add_compile_options(-Wexpansion-to-defined)
     add_compile_options(-Wfloat-equal)
     add_compile_options(-Widiomatic-parentheses)
+    add_compile_options(-Winfinite-recursion)
+    add_compile_options(-Wmissing-prototypes)
+    add_compile_options(-Wnewline-eof)
     add_compile_options(-Wnullable-to-nonnull-conversion)
     add_compile_options(-Wobjc-interface-ivars)
     add_compile_options(-Wover-aligned)
     add_compile_options(-Wpacked)
     add_compile_options(-Wpointer-arith)
     add_compile_options(-Wselector)
+    add_compile_options(-Wshadow)
+    add_compile_options(-Wshorten-64-to-32)
+    add_compile_options(-Wsign-conversion)
     add_compile_options(-Wstatic-in-inline)
     add_compile_options(-Wsuper-class-method-mismatch)
     add_compile_options(-Wswitch-enum)
     add_compile_options(-Wunguarded-availability)
+    add_compile_options(-Wunreachable-code)
     add_compile_options(-Wunused)

     add_compile_options(-Wno-unknown-warning-option)


Fix /MT /MD flags for Cmake 3.15+

Fix /MT /MD flags for Cmake 3.15+

--- cmake-toolchains/windows.cmake
+++ cmake-toolchains/windows.cmake
@@ -48,10 +48,20 @@
     set(FIPS_VS_EXCEPTION_FLAGS "/EHsc")
 endif()

-if (FIPS_DYNAMIC_CRT OR FIPS_UWP)
-    set(FIPS_VS_CRT_FLAGS "/MD")
+# CMake 3.15 has a different way to setup MT / MD flags
+# see: https://cmake.org/cmake/help/latest/variable/CMAKE_MSVC_RUNTIME_LIBRARY.html#variable:CMAKE_MSVC_RUNTIME_LIBRARY
+if (${CMAKE_VERSION} VERSION_GREATER_EQUAL 3.15)
+    if (FIPS_DYNAMIC_CRT OR FIPS_UWP)
+        set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>DLL")
+    else()
+        set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
+    endif()
 else()
-    set(FIPS_VS_CRT_FLAGS "/MT")
+    if (FIPS_DYNAMIC_CRT OR FIPS_UWP)
+        set(FIPS_VS_CRT_FLAGS "/MD")
+    else()
+        set(FIPS_VS_CRT_FLAGS "/MT")
+    endif()
 endif()

 set(CMAKE_CXX_FLAGS "${FIPS_VS_EXCEPTION_FLAGS} /MP /DWIN32")


modules/BuildGTest: add variables for gtest_main

--- cmake/Modules/BuildGTest.cmake
+++ cmake/Modules/BuildGTest.cmake
@@ -18,12 +18,16 @@

 set(GTEST_INCLUDE_DIRS "${source_dir}/include")
 set(GTEST_INSTALL_LIB "${source_dir}/${CMAKE_SHARED_LIBRARY_PREFIX}gtest${CMAKE_SHARED_LIBRARY_SUFFIX}")
+set(GTEST_INSTALL_MAIN_LIB "${source_dir}/${CMAKE_SHARED_LIBRARY_PREFIX}gtest_main${CMAKE_SHARED_LIBRARY_SUFFIX}")
+
 if(WIN32)
   set(GTEST_LIBRARIES "${source_dir}/${CMAKE_IMPORT_LIBRARY_PREFIX}gtest${CMAKE_IMPORT_LIBRARY_SUFFIX}")
+  set(GTEST_MAIN_LIBRARIES "${source_dir}/${CMAKE_IMPORT_LIBRARY_PREFIX}gtest_main${CMAKE_IMPORT_LIBRARY_SUFFIX}")
 else()
   set(GTEST_LIBRARIES "${GTEST_INSTALL_LIB}")
+  set(GTEST_MAIN_LIBRARIES "${GTEST_INSTALL_MAIN_LIB}")
 endif()

-set(GTEST_BOTH_LIBRARIES ${GTEST_LIBRARIES})
+set(GTEST_BOTH_LIBRARIES ${GTEST_LIBRARIES} ${GTEST_MAIN_LIBRARIES})

-install_external_library(gtest ${GTEST_INSTALL_LIB})
+install_external_library(gtest ${GTEST_INSTALL_LIB} ${GTEST_INSTALL_MAIN_LIB})


Add non-buildtype imported location for TBB, and import as unknown.

--- cmake/Modules/FindTBB_EP.cmake
+++ cmake/Modules/FindTBB_EP.cmake
@@ -156,10 +156,11 @@
     )

     if (TBB_FOUND AND NOT TARGET TBB::tbb)
-      add_library(TBB::tbb SHARED IMPORTED)
+      add_library(TBB::tbb UNKNOWN IMPORTED)
       set_target_properties(TBB::tbb PROPERTIES
         IMPORTED_LOCATION_RELEASE "${TBB_LIBRARIES}"
         IMPORTED_LOCATION_DEBUG "${TBB_LIBRARIES}"
+        IMPORTED_LOCATION "${TBB_LIBRARIES}"
         INTERFACE_INCLUDE_DIRECTORIES "${TBB_INCLUDE_DIR}"
       )
       set(TBB_IMPORTED_TARGETS TBB::tbb PARENT_SCOPE)


From Gerri:
Make sure that XROOTD_PRIVATE_INCLUDE_DIR is not undefined.

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

--- cmake/modules/FindXROOTD.cmake
+++ cmake/modules/FindXROOTD.cmake
@@ -113,7 +113,8 @@
             ${XROOTD_INCLUDE_DIR}
         )
      endif()
-
+
+     SET(XROOTD_PRIVATE_INCLUDE_DIR FALSE)
      if (XROOTD_INCLUDE_DIR)
         # Check for additional headers in new directories
         find_path(XROOTD_PRIVATE_INCLUDE_DIR
@@ -171,7 +172,11 @@
   if(XROOTD_LIBRARIES)
     set(XROOTD_FOUND TRUE)
     if(NOT XROOTD_FIND_QUIETLY )
-      message(STATUS "             include_dir: ${XROOTD_INCLUDE_DIR} ${XROOTD_PRIVATE_INCLUDE_DIR}")
+      if (XROOTD_PRIVATE_INCLUDE_DIR)
+         message(STATUS "             include_dir: ${XROOTD_INCLUDE_DIR} ${XROOTD_PRIVATE_INCLUDE_DIR}")
+      else ()
+         message(STATUS "             include_dir: ${XROOTD_INCLUDE_DIR}")
+      endif ()
       message(STATUS "             libraries: ${XROOTD_LIBRARIES}")
     endif()
   else ()


"Revert" CMake change by providing -rdynamic.

It is needed by the JIT to resolve symbols from the binary.
Fixes rootcling issue on Linux.

--- cmake/modules/SetUpLinux.cmake
+++ cmake/modules/SetUpLinux.cmake
@@ -65,6 +65,8 @@
 set(CILIBS "-lm -ldl -rdynamic")
 set(CRYPTLIBS "-lcrypt")
 set(CMAKE_M_LIBS -lm)
+# JIT must be able to resolve symbols from all ROOT binaries.
+set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -rdynamic")

 if(CMAKE_COMPILER_IS_GNUCXX)


Pull Request #236. Fix Freetype detection

--HG--
branch : v1-9

--- CMake/Packages/FindFreetype.cmake
+++ CMake/Packages/FindFreetype.cmake
@@ -31,7 +31,7 @@
   FREETYPE_INCLUDE_DIR
 )

-set(FREETYPE_LIBRARY_NAMES freetype2501 freetype250 freetype2412 freetype2411 freetype2410 freetype249 freetype248 freetype246 freetype2311 freetype239 freetype238 freetype235 freetype219 freetype)
+set(FREETYPE_LIBRARY_NAMES freetype251 freetype2501 freetype250 freetype2412 freetype2411 freetype2410 freetype249 freetype248 freetype246 freetype2311 freetype239 freetype238 freetype235 freetype219 freetype)
 get_debug_names(FREETYPE_LIBRARY_NAMES)

 use_pkgconfig(FREETYPE_PKGC freetype2)
@@ -43,7 +43,7 @@
 findpkg_framework(FREETYPE)
 message(STATUS "CMAKE_PREFIX_PATH: ${CMAKE_PREFIX_PATH}")

-find_path(FREETYPE_INCLUDE_DIR NAMES freetype/freetype.h HINTS ${FREETYPE_INC_SEARCH_PATH} ${FREETYPE_PKGC_INCLUDE_DIRS} PATH_SUFFIXES freetype2)
+find_path(FREETYPE_INCLUDE_DIR NAMES freetype.h freetype/freetype.h HINTS ${FREETYPE_INC_SEARCH_PATH} ${FREETYPE_PKGC_INCLUDE_DIRS} PATH_SUFFIXES freetype2)
 find_path(FREETYPE_FT2BUILD_INCLUDE_DIR NAMES ft2build.h HINTS ${FREETYPE_INC_SEARCH_PATH} ${FREETYPE_PKGC_INCLUDE_DIRS})

 find_library(FREETYPE_LIBRARY_REL NAMES ${FREETYPE_LIBRARY_NAMES} HINTS ${FREETYPE_LIB_SEARCH_PATH} ${FREETYPE_PKGC_LIBRARY_DIRS} PATH_SUFFIXES "" Release RelWithDebInfo MinSizeRel)


Fixed small bug in build script (accidentally an error message was suppressed when boost is not available)

--- CMake/hoomd/HOOMDBoostSetup.cmake
+++ CMake/hoomd/HOOMDBoostSetup.cmake
@@ -25,10 +25,12 @@
     find_package(Boost 1.44.0 COMPONENTS ${REQUIRED_BOOST_COMPONENTS} system mpi serialization)

     if (NOT Boost_FOUND)
-        message(WARNING "Boost (>= 1.44.0) with mpi and serialization components not found. Continuing without MPI support.")
+        message(WARNING "Boost (>= 1.44.0) with mpi and serialization components not found. Disabling MPI.")
         set(ENABLE_MPI FALSE)
     endif (NOT Boost_FOUND)
-else(ENABLE_MPI)
+endif(ENABLE_MPI)
+
+if (NOT ENABLE_MPI)
     # see if we can get any supported version of Boost
     find_package(Boost 1.32.0 COMPONENTS ${REQUIRED_BOOST_COMPONENTS} REQUIRED)

@@ -38,7 +40,7 @@
     set(BOOST_REQUIRED_COMPONENTS ${REQUIRED_BOOST_COMPONENTS} system)
     find_package(Boost 1.35.0 COMPONENTS ${REQUIRED_BOOST_COMPONENTS} REQUIRED)
     endif (Boost_MINOR_VERSION GREATER 34)
-endif(ENABLE_MPI)
+endif(NOT ENABLE_MPI)

 # add include directories
 include_directories(SYSTEM ${Boost_INCLUDE_DIR})


Make Boost a TEST_OPTIONAL_TPLS in Search package

--- packages/Search/cmake/Dependencies.cmake
+++ packages/Search/cmake/Dependencies.cmake
@@ -4,6 +4,6 @@
   Kokkos
   Teuchos
   Tpetra
-  TEST_REQUIRED_TPLS
-  Boost
+  TEST_OPTIONAL_TPLS
+  BoostOrg
   )


[INTERNAL] README was renamed to README.rst

--- util/cmake/SeqAnBuildSystem.cmake
+++ util/cmake/SeqAnBuildSystem.cmake
@@ -188,9 +188,9 @@

     if (("${SEQAN_BUILD_SYSTEM}" STREQUAL "SEQAN_RELEASE") OR
         ("${SEQAN_BUILD_SYSTEM}" STREQUAL "SEQAN_RELEASE_LIBRARY"))
-        # Install SeqAn README and LICENSE files.
+        # Install SeqAn README.rst and LICENSE files.
         install (FILES LICENSE
-                       README
+                       README.rst
                  DESTINATION share/doc/seqan)
     endif ()


[FIX] nightly demos tests

[FIX] nightly demos tests

git-svn-id: a7f2a8f7432d210e972fb03898013d213e2b549b@14511 e6417c60-b987-48fd-844e-b20f0fcc1017

--- util/cmake/SeqAnBuildSystem.cmake
+++ util/cmake/SeqAnBuildSystem.cmake
@@ -418,13 +418,7 @@
         set (CHECKER_PATH "${CMAKE_SOURCE_DIR}/util/bin/demo_checker.py")

         # Compose arguments to the demo_checker.py script.
-        foreach (INFIX "" "Release/" "Debug/" "RelWithDebInfo/")
-          foreach (EXTENSION "" ".exe")
-            if (EXISTS "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${INFIX}${EXECUTABLE}${EXTENSION}")
-                set (ARGS "--binary-path" "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${INFIX}${EXECUTABLE}${EXTENSION}")
-            endif (EXISTS "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${INFIX}${EXECUTABLE}${EXTENSION}")
-          endforeach (EXTENSION "" ".exe")
-        endforeach (INFIX "" "Release/" "Debug/" "RelWithDebInfo/")
+        set (ARGS "--binary-path" "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${EXECUTABLE}")

         if (EXISTS "${STDOUT_PATH}")
             set (ARGS ${ARGS} "--stdout-path" "${STDOUT_PATH}")


Fix compile error in MacOS

Fix compile error in MacOS

-Wno-int-in-bool-context is not exist in Clang

--- Builds/CMake/CompileOptions.cmake
+++ Builds/CMake/CompileOptions.cmake
@@ -103,9 +103,14 @@
 	set(DEFAULT_COMPILE_OPTIONS ${DEFAULT_COMPILE_OPTIONS}
 		-Wall
 		-Wno-missing-braces
-		-Wno-int-in-bool-context
+
 		${WARN_AS_ERROR_FLAGS}
 		-std=c++1z
+	)
+endif ()
+if (CMAKE_CXX_COMPILER_ID MATCHES "GNU")
+	set(DEFAULT_COMPILE_OPTIONS ${DEFAULT_COMPILE_OPTIONS}
+		-Wno-int-in-bool-context
 	)
 endif ()


Adapt to EMSDK changes. [ci only: Web]

Adapt to EMSDK changes. [ci only: Web]

--- CMake/Toolchains/Emscripten.cmake
+++ CMake/Toolchains/Emscripten.cmake
@@ -60,8 +60,16 @@
             if (DEFINED ENV{EMSCRIPTEN_ROOT_PATH})
                 file (TO_CMAKE_PATH $ENV{EMSCRIPTEN_ROOT_PATH} EMSCRIPTEN_ROOT_PATH)
             elseif (DEFINED ENV{EM_CONFIG})
+                # Attempt to auto detect the Emscripten root path from the config file
                 file (STRINGS $ENV{EM_CONFIG} EMSCRIPTEN_ROOT_PATH REGEX "^EMSCRIPTEN_ROOT = '.*'$")
-                string (REGEX REPLACE "^EMSCRIPTEN_ROOT = '(.*)'$" \\1 EMSCRIPTEN_ROOT_PATH "${EMSCRIPTEN_ROOT_PATH}")    # Stringify to guard against empty variable
+                if (EMSCRIPTEN_ROOT_PATH)
+                    string (REGEX REPLACE "^EMSCRIPTEN_ROOT = '(.*)'$" \\1 EMSCRIPTEN_ROOT_PATH ${EMSCRIPTEN_ROOT_PATH})
+                else ()
+                    # Newer config file requires Python to actually evaluate it, basically, `cat $EM_CONFIG <(echo 'print(EMSCRIPTEN_ROOT)') |python -`
+                    file (STRINGS $ENV{EM_CONFIG} EM_CONFIG NEWLINE_CONSUME)
+                    execute_process (COMMAND ${CMAKE_COMMAND} -E echo "${EM_CONFIG}\nprint(EMSCRIPTEN_ROOT)"
+                                     COMMAND python - OUTPUT_VARIABLE EMSCRIPTEN_ROOT_PATH OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_QUIET)
+                endif ()
             endif ()
         endif ()
         set (EMSCRIPTEN_ROOT_PATH ${EMSCRIPTEN_ROOT_PATH} CACHE STRING "Root path to Emscripten cross-compiler tools (Emscripten only)")


removed some compiler flags for xeon phi

--- common/cmake/icc_xeonphi.cmake
+++ common/cmake/icc_xeonphi.cmake
@@ -22,9 +22,9 @@
 #--no-exceptions --no-rtti
 # -ansi-alias # ISPC not working with ansi-alias flag

-SET (CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG -mCG_lrb_num_threads=4 -mCG_lrb_num_threads=4 -fp-model fast -fimf-precision=low -fasm-blocks -no-inline-max-total-size -inline-factor=200 -fPIC  -fma  -restrict -no-prec-div -no-prec-sqrt  -mGLOB_default_function_attrs=\"use_vec_for_imul=on;use_fast_math=on;gather_scatter_loop_jknzd=on;gather_scatter_loop_unroll=2;use_gather_scatter_hint=on;c_lrb_avoid_vector_insts_with_rip=on;c_avoid_bank_conflicts=on;c_sch_nop_insertion=on;c_avoid_movz_and_movs=off;c_avoid_integer_ciscization=on;avoid_stall_between_all_insts=on;avoid_long_vector_ints=on;avoid_loads_with_extend=on;smart_mem_conflicts=on\"  -mP2OPT_hlo_prefetch=F ")
+SET (CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG -fp-model fast -fimf-precision=low -fasm-blocks -no-inline-max-total-size -inline-factor=200 -fPIC  -fma  -restrict -no-prec-div -no-prec-sqrt  -mGLOB_default_function_attrs=\"use_vec_for_imul=on;use_fast_math=on;gather_scatter_loop_jknzd=on;gather_scatter_loop_unroll=2;use_gather_scatter_hint=on;c_sch_nop_insertion=on;c_avoid_movz_and_movs=off;c_avoid_integer_ciscization=on;avoid_long_vector_ints=on;avoid_loads_with_extend=on;smart_mem_conflicts=on\"  -mP2OPT_hlo_prefetch=F ")

-SET (CMAKE_CXX_FLAGS_RELWITHDEBINFO "-g -O3 -DNDEBUG -mCG_lrb_num_threads=4 -mCG_lrb_num_threads=4 -fp-model fast -fimf-precision=low -fasm-blocks -no-inline-max-total-size -inline-factor=200 -fPIC  -fma  -restrict -no-prec-div -no-prec-sqrt  -mGLOB_default_function_attrs=\"use_vec_for_imul=on;use_fast_math=on;gather_scatter_loop_jknzd=on;gather_scatter_loop_unroll=2;use_gather_scatter_hint=on;c_lrb_avoid_vector_insts_with_rip=on;c_avoid_bank_conflicts=on;c_sch_nop_insertion=on;c_avoid_movz_and_movs=off;c_avoid_integer_ciscization=on;avoid_stall_between_all_insts=on;avoid_long_vector_ints=on;avoid_loads_with_extend=on;smart_mem_conflicts=on\"  -mP2OPT_hlo_prefetch=F ")
+SET (CMAKE_CXX_FLAGS_RELWITHDEBINFO "-g -O3 -DNDEBUG -fp-model fast -fimf-precision=low -fasm-blocks -no-inline-max-total-size -inline-factor=200 -fPIC  -fma  -restrict -no-prec-div -no-prec-sqrt  -mGLOB_default_function_attrs=\"use_vec_for_imul=on;use_fast_math=on;gather_scatter_loop_jknzd=on;gather_scatter_loop_unroll=2;use_gather_scatter_hint=on;c_sch_nop_insertion=on;c_avoid_movz_and_movs=off;c_avoid_integer_ciscization=on;avoid_long_vector_ints=on;avoid_loads_with_extend=on;smart_mem_conflicts=on\"  -mP2OPT_hlo_prefetch=F ")

 SET(CMAKE_LINKER icpc)
 SET(CMAKE_SHARED_LINKER_FLAGS ${CMAKE_SHARED_LINKER_FLAGS} -static-intel)


[brief] Fixes spelling mistake on debug variable.

[detailed]
- This mistake prevented the debug flags from being set properly.

--- config/Compiler.cmake
+++ config/Compiler.cmake
@@ -29,7 +29,7 @@
         -D_CRT_SECURE_NO_WARNINGS
         )
     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4")
-    set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEUBG} /Zl")
+    set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /Zl")
 else()
     set(CMAKE_CXX_FLAGS_DEBUG "-g")
     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -std=c++11")


linking concrete modules to cycluscore.

linking concrete modules to cycluscore.

--- CMake/CycamoreModuleMacros.cmake
+++ CMake/CycamoreModuleMacros.cmake
@@ -5,6 +5,8 @@

   # Build the libraries from the CYCAMORE_SRC source files
   ADD_LIBRARY( ${_name}       ${_name}.cpp )
+  # Link the libraries to libcycluscore
+  TARGET_LINK_LIBRARIES(${_name} dl cycluscore)
   SET(CYCAMORE_LIBRARIES ${CYCAMORE_LIBRARIES} ${_name} )


Change CHANGE_SUMMARY parsing method

Change CHANGE_SUMMARY parsing method

--- Modules/ManageReleaseFedora.cmake
+++ Modules/ManageReleaseFedora.cmake
@@ -151,7 +151,7 @@
 	    "MANAGE_SOURCE_VERSION_CONTROL_TAG_FILE=${MANAGE_SOURCE_VERSION_CONTROL_TAG_FILE}")
 	SET(_cmdOpts "")
 	IF (NOT CHANGE_SUMMARY STREQUAL "")
-	    LIST(APPEND _cmdOpts "-m" "${CHANGE_SUMMARY}")
+	    SET(CHANGE_SUMMARY "Release ${PROJECT_NAME}-${PRJ_VER}")
 	ENDIF(NOT CHANGE_SUMMARY STREQUAL "")

 	IF (NOT REDHAT_BUGZILLA STREQUAL "")
@@ -160,6 +160,7 @@

 	ADD_CUSTOM_TARGET(fedpkg_build
 	    COMMAND ${CMAKE_FEDORA_FEDPKG_CMD} -d "${FEDPKG_DIR}"
+	    -m "${CHANGE_SUMMARY}"
 	    ${_cmdOpts} "${PRJ_SRPM_FILE}" ${ARGN}
 	    DEPENDS "${MANAGE_SOURCE_VERSION_CONTROL_TAG_FILE}"
 	    VERBATIM


COMP: Fix compilation for ITK_FUTURE_LEGACY=ON

Preparing for future code builds with ITK_FUTURE_LEGACY=ON requires
that deprecated function names be replaced with new
names.  Replace SetUseImageSpacingOn() with SetUseImageSpacing(true)

--- Modules/Remote/AdaptiveDenoising.remote.cmake
+++ Modules/Remote/AdaptiveDenoising.remote.cmake
@@ -56,5 +56,5 @@
   "
   MODULE_COMPLIANCE_LEVEL 3
   GIT_REPOSITORY ${git_protocol}://github.com/ntustison/ITKAdaptiveDenoising.git
-  GIT_TAG 062c050c0163f49ae66e97a0f56188be15964cb2
+  GIT_TAG a31fc7dbed78260abb3832b908fd2b6a52cf189e
 )