[Cmake-commits] CMake branch, master, updated. v3.11.0-rc4-306-g8aec07e

Kitware Robot kwrobot at kitware.com
Thu Mar 22 08:45:04 EDT 2018


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, master has been updated
       via  8aec07e0576a6121174a210dd3e3440a9f7105aa (commit)
       via  45ffb4ac79f9109ebf93980b091af839b7083b3c (commit)
       via  a5eb7d1c11c9b50e2bad40d6fe58569d95f171ca (commit)
       via  99bf77f49c18f9947b2386c4f5b6308da793de9f (commit)
       via  1673923c303c6a4184904c4c5849911feddb87e7 (commit)
       via  5697c6ae03a32205ccbff7885c61a6f925513999 (commit)
      from  d78d750c04f9d928afd7f29dcb66f854dc3bbe2b (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8aec07e0576a6121174a210dd3e3440a9f7105aa
commit 8aec07e0576a6121174a210dd3e3440a9f7105aa
Merge: 45ffb4a 1673923
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Thu Mar 22 12:40:35 2018 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Thu Mar 22 08:40:42 2018 -0400

    Merge topic 'boost-1.67'
    
    1673923c30 FindBoost: Add support for Boost 1.67 with Python version suffixes
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !1865


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=45ffb4ac79f9109ebf93980b091af839b7083b3c
commit 45ffb4ac79f9109ebf93980b091af839b7083b3c
Merge: a5eb7d1 99bf77f
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Thu Mar 22 12:39:21 2018 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Thu Mar 22 08:39:26 2018 -0400

    Merge topic 'ccmake-revise-default'
    
    99bf77f49c ccmake: Check for curses more robustly before enabling
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !1881


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a5eb7d1c11c9b50e2bad40d6fe58569d95f171ca
commit a5eb7d1c11c9b50e2bad40d6fe58569d95f171ca
Merge: d78d750 5697c6a
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Thu Mar 22 12:35:11 2018 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Thu Mar 22 08:35:17 2018 -0400

    Merge topic 'vs-flags-improvement'
    
    5697c6ae03 cmVisualStudioGeneratorOptions: Factor out an OutputFlag helper
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !1862


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=99bf77f49c18f9947b2386c4f5b6308da793de9f
commit 99bf77f49c18f9947b2386c4f5b6308da793de9f
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Wed Mar 21 13:37:20 2018 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Wed Mar 21 13:57:45 2018 -0400

    ccmake: Check for curses more robustly before enabling
    
    Compute a default for `BUILD_CursesDialog` by building a small test
    project that uses curses.  Disable `ccmake` by default if it fails,
    and do not search for Curses as part of the main build.  This avoids
    creating FindCurses cache entries when we are not considering ccmake.
    
    If `BUILD_CursesDialog` is enabled (e.g. by the user) then warn if
    curses cannot be found.

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6623959..a27c662 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -573,23 +573,25 @@ macro (CMAKE_BUILD_UTILITIES)
   #---------------------------------------------------------------------
   # Use curses?
   if (UNIX)
-    # there is a bug in the Syllable libraries which makes linking ccmake fail, Alex
-    if(NOT CMAKE_SYSTEM_NAME MATCHES syllable)
-      set(CURSES_NEED_NCURSES TRUE)
-      find_package(Curses QUIET)
-      if (CURSES_LIBRARY)
-        option(BUILD_CursesDialog "Build the CMake Curses Dialog ccmake" ON)
-      else ()
-        message("Curses libraries were not found. Curses GUI for CMake will not be built.")
-        set(BUILD_CursesDialog 0)
-      endif ()
-    else()
-      set(BUILD_CursesDialog 0)
+    if(NOT DEFINED BUILD_CursesDialog)
+      include(${CMake_SOURCE_DIR}/Source/Checks/Curses.cmake)
+      option(BUILD_CursesDialog "Build the CMake Curses Dialog ccmake" "${CMakeCheckCurses_COMPILED}")
     endif()
   else ()
     set(BUILD_CursesDialog 0)
   endif ()
   if(BUILD_CursesDialog)
+    set(CURSES_NEED_NCURSES TRUE)
+    find_package(Curses)
+    if(NOT CURSES_FOUND)
+      message(WARNING
+        "'ccmake' will not be built because Curses was not found.\n"
+        "Turn off BUILD_CursesDialog to suppress this message."
+        )
+      set(BUILD_CursesDialog 0)
+    endif()
+  endif()
+  if(BUILD_CursesDialog)
     if(NOT CMAKE_USE_SYSTEM_FORM)
       add_subdirectory(Source/CursesDialog/form)
     elseif(NOT CURSES_FORM_LIBRARY)
diff --git a/Source/Checks/Curses.cmake b/Source/Checks/Curses.cmake
new file mode 100644
index 0000000..46dc770
--- /dev/null
+++ b/Source/Checks/Curses.cmake
@@ -0,0 +1,41 @@
+message(STATUS "Checking for curses support")
+
+# Try compiling a simple project using curses.
+# Pass in any cache entries that the user may have set.
+set(CMakeCheckCurses_ARGS "")
+foreach(v
+    CURSES_INCLUDE_PATH
+    CURSES_CURSES_LIBRARY
+    CURSES_NCURSES_LIBRARY
+    CURSES_EXTRA_LIBRARY
+    CURSES_FORM_LIBRARY
+    )
+  if(${v})
+    list(APPEND CMakeCheckCurses_ARGS -D${v}=${${v}})
+  endif()
+endforeach()
+file(REMOVE_RECURSE "${CMake_BINARY_DIR}/Source/Checks/Curses-build")
+try_compile(CMakeCheckCurses_COMPILED
+  ${CMake_BINARY_DIR}/Source/Checks/Curses-build
+  ${CMake_SOURCE_DIR}/Source/Checks/Curses
+  CheckCurses # project name
+  CheckCurses # target name
+  CMAKE_FLAGS
+    "-DCMAKE_C_FLAGS:STRING=${CMAKE_C_FLAGS}"
+    ${CMakeCheckCurses_ARGS}
+  OUTPUT_VARIABLE CMakeCheckCurses_OUTPUT
+  )
+
+# Covnert result from cache entry to normal variable.
+set(CMakeCheckCurses_COMPILED "${CMakeCheckCurses_COMPILED}")
+unset(CMakeCheckCurses_COMPILED CACHE)
+
+if(CMakeCheckCurses_COMPILED)
+  message(STATUS "Checking for curses support - Success")
+  file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
+    "Checking for curses support passed with the following output:\n${CMakeCheckCurses_OUTPUT}\n\n")
+else()
+  message(STATUS "Checking for curses support - Failed")
+  file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
+    "Checking for curses support failed with the following output:\n${CMakeCheckCurses_OUTPUT}\n\n")
+endif()
diff --git a/Source/Checks/Curses/CMakeLists.txt b/Source/Checks/Curses/CMakeLists.txt
new file mode 100644
index 0000000..17318a3
--- /dev/null
+++ b/Source/Checks/Curses/CMakeLists.txt
@@ -0,0 +1,25 @@
+cmake_minimum_required(VERSION 3.1)
+if(POLICY CMP0060)
+  cmake_policy(SET CMP0060 NEW)
+endif()
+project(CheckCurses C)
+
+set(CURSES_NEED_NCURSES TRUE)
+find_package(Curses)
+if(NOT CURSES_FOUND)
+  return()
+endif()
+include_directories(${CURSES_INCLUDE_DIRS})
+add_executable(CheckCurses CheckCurses.c)
+target_link_libraries(CheckCurses ${CURSES_LIBRARIES})
+
+foreach(h
+    CURSES_HAVE_CURSES_H
+    CURSES_HAVE_NCURSES_H
+    CURSES_HAVE_NCURSES_NCURSES_H
+    CURSES_HAVE_NCURSES_CURSES_H
+    )
+  if(${h})
+    target_compile_definitions(CheckCurses PRIVATE ${h})
+  endif()
+endforeach()
diff --git a/Source/Checks/Curses/CheckCurses.c b/Source/Checks/Curses/CheckCurses.c
new file mode 100644
index 0000000..857ae28
--- /dev/null
+++ b/Source/Checks/Curses/CheckCurses.c
@@ -0,0 +1,15 @@
+#if defined(CURSES_HAVE_NCURSES_H)
+#include <ncurses.h>
+#elif defined(CURSES_HAVE_NCURSES_NCURSES_H)
+#include <ncurses/ncurses.h>
+#elif defined(CURSES_HAVE_NCURSES_CURSES_H)
+#include <ncurses/curses.h>
+#else
+#include <curses.h>
+#endif
+
+int main()
+{
+  curses_version();
+  return 0;
+}

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1673923c303c6a4184904c4c5849911feddb87e7
commit 1673923c303c6a4184904c4c5849911feddb87e7
Author:     Roger Leigh <rleigh at codelibre.net>
AuthorDate: Sun Mar 18 13:05:35 2018 +0000
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Wed Mar 21 13:34:17 2018 -0400

    FindBoost: Add support for Boost 1.67 with Python version suffixes
    
    Fixes: #16612, #16335, #16391, #12955

