Remove the OpenGL SW rasterizer as well.

--- cmake/DeployQt.cmake
+++ cmake/DeployQt.cmake
@@ -46,6 +46,7 @@
                 --verbose 0
                 --no-compiler-runtime
                 --no-angle
+                --no-opengl-sw
                 \"$<TARGET_FILE:${target}>\"
         COMMENT "Deploying Qt..."
     )


Fixing FindGLFW cmake module

Fixing FindGLFW cmake module

Previously, FindGLFW would search for both GL/glfw.h and GLFW/glfw3.h, which
does not work when a system has both GLFW 2.0 and 3.0 installed.

The fix still probes for both files, but does so in two passes, preferring
glfw3.h.

--- cmake/FindGLFW.cmake
+++ cmake/FindGLFW.cmake
@@ -32,7 +32,6 @@

 find_path( GLFW_INCLUDE_DIR
     NAMES
-        GL/glfw.h
         GLFW/glfw3.h
     HINTS
         "${GLFW_LOCATION}/include"
@@ -50,6 +49,31 @@
         /usr/include/GL
         /usr/include
     DOC
+        "The directory where GLFW/glfw3.h resides"
+)
+
+#
+# XXX: Do we still need to search for GL/glfw.h?
+#
+find_path( GLFW_INCLUDE_DIR
+    NAMES
+        GL/glfw.h
+    HINTS
+        "${GLFW_LOCATION}/include"
+        "$ENV{GLFW_LOCATION}/include"
+    PATHS
+        "$ENV{PROGRAMFILES}/GLFW/include"
+        "${OPENGL_INCLUDE_DIR}"
+        /usr/openwin/share/include
+        /usr/openwin/include
+        /usr/X11R6/include
+        /usr/include/X11
+        /opt/graphics/OpenGL/include
+        /opt/graphics/OpenGL/contrib/libglfw
+        /usr/local/include
+        /usr/include/GL
+        /usr/include
+    DOC
         "The directory where GL/glfw.h resides"
 )


don't try to find intl

don't try to find intl

--- cmake/FindGLIB.cmake
+++ cmake/FindGLIB.cmake
@@ -14,19 +14,9 @@
 find_library(GMODULE_LIBRARY NAMES gmodule-2.0 gmodule-2.0-0
              HINTS ${PC_GMODULE_LIBDIR} ${PC_GMODULE_LIBRARY_DIRS})

-if(WIN32)
-  unset(INTL_LIBRARY CACHE)
-  find_library(INTL_LIBRARY NAMES intl intl-8)
-endif()
-
-set(GLIB_LIBRARIES ${GLIB_LIBRARY} ${GTHREAD_LIBRARY} ${GMODULE_LIBRARY} ${INTL_LIBRARY})
+set(GLIB_LIBRARIES ${GLIB_LIBRARY} ${GTHREAD_LIBRARY} ${GMODULE_LIBRARY})
 set(GLIB_INCLUDE_DIRS ${GLIB_INCLUDE_DIR} ${GLIB_LIB_INCLUDE_DIR})

 include(FindPackageHandleStandardArgs)
-if(WIN32)
-  find_package_handle_standard_args(GLIB DEFAULT_MSG GLIB_LIBRARY GTHREAD_LIBRARY GMODULE_LIBRARY INTL_LIBRARY GLIB_INCLUDE_DIR GLIB_LIB_INCLUDE_DIR)
-  mark_as_advanced(GLIB_LIBRARY GTHREAD_LIBRARY GMODULE_LIBRARY INTL_LIBRARY GLIB_INCLUDE_DIR GLIB_LIB_INCLUDE_DIR)
-else()
-  find_package_handle_standard_args(GLIB DEFAULT_MSG GLIB_LIBRARY GTHREAD_LIBRARY GMODULE_LIBRARY GLIB_INCLUDE_DIR GLIB_LIB_INCLUDE_DIR)
-  mark_as_advanced(GLIB_LIBRARY GTHREAD_LIBRARY GMODULE_LIBRARY GLIB_INCLUDE_DIR GLIB_LIB_INCLUDE_DIR)
-endif()
+find_package_handle_standard_args(GLIB DEFAULT_MSG GLIB_LIBRARY GTHREAD_LIBRARY GMODULE_LIBRARY GLIB_INCLUDE_DIR GLIB_LIB_INCLUDE_DIR)
+mark_as_advanced(GLIB_LIBRARY GTHREAD_LIBRARY GMODULE_LIBRARY GLIB_INCLUDE_DIR GLIB_LIB_INCLUDE_DIR)


Strip llvm variables of whitespace

Strip llvm variables of whitespace

llvm-config for llvm 4 seems to cause additional whitespace to appear in
the LLVM_LDFLAGS. As this is an error in CMake we should strip the LLVM
variables we use of their whitespace to avoid problems in the future.

--- cmake/FindLLVM.cmake
+++ cmake/FindLLVM.cmake
@@ -188,6 +188,9 @@
 string(REGEX REPLACE "([0-9]+).*" "\\1" LLVM_VERSION_MAJOR "${LLVM_VERSION_STRING}" )
 string(REGEX REPLACE "[0-9]+\\.([0-9]+).*[A-Za-z]*" "\\1" LLVM_VERSION_MINOR "${LLVM_VERSION_STRING}" )

+string(STRIP "${LLVM_LDFLAGS}" LLVM_LDFLAGS)
+string(STRIP "${LLVM_LIBRARIES}" LLVM_LIBRARIES)
+
 # Use the default CMake facilities for handling QUIET/REQUIRED.
 include(FindPackageHandleStandardArgs)


llvm-config sanity check

llvm-config sanity check

--- cmake/Findllvm.cmake
+++ cmake/Findllvm.cmake
@@ -14,6 +14,15 @@
         "/c/msys64/mingw64/bin"
         "c:/msys64/mingw64/bin"
         "C:/Libraries/llvm-7.0.0/bin")
+
+execute_process(
+	COMMAND ${LLVM_CONFIG_EXE} --version
+	OUTPUT_VARIABLE LLVM_CONFIG_VERSION
+	OUTPUT_STRIP_TRAILING_WHITESPACE)
+
+if(LLVM_CONFIG_VERSION VERSION_LESS 7)
+  message(FATAL_ERROR "expected LLVM version >=7 but found ${LLVM_CONFIG_VERSION}")
+endif()

 if(NOT(CMAKE_BUILD_TYPE STREQUAL "Debug") OR ZIG_STATIC)
   execute_process(


Print the llvm-config path on configuration error

This is helpful on systems with multiple LLVM installations.

For example, OpenBSD ships with LLVM in the base system, but without
support for extra targets.

A full LLVM version can be installed using the ports system, but even
when it is, `cmake` is not going to pick it up unless `/usr/local` is
explicitly added to the `cmake` search paths.

Having the full `llvm-config` path printed on error is helpful to
understand that the detected LLVM version was not the expected one.

--- cmake/Findllvm.cmake
+++ cmake/Findllvm.cmake
@@ -55,13 +55,13 @@
     OUTPUT_STRIP_TRAILING_WHITESPACE)

   if("${LLVM_CONFIG_VERSION}" VERSION_LESS 10)
-    message(FATAL_ERROR "expected LLVM 10.x but found ${LLVM_CONFIG_VERSION}")
+    message(FATAL_ERROR "expected LLVM 10.x but found ${LLVM_CONFIG_VERSION} using ${LLVM_CONFIG_EXE}")
   endif()
   if("${LLVM_CONFIG_VERSION}" VERSION_EQUAL 11)
-    message(FATAL_ERROR "expected LLVM 10.x but found ${LLVM_CONFIG_VERSION}")
+    message(FATAL_ERROR "expected LLVM 10.x but found ${LLVM_CONFIG_VERSION} using ${LLVM_CONFIG_EXE}")
   endif()
   if("${LLVM_CONFIG_VERSION}" VERSION_GREATER 11)
-    message(FATAL_ERROR "expected LLVM 10.x but found ${LLVM_CONFIG_VERSION}")
+    message(FATAL_ERROR "expected LLVM 10.x but found ${LLVM_CONFIG_VERSION} using ${LLVM_CONFIG_EXE}")
   endif()

   execute_process(
@@ -72,7 +72,7 @@
   function(NEED_TARGET TARGET_NAME)
       list (FIND LLVM_TARGETS_BUILT "${TARGET_NAME}" _index)
       if (${_index} EQUAL -1)
-          message(FATAL_ERROR "LLVM is missing target ${TARGET_NAME}. Zig requires LLVM to be built with all default targets enabled.")
+          message(FATAL_ERROR "LLVM (according to ${LLVM_CONFIG_EXE}) is missing target ${TARGET_NAME}. Zig requires LLVM to be built with all default targets enabled.")
       endif()
   endfunction(NEED_TARGET)
   NEED_TARGET("AArch64")


fpta-cmake: move LTO-handling after other CFLAGS preparations.

--- cmake/compiler.cmake
+++ cmake/compiler.cmake
@@ -364,6 +364,108 @@
   set(SHARED_LINKER_FLAGS ${INITIAL_CMAKE_SHARED_LINKER_FLAGS})
   set(STATIC_LINKER_FLAGS ${INITIAL_CMAKE_STATIC_LINKER_FLAGS})
   set(MODULE_LINKER_FLAGS ${INITIAL_CMAKE_MODULE_LINKER_FLAGS})
+
+  if(CC_HAS_FNO_COMMON)
+    add_compile_flags("C;CXX" "-fno-common")
+  endif()
+
+  if(CC_HAS_GGDB)
+    add_compile_flags("C;CXX" "-ggdb")
+  endif()
+
+  if(CC_HAS_WNO_UNKNOWN_PRAGMAS AND NOT HAVE_OPENMP)
+    add_compile_flags("C;CXX" -Wno-unknown-pragmas)
+  endif()
+
+  # We must set -fno-omit-frame-pointer here, since we rely
+  # on frame pointer when getting a backtrace, and it must
+  # be used consistently across all object files.
+  # The same reasoning applies to -fno-stack-protector switch.
+  if(ENABLE_BACKTRACE)
+    if(CC_HAS_FNO_OMIT_FRAME_POINTER)
+      add_compile_flags("C;CXX" "-fno-omit-frame-pointer")
+    endif()
+    if(CC_HAS_FNO_STACK_PROTECTOR)
+      add_compile_flags("C;CXX" "-fno-stack-protector")
+    endif()
+  endif()
+
+  # Set standard
+  if(HAVE_STD_C11)
+    add_compile_flags("C" "-std=c11")
+  elseif(HAVE_STD_GNU99)
+    add_compile_flags("C" "-std=gnu99")
+  elseif(HAVE_STD_C99 AND NOT MSVC)
+    add_compile_flags("C" "-std=c99")
+  endif()
+
+  if(HAVE_STD_CXX11 AND NOT MSVC)
+    add_compile_flags("CXX" "-std=c++11")
+  elseif(HAVE_STD_GNUXX0X)
+    add_compile_flags("CXX" "-std=gnu++0x")
+    add_definitions("-Doverride=")
+  endif()
+
+  if(MSVC)
+    if(MSVC_VERSION EQUAL 1910)
+      # LY: avoid /Wall for Visual Studio 2017, otherwise due a bug we could lost the control
+      #     and get a lot of junk warnings from compiler's and SDK headers.
+      add_compile_flags("C;CXX" "/W4")
+    else()
+      add_compile_flags("C;CXX" "/Wall")
+    endif()
+  elseif(CC_HAS_WALL)
+    add_compile_flags("C;CXX" "-Wall")
+  endif()
+  if(CC_HAS_WEXTRA)
+    add_compile_flags("C;CXX" "-Wextra")
+  endif()
+
+  if(CMAKE_COMPILER_IS_GNUCXX
+      AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5)
+    # G++ bug. http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31488
+    add_compile_flags("CXX" "-Wno-invalid-offsetof")
+  endif()
+
+  add_definitions("-D__STDC_FORMAT_MACROS=1")
+  add_definitions("-D__STDC_LIMIT_MACROS=1")
+  add_definitions("-D__STDC_CONSTANT_MACROS=1")
+  add_definitions("-D_HAS_EXCEPTIONS=0")
+
+  # Only add -Werror if it's a debug build, done by developers.
+  # Release builds should not cause extra trouble.
+  if(CC_HAS_WERROR AND (CI OR CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE STREQUAL "Debug"))
+    if(MSVC)
+      add_compile_flags("C;CXX" "/WX")
+    elseif(HAVE_STD_C11 AND HAVE_STD_CXX11)
+      add_compile_flags("C;CXX" "-Werror")
+    endif()
+  endif()
+
+  if(HAVE_OPENMP)
+    add_compile_flags("C;CXX" "-fopenmp")
+  endif()
+
+  if (ENABLE_ASAN)
+    add_compile_flags("C;CXX" -fsanitize=address)
+  endif()
+
+  if(ENABLE_GCOV)
+    if(NOT HAVE_GCOV)
+      message(FATAL_ERROR
+        "ENABLE_GCOV option requested but gcov library is not found")
+    endif()
+
+    add_compile_flags("C;CXX" "-fprofile-arcs" "-ftest-coverage")
+    set(EXE_LINKER_FLAGS "${EXE_LINKER_FLAGS} -fprofile-arcs -ftest-coverage")
+    set(SHARED_LINKER_FLAGS "${SHARED_LINKER_FLAGS} -fprofile-arcs -ftest-coverage")
+    set(MODULE_LINKER_FLAGS "${MODULE_LINKER_FLAGS} -fprofile-arcs -ftest-coverage")
+    # add_library(gcov SHARED IMPORTED)
+  endif()
+
+  if(ENABLE_GPROF)
+    add_compile_flags("C;CXX" "-pg")
+  endif()

   if(CMAKE_COMPILER_IS_GNUCC AND GCC_LTO_ENABLED)
     add_compile_flags("C;CXX" ${GCC_LTO_CFLAGS})
@@ -429,108 +531,6 @@
     set(MODULE_LINKER_FLAGS "${MODULE_LINKER_FLAGS} -flto -fverbose-asm")
   endif()

-  if(CC_HAS_FNO_COMMON)
-    add_compile_flags("C;CXX" "-fno-common")
-  endif()
-
-  if(CC_HAS_GGDB)
-    add_compile_flags("C;CXX" "-ggdb")
-  endif()
-
-  if(CC_HAS_WNO_UNKNOWN_PRAGMAS AND NOT HAVE_OPENMP)
-    add_compile_flags("C;CXX" -Wno-unknown-pragmas)
-  endif()
-
-  # We must set -fno-omit-frame-pointer here, since we rely
-  # on frame pointer when getting a backtrace, and it must
-  # be used consistently across all object files.
-  # The same reasoning applies to -fno-stack-protector switch.
-  if(ENABLE_BACKTRACE)
-    if(CC_HAS_FNO_OMIT_FRAME_POINTER)
-      add_compile_flags("C;CXX" "-fno-omit-frame-pointer")
-    endif()
-    if(CC_HAS_FNO_STACK_PROTECTOR)
-      add_compile_flags("C;CXX" "-fno-stack-protector")
-    endif()
-  endif()
-
-  # Set standard
-  if(HAVE_STD_C11)
-    add_compile_flags("C" "-std=c11")
-  elseif(HAVE_STD_GNU99)
-    add_compile_flags("C" "-std=gnu99")
-  elseif(HAVE_STD_C99 AND NOT MSVC)
-    add_compile_flags("C" "-std=c99")
-  endif()
-
-  if(HAVE_STD_CXX11 AND NOT MSVC)
-    add_compile_flags("CXX" "-std=c++11")
-  elseif(HAVE_STD_GNUXX0X)
-    add_compile_flags("CXX" "-std=gnu++0x")
-    add_definitions("-Doverride=")
-  endif()
-
-  if(MSVC)
-    if(MSVC_VERSION EQUAL 1910)
-      # LY: avoid /Wall for Visual Studio 2017, otherwise due a bug we could lost the control
-      #     and get a lot of junk warnings from compiler's and SDK headers.
-      add_compile_flags("C;CXX" "/W4")
-    else()
-      add_compile_flags("C;CXX" "/Wall")
-    endif()
-  elseif(CC_HAS_WALL)
-    add_compile_flags("C;CXX" "-Wall")
-  endif()
-  if(CC_HAS_WEXTRA)
-    add_compile_flags("C;CXX" "-Wextra")
-  endif()
-
-  if(CMAKE_COMPILER_IS_GNUCXX
-      AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5)
-    # G++ bug. http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31488
-    add_compile_flags("CXX" "-Wno-invalid-offsetof")
-  endif()
-
-  add_definitions("-D__STDC_FORMAT_MACROS=1")
-  add_definitions("-D__STDC_LIMIT_MACROS=1")
-  add_definitions("-D__STDC_CONSTANT_MACROS=1")
-  add_definitions("-D_HAS_EXCEPTIONS=0")
-
-  # Only add -Werror if it's a debug build, done by developers.
-  # Release builds should not cause extra trouble.
-  if(CC_HAS_WERROR AND (CI OR CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE STREQUAL "Debug"))
-    if(MSVC)
-      add_compile_flags("C;CXX" "/WX")
-    elseif(HAVE_STD_C11 AND HAVE_STD_CXX11)
-      add_compile_flags("C;CXX" "-Werror")
-    endif()
-  endif()
-
-  if(HAVE_OPENMP)
-    add_compile_flags("C;CXX" "-fopenmp")
-  endif()
-
-  if (ENABLE_ASAN)
-    add_compile_flags("C;CXX" -fsanitize=address)
-  endif()
-
-  if(ENABLE_GCOV)
-    if(NOT HAVE_GCOV)
-      message(FATAL_ERROR
-        "ENABLE_GCOV option requested but gcov library is not found")
-    endif()
-
-    add_compile_flags("C;CXX" "-fprofile-arcs" "-ftest-coverage")
-    set(EXE_LINKER_FLAGS "${EXE_LINKER_FLAGS} -fprofile-arcs -ftest-coverage")
-    set(SHARED_LINKER_FLAGS "${SHARED_LINKER_FLAGS} -fprofile-arcs -ftest-coverage")
-    set(MODULE_LINKER_FLAGS "${MODULE_LINKER_FLAGS} -fprofile-arcs -ftest-coverage")
-    # add_library(gcov SHARED IMPORTED)
-  endif()
-
-  if(ENABLE_GPROF)
-    add_compile_flags("C;CXX" "-pg")
-  endif()
-
   # LY: push C/CXX flags into the cache
   set(CMAKE_CXX_FLAGS ${CXX_FLAGS} CACHE STRING "Flags used by the C++ compiler during all build types" FORCE)
   set(CMAKE_C_FLAGS ${C_FLAGS} CACHE STRING "Flags used by the C compiler during all build types" FORCE)


use static link to cppunit for mac if using integration, and dynamic link otherwise

--- cmake/findCUTI.cmake
+++ cmake/findCUTI.cmake
@@ -41,8 +41,13 @@
 	find_package(CppUnit REQUIRED)
 	add_definitions(-DCUTI_USES_CPPUNIT_BACKEND)
 	add_definitions(-DCPPUNIT_DLL)
-	set(CUTI_LIBRARIES_DEBUG ${CPPUNIT_LIBRARIES_DEBUG})
-	set(CUTI_LIBRARIES_RELEASE ${CPPUNIT_LIBRARIES_RELEASE})
+  IF(USE_CUTI_INTEGRATION)
+	  set(CUTI_LIBRARIES_DEBUG ${CPPUNIT_LIBRARIES_DEBUG})
+	  set(CUTI_LIBRARIES_RELEASE ${CPPUNIT_LIBRARIES_RELEASE})
+  ELSE()
+    set(CUTI_LIBRARIES_DEBUG ${CPPUNIT_DYN_LIB_DEBUG})
+	  set(CUTI_LIBRARIES_RELEASE ${CPPUNIT_DYN_LIB_RELEASE})
+  ENDIF()
   include_directories(${CPPUNIT_INCLUDE_DIRS})
 ENDIF(USE_CUTI_INTEGRATION AND WIN32)


cmake: Fix flatzinc install

cmake: Fix flatzinc install

--- cmake/flatzinc.cmake
+++ cmake/flatzinc.cmake
@@ -134,11 +134,11 @@

 # MiniZinc solver configuration
 file(RELATIVE_PATH FZ_REL_INSTALL_BINARY
-  ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATAROOTDIR}/minizinc/solvers
+  ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATADIR}/minizinc/solvers
   ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR}/fz)
 configure_file(
   ortools/flatzinc/ortools.msc.in
-  ortools.msc
+  ${PROJECT_BINARY_DIR}/ortools.msc
   @ONLY)

 # Install rules
