FindBoost.cmake updated to 1.18 from CMake CVS to test new BOOST_ROOT behavior.

git-svn-id: 9be72bd8b79bf6944680671de68cae08993c9086@1588 fa922fa7-2fde-0310-acd8-f43f465a7996

--- src/CMake/boost/FindBoost.cmake
+++ src/CMake/boost/FindBoost.cmake
@@ -5,20 +5,14 @@
 #     SET(Boost_USE_MULTITHREAD OFF)
 #     FIND_PACKAGE( Boost 1.34.1 COMPONENTS date_time filesystem iostreams ... )
 #
-# The Boost_ADDITIONAL_VERSIONS variable can be used to specify a list of
-# boost version numbers that should be taken into account when searching
-# for the libraries. Unfortunately boost puts the version number into the
-# actual filename for the libraries, so this might be needed in the future
-# when new Boost versions are released.
-#
-# Currently this module searches for the following version numbers:
-# 1.33, 1.33.0, 1.33.1, 1.34, 1.34.0, 1.34.1, 1.35, 1.35.0, 1.35.1, 1.36,
-# 1.36.0, 1.36.1
+#     INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS})
+#     ADD_EXECUTABLE(foo foo.cc)
+#     TARGET_LINK_LIBRARIES(foo ${Boost_LIBRARIES})
 #
 # The components list needs to be the actual names of boost libraries, that is
 # the part of the actual library files that differ on different libraries. So
 # its "date_time" for "libboost_date_time...". Anything else will result in
-# errors
+# errors.
 #
 # You can provide a minimum version number that should be used. If you provide this
 # version number and specify the REQUIRED attribute, this module will fail if it
@@ -26,25 +20,59 @@
 # automatically put into the considered list of version numbers and thus doesn't need
 # to be specified in the Boost_ADDITIONAL_VERSIONS variable
 #
+# =========== The mess that is Boost_ADDITIONAL_VERSIONS (sorry?) ============
+#
+# OK, so the Boost_ADDITIONAL_VERSIONS variable can be used to specify a list of
+# boost version numbers that should be taken into account when searching
+# for Boost. Unfortunately boost puts the version number into the
+# actual filename for the libraries, so this variable will certainly be needed
+# in the future when new Boost versions are released.  CMake will one day have glob
+# or regex support for FIND_LIBRARY() after which this variable will
+# likely be ignored.
+#
+# Currently this module searches for the following version numbers:
+# 1.33, 1.33.0, 1.33.1, 1.34, 1.34.0, 1.34.1, 1.35, 1.35.0, 1.35.1,
+# 1.36, 1.36.0, 1.36.1, 1.37, 1.37.0
+#
+# NOTE: If you add a new major 1.x version in Boost_ADDITIONAL_VERSIONS you should
+# add both 1.x and 1.x.0 as shown above.
+#
+# SET(Boost_ADDITIONAL_VERSIONS "0.99" "0.99.0" "1.78" "1.78.0")
+#
+# One day in the near future this will no longer be necessary and which
+# version gets selected will depend completely on how you call FIND_PACKAGE().
+#
+# ============================================================================
+#
 # Variables used by this module, they can change the default behaviour and need to be set
 # before calling find_package:
+#
 #  Boost_USE_MULTITHREAD         Can be set to OFF to use the non-multithreaded
 #                                boost libraries. Defaults to ON.
+#
 #  Boost_USE_STATIC_LIBS         Can be set to ON to force the use of the static
 #                                boost libraries. Defaults to OFF.
+#
+# Other Variables used by this module which you may want to set.
+#
 #  Boost_ADDITIONAL_VERSIONS     A list of version numbers to use for searching
-#                                the boost include directory. The default list
-#                                of version numbers is:
-#                                1.33, 1.33.0, 1.33.1, 1.34, 1.34.0, 1.34.1,
-#                                1.35, 1.35.0, 1.35.1, 1.36, 1.36.0, 1.36.1
-#                                If you want to look for an older or newer
-#                                version set this variable to a list of
-#                                strings, where each string contains a number, i.e.
-#                                SET(Boost_ADDITIONAL_VERSIONS "0.99.0" "1.35.0")
+#                                the boost include directory.  Please see
+#                                the documentation above regarding this
+#                                annoying variable :(
+#
+#  Boost_DEBUG                   Set this to TRUE to enable debugging output
+#                                of FindBoost.cmake if you are having problems.
+#                                Please enable this and include the output in any bug reports.
+#
+#  Boost_COMPILER                Set this to the compiler suffix used by boost (e.g. -gcc43) if the
+#                                module has problems finding the proper Boost installation
+#
 #  BOOST_ROOT or BOOSTROOT       Preferred installation prefix for searching for Boost,
 #                                set this if the module has problems finding the proper Boost installation
+#
 #  BOOST_INCLUDEDIR              Set this to the include directory of Boost, if the
 #                                module has problems finding the proper Boost installation
+#
 #  BOOST_LIBRARYDIR              Set this to the lib directory of Boost, if the
 #                                module has problems finding the proper Boost installation
 #
@@ -55,17 +83,27 @@
 #
 #  Boost_FOUND                          System has Boost, this means the include dir was found,
 #                                       as well as all the libraries specified in the COMPONENTS list
+#
 #  Boost_INCLUDE_DIRS                   Boost include directories, not cached
+#
 #  Boost_INCLUDE_DIR                    This is almost the same as above, but this one is cached and may be
 #                                       modified by advanced users
+#
 #  Boost_LIBRARIES                      Link these to use the Boost libraries that you specified, not cached
+#
 #  Boost_LIBRARY_DIRS                   The path to where the Boost library files are.
+#
 #  Boost_VERSION                        The version number of the boost libraries that have been found,
 #                                       same as in version.hpp from Boost
+#
 #  Boost_LIB_VERSION                    The version number in filename form as its appended to the library filenames
+#
 #  Boost_MAJOR_VERSION                  major version number of boost
+#
 #  Boost_MINOR_VERSION                  minor version number of boost
+#
 #  Boost_SUBMINOR_VERSION               subminor version number of boost
+#
 #  Boost_LIB_DIAGNOSTIC_DEFINITIONS     Only set on windows. Can be used with add_definitions
 #                                       to print diagnostic information about the automatic
 #                                       linking done on windows.
@@ -94,20 +132,38 @@
 OPTION(Boost_USE_MULTITHREADED
   "Use the multithreaded versions of the Boost libraries" ON)

-if (Boost_FIND_VERSION_EXACT)
-  if (Boost_FIND_VERSION_PATCH)
-    set( _boost_TEST_VERSIONS
-      "${Boost_FIND_VERSION_MAJOR}.${Boost_FIND_VERSION_MINOR}.${Boost_FIND_VERSION_PATCH}")
-  else (Boost_FIND_VERSION_PATCH)
-    set( _boost_TEST_VERSIONS
-      "${Boost_FIND_VERSION_MAJOR}.${Boost_FIND_VERSION_MINOR}.0"
-      "${Boost_FIND_VERSION_MAJOR}.${Boost_FIND_VERSION_MINOR}")
-  endif (Boost_FIND_VERSION_PATCH)
-else (Boost_FIND_VERSION_EXACT)
-  set( _boost_TEST_VERSIONS ${Boost_ADDITIONAL_VERSIONS}
-    "1.36.1" "1.36.0" "1.36" "1.35.1" "1.35.0" "1.35" "1.34.1" "1.34.0"
-    "1.34" "1.33.1" "1.33.0" "1.33" )
-endif (Boost_FIND_VERSION_EXACT)
+if(Boost_FIND_VERSION_EXACT)
+  # The version may appear in a directory with or without the patch
+  # level, even when the patch level is non-zero.
+  set(_boost_TEST_VERSIONS
+    "${Boost_FIND_VERSION_MAJOR}.${Boost_FIND_VERSION_MINOR}.${Boost_FIND_VERSION_PATCH}"
+    "${Boost_FIND_VERSION_MAJOR}.${Boost_FIND_VERSION_MINOR}")
+else(Boost_FIND_VERSION_EXACT)
+  # The user has not requested an exact version.  Among known
+  # versions, find those that are acceptable to the user request.
+  set(_Boost_KNOWN_VERSIONS ${Boost_ADDITIONAL_VERSIONS}
+    "1.37.0" "1.37"
+    "1.36.1" "1.36.0" "1.36" "1.35.1" "1.35.0" "1.35" "1.34.1" "1.34.0"
+    "1.34" "1.33.1" "1.33.0" "1.33")
+  set(_boost_TEST_VERSIONS)
+  if(Boost_FIND_VERSION)
+    set(_Boost_FIND_VERSION_SHORT "${Boost_FIND_VERSION_MAJOR}.${Boost_FIND_VERSION_MINOR}")
+    # Select acceptable versions.
+    foreach(version ${_Boost_KNOWN_VERSIONS})
+      if(NOT "${version}" VERSION_LESS "${Boost_FIND_VERSION}")
+        # This version is high enough.
+        list(APPEND _boost_TEST_VERSIONS "${version}")
+      elseif("${version}.99" VERSION_EQUAL "${_Boost_FIND_VERSION_SHORT}.99")
+        # This version is a short-form for the requested version with
+        # the patch level dropped.
+        list(APPEND _boost_TEST_VERSIONS "${version}")
+      endif()
+    endforeach(version)
+  else(Boost_FIND_VERSION)
+    # Any version is acceptable.
+    set(_boost_TEST_VERSIONS "${_Boost_KNOWN_VERSIONS}")
+  endif(Boost_FIND_VERSION)
+endif(Boost_FIND_VERSION_EXACT)

 # The reason that we failed to find Boost. This will be set to a
 # user-friendly message when we fail to find some necessary piece of
@@ -199,8 +255,19 @@
     MATH(EXPR Boost_MINOR_VERSION "${Boost_VERSION} / 100 % 1000")
     MATH(EXPR Boost_SUBMINOR_VERSION "${Boost_VERSION} % 100")
   ENDIF(Boost_VERSION AND NOT "${Boost_VERSION}" STREQUAL "0")
+  if(Boost_DEBUG)
+      message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
+                     "boost ${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION} "
+                     "is already in the cache.  For debugging messages, please clear the cache.")
+  endif()
 ELSE (_boost_IN_CACHE)
   # Need to search for boost
+  if(Boost_DEBUG)
+      message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
+                     "boost not in cache")
+      message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
+                     "_boost_TEST_VERSIONS = ${_boost_TEST_VERSIONS}")
+  endif()

   IF(WIN32)
     # In windows, automatic linking is performed, so you do not have
@@ -226,18 +293,9 @@

   SET(_boost_INCLUDE_SEARCH_DIRS
     C:/boost/include
-    "C:/boost"
-    "$ENV{ProgramFiles}/boost/boost_${Boost_FIND_VERSION_MAJOR}_${Boost_FIND_VERSION_MINOR}_${Boost_FIND_VERSION_PATCH}"
-    "$ENV{ProgramFiles}/Boost"
+    C:/boost
+    "$ENV{ProgramFiles}/boost"
     /sw/local/include
-  )
-
-  SET(_boost_LIBRARIES_SEARCH_DIRS
-    C:/boost/lib
-    "C:/boost"
-    "$ENV{ProgramFiles}/boost/boost_${Boost_FIND_VERSION_MAJOR}_${Boost_FIND_VERSION_MINOR}_${Boost_FIND_VERSION_PATCH}/lib"
-    "$ENV{ProgramFiles}/Boost"
-    /sw/local/lib
   )

   # If BOOST_ROOT was defined in the environment, use it.
@@ -254,22 +312,34 @@
   IF( NOT $ENV{BOOST_INCLUDEDIR} STREQUAL "" )
     set(BOOST_INCLUDEDIR $ENV{BOOST_INCLUDEDIR})
   ENDIF( NOT $ENV{BOOST_INCLUDEDIR} STREQUAL "" )
-
+
   # If BOOST_LIBRARYDIR was defined in the environment, use it.
   IF( NOT $ENV{BOOST_LIBRARYDIR} STREQUAL "" )
     set(BOOST_LIBRARYDIR $ENV{BOOST_LIBRARYDIR})
   ENDIF( NOT $ENV{BOOST_LIBRARYDIR} STREQUAL "" )
-
+
   IF( BOOST_ROOT )
     file(TO_CMAKE_PATH ${BOOST_ROOT} BOOST_ROOT)
+  ENDIF( BOOST_ROOT )
+
+  if(Boost_DEBUG)
+    message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
+                   "Declared as CMake or Environmental Variables:")
+    message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
+                   "  BOOST_ROOT = ${BOOST_ROOT}")
+    message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
+                   "  BOOST_INCLUDEDIR = ${BOOST_INCLUDEDIR}")
+    message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
+                   "  BOOST_LIBRARYDIR = ${BOOST_LIBRARYDIR}")
+    message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
+                   "_boost_TEST_VERSIONS = ${_boost_TEST_VERSIONS}")
+  endif()
+
+  IF( BOOST_ROOT )
     SET(_boost_INCLUDE_SEARCH_DIRS
       ${BOOST_ROOT}/include
       ${BOOST_ROOT}
       ${_boost_INCLUDE_SEARCH_DIRS})
-    SET(_boost_LIBRARIES_SEARCH_DIRS
-      ${BOOST_ROOT}/lib
-      ${BOOST_ROOT}/stage/lib
-      ${_boost_LIBRARIES_SEARCH_DIRS})
   ENDIF( BOOST_ROOT )

   IF( BOOST_INCLUDEDIR )
@@ -278,12 +348,9 @@
       ${BOOST_INCLUDEDIR} ${_boost_INCLUDE_SEARCH_DIRS})
   ENDIF( BOOST_INCLUDEDIR )

-  IF( BOOST_LIBRARYDIR )
-    file(TO_CMAKE_PATH ${BOOST_LIBRARYDIR} BOOST_LIBRARYDIR)
-    SET(_boost_LIBRARIES_SEARCH_DIRS
-      ${BOOST_LIBRARYDIR} ${_boost_LIBRARIES_SEARCH_DIRS})
-  ENDIF( BOOST_LIBRARYDIR )
-
+  # ------------------------------------------------------------------------
+  #  Search for Boost include DIR
+  # ------------------------------------------------------------------------
   # Try to find Boost by stepping backwards through the Boost versions
   # we know about.
   IF( NOT Boost_INCLUDE_DIR )