diff --git a/Modules/FindBoost.cmake b/Modules/FindBoost.cmake
index 4a55588..8d44aee 100644
--- a/Modules/FindBoost.cmake
+++ b/Modules/FindBoost.cmake
@@ -10,7 +10,7 @@
 # Use this module by invoking find_package with the form::
 #
 #   find_package(Boost
-#     [version] [EXACT]      # Minimum or EXACT version e.g. 1.36.0
+#     [version] [EXACT]      # Minimum or EXACT version e.g. 1.67.0
 #     [REQUIRED]             # Fail with error if Boost is not found
 #     [COMPONENTS <libs>...] # Boost libraries by their canonical name
 #                            # e.g. "date_time" for "libboost_date_time"
@@ -40,6 +40,15 @@
 #                            information about Boost's automatic linking
 #                            displayed during compilation
 #
+# Note that Boost Python components require a Python version suffix
+# (Boost 1.67 and later), e.g. ``python36`` or ``python27`` for the
+# versions built against Python 3.6 and 2.7, respectively.  This also
+# applies to additional components using Python including
+# ``mpi_python`` and ``numpy``.  Earlier Boost releases may use
+# distribution-specific suffixes such as ``2``, ``3`` or ``2.7``.
+# These may also be used as suffixes, but note that they are not
+# portable.
+#
 # This module reads hints about search locations from variables::
 #
 #   BOOST_ROOT             - Preferred installation prefix