@@ -152,7 +152,7 @@
   )

 install(DIRECTORY ortools/flatzinc/mznlib/
-  DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/minizinc/ortools
+  DESTINATION ${CMAKE_INSTALL_DATADIR}/minizinc/ortools
   FILES_MATCHING PATTERN "*.mzn")
-install(FILES ${CMAKE_BINARY_DIR}/ortools.msc
-  DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/minizinc/solvers)
+install(FILES ${PROJECT_BINARY_DIR}/ortools.msc
+  DESTINATION ${CMAKE_INSTALL_DATADIR}/minizinc/solvers)


Changed swig to 3.0.11

Changed swig to 3.0.11

--- cmake/get-swig.cmake
+++ cmake/get-swig.cmake
@@ -7,7 +7,7 @@

 INCLUDE(ExternalProject)

-set(SWIG_VERSION "3.0.10")
+set(SWIG_VERSION "3.0.11")

 # For Windows it's faster to download the pre-compiled development binaries.
 if(WIN32)
@@ -37,4 +37,4 @@
         INSTALL_DIR         ${DEPENDENCY_INSTALL_DIR}/../build-tools/swig
     )

-endif()+endif()


Suppress some librarian warnings for Windows and UWP

--- cmake-toolchains/windows.cmake
+++ cmake-toolchains/windows.cmake
@@ -101,6 +101,13 @@
 set(CMAKE_EXE_LINKER_FLAGS_DEBUG "/DEBUG")
 set(CMAKE_EXE_LINKER_FLAGS_RELEASE "")

+if (FIPS_UWP)
+    # 4264: UWP-specific static linking warnings
+    set(CMAKE_STATIC_LINKER_FLAGS "${CMAKE_STATIC_LINKER_FLAGS} /ignore:4264")
+endif()
+# 4221: warning on empty object files
+set(CMAKE_STATIC_LINKER_FLAGS "${CMAKE_STATIC_LINKER_FLAGS} /ignore:4221")
+
 # update cache variables for cmake gui
 set(CMAKE_CONFIGURATION_TYPES "${CMAKE_CONFIGURATION_TYPES}" CACHE STRING "Config Type" FORCE)
 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}" CACHE STRING "Generic C++ Compiler Flags" FORCE)


Added a PythonInterp check.

Added a PythonInterp check.

Added Boost as a dependency to BoostShared so the build order is set properly.

Updated to a new version of boost that fixes a compile issue with boost python.

--- cmake/BuildExternalBoost.cmake
+++ cmake/BuildExternalBoost.cmake
@@ -15,7 +15,7 @@
 ExternalProject_Add(Boost
 	PREFIX ${VENDOR_PREFIX}
 	GIT_REPOSITORY https://github.com/anhstudios/boost.git
-	GIT_TAG 7b35086
+	GIT_TAG 3960f21
 	UPDATE_COMMAND ""
 	CMAKE_ARGS
 		${boost_lib_args}
@@ -38,8 +38,10 @@
 )

 FIND_PACKAGE(PythonLibs REQUIRED)
+FIND_PACKAGE(PythonInterp REQUIRED)

 ExternalProject_Add(BoostShared
+    DEPENDS Boost
 	PREFIX ${VENDOR_PREFIX}
 	DOWNLOAD_COMMAND ""
 	SOURCE_DIR ${Boost_SOURCEDIR}
@@ -49,10 +51,11 @@
 		-DENABLE_MULTITHREADED:BOOL=ON
     	-DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
 		-DCMAKE_MODULE_PATH:PATH=${CMAKE_CURRENT_SOURCE_DIR}/cmake
-    	-DCMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG:PATH=${Boost_LIBRARYDIR}/lib
-    	-DCMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG:PATH=${Boost_LIBRARYDIR}/lib
-    	-DCMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE:PATH=${Boost_LIBRARYDIR}/lib
-    	-DCMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE:PATH=${Boost_LIBRARYDIR}/lib
+    	-DCMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG:PATH=${Boost_LIBRARYDIR}
+    	-DCMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG:PATH=${Boost_LIBRARYDIR}
+    	-DCMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE:PATH=${Boost_LIBRARYDIR}
+    	-DCMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE:PATH=${Boost_LIBRARYDIR}
+    	-DPYTHON_EXECUTABLE=${PYTHON_EXECUTABLE}
 		-DPYTHON_INCLUDE_PATH=${PYTHON_INCLUDE_DIR}
 		-DPYTHON_LIBRARIES=${PYTHON_LIBRARY}
 		-DPYTHON_DEBUG_LIBRARIES=${PYTHON_DEBUG_LIBRARY}


removed unused code

removed unused code

--- cmake/DefaultConfigTypes.cmake
+++ cmake/DefaultConfigTypes.cmake
@@ -4,10 +4,9 @@
   set_property(CACHE CMAKE_BUILD_TYPE PROPERTY VALUE Release)
 endif()

-set(FOAM_CXX_FLAGS "-std=c++11" CACHE STRING "Foam default CXX flags" FORCE) #-pedantic
-set(CMAKE_CXX_FLAGS_RELEASE "${FOAM_CXX_FLAGS} -O2")
+set(CMAKE_CXX_FLAGS_RELEASE "-std=c++11 -pedantic -O2")
 set(CMAKE_C_FLAGS_RELEASE "-O2")
-set(CMAKE_CXX_FLAGS_DEBUG "${FOAM_CXX_FLAGS} -g")
+set(CMAKE_CXX_FLAGS_DEBUG "-std=c++11 -pedantic -g")
 set(CMAKE_C_FLAGS_DEBUG "-g")
 # Handle some compile flag options
 option(DEBUG_FLAG_GLIBCXX_DEBUG "use gcc flag -D_GLIBCXX_DEBUG when CMAKE_BUILD_TYPE is Debug" OFF)


WIP: workaround for _Complex on Win

WIP: workaround for _Complex on Win

--- cmake/DependenciesConfig.cmake
+++ cmake/DependenciesConfig.cmake
@@ -46,7 +46,7 @@
   find_package(LAPACKE REQUIRED)
   add_definitions(-DEIGEN_USE_BLAS -DEIGEN_USE_LAPACKE)
   # needed because MSVC does not have support for c-type _Complex
-  add_definitions(-DLAPACK_COMPLEX_STRUCTURE=1)
+  add_definitions(-Dlapack_complex_float=std::complex<float> -Dlapack_complex_double=std::complex<double>)
   message(STATUS LAPACK: ${LAPACK_LIBRARIES})
 endmacro(configure_lapack)


Removed the CMake variable caching from the EnableBoostSupport.cmake macro. It was causing all files to be rebuilt every time frensie was reconfigured (clearing the cmake cache somehow I figure).

--- cmake/EnableBoostSupport.cmake
+++ cmake/EnableBoostSupport.cmake
@@ -15,30 +15,7 @@
     SET(Boost_NO_SYSTEM_PATHS ON)

     # Check if boost needs to be found
-    IF(NOT DEFINED BOOST_FOUND)
-      SET(FIND_BOOST TRUE)
-    ELSEIF(NOT ${BOOST_FOUND})
-      SET(FIND_BOOST TRUE)
-    ELSEIF(${BOOST_FOUND})
-      STRING(COMPARE NOTEQUAL "${FOUND_BOOST_LIBS}" "${ARGN}" FIND_BOOST)
-    ENDIF()
-
-    # Find the boost package
-    IF(FIND_BOOST)
-      FIND_PACKAGE(Boost 1.54.0 REQUIRED COMPONENTS ${ARGN})
-
-      # Cache to boost found boolean
-      SET(BOOST_FOUND ON
-	CACHE BOOL "Indicates that boost has been found")
-
-      # Cache the libraries that were found
-      SET(FOUND_BOOST_LIBS "${ARGN}"
-	CACHE STRING "The boost libraries that were found" FORCE)
-
-      # Cache the library names
-      SET(Boost_LIBRARIES ${Boost_LIBRARIES}
-	CACHE STRING "The boost libraries requested" FORCE)
-    ENDIF()
+    FIND_PACKAGE(Boost 1.54.0 REQUIRED COMPONENTS ${ARGN})

     # Set the include paths for Boost
     INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS})


#31 Fix search path for external FFmpeg on Linux for multiarch

--- cmake/Modules/FindFFMPEG.cmake
+++ cmake/Modules/FindFFMPEG.cmake
@@ -71,8 +71,10 @@
         /Library/Frameworks
         /usr/local/lib
         /usr/local/lib64
+	/usr/local/lib/${CMAKE_LIBRARY_ARCHITECTURE}
         /usr/lib
         /usr/lib64
+	/usr/lib/${CMAKE_LIBRARY_ARCHITECTURE}
         /sw/lib
         /opt/local/lib
         /opt/csw/lib


Update FindLibSSH module to the lastest version.

--- cmake/Modules/FindLibSSH.cmake
+++ cmake/Modules/FindLibSSH.cmake
@@ -26,8 +26,10 @@
       /usr/local/include
       /opt/local/include
       /sw/include
+      ${CMAKE_INCLUDE_PATH}
+      ${CMAKE_INSTALL_PREFIX}/include
   )
-
+
   find_library(SSH_LIBRARY
     NAMES
       ssh
@@ -37,11 +39,13 @@
       /usr/local/lib
       /opt/local/lib
       /sw/lib
+      ${CMAKE_LIBRARY_PATH}
+      ${CMAKE_INSTALL_PREFIX}/lib
   )

-  if (SSH_LIBRARY)
+  if (LIBSSH_INCLUDE_DIR AND SSH_LIBRARY)
     set(SSH_FOUND TRUE)
-  endif (SSH_LIBRARY)
+  endif (LIBSSH_INCLUDE_DIR AND SSH_LIBRARY)

   set(LIBSSH_INCLUDE_DIRS
     ${LIBSSH_INCLUDE_DIR}
@@ -56,23 +60,34 @@
     if (LibSSH_FIND_VERSION)
       file(STRINGS ${LIBSSH_INCLUDE_DIR}/libssh/libssh.h LIBSSH_VERSION_MAJOR
         REGEX "#define[ ]+LIBSSH_VERSION_MAJOR[ ]+[0-9]+")
-      string(REGEX MATCH "[0-9]+" LIBSSH_VERSION_MAJOR ${LIBSSH_VERSION_MAJOR})
-      file(STRINGS ${LIBSSH_INCLUDE_DIR}/libssh/libssh.h LIBSSH_VERSION_MINOR
-        REGEX "#define[ ]+LIBSSH_VERSION_MINOR[ ]+[0-9]+")
-      string(REGEX MATCH "[0-9]+" LIBSSH_VERSION_MINOR ${LIBSSH_VERSION_MINOR})
-      file(STRINGS ${LIBSSH_INCLUDE_DIR}/libssh/libssh.h LIBSSH_VERSION_PATCH
-        REGEX "#define[ ]+LIBSSH_VERSION_MICRO[ ]+[0-9]+")
-      string(REGEX MATCH "[0-9]+" LIBSSH_VERSION_PATCH ${LIBSSH_VERSION_PATCH})
+      # Older versions of libssh like libssh-0.2 have LIBSSH_VERSION but not LIBSSH_VERSION_MAJOR
+      if (LIBSSH_VERSION_MAJOR)
+        string(REGEX MATCH "[0-9]+" LIBSSH_VERSION_MAJOR ${LIBSSH_VERSION_MAJOR})
+	file(STRINGS ${LIBSSH_INCLUDE_DIR}/libssh/libssh.h LIBSSH_VERSION_MINOR
+          REGEX "#define[ ]+LIBSSH_VERSION_MINOR[ ]+[0-9]+")
+	string(REGEX MATCH "[0-9]+" LIBSSH_VERSION_MINOR ${LIBSSH_VERSION_MINOR})
+	file(STRINGS ${LIBSSH_INCLUDE_DIR}/libssh/libssh.h LIBSSH_VERSION_PATCH
+          REGEX "#define[ ]+LIBSSH_VERSION_MICRO[ ]+[0-9]+")
+	string(REGEX MATCH "[0-9]+" LIBSSH_VERSION_PATCH ${LIBSSH_VERSION_PATCH})

-      set(LibSSH_VERSION ${LIBSSH_VERSION_MAJOR}.${LIBSSH_VERSION_MINOR}.${LIBSSH_VERSION_PATCH})
+	set(LibSSH_VERSION ${LIBSSH_VERSION_MAJOR}.${LIBSSH_VERSION_MINOR}.${LIBSSH_VERSION_PATCH})

-      include(FindPackageVersionCheck)
-      find_package_version_check(LibSSH DEFAULT_MSG)
+	include(FindPackageVersionCheck)
+	find_package_version_check(LibSSH DEFAULT_MSG)
+      else (LIBSSH_VERSION_MAJOR)
+        message(STATUS "LIBSSH_VERSION_MAJOR not found in ${LIBSSH_INCLUDE_DIR}/libssh/libssh.h, assuming libssh is too old")
+        set(LIBSSH_FOUND FALSE)
+      endif (LIBSSH_VERSION_MAJOR)
     endif (LibSSH_FIND_VERSION)
   endif (SSH_FOUND)

-  include(FindPackageHandleStandardArgs)
-  find_package_handle_standard_args(LibSSH DEFAULT_MSG LIBSSH_LIBRARIES LIBSSH_INCLUDE_DIRS)
+  # If the version is too old, but libs and includes are set,
+  # find_package_handle_standard_args will set LIBSSH_FOUND to TRUE again,
+  # so we need this if() here.
+  if (LIBSSH_FOUND)
+    include(FindPackageHandleStandardArgs)
+    find_package_handle_standard_args(LibSSH DEFAULT_MSG LIBSSH_LIBRARIES LIBSSH_INCLUDE_DIRS)
+  endif (LIBSSH_FOUND)

   # show the LIBSSH_INCLUDE_DIRS and LIBSSH_LIBRARIES variables only in the advanced view
   mark_as_advanced(LIBSSH_INCLUDE_DIRS LIBSSH_LIBRARIES)


Use compiler default instead of setting BIT_ENVIRONMENT

This is a necessary step to resolve ROOT-7397.

--- cmake/modules/SetUpLinux.cmake
+++ cmake/modules/SetUpLinux.cmake
@@ -3,7 +3,6 @@

 if(CMAKE_SYSTEM_PROCESSOR MATCHES x86_64)
   message(STATUS "Found a 64bit system")
-  set(BIT_ENVIRONMENT "-m64")
   if(CMAKE_COMPILER_IS_GNUCXX)
     message(STATUS "Found GNU compiler collection")
     set(ROOT_ARCHITECTURE linuxx8664gcc)
@@ -50,7 +49,6 @@
   endif()
 elseif(CMAKE_SYSTEM_PROCESSOR MATCHES s390x)
   message(STATUS "Found a 64bit system")
-  set(BIT_ENVIRONMENT "-m64")
   if(CMAKE_COMPILER_IS_GNUCXX)
     message(STATUS "Found GNU compiler collection")
     set(ROOT_ARCHITECTURE linuxs390xgcc)
@@ -62,7 +60,6 @@
   endif()
 elseif(CMAKE_SYSTEM_PROCESSOR MATCHES s390)
   message(STATUS "Found a 31bit system")
-  set(BIT_ENVIRONMENT "-m31")
   if(CMAKE_COMPILER_IS_GNUCXX)
     message(STATUS "Found GNU compiler collection")
     set(ROOT_ARCHITECTURE linuxs390gcc)
@@ -74,7 +71,6 @@
   endif()
 else()
   message(STATUS "Found a 32bit system")
-  set(BIT_ENVIRONMENT "-m32")
   set(FP_MATH_FLAGS "-msse -mfpmath=sse")
   if(CMAKE_COMPILER_IS_GNUCXX)
     message(STATUS "Found GNU compiler collection")
@@ -98,9 +94,9 @@
 set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -rdynamic")

 if(CMAKE_COMPILER_IS_GNUCXX)
-  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pipe ${BIT_ENVIRONMENT} ${FP_MATH_FLAGS} -Wshadow -Wall -W -Woverloaded-virtual -fsigned-char")
-  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pipe ${BIT_ENVIRONMENT} -Wall -W")
-  set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} ${BIT_ENVIRONMENT} -std=legacy")
+  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pipe ${FP_MATH_FLAGS} -Wshadow -Wall -W -Woverloaded-virtual -fsigned-char")
+  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pipe -Wall -W")
+  set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -std=legacy")

   set(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS}")
   set(CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS "${CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS}")