@@ -293,38 +360,45 @@
       # Add in a path suffix, based on the required version, ideally
       # we could read this from version.hpp, but for that to work we'd
       # need to know the include dir already
-      set(_boost_PATH_SUFFIX ${_boost_VER})
-
-      IF(_boost_PATH_SUFFIX MATCHES "[0-9]+\\.[0-9]+\\.[0-9]+")
+      set(_boost_BOOSTIFIED_VERSION)
+
+      # Transform 1.35 => 1_35 and 1.36.0 => 1_36_0
+      IF(_boost_VER MATCHES "[0-9]+\\.[0-9]+\\.[0-9]+")
           STRING(REGEX REPLACE "([0-9]+)\\.([0-9]+)\\.([0-9]+)" "\\1_\\2_\\3"
-            _boost_PATH_SUFFIX ${_boost_PATH_SUFFIX})
-      ELSEIF(_boost_PATH_SUFFIX MATCHES "[0-9]+\\.[0-9]+")
+            _boost_BOOSTIFIED_VERSION ${_boost_VER})
+      ELSEIF(_boost_VER MATCHES "[0-9]+\\.[0-9]+")
           STRING(REGEX REPLACE "([0-9]+)\\.([0-9]+)" "\\1_\\2"
-            _boost_PATH_SUFFIX ${_boost_PATH_SUFFIX})
-      ENDIF(_boost_PATH_SUFFIX MATCHES "[0-9]+\\.[0-9]+\\.[0-9]+")
-      LIST(APPEND _boost_PATH_SUFFIXES "boost-${_boost_PATH_SUFFIX}")
-      LIST(APPEND _boost_PATH_SUFFIXES "boost_${_boost_PATH_SUFFIX}")
+            _boost_BOOSTIFIED_VERSION ${_boost_VER})
+      ENDIF()
+
+      LIST(APPEND _boost_PATH_SUFFIXES "boost-${_boost_BOOSTIFIED_VERSION}")
+      IF(WIN32)
+        # Yay Boost Pro!  We dig your underscores.
+        LIST(APPEND _boost_PATH_SUFFIXES "boost_${_boost_BOOSTIFIED_VERSION}")
+      ENDIF()
+
     ENDFOREACH(_boost_VER)
+
+    if(Boost_DEBUG)
+      message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
+                     "Include debugging info:")
+      message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
+                     "  _boost_INCLUDE_SEARCH_DIRS = ${_boost_INCLUDE_SEARCH_DIRS}")
+      message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
+                     "  _boost_PATH_SUFFIXES = ${_boost_PATH_SUFFIXES}")
+    endif()

     # Look for a standard boost header file.
-	if (BOOST_ROOT)
     FIND_PATH(Boost_INCLUDE_DIR
       NAMES         boost/config.hpp
       HINTS         ${_boost_INCLUDE_SEARCH_DIRS}
       PATH_SUFFIXES ${_boost_PATH_SUFFIXES}
-      NO_CMAKE_PATH
-      NO_CMAKE_ENVIRONMENT_PATH
-      NO_SYSTEM_ENVIRONMENT_PATH
-      NO_CMAKE_SYSTEM_PATH
-	  )
-    else (BOOST_ROOT)
-	FIND_PATH(Boost_INCLUDE_DIR
-      NAMES         boost/config.hpp
-      HINTS         ${_boost_INCLUDE_SEARCH_DIRS}
-      PATH_SUFFIXES ${_boost_PATH_SUFFIXES}
       )
-	endif(BOOST_ROOT)
   ENDIF( NOT Boost_INCLUDE_DIR )
+
+  # ------------------------------------------------------------------------
+  #  Extract version information from version.hpp
+  # ------------------------------------------------------------------------

   IF(Boost_INCLUDE_DIR)
     # Extract Boost_VERSION and Boost_LIB_VERSION from version.hpp
@@ -333,6 +407,10 @@
     SET(BOOST_VERSION 0)
     SET(BOOST_LIB_VERSION "")
     FILE(READ "${Boost_INCLUDE_DIR}/boost/version.hpp" _boost_VERSION_HPP_CONTENTS)
+    if(Boost_DEBUG)
+      message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
+                     "location of version.hpp: ${Boost_INCLUDE_DIR}/boost/version.hpp")
+    endif()

     STRING(REGEX REPLACE ".*#define BOOST_VERSION ([0-9]+).*" "\\1" Boost_VERSION "${_boost_VERSION_HPP_CONTENTS}")
     STRING(REGEX REPLACE ".*#define BOOST_LIB_VERSION \"([0-9_]+)\".*" "\\1" Boost_LIB_VERSION "${_boost_VERSION_HPP_CONTENTS}")
@@ -348,72 +426,99 @@
       set(Boost_ERROR_REASON
           "${Boost_ERROR_REASON}Boost version: ${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}\nBoost include path: ${Boost_INCLUDE_DIR}")
     ENDIF(NOT "${Boost_VERSION}" STREQUAL "0")
+    if(Boost_DEBUG)
+      message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
+                     "version.hpp reveals boost "
+                     "${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}")
+    endif()
   ELSE(Boost_INCLUDE_DIR)
     set(Boost_ERROR_REASON
       "${Boost_ERROR_REASON}Unable to find the Boost header files. Please set BOOST_ROOT to the root directory containing Boost or BOOST_INCLUDEDIR to the directory containing Boost's headers.")
   ENDIF(Boost_INCLUDE_DIR)
+
+  # ------------------------------------------------------------------------
+  #  Suffix initialization and compiler suffix detection.
+  # ------------------------------------------------------------------------

   # Setting some more suffixes for the library
   SET (Boost_LIB_PREFIX "")
   IF ( WIN32 AND Boost_USE_STATIC_LIBS )
     SET (Boost_LIB_PREFIX "lib")
   ENDIF ( WIN32 AND Boost_USE_STATIC_LIBS )
-  SET (_boost_COMPILER "-gcc")
-  IF (MSVC90)
-    SET (_boost_COMPILER "-vc90")
-  ELSEIF (MSVC80)
-    SET (_boost_COMPILER "-vc80")
-  ELSEIF (MSVC71)
-    SET (_boost_COMPILER "-vc71")
-  ENDIF(MSVC90)
-  IF (MINGW)
-    EXEC_PROGRAM(${CMAKE_CXX_COMPILER}
-      ARGS -dumpversion
-      OUTPUT_VARIABLE _boost_COMPILER_VERSION
-      )
-    STRING(REGEX REPLACE "([0-9])\\.([0-9])\\.[0-9]" "\\1\\2"
-      _boost_COMPILER_VERSION ${_boost_COMPILER_VERSION})
-    SET (_boost_COMPILER "-mgw${_boost_COMPILER_VERSION}")
-  ENDIF(MINGW)
-  IF (UNIX)
-    IF (NOT CMAKE_COMPILER_IS_GNUCC)
-      # We assume that we have the Intel compiler.
-      SET (_boost_COMPILER "-il")
-    ELSE (NOT CMAKE_COMPILER_IS_GNUCC)
-      # Determine which version of GCC we have.
+
+  if (Boost_COMPILER)
+    set(_boost_COMPILER ${Boost_COMPILER})
+    if(Boost_DEBUG)
+      message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
+                     "using user-specified _boost_COMPILER = ${_boost_COMPILER}")
+    endif()
+  else(Boost_COMPILER)
+    # Attempt to guess the compiler suffix
+    SET (_boost_COMPILER "-gcc")
+    IF (MSVC90)
+      SET (_boost_COMPILER "-vc90")
+    ELSEIF (MSVC80)
+      SET (_boost_COMPILER "-vc80")
+    ELSEIF (MSVC71)
+      SET (_boost_COMPILER "-vc71")
+    ENDIF(MSVC90)
+    IF (MINGW)
       EXEC_PROGRAM(${CMAKE_CXX_COMPILER}
         ARGS -dumpversion
         OUTPUT_VARIABLE _boost_COMPILER_VERSION
         )
-      STRING(REGEX REPLACE "([0-9])\\.([0-9])\\.[0-9]" "\\1\\2"
+      STRING(REGEX REPLACE "([0-9])\\.([0-9])(\\.[0-9])?" "\\1\\2"
         _boost_COMPILER_VERSION ${_boost_COMPILER_VERSION})
-      IF(APPLE)
-        IF(Boost_MINOR_VERSION)
-          IF(${Boost_MINOR_VERSION} GREATER 35)
-            # In Boost 1.36.0 and newer, the mangled compiler name used
-            # on Mac OS X/Darwin is "xgcc".
-            SET(_boost_COMPILER "-xgcc${_boost_COMPILER_VERSION}")
-          ELSE(${Boost_MINOR_VERSION} GREATER 35)
-            # In Boost <= 1.35.0, there is no mangled compiler name for
-            # the Mac OS X/Darwin version of GCC.
+      SET (_boost_COMPILER "-mgw${_boost_COMPILER_VERSION}")
+    ENDIF(MINGW)
+    IF (UNIX)
+      IF (NOT CMAKE_COMPILER_IS_GNUCC)
+        # We assume that we have the Intel compiler.
+        SET (_boost_COMPILER "-il")
+      ELSE (NOT CMAKE_COMPILER_IS_GNUCC)
+        # Determine which version of GCC we have.
+        EXEC_PROGRAM(${CMAKE_CXX_COMPILER}
+          ARGS ${CMAKE_CXX_COMPILER_ARG1} -dumpversion
+          OUTPUT_VARIABLE _boost_COMPILER_VERSION
+          )
+        STRING(REGEX REPLACE "([0-9])\\.([0-9])(\\.[0-9])?" "\\1\\2"
+          _boost_COMPILER_VERSION ${_boost_COMPILER_VERSION})
+        IF(APPLE)
+          IF(Boost_MINOR_VERSION)
+            IF(${Boost_MINOR_VERSION} GREATER 35)
+              # In Boost 1.36.0 and newer, the mangled compiler name used
+              # on Mac OS X/Darwin is "xgcc".
+              SET(_boost_COMPILER "-xgcc${_boost_COMPILER_VERSION}")
+            ELSE(${Boost_MINOR_VERSION} GREATER 35)
+              # In Boost <= 1.35.0, there is no mangled compiler name for
+              # the Mac OS X/Darwin version of GCC.
+              SET(_boost_COMPILER "")
+            ENDIF(${Boost_MINOR_VERSION} GREATER 35)
+          ELSE(Boost_MINOR_VERSION)
+            # We don't know the Boost version, so assume it's
+            # pre-1.36.0.
             SET(_boost_COMPILER "")
-          ENDIF(${Boost_MINOR_VERSION} GREATER 35)
-        ELSE(Boost_MINOR_VERSION)
-          # We don't know the Boost version, so assume it's
-          # pre-1.36.0.
-          SET(_boost_COMPILER "")
-        ENDIF(Boost_MINOR_VERSION)
-      ELSE()
-        SET (_boost_COMPILER "-gcc${_boost_COMPILER_VERSION}")
-      ENDIF()
-    ENDIF (NOT CMAKE_COMPILER_IS_GNUCC)
-  ENDIF(UNIX)
+          ENDIF(Boost_MINOR_VERSION)
+        ELSE()
+          SET (_boost_COMPILER "-gcc${_boost_COMPILER_VERSION}")
+        ENDIF()
+      ENDIF (NOT CMAKE_COMPILER_IS_GNUCC)
+    ENDIF(UNIX)
+    if(Boost_DEBUG)
+      message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
+        "guessed _boost_COMPILER = ${_boost_COMPILER}")
+    endif()
+  endif(Boost_COMPILER)

   SET (_boost_MULTITHREADED "-mt")

   IF( NOT Boost_USE_MULTITHREADED )
     SET (_boost_MULTITHREADED "")
   ENDIF( NOT Boost_USE_MULTITHREADED )
+  if(Boost_DEBUG)
+    message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
+      "_boost_MULTITHREADED = ${_boost_MULTITHREADED}")
+  endif()

   SET( _boost_STATIC_TAG "")
   IF (WIN32)
@@ -426,9 +531,42 @@
   ENDIF(WIN32)
   SET (_boost_ABI_TAG "${_boost_ABI_TAG}d")

+  if(Boost_DEBUG)
+    message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
+      "_boost_STATIC_TAG = ${_boost_STATIC_TAG}")
+    message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
+      "_boost_ABI_TAG = ${_boost_ABI_TAG}")
+  endif()
+
   # ------------------------------------------------------------------------
   #  Begin finding boost libraries
   # ------------------------------------------------------------------------
+
+  SET(_boost_LIBRARIES_SEARCH_DIRS
+    C:/boost/lib
+    C:/boost
+    "$ENV{ProgramFiles}/boost/boost_${Boost_MAJOR_VERSION}_${Boost_MINOR_VERSION}_${Boost_SUBMINOR_VERSION}/lib"
+    "$ENV{ProgramFiles}/boost"
+    /sw/local/lib
+  )
+  IF( BOOST_ROOT )
+    SET(_boost_LIBRARIES_SEARCH_DIRS
+      ${BOOST_ROOT}/lib
+      ${BOOST_ROOT}/stage/lib
+      ${_boost_LIBRARIES_SEARCH_DIRS})
+  ENDIF( BOOST_ROOT )
+
+  IF( BOOST_LIBRARYDIR )
+    file(TO_CMAKE_PATH ${BOOST_LIBRARYDIR} BOOST_LIBRARYDIR)
+    SET(_boost_LIBRARIES_SEARCH_DIRS
+      ${BOOST_LIBRARYDIR} ${_boost_LIBRARIES_SEARCH_DIRS})
+  ENDIF( BOOST_LIBRARYDIR )
+
+  if(Boost_DEBUG)
+    message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
+      "_boost_LIBRARIES_SEARCH_DIRS = ${_boost_LIBRARIES_SEARCH_DIRS}")
+  endif()
+
   FOREACH(COMPONENT ${Boost_FIND_COMPONENTS})
     STRING(TOUPPER ${COMPONENT} UPPERCOMPONENT)
     SET( Boost_${UPPERCOMPONENT}_LIBRARY "Boost_${UPPERCOMPONENT}_LIBRARY-NOTFOUND" )