@@ -156,7 +165,7 @@
 #   Boost_REALPATH           - Set to ON to resolve symlinks for discovered
 #                              libraries to assist with packaging.  For example,
 #                              the "system" component library may be resolved to
-#                              "/usr/lib/libboost_system.so.1.42.0" instead of
+#                              "/usr/lib/libboost_system.so.1.67.0" instead of
 #                              "/usr/lib/libboost_system.so".  This does not
 #                              affect linking and should not be enabled unless
 #                              the user needs this information.
@@ -190,6 +199,13 @@
 #   target_link_libraries(foo Boost::date_time Boost::filesystem
 #                             Boost::iostreams)
 #
+# Example to find Boost Python 3.6 libraries and use imported targets::
+#
+#   find_package(Boost 1.67 REQUIRED COMPONENTS
+#                python36 numpy36)
+#   add_executable(foo foo.cc)
+#   target_link_libraries(foo Boost::python36 Boost::numpy36)
+#
 # Example to find Boost headers and some *static* (release only) libraries::
 #
 #   set(Boost_USE_STATIC_LIBS        ON)  # only find static libs
@@ -197,7 +213,7 @@
 #   set(Boost_USE_RELEASE_LIBS       ON)  # only find release libs
 #   set(Boost_USE_MULTITHREADED      ON)
 #   set(Boost_USE_STATIC_RUNTIME    OFF)
-#   find_package(Boost 1.36.0 COMPONENTS date_time filesystem system ...)
+#   find_package(Boost 1.66.0 COMPONENTS date_time filesystem system ...)
 #   if(Boost_FOUND)
 #     include_directories(${Boost_INCLUDE_DIRS})
 #     add_executable(foo foo.cc)
@@ -559,6 +575,13 @@ function(_Boost_COMPONENT_DEPENDENCIES component _ret)
   # required only if the BoostScanDeps.cmake script logic is changed.
   # The addition of a new release should only require it to be run
   # against the new release.
+
+  # Handle Python version suffixes
+  if(component MATCHES "^(python|mpi_python|numpy)([0-9][0-9]?|[0-9]\\.[0-9])\$")
+    set(component "${CMAKE_MATCH_1}")
+    set(component_python_version "${CMAKE_MATCH_2}")
+  endif()
+
   set(_Boost_IMPORTED_TARGETS TRUE)
   if(Boost_VERSION VERSION_LESS 103300)
     message(WARNING "Imported targets and dependency information not available for Boost version ${Boost_VERSION} (all versions older than 1.33)")
@@ -776,8 +799,7 @@ function(_Boost_COMPONENT_DEPENDENCIES component _ret)
     set(_Boost_THREAD_DEPENDENCIES chrono system date_time atomic)
     set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread chrono date_time atomic)
     set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
-  else()
-    if(NOT Boost_VERSION VERSION_LESS 106500)
+  elseif(NOT Boost_VERSION VERSION_LESS 106500 AND Boost_VERSION VERSION_LESS 106700)
       set(_Boost_CHRONO_DEPENDENCIES system)
       set(_Boost_CONTEXT_DEPENDENCIES thread chrono system date_time)
       set(_Boost_COROUTINE_DEPENDENCIES context system)
@@ -791,10 +813,29 @@ function(_Boost_COMPONENT_DEPENDENCIES component _ret)
       set(_Boost_NUMPY_DEPENDENCIES python)
       set(_Boost_RANDOM_DEPENDENCIES system)
       set(_Boost_THREAD_DEPENDENCIES chrono system date_time atomic)
+      set(_Boost_TIMER_DEPENDENCIES chrono system)
       set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread chrono date_time atomic)
       set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
-    endif()
+  else()
     if(NOT Boost_VERSION VERSION_LESS 106700)
+      set(_Boost_CHRONO_DEPENDENCIES system)
+      set(_Boost_CONTEXT_DEPENDENCIES thread chrono system date_time)
+      set(_Boost_COROUTINE_DEPENDENCIES context system)
+      set(_Boost_FIBER_DEPENDENCIES context thread chrono system date_time)
+      set(_Boost_FILESYSTEM_DEPENDENCIES system)
+      set(_Boost_IOSTREAMS_DEPENDENCIES regex)
+      set(_Boost_LOG_DEPENDENCIES date_time log_setup system filesystem thread regex chrono atomic)
+      set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l atomic)
+      set(_Boost_MPI_DEPENDENCIES serialization)
+      set(_Boost_MPI_PYTHON_DEPENDENCIES python${component_python_version} mpi serialization)
+      set(_Boost_NUMPY_DEPENDENCIES python${component_python_version})
+      set(_Boost_RANDOM_DEPENDENCIES system)
+      set(_Boost_THREAD_DEPENDENCIES chrono system date_time atomic)
+      set(_Boost_TIMER_DEPENDENCIES chrono system)
+      set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread chrono date_time atomic)
+      set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
+    endif()
+    if(NOT Boost_VERSION VERSION_LESS 106800)
       message(WARNING "New Boost version may have incorrect or missing dependencies and imported targets")
     endif()
   endif()