@@ -120,9 +116,9 @@
   set(CMAKE_C_FLAGS_DEBUGFULL        "-g3 -fno-inline")
   set(CMAKE_C_FLAGS_PROFILE          "-g3 -fno-inline -ftest-coverage -fprofile-arcs")
 elseif(CMAKE_CXX_COMPILER_ID STREQUAL Clang)
-  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pipe ${BIT_ENVIRONMENT} ${FP_MATH_FLAGS} -Wall -W -Woverloaded-virtual -fsigned-char")
-  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pipe ${BIT_ENVIRONMENT} -Wall -W")
-  set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} ${BIT_ENVIRONMENT} -std=legacy")
+  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pipe ${FP_MATH_FLAGS} -Wall -W -Woverloaded-virtual -fsigned-char")
+  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pipe -Wall -W")
+  set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -std=legacy")

   if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 8)
     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wshadow")
@@ -166,9 +162,9 @@
   endif()

   if(ICC_MAJOR GREATER 11 OR ICC_MAJOR EQUAL 11)
-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${BIT_ENVIRONMENT} -wd279")
-    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${BIT_ENVIRONMENT} -wd279")
-    set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${BIT_ENVIRONMENT} -Wl,--no-undefined")
+    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -wd279")
+    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -wd279")
+    set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined")
   endif()

   if(ICC_MAJOR GREATER 14 OR ICC_MAJOR EQUAL 14)


Set BUILD_LIBRARY_FOR_DISTRIBUTION to YES for iOS static library

--- platforms/ios/config.cmake
+++ platforms/ios/config.cmake
@@ -224,6 +224,8 @@
   XCODE_ATTRIBUTE_GCC_TREAT_WARNINGS_AS_ERRORS "YES"
   # Generate dsym for all build types to ensure symbols are available in profiling.
   XCODE_ATTRIBUTE_GCC_GENERATE_DEBUGGING_SYMBOLS "YES"
+  # Ensure that archives are built for distribution.
+  XCODE_ATTRIBUTE_BUILD_LIBRARY_FOR_DISTRIBUTION "YES"
 )

 # Copy the framework headers into a directory in the build folder, for use by