@@ -548,6 +686,10 @@
         endif(NOT Boost_${COMPONENT}_FOUND)
       endforeach(COMPONENT)
     endif (Boost_FOUND)
+
+    if(Boost_DEBUG)
+      message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] Boost_FOUND = ${Boost_FOUND}")
+    endif()

     if (_Boost_MISSING_COMPONENTS)
       # We were unable to find some libraries, so generate a sensible


FIX: defaults to Debug if build type in unset

--- CMakeLists.default.cmake
+++ CMakeLists.default.cmake
@@ -6,6 +6,13 @@

 add_custom_target(uninstall
     COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/dist/cmake_uninstall.cmake)
+
+if (NOT CMAKE_BUILD_TYPE)
+	set(CMAKE_BUILD_TYPE Debug CACHE STRING
+      	"Choose the type of build, options are: Debug Release."
+      	FORCE
+	)
+endif(NOT CMAKE_BUILD_TYPE)

 if (CMAKE_COMPILER_IS_GNUCXX)
 	set(CMAKE_C_FLAGS "-Wall -Wshadow -Wconversion -Wno-sign-conversion -fstrict-aliasing -fstack-protector-all -std=c99 ${CMAKE_USER_C_FLAGS}" CACHE STRING


LibFindMacros 2.0 - released 2014-05-30.

- Development moved to https://github.com/Tronic/cmake-modules
- Remains compatible with older versions (drop-in replacement)
- Removed backwards compatibility with CMake older than 2.8
- Using function() rather than macro() where applicable
- Major code cleanup for better readability and more flexibility
- Added package version checks to libfind_process
- If a library fails to detect, none of its config options are hidden
- Added libfind_version_header for easy parsing of version.h
- Made pkg-config search QUIET
- Heavily improved error/warning messages on libfind_process

--- LibFindMacros.cmake
+++ LibFindMacros.cmake
@@ -1,46 +1,84 @@
-# Version 1.0 (2013-04-12)
-# Public Domain, originally written by Lasse Kärkkäinen <tronic@zi.fi>
-# Published at http://www.cmake.org/Wiki/CMake:How_To_Find_Libraries
-
-# If you improve the script, please modify the forementioned wiki page because
-# I no longer maintain my scripts (hosted as static files at zi.fi). Feel free
-# to remove this entire header if you use real version control instead.
-
-# Changelog:
-# 2013-04-12  Added version number (1.0) and this header, no other changes
-# 2009-10-08  Originally published
-
-
-# Works the same as find_package, but forwards the "REQUIRED" and "QUIET" arguments
-# used for the current package. For this to work, the first parameter must be the
-# prefix of the current package, then the prefix of the new package etc, which are
-# passed to find_package.
+# Version 2.0 (2013-04-12)
+# Public Domain, originally written by Lasse Kärkkäinen <tronic>
+# Maintained at https://github.com/Tronic/cmake-modules
+# Please send your improvements as pull requests on Github.
+
+# Version (none) - originally published on 2009-10-08 on Kitware Public Wiki
+# Version 1.0 - update on Kitware Public Wiki
+# - Added a version number and a fancy header with license and authorship data,
+#   no other changes.
+# Version 2.0 - released 2014-05-30
+# - Development moved to https://github.com/Tronic/cmake-modules
+# - Remains compatible with older versions (drop-in replacement)
+# - Removed backwards compatibility with CMake older than 2.8
+# - Using function() rather than macro() where applicable
+# - Major code cleanup for better readability and more flexibility
+# - Added package version checks to libfind_process
+# - If a library fails to detect, none of its config options are hidden
+# - Added libfind_version_header for easy parsing of version.h
+# - Made pkg-config search QUIET
+# - Heavily improved error/warning messages on libfind_process
+
+# Works the same as find_package, but forwards the "REQUIRED" argument used for
+# the current package and always uses the "QUIET" flag. For this to work, the
+# first parameter must be the prefix of the current package, then the prefix of
+# the new package etc, which are passed to find_package.
 macro (libfind_package PREFIX)
-  set (LIBFIND_PACKAGE_ARGS ${ARGN})
-  if (${PREFIX}_FIND_QUIETLY)
-    set (LIBFIND_PACKAGE_ARGS ${LIBFIND_PACKAGE_ARGS} QUIET)
-  endif (${PREFIX}_FIND_QUIETLY)
+  set (LIBFIND_PACKAGE_ARGS ${ARGN} QUIET)
   if (${PREFIX}_FIND_REQUIRED)
     set (LIBFIND_PACKAGE_ARGS ${LIBFIND_PACKAGE_ARGS} REQUIRED)
-  endif (${PREFIX}_FIND_REQUIRED)
+  endif()
   find_package(${LIBFIND_PACKAGE_ARGS})
+  unset(LIBFIND_PACKAGE_ARGS)
 endmacro (libfind_package)

-# CMake developers made the UsePkgConfig system deprecated in the same release (2.6)
-# where they added pkg_check_modules. Consequently I need to support both in my scripts
-# to avoid those deprecated warnings. Here's a helper that does just that.
-# Works identically to pkg_check_modules, except that no checks are needed prior to use.
-macro (libfind_pkg_check_modules PREFIX PKGNAME)
-  if (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
-    include(UsePkgConfig)
-    pkgconfig(${PKGNAME} ${PREFIX}_INCLUDE_DIRS ${PREFIX}_LIBRARY_DIRS ${PREFIX}_LDFLAGS ${PREFIX}_CFLAGS)
-  else (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
-    find_package(PkgConfig)
-    if (PKG_CONFIG_FOUND)
-      pkg_check_modules(${PREFIX} ${PKGNAME})
-    endif (PKG_CONFIG_FOUND)
-  endif (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
-endmacro (libfind_pkg_check_modules)
+# A simple wrapper to make pkg-config searches a bit easier.
+# Works the same as CMake's internal pkg_check_modules but is always quiet.
+macro (libfind_pkg_check_modules)
+  find_package(PkgConfig QUIET)
+  if (PKG_CONFIG_FOUND)
+    pkg_check_modules(${ARGN} QUIET)
+  endif()
+endmacro()
+
+# Extracts a version #define from a version.h file, output stored to <PREFIX>_VERSION.
+# Usage: libfind_version_header(Foobar foobar/version.h FOOBAR_VERSION_STR)
+# Fourth argument "QUIET" may be used for silently testing different define names.
+# This function does nothing if the version variable is already defined.
+function (libfind_version_header PREFIX VERSION_H DEFINE_NAME)
+  # Skip processing if we already have a version or if the include dir was not found
+  if (${PREFIX}_VERSION OR NOT ${PREFIX}_INCLUDE_DIR)
+    return()
+  endif()
+  set(quiet ${${PREFIX}_FIND_QUIETLY})
+  # Process optional arguments
+  foreach(arg ${ARGN})
+    if (arg STREQUAL "QUIET")
+      set(quiet TRUE)
+    else()
+      message(AUTHOR_WARNING "Unknown argument ${arg} to libfind_version_header ignored.")
+    endif()
+  endforeach()
+  # Read the header and parse for version number
+  set(filename "${${PREFIX}_INCLUDE_DIR}/${VERSION_H}")
+  if (NOT EXISTS ${filename})
+    if (NOT quiet)
+      message(AUTHOR_WARNING "Unable to find ${${PREFIX}_INCLUDE_DIR}/${VERSION_H}")
+    endif()
+    return()
+  endif()
+  file(READ "${filename}" header)
+  string(REGEX REPLACE ".*#[ \t]*define[ \t]*${DEFINE_NAME}[ \t]*\"([^\n]*)\".*" "\\1" match "${header}")
+  # No regex match?
+  if (match STREQUAL header)
+    if (NOT quiet)
+      message(AUTHOR_WARNING "Unable to find \#define ${DEFINE_NAME} \"<version>\" from ${${PREFIX}_INCLUDE_DIR}/${VERSION_H}")
+    endif()
+    return()
+  endif()
+  # Export the version string
+  set(${PREFIX}_VERSION "${match}" PARENT_SCOPE)
+endfunction()

 # Do the final processing once the paths have been detected.
 # If include dirs are needed, ${PREFIX}_PROCESS_INCLUDES should be set to contain
@@ -48,65 +86,119 @@
 # Ditto for ${PREFIX}_PROCESS_LIBS and library files.
 # Will set ${PREFIX}_FOUND, ${PREFIX}_INCLUDE_DIRS and ${PREFIX}_LIBRARIES.
 # Also handles errors in case library detection was required, etc.
-macro (libfind_process PREFIX)
-  # Skip processing if already processed during this run
-  if (NOT ${PREFIX}_FOUND)
-    # Start with the assumption that the library was found
-    set (${PREFIX}_FOUND TRUE)
-
-    # Process all includes and set _FOUND to false if any are missing
-    foreach (i ${${PREFIX}_PROCESS_INCLUDES})
-      if (${i})
-        set (${PREFIX}_INCLUDE_DIRS ${${PREFIX}_INCLUDE_DIRS} ${${i}})
-        mark_as_advanced(${i})
-      else (${i})
-        set (${PREFIX}_FOUND FALSE)
-      endif (${i})
-    endforeach (i)
-
-    # Process all libraries and set _FOUND to false if any are missing
-    foreach (i ${${PREFIX}_PROCESS_LIBS})
-      if (${i})
-        set (${PREFIX}_LIBRARIES ${${PREFIX}_LIBRARIES} ${${i}})
-        mark_as_advanced(${i})
-      else (${i})
-        set (${PREFIX}_FOUND FALSE)
-      endif (${i})
-    endforeach (i)
-
-    # Print message and/or exit on fatal error
-    if (${PREFIX}_FOUND)
-      if (NOT ${PREFIX}_FIND_QUIETLY)
-        message (STATUS "Found ${PREFIX} ${${PREFIX}_VERSION}")
-      endif (NOT ${PREFIX}_FIND_QUIETLY)
-    else (${PREFIX}_FOUND)
-      if (${PREFIX}_FIND_REQUIRED)
-        foreach (i ${${PREFIX}_PROCESS_INCLUDES} ${${PREFIX}_PROCESS_LIBS})
-          message("${i}=${${i}}")
-        endforeach (i)
-        message (FATAL_ERROR "Required library ${PREFIX} NOT FOUND.\nInstall the library (dev version) and try again. If the library is already installed, use ccmake to set the missing variables manually.")
-      endif (${PREFIX}_FIND_REQUIRED)
-    endif (${PREFIX}_FOUND)
-  endif (NOT ${PREFIX}_FOUND)
-endmacro (libfind_process)
-
-macro(libfind_library PREFIX basename)
-  set(TMP "")
-  if(MSVC80)
-    set(TMP -vc80)
-  endif(MSVC80)
-  if(MSVC90)
-    set(TMP -vc90)
-  endif(MSVC90)
-  set(${PREFIX}_LIBNAMES ${basename}${TMP})
-  if(${ARGC} GREATER 2)
-    set(${PREFIX}_LIBNAMES ${basename}${TMP}-${ARGV2})
-    string(REGEX REPLACE "\\." "_" TMP ${${PREFIX}_LIBNAMES})
-    set(${PREFIX}_LIBNAMES ${${PREFIX}_LIBNAMES} ${TMP})
-  endif(${ARGC} GREATER 2)
-  find_library(${PREFIX}_LIBRARY
-    NAMES ${${PREFIX}_LIBNAMES}
-    PATHS ${${PREFIX}_PKGCONF_LIBRARY_DIRS}
-  )
-endmacro(libfind_library)
-
+function (libfind_process PREFIX)
+  # Skip processing if already processed during this configuration run
+  if (${PREFIX}_FOUND)
+    return()
+  endif()
+
+  set(found TRUE)  # Start with the assumption that the package was found
+
+  # Did we find any files? Did we miss includes? These are for formatting better error messages.
+  set(some_files FALSE)
+  set(missing_headers FALSE)
+
+  # Shorthands for some variables that we need often
+  set(quiet ${${PREFIX}_FIND_QUIETLY})
+  set(required ${${PREFIX}_FIND_REQUIRED})
+  set(exactver ${${PREFIX}_FIND_VERSION_EXACT})
+  set(findver "${${PREFIX}_FIND_VERSION}")
+  set(version "${${PREFIX}_VERSION}")
+
+  # Make sure that these don't already exist before we start making lists
+  unset(configopts)
+  unset(includes)
+  unset(libs)
+
+  # Process all includes and set found false if any are missing
+  foreach (i ${${PREFIX}_PROCESS_INCLUDES})
+    list(APPEND configopts ${i})
+    if (NOT "${${i}}" STREQUAL "${i}-NOTFOUND")
+      set(includes ${includes} ${${i}})
+    else()
+      set(found FALSE)
+      set(missing_headers TRUE)
+    endif()
+  endforeach()
+
+  # Process all libraries and set found false if any are missing
+  foreach (i ${${PREFIX}_PROCESS_LIBS})
+    list(APPEND configopts ${i})
+    if (NOT "${${i}}" STREQUAL "${i}-NOTFOUND")
+      set(libs ${libs} ${${i}})
+    else()
+      set (found FALSE)
+    endif()
+  endforeach()
+
+  # Version checks
+  if (found AND findver)
+    if (NOT version)
+      message (AUTHOR_WARNING "Find${PREFIX}.cmake does not provide version information. Either fix the module or remove any find_package() version requirements.")
+      set(found FALSE)
+    elseif (version VERSION_LESS findver OR (exactver AND NOT version VERSION_EQUAL findver))
+      set(found FALSE)
+      set(version_unsuitable TRUE)
+    endif()
+  endif()
+
+  # If all-OK, hide all config options, export variables, print status and exit
+  if (found)
+    foreach (i ${configopts})
+      mark_as_advanced(${i})
+    endforeach()
+    set (${PREFIX}_INCLUDE_DIRS ${includes} PARENT_SCOPE)
+    set (${PREFIX}_LIBRARIES ${libs} PARENT_SCOPE)
+    set (${PREFIX}_FOUND TRUE PARENT_SCOPE)
+    if (NOT quiet)
+      message(STATUS "Found ${PREFIX} ${${PREFIX}_VERSION}")
+    endif()
+    return()
+  endif()
+
+  # Format messages for debug info and the type of error
+  set(vars "Relevant CMake configuration variables:\n")
+  foreach (i ${configopts})
+    mark_as_advanced(CLEAR ${i})
+    set(val ${${i}})
+    if ("${val}" STREQUAL "${i}-NOTFOUND")
+      set (val "<not found>")
+    elseif (val AND NOT EXISTS ${val})
+      set (val "${val}  (does not exist)")
+    else()
+      set(some_files TRUE)
+    endif()
+    set(vars "${vars}  ${i}=${val}\n")
+  endforeach()
+  set(vars "${vars}You may use CMake GUI, cmake -D or ccmake to modify the values. Delete CMakeCache.txt to discard all values and force full re-detection if necessary.\n")
+  if (version_unsuitable)
+    set(msg "${PREFIX} ${${PREFIX}_VERSION} was found but")
+    if (exactver)
+      set(msg "${msg} only version ${findver} is acceptable.")
+    else()
+      set(msg "${msg} version ${findver} is the minimum requirement.")
+    endif()
+  else()
+    if (missing_headers)
+      set(msg "We could not find development headers for ${PREFIX}. Do you have the necessary dev package installed?")
+    elseif (some_files)
+      set(msg "We only found some files of ${PREFIX}, not all of them. Perhaps your installation is incomplete or maybe we just didn't look in the right place?")
+      if(findver)
+        set(msg "${msg} This could also be caused by incompatible version (if it helps, at least ${PREFIX} ${findver} should work).")
+      endif()
+    else()
+      set(msg "We were unable to find package ${PREFIX}.")
+    endif()
+  endif()
+
+  # Fatal error out if REQUIRED
+  if (required)
+    set(msg "REQUIRED PACKAGE NOT FOUND\n${msg} This package is REQUIRED and you need to install it or adjust CMake configuration in order to continue building ${CMAKE_PROJECT_NAME}.")
+    message(FATAL_ERROR "${msg}\n${vars}")
+  endif()
+  # Otherwise just print a nasty warning
+  if (NOT quiet)
+    message(WARNING "WARNING: MISSING PACKAGE\n${msg} This package is NOT REQUIRED and you may ignore this warning but by doing so you may miss some functionality of ${CMAKE_PROJECT_NAME}. \n${vars}")
+  endif()
+endfunction()
+


Apply the CMake Apple Silicon workaround for the 'FREESTANDING' SDK too (#38956)

--- stdlib/cmake/modules/AddSwiftStdlib.cmake
+++ stdlib/cmake/modules/AddSwiftStdlib.cmake
@@ -2066,7 +2066,8 @@
         endif()
       endif()

-      if(sdk IN_LIST SWIFT_APPLE_PLATFORMS)
+      if((sdk IN_LIST SWIFT_APPLE_PLATFORMS)
+        OR (sdk STREQUAL "FREESTANDING"))
         # In the past, we relied on unsetting globally
         # CMAKE_OSX_ARCHITECTURES to ensure that CMake would
         # not add the -arch flag
@@ -2074,6 +2075,9 @@
         # when CMake will enforce a default (see
         # https://gitlab.kitware.com/cmake/cmake/-/merge_requests/5291)
         set_property(TARGET ${VARIANT_NAME} PROPERTY OSX_ARCHITECTURES "${arch}")
+        if (SWIFTLIB_IS_STDLIB AND SWIFTLIB_STATIC)
+          set_property(TARGET ${VARIANT_NAME}-static PROPERTY OSX_ARCHITECTURES "${arch}")
+        endif()
       endif()
     endforeach()

@@ -2512,7 +2516,8 @@
           EXCLUDE_FROM_ALL TRUE)
       endif()

-      if(${sdk} IN_LIST SWIFT_APPLE_PLATFORMS)
+      if((${sdk} IN_LIST SWIFT_APPLE_PLATFORMS)
+        OR (sdk STREQUAL "FREESTANDING"))
         # In the past, we relied on unsetting globally
         # CMAKE_OSX_ARCHITECTURES to ensure that CMake would
         # not add the -arch flag


Added PATH variable for Redland for Win32

--- CMake/mitkFunctionGetLibrarySearchPaths.cmake
+++ CMake/mitkFunctionGetLibrarySearchPaths.cmake
@@ -49,7 +49,6 @@
   # the structure of the build directories, pointed to by
   # the *_DIR variables. Instead, we should rely on package
   # specific "LIBRARY_DIRS" variables, if they exist.
-
   if(WIN32)
     if(DCMTK_DIR)
       list(APPEND _dir_candidates "${DCMTK_DIR}/bin")
@@ -65,6 +64,9 @@
     endif()
     if(SimpleITK_DIR)
       list(APPEND _dir_candidates "${SimpleITK_DIR}/bin")
+    endif()
+    if(REDLAND_INSTALL_DIR)
+      list(APPEND _dir_candidates "${REDLAND_INSTALL_DIR}/bin")
     endif()
     list(APPEND _dir_candidates "${ITK_DIR}/bin")
   else()


Removed extraneous paths

Removed extraneous paths

--- src/lio/cmake/FindOpenSSL.cmake
+++ src/lio/cmake/FindOpenSSL.cmake
@@ -13,7 +13,6 @@
 else (OPENSSL_INCLUDE_DIR AND OPENSSL_LIBRARIES)

   FIND_PATH(OPENSSL_INCLUDE_DIR openssl/ssl.h
-     $ENV{CMAKE_PREFIX_PATH}/include/
      $ENV{HOME}/include/
      /usr/include/
      /usr/local/include/
@@ -66,15 +65,13 @@

    FIND_LIBRARY(OPENSSL_LIBRARIES NAMES ssl ssleay32 ssleay32MD libeay32 libeay32MD
       PATHS
-      $ENV{CMAKE_PREFIX_PATH}/include/
-      $ENV{HOME}/include/
+      $ENV{HOME}/lib/
       /usr/lib
       /usr/local/lib
    )
    FIND_LIBRARY(CRYPTO_LIBRARIES crypto
       PATHS
-      $ENV{CMAKE_PREFIX_PATH}/include/
-      $ENV{HOME}/include/
+      $ENV{HOME}/lib/
       /usr/lib
       /usr/local/lib
    )


Added a verification step for plugin names. Fixes #232.

--- CMake/ctkMacroSetupPlugins.cmake
+++ CMake/ctkMacroSetupPlugins.cmake
@@ -118,35 +118,56 @@
     get_filename_component(QT_INSTALLED_LIBRARY_DIR ${QT_QMAKE_EXECUTABLE} PATH)
   endif()

+  set(plugin_symbolic_names )
+  set(plugin_targets )
+  foreach(plugin ${plugin_list})
+    ctkFunctionExtractOptionNameAndValue(${plugin} plugin_dir plugin_value)
+    string(REPLACE "/" ";" _tokens ${plugin_dir})
+    list(GET _tokens -1 plugin_symbolic_name)
+    list(APPEND plugin_symbolic_names ${plugin_symbolic_name})
+
+    string(REPLACE "." "_" plugin_target ${plugin_symbolic_name})
+    list(APPEND plugin_targets ${plugin_target})
+
+    set(${plugin_symbolic_name}_plugin_dir ${plugin_dir})
+    set(${plugin_symbolic_name}_plugin_value ${plugin_value})
+  endforeach()
+
+  # Check if the plugin symbolic names are valid for the current project
+  ctkMacroGetAllNonProjectTargetLibraries("${plugin_targets}" invalid_targets)
+  if(invalid_targets)
+    set(invalid_plugins )
+    foreach(plugin_target ${invalid_targets})
+      string(REPLACE "_" "." plugin_symbolic_name ${plugin_target})
+      list(APPEND invalid_plugins ${plugin_symbolic_name})
+    endforeach()
+    message(FATAL_ERROR "The following plug-ins are using invalid symbolic names: ${invalid_plugins}")
+  endif()
+
   set(plugin_dirswithoption )
   set(plugin_subdirs )
-  foreach(plugin ${plugin_list})
-    ctkFunctionExtractOptionNameAndValue(${plugin} plugin_name plugin_value)
+  foreach(plugin_symbolic_name ${plugin_symbolic_names})
     if(MY_COMPACT_OPTIONS)
-      string(REPLACE "/" ";" _tokens ${plugin_name})
-      list(GET _tokens -1 option_name)
-      set(option_name ${MY_BUILD_OPTION_PREFIX}${option_name})
+      set(option_name ${MY_BUILD_OPTION_PREFIX}${plugin_symbolic_name})
     else()
-      set(option_name ${MY_BUILD_OPTION_PREFIX}${plugin_name})
+      set(option_name ${MY_BUILD_OPTION_PREFIX}${${plugin_symbolic_name}_plugin_dir})
     endif()
     # This variable may have the form "Plugins/org.commontk.bla_option_name"
-    set(${plugin_name}_option_name ${option_name})
+    set(${${plugin_symbolic_name}_plugin_dir}_option_name ${option_name})
     # Additionally create a variable of the form "org_commontk_bla_option_name"
-    string(REPLACE "/" ";" _tokens ${plugin_name})
-    list(GET _tokens -1 plugin_symbolic_name)
     string(REPLACE "." "_" plugin_target ${plugin_symbolic_name})
     set(${plugin_target}_option_name ${option_name})

-    option(${option_name} "Build ${plugin_name} Plugin." ${plugin_value})
+    option(${option_name} "Build the ${plugin_symbolic_name} Plugin." ${${plugin_symbolic_name}_plugin_value})
     if(MY_BUILD_ALL)
       set(${option_name} 1)
     endif()

-    list(APPEND plugin_subdirs "${plugin_name}")
-    if(IS_ABSOLUTE ${plugin_name})
-      list(APPEND plugin_dirswithoption "${plugin_name}^^${option_name}")
+    list(APPEND plugin_subdirs "${${plugin_symbolic_name}_plugin_dir}")
+    if(IS_ABSOLUTE ${${plugin_symbolic_name}_plugin_dir})
+      list(APPEND plugin_dirswithoption "${${plugin_symbolic_name}_plugin_dir}^^${option_name}")
     else()
-      list(APPEND plugin_dirswithoption "${CMAKE_CURRENT_SOURCE_DIR}/${plugin_name}^^${option_name}")
+      list(APPEND plugin_dirswithoption "${CMAKE_CURRENT_SOURCE_DIR}/${${plugin_symbolic_name}_plugin_dir}^^${option_name}")
     endif()
   endforeach()


tweak cmake message

tweak cmake message

--- CMakeModules/FindlibSquish.cmake
+++ CMakeModules/FindlibSquish.cmake
@@ -10,5 +10,5 @@

 IF (LIBSQUISH_LIBRARY AND LIBSQUISH_INCLUDE_DIR)
    SET(LIBSQUISH_FOUND TRUE)
-   MESSAGE(STATUS Found libSquish: ${LIBSQUISH_LIBRARY})
+   MESSAGE(STATUS "Found libSquish: ${LIBSQUISH_LIBRARY}")
 ENDIF (LIBSQUISH_LIBRARY AND LIBSQUISH_INCLUDE_DIR)


recommit: remove Qt5*_EXECUTABLE_COMPILE_FLAG

as it is useless and causes errors with old compiler
from 9735dca

Indeed it add fPIE flags which prevent generation of PIC
suitable in a shared library

--- manageQt5.cmake
+++ manageQt5.cmake
@@ -44,7 +44,7 @@
       message("Adding module ${_module}")
       set(Qt5_INCLUDES ${Qt5_INCLUDES} ${Qt5${_module}_INCLUDE_DIRS} )
       set(Qt5_LIBRARIES ${Qt5_LIBRARIES} ${Qt5${_module}_LIBRARIES} )
-      set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5${_module}_EXECUTABLE_COMPILE_FLAGS}")
+      #set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5${_module}_EXECUTABLE_COMPILE_FLAGS}")
     endforeach()
   endif()
 endmacro()


Fix the version in the user guide.

Fix the version in the user guide.

--- doc/tnt.ent.cmake
+++ doc/tnt.ent.cmake
@@ -3,7 +3,7 @@
      This file contains all common entities.
      tnt.ent is built by cmake from tnt.ent.cmake.
 -->
-<!ENTITY tnt_version "@TARANTOOL_VERSION@">
+<!ENTITY tnt_version "@PACKAGE_VERSION@">
 <!-- Include the standard ISO 8879 publishing entities -->
 <!ENTITY % isopub PUBLIC "ISO 8879:1986//ENTITIES Publishing//EN//XML"
                          "http://www.w3.org/2003/entities/iso8879/isopub.ent">


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

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

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

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

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/kwsys/kwsysDateStamp.cmake
@@ -12,10 +12,10 @@
 #=============================================================================

 # KWSys version date year component.  Format is CCYY.
-SET(KWSYS_DATE_STAMP_YEAR  2011)
+SET(KWSYS_DATE_STAMP_YEAR  2012)

 # KWSys version date month component.  Format is MM.
-SET(KWSYS_DATE_STAMP_MONTH 12)
+SET(KWSYS_DATE_STAMP_MONTH 01)

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

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

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

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

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

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

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

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

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

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

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


Disable debug in cmake

Disable debug in cmake

--- resqliteun.cmake
+++ resqliteun.cmake
@@ -1,6 +1,6 @@

 # enable/disable cmake debug messages related to this pile
-set (RESQLITEUN_DEBUG_MSG ON)
+set (RESQLITEUN_DEBUG_MSG OFF)

 # make sure support code is present; no harm
 # in including it twice; the user, however, should have used


Add LidarView optional dependencies in superbuild to wait for sub-projects installation

--- Superbuild/Projects/lidarview.cmake
+++ Superbuild/Projects/lidarview.cmake
@@ -1,5 +1,6 @@
 superbuild_add_project(lidarview
   DEPENDS paraview qt5 pcap boost eigen liblas yaml
+  DEPENDS_OPTIONAL pcl ceres opencv nanoflann g2o
   DEFAULT_ON
   CMAKE_ARGS
     -DBUILD_SHARED_LIBS:BOOL=ON


Fix example testing

Fix example testing

--- examples/common.cmake
+++ examples/common.cmake
@@ -4,6 +4,15 @@
 cmake_minimum_required(VERSION 2.8.12)

 get_filename_component(HUNTER_ROOT "${CMAKE_CURRENT_LIST_DIR}/../.." ABSOLUTE)
+list(APPEND CMAKE_MODULE_PATH "${HUNTER_ROOT}/Source/cmake/modules")
+
+# default generator info
+# (before master file, otherwise generator will be placed in "normal" location)
+set(HUNTER_BASE "${PROJECT_BINARY_DIR}/_hunter_base")
+set(HUNTER_INSTALL_TAG "_testing")
+include(hunter_set_cmake_default_generator)
+hunter_set_cmake_default_generator()
+
 include("${HUNTER_ROOT}/Source/cmake/Hunter")

 # rewrite base for testing


Add testing option TESTING_CONFIG_OPT

Add testing option TESTING_CONFIG_OPT

--- examples/common.cmake
+++ examples/common.cmake
@@ -27,8 +27,8 @@
   get_filename_component(TESTING_URL "${TESTING_URL}" ABSOLUTE)

   ### HunterGate module
-  HunterGate(URL "${TESTING_URL}" SHA1 "${TESTING_SHA1}")
+  HunterGate(URL "${TESTING_URL}" SHA1 "${TESTING_SHA1}" ${TESTING_CONFIG_OPT})
 else()
   get_filename_component(HUNTER_ROOT "${CMAKE_CURRENT_LIST_DIR}/.." ABSOLUTE)
-  HunterGate(URL "x" SHA1 "xxxxxxxx")
+  HunterGate(URL "x" SHA1 "xxxxxxxx" ${TESTING_CONFIG_OPT})
 endif()


CI: update NDK to 15c

CI: update NDK to 15c

--- ci-build.cmake
+++ ci-build.cmake
@@ -55,7 +55,7 @@
 if(DEFINED ENV{ANDROID})
     set(CROSS
         -DANDROID_NATIVE_API_LEVEL=16
-        -DANDROID_NDK=${CMAKE_CURRENT_SOURCE_DIR}/android-ndk-r15b
+        -DANDROID_NDK=${CMAKE_CURRENT_SOURCE_DIR}/android-ndk-r15c
         -DCMAKE_TOOLCHAIN_FILE=${CMAKE_CURRENT_SOURCE_DIR}/CMake/toolchain/android.toolchain.cmake
         "-DANDROID_ABI=armeabi-v7a with NEON")

@@ -71,13 +71,13 @@
         -DOGRE_DEPENDENCIES_DIR=${CMAKE_CURRENT_SOURCE_DIR}/ogredeps)
     set(BUILD_DEPS TRUE)

-    if(NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/android-ndk-r15b)
+    if(NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/android-ndk-r15c)
         message(STATUS "Downloading Android NDK")
         file(DOWNLOAD
-            http://dl.google.com/android/repository/android-ndk-r15b-linux-x86_64.zip
-            ./android-ndk-r15b-linux-x86_64.zip)
+            http://dl.google.com/android/repository/android-ndk-r15c-linux-x86_64.zip
+            ./android-ndk-r15c-linux-x86_64.zip)
         message(STATUS "Extracting Android NDK")
-        execute_process(COMMAND unzip android-ndk-r15b-linux-x86_64.zip OUTPUT_QUIET)
+        execute_process(COMMAND unzip android-ndk-r15c-linux-x86_64.zip OUTPUT_QUIET)
     endif()
 endif()


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

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

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

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

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

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

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

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

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

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

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

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

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

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

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

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

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

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

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

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

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

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

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

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

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

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

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

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

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


Update example_config.cmake

Update example_config.cmake

--- scripts/cmake/config/example_config.cmake
+++ scripts/cmake/config/example_config.cmake
@@ -24,16 +24,13 @@
 # ------------------------------------------------------------------------------

 # To use this config, put this file in the same folder that contains the
-# hypervisor and build folder, (and extended apis if your using them), and
-# rename it to "config.cmake". For example:
+# hypervisor and build folder and rename it to "config.cmake".
+# For example:
 #
 # - working
 #   - build
 #   - hypervisor
-#   - hypervisor_example_vpid           # optional
-#   - hypervisor_example_rdtsc          # optional
-#   - hypervisor_example_cpuidcount     # optional
-#   - hypervisor_example_msr_bitmap     # optional
+#   - boxy # optional
 #   - config.cmake
 #
 # Change the options as needed, and then from the build folder, run the
@@ -80,44 +77,47 @@
 #
 # These options enable the examples
 #
-set(ENABLE_HYPERVISOR_EXAMPLE_VPID OFF)
-set(ENABLE_HYPERVISOR_EXAMPLE_RDTSC OFF)
-set(ENABLE_HYPERVISOR_EXAMPLE_CPUIDCOUNT OFF)
-set(ENABLE_HYPERVISOR_EXAMPLE_MSR_BITMAP OFF)
-set(ENABLE_EXTENDED_APIS_EXAMPLE_HOOK OFF)
+set(ENABLE_EXAMPLE_CPUIDCOUNT OFF)
+set(ENABLE_EXAMPLE_HOOK OFF)
+set(ENABLE_EXAMPLE_RDTSC OFF)
+set(ENABLE_EXAMPLE_VPID OFF)

 # Override VMM
 #
-# If the override VMM is set, this VMM will be used instead of the default VMM
-# based on the current configuration.
+# Setting the OVERRIDE_VMM variable is the same as setting the DEFAULT_VMM
+# from the command line. Use this to change which VMM the build system will
+# load when you run 'make load` or `make quick`.
 #
 # set(OVERRIDE_VMM <name>)
+
+# Override VMM Target
+#
+# This is only needed if you also turn on EFI. If you are building EFI from
+# your own extension, you will need to tell the build system what the target
+# name is for your VMM so that it will know what target the EFI portion of
+# the build system depends on. This simply ensures that the build system
+# first compiles your custom VMM before compiling the bareflank.efi. In other
+# words, within the build system, this will add a call to add_dependency()
+# with the value you provide.
+#
 # set(OVERRIDE_VMM_TARGET <name>)

-# Override Compiler Warnings
-#
-# Tells the configuration that you want -Werror enabled regardless of the
-# setting of developer mode
-#
-# set(OVERRIDE_COMPILER_WARNINGS ON)

-# ------------------------------------------------------------------------------
-# Config Variables (No Need To Modify)
-# ------------------------------------------------------------------------------

-# Build Type
-#
-# Defines the type of hypervisor that is built. Possible values are Release
-# and Debug. Release mode turns on all optimizations and is the default
-#
+
+
+
+
+# ==============================================================================
+# DO NOT MODIFY BELOW
+# ==============================================================================
+
 if(ENABLE_DEVELOPER_MODE)
     set(CMAKE_BUILD_TYPE Debug)
 else()
     set(CMAKE_BUILD_TYPE Release)
 endif()

-# Shared vs Static Builds
-#
 if(ENABLE_DEVELOPER_MODE AND NOT ENABLE_BUILD_EFI)
     set(BUILD_SHARED_LIBS ON)
     set(BUILD_STATIC_LIBS OFF)
@@ -126,21 +126,9 @@
     set(BUILD_STATIC_LIBS ON)
 endif()

-# Cache
-#
-# THe build system maintains it's own cache of all external dependencies to
-# eliminate the need to download these dependencies multiple times. The default
-# location is in the build folder, but if you plan to do more than one build,
-# moving this cache outside of the build folder will speed up build times, and
-# prevent needless downloading.
-#
+file(MAKE_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/cache)
 set(CACHE_DIR ${CMAKE_CURRENT_LIST_DIR}/cache)

-# Enable Bits
-#
-# There are several enable bits that can be used to enable additional
-# functionality, or reduce which portions of the hypervisor are built.
-#
 if(ENABLE_DEVELOPER_MODE AND NOT ENABLE_BUILD_EFI)
     set(ENABLE_BUILD_TEST ON)
 else()
@@ -159,19 +147,10 @@
     set(ENABLE_CODECOV OFF)
 endif()

-# Compiler Warnings
-#
-# Enables compiler warnings. This option should always be on when developing.
-# Not that Release builds add "-Werror".
-#
-if(ENABLE_DEVELOPER_MODE AND NOT OVERRIDE_COMPILER_WARNINGS)
-    set(ENABLE_COMPILER_WARNINGS OFF)
-else()
-    set(ENABLE_COMPILER_WARNINGS ${OVERRIDE_COMPILER_WARNINGS})
-endif()
+set(ENABLE_COMPILER_WARNINGS ON)

 # ------------------------------------------------------------------------------
-# Hyperkernel
+# Boxy
 # ------------------------------------------------------------------------------

 if(ENABLE_BOXY)
@@ -185,39 +164,20 @@
 # Examples
 # ------------------------------------------------------------------------------

-if(ENABLE_HYPERVISOR_EXAMPLE_VPID)
-    set_bfm_vmm(example_vmm)
-    list(APPEND EXTENSION
-        ${CMAKE_CURRENT_LIST_DIR}/hypervisor_example_vpid
-    )
+if(ENABLE_EXAMPLE_CPUIDCOUNT)
+    set_bfm_vmm(example_cpuidcount_vmm)
 endif()

-if(ENABLE_HYPERVISOR_EXAMPLE_RDTSC)
-    set_bfm_vmm(example_vmm)
-    list(APPEND EXTENSION
-        ${CMAKE_CURRENT_LIST_DIR}/hypervisor_example_rdtsc
-    )
+if(ENABLE_EXAMPLE_HOOK)
+    set_bfm_vmm(example_hook_vmm)
 endif()

-if(ENABLE_HYPERVISOR_EXAMPLE_CPUIDCOUNT)
-    set_bfm_vmm(example_vmm)
-    list(APPEND EXTENSION
-        ${CMAKE_CURRENT_LIST_DIR}/hypervisor_example_cpuidcount
-    )
+if(ENABLE_EXAMPLE_RDTSC)
+    set_bfm_vmm(example_rdtsc_vmm)
 endif()

-if(ENABLE_HYPERVISOR_EXAMPLE_MSR_BITMAP)
-    set_bfm_vmm(example_vmm)
-    list(APPEND EXTENSION
-        ${CMAKE_CURRENT_LIST_DIR}/hypervisor_example_msr_bitmap
-    )
-endif()
-
-if(ENABLE_EXTENDED_APIS_EXAMPLE_HOOK)
-    set_bfm_vmm(example_vmm)
-    list(APPEND EXTENSION
-        ${CMAKE_CURRENT_LIST_DIR}/extended_apis_example_hook
-    )
+if(ENABLE_EXAMPLE_VPID)
+    set_bfm_vmm(example_vpid_vmm)
 endif()

 # ------------------------------------------------------------------------------


Update dependencies

Update dependencies

--- find_dependencies.cmake
+++ find_dependencies.cmake
@@ -2,5 +2,5 @@
 if(NOT Boost.Hana_FOUND)
     find_package(Boost 1.61.0 REQUIRED)
 endif()
-find_package(jegp 3.0.0 REQUIRED)
+find_package(jegp 3.1.0 REQUIRED)
 find_package(RapidXml 5.0.0 REQUIRED)


autotools: Sync expat.cmake to agree with CI


Add the CTK external library dirs to the link dirs.

--- CMake/PackageDepends/MITK_CTK_Config.cmake
+++ CMake/PackageDepends/MITK_CTK_Config.cmake
@@ -2,6 +2,6 @@
 find_package(CTK REQUIRED)
 list(APPEND ALL_INCLUDE_DIRECTORIES ${CTK_INCLUDE_DIRS})
 list(APPEND ALL_LIBRARIES ${CTK_LIBRARIES})
-link_directories(${CTK_LIBRARY_DIRS})
+link_directories(${CTK_LIBRARY_DIRS} ${CTK_EXTERNAL_LIBRARY_DIRS})


Setting some cmake variables as hidden

Setting some cmake variables as hidden


Added missing newline.

Added missing newline.

--- config.h.cmake
+++ config.h.cmake
@@ -2,4 +2,4 @@
 #cmakedefine HAVE_INTTYPES_H

 /* 64 bit format */
-#cmakedefine PRId64 "@PRId64@"+#cmakedefine PRId64 "@PRId64@"


cmake: make PDB output directory match that of a static library.

PDB files should be created at the same location as their primary
artifact, which is either static library or a DLL.

On Windows, an artifact location is controlled by:

* RUNTIME_OUTPUT_DIRECTORY is a directory of a DLL artifact.
* ARCHIVE_OUTPUT_DIRECTORY is a directory of a LIB artifact.

A PDB file location is controlled:

* PDB_OUTPUT_DIRECTORY should match a directory of a DLL artifact.
* COMPILE_PDB_OUTPUT_DIRECTORY should match a directory of a LIB artifact.

--- googletest/cmake/internal_utils.cmake
+++ googletest/cmake/internal_utils.cmake
@@ -162,7 +162,8 @@
     RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin"
     LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
     ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
-    PDB_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
+    PDB_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin"
+    COMPILE_PDB_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib")
   # make PDBs match library name
   get_target_property(pdb_debug_postfix ${name} DEBUG_POSTFIX)
   set_target_properties(${name}


Update boost to next release version 1.56.

--HG--
branch : v1-9


Allow embedding of Dependencies source build into the Ogre source tree

--HG--
branch : v1-7

--- CMake/Dependencies.cmake
+++ CMake/Dependencies.cmake
@@ -199,6 +199,19 @@
   endif (OGRE_BUILD_PLATFORM_IPHONE)
 endif(APPLE)

+
+# now see if we have a buildable Dependencies package in
+# the source tree. If so, include that, and it will take care of
+# setting everything up, including overriding any of the above
+# findings.
+set(OGREDEPS_RUNTIME_OUTPUT ${OGRE_RUNTIME_OUTPUT})
+if (EXISTS "${OGRE_SOURCE_DIR}/Dependencies/CMakeLists.txt")
+  add_subdirectory(Dependencies)
+elseif (EXISTS "${OGRE_SOURCE_DIR}/ogredeps/CMakeLists.txt")
+  add_subdirectory(ogredeps)
+endif ()
+
+
 # Display results, terminate if anything required is missing
 MACRO_DISPLAY_FEATURE_LOG()


ENH: ExternalData: Teach DATA{} syntax to name associated files

Some data files come in pairs or groups such that only one needs to be
named on a command line and the program can find the others next to it.
Support this case with the DATA{} syntax by allowing a comma-separated
list of names or regular expressions to specify associated files.

--- CMake/ExternalData.cmake
+++ CMake/ExternalData.cmake
@@ -78,6 +78,16 @@
 # members named <prefix><number><suffix>.  Note that the <suffix> of a series
 # does not include a hash-algorithm extension.  Both series configuration
 # variables have default values that work well for common cases.
+#
+# The DATA{} syntax can alternatively match files associated with the named
+# file and contained in the same directory.  Associated files may be specified
+# by options using the syntax DATA{<name>,<opt1>,<opt2>,...}.  Each option may
+# specify one file by name or specify a regular expression to match file names
+# using the syntax REGEX:<regex>.  For example, the arguments
+#   DATA{MyData/MyInput.mhd,MyInput.img}             # File pair
+#   DATA{MyData/MyFrames00.png,MyFrames[0-9]+\\.png} # Series
+# will pass MyInput.mha and MyFrames00.png on the command line but ensure
+# that the associated files are present next to them.
 #
 # The variable ExternalData_LINK_CONTENT may be set to the name of a supported
 # hash algorithm to enable automatic conversion of real data files referenced
@@ -268,7 +278,12 @@
   message(STATUS "Linked ${relname} to ExternalData ${algo}/${hash}")
 endfunction()

-function(_ExternalData_arg target arg data var_file)
+function(_ExternalData_arg target arg options var_file)
+  # Separate data path from the options.
+  string(REPLACE "," ";" options "${options}")
+  list(GET options 0 data)
+  list(REMOVE_AT options 0)
+
   # Convert to full path.
   if(IS_ABSOLUTE "${data}")
     set(absdata "${data}")
@@ -295,7 +310,34 @@
   set(internal "") # Entries internal to the source tree.
   set(have_original 0)

-  _ExternalData_arg_series()
+  # Process options.
+  set(associated_files "")
+  set(associated_regex "")
+  foreach(opt ${options})
+    if("x${opt}" MATCHES "^xREGEX:[^:/]+$")
+      # Regular expression to match associated files.
+      string(REGEX REPLACE "^REGEX:" "" regex "${opt}")
+      list(APPEND associated_regex "${regex}")
+    elseif("x${opt}" MATCHES "^[^][:/*?]+$")
+      # Specific associated file.
+      list(APPEND associated_files "${opt}")
+    else()
+      message(FATAL_ERROR "Unknown option \"${opt}\" in argument\n"
+        "  ${arg}\n")
+    endif()
+  endforeach()
+
+  if(associated_files OR associated_regex)
+    # Load the named data file and listed/matching associated files.
+    _ExternalData_arg_single()
+    _ExternalData_arg_associated()
+  elseif("${reldata}" MATCHES "(^|/)[^/.]+$")
+    # Files with no extension cannot be a series.
+    _ExternalData_arg_single()
+  else()
+    # Match a whole file series by default.
+    _ExternalData_arg_series()
+  endif()

   if(NOT have_original)
     message(FATAL_ERROR "Data file referenced by argument\n"
@@ -317,6 +359,36 @@
     set("${var_file}" "${top_src}/${reldata}" PARENT_SCOPE)
   endif()
 endfunction()
+
+macro(_ExternalData_arg_associated)
+  # Associated files lie in the same directory.
+  get_filename_component(reldir "${reldata}" PATH)
+  if(reldir)
+    set(reldir "${reldir}/")
+  endif()
+  _ExternalData_exact_regex(reldir_regex "${reldir}")
+
+  # Find files named explicitly.
+  foreach(file ${associated_files})
+    _ExternalData_exact_regex(file_regex "${file}")
+    _ExternalData_arg_find_files("${reldir}${file}" "${reldir_regex}${file_regex}")
+  endforeach()
+
+  # Find files matching the given regular expressions.
+  set(all "")
+  set(sep "")
+  foreach(regex ${associated_regex})
+    set(all "${all}${sep}${reldir_regex}${regex}")
+    set(sep "|")
+  endforeach()
+  _ExternalData_arg_find_files("${reldir}" "${all}")
+endmacro()
+
+macro(_ExternalData_arg_single)
+  # Match only the named data by itself.
+  _ExternalData_exact_regex(data_regex "${reldata}")
+  _ExternalData_arg_find_files("${reldata}" "${data_regex}")
+endmacro()

 macro(_ExternalData_arg_series)
   # Configure series parsing and matching.


ENH: ExternalData: Do not re-stage staged object files

The ExternalData_LINK_CONTENT option tells ExternalData to convert real
data files it finds into content links and to "stage" the original
content in a ".ExternalData_<algo>_<hash>" file.  However, after a data
object has been staged it is possible that a user-provided pattern in
the "REGEX:" option will later match the staged object file.  We must
not process staged object files even when a user pattern matches them.

Fix the implementation to not match a staged object file as a normal
data file for conversion.

Change-Id: Ie21b90aa8a8ffac76c8efa1565453bb29c331527

--- CMake/ExternalData.cmake
+++ CMake/ExternalData.cmake
@@ -576,7 +576,10 @@
       set(relname "${entry}")
       set(alg "")
     endif()
-    if("x${relname}" MATCHES "^x${regex}$" AND NOT IS_DIRECTORY "${top_src}/${entry}")
+    if("x${relname}" MATCHES "^x${regex}$" # matches
+        AND NOT IS_DIRECTORY "${top_src}/${entry}" # not a directory
+        AND NOT "x${relname}" MATCHES "(^x|/)\\.ExternalData_" # not staged obj
+        )
       set(name "${top_src}/${relname}")
       set(file "${top_bin}/${relname}")
       if(alg)


Install cmake file for development installs.

Install all cmake files (and resource files) needed to build modules externally
from VTK source. With these files installed, applications can now build new
modules that extend VTK private to their own source code using installed VTK
versions.

Change-Id: I130e7063edd7e50117caf661dc3bec7c3913154b

--- CMake/vtkModuleTop.cmake
+++ CMake/vtkModuleTop.cmake
@@ -302,8 +302,31 @@
 if (NOT VTK_INSTALL_NO_DEVELOPMENT)
   install(FILES ${VTK_BINARY_DIR}/CMakeFiles/VTKConfig.cmake
                 ${VTK_BINARY_DIR}/VTKConfigVersion.cmake
+                CMake/exportheader.cmake.in
+                CMake/GenerateExportHeader.cmake
+                CMake/pythonmodules.h.in
+                CMake/UseVTK.cmake
+                CMake/vtk-forward.c.in
+                CMake/vtkForwardingExecutable.cmake
+                CMake/vtkJavaWrapping.cmake
                 CMake/vtkModuleAPI.cmake
-                CMake/UseVTK.cmake
+                CMake/vtkModuleClasses.cmake.in
+                CMake/vtkModuleInfo.cmake.in
+                CMake/vtkModuleMacros.cmake
+                CMake/vtkObjectFactory.cxx.in
+                CMake/vtkObjectFactory.h.in
+                CMake/vtkPythonWrapping.cmake
+                CMake/vtkTclWrapping.cmake
+                CMake/vtkThirdParty.cmake
+                CMake/vtkWrapHierarchy.cmake
+                CMake/vtkWrapJava.cmake
+                CMake/vtkWrapperInit.data.in
+                CMake/vtkWrapping.cmake
+                CMake/vtkWrapPython.cmake
+                CMake/vtkWrapPythonSIP.cmake
+                CMake/vtkWrapPython.sip.in
+                CMake/vtkWrapTcl.cmake
+
     DESTINATION ${VTK_INSTALL_PACKAGE_DIR})
   get_property(VTK_TARGETS GLOBAL PROPERTY VTK_TARGETS)
   if(VTK_TARGETS)


COMP: 62 - Warn if template parsing fails

SIMPLEITK-62

--- CMake/generate_filter_source.cmake
+++ CMake/generate_filter_source.cmake
@@ -13,33 +13,42 @@
   # Get the line from the json file that indicates the correct template
   file(STRINGS ${json_file} template_line REGEX ".*template_code_filename.*")
   string(REGEX MATCH ":.*\".*ImageFilter" first_strip ${template_line})
-  string(REGEX MATCH "[^\"]*ImageFilter" template_name ${first_strip})

-  set(template_file_h ${input_dir}/templates/sitk${template_name}Template.h.in)
-  set(template_file_cxx ${input_dir}/templates/sitk${template_name}Template.cxx.in)
+  # Only continue if we found something for first_strip
+  if(first_strip)

-  ######
-  # Get dependencies template files
-  ######
+    # Strip down to just the name and then fill out full path
+    string(REGEX MATCH "[^\"]*ImageFilter" template_name ${first_strip})
+    set(template_file_h ${input_dir}/templates/sitk${template_name}Template.h.in)
+    set(template_file_cxx ${input_dir}/templates/sitk${template_name}Template.cxx.in)

-  # Get the contents of the file
-  file(READ ${template_file_h} h_contents)
-  file(READ ${template_file_cxx} cxx_contents)
+    ######
+    # Get dependencies template files
+    ######

-  # For each component, see if it appears in the body of the template file
-  foreach(component ${template_components})
+    # Get the contents of the file
+    file(READ ${template_file_h} h_contents)
+    file(READ ${template_file_cxx} cxx_contents)

-    # Get the filename without the path
-    get_filename_component( filename ${component} NAME )
+    # For each component, see if it appears in the body of the template file
+    foreach(component ${template_components})

-    if("${h_contents}" MATCHES ".*${filename}.*")
-      set(${out_var_name} ${${out_var_name}} ${component})
-    endif()
-    if("${cxx_contents}" MATCHES ".*${filename}.*")
-      set(${out_var_name} ${${out_var_name}} ${component})
-    endif()
+      # Get the filename without the path
+      get_filename_component( filename ${component} NAME )

-  endforeach(component)
+      if("${h_contents}" MATCHES ".*${filename}.*")
+        set(${out_var_name} ${${out_var_name}} ${component})
+      endif()
+      if("${cxx_contents}" MATCHES ".*${filename}.*")
+        set(${out_var_name} ${${out_var_name}} ${component})
+      endif()
+
+    endforeach(component)
+
+  else()
+    message(WARNING "No template name found for ${json_file}")
+
+  endif()

 endmacro()


DOC: Index Sphinx examples in Doxygen.

DOC: Index Sphinx examples in Doxygen.

The Sphinx examples are indexed by doxygen in the "Examples" tab and
are automatically cross-indexed in all the classes that they use.

ITK-3309.

Change-Id: Ic285cea7e65c348e9a978205c11d9684015acfc6

--- Utilities/Doxygen/GenerateExamplesDox.cmake
+++ Utilities/Doxygen/GenerateExamplesDox.cmake
@@ -46,6 +46,10 @@
   "${PROJECT_SOURCE_DIR}/Modules/Remote/WikiExamples/VectorImages/*.cxx"
   "${PROJECT_SOURCE_DIR}/Modules/Remote/WikiExamples/Visualization/*.cxx"
 )
+file( GLOB_RECURSE sphinx_examples_list_fullpath
+  "${PROJECT_SOURCE_DIR}/Modules/Remote/SphinxExamples/src/*.cxx"
+  "${PROJECT_SOURCE_DIR}/Modules/Remote/SphinxExamples/src/*.py"
+)

 # Use relative paths
 set( examples_list )
@@ -55,7 +59,7 @@
   list( APPEND examples_list ${example_relative} )
 endforeach()
 string( LENGTH "${PROJECT_SOURCE_DIR}/Modules/Remote/" root_length )
-foreach( _example ${wiki_examples_list_fullpath} )
+foreach( _example ${wiki_examples_list_fullpath} ${sphinx_examples_list_fullpath} )
   string( SUBSTRING ${_example} ${root_length} -1 example_relative )
   list( APPEND examples_list ${example_relative} )
 endforeach()


Add workaround for android builds.

Add workaround for android builds.

--- run_ctest.cmake
+++ run_ctest.cmake
@@ -229,7 +229,7 @@
 ctest_update()
 ctest_read_custom_files(${CTEST_SOURCE_DIRECTORY})
 if(DEFINED ENV{CMAKE_TOOLCHAIN_FILE} AND DEFINED ENV{CMAKE_ANDROID_ARCH_ABI})
-    ctest_configure(OPTIONS "-DCMAKE_TOOLCHAIN_FILE=$ENV{CMAKE_TOOLCHAIN_FILE}" "-DCMAKE_ANDROID_ARCH_ABI=$ENV{CMAKE_ANDROID_ARCH_ABI}")
+    ctest_configure(OPTIONS "-DCMAKE_TOOLCHAIN_FILE=$ENV{CMAKE_TOOLCHAIN_FILE};-DCMAKE_ANDROID_ARCH_ABI=$ENV{CMAKE_ANDROID_ARCH_ABI}")
 elseif(DEFINED ENV{CMAKE_TOOLCHAIN_FILE})
     ctest_configure(OPTIONS "-DCMAKE_TOOLCHAIN_FILE=$ENV{CMAKE_TOOLCHAIN_FILE}")
 else()


Add print options [skip ci]

Add print options [skip ci]

--- Common.cmake
+++ Common.cmake
@@ -6,6 +6,9 @@
 else()
   set(POLLY_COMMON_CMAKE 1)
 endif()
+
+option(POLLY_STATUS_PRINT "Print process messages" ON)
+option(POLLY_STATUS_DEBUG "Print all process messages" OFF)

 # Add extra cmake modules
 list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/find")


BUG: Included name by error

BUG: Included name by error

--- Common.cmake
+++ Common.cmake
@@ -1,4 +1,4 @@
-AutoTract.cmakeinclude(CMakeDependentOption)
+include(CMakeDependentOption)
 #-----------------------------------------------------------------------------
 enable_language(C)
 enable_language(CXX)


Improving search for libgfortran on Ubuntu

--- external/cmake/openblas.cmake
+++ external/cmake/openblas.cmake
@@ -10,8 +10,21 @@
 include(ElCheckFunctionExists)

 if(CMAKE_Fortran_COMPILER_ID MATCHES "GNU")
+  set(GFORTRAN_PATHS /usr/lib
+                     /usr/lib64
+                     /usr/local/lib
+                     /usr/local/lib64
+                     /usr/lib/openmpi/lib
+                     /usr/lib/gcc/x86_64-linux-gnu/4.8
+                     /usr/lib/gcc/x86_64-linux-gnu/4.9
+                     /lib/x86_64-linux-gnu
+                     /usr/lib/x86_64-linux-gnu
+                     /usr/lib/openblas-base
+                     /usr/lib64/openblas-base
+                     /usr/local/lib/gcc/4.8
+                     /usr/local/lib/gcc/4.9)
   if(NOT GFORTRAN_LIB)
-    find_library(GFORTRAN_LIB NAMES gfortran PATHS /usr/local/lib/gcc/4.9)
+    find_library(GFORTRAN_LIB NAMES gfortran PATHS ${GFORTRAN_PATHS})
     if(NOT GFORTRAN_LIB)
       if(APPLE)
         message(FATAL_ERROR "Could not find gfortran library; please consider setting the GFORTRAN_LIB variable. If you installed gfortran via homebrew, please see the issue filed at https://github.com/Homebrew/homebrew/issues/8539")


Disabling perfcheck for ninja

Disabling perfcheck for ninja

--- benchmark/checkperf.cmake
+++ benchmark/checkperf.cmake
@@ -7,7 +7,7 @@

 # Clone the repository if it's not there
 find_package(Git QUIET)
-if (SIMDJSON_IS_UNDER_GIT AND Git_FOUND AND (GIT_VERSION_STRING VERSION_GREATER  "2.1.4")) # We use "-C" which requires a recent git
+if (SIMDJSON_IS_UNDER_GIT AND Git_FOUND AND (GIT_VERSION_STRING VERSION_GREATER  "2.1.4") AND (NOT CMAKE_GENERATOR MATCHES Ninja) ) # We use "-C" which requires a recent git
   message(STATUS "Git is available and it is recent. We are enabling checkperf targets.")
   # sync_git_repository(myrepo ...) creates two targets:
   # myrepo - if the repo does not exist, creates and syncs it against the origin branch


Update facts.cmake

Update facts.cmake

--- facts/facts.cmake
+++ facts/facts.cmake
@@ -30,22 +30,21 @@
 	MESSAGE("DEPENDS_PATHFILE = ${DEPENDS_PATHFILE}")
 endif()

-# set(ENV{CMAKI_INFO} COMPILER)
-# execute_process(
-# 	COMMAND bash cmaki_identifier.sh
-# 	WORKING_DIRECTORY $ENV{CMAKI_INSTALL}
-# 	OUTPUT_VARIABLE RESULT_VERSION
-# 	OUTPUT_STRIP_TRAILING_WHITESPACE)
-# set(CMAKI_COMPILER "${RESULT_VERSION}")
-
 set(ENV{CMAKI_INFO} ALL)
-execute_process(
-	COMMAND bash cmaki_identifier.sh
-	WORKING_DIRECTORY $ENV{CMAKI_INSTALL}
-	OUTPUT_VARIABLE RESULT_VERSION
-	OUTPUT_STRIP_TRAILING_WHITESPACE)
+if(WIN32)
+	execute_process(
+		COMMAND cmaki_identifier.exe
+		WORKING_DIRECTORY $ENV{CMAKI_INSTALL}
+		OUTPUT_VARIABLE RESULT_VERSION
+		OUTPUT_STRIP_TRAILING_WHITESPACE)
+else()
+	execute_process(
+		COMMAND bash cmaki_identifier.sh
+		WORKING_DIRECTORY $ENV{CMAKI_INSTALL}
+		OUTPUT_VARIABLE RESULT_VERSION
+		OUTPUT_STRIP_TRAILING_WHITESPACE)
+endif()
 set(CMAKI_IDENTIFIER "${RESULT_VERSION}")
-# TODO: for support old code
 set(CMAKI_PLATFORM "${RESULT_VERSION}")

 function(cmaki_find_package PACKAGE)


cmake: fix pkg_check_module call

cmake: fix pkg_check_module call

Signed-off-by: Corentin Chary <4153b5fcec9d8639b77e759711dc8338f0db8708@gmail.com>

--- cmake/modules/FindQCommandLine.cmake
+++ cmake/modules/FindQCommandLine.cmake
@@ -17,7 +17,7 @@
     # use pkg-config to get the values of QCOMMANDLINE_INCLUDE_DIRS
     # and QCOMMANDLINE_LIBRARY_DIRS to add as hints to the find commands.
     include (FindPkgConfig)
-    pkg_check_modules (QCOMMANDLINE QCommandLine >=0.1)
+    pkg_check_modules (QCOMMANDLINE QCommandLine>=0.1)
   endif (NOT WIN32)

   find_library (QCOMMANDLINE_LIBRARIES


RootBuildOptions.cmake: move platform defaults after all=ON

We do not want -Dall=ON enabling unsupported options, like
Davix support on Windows, etc.

--- cmake/modules/RootBuildOptions.cmake
+++ cmake/modules/RootBuildOptions.cmake
@@ -196,23 +196,6 @@
     "Known values are zlib, lzma, lz4 (case-insensitive).")
 endif()

-#--- Minor chnages in defaults due to platform--------------------------------------------------
-if(WIN32)
-  set(x11_defvalue OFF)
-  set(memstat_defvalue OFF)
-  set(davix_defvalue OFF)
-  set(imt_defvalue OFF)
-  set(builtin_tbb_defvalue OFF)
-  set(tmva_defvalue OFF)
-  set(roofit_defvalue OFF)
-  set(roottest_defvalue OFF)
-  set(testing_defvalue OFF)
-  set(vdt_defvalue OFF)
-elseif(APPLE)
-  set(x11_defvalue OFF)
-  set(cocoa_defvalue ON)
-endif()
-
 #--- The 'all' option swithes ON major options---------------------------------------------------
 if(all)
  set(alien_defvalue ON)
@@ -300,6 +283,24 @@
 #---webui always build together with root7----------------------------------------------------
 set(webui_defvalue ${root7})

+#---Changes in defaults due to platform-------------------------------------------------------
+if(WIN32)
+  set(builtin_tbb_defvalue OFF)
+  set(davix_defvalue OFF)
+  set(imt_defvalue OFF)
+  set(memstat_defvalue OFF)
+  set(roofit_defvalue OFF)
+  set(roottest_defvalue OFF)
+  set(testing_defvalue OFF)
+  set(tmva_defvalue OFF)
+  set(vdt_defvalue OFF)
+  set(x11_defvalue OFF)
+elseif(APPLE)
+  set(cocoa_defvalue ON)
+  set(x11_defvalue OFF)
+  set(xft_defvalue OFF)
+endif()
+
 #---Vc supports only x86_64 architecture-------------------------------------------------------
 if (NOT CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
   message(STATUS "Vc does not support ${CMAKE_SYSTEM_PROCESSOR}. Support for Vc disabled.")


cmake: Use cmake var not env for sdk

cmake: Use cmake var not env for sdk

ZEPHYR_SDK_INSTALL_DIR is set from the env if it is not passed
explicitly to cmake, but one usage was reading directly from the env,
not allowing passing the var to cmake instead.

Change find_package of Zephyr-sdk to read from cmake var not env var.

Signed-off-by: Jeremy Bettis <4df7b5147fee087dca33c181f288ee7dbf56e022@google.com>

--- cmake/modules/verify-toolchain.cmake
+++ cmake/modules/verify-toolchain.cmake
@@ -76,7 +76,7 @@
     # To support Zephyr SDK tools (DTC, and other tools) with 3rd party toolchains
     # then we keep track of current toolchain variant.
     set(ZEPHYR_CURRENT_TOOLCHAIN_VARIANT ${ZEPHYR_TOOLCHAIN_VARIANT})
-    find_package(Zephyr-sdk ${TOOLCHAIN_ZEPHYR_MINIMUM_REQUIRED_VERSION} REQUIRED QUIET HINTS $ENV{ZEPHYR_SDK_INSTALL_DIR})
+    find_package(Zephyr-sdk ${TOOLCHAIN_ZEPHYR_MINIMUM_REQUIRED_VERSION} REQUIRED QUIET HINTS ${ZEPHYR_SDK_INSTALL_DIR})
     if(DEFINED ZEPHYR_CURRENT_TOOLCHAIN_VARIANT)
       set(ZEPHYR_TOOLCHAIN_VARIANT ${ZEPHYR_CURRENT_TOOLCHAIN_VARIANT})
     endif()


Use cross build objcopy (#433)

Use cross build objcopy (#433)

Resource embedding using the linker will failure when cross compiling. Use the cross build chain's objcopy instead of the host build tools' objcopy.

Signed-off-by: 13c070840a6ad1a6bd5ec250484ecbd6f037ec10@mathworks.com

--- cmake/usFunctionEmbedResources.cmake
+++ cmake/usFunctionEmbedResources.cmake
@@ -199,7 +199,7 @@
       add_custom_command(
         OUTPUT ${_source_output}
         COMMAND ${CMAKE_LINKER} -r -b binary -o ${_source_output} ${_zip_archive_name}
-        COMMAND objcopy --rename-section .data=.us_resources,alloc,load,readonly,data,contents ${_source_output} ${_source_output}
+        COMMAND ${CMAKE_OBJCOPY} --rename-section .data=.us_resources,alloc,load,readonly,data,contents ${_source_output} ${_source_output}
         DEPENDS ${_zip_archive}
         WORKING_DIRECTORY ${_zip_archive_path}
         COMMENT "Linking resources zip file for ${US_RESOURCE_TARGET}"


[cmake] Avoid passing -mcx16 to non-x86_64 compilations

We were checking the host instead of the target compiler, causing many
warnings about passing -mcx16 while building the runtime for arm.

--- stdlib/cmake/modules/AddSwiftStdlib.cmake
+++ stdlib/cmake/modules/AddSwiftStdlib.cmake
@@ -265,7 +265,7 @@
   # uses a spin lock for this, so to get reasonable behavior we have to
   # implement it ourselves using _InterlockedCompareExchange128.
   # clang-cl requires us to enable the `cx16` feature to use this intrinsic.
-  if(SWIFT_HOST_VARIANT_ARCH STREQUAL x86_64)
+  if(CFLAGS_ARCH STREQUAL x86_64)
     if(SWIFT_COMPILER_IS_MSVC_LIKE)
       list(APPEND result /clang:-mcx16)
     else()


moved up multisense driver revision

moved up multisense driver revision

--- software/externals/cmake/externals.cmake
+++ software/externals/cmake/externals.cmake
@@ -148,7 +148,7 @@
   )

 set(multisense-lcm_url http://github.com/mitdrc/multisense-lcm.git)
-set(multisense-lcm_revision ff0e70deb)
+set(multisense-lcm_revision 623bc10577f76e3dfdf061578918e2abacc8c587)
 set(multisense-lcm_depends libmultisense)


[cmake] reformat custom flags

[cmake] reformat custom flags

--- cmake/DuneUtils.cmake
+++ cmake/DuneUtils.cmake
@@ -179,9 +179,15 @@
 	"-O0 -DDNDEBUG -g3 -ggdb -Wall -Wextra -Wc++0x-compat -Wparentheses -pedantic -Wredundant-decls -Wshadow -Wunused-variable -Winline -fno-strict-aliasing -Wundef -Wnon-virtual-dtor " )

 if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
-	set( CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wdocumentation -Wshorten-64-to-32 -Wused-but-marked-unused -Wdisabled-macro-expansion -Wcovered-switch-default -Wweak-vtables -Wfloat-equal -Wswitch-enum -Wunreachable-code -Wnon-literal-null-conversion ")
+	set( CMAKE_CXX_FLAGS_DEBUG
+				"${CMAKE_CXX_FLAGS_DEBUG} -Wdocumentation -Wshorten-64-to-32 -Wused-but-marked-unused -Wdisabled-macro-expansion -Wcovered-switch-default  -Wfloat-equal -Wswitch-enum -Wunreachable-code -Wnon-literal-null-conversion "
+				CACHE STRING
+				"Flags used by the compiler during debug builds.")
 elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
-	set( CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wlogical-op")
+	set( CMAKE_CXX_FLAGS_DEBUG
+				"${CMAKE_CXX_FLAGS_DEBUG} -Wlogical-op"
+				CACHE STRING
+				"Flags used by the compiler during debug builds.")
 endif()

 FIND_PACKAGE( PkgConfig )


Simplify FindDBXML.

Simplify FindDBXML.

--- cmake/FindDBXML.cmake
+++ cmake/FindDBXML.cmake
@@ -1,9 +1,9 @@
 # Find the Oracle Berkeley DB XML library and its requirements

-find_library(XQILLA_LIBRARY names xqilla libxqilla.so PATH ${DBXML_PREFIX}/lib)
-find_library(XERCES_LIBRARY names xerces-c libxerces-c.so PATH ${DBXML_PREFIX}/lib)
-find_library(DBXML_LIBRARY names dbxml libdbxml.so PATH ${DBXML_PREFIX}/lib)
-find_library(DBCXX_LIBRARY names db_cxx lib_dbcxx.so PATH ${DBXML_PREFIX}/lib)
+find_library(XQILLA_LIBRARY NAMES xqilla)
+find_library(XERCES_LIBRARY NAMES xerces-c)
+find_library(DBXML_LIBRARY NAMES dbxml)
+find_library(DBCXX_LIBRARY NAMES db_cxx)

 include(FindPackageHandleStandardArgs)
 find_package_handle_standard_args(DBXML DEFAULT_MSG DBXML_LIBRARY)


Sync with YCM commit 9db55e62b4f1517de28cd14f5aafb17444b48512

In particular, port the fix https://github.com/robotology/ycm/pull/276

--- cmake/FindIPOPT.cmake
+++ cmake/FindIPOPT.cmake
@@ -5,11 +5,11 @@
 # Try to locate the IPOPT library
 #
 # On non Windows systems, use pkg-config to try to locate the library,
-# if this fails then try to locate the library in the directory pointed by
-# the IPOPT_DIR enviromental variable.
+# if this fails then try to locate the library in the directory pointed
+# by the IPOPT_DIR environment variable.
 #
 # On Windows systems,  just try to find the library using the IPOPT_DIR
-# enviromental variable.
+# environment variable.
 #
 # Create the following variables::
 #
@@ -21,7 +21,7 @@

 #=============================================================================
 # Copyright (C) 2008-2010 RobotCub Consortium
-# Copyright (C) 2016 iCub Facility - Istituto Italiano di Tecnologia
+# Copyright (C) 2016 Istituto Italiano di Tecnologia (IIT)
 #   Authors: Ugo Pattacini <ugo.pattacini@iit.it>
 #   Authors: Daniele E. Domenichelli <daniele.domenichelli@iit.it>
 #
@@ -82,7 +82,8 @@
       set(IPOPT_DIR /usr            CACHE PATH "Path to IPOPT build directory")
     endif()

-    set(IPOPT_INCLUDE_DIRS ${IPOPT_DIR}/include/coin)
+    find_path(IPOPT_INCLUDE_DIRS NAMES IpIpoptApplication.hpp coin/IpIpoptApplication.hpp PATHS ${IPOPT_DIR}/include/coin)
+
     find_library(IPOPT_LIBRARIES ipopt ${IPOPT_DIR}/lib
                                      ${IPOPT_DIR}/lib/coin
                                      NO_DEFAULT_PATH)
@@ -129,8 +130,9 @@
   include(SelectLibraryConfigurations)

   set(IPOPT_DIR $ENV{IPOPT_DIR} CACHE PATH "Path to IPOPT build directory")
-
-  set(IPOPT_INCLUDE_DIRS ${IPOPT_DIR}/include/coin)
+
+  find_path(IPOPT_INCLUDE_DIRS NAMES IpIpoptApplication.hpp coin/IpIpoptApplication.hpp PATHS ${IPOPT_DIR}/include/coin)
+
   find_library(IPOPT_IPOPT_LIBRARY_RELEASE libipopt ${IPOPT_DIR}/lib
                                                     ${IPOPT_DIR}/lib/coin
                                                     NO_DEFAULT_PATH)


tests/apps: Statically link libc++ with llvm-mingw.

--- cmake/StaticCRT.cmake
+++ cmake/StaticCRT.cmake
@@ -8,7 +8,9 @@
         set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -static-libgcc")
         set (CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -static-libgcc")
     endif ()
-    if (NOT CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
+    if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
+        set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static")
+    else ()
         check_cxx_compiler_flag (-static-libstdc++ HAVE_STATIC_LIBSTDCXX_FLAG)
         if (HAVE_STATIC_LIBSTDCXX_FLAG)
             set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libstdc++")


Use the --timestamps flag to call Cython. With Versions of Cython after 0.24, this allows incremental builds.

--- cmake/UseCython.cmake
+++ cmake/UseCython.cmake
@@ -142,7 +142,7 @@
   set_source_files_properties( ${_generated_files} PROPERTIES GENERATED TRUE )

   set(_cython_command ${CYTHON_EXECUTABLE} ${_cxx_arg}
-  ${_annotate_arg} ${_no_docstrings_arg} ${_cython_debug_arg} ${CYTHON_FLAGS}
+  ${_annotate_arg} ${_no_docstrings_arg} ${_cython_debug_arg} ${CYTHON_FLAGS} --timestamps
   --output-file "${CMAKE_CURRENT_BINARY_DIR}/${_directories}/${_module_name}.${_extension}" ${_pyx_location})
   string(REPLACE ";" " " _cython_comment "${_cython_command}")


only put real *.so.* shared libraries in compat.rpm

do not put there *.so symlinks

--- cmake/cpack_rpm.cmake
+++ cmake/cpack_rpm.cmake
@@ -256,7 +256,7 @@
     MESSAGE("Using ${compat_rpm} to build MariaDB-compat")
     INSTALL(CODE "EXECUTE_PROCESS(
                    COMMAND rpm2cpio ${CMAKE_SOURCE_DIR}/${compat_rpm}
-                   COMMAND cpio --extract --make-directories */libmysqlclient*.so* -
+                   COMMAND cpio --extract --make-directories */libmysqlclient*.so.* -
                    WORKING_DIRECTORY \$ENV{DESTDIR})
                   EXECUTE_PROCESS(
                    COMMAND chmod -R a+rX .


Some Windows support.

Some Windows support.

--- cmake/gcc_stm32.cmake
+++ cmake/gcc_stm32.cmake
@@ -37,14 +37,14 @@
 SET(CMAKE_SYSTEM_NAME Generic)
 SET(CMAKE_SYSTEM_PROCESSOR arm)

-CMAKE_FORCE_C_COMPILER(${TOOLCHAIN_BIN_DIR}/${TARGET_TRIPLET}-gcc GNU)
-CMAKE_FORCE_CXX_COMPILER(${TOOLCHAIN_BIN_DIR}/${TARGET_TRIPLET}-g++ GNU)
-SET(CMAKE_ASM_COMPILER ${TOOLCHAIN_BIN_DIR}/${TARGET_TRIPLET}-gcc)
+CMAKE_FORCE_C_COMPILER(${TOOLCHAIN_BIN_DIR}/${TARGET_TRIPLET}-gcc${CMAKE_EXECUTABLE_SUFFIX} GNU)
+CMAKE_FORCE_CXX_COMPILER(${TOOLCHAIN_BIN_DIR}/${TARGET_TRIPLET}-g++${CMAKE_EXECUTABLE_SUFFIX} GNU)
+SET(CMAKE_ASM_COMPILER ${TOOLCHAIN_BIN_DIR}/${TARGET_TRIPLET}-gcc${CMAKE_EXECUTABLE_SUFFIX})

-SET(CMAKE_OBJCOPY ${TOOLCHAIN_BIN_DIR}/${TARGET_TRIPLET}-objcopy CACHE INTERNAL "objcopy tool")
-SET(CMAKE_OBJDUMP ${TOOLCHAIN_BIN_DIR}/${TARGET_TRIPLET}-objdump CACHE INTERNAL "objdump tool")
-SET(CMAKE_SIZE ${TOOLCHAIN_BIN_DIR}/${TARGET_TRIPLET}-size CACHE INTERNAL "size tool")
-SET(CMAKE_DEBUGER ${TOOLCHAIN_BIN_DIR}/${TARGET_TRIPLET}-gdb CACHE INTERNAL "debuger")
+SET(CMAKE_OBJCOPY ${TOOLCHAIN_BIN_DIR}/${TARGET_TRIPLET}-objcopy${CMAKE_EXECUTABLE_SUFFIX} CACHE INTERNAL "objcopy tool")
+SET(CMAKE_OBJDUMP ${TOOLCHAIN_BIN_DIR}/${TARGET_TRIPLET}-objdump${CMAKE_EXECUTABLE_SUFFIX} CACHE INTERNAL "objdump tool")
+SET(CMAKE_SIZE ${TOOLCHAIN_BIN_DIR}/${TARGET_TRIPLET}-size${CMAKE_EXECUTABLE_SUFFIX} CACHE INTERNAL "size tool")
+SET(CMAKE_DEBUGER ${TOOLCHAIN_BIN_DIR}/${TARGET_TRIPLET}-gdb${CMAKE_EXECUTABLE_SUFFIX} CACHE INTERNAL "debuger")

 SET(CMAKE_C_FLAGS_DEBUG "-Og -g" CACHE INTERNAL "c compiler flags debug")
 SET(CMAKE_CXX_FLAGS_DEBUG "-Og -g" CACHE INTERNAL "cxx compiler flags debug")


include the build directory

include the build directory

--- cmake/rosbuild2.cmake
+++ cmake/rosbuild2.cmake
@@ -17,8 +17,11 @@
                     OUTPUT_VARIABLE OUT_VAR
                     ERROR_VARIABLE ERR_VAR
     )
+    message(STATUS "dynamic_reconfigure building ${_cfg}")
     if (${ERR_VAR})
       message(ERROR ${ERR_VAR})
     endif()
   endforeach(_cfg)
+
+  include_directories(${CATKIN_BUILD_PREFIX}/${CATKIN_PACKAGE_INCLUDE_DESTINATION})
 endmacro()


externals flycapture into atlas-collection

--- software/externals/cmake/externals.cmake
+++ software/externals/cmake/externals.cmake
@@ -142,7 +142,7 @@
 set(flycapture_depends)
 set(flycapture_external_args
   ${download_only_args}
-  SOURCE_DIR ${source_prefix}/../drivers/flycapture
+  SOURCE_DIR ${source_prefix}/../atlas-collection/flycapture
   )

 set(swigmake_url https://github.com/rdeits/swigmake.git)


CMake: Find AliRoot executable and CMake config

Set AliRoot_VERSION and AliRoot_REVISION

--- cmake/FindAliRoot.cmake
+++ cmake/FindAliRoot.cmake
@@ -1,36 +1,29 @@
-# **************************************************************************
-# * Copyright(c) 1998-2015, ALICE Experiment at CERN, All rights reserved. *
-# *                                                                        *
-# * Author: The ALICE Off-line Project.                                    *
-# * Contributors are mentioned in the code where appropriate.              *
-# *                                                                        *
-# * Permission to use, copy, modify and distribute this software and its   *
-# * documentation strictly for non-commercial purposes is hereby granted   *
-# * without fee, provided that the above copyright notice appears in all   *
-# * copies and that both the copyright notice and this permission notice   *
-# * appear in the supporting documentation. The authors make no claims     *
-# * about the suitability of this software for any purpose. It is          *
-# * provided "as is" without express or implied warranty.                  *
-# **************************************************************************
+# Check AliRoot installation

 set(AliRoot_FOUND FALSE)

+set(ALIROOT CACHE STRING "AliRoot installation location")
 if(ALIROOT)
-
-  # Check if AliRoot is really installed there
-  if(EXISTS ${ALIROOT}/bin/aliroot AND EXISTS ${ALIROOT}/lib AND EXISTS ${ALIROOT}/include)
-
+  # Check for aliroot executable
+  find_program(ALIROOT_EXE NAMES aliroot PATHS ${ALIROOT}/bin NO_DEFAULT_PATH)
+
+  if(NOT ALIROOT_EXE)
+    set(AliRoot_FOUND FALSE)
+    message(WARNING "AliRoot executable not found in: ${ALIROOT}")
+  else()
+    mark_as_advanced(ALIROOT_EXE)
+
     include_directories(
       ${ALIROOT}/include
       ${ALIROOT}/include/pythia
     )

     link_directories(${ALIROOT}/lib)
-
+
+    include(${ALIROOT}/etc/AliRoot-config.cmake)
+    message(STATUS "Found AliRoot version : \"${AliRoot_VERSION}\", git hash : \"${AliRoot_REVISION}\"")
     set(AliRoot_FOUND TRUE)
-
-    message(STATUS "Found AliRoot")
-
+
   endif()
 endif(ALIROOT)


fix include directories in FindKPeople.cmake

--- cmake/FindKPeople.cmake
+++ cmake/FindKPeople.cmake
@@ -14,7 +14,7 @@
 find_library(KPEOPLE_LIBRARY NAMES kpeople HINTS ${KDE4_LIB_INSTALL_DIR} ${QT_LIBRARY_DIR})
 find_library(KPEOPLEWIDGETS_LIBRARY NAMES kpeoplewidgets HINTS ${KDE4_LIB_INSTALL_DIR} ${QT_LIBRARY_DIR})

-find_path(KPEOPLE_INCLUDE_DIR NAMES kpeople_export.h HINTS ${KDE4_INCLUDE_INSTALL_DIR} ${QT_INCLUDE_DIR} ${INCLUDE_INSTALL_DIR} PATH_SUFFIXES kpeople)
+find_path(KPEOPLE_INCLUDE_DIR NAMES kpeople_export.h HINTS ${KDE4_INCLUDE_INSTALL_DIR} ${QT_INCLUDE_DIR} ${INCLUDE_INSTALL_DIR})

 if(KPEOPLE_INCLUDE_DIR AND KPEOPLE_LIBRARY)
    set(KPEOPLE_LIBS ${kpeople_LIB_DEPENDS} ${KPEOPLE_LIBRARY})


add BLAS dependency in FindSuperLU.cmake

--- cmake/FindSuperLU.cmake
+++ cmake/FindSuperLU.cmake
@@ -3,19 +3,29 @@
   set(SUPERLU_FIND_QUIETLY TRUE)
 endif (SUPERLU_INCLUDES AND SUPERLU_LIBRARIES)

-find_path(SUPERLU_INCLUDES
-  NAMES
-  superlu/supermatrix.h
-  PATHS
-  $ENV{SUPERLUDIR}
-  ${INCLUDE_INSTALL_DIR}
-)
+find_package(BLAS)

-find_library(SUPERLU_LIBRARIES superlu PATHS $ENV{SUPERLUDIR} ${LIB_INSTALL_DIR})
+if(BLAS_FOUND)
+
+  find_path(SUPERLU_INCLUDES
+    NAMES
+    superlu/supermatrix.h
+    PATHS
+    $ENV{SUPERLUDIR}
+    ${INCLUDE_INSTALL_DIR}
+  )

-if(SUPERLU_LIBRARIES AND CMAKE_COMPILER_IS_GNUCXX)
-  set(SUPERLU_LIBRARIES ${SUPERLU_LIBRARIES} -lgfortran)
-endif(SUPERLU_LIBRARIES AND CMAKE_COMPILER_IS_GNUCXX)
+  find_library(SUPERLU_LIBRARIES superlu PATHS $ENV{SUPERLUDIR} ${LIB_INSTALL_DIR})
+
+  if(SUPERLU_LIBRARIES AND CMAKE_COMPILER_IS_GNUCXX)
+    set(SUPERLU_LIBRARIES ${SUPERLU_LIBRARIES} -lgfortran)
+  endif(SUPERLU_LIBRARIES AND CMAKE_COMPILER_IS_GNUCXX)
+
+  if(SUPERLU_LIBRARIES)
+    set(SUPERLU_LIBRARIES ${SUPERLU_LIBRARIES} ${BLAS_LIBRARIES})
+  endif(SUPERLU_LIBRARIES)
+
+endif(BLAS_FOUND)

 include(FindPackageHandleStandardArgs)
 find_package_handle_standard_args(SUPERLU DEFAULT_MSG