@@ -820,6 +861,12 @@ endfunction()
 # _hdrs
 #
 function(_Boost_COMPONENT_HEADERS component _hdrs)
+  # Handle Python version suffixes
+  if(component MATCHES "^(python|mpi_python|numpy)([0-9][0-9]?|[0-9]\\.[0-9])\$")
+    set(component "${CMAKE_MATCH_1}")
+    set(component_python_version "${CMAKE_MATCH_2}")
+  endif()
+
   # Note: new boost components will require adding here.  The header
   # must be present in all versions of Boost providing a library.
   set(_Boost_ATOMIC_HEADERS              "boost/atomic.hpp")
@@ -1034,7 +1081,7 @@ else()
   # _Boost_COMPONENT_HEADERS.  See the instructions at the top of
   # _Boost_COMPONENT_DEPENDENCIES.
   set(_Boost_KNOWN_VERSIONS ${Boost_ADDITIONAL_VERSIONS}
-    "1.66.0" "1.66" "1.65.1" "1.65.0" "1.65"
+    "1.67.0" "1.67" "1.66.0" "1.66" "1.65.1" "1.65.0" "1.65"
     "1.64.0" "1.64" "1.63.0" "1.63" "1.62.0" "1.62" "1.61.0" "1.61" "1.60.0" "1.60"
     "1.59.0" "1.59" "1.58.0" "1.58" "1.57.0" "1.57" "1.56.0" "1.56" "1.55.0" "1.55"
     "1.54.0" "1.54" "1.53.0" "1.53" "1.52.0" "1.52" "1.51.0" "1.51"
@@ -1613,7 +1660,44 @@ foreach(COMPONENT ${Boost_FIND_COMPONENTS})
     endforeach()
   endif()
 
+  # Handle Python version suffixes
+  unset(COMPONENT_PYTHON_VERSION_MAJOR)
+  unset(COMPONENT_PYTHON_VERSION_MINOR)
+  if(${COMPONENT} MATCHES "^(python|mpi_python|numpy)([0-9])\$")
+    set(COMPONENT_UNVERSIONED "${CMAKE_MATCH_1}")
+    set(COMPONENT_PYTHON_VERSION_MAJOR "${CMAKE_MATCH_2}")
+  elseif(${COMPONENT} MATCHES "^(python|mpi_python|numpy)([0-9])\\.?([0-9])\$")
+    set(COMPONENT_UNVERSIONED "${CMAKE_MATCH_1}")
+    set(COMPONENT_PYTHON_VERSION_MAJOR "${CMAKE_MATCH_2}")
+    set(COMPONENT_PYTHON_VERSION_MINOR "${CMAKE_MATCH_3}")
+  endif()
+
+  unset(_Boost_FIND_LIBRARY_HINTS_FOR_COMPONENT_NAME)
+  if (COMPONENT_PYTHON_VERSION_MINOR)
+    # Boost >= 1.67
+    list(APPEND _Boost_FIND_LIBRARY_HINTS_FOR_COMPONENT_NAME "${COMPONENT_UNVERSIONED}${COMPONENT_PYTHON_VERSION_MAJOR}${COMPONENT_PYTHON_VERSION_MINOR}")
+    # Debian/Ubuntu (Some versions omit the 2 and/or 3 from the suffix)
+    list(APPEND _Boost_FIND_LIBRARY_HINTS_FOR_COMPONENT_NAME "${COMPONENT_UNVERSIONED}${COMPONENT_PYTHON_VERSION_MAJOR}-py${COMPONENT_PYTHON_VERSION_MAJOR}${COMPONENT_PYTHON_VERSION_MINOR}")
+    list(APPEND _Boost_FIND_LIBRARY_HINTS_FOR_COMPONENT_NAME "${COMPONENT_UNVERSIONED}-py${COMPONENT_PYTHON_VERSION_MAJOR}${COMPONENT_PYTHON_VERSION_MINOR}")
+    # Gentoo
+    list(APPEND _Boost_FIND_LIBRARY_HINTS_FOR_COMPONENT_NAME "${COMPONENT_UNVERSIONED}-${COMPONENT_PYTHON_VERSION_MAJOR}${COMPONENT_PYTHON_VERSION_MINOR}")
+    # RPMs
+    list(APPEND _Boost_FIND_LIBRARY_HINTS_FOR_COMPONENT_NAME "${COMPONENT_UNVERSIONED}-${COMPONENT_PYTHON_VERSION_MAJOR}${COMPONENT_PYTHON_VERSION_MINOR}")
+  endif()
+  if (COMPONENT_PYTHON_VERSION_MAJOR AND NOT COMPONENT_PYTHON_VERSION_MINOR)
+    # Boost < 1.67
+    list(APPEND _Boost_FIND_LIBRARY_HINTS_FOR_COMPONENT_NAME "${COMPONENT_UNVERSIONED}${COMPONENT_PYTHON_VERSION_MAJOR}")
+  endif()
+
   # Consolidate and report component-specific hints.
+  if(_Boost_FIND_LIBRARY_HINTS_FOR_COMPONENT_NAME)
+    list(REMOVE_DUPLICATES _Boost_FIND_LIBRARY_HINTS_FOR_COMPONENT_NAME)
+    if(Boost_DEBUG)
+      message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
+        "Component-specific library search names for ${COMPONENT_NAME}: "
+        "${_Boost_FIND_LIBRARY_HINTS_FOR_COMPONENT_NAME}")
+    endif()
+  endif()
   if(_Boost_FIND_LIBRARY_HINTS_FOR_COMPONENT)
     list(REMOVE_DUPLICATES _Boost_FIND_LIBRARY_HINTS_FOR_COMPONENT)
     if(Boost_DEBUG)