Removed default path (#109)

Removed default path (#109)

--- src/cmake/pxr_deps.cmake
+++ src/cmake/pxr_deps.cmake
@@ -145,7 +145,6 @@
 find_library(TIFF_LIB
         NAMES tiff
         PATHS ${USD_LIB}
-        NO_DEFAULT_PATH
         REQUIRED
         )

@@ -156,7 +155,6 @@
 find_library(PNG_LIB
         NAMES png
         PATHS ${USD_LIB}
-        NO_DEFAULT_PATH
         REQUIRED
         )

@@ -222,7 +220,6 @@
 find_library(JPEG_LIB
         NAMES jpeg
         PATHS ${USD_LIB}
-        NO_DEFAULT_PATH
         REQUIRED
         )


disable building of clang-format on Solaris

--- projects/clangformat.cmake
+++ projects/clangformat.cmake
@@ -15,13 +15,14 @@
   if(NOT (XP_DEFAULT OR XP_PRO_LLVM))
     return()
   endif()
+  if(${CMAKE_SYSTE_NAME} STREQUAL "SunOS")
+    return() # we don't build clang-format on Solaris
+    # at first we didn't have the right version of python
+    # but even after getting python 2.7, we had linker errors
+  endif()
   find_package(PythonInterp 2.7)
   if(NOT PYTHONINTERP_FOUND)
-    if(NOT ${CMAKE_SYSTEM_NAME} STREQUAL "SunOS")
-      # we don't expect to build clang-format on Solaris
-      # so only show this message on non-Solaris systems
-      message(AUTHOR_WARNING "Unable to build clang-format, required python not found")
-    endif()
+    message(AUTHOR_WARNING "Unable to build clang-format, required python not found")
     return()
   endif()
   set(XP_DEPS llvm clang)


[Build] The Git-related macro no longer stops with an error when the build occurs in a non-Git directory.

--- config/FindGit.cmake
+++ config/FindGit.cmake
@@ -14,7 +14,7 @@
       OUTPUT_VARIABLE ${prefix}_WC_REVISION_HASH
       OUTPUT_STRIP_TRAILING_WHITESPACE)
     if (NOT ${Git_error} EQUAL 0)
-      message (SEND_ERROR
+      message (STATUS
 	"Command \"${Git_EXECUTBALE} rev-list -n 1 HEAD\" in directory ${dir} failed with output:\n${Git_error}")
     else (NOT ${Git_error} EQUAL 0)
       execute_process (COMMAND ${Git_EXECUTABLE}


[Config] Upgraed the ICU CMake module

[Config] Upgraed the ICU CMake module

--- config/FindICU.cmake
+++ config/FindICU.cmake
@@ -1,392 +1,438 @@
-# This module can find the International Components for Unicode (ICU) Library
-#
-# Requirements:
-# - CMake >= 2.8.3 (for new version of find_package_handle_standard_args)
-#
-# The following variables will be defined for your use:
-#   - ICU_FOUND             : were all of your specified components found
-#                             (include dependencies)?
-#   - ICU_INCLUDE_DIRS      : ICU include directory
-#   - ICU_LIBRARIES         : ICU libraries
-#   - ICU_VERSION           : complete version of ICU (x.y.z)
-#   - ICU_MAJOR_VERSION     : major version of ICU
-#   - ICU_MINOR_VERSION     : minor version of ICU
-#   - ICU_PATCH_VERSION     : patch version of ICU
-#   - ICU_<COMPONENT>_FOUND : were <COMPONENT> found? (FALSE for non specified
-#                             component if it is not a dependency)
-#
-# For windows or non standard installation, define ICU_ROOT variable to point
-# to the root installation of ICU. Two ways:
-#   - run cmake with -DICU_ROOT=<PATH>
-#   - define an environment variable with the same name before running cmake
-# With cmake-gui, before pressing "Configure":
-#   1) Press "Add Entry" button
-#   2) Add a new entry defined as:
-#     - Name: ICU_ROOT
-#     - Type: choose PATH in the selection list
-#     - Press "..." button and select the root installation of ICU
-#
-# Example Usage:
-#
-#   1. Copy this file in the root of your project source directory
-#   2. Then, tell CMake to search this non-standard module in your project
-#      directory by adding to your CMakeLists.txt:
-#     set (CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR})
-#   3. Finally call find_package() once, here are some examples to pick from
-#
-#   Require ICU 4.4 or later
-#     set (ICU_REQUIRED_COMPONENTS i18n)
-#     find_package (ICU 4.4 COMPONENTS ${ICU_REQUIRED_COMPONENTS} REQUIRED)
-#
-#   if (ICU_FOUND)
-#      include_directories (${ICU_INCLUDE_DIRS})
-#      add_executable (myapp myapp.c)
-#      target_link_libraries (myapp ${ICU_LIBRARIES})
-#   endif (ICU_FOUND)
-
-#=============================================================================
-# Copyright (c) 2011-2012, julp
-#
-# Distributed under the OSI-approved BSD License
-#
-# This software is distributed WITHOUT ANY WARRANTY; without even the
-# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-#=============================================================================
-
-find_package (PkgConfig QUIET)
-
-########## Private ##########
-# Prefix for all ICU relative public variables
-set (ICU_PUBLIC_VAR_NS "ICU")
-# Prefix for all ICU relative internal variables
-set (ICU_PRIVATE_VAR_NS "_${ICU_PUBLIC_VAR_NS}")
-# Prefix for all pkg-config relative internal variables
-set (PC_ICU_PRIVATE_VAR_NS "_PC${ICU_PRIVATE_VAR_NS}")
-
-#
-function (icudebug _VARNAME)
-  if (${ICU_PUBLIC_VAR_NS}_DEBUG)
-    if (DEFINED ${ICU_PUBLIC_VAR_NS}_${_VARNAME})
-      message ("${ICU_PUBLIC_VAR_NS}_${_VARNAME} = ${${ICU_PUBLIC_VAR_NS}_${_VARNAME}}")
-    else (DEFINED ${ICU_PUBLIC_VAR_NS}_${_VARNAME})
-      message ("${ICU_PUBLIC_VAR_NS}_${_VARNAME} = <UNDEFINED>")
-    endif (DEFINED ${ICU_PUBLIC_VAR_NS}_${_VARNAME})
-  endif (${ICU_PUBLIC_VAR_NS}_DEBUG)
-endfunction (icudebug)
-
-#
-set (${ICU_PRIVATE_VAR_NS}_ROOT "")
-if (DEFINED ENV{ICU_ROOT})
-  set (${ICU_PRIVATE_VAR_NS}_ROOT "$ENV{ICU_ROOT}")
-endif (DEFINED ENV{ICU_ROOT})
-if (DEFINED ICU_ROOT)
-  set (${ICU_PRIVATE_VAR_NS}_ROOT "${ICU_ROOT}")
-endif (DEFINED ICU_ROOT)
-
-set (${ICU_PRIVATE_VAR_NS}_BIN_SUFFIXES)
-set (${ICU_PRIVATE_VAR_NS}_LIB_SUFFIXES)
-if (CMAKE_SIZEOF_VOID_P EQUAL 8)
-  list (APPEND ${ICU_PRIVATE_VAR_NS}_BIN_SUFFIXES "bin64")
-  list (APPEND ${ICU_PRIVATE_VAR_NS}_LIB_SUFFIXES "lib64")
-endif (CMAKE_SIZEOF_VOID_P EQUAL 8)
-list (APPEND ${ICU_PRIVATE_VAR_NS}_BIN_SUFFIXES "bin")
-list (APPEND ${ICU_PRIVATE_VAR_NS}_LIB_SUFFIXES "lib")
-
-set (${ICU_PRIVATE_VAR_NS}_COMPONENTS)
-
-# <icu component name> <library name 1> ... <library name N>
-macro (icu_declare_component _NAME)
-  list (APPEND ${ICU_PRIVATE_VAR_NS}_COMPONENTS ${_NAME})
-  set ("${ICU_PRIVATE_VAR_NS}_COMPONENTS_${_NAME}" ${ARGN})
-endmacro (icu_declare_component)
-
-icu_declare_component (data icudata)
-icu_declare_component (uc   icuuc)         # Common and Data libraries
-icu_declare_component (i18n icui18n icuin) # Internationalization library
-icu_declare_component (io   icuio ustdio)  # Stream and I/O Library
-icu_declare_component (le   icule)         # Layout library
-icu_declare_component (lx   iculx)         # Paragraph Layout library
-
-########## Public ##########
-set (${ICU_PUBLIC_VAR_NS}_FOUND TRUE)
-set (${ICU_PUBLIC_VAR_NS}_LIBRARIES )
-set (${ICU_PUBLIC_VAR_NS}_INCLUDE_DIRS )
-set (${ICU_PUBLIC_VAR_NS}_DEFINITIONS )
-foreach (${ICU_PRIVATE_VAR_NS}_COMPONENT ${${ICU_PRIVATE_VAR_NS}_COMPONENTS})
-  string (TOUPPER "${${ICU_PRIVATE_VAR_NS}_COMPONENT}"
-	${ICU_PRIVATE_VAR_NS}_UPPER_COMPONENT)
-  # May be done in the icu_declare_component macro
-  set ("${ICU_PUBLIC_VAR_NS}_${${ICU_PRIVATE_VAR_NS}_UPPER_COMPONENT}_FOUND"
-	FALSE)
-endforeach (${ICU_PRIVATE_VAR_NS}_COMPONENT)
-
-# Check components
-if (NOT ${ICU_PUBLIC_VAR_NS}_FIND_COMPONENTS) # uc required at least
-  set (${ICU_PUBLIC_VAR_NS}_FIND_COMPONENTS uc)
-
-else (NOT ${ICU_PUBLIC_VAR_NS}_FIND_COMPONENTS)
-  list (APPEND ${ICU_PUBLIC_VAR_NS}_FIND_COMPONENTS uc)
-  list (REMOVE_DUPLICATES ${ICU_PUBLIC_VAR_NS}_FIND_COMPONENTS)
-
-  foreach (${ICU_PRIVATE_VAR_NS}_COMPONENT
-	  ${${ICU_PUBLIC_VAR_NS}_FIND_COMPONENTS})
-    if (NOT DEFINED
-		${ICU_PRIVATE_VAR_NS}_COMPONENTS_${${ICU_PRIVATE_VAR_NS}_COMPONENT})
-      message (FATAL_ERROR
-		"Unknown ICU component: ${${ICU_PRIVATE_VAR_NS}_COMPONENT}")
-    endif (NOT DEFINED
-	  ${ICU_PRIVATE_VAR_NS}_COMPONENTS_${${ICU_PRIVATE_VAR_NS}_COMPONENT})
-  endforeach (${ICU_PRIVATE_VAR_NS}_COMPONENT)
-endif (NOT ${ICU_PUBLIC_VAR_NS}_FIND_COMPONENTS)
-
-# Includes
-find_path (
-  ${ICU_PUBLIC_VAR_NS}_INCLUDE_DIRS
-  NAMES unicode/utypes.h utypes.h
-  HINTS ${${ICU_PRIVATE_VAR_NS}_ROOT}
-  PATH_SUFFIXES "include"
-  DOC "Include directories for ICU"
-)
-
-if (${ICU_PUBLIC_VAR_NS}_INCLUDE_DIRS)
-  ########## <part to keep synced with tests/version/CMakeLists.txt> ##########
-  if (EXISTS "${${ICU_PUBLIC_VAR_NS}_INCLUDE_DIRS}/unicode/uvernum.h")
-	# ICU >= 4
-    file (READ "${${ICU_PUBLIC_VAR_NS}_INCLUDE_DIRS}/unicode/uvernum.h"
-	  ${ICU_PRIVATE_VAR_NS}_VERSION_HEADER_CONTENTS)
-  elseif (EXISTS "${${ICU_PUBLIC_VAR_NS}_INCLUDE_DIRS}/unicode/uversion.h")
-	# ICU [2;4[
-    file (READ "${${ICU_PUBLIC_VAR_NS}_INCLUDE_DIRS}/unicode/uversion.h"
-	  ${ICU_PRIVATE_VAR_NS}_VERSION_HEADER_CONTENTS)
-  elseif (EXISTS "${${ICU_PUBLIC_VAR_NS}_INCLUDE_DIRS}/unicode/utypes.h")
-	# ICU [1.4;2[
-    file (READ "${${ICU_PUBLIC_VAR_NS}_INCLUDE_DIRS}/unicode/utypes.h"
-	  ${ICU_PRIVATE_VAR_NS}_VERSION_HEADER_CONTENTS)
-  elseif (EXISTS "${${ICU_PUBLIC_VAR_NS}_INCLUDE_DIRS}/utypes.h")
-	# ICU 1.3
-    file (READ "${${ICU_PUBLIC_VAR_NS}_INCLUDE_DIRS}/utypes.h"
-	  ${ICU_PRIVATE_VAR_NS}_VERSION_HEADER_CONTENTS)
+# Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
+# file Copyright.txt or https://cmake.org/licensing for details.
+
+#[=======================================================================[.rst:
+FindICU
+-------
+
+.. versionadded:: 3.7
+
+Find the International Components for Unicode (ICU) libraries and
+programs.
+
+This module supports multiple components.
+Components can include any of: ``data``, ``i18n``, ``io``, ``le``,
+``lx``, ``test``, ``tu`` and ``uc``.
+
+Note that on Windows ``data`` is named ``dt`` and ``i18n`` is named
+``in``; any of the names may be used, and the appropriate
+platform-specific library name will be automatically selected.
+
+.. versionadded:: 3.11
+  Added support for static libraries on Windows.
+
+This module reports information about the ICU installation in
+several variables.  General variables::
+
+  ICU_VERSION - ICU release version
+  ICU_FOUND - true if the main programs and libraries were found
+  ICU_LIBRARIES - component libraries to be linked
+  ICU_INCLUDE_DIRS - the directories containing the ICU headers
+
+Imported targets::
+
+  ICU::<C>
+
+Where ``<C>`` is the name of an ICU component, for example
+``ICU::i18n``; ``<C>`` is lower-case.
+
+ICU programs are reported in::
+
+  ICU_GENCNVAL_EXECUTABLE - path to gencnval executable
+  ICU_ICUINFO_EXECUTABLE - path to icuinfo executable
+  ICU_GENBRK_EXECUTABLE - path to genbrk executable
+  ICU_ICU-CONFIG_EXECUTABLE - path to icu-config executable
+  ICU_GENRB_EXECUTABLE - path to genrb executable
+  ICU_GENDICT_EXECUTABLE - path to gendict executable
+  ICU_DERB_EXECUTABLE - path to derb executable
+  ICU_PKGDATA_EXECUTABLE - path to pkgdata executable
+  ICU_UCONV_EXECUTABLE - path to uconv executable
+  ICU_GENCFU_EXECUTABLE - path to gencfu executable
+  ICU_MAKECONV_EXECUTABLE - path to makeconv executable
+  ICU_GENNORM2_EXECUTABLE - path to gennorm2 executable
+  ICU_GENCCODE_EXECUTABLE - path to genccode executable
+  ICU_GENSPREP_EXECUTABLE - path to gensprep executable
+  ICU_ICUPKG_EXECUTABLE - path to icupkg executable
+  ICU_GENCMN_EXECUTABLE - path to gencmn executable
+
+ICU component libraries are reported in::
+
+  ICU_<C>_FOUND - ON if component was found; ``<C>`` is upper-case.
+  ICU_<C>_LIBRARIES - libraries for component; ``<C>`` is upper-case.
+
+ICU datafiles are reported in::
+
+  ICU_MAKEFILE_INC - Makefile.inc
+  ICU_PKGDATA_INC - pkgdata.inc
+
+This module reads hints about search results from::
+
+  ICU_ROOT - the root of the ICU installation
+
+The environment variable ``ICU_ROOT`` may also be used; the
+ICU_ROOT variable takes precedence.
+
+The following cache variables may also be set::
+
+  ICU_<P>_EXECUTABLE - the path to executable <P>; ``<P>`` is upper-case.
+  ICU_INCLUDE_DIR - the directory containing the ICU headers
+  ICU_<C>_LIBRARY - the library for component <C>; ``<C>`` is upper-case.
+
+.. note::
+
+  In most cases none of the above variables will require setting,
+  unless multiple ICU versions are available and a specific version
+  is required.
+
+Other variables one may set to control this module are::
+
+  ICU_DEBUG - Set to ON to enable debug output from FindICU.
+#]=======================================================================]
+
+# Written by Roger Leigh <rleigh@codelibre.net>
+
+set(icu_programs
+  gencnval
+  icuinfo
+  genbrk
+  icu-config
+  genrb
+  gendict
+  derb
+  pkgdata
+  uconv
+  gencfu
+  makeconv
+  gennorm2
+  genccode
+  gensprep
+  icupkg
+  gencmn)
+
+set(icu_data
+  Makefile.inc
+  pkgdata.inc)
+
+# The ICU checks are contained in a function due to the large number
+# of temporary variables needed.
+function(_ICU_FIND)
+  # Set up search paths, taking compiler into account.  Search ICU_ROOT,
+  # with ICU_ROOT in the environment as a fallback if unset.
+  if(ICU_ROOT)
+    list(APPEND icu_roots "${ICU_ROOT}")
   else()
-    message(FATAL_ERROR "ICU version header not found")
-  endif()
-
-  if (${ICU_PRIVATE_VAR_NS}_VERSION_HEADER_CONTENTS
-	  MATCHES ".*# *define *ICU_VERSION *\"([0-9]+)\".*")
-	# ICU 1.3
-    # [1.3;1.4[ as #define ICU_VERSION "3" (no patch version,
-	# ie all 1.3.X versions will be detected as 1.3.0)
-    set (${ICU_PUBLIC_VAR_NS}_MAJOR_VERSION "1")
-    set (${ICU_PUBLIC_VAR_NS}_MINOR_VERSION "${CMAKE_MATCH_1}")
-    set (${ICU_PUBLIC_VAR_NS}_PATCH_VERSION "0")
-
-  elseif (${ICU_PRIVATE_VAR_NS}_VERSION_HEADER_CONTENTS
-	  MATCHES ".*# *define *U_ICU_VERSION_MAJOR_NUM *([0-9]+).*")
-    set (${ICU_PUBLIC_VAR_NS}_MAJOR_VERSION "${CMAKE_MATCH_1}")
-    #
-    # Since version 4.9.1, ICU release version numbering was totaly changed, see:
-    # - http://site.icu-project.org/download/49
-    # - http://userguide.icu-project.org/design#TOC-Version-Numbers-in-ICU
-    #
-    if (${ICU_PUBLIC_VAR_NS}_MAJOR_VERSION LESS 49)
-      string (REGEX REPLACE
-		".*# *define *U_ICU_VERSION_MINOR_NUM *([0-9]+).*" "\\1"
-		${ICU_PUBLIC_VAR_NS}_MINOR_VERSION
-		"${${ICU_PRIVATE_VAR_NS}_VERSION_HEADER_CONTENTS}")
-
-      string (REGEX REPLACE
-		".*# *define *U_ICU_VERSION_PATCHLEVEL_NUM *([0-9]+).*" "\\1"
-		${ICU_PUBLIC_VAR_NS}_PATCH_VERSION
-		"${${ICU_PRIVATE_VAR_NS}_VERSION_HEADER_CONTENTS}")
-
-    else (${ICU_PUBLIC_VAR_NS}_MAJOR_VERSION LESS 49)
-      string (REGEX MATCH [0-9]$ ${ICU_PUBLIC_VAR_NS}_MINOR_VERSION
-		"${${ICU_PUBLIC_VAR_NS}_MAJOR_VERSION}")
-      string (REGEX REPLACE [0-9]$ "" ${ICU_PUBLIC_VAR_NS}_MAJOR_VERSION
-		"${${ICU_PUBLIC_VAR_NS}_MAJOR_VERSION}")
-      string (REGEX REPLACE
-		".*# *define *U_ICU_VERSION_MINOR_NUM *([0-9]+).*" "\\1"
-		${ICU_PUBLIC_VAR_NS}_PATCH_VERSION
-		"${${ICU_PRIVATE_VAR_NS}_VERSION_HEADER_CONTENTS}")
-    endif (${ICU_PUBLIC_VAR_NS}_MAJOR_VERSION LESS 49)
-
-  elseif (${ICU_PRIVATE_VAR_NS}_VERSION_HEADER_CONTENTS
-	  MATCHES ".*# *define *U_ICU_VERSION *\"(([0-9]+)(\\.[0-9]+)*)\".*")
-	# ICU [1.4;1.8[
-    # [1.4;1.8[ as #define U_ICU_VERSION "1.4.1.2" but it seems that some
-	# 1.4.1(?:\.\d)? have releasing error and appears as 1.4.0
-    set (${ICU_PRIVATE_VAR_NS}_FULL_VERSION "${CMAKE_MATCH_1}")
-
-	# Copy CMAKE_MATCH_1, no longer valid on the following if
-    if (${ICU_PRIVATE_VAR_NS}_FULL_VERSION MATCHES "^([0-9]+)\\.([0-9]+)$")
-      set (${ICU_PUBLIC_VAR_NS}_MAJOR_VERSION "${CMAKE_MATCH_1}")
-      set (${ICU_PUBLIC_VAR_NS}_MINOR_VERSION "${CMAKE_MATCH_2}")
-      set (${ICU_PUBLIC_VAR_NS}_PATCH_VERSION "0")
-
-    elseif (${ICU_PRIVATE_VAR_NS}_FULL_VERSION
-		MATCHES "^([0-9]+)\\.([0-9]+)\\.([0-9]+)")
-      set (${ICU_PUBLIC_VAR_NS}_MAJOR_VERSION "${CMAKE_MATCH_1}")
-      set (${ICU_PUBLIC_VAR_NS}_MINOR_VERSION "${CMAKE_MATCH_2}")
-      set (${ICU_PUBLIC_VAR_NS}_PATCH_VERSION "${CMAKE_MATCH_3}")
-    endif()
-
-  else()
-    message (FATAL_ERROR "failed to detect ICU version")
-  endif()
-
-  set (${ICU_PUBLIC_VAR_NS}_VERSION
-	"${${ICU_PUBLIC_VAR_NS}_MAJOR_VERSION}.${${ICU_PUBLIC_VAR_NS}_MINOR_VERSION}.${${ICU_PUBLIC_VAR_NS}_PATCH_VERSION}")
-  ########## </part to keep synced with tests/version/CMakeLists.txt> ##########
-
-  # Check dependencies (implies pkg-config)
-  if (PKG_CONFIG_FOUND)
-    set (${ICU_PRIVATE_VAR_NS}_COMPONENTS_DUP
-	  ${${ICU_PUBLIC_VAR_NS}_FIND_COMPONENTS})
-    foreach (${ICU_PRIVATE_VAR_NS}_COMPONENT
-		${${ICU_PRIVATE_VAR_NS}_COMPONENTS_DUP})
-      pkg_check_modules (PC_ICU_PRIVATE_VAR_NS
-		"icu-${${ICU_PRIVATE_VAR_NS}_COMPONENT}" QUIET)
-
-      if (${PC_ICU_PRIVATE_VAR_NS}_FOUND)
-        foreach (${PC_ICU_PRIVATE_VAR_NS}_LIBRARY ${PC_ICU_LIBRARIES})
-          string (REGEX REPLACE "^icu" ""
-			${PC_ICU_PRIVATE_VAR_NS}_STRIPPED_LIBRARY
-			${${PC_ICU_PRIVATE_VAR_NS}_LIBRARY})
-          list (APPEND ${ICU_PUBLIC_VAR_NS}_FIND_COMPONENTS
-			${${PC_ICU_PRIVATE_VAR_NS}_STRIPPED_LIBRARY})
-        endforeach (${PC_ICU_PRIVATE_VAR_NS}_LIBRARY)
-      endif (${PC_ICU_PRIVATE_VAR_NS}_FOUND)
-    endforeach (${ICU_PRIVATE_VAR_NS}_COMPONENT)
-
-    list (REMOVE_DUPLICATES ${ICU_PUBLIC_VAR_NS}_FIND_COMPONENTS)
-  endif (PKG_CONFIG_FOUND)
-
-  # Check libraries
-  foreach (${ICU_PRIVATE_VAR_NS}_COMPONENT
-	  ${${ICU_PUBLIC_VAR_NS}_FIND_COMPONENTS})
-    set (${ICU_PRIVATE_VAR_NS}_POSSIBLE_RELEASE_NAMES )
-    set (${ICU_PRIVATE_VAR_NS}_POSSIBLE_DEBUG_NAMES )
-
-    foreach (${ICU_PRIVATE_VAR_NS}_BASE_NAME
-		${${ICU_PRIVATE_VAR_NS}_COMPONENTS_${${ICU_PRIVATE_VAR_NS}_COMPONENT}})
-      list (APPEND ${ICU_PRIVATE_VAR_NS}_POSSIBLE_RELEASE_NAMES
-		"${${ICU_PRIVATE_VAR_NS}_BASE_NAME}")
-      list (APPEND ${ICU_PRIVATE_VAR_NS}_POSSIBLE_DEBUG_NAMES
-		"${${ICU_PRIVATE_VAR_NS}_BASE_NAME}d")
-      list (APPEND ${ICU_PRIVATE_VAR_NS}_POSSIBLE_RELEASE_NAMES
-		"${${ICU_PRIVATE_VAR_NS}_BASE_NAME}${ICU_MAJOR_VERSION}${ICU_MINOR_VERSION}")
-      list (APPEND ${ICU_PRIVATE_VAR_NS}_POSSIBLE_DEBUG_NAMES
-		"${${ICU_PRIVATE_VAR_NS}_BASE_NAME}${ICU_MAJOR_VERSION}${ICU_MINOR_VERSION}d")
-    endforeach (${ICU_PRIVATE_VAR_NS}_BASE_NAME)
-
-    find_library (
-      ${ICU_PRIVATE_VAR_NS}_LIB_RELEASE_${${ICU_PRIVATE_VAR_NS}_COMPONENT}
-      NAMES ${${ICU_PRIVATE_VAR_NS}_POSSIBLE_RELEASE_NAMES}
-      HINTS ${${ICU_PRIVATE_VAR_NS}_ROOT}
-      PATH_SUFFIXES ${_ICU_LIB_SUFFIXES}
-      DOC "Release libraries for ICU"
+    if(NOT "$ENV{ICU_ROOT}" STREQUAL "")
+      file(TO_CMAKE_PATH "$ENV{ICU_ROOT}" NATIVE_PATH)
+      list(APPEND icu_roots "${NATIVE_PATH}")
+      set(ICU_ROOT "${NATIVE_PATH}"
+          CACHE PATH "Location of the ICU installation" FORCE)
+    endif()
+  endif()
+
+  # Find include directory
+  list(APPEND icu_include_suffixes "include")
+  find_path(ICU_INCLUDE_DIR
+            NAMES "unicode/utypes.h"
+            HINTS ${icu_roots}
+            PATH_SUFFIXES ${icu_include_suffixes}
+            DOC "ICU include directory")
+  set(ICU_INCLUDE_DIR "${ICU_INCLUDE_DIR}" PARENT_SCOPE)
+
+  # Get version
+  if(ICU_INCLUDE_DIR AND EXISTS "${ICU_INCLUDE_DIR}/unicode/uvernum.h")
+    file(STRINGS "${ICU_INCLUDE_DIR}/unicode/uvernum.h" icu_header_str
+      REGEX "^#define[\t ]+U_ICU_VERSION[\t ]+\".*\".*")
+
+    string(REGEX REPLACE "^#define[\t ]+U_ICU_VERSION[\t ]+\"([^ \\n]*)\".*"
+      "\\1" icu_version_string "${icu_header_str}")
+    set(ICU_VERSION "${icu_version_string}")
+    set(ICU_VERSION "${icu_version_string}" PARENT_SCOPE)
+    unset(icu_header_str)
+    unset(icu_version_string)
+  endif()
+
+  if(CMAKE_SIZEOF_VOID_P EQUAL 8)
+    # 64-bit binary directory
+    set(_bin64 "bin64")
+    # 64-bit library directory
+    set(_lib64 "lib64")
+  endif()
+
+
+  # Find all ICU programs
+  list(APPEND icu_binary_suffixes "${_bin64}" "bin" "sbin")
+  foreach(program ${icu_programs})
+    string(TOUPPER "${program}" program_upcase)
+    set(cache_var "ICU_${program_upcase}_EXECUTABLE")
+    set(program_var "ICU_${program_upcase}_EXECUTABLE")
+    find_program("${cache_var}"
+      NAMES "${program}"
+      HINTS ${icu_roots}
+      PATH_SUFFIXES ${icu_binary_suffixes}
+      DOC "ICU ${program} executable"
+      NO_PACKAGE_ROOT_PATH
       )
-    find_library (
-      ${ICU_PRIVATE_VAR_NS}_LIB_DEBUG_${${ICU_PRIVATE_VAR_NS}_COMPONENT}
-      NAMES ${${ICU_PRIVATE_VAR_NS}_POSSIBLE_DEBUG_NAMES}
-      HINTS ${${ICU_PRIVATE_VAR_NS}_ROOT}
-      PATH_SUFFIXES ${_ICU_LIB_SUFFIXES}
-      DOC "Debug libraries for ICU"
+    mark_as_advanced("${cache_var}")
+    set("${program_var}" "${${cache_var}}" PARENT_SCOPE)
+  endforeach()
+
+  # Find all ICU libraries
+  list(APPEND icu_library_suffixes "${_lib64}" "lib")
+  set(ICU_REQUIRED_LIBS_FOUND ON)
+  set(static_prefix )
+  # static icu libraries compiled with MSVC have the prefix 's'
+  if(MSVC)
+    set(static_prefix "s")
+  endif()
+  foreach(component ${ICU_FIND_COMPONENTS})
+    string(TOUPPER "${component}" component_upcase)
+    set(component_cache "ICU_${component_upcase}_LIBRARY")
+    set(component_cache_release "${component_cache}_RELEASE")
+    set(component_cache_debug "${component_cache}_DEBUG")
+    set(component_found "ICU_${component_upcase}_FOUND")
+    set(component_found_compat "${component_upcase}_FOUND")
+    set(component_libnames "icu${component}")
+    set(component_debug_libnames "icu${component}d")
+
+    # Special case deliberate library naming mismatches between Unix
+    # and Windows builds
+    unset(component_libnames)
+    unset(component_debug_libnames)
+    list(APPEND component_libnames "icu${component}")
+    list(APPEND component_debug_libnames "icu${component}d")
+    if(component STREQUAL "data")
+      list(APPEND component_libnames "icudt")
+      # Note there is no debug variant at present
+      list(APPEND component_debug_libnames "icudtd")
+    endif()
+    if(component STREQUAL "dt")
+      list(APPEND component_libnames "icudata")
+      # Note there is no debug variant at present
+      list(APPEND component_debug_libnames "icudatad")
+    endif()
+    if(component STREQUAL "i18n")
+      list(APPEND component_libnames "icuin")
+      list(APPEND component_debug_libnames "icuind")
+    endif()
+    if(component STREQUAL "in")
+      list(APPEND component_libnames "icui18n")
+      list(APPEND component_debug_libnames "icui18nd")
+    endif()
+
+    if(static_prefix)
+      unset(static_component_libnames)
+      unset(static_component_debug_libnames)
+      foreach(component_libname ${component_libnames})
+        list(APPEND static_component_libnames
+          ${static_prefix}${component_libname})
+      endforeach()
+      foreach(component_libname ${component_debug_libnames})
+        list(APPEND static_component_debug_libnames
+          ${static_prefix}${component_libname})
+      endforeach()
+      list(APPEND component_libnames ${static_component_libnames})
+      list(APPEND component_debug_libnames ${static_component_debug_libnames})
+    endif()
+    find_library("${component_cache_release}"
+      NAMES ${component_libnames}
+      HINTS ${icu_roots}
+      PATH_SUFFIXES ${icu_library_suffixes}
+      DOC "ICU ${component} library (release)"
+      NO_PACKAGE_ROOT_PATH
       )
-
-    string (TOUPPER "${${ICU_PRIVATE_VAR_NS}_COMPONENT}"
-	  ${ICU_PRIVATE_VAR_NS}_UPPER_COMPONENT)
-    if (NOT ${ICU_PRIVATE_VAR_NS}_LIB_RELEASE_${${ICU_PRIVATE_VAR_NS}_COMPONENT}
-		AND NOT ${ICU_PRIVATE_VAR_NS}_LIB_DEBUG_${${ICU_PRIVATE_VAR_NS}_COMPONENT})
-	  # Both not found
-      set ("${ICU_PUBLIC_VAR_NS}_${${ICU_PRIVATE_VAR_NS}_UPPER_COMPONENT}_FOUND"
-		FALSE)
-      set ("${ICU_PUBLIC_VAR_NS}_FOUND" FALSE)
-    else (NOT ${ICU_PRIVATE_VAR_NS}_LIB_RELEASE_${${ICU_PRIVATE_VAR_NS}_COMPONENT}
-		AND NOT ${ICU_PRIVATE_VAR_NS}_LIB_DEBUG_${${ICU_PRIVATE_VAR_NS}_COMPONENT})
-	  # One or both found
-      set ("${ICU_PUBLIC_VAR_NS}_${${ICU_PRIVATE_VAR_NS}_UPPER_COMPONENT}_FOUND"
-		TRUE)
-      if (NOT ${ICU_PRIVATE_VAR_NS}_LIB_RELEASE_${${ICU_PRIVATE_VAR_NS}_COMPONENT})
-		# Release not found => we are in debug
-        set (${ICU_PRIVATE_VAR_NS}_LIB_${${ICU_PRIVATE_VAR_NS}_COMPONENT}
-		  "${${ICU_PRIVATE_VAR_NS}_LIB_DEBUG_${${ICU_PRIVATE_VAR_NS}_COMPONENT}}")
-      elseif (NOT ${ICU_PRIVATE_VAR_NS}_LIB_DEBUG_${${ICU_PRIVATE_VAR_NS}_COMPONENT})
-		# Debug not found => we are in release
-        set (${ICU_PRIVATE_VAR_NS}_LIB_${${ICU_PRIVATE_VAR_NS}_COMPONENT}
-		  "${${ICU_PRIVATE_VAR_NS}_LIB_RELEASE_${${ICU_PRIVATE_VAR_NS}_COMPONENT}}")
+    find_library("${component_cache_debug}"
+      NAMES ${component_debug_libnames}
+      HINTS ${icu_roots}
+      PATH_SUFFIXES ${icu_library_suffixes}
+      DOC "ICU ${component} library (debug)"
+      NO_PACKAGE_ROOT_PATH
+      )
+    include(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake)
+    select_library_configurations(ICU_${component_upcase})
+    mark_as_advanced("${component_cache_release}" "${component_cache_debug}")
+    if(${component_cache})
+      set("${component_found}" ON)
+      set("${component_found_compat}" ON)
+      list(APPEND ICU_LIBRARY "${${component_cache}}")
+    endif()
+    mark_as_advanced("${component_found}")
+    mark_as_advanced("${component_found_compat}")
+    set("${component_cache}" "${${component_cache}}" PARENT_SCOPE)
+    set("${component_found}" "${${component_found}}" PARENT_SCOPE)
+    set("${component_found_compat}" "${${component_found_compat}}" PARENT_SCOPE)
+    if(component_found OR component_found_compat)
+      if (ICU_FIND_REQUIRED_${component})
+        list(APPEND ICU_LIBS_FOUND "${component} (required)")
       else()
-		# Both found
-        set (${ICU_PRIVATE_VAR_NS}_LIB_${${ICU_PRIVATE_VAR_NS}_COMPONENT}
-          optimized
-		  ${${ICU_PRIVATE_VAR_NS}_LIB_RELEASE_${${ICU_PRIVATE_VAR_NS}_COMPONENT}}
-          debug
-		  ${${ICU_PRIVATE_VAR_NS}_LIB_DEBUG_${${ICU_PRIVATE_VAR_NS}_COMPONENT}}
-          )
+        list(APPEND ICU_LIBS_FOUND "${component} (optional)")
       endif()
-
-      list (APPEND ${ICU_PUBLIC_VAR_NS}_LIBRARIES
-		${${ICU_PRIVATE_VAR_NS}_LIB_${${ICU_PRIVATE_VAR_NS}_COMPONENT}})
-    endif (NOT ${ICU_PRIVATE_VAR_NS}_LIB_RELEASE_${${ICU_PRIVATE_VAR_NS}_COMPONENT}
-	  AND NOT ${ICU_PRIVATE_VAR_NS}_LIB_DEBUG_${${ICU_PRIVATE_VAR_NS}_COMPONENT})
-  endforeach (${ICU_PRIVATE_VAR_NS}_COMPONENT)
-endif (${ICU_PUBLIC_VAR_NS}_INCLUDE_DIRS)
-
-if (${ICU_PUBLIC_VAR_NS}_INCLUDE_DIRS)
-  include (FindPackageHandleStandardArgs)
-
-  if (${ICU_PUBLIC_VAR_NS}_FIND_REQUIRED
-	  AND NOT ${ICU_PUBLIC_VAR_NS}_FIND_QUIETLY)
-    if (${CMAKE_VERSION} VERSION_GREATER 2.8.1)
-       find_package_handle_standard_args (${ICU_PUBLIC_VAR_NS}
-         REQUIRED_VARS ${ICU_PUBLIC_VAR_NS}_LIBRARIES
-	 ${ICU_PUBLIC_VAR_NS}_INCLUDE_DIRS
-	 VERSION_VAR ${ICU_PUBLIC_VAR_NS}_VERSION)
-    else (${CMAKE_VERSION} VERSION_GREATER 2.8.1)
-       find_package_handle_standard_args (${ICU_PUBLIC_VAR_NS}
-         DEFAULT_MSG ${ICU_PUBLIC_VAR_NS}_LIBRARIES
-	 ${ICU_PUBLIC_VAR_NS}_INCLUDE_DIRS)
-    endif (${CMAKE_VERSION} VERSION_GREATER 2.8.1)
-
-  else (${ICU_PUBLIC_VAR_NS}_FIND_REQUIRED
-	  AND NOT ${ICU_PUBLIC_VAR_NS}_FIND_QUIETLY)
-    find_package_handle_standard_args (${ICU_PUBLIC_VAR_NS} "ICU not found"
-	  ${ICU_PUBLIC_VAR_NS}_LIBRARIES ${ICU_PUBLIC_VAR_NS}_INCLUDE_DIRS)
-  endif (${ICU_PUBLIC_VAR_NS}_FIND_REQUIRED
-	AND NOT ${ICU_PUBLIC_VAR_NS}_FIND_QUIETLY)
-
-else (${ICU_PUBLIC_VAR_NS}_INCLUDE_DIRS)
-  if (${ICU_PUBLIC_VAR_NS}_FIND_REQUIRED
-	  AND NOT ${ICU_PUBLIC_VAR_NS}_FIND_QUIETLY)
-    message (FATAL_ERROR "Could not find ICU include directory")
-  endif (${ICU_PUBLIC_VAR_NS}_FIND_REQUIRED
-	AND NOT ${ICU_PUBLIC_VAR_NS}_FIND_QUIETLY)
-endif (${ICU_PUBLIC_VAR_NS}_INCLUDE_DIRS)
-
-#
-mark_as_advanced (
-  ${ICU_PUBLIC_VAR_NS}_INCLUDE_DIRS
-  ${ICU_PUBLIC_VAR_NS}_LIBRARIES
-)
-
-# IN (args)
-icudebug ("FIND_COMPONENTS")
-icudebug ("FIND_REQUIRED")
-icudebug ("FIND_QUIETLY")
-icudebug ("FIND_VERSION")
-# OUT
-# Found
-icudebug ("FOUND")
-icudebug ("UC_FOUND")
-icudebug ("I18N_FOUND")
-icudebug ("IO_FOUND")
-icudebug ("LE_FOUND")
-icudebug ("LX_FOUND")
-icudebug ("DATA_FOUND")
-# Linking
-icudebug ("INCLUDE_DIRS")
-icudebug ("LIBRARIES")
-# Version
-icudebug ("MAJOR_VERSION")
-icudebug ("MINOR_VERSION")
-icudebug ("PATCH_VERSION")
-icudebug ("VERSION")
+    else()
+      if (ICU_FIND_REQUIRED_${component})
+        set(ICU_REQUIRED_LIBS_FOUND OFF)
+        list(APPEND ICU_LIBS_NOTFOUND "${component} (required)")
+      else()
+        list(APPEND ICU_LIBS_NOTFOUND "${component} (optional)")
+      endif()
+    endif()
+  endforeach()
+  set(_ICU_REQUIRED_LIBS_FOUND "${ICU_REQUIRED_LIBS_FOUND}" PARENT_SCOPE)
+  set(ICU_LIBRARY "${ICU_LIBRARY}" PARENT_SCOPE)
+
+  # Find all ICU data files
+  if(CMAKE_LIBRARY_ARCHITECTURE)
+    list(APPEND icu_data_suffixes
+      "${_lib64}/${CMAKE_LIBRARY_ARCHITECTURE}/icu/${ICU_VERSION}"
+      "lib/${CMAKE_LIBRARY_ARCHITECTURE}/icu/${ICU_VERSION}"
+      "${_lib64}/${CMAKE_LIBRARY_ARCHITECTURE}/icu"
+      "lib/${CMAKE_LIBRARY_ARCHITECTURE}/icu")
+  endif()
+  list(APPEND icu_data_suffixes
+    "${_lib64}/icu/${ICU_VERSION}"
+    "lib/icu/${ICU_VERSION}"
+    "${_lib64}/icu"
+    "lib/icu")
+  foreach(data ${icu_data})
+    string(TOUPPER "${data}" data_upcase)
+    string(REPLACE "." "_" data_upcase "${data_upcase}")
+    set(cache_var "ICU_${data_upcase}")
+    set(data_var "ICU_${data_upcase}")
+    find_file("${cache_var}"
+      NAMES "${data}"
+      HINTS ${icu_roots}
+      PATH_SUFFIXES ${icu_data_suffixes}
+      DOC "ICU ${data} data file")
+    mark_as_advanced("${cache_var}")
+    set("${data_var}" "${${cache_var}}" PARENT_SCOPE)
+  endforeach()
+
+  if(NOT ICU_FIND_QUIETLY)
+    if(ICU_LIBS_FOUND)
+      message(STATUS "Found the following ICU libraries:")
+      foreach(found ${ICU_LIBS_FOUND})
+        message(STATUS "  ${found}")
+      endforeach()
+    endif()
+    if(ICU_LIBS_NOTFOUND)
+      message(STATUS "The following ICU libraries were not found:")
+      foreach(notfound ${ICU_LIBS_NOTFOUND})
+        message(STATUS "  ${notfound}")
+      endforeach()
+    endif()
+  endif()
+
+  if(ICU_DEBUG)
+    message(STATUS "--------FindICU.cmake search debug--------")
+    message(STATUS "ICU binary path search order: ${icu_roots}")
+    message(STATUS "ICU include path search order: ${icu_roots}")
+    message(STATUS "ICU library path search order: ${icu_roots}")
+    message(STATUS "----------------")
+  endif()
+endfunction()
+
+_ICU_FIND()
+
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(ICU
+                                  FOUND_VAR ICU_FOUND
+                                  REQUIRED_VARS ICU_INCLUDE_DIR
+                                                ICU_LIBRARY
+                                                _ICU_REQUIRED_LIBS_FOUND
+                                  VERSION_VAR ICU_VERSION
+                                  FAIL_MESSAGE "Failed to find all ICU components")
+
+unset(_ICU_REQUIRED_LIBS_FOUND)
+
+if(ICU_FOUND)
+  set(ICU_INCLUDE_DIRS "${ICU_INCLUDE_DIR}")
+  set(ICU_LIBRARIES "${ICU_LIBRARY}")
+  foreach(_ICU_component ${ICU_FIND_COMPONENTS})
+    string(TOUPPER "${_ICU_component}" _ICU_component_upcase)
+    set(_ICU_component_cache "ICU_${_ICU_component_upcase}_LIBRARY")
+    set(_ICU_component_cache_release "ICU_${_ICU_component_upcase}_LIBRARY_RELEASE")
+    set(_ICU_component_cache_debug "ICU_${_ICU_component_upcase}_LIBRARY_DEBUG")
+    set(_ICU_component_lib "ICU_${_ICU_component_upcase}_LIBRARIES")
+    set(_ICU_component_found "ICU_${_ICU_component_upcase}_FOUND")
+    set(_ICU_imported_target "ICU::${_ICU_component}")
+    if(${_ICU_component_found})
+      set("${_ICU_component_lib}" "${${_ICU_component_cache}}")
+      if(NOT TARGET ${_ICU_imported_target})
+        add_library(${_ICU_imported_target} UNKNOWN IMPORTED)
+        if(ICU_INCLUDE_DIR)
+          set_target_properties(${_ICU_imported_target} PROPERTIES
+            INTERFACE_INCLUDE_DIRECTORIES "${ICU_INCLUDE_DIR}")
+        endif()
+        if(EXISTS "${${_ICU_component_cache}}")
+          set_target_properties(${_ICU_imported_target} PROPERTIES
+            IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
+            IMPORTED_LOCATION "${${_ICU_component_cache}}")
+        endif()
+        if(EXISTS "${${_ICU_component_cache_release}}")
+          set_property(TARGET ${_ICU_imported_target} APPEND PROPERTY
+            IMPORTED_CONFIGURATIONS RELEASE)
+          set_target_properties(${_ICU_imported_target} PROPERTIES
+            IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE "CXX"
+            IMPORTED_LOCATION_RELEASE "${${_ICU_component_cache_release}}")
+        endif()
+        if(EXISTS "${${_ICU_component_cache_debug}}")
+          set_property(TARGET ${_ICU_imported_target} APPEND PROPERTY
+            IMPORTED_CONFIGURATIONS DEBUG)
+          set_target_properties(${_ICU_imported_target} PROPERTIES
+            IMPORTED_LINK_INTERFACE_LANGUAGES_DEBUG "CXX"
+            IMPORTED_LOCATION_DEBUG "${${_ICU_component_cache_debug}}")
+        endif()
+        if(CMAKE_DL_LIBS AND _ICU_component STREQUAL "uc")
+          set_target_properties(${_ICU_imported_target} PROPERTIES
+            INTERFACE_LINK_LIBRARIES "${CMAKE_DL_LIBS}")
+        endif()
+      endif()
+    endif()
+    unset(_ICU_component_upcase)
+    unset(_ICU_component_cache)
+    unset(_ICU_component_lib)
+    unset(_ICU_component_found)
+    unset(_ICU_imported_target)
+  endforeach()
+endif()
+
+if(ICU_DEBUG)
+  message(STATUS "--------FindICU.cmake results debug--------")
+  message(STATUS "ICU found: ${ICU_FOUND}")
+  message(STATUS "ICU_VERSION number: ${ICU_VERSION}")
+  message(STATUS "ICU_ROOT directory: ${ICU_ROOT}")
+  message(STATUS "ICU_INCLUDE_DIR directory: ${ICU_INCLUDE_DIR}")
+  message(STATUS "ICU_LIBRARIES: ${ICU_LIBRARIES}")
+
+  foreach(program IN LISTS icu_programs)
+    string(TOUPPER "${program}" program_upcase)
+    set(program_lib "ICU_${program_upcase}_EXECUTABLE")
+    message(STATUS "${program} program: ${program_lib}=${${program_lib}}")
+    unset(program_upcase)
+    unset(program_lib)
+  endforeach()
+
+  foreach(data IN LISTS icu_data)
+    string(TOUPPER "${data}" data_upcase)
+    string(REPLACE "." "_" data_upcase "${data_upcase}")
+    set(data_lib "ICU_${data_upcase}")
+    message(STATUS "${data} data: ${data_lib}=${${data_lib}}")
+    unset(data_upcase)
+    unset(data_lib)
+  endforeach()
+
+  foreach(component IN LISTS ICU_FIND_COMPONENTS)
+    string(TOUPPER "${component}" component_upcase)
+    set(component_lib "ICU_${component_upcase}_LIBRARIES")
+    set(component_found "ICU_${component_upcase}_FOUND")
+    set(component_found_compat "${component_upcase}_FOUND")
+    message(STATUS "${component} library found: ${component_found}=${${component_found}}")
+    message(STATUS "${component} library found (compat name): ${component_found_compat}=${${component_found_compat}}")
+    message(STATUS "${component} library: ${component_lib}=${${component_lib}}")
+    unset(component_upcase)
+    unset(component_lib)
+    unset(component_found)
+    unset(component_found_compat)
+  endforeach()
+  message(STATUS "----------------")
+endif()
+
+unset(icu_programs)


Fix Conan warning for spdlog dependency

Fix Conan warning for spdlog dependency

At some point, spdlog 1.5.0 changed its dependencies to require
fmt 6.2.1, rather than 6.2.0. As a result, every time you configure
the project, you see this warning:

    WARN: spdlog/1.5.0: requirement fmt/6.2.1 overridden by your
    conanfile to fmt/6.2.0

This commit fixes that warning, and prevent whatever latent bugs the
spdlog devs expect this version mismatch to cause.

Note that the current version of spdlog (1.8.2) requires fmt version
7.1.3; it would make a lot of sense to update the versions of both
packages.

--- cmake/Conan.cmake
+++ cmake/Conan.cmake
@@ -18,7 +18,7 @@
     ${CONAN_EXTRA_REQUIRES}
     catch2/2.13.3
     docopt.cpp/0.6.2
-    fmt/6.2.0
+    fmt/6.2.1
     spdlog/1.5.0
     OPTIONS
     ${CONAN_EXTRA_OPTIONS}


+ Fix CMake developer warning about mismatching if/endif arguments.

--- cmake/Utils.cmake
+++ cmake/Utils.cmake
@@ -39,7 +39,7 @@
     foreach(str ${${listvar}})
         if (NOT ${str} MATCHES ${match})
             list(APPEND temp ${str})
-        endif (not ${str} matches ${match})
+        endif (NOT ${str} MATCHES ${match})
     endforeach(str ${${listvar}})
     set(${listvar} "${temp}")
 endmacro(list_remove_regex listvar regex)


limix.cmake

limix.cmake

--- cmake/limix.cmake
+++ cmake/limix.cmake
@@ -16,6 +16,26 @@
     message(${MSG})
   endforeach()
 endfunction(display_welcome)
+
+macro(limix_windows_config)
+  set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS TRUE)
+  set_property(GLOBAL PROPERTY USE_FOLDERS ON)
+  add_definitions(-D_CRT_SECURE_NO_WARNINGS)
+  add_definitions(-D_CRT_NONSTDC_NO_DEPRECATE)
+  add_definitions(-Dinline=__inline)
+
+  set(CompilerFlags
+      CMAKE_CXX_FLAGS
+      CMAKE_CXX_FLAGS_DEBUG
+      CMAKE_CXX_FLAGS_RELEASE
+      CMAKE_C_FLAGS
+      CMAKE_C_FLAGS_DEBUG
+      CMAKE_C_FLAGS_RELEASE)
+
+  foreach(CompilerFlag ${CompilerFlags})
+    string(REPLACE "/MD" "/MT" ${CompilerFlag} "${${CompilerFlag}}")
+  endforeach()
+endmacro(limix_windows_config)

 macro(limix_config)
   enable_testing()
@@ -38,10 +58,7 @@

   # Windows specific common configuration
   if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
-    set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS TRUE)
-    add_definitions(-D_CRT_SECURE_NO_WARNINGS)
-    add_definitions(-D_CRT_NONSTDC_NO_DEPRECATE)
-    add_definitions(-Dinline=__inline)
+    limix_windows_config()
   endif()

   set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake")
@@ -68,13 +85,19 @@
   set_target_properties(${NAME} PROPERTIES ${PROPERTY} "${VALUE}")
 endfunction(easy_set_target_property)

-function(easy_install TARGET_NAME INCLUDE_DIR)
+function(easy_shared_install TARGET_NAME)
   install(TARGETS ${TARGET_NAME}
           ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
           LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
           RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
-          PUBLIC_HEADER DESTINATION ${INCLUDE_DIR})
-endfunction(easy_install)
+          PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
+endfunction(easy_shared_install)
+
+function(easy_static_install TARGET_NAME)
+  install(TARGETS ${TARGET_NAME}
+          ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
+          LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
+endfunction(easy_static_install)

 function(add_library_type TYPE NAME VERSION SOURCES PUBLIC_HEADERS LIBS)
   if(TYPE MATCHES "STATIC")
@@ -85,10 +108,9 @@
   easy_set_target_property(${NAME} VERSION ${VERSION})
   if(TYPE MATCHES "SHARED")
     easy_set_target_property(${NAME} PUBLIC_HEADER "${PUBLIC_HEADERS}")
-  endif()
-
-  if(TYPE MATCHES "SHARED")
-    easy_install(${NAME} include/${NAME})
+    easy_shared_install(${NAME})
+  else()
+    easy_static_install(${NAME})
   endif()

   target_link_libraries(${NAME} "${LIBS}")
@@ -103,9 +125,10 @@
   add_executable(${NAME} ${SOURCES})
   target_link_libraries(${NAME} ${LIBRARY})
   add_test(test_${NAME} ${NAME} -E environment)
+  file(TO_CMAKE_PATH "$ENV{PATH}" MYPATH)

-  file(TO_CMAKE_PATH "$ENV{PATH}" MYPATH)
   list(APPEND MYPATH ${CMAKE_BINARY_DIR})
+  list(APPEND MYPATH ${CMAKE_BINARY_DIR}/${CMAKE_BUILD_TYPE})
   string(REPLACE ";" "\\;" MYPATH "${MYPATH}")

   set_property(TEST test_${NAME} APPEND PROPERTY ENVIRONMENT "PATH=${MYPATH}")
@@ -116,4 +139,4 @@
     list(APPEND FULL "${BASE_DIR}/${SRC}")
   endforeach()
   set(${_FULL} ${FULL} PARENT_SCOPE)
-endfunction(limix_convert_rel_to_full)+endfunction(limix_convert_rel_to_full)


Adding missing suffix tests within ElMath/ScaLAPACK.cmake

--- cmake/external_projects/ElMath/ScaLAPACK.cmake
+++ cmake/external_projects/ElMath/ScaLAPACK.cmake
@@ -16,19 +16,43 @@
   set(CMAKE_REQUIRED_LINKER_FLAGS "${MPI_LINK_FLAGS} ${CMAKE_EXE_LINKER_FLAGS}")
   set(CMAKE_REQUIRED_INCLUDES ${MPI_C_INCLUDE_PATH})
   set(CMAKE_REQUIRED_LIBRARIES ${MATH_LIBS_AT_CONFIG} ${MPI_C_LIBRARIES})
-  El_check_function_exists(dtrsm   EL_HAVE_DTRSM)
-  El_check_function_exists(dtrsm_  EL_HAVE_DTRSM_POST)
-  if(EL_HAVE_DTRSM OR EL_HAVE_DTRSM_POST)
-    set(HAVE_BLAS TRUE)
-  else()
-    message(WARNING "Could not find BLAS in ${MATH_LIBS_AT_CONFIG}")
-  endif()
-  El_check_function_exists(dsytrd  EL_HAVE_DSYTRD)
-  El_check_function_exists(dsytrd_ EL_HAVE_DSYTRD_POST)
-  if(EL_HAVE_DSYTRD OR EL_HAVE_DSYTRD_POST)
-    set(HAVE_LAPACK TRUE)
-  else()
-    message(WARNING "Could not find LAPACK in ${MATH_LIBS_AT_CONFIG}")
+  if(EL_BLAS_SUFFIX)
+    El_check_function_exists(dtrsm${EL_BLAS_SUFFIX} EL_HAVE_DTRSM)
+    if(EL_HAVE_DTRSM)
+      set(HAVE_BLAS TRUE)
+    else()
+      set(HAVE_BLAS FALSE)
+    endif()
+  else()
+    El_check_function_exists(dtrsm   EL_HAVE_DTRSM)
+    El_check_function_exists(dtrsm_  EL_HAVE_DTRSM_POST)
+    if(EL_HAVE_DTRSM OR EL_HAVE_DTRSM_POST)
+      set(HAVE_BLAS TRUE)
+    else()
+      set(HAVE_BLAS FALSE)
+    endif()
+  endif()
+  if(NOT HAVE_BLAS)
+    message(FATAL_ERROR "Could not find BLAS in ${MATH_LIBS_AT_CONFIG}")
+  endif()
+  if(EL_LAPACK_SUFFIX)
+    El_check_function_exists(dsytrd${EL_LAPACK_SUFFIX} EL_HAVE_DSYTRD)
+    if(EL_HAVE_DSYTRD)
+      set(HAVE_LAPACK TRUE)
+    else()
+      set(HAVE_LAPACK FALSE)
+    endif()
+  else()
+    El_check_function_exists(dsytrd  EL_HAVE_DSYTRD)
+    El_check_function_exists(dsytrd_ EL_HAVE_DSYTRD_POST)
+    if(EL_HAVE_DSYTRD OR EL_HAVE_DSYTRD_POST)
+      set(HAVE_LAPACK TRUE)
+    else()
+      set(HAVE_LAPACK FALSE)
+    endif()
+  endif()
+  if(NOT HAVE_LAPACK)
+    message(FATAL_ERROR "Could not find LAPACK in ${MATH_LIBS_AT_CONFIG}")
   endif()
   if(EL_SCALAPACK_SUFFIX)
     El_check_function_exists(pdsyngst${EL_SCALAPACK_SUFFIX} EL_HAVE_PDSYNGST)
@@ -85,19 +109,45 @@
       set(CMAKE_REQUIRED_INCLUDES ${MPI_C_INCLUDE_PATH})
       set(CMAKE_REQUIRED_LIBRARIES
         ${ScaLAPACK} ${MATH_LIBS_AT_CONFIG} ${MPI_C_LIBRARIES})
-      El_check_function_exists(dtrsm   EL_HAVE_DTRSM)
-      El_check_function_exists(dtrsm_  EL_HAVE_DTRSM_POST)
-      if(EL_HAVE_DTRSM OR EL_HAVE_DTRSM_POST)
-        set(HAVE_BLAS TRUE)
+      if(EL_BLAS_SUFFIX)
+        El_check_function_exists(dtrsm${EL_BLAS_SUFFIX} EL_HAVE_DTRSM)
+        if(EL_HAVE_DTRSM)
+          set(HAVE_BLAS TRUE)
+        else()
+          set(HAVE_BLAS FALSE)
+        endif()
       else()
-        message(STATUS "Cannot link BLAS with found ScaLAPACK and MATH_LIBS")
-      endif()
-      El_check_function_exists(dsytrd  EL_HAVE_DSYTRD)
-      El_check_function_exists(dsytrd_ EL_HAVE_DSYTRD_POST)
-      if(EL_HAVE_DSYTRD OR EL_HAVE_DSYTRD_POST)
-        set(HAVE_LAPACK TRUE)
+        El_check_function_exists(dtrsm  EL_HAVE_DTRSM)
+        El_check_function_exists(dtrsm_ EL_HAVE_DTRSM_POST)
+        if(EL_HAVE_DTRSM OR EL_HAVE_DTRSM_POST)
+          set(HAVE_BLAS TRUE)
+        else()
+          set(HAVE_BLAS FALSE)
+        endif()
+      endif()
+      if(NOT HAVE_BLAS)
+        message(FATAL_ERROR
+          "Cannot link BLAS with found ScaLAPACK and MATH_LIBS")
+      endif()
+      if(EL_LAPACK_SUFFIX)
+        El_check_function_exists(dsytrd${EL_LAPACK_SUFFIX} EL_HAVE_DSYTRD)
+        if(EL_HAVE_DSYTRD)
+          set(HAVE_LAPACK TRUE)
+        else()
+          set(HAVE_LAPACK FALSE)
+        endif()
       else()
-        message(STATUS "Cannot link LAPACK with found ScaLAPACK and MATH_LIBS")
+        El_check_function_exists(dsytrd  EL_HAVE_DSYTRD)
+        El_check_function_exists(dsytrd_ EL_HAVE_DSYTRD_POST)
+        if(EL_HAVE_DSYTRD OR EL_HAVE_DSYTRD_POST)
+          set(HAVE_LAPACK TRUE)
+        else()
+          set(HAVE_LAPACK FALSE)
+        endif()
+      endif()
+      if(NOT HAVE_LAPACK)
+        message(FATAL_ERROR
+          "Cannot link LAPACK with found ScaLAPACK and MATH_LIBS")
       endif()
       if(EL_SCALAPACK_SUFFIX)
         El_check_function_exists(pdsyngst${EL_SCALAPACK_SUFFIX} EL_HAVE_PDSYNGST)


forcing checkout of models

forcing checkout of models

--- scripts/test.cmake
+++ scripts/test.cmake
@@ -73,7 +73,7 @@
   ENDIF()
   MESSAGE("checking out test models: ${TEST_MODELS_HASH}")
   EXECUTE_PROCESS(
-    COMMAND ${CTEST_GIT_COMMAND} "checkout" ${TEST_MODELS_HASH}
+    COMMAND ${CTEST_GIT_COMMAND} "checkout" "-f" ${TEST_MODELS_HASH}
     WORKING_DIRECTORY ${TEST_MODELS_DIRECTORY}
     RESULT_VARIABLE retcode)
   check_return_code()


Fixed the HashMap detection in CMake.

Fixed the HashMap detection in CMake.

The main problem was that cached variables were not unset in the foreach
loops. So only the first entry in each list was looked at (namespaces,
etc. Now only the HashMap implementation needs to be fixed for the
other non tr1 hash_maps/unordered_sets.

--- cmake/BALLConfigHashMap.cmake
+++ cmake/BALLConfigHashMap.cmake
@@ -6,13 +6,28 @@

 INCLUDE(CheckIncludeFileCXX)

-MESSAGE(STATUS "Checking for hash map")
+MACRO(BALL_HASH_MAP_COMPILES MAP_NAME MAP_NAMESPACE MAP_INCLUDE RESULT)
+	CHECK_CXX_SOURCE_COMPILES("#include <${MAP_INCLUDE}>
+		int main(int, char**)
+		{
+			${MAP_NAMESPACE}::${MAP_NAME}<int, int> a;
+
+			return 0;
+		}" ${RESULT} ${COMPILE_DEFINITIONS}
+	)
+ENDMACRO(BALL_HASH_MAP_COMPILES)
+
+
+
+
+
+MESSAGE(STATUS "Checking for unordered_map")

 ## First, try to find an unordered_map implementation
 #  For now, we have to disable <unordered_map> without prefix to avoid conflicts with boost
 #  CHECK_INCLUDE_FILE_CXX("unordered_map" BALL_HAS_STD_UNORDERED_MAP ${COMPILE_DEFINITIONS})
 IF(BALL_HAS_STD_UNORDERED_MAP)
-	MESSAGE(STATUS "Found as <unordered_map>!")
+	MESSAGE(STATUS "Checking for unordered_map - Found as <unordered_map>!")
 	SET(BALL_MAP_NAMESPACE "std")
 	SET(BALL_MAP_NAME "std::unordered_map<Key,T>")
 	SET(BALL_EXTEND_HASH_IN_STD_NS TRUE)
@@ -20,7 +35,11 @@
 ELSE()
 	CHECK_INCLUDE_FILE_CXX("tr1/unordered_map" BALL_HAS_TR1_UNORDERED_MAP ${COMPILE_DEFINITIONS})
 	IF (BALL_HAS_TR1_UNORDERED_MAP)
-		MESSAGE(STATUS "Found as <tr1/unordered_map>!")
+		UNSET(BALL_HAS_TR1_UNORDERED_MAP CACHE)
+		BALL_HASH_MAP_COMPILES("eeunordered_map" "std::tr1" "tr1/unordered_map" BALL_HAS_TR1_UNORDERED_MAP)
+	ENDIF()
+	IF (BALL_HAS_TR1_UNORDERED_MAP)
+		MESSAGE(STATUS "Checking for unordered_map - Found as <tr1/unordered_map>!")
 		SET(BALL_MAP_NAMESPACE "tr1")
 		SET(BALL_MAP_NAME "std::tr1::unordered_map<Key,T>")
 		SET(BALL_EXTEND_HASH_IN_STD_NS TRUE)
@@ -28,7 +47,11 @@
 	ELSE()
 		CHECK_INCLUDE_FILE_CXX("boost/unordered_map.hpp" BALL_HAS_BOOST_UNORDERED_MAP ${COMPILE_DEFINITIONS})
 		IF (BALL_HAS_BOOST_UNORDERED_MAP)
-			MESSAGE(STATUS "Found as <boost/unordered_map.hpp>!")
+			UNSET(BALL_HAS_BOOST_UNORDERED_MAP CACHE)
+			BALL_HASH_MAP_COMPILES("unordered_map" "boost" "boost/unordered_map.hpp" BALL_HAS_BOOST_UNORDERED_MAP)
+		ENDIF()
+		IF (BALL_HAS_BOOST_UNORDERED_MAP)
+			MESSAGE(STATUS "Checking for unordered_map - Found as <boost/unordered_map.hpp>!")
 			SET(BALL_MAP_NAMESPACE "boost")
 			SET(BALL_MAP_NAME "boost::unordered_map<Key,T>")
 			SET(BALL_EXTEND_HASH_IN_STD_NS FALSE)
@@ -38,45 +61,40 @@
 ENDIF()

 IF (NOT BALL_HAS_UNORDERED_MAP)
-	SET(EXT_INCLUDE_PREFIX_FOUND FALSE)
+	MESSAGE(STATUS "Checking for hash_map GNU extension")
 	FOREACH(TMP_EXT_INCLUDE_PREFIX "" "ext/")
-		IF (NOT EXT_INCLUDE_PREFIX_FOUND)
-			CHECK_INCLUDE_FILE_CXX(${TMP_EXT_INCLUDE_PREFIX}hash_map EXT_INCLUDE_PREFIX_FOUND ${COMPILE_DEFINITIONS})
-			IF (EXT_INCLUDE_PREFIX_FOUND)
-				MESSAGE(STATUS "Found as <"${TMP_EXT_INCLUDE_PREFIX}"hash_map>")
-				IF (NOT TMP_EXT_INCLUDE_PREFIX STREQUAL "")
-					SET(BALL_EXT_INCLUDE_PREFIX TMP_EXT_INCLUDE_PREFIX)
-				ENDIF()
+		UNSET(EXT_INCLUDE_PREFIX_FOUND CACHE)
+		CHECK_INCLUDE_FILE_CXX(${TMP_EXT_INCLUDE_PREFIX}hash_map EXT_INCLUDE_PREFIX_FOUND ${COMPILE_DEFINITIONS})
+		IF (EXT_INCLUDE_PREFIX_FOUND)
+			MESSAGE(STATUS "Checking for hash_map GNU extension - Found as <${TMP_EXT_INCLUDE_PREFIX}hash_map>")
+			IF (NOT TMP_EXT_INCLUDE_PREFIX STREQUAL "")
+				SET(BALL_EXT_INCLUDE_PREFIX TMP_EXT_INCLUDE_PREFIX)
 			ENDIF()
+			BREAK()
 		ENDIF()
 	ENDFOREACH()

-	## Find the correct namespace to use
-	SET(EXT_NAMESPACE_FOUND FALSE)
-	FOREACH(TMP_EXT_NAMESPACE "std" "stdext" "__gnu_cxx")
-		IF (NOT EXT_NAMESPACE_FOUND)
-			CHECK_CXX_SOURCE_COMPILES("#include <${BALL_EXT_INCLUDE_PREFIX}hash_map>
-				int main(int /*argc*/, char** /*argv*/)
-				{
-					${TMP_EXT_NAMESPACE}::hash_map<int, int> a;
-
-					return 0;
-				}"
-			EXT_NAMESPACE_FOUND)
+	IF (EXT_INCLUDE_PREFIX_FOUND)
+		## Find the correct namespace to use
+		MESSAGE(STATUS "Checking for hash_map GNU extension namespace")
+		FOREACH(TMP_EXT_NAMESPACE "std" "stdext" "__gnu_cxx")
+			UNSET(EXT_NAMESPACE_FOUND CACHE)
+			BALL_HASH_MAP_COMPILES("hash_map" "${TMP_EXT_NAMESPACE}" "${BALL_EXT_INCLUDE_PREFIX}hash_map" EXT_NAMESPACE_FOUND)
 			IF (EXT_NAMESPACE_FOUND)
 				SET(BALL_MAP_NAMESPACE ${TMP_EXT_NAMESPACE})
-				SET(BALL_MAP_NAME ${TMP_EXT_NAMESPACE}"::hash_map<Key, T>")
+				SET(BALL_MAP_NAME "${TMP_EXT_NAMESPACE}::hash_map<Key, T>")
 				SET(BALL_HAS_HASH_MAP)
+				MESSAGE(STATUS "Checking for hash_map GNU extension namespace - ${TMP_EXT_NAMESPACE}")
+				BREAK()
 			ENDIF()
-		ENDIF()
-	ENDFOREACH()
+		ENDFOREACH()
+	ENDIF()

 	IF (NOT EXT_INCLUDE_PREFIX_FOUND OR NOT EXT_NAMESPACE_FOUND)
 		MESSAGE(STATUS "No suitable hash_map implementation found! Falling back to std::map!")
 		SET(BALL_MAP_NAMESPACE "std")
 		SET(BALL_MAP_NAME "std::map<Key, T>")
 	ELSE()
-		MESSAGE(Check whether LongSize hash is required)
 		CHECK_CXX_SOURCE_COMPILES("#include <${BALL_EXT_INCLUDE_PREFIX}hash_map>
 			namespace ${TMP_EXT_NAMESPACE} {
 				template<>


Fixed an issue with install command on windows

--- cmake/BuildExternalGLog.cmake
+++ cmake/BuildExternalGLog.cmake
@@ -26,5 +26,5 @@
 	BUILD_IN_SOURCE 1
 	CONFIGURE_COMMAND "${glog_configure}"
 	BUILD_COMMAND ${glog_build}
-	INSTALL_COMMAND ${glog_install}
+	INSTALL_COMMAND "${glog_install}"
 )


Use env.variable G4APPLICATION_DIR in cmake

--- cmake/FindG4Application.cmake
+++ cmake/FindG4Application.cmake
@@ -4,10 +4,10 @@
 #
 # It requires you to set the G4APPLICATION_DIR to point to the
 #   g4Application root directory.
-if (NOT G4APPLICATION_DIR )
-    message(send_error "Please set G4APPLICATION_DIR variable.")
+if (NOT DEFINED ENV{G4APPLICATION_DIR} )
+    message(ERROR "Please set G4APPLICATION_DIR variable.")
 else()
     message(STATUS "Using g4Application from ${G4APPLICATION_DIR}.")
-    find_path(G4Application_INCLUDE_DIR "Plugin.hh" HINTS "${G4APPLICATION_DIR}/include")
-    find_library(G4Application_LIBRARY g4Application HINTS ${G4APPLICATION_DIR})
+    find_path(G4Application_INCLUDE_DIR "Plugin.hh" HINTS "$ENV{G4APPLICATION_DIR}/include")
+    find_library(G4Application_LIBRARY g4Application HINTS $ENV{G4APPLICATION_DIR})
 endif()


Commented NO_DEFAULT_PATH in cmake search [ci skip]

--- cmake/FindgenericLogger.cmake
+++ cmake/FindgenericLogger.cmake
@@ -71,7 +71,8 @@
     PATHS ${GENERICLOGGER_ROOT_DIR}
     PATH_SUFFIXES ${_GENERICLOGGER_POSSIBLE_INCLUDE_SUFFIXES}
     DOC "genericLogger include directory"
-    NO_DEFAULT_PATH)
+    # NO_DEFAULT_PATH
+    )
 ELSE (GENERICLOGGER_ROOT_DIR)
   # Use default path search
   FIND_PATH (GENERICLOGGER_INCLUDE_DIR
@@ -103,11 +104,13 @@
       FIND_LIBRARY (${_GENERICLOGGER_LIBRARY_BASE}_DEBUG
 	NAMES ${_GENERICLOGGER_COMPONENT_POSSIBLE_DEBUG_NAMES}
 	PATHS ${GENERICLOGGER_ROOT_DIR} PATH_SUFFIXES ${_GENERICLOGGER_POSSIBLE_LIB_SUFFIXES}
-	NO_DEFAULT_PATH)
+	# NO_DEFAULT_PATH
+	)
       FIND_LIBRARY (${_GENERICLOGGER_STATIC_LIBRARY_BASE}_DEBUG
 	NAMES ${_GENERICLOGGER_STATIC_COMPONENT_POSSIBLE_DEBUG_NAMES}
 	PATHS ${GENERICLOGGER_ROOT_DIR} PATH_SUFFIXES ${_GENERICLOGGER_POSSIBLE_LIB_SUFFIXES}
-	NO_DEFAULT_PATH)
+	# NO_DEFAULT_PATH
+	)
     ELSE (GENERICLOGGER_ROOT_DIR)
       FIND_LIBRARY (${_GENERICLOGGER_LIBRARY_BASE}_DEBUG
 	NAMES ${_GENERICLOGGER_COMPONENT_POSSIBLE_DEBUG_NAMES}
@@ -123,11 +126,13 @@
       FIND_LIBRARY (${_GENERICLOGGER_LIBRARY_BASE}_RELEASE
 	NAMES ${_GENERICLOGGER_COMPONENT_POSSIBLE_RELEASE_NAMES}
 	PATHS ${GENERICLOGGER_ROOT_DIR} PATH_SUFFIXES ${_GENERICLOGGER_POSSIBLE_LIB_SUFFIXES}
-	NO_DEFAULT_PATH)
+	# NO_DEFAULT_PATH
+	)
       FIND_LIBRARY (${_GENERICLOGGER_STATIC_LIBRARY_BASE}_RELEASE
 	NAMES ${_GENERICLOGGER_STATIC_COMPONENT_POSSIBLE_RELEASE_NAMES}
 	PATHS ${GENERICLOGGER_ROOT_DIR} PATH_SUFFIXES ${_GENERICLOGGER_POSSIBLE_LIB_SUFFIXES}
-	NO_DEFAULT_PATH)
+	# NO_DEFAULT_PATH
+	)
     ELSE (ICU_ROOT_DIR)
       FIND_LIBRARY (${_GENERICLOGGER_LIBRARY_BASE}_RELEASE
 	NAMES ${_GENERICLOGGER_COMPONENT_POSSIBLE_RELEASE_NAMES}


remove usless cmake module - findgmock

remove usless cmake module - findgmock

--- cmake/modules/FindGMock.cmake
+++ cmake/modules/FindGMock.cmake
@@ -1,113 +0,0 @@
-# Locate the Google C++ Mocking Framework.
-# (This file is almost an identical copy of the original FindGTest.cmake file,
-#  feel free to use it as it is or modify it for your own needs.)
-#
-#
-# Defines the following variables:
-#
-#   GMOCK_FOUND - Found the Google Testing framework
-#   GMOCK_INCLUDE_DIRS - Include directories
-#
-# Also defines the library variables below as normal
-# variables. These contain debug/optimized keywords when
-# a debugging library is found.
-#
-#   GMOCK_BOTH_LIBRARIES - Both libgmock & libgmock-main
-#   GMOCK_LIBRARIES - libgmock
-#   GMOCK_MAIN_LIBRARIES - libgmock-main
-#
-# Accepts the following variables as input:
-#
-#   GMOCK_ROOT - (as a CMake or environment variable)
-#                The root directory of the gmock install prefix
-#
-#
-#-----------------------
-# Example Usage:
-#
-#    find_package(GMock REQUIRED)
-#    include_directories(${GMOCK_INCLUDE_DIRS})
-#
-#    add_executable(foo foo.cc)
-#    target_link_libraries(foo ${GMOCK_BOTH_LIBRARIES})
-#
-#=============================================================================
-# This file is released under the MIT licence:
-#
-# Copyright (c) 2011 Matej Svec
-#
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documentation files (the "Software"), to
-# deal in the Software without restriction, including without limitation the
-# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
-# sell copies of the Software, and to permit persons to whom the Software is
-# furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be included in
-# all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
-# IN THE SOFTWARE.
-#=============================================================================
-
-
-function(_gmock_append_debugs _endvar _library)
-  if(${_library} AND ${_library}_DEBUG)
-    set(_output optimized ${${_library}} debug ${${_library}_DEBUG})
-  else()
-    set(_output ${${_library}})
-  endif()
-  set(${_endvar} ${_output} PARENT_SCOPE)
-endfunction()
-
-function(_gmock_find_library _name)
-  find_library(${_name}
-    NAMES ${ARGN}
-    HINTS
-      $ENV{GMOCK_ROOT}
-      ${GMOCK_ROOT}
-    PATH_SUFFIXES ${_gmock_libpath_suffixes}
-  )
-  mark_as_advanced(${_name})
-endfunction()
-
-
-set(_gmock_libpath_suffixes lib)
-if(MSVC)
-  if(MSVC_VERSION GREATER 1400)
-    list(APPEND _gmock_libpath_suffixes
-      msvc/2010/Debug
-      msvc/2010/Release)
-  else()
-    list(APPEND _gmock_libpath_suffixes
-      msvc/2005/Debug
-      msvc/2005/Release)
-  endif()
-endif()
-
-find_path(GMOCK_INCLUDE_DIR gmock/gmock.h
-  HINTS
-    $ENV{GMOCK_ROOT}/include
-    ${GMOCK_ROOT}/include
-)
-mark_as_advanced(GMOCK_INCLUDE_DIR)
-
-_gmock_find_library(GMOCK_LIBRARY            gmock)
-_gmock_find_library(GMOCK_LIBRARY_DEBUG      gmockd)
-_gmock_find_library(GMOCK_MAIN_LIBRARY       gmock_main)
-_gmock_find_library(GMOCK_MAIN_LIBRARY_DEBUG gmock_maind)
-
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(GMock DEFAULT_MSG GMOCK_LIBRARY GMOCK_INCLUDE_DIR GMOCK_MAIN_LIBRARY)
-
-if(GMOCK_FOUND)
-  set(GMOCK_INCLUDE_DIRS ${GMOCK_INCLUDE_DIR})
-  _gmock_append_debugs(GMOCK_LIBRARIES      GMOCK_LIBRARY)
-  _gmock_append_debugs(GMOCK_MAIN_LIBRARIES GMOCK_MAIN_LIBRARY)
-  set(GMOCK_BOTH_LIBRARIES ${GMOCK_LIBRARIES} ${GMOCK_MAIN_LIBRARIES})
-endif()
-


[skip-ci][win] Use FATAL_ERROR instead of WARNING

--- cmake/modules/RootCPack.cmake
+++ cmake/modules/RootCPack.cmake
@@ -79,7 +79,7 @@
   elseif(MSVC_VERSION LESS 1940)
     math(EXPR VS_VERSION "${VC_MAJOR} - 2")
   else()
-    message(WARNING "MSVC_VERSION ${MSVC_VERSION} not implemented")
+    message(FATAL_ERROR "MSVC_VERSION ${MSVC_VERSION} not implemented")
   endif()
   set(COMPILER_NAME_VERSION ".vc${VS_VERSION}")
 else()


[python] compile numerics in C

[python] compile numerics in C

--- cmake/swig_python_tools.cmake
+++ cmake/swig_python_tools.cmake
@@ -95,10 +95,10 @@
     set(${COMPONENT}_SWIG_DEFS "-I${_dir};${${COMPONENT}_SWIG_DEFS}")
   endforeach()

-  IF(WITH_CXX OR NOT ${COMPONENT} MATCHES "numerics")
+  IF(WITH_CXX AND NOT ${COMPONENT} MATCHES "numerics")
     set_source_files_properties(${swig_file}
       PROPERTIES SWIG_FLAGS "${${COMPONENT}_SWIG_DEFS}" CPLUSPLUS ON)
-  ENDIF(WITH_CXX OR NOT ${COMPONENT} MATCHES "numerics")
+  ENDIF(WITH_CXX AND NOT ${COMPONENT} MATCHES "numerics")

   # --- build swig module ---
   swig_add_module(${_name} python ${swig_file})


Backup.

Backup.

--- cmake_modules/LPSCommon.cmake
+++ cmake_modules/LPSCommon.cmake
@@ -862,9 +862,9 @@
             file(APPEND ${CMAKE_BINARY_DIR}/${INSTALL_CONFIG_FILE} "\n")
             file(APPEND ${CMAKE_BINARY_DIR}/${INSTALL_CONFIG_FILE} "set(USE_VTK OFF CACHE BOOL \"Set ON to link against VTK libs\")\n")
             file(APPEND ${CMAKE_BINARY_DIR}/${INSTALL_CONFIG_FILE} "\n")
-            file(APPEND ${CMAKE_BINARY_DIR}/${INSTALL_CONFIG_FILE} "set(VTK_INC_DIR @SHEAFSYSTEM_HOME@/include/VTK CACHE PATH \"VTK library path\")\n")
+            file(APPEND ${CMAKE_BINARY_DIR}/${INSTALL_CONFIG_FILE} "set(VTK_INC_DIR @SHEAFSYSTEM_HOME@/include/vtk CACHE PATH \"VTK library path\")\n")
             file(APPEND ${CMAKE_BINARY_DIR}/${INSTALL_CONFIG_FILE} "\n")
-            file(APPEND ${CMAKE_BINARY_DIR}/${INSTALL_CONFIG_FILE} "set(VTK_LIB_DIR @SHEAFSYSTEM_HOME@/lib/VTK CACHE PATH \"VTK library path\")\n")
+            file(APPEND ${CMAKE_BINARY_DIR}/${INSTALL_CONFIG_FILE} "set(VTK_LIB_DIR @SHEAFSYSTEM_HOME@/lib/vtk CACHE PATH \"VTK library path\")\n")
             file(APPEND ${CMAKE_BINARY_DIR}/${INSTALL_CONFIG_FILE} "\n")
             file(APPEND ${CMAKE_BINARY_DIR}/${INSTALL_CONFIG_FILE} "set(VTK_LIBS ${VTK_LIBS} CACHE STRING \"VTK Libraries\")\n")
             file(APPEND ${CMAKE_BINARY_DIR}/${INSTALL_CONFIG_FILE} "\n")
@@ -888,9 +888,9 @@
     file(WRITE ${CMAKE_BINARY_DIR}/${EXPORTS_FILE}.in "${MASSAGED_OUTPUT}")
     file(APPEND ${CMAKE_BINARY_DIR}/${EXPORTS_FILE}.in "\n")
     if(WIN64MSVC OR WIN64INTEL)
-        file(APPEND ${CMAKE_BINARY_DIR}/${EXPORTS_FILE}.in "set(INSTALLED_VTK_LIB_DIR "\@SHEAFSYSTEM_HOME\@"/lib/VTK CACHE STRING \"VTK Base Dir\" FORCE)\n")
-        file(APPEND ${CMAKE_BINARY_DIR}/${EXPORTS_FILE}.in "set(VTK_BIN_DIR "\@SHEAFSYSTEM_HOME\@"/bin/VTK CACHE STRING \"VTK Base Dir\" FORCE)\n")
-        file(APPEND ${CMAKE_BINARY_DIR}/${EXPORTS_FILE}.in "set(VTK_INC_DIR "\@SHEAFSYSTEM_HOME\@"/include/VTK CACHE STRING \"VTK Base Dir\" FORCE)\n")
+        file(APPEND ${CMAKE_BINARY_DIR}/${EXPORTS_FILE}.in "set(INSTALLED_VTK_LIB_DIR "\@SHEAFSYSTEM_HOME\@"/lib/vtk CACHE STRING \"VTK Base Dir\" FORCE)\n")
+        file(APPEND ${CMAKE_BINARY_DIR}/${EXPORTS_FILE}.in "set(VTK_BIN_DIR "\@SHEAFSYSTEM_HOME\@"/bin/vtk CACHE STRING \"VTK Base Dir\" FORCE)\n")
+        file(APPEND ${CMAKE_BINARY_DIR}/${EXPORTS_FILE}.in "set(VTK_INC_DIR "\@SHEAFSYSTEM_HOME\@"/include/vtk CACHE STRING \"VTK Base Dir\" FORCE)\n")
     endif()
     file(APPEND ${CMAKE_BINARY_DIR}/${EXPORTS_FILE}.in "set(VTK_LIBS ${VTK_LIBS} CACHE STRING \"VTK Runtime Libraries\" FORCE)\n")
     file(APPEND ${CMAKE_BINARY_DIR}/${EXPORTS_FILE}.in "set(HDF_INCLUDE_DIR ${HDF_INCLUDE_DIR} CACHE STRING \"HDF Include Directory\" FORCE)\n")


Correct the find OpenCL for both cases

Correct the find OpenCL for both cases

--- cmake/FindOpenCL.cmake
+++ cmake/FindOpenCL.cmake
@@ -75,7 +75,7 @@

 find_path(OpenCL_INCLUDE_DIR
   NAMES
-    CL/cl.h OpenCL/cl.h
+    cl.h cl.h
   PATHS
     ENV "PROGRAMFILES(X86)"
     ENV AMDAPPSDKROOT
@@ -84,9 +84,12 @@
     ENV CUDA_PATH
     ENV ATISTREAMSDKROOT

+    /usr/include/CL
+    /usr/include/OpenCL
   PATH_SUFFIXES
     include
     OpenCL/common/inc
+    OpenCL
     "AMD APP/include")

 _FIND_OPENCL_VERSION()


OS X linking fix

OS X linking fix

--- cmake/TaichiCore.cmake
+++ cmake/TaichiCore.cmake
@@ -47,9 +47,15 @@
         message("Fetching runtimes..")
         execute_process(COMMAND git clone https://github.com/yuanming-hu/taichi_runtime ${CMAKE_CURRENT_SOURCE_DIR}/external/lib)
     endif()
-    target_link_libraries(${CORE_LIBRARY_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/external/lib/libembree.so.2)
-    target_link_libraries(${CORE_LIBRARY_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/external/lib/libtbb.so.2)
-    target_link_libraries(${CORE_LIBRARY_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/external/lib/libtbbmalloc.so.2)
+    if (APPLE)
+        target_link_libraries(${CORE_LIBRARY_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/external/lib/libembree.2.dylib)
+        target_link_libraries(${CORE_LIBRARY_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/external/lib/libtbb.dylib)
+        target_link_libraries(${CORE_LIBRARY_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/external/lib/libtbbmalloc.dylib)
+    else()
+        target_link_libraries(${CORE_LIBRARY_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/external/lib/libembree.so.2)
+        target_link_libraries(${CORE_LIBRARY_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/external/lib/libtbb.so.2)
+        target_link_libraries(${CORE_LIBRARY_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/external/lib/libtbbmalloc.so.2)
+    endif()
 endif ()
 if (MINGW)
     target_link_libraries(${CORE_LIBRARY_NAME} ws2_32)


CMake project option to copy executable dll dependencies

--- cmake/deftargets.cmake
+++ cmake/deftargets.cmake
@@ -195,7 +195,7 @@

     target_link_libraries(${NAME} ${linking} ${link_libraries})

-    if(SIPLASPLAS_COPY_DLL_DEPENDENCIES)
+    if(SIPLASPLAS_COPY_DLL_DEPENDENCIES AND (TARGET_TYPE STREQUAL "UNIT_TEST" OR TARGET_TYPE STREQUAL "EXECUTABLE"))
         copy_dll_dependencies(${NAME})
     endif()


r9221/sofa : cmake: include path to extlib/newmat

Former-commit-id: 97bbd596bcfc13f1b380475b910533d593d2b75c

--- cmake/pre-config.cmake
+++ cmake/pre-config.cmake
@@ -27,6 +27,7 @@
 if(EXTERNAL_HAVE_EIGEN2)
 	include_directories("${SOFA_EXTLIBS_DIR}/eigen-3.1.1")
 endif()
+include_directories("${SOFA_EXTLIBS_DIR}/newmat")

 ## Zlib
 if(EXTERNAL_HAVE_ZLIB)


Adding a warning about libquadmath's licensing

--- cmake/tests/Math.cmake
+++ cmake/tests/Math.cmake
@@ -184,8 +184,9 @@
     check_cxx_source_compiles("${QUADMATH_CODE}" EL_HAVE_QUADMATH)
     if(EL_HAVE_QUADMATH)
       set(EL_HAVE_QUAD TRUE)
+      message(WARNING "The usage of libquadmath effectively moves the Elemental build from the permissive New BSD License to the GPL; if this is not acceptable, it is necessary to reconfigure with the 'EL_DISABLE_QUAD=ON' option")
     else()
-      message(WARNING "Found quadmath lib but could not use it in C++")
+      message(WARNING "Found libquadmath but could not use it in C++")
     endif()
   endif()
 endif()


update ITK to v4.13.1

update ITK to v4.13.1

needed for Gcc 8.1 for instance

--- version_config.cmake
+++ version_config.cmake
@@ -79,7 +79,7 @@

 ## ITK
 set(ITK_URL https://itk.org/ITK.git)
-set(ITK_TAG v4.13.0)
+set(ITK_TAG v4.13.1)

 ## NiftyReg
 set(NiftyReg_URL https://git.code.sf.net/p/niftyreg/git )


added a slightly more rigorous find of the casacore header path - will need careful testing still

--- cmake/modules/FindCasaCore.cmake
+++ cmake/modules/FindCasaCore.cmake
@@ -57,9 +57,11 @@
 # mmm this only works by luck by the looks of things...!
 if (LAPACK_FOUND)
     set(CASACORE_LINKER_FLAGS ${LAPACK_LINKER_FLAGS})
-    find_path(CASACORE_INCLUDE_DIR casacore
+    find_path(CASACORE_INCLUDE_DIR MeasurementSets.h
         HINTS ${CASACORE_INC_DIR}
-        PATH_SUFFIXES include)
+        PATH_SUFFIXES casacore/ms ms)
+    get_filename_component(CASACORE_INCLUDE_DIR ${CASACORE_INCLUDE_DIR} DIRECTORY)
+    get_filename_component(CASACORE_INCLUDE_DIR ${CASACORE_INCLUDE_DIR} DIRECTORY)
     foreach (module ${casacore_modules})
         find_library(CASACORE_LIBRARY_${module} NAMES ${module}
            HINTS ${CASACORE_LIB_DIR}


[cmake] Skip regex when CMAKE_STATIC_LIBRARY_PREFIX is empty.

In platforms like Windows, there's no prefix for static libraries.
Interpolating it in the regex will end up with a regex "^", which seems
not to be valid. Since the regex was removing the prefix, we can simply
skip the operation and the result will be the same.

Also do the same for CMAKE_STATIC_LIBRARY_SUFFIX, even if in that case,
Windows will have a value (but if it is empty, it will fail trying to
create the regex).

--- cmake/modules/SwiftSupport.cmake
+++ cmake/modules/SwiftSupport.cmake
@@ -155,8 +155,12 @@
       add_dependencies(${target}-static ${AST_DEPENDS})
     endif()
     get_filename_component(ast_output_bn ${AST_OUTPUT} NAME)
-    string(REGEX REPLACE "^${CMAKE_STATIC_LIBRARY_PREFIX}" "" ast_output_bn ${ast_output_bn})
-    string(REGEX REPLACE "${CMAKE_STATIC_LIBRARY_SUFFIX}$" "" ast_output_bn ${ast_output_bn})
+    if(NOT CMAKE_STATIC_LIBRARY_PREFIX STREQUAL "")
+      string(REGEX REPLACE "^${CMAKE_STATIC_LIBRARY_PREFIX}" "" ast_output_bn ${ast_output_bn})
+    endif()
+    if(NOT CMAKE_STATIC_LIBRARY_SUFFIX STREQUAL "")
+      string(REGEX REPLACE "${CMAKE_STATIC_LIBRARY_SUFFIX}$" "" ast_output_bn ${ast_output_bn})
+    endif()
     get_filename_component(ast_output_dn ${AST_OUTPUT} DIRECTORY)
     set_target_properties(${target}-static
                           PROPERTIES


remove hunter_add_package

remove hunter_add_package

--- cmake/projects/dlib/hunter.cmake
+++ cmake/projects/dlib/hunter.cmake
@@ -11,7 +11,6 @@
 include(hunter_add_version)
 include(hunter_download)
 include(hunter_pick_scheme)
-include(hunter_add_package)

 # List of versions here...
 hunter_add_version(


deactivated test

deactivated test

--- Modules/DiffusionImaging/Testing/files.cmake
+++ Modules/DiffusionImaging/Testing/files.cmake
@@ -4,5 +4,5 @@

 SET(MODULE_CUSTOM_TESTS
   mitkFiberBundleXReaderWriterTest.cpp
-  mitkFiberBundleXTest.cpp
+  # mitkFiberBundleXTest.cpp ## deactivated, see bug 12017
 )


Explicitly enable C++11 when building google test

Per the GTest documentation it is expected C++11 is enabled at
configuration time. It is also marked as a required feature when using
the library.

--- CMake/sitkUseGTest.cmake
+++ CMake/sitkUseGTest.cmake
@@ -30,6 +30,10 @@
   set(CMAKE_C_VISIBILITY_PRESET)
   set(CMAKE_CXX_VISIBILITY_PRESET)
   set(CMAKE_VISIBILITY_INLINES_HIDDEN)
+
+  set(CMAKE_CXX_STANDARD 11)
+  set(CMAKE_CXX_STANDARD_REQUIRED ON)
+

   set(BUILD_GTEST                 ON )
   set(BUILD_GMOCK                 OFF)
@@ -70,6 +74,9 @@

     _sitk_gtest_use_gtest_source()

+    target_compile_features(${GTEST_LIBRARIES} PUBLIC cxx_std_11)
+    target_compile_features(${GTEST_MAIN_LIBRARIES} PUBLIC cxx_std_11)
+
     add_library(GTest::GTest ALIAS ${GTEST_LIBRARIES})
     add_library(GTest::Main ALIAS ${GTEST_MAIN_LIBRARIES})


Ignore test tutorial-math-goftest for fix location installations

--- tutorials/CTestCustom.cmake
+++ tutorials/CTestCustom.cmake
@@ -2,3 +2,7 @@
 if(WIN32)
   list(APPEND CTEST_CUSTOM_TESTS_IGNORE tutorial-roofit-rf509_wsinteractive)   #  workspaces as namespace does not work on windows
 endif()
+
+if("$ENV{MODE}" STREQUAL "install") # libraires installed in fix location <prefix>/lib/root
+  list(APPEND CTEST_CUSTOM_TESTS_IGNORE tutorial-math-goftest)
+endif()


CMake: add dotscene plugin and imgui support to feature summary

--- CMake/FeatureSummary.cmake
+++ CMake/FeatureSummary.cmake
@@ -26,6 +26,10 @@
 endif ()
 if (OGRE_BUILD_COMPONENT_OVERLAY)
 	set(_components "${_components}  + Overlay\n")
+
+    if (OGRE_BUILD_COMPONENT_OVERLAY_IMGUI)
+        set(_components "${_components}  + Overlay Dear Imgui\n")
+    endif ()
 endif ()
 if (OGRE_BUILD_COMPONENT_PAGING)
 	set(_components "${_components}  + Paging\n")
@@ -89,6 +93,9 @@
 endif ()
 if (OGRE_BUILD_PLUGIN_PFX)
 	set(_plugins "${_plugins}  + Particle FX\n")
+endif ()
+if (OGRE_BUILD_PLUGIN_DOT_SCENE)
+	set(_plugins "${_plugins}  + DotScene loader\n")
 endif ()

 if (DEFINED _plugins)