@@ -1643,28 +1727,30 @@ foreach(COMPONENT ${Boost_FIND_COMPONENTS})
   # Find RELEASE libraries
   #
   unset(_boost_RELEASE_NAMES)
-  foreach(compiler IN LISTS _boost_COMPILER)
-    list(APPEND _boost_RELEASE_NAMES
-      ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${compiler}${_boost_MULTITHREADED}${_boost_RELEASE_ABI_TAG}${_boost_ARCHITECTURE_TAG}-${Boost_LIB_VERSION}
-      ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${compiler}${_boost_MULTITHREADED}${_boost_RELEASE_ABI_TAG} )
-  endforeach()
-  list(APPEND _boost_RELEASE_NAMES
-    ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${_boost_MULTITHREADED}${_boost_RELEASE_ABI_TAG}${_boost_ARCHITECTURE_TAG}-${Boost_LIB_VERSION}
-    ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${_boost_MULTITHREADED}${_boost_RELEASE_ABI_TAG}
-    ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT} )
-  if(_boost_STATIC_RUNTIME_WORKAROUND)
-    set(_boost_RELEASE_STATIC_ABI_TAG "-s${_boost_RELEASE_ABI_TAG}")
+  foreach(component IN LISTS _Boost_FIND_LIBRARY_HINTS_FOR_COMPONENT_NAME COMPONENT)
     foreach(compiler IN LISTS _boost_COMPILER)
       list(APPEND _boost_RELEASE_NAMES
-        ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${compiler}${_boost_MULTITHREADED}${_boost_RELEASE_STATIC_ABI_TAG}${_boost_ARCHITECTURE_TAG}-${Boost_LIB_VERSION}
-        ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${compiler}${_boost_MULTITHREADED}${_boost_RELEASE_STATIC_ABI_TAG} )
+        ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${compiler}${_boost_MULTITHREADED}${_boost_RELEASE_ABI_TAG}${_boost_ARCHITECTURE_TAG}-${Boost_LIB_VERSION}
+        ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${compiler}${_boost_MULTITHREADED}${_boost_RELEASE_ABI_TAG} )
     endforeach()
     list(APPEND _boost_RELEASE_NAMES
-      ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${_boost_MULTITHREADED}${_boost_RELEASE_STATIC_ABI_TAG}${_boost_ARCHITECTURE_TAG}-${Boost_LIB_VERSION}
-      ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${_boost_MULTITHREADED}${_boost_RELEASE_STATIC_ABI_TAG} )
-  endif()
+      ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${_boost_MULTITHREADED}${_boost_RELEASE_ABI_TAG}${_boost_ARCHITECTURE_TAG}-${Boost_LIB_VERSION}
+      ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${_boost_MULTITHREADED}${_boost_RELEASE_ABI_TAG}
+      ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component} )
+    if(_boost_STATIC_RUNTIME_WORKAROUND)
+      set(_boost_RELEASE_STATIC_ABI_TAG "-s${_boost_RELEASE_ABI_TAG}")
+      foreach(compiler IN LISTS _boost_COMPILER)
+        list(APPEND _boost_RELEASE_NAMES
+          ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${compiler}${_boost_MULTITHREADED}${_boost_RELEASE_STATIC_ABI_TAG}${_boost_ARCHITECTURE_TAG}-${Boost_LIB_VERSION}
+          ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${compiler}${_boost_MULTITHREADED}${_boost_RELEASE_STATIC_ABI_TAG} )
+      endforeach()
+      list(APPEND _boost_RELEASE_NAMES
+        ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${_boost_MULTITHREADED}${_boost_RELEASE_STATIC_ABI_TAG}${_boost_ARCHITECTURE_TAG}-${Boost_LIB_VERSION}
+        ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${_boost_MULTITHREADED}${_boost_RELEASE_STATIC_ABI_TAG} )
+    endif()
+  endforeach()
   if(Boost_THREADAPI AND ${COMPONENT} STREQUAL "thread")
-     _Boost_PREPEND_LIST_WITH_THREADAPI(_boost_RELEASE_NAMES ${_boost_RELEASE_NAMES})
+    _Boost_PREPEND_LIST_WITH_THREADAPI(_boost_RELEASE_NAMES ${_boost_RELEASE_NAMES})
   endif()
   if(Boost_DEBUG)
     message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
@@ -1693,27 +1779,29 @@ foreach(COMPONENT ${Boost_FIND_COMPONENTS})
   # Find DEBUG libraries
   #
   unset(_boost_DEBUG_NAMES)
-  foreach(compiler IN LISTS _boost_COMPILER)
-    list(APPEND _boost_DEBUG_NAMES
-      ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${compiler}${_boost_MULTITHREADED}${_boost_DEBUG_ABI_TAG}${_boost_ARCHITECTURE_TAG}-${Boost_LIB_VERSION}
-      ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${compiler}${_boost_MULTITHREADED}${_boost_DEBUG_ABI_TAG} )
-  endforeach()
-  list(APPEND _boost_DEBUG_NAMES
-    ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${_boost_MULTITHREADED}${_boost_DEBUG_ABI_TAG}${_boost_ARCHITECTURE_TAG}-${Boost_LIB_VERSION}
-    ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${_boost_MULTITHREADED}${_boost_DEBUG_ABI_TAG}
-    ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${_boost_MULTITHREADED}
-    ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT} )
-  if(_boost_STATIC_RUNTIME_WORKAROUND)
-    set(_boost_DEBUG_STATIC_ABI_TAG "-s${_boost_DEBUG_ABI_TAG}")
+  foreach(component IN LISTS _Boost_FIND_LIBRARY_HINTS_FOR_COMPONENT_NAME COMPONENT)
     foreach(compiler IN LISTS _boost_COMPILER)
       list(APPEND _boost_DEBUG_NAMES
-        ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${compiler}${_boost_MULTITHREADED}${_boost_DEBUG_STATIC_ABI_TAG}${_boost_ARCHITECTURE_TAG}-${Boost_LIB_VERSION}
-        ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${compiler}${_boost_MULTITHREADED}${_boost_DEBUG_STATIC_ABI_TAG} )
+        ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${compiler}${_boost_MULTITHREADED}${_boost_DEBUG_ABI_TAG}${_boost_ARCHITECTURE_TAG}-${Boost_LIB_VERSION}
+        ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${compiler}${_boost_MULTITHREADED}${_boost_DEBUG_ABI_TAG} )
     endforeach()
     list(APPEND _boost_DEBUG_NAMES
-      ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${_boost_MULTITHREADED}${_boost_DEBUG_STATIC_ABI_TAG}${_boost_ARCHITECTURE_TAG}-${Boost_LIB_VERSION}
-      ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${_boost_MULTITHREADED}${_boost_DEBUG_STATIC_ABI_TAG} )
-  endif()
+      ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${_boost_MULTITHREADED}${_boost_DEBUG_ABI_TAG}${_boost_ARCHITECTURE_TAG}-${Boost_LIB_VERSION}
+      ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${_boost_MULTITHREADED}${_boost_DEBUG_ABI_TAG}
+      ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${_boost_MULTITHREADED}
+      ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component} )
+    if(_boost_STATIC_RUNTIME_WORKAROUND)
+      set(_boost_DEBUG_STATIC_ABI_TAG "-s${_boost_DEBUG_ABI_TAG}")
+      foreach(compiler IN LISTS _boost_COMPILER)
+        list(APPEND _boost_DEBUG_NAMES
+          ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${compiler}${_boost_MULTITHREADED}${_boost_DEBUG_STATIC_ABI_TAG}${_boost_ARCHITECTURE_TAG}-${Boost_LIB_VERSION}
+          ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${compiler}${_boost_MULTITHREADED}${_boost_DEBUG_STATIC_ABI_TAG} )
+      endforeach()
+      list(APPEND _boost_DEBUG_NAMES
+        ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${_boost_MULTITHREADED}${_boost_DEBUG_STATIC_ABI_TAG}${_boost_ARCHITECTURE_TAG}-${Boost_LIB_VERSION}
+        ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${_boost_MULTITHREADED}${_boost_DEBUG_STATIC_ABI_TAG} )
+    endif()
+  endforeach()
   if(Boost_THREADAPI AND ${COMPONENT} STREQUAL "thread")
      _Boost_PREPEND_LIST_WITH_THREADAPI(_boost_DEBUG_NAMES ${_boost_DEBUG_NAMES})
   endif()

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5697c6ae03a32205ccbff7885c61a6f925513999
commit 5697c6ae03a32205ccbff7885c61a6f925513999
Author:     Vitaly Stakhovsky <vvs31415 at gitlab.org>
AuthorDate: Fri Mar 16 11:20:08 2018 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Tue Mar 20 14:10:04 2018 -0400

    cmVisualStudioGeneratorOptions: Factor out an OutputFlag helper

diff --git a/Source/cmVisualStudioGeneratorOptions.cxx b/Source/cmVisualStudioGeneratorOptions.cxx
index 2095d23..7d7000b 100644
--- a/Source/cmVisualStudioGeneratorOptions.cxx
+++ b/Source/cmVisualStudioGeneratorOptions.cxx
@@ -6,10 +6,14 @@
 #include "cmSystemTools.h"
 #include "cmVisualStudio10TargetGenerator.h"
 
+static void cmVS10EscapeForMSBuild(std::string& ret)
+{
+  cmSystemTools::ReplaceString(ret, ";", "%3B");
+}
+
 static std::string cmVisualStudio10GeneratorOptionsEscapeForXML(
   std::string ret)
 {
-  cmSystemTools::ReplaceString(ret, ";", "%3B");
   cmSystemTools::ReplaceString(ret, "&", "&");
   cmSystemTools::ReplaceString(ret, "<", "<");
   cmSystemTools::ReplaceString(ret, ">", ">");
@@ -440,6 +444,30 @@ void cmVisualStudioGeneratorOptions::SetConfiguration(
   this->Configuration = config;
 }
 
+void cmVisualStudioGeneratorOptions::OutputFlag(std::ostream& fout,
+                                                const char* indent,
+                                                const char* tag,
+                                                const std::string& content)
+{
+  if (this->Version >= cmGlobalVisualStudioGenerator::VS10) {
+    if (!this->Configuration.empty()) {
+      // if there are configuration specific flags, then
+      // use the configuration specific tag for PreprocessorDefinitions
+      fout << indent;
+      this->TargetGenerator->WritePlatformConfigTag(tag, this->Configuration,
+                                                    0, 0, 0, &fout);
+    } else {
+      fout << indent << "<" << tag << ">";
+    }
+    fout << cmVisualStudio10GeneratorOptionsEscapeForXML(content);
+    fout << "</" << tag << ">";
+  } else {
+    fout << indent << tag << "=\"";
+    fout << cmVisualStudioGeneratorOptionsEscapeForXML(content);
+    fout << "\"";
+  }
+}
+
 void cmVisualStudioGeneratorOptions::OutputPreprocessorDefinitions(
   std::ostream& fout, const char* prefix, const char* suffix,
   const std::string& lang)
@@ -451,19 +479,8 @@ void cmVisualStudioGeneratorOptions::OutputPreprocessorDefinitions(
   if (lang == "CUDA") {
     tag = "Defines";
   }
-  if (this->Version >= cmGlobalVisualStudioGenerator::VS10) {
-    // if there are configuration specific flags, then
-    // use the configuration specific tag for PreprocessorDefinitions
-    if (!this->Configuration.empty()) {
-      fout << prefix;
-      this->TargetGenerator->WritePlatformConfigTag(
-        tag, this->Configuration.c_str(), 0, 0, 0, &fout);
-    } else {
-      fout << prefix << "<" << tag << ">";
-    }
-  } else {
-    fout << prefix << tag << "=\"";
-  }
+
+  std::ostringstream oss;
   const char* sep = "";
   std::vector<std::string>::const_iterator de =
     cmRemoveDuplicates(this->Defines);
@@ -472,29 +489,27 @@ void cmVisualStudioGeneratorOptions::OutputPreprocessorDefinitions(
     // Escape the definition for the compiler.
     std::string define;
     if (this->Version < cmGlobalVisualStudioGenerator::VS10) {
-      define = this->LocalGenerator->EscapeForShell(di->c_str(), true);
+      define = this->LocalGenerator->EscapeForShell(*di, true);
     } else {
       define = *di;
     }
-    // Escape this flag for the IDE.
+    // Escape this flag for the MSBuild.
     if (this->Version >= cmGlobalVisualStudioGenerator::VS10) {
-      define = cmVisualStudio10GeneratorOptionsEscapeForXML(define);
-
+      cmVS10EscapeForMSBuild(define);
       if (lang == "RC") {
         cmSystemTools::ReplaceString(define, "\"", "\\\"");
       }
-    } else {
-      define = cmVisualStudioGeneratorOptionsEscapeForXML(define);
     }
     // Store the flag in the project file.
-    fout << sep << define;
+    oss << sep << define;
     sep = ";";
   }
   if (this->Version >= cmGlobalVisualStudioGenerator::VS10) {
-    fout << ";%(" << tag << ")</" << tag << ">" << suffix;
-  } else {
-    fout << "\"" << suffix;
+    oss << ";%(" << tag << ")";
   }
+
+  this->OutputFlag(fout, prefix, tag, oss.str());
+  fout << suffix;
 }
 
 void cmVisualStudioGeneratorOptions::OutputAdditionalIncludeDirectories(
@@ -512,20 +527,7 @@ void cmVisualStudioGeneratorOptions::OutputAdditionalIncludeDirectories(
     tag = "IncludePaths";
   }
 
-  if (this->Version >= cmGlobalVisualStudioGenerator::VS10) {
-    // if there are configuration specific flags, then
-    // use the configuration specific tag for PreprocessorDefinitions
-    if (!this->Configuration.empty()) {
-      fout << prefix;
-      this->TargetGenerator->WritePlatformConfigTag(
-        tag, this->Configuration.c_str(), 0, 0, 0, &fout);
-    } else {
-      fout << prefix << "<" << tag << ">";
-    }
-  } else {
-    fout << prefix << tag << "=\"";
-  }
-
+  std::ostringstream oss;
   const char* sep = "";
   for (std::string include : this->Includes) {
     // first convert all of the slashes
@@ -539,55 +541,42 @@ void cmVisualStudioGeneratorOptions::OutputAdditionalIncludeDirectories(
       include += "\\";
     }
 
-    // Escape this include for the IDE.
-    fout << sep << (this->Version >= cmGlobalVisualStudioGenerator::VS10
-                      ? cmVisualStudio10GeneratorOptionsEscapeForXML(include)
-                      : cmVisualStudioGeneratorOptionsEscapeForXML(include));
+    // Escape this include for the MSBuild.
+    if (this->Version >= cmGlobalVisualStudioGenerator::VS10) {
+      cmVS10EscapeForMSBuild(include);
+    }
+    oss << sep << include;
     sep = ";";
 
     if (lang == "Fortran") {
       include += "/$(ConfigurationName)";
-      fout << sep << (this->Version >= cmGlobalVisualStudioGenerator::VS10
-                        ? cmVisualStudio10GeneratorOptionsEscapeForXML(include)
-                        : cmVisualStudioGeneratorOptionsEscapeForXML(include));
+      oss << sep << include;
     }
   }
 
   if (this->Version >= cmGlobalVisualStudioGenerator::VS10) {
-    fout << sep << "%(" << tag << ")</" << tag << ">" << suffix;
-  } else {
-    fout << "\"" << suffix;
+    oss << sep << "%(" << tag << ")";
   }
+
+  this->OutputFlag(fout, prefix, tag, oss.str());
+  fout << suffix;
 }
 
 void cmVisualStudioGeneratorOptions::OutputFlagMap(std::ostream& fout,
                                                    const char* indent)
 {
-  if (this->Version >= cmGlobalVisualStudioGenerator::VS10) {
-    for (auto const& m : this->FlagMap) {
-      fout << indent;
-      if (!this->Configuration.empty()) {
-        this->TargetGenerator->WritePlatformConfigTag(
-          m.first.c_str(), this->Configuration.c_str(), 0, 0, 0, &fout);
-      } else {
-        fout << "<" << m.first << ">";
+  for (auto const& m : this->FlagMap) {
+    std::ostringstream oss;
+    const char* sep = "";
+    for (std::string i : m.second) {
+      if (this->Version >= cmGlobalVisualStudioGenerator::VS10) {
+        cmVS10EscapeForMSBuild(i);
       }
-      const char* sep = "";
-      for (std::string const& i : m.second) {
-        fout << sep << cmVisualStudio10GeneratorOptionsEscapeForXML(i);
-        sep = ";";
-      }
-      fout << "</" << m.first << ">\n";
-    }
-  } else {
-    for (auto const& m : this->FlagMap) {
-      fout << indent << m.first << "=\"";
-      const char* sep = "";
-      for (std::string const& i : m.second) {
-        fout << sep << cmVisualStudioGeneratorOptionsEscapeForXML(i);
-        sep = ";";
-      }
-      fout << "\"\n";
+      oss << sep << i;
+      sep = ";";
     }
+
+    this->OutputFlag(fout, indent, m.first.c_str(), oss.str());
+    fout << "\n";
   }
 }
diff --git a/Source/cmVisualStudioGeneratorOptions.h b/Source/cmVisualStudioGeneratorOptions.h
index 5c3e415..517760a 100644
--- a/Source/cmVisualStudioGeneratorOptions.h
+++ b/Source/cmVisualStudioGeneratorOptions.h
@@ -94,6 +94,10 @@ public:
   void SetConfiguration(const std::string& config);
 
 private:
+  void OutputFlag(std::ostream& fout, const char* indent, const char* tag,
+                  const std::string& content);
+
+private:
   cmLocalVisualStudioGenerator* LocalGenerator;
   cmGlobalVisualStudioGenerator::VSVersion Version;
 

-----------------------------------------------------------------------

Summary of changes:
 CMakeLists.txt                            |   26 +++--
 Modules/FindBoost.cmake                   |  170 ++++++++++++++++++++++-------
 Source/Checks/Curses.cmake                |   41 +++++++
 Source/Checks/Curses/CMakeLists.txt       |   25 +++++
 Source/Checks/Curses/CheckCurses.c        |   15 +++
 Source/cmVisualStudioGeneratorOptions.cxx |  133 +++++++++++-----------
 Source/cmVisualStudioGeneratorOptions.h   |    4 +
 7 files changed, 289 insertions(+), 125 deletions(-)
 create mode 100644 Source/Checks/Curses.cmake
 create mode 100644 Source/Checks/Curses/CMakeLists.txt
 create mode 100644 Source/Checks/Curses/CheckCurses.c


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list