summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CMakeCPack.cmake345
-rw-r--r--CMakeLists.txt83
-rw-r--r--Modules/FindProtobuf.cmake16
-rw-r--r--Modules/Platform/Android/ndk-stl-c++.cmake2
-rw-r--r--Source/CMakeVersion.cmake2
-rw-r--r--Source/cmExportBuildAndroidMKGenerator.cxx12
-rw-r--r--Source/cmGhsMultiTargetGenerator.cxx2
-rw-r--r--Source/cmLocalGenerator.cxx5
-rw-r--r--Source/cmLocalUnixMakefileGenerator3.cxx13
-rw-r--r--Source/cmMakefile.cxx6
-rw-r--r--Source/cmMakefile.h2
-rw-r--r--Source/cmMakefileTargetGenerator.cxx41
-rw-r--r--Source/cmMakefileTargetGenerator.h1
-rw-r--r--Source/kwsys/SystemTools.cxx20
-rw-r--r--Tests/FindPackageModeMakefileTest/CMakeLists.txt13
-rw-r--r--Tests/RunCMake/Android/android.cxx3
-rw-r--r--Tests/RunCMake/Android/common.cmake2
-rw-r--r--Tests/RunCMake/AndroidMK/AndroidMK.cmake2
-rw-r--r--Tests/RunCMake/AndroidMK/bar.c3
-rw-r--r--Tests/RunCMake/AndroidMK/expectedBuildAndroidMK.txt3
-rw-r--r--Tests/RunCMake/AndroidMK/expectedInstallAndroidMK.txt3
-rw-r--r--Tests/RunCMake/CPack/VerifyResult.cmake6
22 files changed, 308 insertions, 277 deletions
diff --git a/CMakeCPack.cmake b/CMakeCPack.cmake
index 1889be2..fc042bc 100644
--- a/CMakeCPack.cmake
+++ b/CMakeCPack.cmake
@@ -1,205 +1,200 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-# If the cmake version includes cpack, use it
-if(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
- if(EXISTS "${CMAKE_ROOT}/Modules/InstallRequiredSystemLibraries.cmake")
- option(CMAKE_INSTALL_DEBUG_LIBRARIES
- "Install Microsoft runtime debug libraries with CMake." FALSE)
- mark_as_advanced(CMAKE_INSTALL_DEBUG_LIBRARIES)
-
- # By default, do not warn when built on machines using only VS Express:
- if(NOT DEFINED CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS)
- set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS ON)
- endif()
+option(CMAKE_INSTALL_DEBUG_LIBRARIES
+ "Install Microsoft runtime debug libraries with CMake." FALSE)
+mark_as_advanced(CMAKE_INSTALL_DEBUG_LIBRARIES)
- if(CMake_INSTALL_DEPENDENCIES)
- include(${CMake_SOURCE_DIR}/Modules/InstallRequiredSystemLibraries.cmake)
- endif()
- endif()
+# By default, do not warn when built on machines using only VS Express:
+if(NOT DEFINED CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS)
+ set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS ON)
+endif()
- set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "CMake is a build tool")
- set(CPACK_PACKAGE_VENDOR "Kitware")
- set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/Copyright.txt")
- set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/Copyright.txt")
- set(CPACK_PACKAGE_NAME "${CMAKE_PROJECT_NAME}")
- set(CPACK_PACKAGE_VERSION "${CMake_VERSION}")
- set(CPACK_PACKAGE_INSTALL_DIRECTORY "${CPACK_PACKAGE_NAME}")
- set(CPACK_SOURCE_PACKAGE_FILE_NAME "cmake-${CMake_VERSION}")
+if(CMake_INSTALL_DEPENDENCIES)
+ include(${CMake_SOURCE_DIR}/Modules/InstallRequiredSystemLibraries.cmake)
+endif()
- # Installers for 32- vs. 64-bit CMake:
- # - Root install directory (displayed to end user at installer-run time)
- # - "NSIS package/display name" (text used in the installer GUI)
- # - Registry key used to store info about the installation
- if(CMAKE_CL_64)
- set(CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES64")
- set(CPACK_NSIS_PACKAGE_NAME "${CPACK_PACKAGE_NAME} ${CPACK_PACKAGE_VERSION} (Win64)")
+set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "CMake is a build tool")
+set(CPACK_PACKAGE_VENDOR "Kitware")
+set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/Copyright.txt")
+set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/Copyright.txt")
+set(CPACK_PACKAGE_NAME "${CMAKE_PROJECT_NAME}")
+set(CPACK_PACKAGE_VERSION "${CMake_VERSION}")
+set(CPACK_PACKAGE_INSTALL_DIRECTORY "${CPACK_PACKAGE_NAME}")
+set(CPACK_SOURCE_PACKAGE_FILE_NAME "cmake-${CMake_VERSION}")
+
+# Installers for 32- vs. 64-bit CMake:
+# - Root install directory (displayed to end user at installer-run time)
+# - "NSIS package/display name" (text used in the installer GUI)
+# - Registry key used to store info about the installation
+if(CMAKE_CL_64)
+ set(CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES64")
+ set(CPACK_NSIS_PACKAGE_NAME "${CPACK_PACKAGE_NAME} ${CPACK_PACKAGE_VERSION} (Win64)")
+else()
+ set(CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES")
+ set(CPACK_NSIS_PACKAGE_NAME "${CPACK_PACKAGE_NAME} ${CPACK_PACKAGE_VERSION}")
+endif()
+set(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "${CPACK_NSIS_PACKAGE_NAME}")
+
+if(NOT DEFINED CPACK_SYSTEM_NAME)
+ # make sure package is not Cygwin-unknown, for Cygwin just
+ # cygwin is good for the system name
+ if("x${CMAKE_SYSTEM_NAME}" STREQUAL "xCYGWIN")
+ set(CPACK_SYSTEM_NAME Cygwin)
else()
- set(CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES")
- set(CPACK_NSIS_PACKAGE_NAME "${CPACK_PACKAGE_NAME} ${CPACK_PACKAGE_VERSION}")
- endif()
- set(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "${CPACK_NSIS_PACKAGE_NAME}")
-
- if(NOT DEFINED CPACK_SYSTEM_NAME)
- # make sure package is not Cygwin-unknown, for Cygwin just
- # cygwin is good for the system name
- if("x${CMAKE_SYSTEM_NAME}" STREQUAL "xCYGWIN")
- set(CPACK_SYSTEM_NAME Cygwin)
- else()
- set(CPACK_SYSTEM_NAME ${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR})
- endif()
+ set(CPACK_SYSTEM_NAME ${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR})
endif()
- if(${CPACK_SYSTEM_NAME} MATCHES Windows)
- if(CMAKE_CL_64)
- set(CPACK_SYSTEM_NAME win64-x64)
- set(CPACK_IFW_TARGET_DIRECTORY "@RootDir@/Program Files/${CMAKE_PROJECT_NAME}")
- else()
- set(CPACK_SYSTEM_NAME win32-x86)
- endif()
+endif()
+if(${CPACK_SYSTEM_NAME} MATCHES Windows)
+ if(CMAKE_CL_64)
+ set(CPACK_SYSTEM_NAME win64-x64)
+ set(CPACK_IFW_TARGET_DIRECTORY "@RootDir@/Program Files/${CMAKE_PROJECT_NAME}")
+ else()
+ set(CPACK_SYSTEM_NAME win32-x86)
endif()
+endif()
- # Components
- if(CMake_INSTALL_COMPONENTS)
- set(_CPACK_IFW_COMPONENTS_ALL cmake ctest cpack)
- if(WIN32 AND NOT CYGWIN)
- list(APPEND _CPACK_IFW_COMPONENTS_ALL cmcldeps)
- endif()
- if(APPLE)
- list(APPEND _CPACK_IFW_COMPONENTS_ALL cmakexbuild)
- endif()
- if(CMAKE_INSTALL_DEFAULT_COMPONENT_NAME)
- set(_CPACK_IFW_COMPONENT_UNSPECIFIED_NAME
- ${CMAKE_INSTALL_DEFAULT_COMPONENT_NAME})
- else()
- set(_CPACK_IFW_COMPONENT_UNSPECIFIED_NAME Unspecified)
- endif()
- list(APPEND _CPACK_IFW_COMPONENTS_ALL ${_CPACK_IFW_COMPONENT_UNSPECIFIED_NAME})
- string(TOUPPER "${_CPACK_IFW_COMPONENT_UNSPECIFIED_NAME}"
- _CPACK_IFW_COMPONENT_UNSPECIFIED_UNAME)
- if(BUILD_CursesDialog)
- list(APPEND _CPACK_IFW_COMPONENTS_ALL ccmake)
- endif()
- if(BUILD_QtDialog)
- list(APPEND _CPACK_IFW_COMPONENTS_ALL cmake-gui)
- if(USE_LGPL)
- set(_CPACK_IFW_COMPONENT_CMAKE-GUI_LICENSES "set(CPACK_IFW_COMPONENT_CMAKE-GUI_LICENSES
- \"LGPLv${USE_LGPL}\" \"${CMake_SOURCE_DIR}/Licenses/LGPLv${USE_LGPL}.txt\")")
- endif()
- endif()
- if(SPHINX_MAN)
- list(APPEND _CPACK_IFW_COMPONENTS_ALL sphinx-man)
- endif()
- if(SPHINX_HTML)
- list(APPEND _CPACK_IFW_COMPONENTS_ALL sphinx-html)
- endif()
- if(SPHINX_SINGLEHTML)
- list(APPEND _CPACK_IFW_COMPONENTS_ALL sphinx-singlehtml)
+# Components
+if(CMake_INSTALL_COMPONENTS)
+ set(_CPACK_IFW_COMPONENTS_ALL cmake ctest cpack)
+ if(WIN32 AND NOT CYGWIN)
+ list(APPEND _CPACK_IFW_COMPONENTS_ALL cmcldeps)
+ endif()
+ if(APPLE)
+ list(APPEND _CPACK_IFW_COMPONENTS_ALL cmakexbuild)
+ endif()
+ if(CMAKE_INSTALL_DEFAULT_COMPONENT_NAME)
+ set(_CPACK_IFW_COMPONENT_UNSPECIFIED_NAME
+ ${CMAKE_INSTALL_DEFAULT_COMPONENT_NAME})
+ else()
+ set(_CPACK_IFW_COMPONENT_UNSPECIFIED_NAME Unspecified)
+ endif()
+ list(APPEND _CPACK_IFW_COMPONENTS_ALL ${_CPACK_IFW_COMPONENT_UNSPECIFIED_NAME})
+ string(TOUPPER "${_CPACK_IFW_COMPONENT_UNSPECIFIED_NAME}"
+ _CPACK_IFW_COMPONENT_UNSPECIFIED_UNAME)
+ if(BUILD_CursesDialog)
+ list(APPEND _CPACK_IFW_COMPONENTS_ALL ccmake)
+ endif()
+ if(BUILD_QtDialog)
+ list(APPEND _CPACK_IFW_COMPONENTS_ALL cmake-gui)
+ if(USE_LGPL)
+ set(_CPACK_IFW_COMPONENT_CMAKE-GUI_LICENSES "set(CPACK_IFW_COMPONENT_CMAKE-GUI_LICENSES
+ \"LGPLv${USE_LGPL}\" \"${CMake_SOURCE_DIR}/Licenses/LGPLv${USE_LGPL}.txt\")")
endif()
- if(SPHINX_QTHELP)
- list(APPEND _CPACK_IFW_COMPONENTS_ALL sphinx-qthelp)
+ endif()
+ if(SPHINX_MAN)
+ list(APPEND _CPACK_IFW_COMPONENTS_ALL sphinx-man)
+ endif()
+ if(SPHINX_HTML)
+ list(APPEND _CPACK_IFW_COMPONENTS_ALL sphinx-html)
+ endif()
+ if(SPHINX_SINGLEHTML)
+ list(APPEND _CPACK_IFW_COMPONENTS_ALL sphinx-singlehtml)
+ endif()
+ if(SPHINX_QTHELP)
+ list(APPEND _CPACK_IFW_COMPONENTS_ALL sphinx-qthelp)
+ endif()
+ if(CMake_BUILD_DEVELOPER_REFERENCE)
+ if(CMake_BUILD_DEVELOPER_REFERENCE_HTML)
+ list(APPEND _CPACK_IFW_COMPONENTS_ALL cmake-developer-reference-html)
endif()
- if(CMake_BUILD_DEVELOPER_REFERENCE)
- if(CMake_BUILD_DEVELOPER_REFERENCE_HTML)
- list(APPEND _CPACK_IFW_COMPONENTS_ALL cmake-developer-reference-html)
- endif()
- if(CMake_BUILD_DEVELOPER_REFERENCE_QTHELP)
- list(APPEND _CPACK_IFW_COMPONENTS_ALL cmake-developer-reference-qthelp)
- endif()
+ if(CMake_BUILD_DEVELOPER_REFERENCE_QTHELP)
+ list(APPEND _CPACK_IFW_COMPONENTS_ALL cmake-developer-reference-qthelp)
endif()
- set(_CPACK_IFW_COMPONENTS_CONFIGURATION "
- # Components
- set(CPACK_COMPONENTS_ALL \"${_CPACK_IFW_COMPONENTS_ALL}\")
- set(CPACK_COMPONENTS_GROUPING IGNORE)
+ endif()
+ set(_CPACK_IFW_COMPONENTS_CONFIGURATION "
+# Components
+set(CPACK_COMPONENTS_ALL \"${_CPACK_IFW_COMPONENTS_ALL}\")
+set(CPACK_COMPONENTS_GROUPING IGNORE)
")
- else()
- if(BUILD_QtDialog AND USE_LGPL)
- set(_CPACK_IFW_ADDITIONAL_LICENSES
- "\"LGPLv${USE_LGPL}\" \"${CMake_SOURCE_DIR}/Licenses/LGPLv${USE_LGPL}.txt\"")
- endif()
+else()
+ if(BUILD_QtDialog AND USE_LGPL)
+ set(_CPACK_IFW_ADDITIONAL_LICENSES
+ "\"LGPLv${USE_LGPL}\" \"${CMake_SOURCE_DIR}/Licenses/LGPLv${USE_LGPL}.txt\"")
endif()
+endif()
- # Components scripts configuration
- foreach(_script
- CMake
- CMake.Documentation.SphinxHTML
- CMake.DeveloperReference.HTML)
- configure_file("${CMake_SOURCE_DIR}/Source/QtIFW/${_script}.qs.in"
- "${CMake_BINARY_DIR}/${_script}.qs" @ONLY)
- endforeach()
-
- if(${CMAKE_SYSTEM_NAME} MATCHES Windows)
- set(_CPACK_IFW_PACKAGE_ICON
- "set(CPACK_IFW_PACKAGE_ICON \"${CMake_SOURCE_DIR}/Source/QtDialog/CMakeSetup.ico\")")
- if(BUILD_QtDialog)
- set(_CPACK_IFW_SHORTCUT_OPTIONAL "${_CPACK_IFW_SHORTCUT_OPTIONAL}component.addOperation(\"CreateShortcut\", \"@TargetDir@/bin/cmake-gui.exe\", \"@StartMenuDir@/CMake (cmake-gui).lnk\");\n")
- endif()
- if(SPHINX_HTML)
- set(_CPACK_IFW_SHORTCUT_OPTIONAL "${_CPACK_IFW_SHORTCUT_OPTIONAL}component.addOperation(\"CreateShortcut\", \"@TargetDir@/doc/cmake-${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}/html/index.html\", \"@StartMenuDir@/CMake Documentation.lnk\");\n")
- endif()
- if(CMake_BUILD_DEVELOPER_REFERENCE)
- if(CMake_BUILD_DEVELOPER_REFERENCE_HTML)
- set(_CPACK_IFW_SHORTCUT_OPTIONAL "${_CPACK_IFW_SHORTCUT_OPTIONAL}component.addOperation(\"CreateShortcut\", \"@TargetDir@/doc/cmake-${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}/developer-reference/html/index.html\", \"@StartMenuDir@/CMake Developer Reference.lnk\");\n")
- endif()
- endif()
- configure_file("${CMake_SOURCE_DIR}/Source/QtIFW/installscript.qs.in"
- "${CMake_BINARY_DIR}/installscript.qs" @ONLY
- )
- install(FILES "${CMake_SOURCE_DIR}/Source/QtIFW/cmake.org.html"
- DESTINATION "${CMAKE_DOC_DIR}"
- )
- if(CMake_INSTALL_COMPONENTS)
- set(_CPACK_IFW_PACKAGE_SCRIPT "${CMake_BINARY_DIR}/CMake.qs")
- else()
- set(_CPACK_IFW_PACKAGE_SCRIPT "${CMake_BINARY_DIR}/installscript.qs")
+# Components scripts configuration
+foreach(_script
+ CMake
+ CMake.Documentation.SphinxHTML
+ CMake.DeveloperReference.HTML)
+ configure_file("${CMake_SOURCE_DIR}/Source/QtIFW/${_script}.qs.in"
+ "${CMake_BINARY_DIR}/${_script}.qs" @ONLY)
+endforeach()
+
+if(${CMAKE_SYSTEM_NAME} MATCHES Windows)
+ set(_CPACK_IFW_PACKAGE_ICON
+ "set(CPACK_IFW_PACKAGE_ICON \"${CMake_SOURCE_DIR}/Source/QtDialog/CMakeSetup.ico\")")
+ if(BUILD_QtDialog)
+ set(_CPACK_IFW_SHORTCUT_OPTIONAL "${_CPACK_IFW_SHORTCUT_OPTIONAL}component.addOperation(\"CreateShortcut\", \"@TargetDir@/bin/cmake-gui.exe\", \"@StartMenuDir@/CMake (cmake-gui).lnk\");\n")
+ endif()
+ if(SPHINX_HTML)
+ set(_CPACK_IFW_SHORTCUT_OPTIONAL "${_CPACK_IFW_SHORTCUT_OPTIONAL}component.addOperation(\"CreateShortcut\", \"@TargetDir@/doc/cmake-${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}/html/index.html\", \"@StartMenuDir@/CMake Documentation.lnk\");\n")
+ endif()
+ if(CMake_BUILD_DEVELOPER_REFERENCE)
+ if(CMake_BUILD_DEVELOPER_REFERENCE_HTML)
+ set(_CPACK_IFW_SHORTCUT_OPTIONAL "${_CPACK_IFW_SHORTCUT_OPTIONAL}component.addOperation(\"CreateShortcut\", \"@TargetDir@/doc/cmake-${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}/developer-reference/html/index.html\", \"@StartMenuDir@/CMake Developer Reference.lnk\");\n")
endif()
endif()
-
- if(${CMAKE_SYSTEM_NAME} MATCHES Linux)
- set(CPACK_IFW_TARGET_DIRECTORY "@HomeDir@/${CMAKE_PROJECT_NAME}")
- set(CPACK_IFW_ADMIN_TARGET_DIRECTORY "@ApplicationsDir@/${CMAKE_PROJECT_NAME}")
+ configure_file("${CMake_SOURCE_DIR}/Source/QtIFW/installscript.qs.in"
+ "${CMake_BINARY_DIR}/installscript.qs" @ONLY
+ )
+ install(FILES "${CMake_SOURCE_DIR}/Source/QtIFW/cmake.org.html"
+ DESTINATION "${CMAKE_DOC_DIR}"
+ )
+ if(CMake_INSTALL_COMPONENTS)
+ set(_CPACK_IFW_PACKAGE_SCRIPT "${CMake_BINARY_DIR}/CMake.qs")
+ else()
+ set(_CPACK_IFW_PACKAGE_SCRIPT "${CMake_BINARY_DIR}/installscript.qs")
endif()
+endif()
- set(_CPACK_IFW_PACKAGE_VERSION ${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}.${CMake_VERSION_PATCH})
+if(${CMAKE_SYSTEM_NAME} MATCHES Linux)
+ set(CPACK_IFW_TARGET_DIRECTORY "@HomeDir@/${CMAKE_PROJECT_NAME}")
+ set(CPACK_IFW_ADMIN_TARGET_DIRECTORY "@ApplicationsDir@/${CMAKE_PROJECT_NAME}")
+endif()
- if(NOT DEFINED CPACK_PACKAGE_FILE_NAME)
- # if the CPACK_PACKAGE_FILE_NAME is not defined by the cache
- # default to source package - system, on cygwin system is not
- # needed
- if(CYGWIN)
- set(CPACK_PACKAGE_FILE_NAME "${CPACK_SOURCE_PACKAGE_FILE_NAME}")
- else()
- set(CPACK_PACKAGE_FILE_NAME
- "${CPACK_SOURCE_PACKAGE_FILE_NAME}-${CPACK_SYSTEM_NAME}")
- endif()
+set(_CPACK_IFW_PACKAGE_VERSION ${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}.${CMake_VERSION_PATCH})
+
+if(NOT DEFINED CPACK_PACKAGE_FILE_NAME)
+ # if the CPACK_PACKAGE_FILE_NAME is not defined by the cache
+ # default to source package - system, on cygwin system is not
+ # needed
+ if(CYGWIN)
+ set(CPACK_PACKAGE_FILE_NAME "${CPACK_SOURCE_PACKAGE_FILE_NAME}")
+ else()
+ set(CPACK_PACKAGE_FILE_NAME
+ "${CPACK_SOURCE_PACKAGE_FILE_NAME}-${CPACK_SYSTEM_NAME}")
endif()
+endif()
- set(CPACK_PACKAGE_CONTACT "cmake@cmake.org")
+set(CPACK_PACKAGE_CONTACT "cmake@cmake.org")
- if(UNIX)
- set(CPACK_STRIP_FILES "${CMAKE_BIN_DIR}/ccmake;${CMAKE_BIN_DIR}/cmake;${CMAKE_BIN_DIR}/cpack;${CMAKE_BIN_DIR}/ctest")
- set(CPACK_SOURCE_STRIP_FILES "")
- set(CPACK_PACKAGE_EXECUTABLES "ccmake" "CMake")
- endif()
+if(UNIX)
+ set(CPACK_STRIP_FILES "${CMAKE_BIN_DIR}/ccmake;${CMAKE_BIN_DIR}/cmake;${CMAKE_BIN_DIR}/cpack;${CMAKE_BIN_DIR}/ctest")
+ set(CPACK_SOURCE_STRIP_FILES "")
+ set(CPACK_PACKAGE_EXECUTABLES "ccmake" "CMake")
+endif()
- set(CPACK_WIX_UPGRADE_GUID "8ffd1d72-b7f1-11e2-8ee5-00238bca4991")
+set(CPACK_WIX_UPGRADE_GUID "8ffd1d72-b7f1-11e2-8ee5-00238bca4991")
- if(MSVC AND NOT "$ENV{WIX}" STREQUAL "")
- set(WIX_CUSTOM_ACTION_ENABLED TRUE)
- if(CMAKE_CONFIGURATION_TYPES)
- set(WIX_CUSTOM_ACTION_MULTI_CONFIG TRUE)
- else()
- set(WIX_CUSTOM_ACTION_MULTI_CONFIG FALSE)
- endif()
+if(MSVC AND NOT "$ENV{WIX}" STREQUAL "")
+ set(WIX_CUSTOM_ACTION_ENABLED TRUE)
+ if(CMAKE_CONFIGURATION_TYPES)
+ set(WIX_CUSTOM_ACTION_MULTI_CONFIG TRUE)
else()
- set(WIX_CUSTOM_ACTION_ENABLED FALSE)
+ set(WIX_CUSTOM_ACTION_MULTI_CONFIG FALSE)
endif()
+else()
+ set(WIX_CUSTOM_ACTION_ENABLED FALSE)
+endif()
- # Set the options file that needs to be included inside CMakeCPackOptions.cmake
- set(QT_DIALOG_CPACK_OPTIONS_FILE ${CMake_BINARY_DIR}/Source/QtDialog/QtDialogCPack.cmake)
- configure_file("${CMake_SOURCE_DIR}/CMakeCPackOptions.cmake.in"
- "${CMake_BINARY_DIR}/CMakeCPackOptions.cmake" @ONLY)
- set(CPACK_PROJECT_CONFIG_FILE "${CMake_BINARY_DIR}/CMakeCPackOptions.cmake")
+# Set the options file that needs to be included inside CMakeCPackOptions.cmake
+set(QT_DIALOG_CPACK_OPTIONS_FILE ${CMake_BINARY_DIR}/Source/QtDialog/QtDialogCPack.cmake)
+configure_file("${CMake_SOURCE_DIR}/CMakeCPackOptions.cmake.in"
+ "${CMake_BINARY_DIR}/CMakeCPackOptions.cmake" @ONLY)
+set(CPACK_PROJECT_CONFIG_FILE "${CMake_BINARY_DIR}/CMakeCPackOptions.cmake")
- # include CPack model once all variables are set
- include(CPack)
-endif()
+# include CPack model once all variables are set
+include(CPack)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b4a577c..b8a635f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -366,31 +366,55 @@ macro (CMAKE_BUILD_UTILITIES)
set(CMAKE_COMPRESS_LIBRARIES "cmcompress")
add_subdirectory(Utilities/cmcompress)
CMAKE_SET_TARGET_FOLDER(cmcompress "Utilities/3rdParty")
- if(CMAKE_USE_SYSTEM_BZIP2)
- find_package(BZip2)
+
+ #---------------------------------------------------------------------
+ # Build expat library for CMake, CTest, and libarchive.
+ if(CMAKE_USE_SYSTEM_EXPAT)
+ find_package(EXPAT)
+ if(NOT EXPAT_FOUND)
+ message(FATAL_ERROR
+ "CMAKE_USE_SYSTEM_EXPAT is ON but a expat is not found!")
+ endif()
+ set(CMAKE_EXPAT_INCLUDES ${EXPAT_INCLUDE_DIRS})
+ set(CMAKE_EXPAT_LIBRARIES ${EXPAT_LIBRARIES})
else()
- set(BZIP2_INCLUDE_DIR
- "${CMAKE_CURRENT_SOURCE_DIR}/Utilities/cmbzip2")
- set(BZIP2_LIBRARIES cmbzip2)
- add_subdirectory(Utilities/cmbzip2)
- CMAKE_SET_TARGET_FOLDER(cmbzip2 "Utilities/3rdParty")
+ set(CMAKE_EXPAT_INCLUDES)
+ set(CMAKE_EXPAT_LIBRARIES cmexpat)
+ add_subdirectory(Utilities/cmexpat)
+ CMAKE_SET_TARGET_FOLDER(cmexpat "Utilities/3rdParty")
+ endif()
+
+ #---------------------------------------------------------------------
+ # Build or use system libbz2 for libarchive.
+ if(NOT CMAKE_USE_SYSTEM_LIBARCHIVE)
+ if(CMAKE_USE_SYSTEM_BZIP2)
+ find_package(BZip2)
+ else()
+ set(BZIP2_INCLUDE_DIR
+ "${CMAKE_CURRENT_SOURCE_DIR}/Utilities/cmbzip2")
+ set(BZIP2_LIBRARIES cmbzip2)
+ add_subdirectory(Utilities/cmbzip2)
+ CMAKE_SET_TARGET_FOLDER(cmbzip2 "Utilities/3rdParty")
+ endif()
endif()
#---------------------------------------------------------------------
# Build or use system liblzma for libarchive.
- if(CMAKE_USE_SYSTEM_LIBLZMA)
- find_package(LibLZMA)
- if(NOT LIBLZMA_FOUND)
- message(FATAL_ERROR "CMAKE_USE_SYSTEM_LIBLZMA is ON but LibLZMA is not found!")
+ if(NOT CMAKE_USE_SYSTEM_LIBARCHIVE)
+ if(CMAKE_USE_SYSTEM_LIBLZMA)
+ find_package(LibLZMA)
+ if(NOT LIBLZMA_FOUND)
+ message(FATAL_ERROR "CMAKE_USE_SYSTEM_LIBLZMA is ON but LibLZMA is not found!")
+ endif()
+ set(LZMA_INCLUDE_DIR ${LIBLZMA_INCLUDE_DIRS})
+ set(LZMA_LIBRARY ${LIBLZMA_LIBRARIES})
+ else()
+ add_subdirectory(Utilities/cmliblzma)
+ CMAKE_SET_TARGET_FOLDER(cmliblzma "Utilities/3rdParty")
+ set(LZMA_INCLUDE_DIR
+ "${CMAKE_CURRENT_SOURCE_DIR}/Utilities/cmliblzma/liblzma/api")
+ set(LZMA_LIBRARY cmliblzma)
endif()
- set(LZMA_INCLUDE_DIR ${LIBLZMA_INCLUDE_DIRS})
- set(LZMA_LIBRARY ${LIBLZMA_LIBRARIES})
- else()
- add_subdirectory(Utilities/cmliblzma)
- CMAKE_SET_TARGET_FOLDER(cmliblzma "Utilities/3rdParty")
- set(LZMA_INCLUDE_DIR
- "${CMAKE_CURRENT_SOURCE_DIR}/Utilities/cmliblzma/liblzma/api")
- set(LZMA_LIBRARY cmliblzma)
endif()
#---------------------------------------------------------------------
@@ -403,6 +427,8 @@ macro (CMAKE_BUILD_UTILITIES)
set(CMAKE_TAR_INCLUDES ${LibArchive_INCLUDE_DIRS})
set(CMAKE_TAR_LIBRARIES ${LibArchive_LIBRARIES})
else()
+ set(EXPAT_INCLUDE_DIR ${CMAKE_EXPAT_INCLUDES})
+ set(EXPAT_LIBRARY ${CMAKE_EXPAT_LIBRARIES})
set(ZLIB_INCLUDE_DIR ${CMAKE_ZLIB_INCLUDES})
set(ZLIB_LIBRARY ${CMAKE_ZLIB_LIBRARIES})
add_definitions(-DLIBARCHIVE_STATIC)
@@ -412,7 +438,7 @@ macro (CMAKE_BUILD_UTILITIES)
set(ENABLE_ZLIB ON CACHE INTERNAL "Enable the use of the system found ZLIB library if found")
set(ENABLE_BZip2 ON CACHE INTERNAL "Enable the use of the system found BZip2 library if found")
set(ENABLE_LIBXML2 OFF CACHE INTERNAL "Enable the use of the system found libxml2 library if found")
- set(ENABLE_EXPAT OFF CACHE INTERNAL "Enable the use of the system found EXPAT library if found")
+ set(ENABLE_EXPAT ON CACHE INTERNAL "Enable the use of the system found EXPAT library if found")
set(ENABLE_PCREPOSIX OFF CACHE INTERNAL "Enable the use of the system found PCREPOSIX library if found")
set(ENABLE_LibGCC OFF CACHE INTERNAL "Enable the use of the system found LibGCC library if found")
set(ENABLE_XATTR OFF CACHE INTERNAL "Enable extended attribute support")
@@ -425,23 +451,6 @@ macro (CMAKE_BUILD_UTILITIES)
endif()
#---------------------------------------------------------------------
- # Build expat library for CMake and CTest.
- if(CMAKE_USE_SYSTEM_EXPAT)
- find_package(EXPAT)
- if(NOT EXPAT_FOUND)
- message(FATAL_ERROR
- "CMAKE_USE_SYSTEM_EXPAT is ON but a expat is not found!")
- endif()
- set(CMAKE_EXPAT_INCLUDES ${EXPAT_INCLUDE_DIRS})
- set(CMAKE_EXPAT_LIBRARIES ${EXPAT_LIBRARIES})
- else()
- set(CMAKE_EXPAT_INCLUDES)
- set(CMAKE_EXPAT_LIBRARIES cmexpat)
- add_subdirectory(Utilities/cmexpat)
- CMAKE_SET_TARGET_FOLDER(cmexpat "Utilities/3rdParty")
- endif()
-
- #---------------------------------------------------------------------
# Build jsoncpp library.
if(CMAKE_USE_SYSTEM_JSONCPP)
if(NOT CMAKE_VERSION VERSION_LESS 3.0)
diff --git a/Modules/FindProtobuf.cmake b/Modules/FindProtobuf.cmake
index 10c07c2..14e392a 100644
--- a/Modules/FindProtobuf.cmake
+++ b/Modules/FindProtobuf.cmake
@@ -136,9 +136,11 @@ function(PROTOBUF_GENERATE_CPP SRCS HDRS)
foreach(FIL ${ARGN})
get_filename_component(ABS_FIL ${FIL} ABSOLUTE)
get_filename_component(FIL_WE ${FIL} NAME_WE)
- get_filename_component(FIL_DIR ${FIL} DIRECTORY)
- if(FIL_DIR)
- set(FIL_WE "${FIL_DIR}/${FIL_WE}")
+ if(NOT PROTOBUF_GENERATE_CPP_APPEND_PATH)
+ get_filename_component(FIL_DIR ${FIL} DIRECTORY)
+ if(FIL_DIR)
+ set(FIL_WE "${FIL_DIR}/${FIL_WE}")
+ endif()
endif()
list(APPEND ${SRCS} "${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}.pb.cc")
@@ -197,9 +199,11 @@ function(PROTOBUF_GENERATE_PYTHON SRCS)
foreach(FIL ${ARGN})
get_filename_component(ABS_FIL ${FIL} ABSOLUTE)
get_filename_component(FIL_WE ${FIL} NAME_WE)
- get_filename_component(FIL_DIR ${FIL} DIRECTORY)
- if(FIL_DIR)
- set(FIL_WE "${FIL_DIR}/${FIL_WE}")
+ if(NOT PROTOBUF_GENERATE_CPP_APPEND_PATH)
+ get_filename_component(FIL_DIR ${FIL} DIRECTORY)
+ if(FIL_DIR)
+ set(FIL_WE "${FIL_DIR}/${FIL_WE}")
+ endif()
endif()
list(APPEND ${SRCS} "${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}_pb2.py")
diff --git a/Modules/Platform/Android/ndk-stl-c++.cmake b/Modules/Platform/Android/ndk-stl-c++.cmake
index cb9fd68..b27015d 100644
--- a/Modules/Platform/Android/ndk-stl-c++.cmake
+++ b/Modules/Platform/Android/ndk-stl-c++.cmake
@@ -6,9 +6,11 @@ macro(__android_stl_cxx lang filename)
if(EXISTS "${CMAKE_ANDROID_NDK}/sources/cxx-stl/llvm-libc++/libcxx/include/cstddef")
# r12 and below
__android_stl_inc(${lang} "${CMAKE_ANDROID_NDK}/sources/cxx-stl/llvm-libc++/libcxx/include" 1)
+ __android_stl_inc(${lang} "${CMAKE_ANDROID_NDK}/sources/cxx-stl/llvm-libc++abi/libcxxabi/include" 1)
else()
# r13 and above
__android_stl_inc(${lang} "${CMAKE_ANDROID_NDK}/sources/cxx-stl/llvm-libc++/include" 1)
+ __android_stl_inc(${lang} "${CMAKE_ANDROID_NDK}/sources/cxx-stl/llvm-libc++abi/include" 1)
endif()
# Add a secondary include directory if it exists.
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index ee2f4af..da91b74 100644
--- a/Source/CMakeVersion.cmake
+++ b/Source/CMakeVersion.cmake
@@ -1,5 +1,5 @@
# CMake version number components.
set(CMake_VERSION_MAJOR 3)
set(CMake_VERSION_MINOR 7)
-set(CMake_VERSION_PATCH 20161007)
+set(CMake_VERSION_PATCH 20161010)
#set(CMake_VERSION_RC 1)
diff --git a/Source/cmExportBuildAndroidMKGenerator.cxx b/Source/cmExportBuildAndroidMKGenerator.cxx
index bb02311..f5e6628 100644
--- a/Source/cmExportBuildAndroidMKGenerator.cxx
+++ b/Source/cmExportBuildAndroidMKGenerator.cxx
@@ -9,6 +9,8 @@
#include "cmMakefile.h"
#include "cmTargetExport.h"
+#include <algorithm>
+
cmExportBuildAndroidMKGenerator::cmExportBuildAndroidMKGenerator()
{
this->LG = CM_NULLPTR;
@@ -164,6 +166,16 @@ void cmExportBuildAndroidMKGenerator::GenerateInterfaceProperties(
}
}
}
+
+ // Tell the NDK build system if prebuilt static libraries use C++.
+ if (target->GetType() == cmState::STATIC_LIBRARY) {
+ cmLinkImplementation const* li = target->GetLinkImplementation(config);
+ if (std::find(li->Languages.begin(), li->Languages.end(), "CXX") !=
+ li->Languages.end()) {
+ os << "LOCAL_HAS_CPP := true\n";
+ }
+ }
+
switch (target->GetType()) {
case cmState::SHARED_LIBRARY:
case cmState::MODULE_LIBRARY:
diff --git a/Source/cmGhsMultiTargetGenerator.cxx b/Source/cmGhsMultiTargetGenerator.cxx
index 959dfdb..fac68f5 100644
--- a/Source/cmGhsMultiTargetGenerator.cxx
+++ b/Source/cmGhsMultiTargetGenerator.cxx
@@ -244,7 +244,7 @@ void cmGhsMultiTargetGenerator::SetCompilerFlags(std::string const& config,
flags, this->GeneratorTarget, lang);
// Append old-style preprocessor definition flags.
- if (std::string(" ") != std::string(this->Makefile->GetDefineFlags())) {
+ if (this->Makefile->GetDefineFlags() != " ") {
this->LocalGenerator->AppendFlags(flags,
this->Makefile->GetDefineFlags());
}
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 2284cf9..025b82a 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -1176,12 +1176,13 @@ void cmLocalGenerator::GetTargetFlags(
!(this->Makefile->IsOn("CYGWIN") || this->Makefile->IsOn("MINGW"))) {
std::vector<cmSourceFile*> sources;
target->GetSourceFiles(sources, buildType);
+ std::string defFlag =
+ this->Makefile->GetSafeDefinition("CMAKE_LINK_DEF_FILE_FLAG");
for (std::vector<cmSourceFile*>::const_iterator i = sources.begin();
i != sources.end(); ++i) {
cmSourceFile* sf = *i;
if (sf->GetExtension() == "def") {
- linkFlags +=
- this->Makefile->GetSafeDefinition("CMAKE_LINK_DEF_FILE_FLAG");
+ linkFlags += defFlag;
linkFlags += this->ConvertToOutputFormat(
cmSystemTools::CollapseFullPath(sf->GetFullPath()), SHELL);
linkFlags += " ";
diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx
index eb2852c..02eef59 100644
--- a/Source/cmLocalUnixMakefileGenerator3.cxx
+++ b/Source/cmLocalUnixMakefileGenerator3.cxx
@@ -995,16 +995,13 @@ void cmLocalUnixMakefileGenerator3::AppendCustomCommand(
std::string output;
const std::vector<std::string>& outputs = ccg.GetOutputs();
if (!outputs.empty()) {
+ output = outputs[0];
if (workingDir.empty()) {
- output = this->ConvertToOutputFormat(
- this->MaybeConvertToRelativePath(
- this->GetCurrentBinaryDirectory(), outputs[0]),
- cmOutputConverter::SHELL);
-
- } else {
- output = this->ConvertToOutputFormat(outputs[0],
- cmOutputConverter::SHELL);
+ output = this->MaybeConvertToRelativePath(
+ this->GetCurrentBinaryDirectory(), output);
}
+ output =
+ this->ConvertToOutputFormat(output, cmOutputConverter::SHELL);
}
vars.Output = output.c_str();
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index df993ce..a9ef9cd 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -3970,10 +3970,8 @@ cmPolicies::PolicyStatus cmMakefile::GetPolicyStatus(
bool cmMakefile::PolicyOptionalWarningEnabled(std::string const& var)
{
// Check for an explicit CMAKE_POLICY_WARNING_CMP<NNNN> setting.
- if (!var.empty()) {
- if (const char* val = this->GetDefinition(var)) {
- return cmSystemTools::IsOn(val);
- }
+ if (const char* val = this->GetDefinition(var)) {
+ return cmSystemTools::IsOn(val);
}
// Enable optional policy warnings with --debug-output, --trace,
// or --trace-expand.
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index 40344ce..de7bead 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -447,7 +447,7 @@ public:
/**
* Get a list of preprocessor define flags.
*/
- const char* GetDefineFlags() const { return this->DefineFlags.c_str(); }
+ std::string GetDefineFlags() const { return this->DefineFlags; }
/**
* Make sure CMake can write this file
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index 14102ef..44ced11 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -1217,21 +1217,16 @@ void cmMakefileTargetGenerator::WriteObjectsVariable(
<< "\n";
}
-void cmMakefileTargetGenerator::WriteObjectsString(std::string& buildObjs)
-{
- std::vector<std::string> objStrings;
- this->WriteObjectsStrings(objStrings);
- buildObjs = objStrings[0];
-}
-
class cmMakefileTargetGeneratorObjectStrings
{
public:
cmMakefileTargetGeneratorObjectStrings(std::vector<std::string>& strings,
- cmLocalUnixMakefileGenerator3* lg,
+ cmOutputConverter* outputConverter,
+ cmState::Directory stateDir,
std::string::size_type limit)
: Strings(strings)
- , LocalGenerator(lg)
+ , OutputConverter(outputConverter)
+ , StateDir(stateDir)
, LengthLimit(limit)
{
this->Space = "";
@@ -1239,10 +1234,8 @@ public:
void Feed(std::string const& obj)
{
// Construct the name of the next object.
- this->NextObject = this->LocalGenerator->ConvertToOutputFormat(
- this->LocalGenerator->MaybeConvertToRelativePath(
- this->LocalGenerator->GetCurrentBinaryDirectory(), obj),
- cmOutputConverter::RESPONSE);
+ this->NextObject = this->OutputConverter->ConvertToOutputFormat(
+ this->MaybeConvertToRelativePath(obj), cmOutputConverter::RESPONSE);
// Roll over to next string if the limit will be exceeded.
if (this->LengthLimit != std::string::npos &&
@@ -1262,8 +1255,19 @@ public:
}
void Done() { this->Strings.push_back(this->CurrentString); }
private:
+ std::string MaybeConvertToRelativePath(std::string const& obj)
+ {
+ if (!cmOutputConverter::ContainedInDirectory(
+ this->StateDir.GetCurrentBinary(), obj, this->StateDir)) {
+ return obj;
+ }
+ return cmOutputConverter::ForceToRelativePath(
+ this->StateDir.GetCurrentBinary(), obj);
+ }
+
std::vector<std::string>& Strings;
- cmLocalUnixMakefileGenerator3* LocalGenerator;
+ cmOutputConverter* OutputConverter;
+ cmState::Directory StateDir;
std::string::size_type LengthLimit;
std::string CurrentString;
std::string NextObject;
@@ -1273,8 +1277,9 @@ private:
void cmMakefileTargetGenerator::WriteObjectsStrings(
std::vector<std::string>& objStrings, std::string::size_type limit)
{
- cmMakefileTargetGeneratorObjectStrings helper(objStrings,
- this->LocalGenerator, limit);
+ cmMakefileTargetGeneratorObjectStrings helper(
+ objStrings, this->LocalGenerator,
+ this->LocalGenerator->GetStateSnapshot().GetDirectory(), limit);
for (std::vector<std::string>::const_iterator i = this->Objects.begin();
i != this->Objects.end(); ++i) {
helper.Feed(*i);
@@ -1665,7 +1670,9 @@ void cmMakefileTargetGenerator::CreateObjectLists(
}
} else if (useLinkScript) {
if (!useArchiveRules) {
- this->WriteObjectsString(buildObjs);
+ std::vector<std::string> objStrings;
+ this->WriteObjectsStrings(objStrings);
+ buildObjs = objStrings[0];
}
} else {
buildObjs = "$(";
diff --git a/Source/cmMakefileTargetGenerator.h b/Source/cmMakefileTargetGenerator.h
index df7b6aa..813af80 100644
--- a/Source/cmMakefileTargetGenerator.h
+++ b/Source/cmMakefileTargetGenerator.h
@@ -112,7 +112,6 @@ protected:
void WriteObjectsVariable(std::string& variableName,
std::string& variableNameExternal,
bool useWatcomQuote);
- void WriteObjectsString(std::string& buildObjs);
void WriteObjectsStrings(std::vector<std::string>& objStrings,
std::string::size_type limit = std::string::npos);
diff --git a/Source/kwsys/SystemTools.cxx b/Source/kwsys/SystemTools.cxx
index c97af25..5da715f 100644
--- a/Source/kwsys/SystemTools.cxx
+++ b/Source/kwsys/SystemTools.cxx
@@ -2716,17 +2716,15 @@ unsigned long SystemTools::FileLength(const std::string& filename)
return length;
}
-int SystemTools::Strucmp(const char *s1, const char *s2)
-{
- // lifted from Graphvis http://www.graphviz.org
- while ((*s1 != '\0')
- && (tolower(*s1) == tolower(*s2)))
- {
- s1++;
- s2++;
- }
-
- return tolower(*s1) - tolower(*s2);
+int SystemTools::Strucmp(const char* l, const char* r)
+{
+ int lc;
+ int rc;
+ do {
+ lc = tolower(*l++);
+ rc = tolower(*r++);
+ } while(lc == rc && lc);
+ return lc - rc;
}
// return file's modified time
diff --git a/Tests/FindPackageModeMakefileTest/CMakeLists.txt b/Tests/FindPackageModeMakefileTest/CMakeLists.txt
index 56fcc5d..23832da 100644
--- a/Tests/FindPackageModeMakefileTest/CMakeLists.txt
+++ b/Tests/FindPackageModeMakefileTest/CMakeLists.txt
@@ -20,16 +20,9 @@ if(UNIX AND "${CMAKE_GENERATOR}" MATCHES "Makefile" AND
configure_file(FindFoo.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/FindFoo.cmake @ONLY)
# now set up the test:
- if (NOT CMAKE_VERSION VERSION_LESS 2.8.12)
- file(GENERATE OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/cmakeExecutable.mk"
- CONTENT "CMAKE = \"$<TARGET_FILE:cmake>\"\n"
- )
- else()
- get_target_property(cmakeLocation cmake LOCATION)
- file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/cmakeExecutable.mk"
- "CMAKE = \"${cmakeLocation}\"\n"
- )
- endif()
+ file(GENERATE OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/cmakeExecutable.mk"
+ CONTENT "CMAKE = \"$<TARGET_FILE:cmake>\"\n"
+ )
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Makefile.in ${CMAKE_CURRENT_BINARY_DIR}/ConfMakefile @ONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/main.cpp ${CMAKE_CURRENT_BINARY_DIR}/main.cpp COPYONLY)
diff --git a/Tests/RunCMake/Android/android.cxx b/Tests/RunCMake/Android/android.cxx
index e6a6cda..2dee8f9 100644
--- a/Tests/RunCMake/Android/android.cxx
+++ b/Tests/RunCMake/Android/android.cxx
@@ -6,6 +6,9 @@
#ifndef STL_SYSTEM
#include <exception>
#include <typeinfo>
+#ifndef STL_STLPORT
+#include <cxxabi.h>
+#endif
#ifndef STL_GABI
#include <iostream>
#include <string>
diff --git a/Tests/RunCMake/Android/common.cmake b/Tests/RunCMake/Android/common.cmake
index 6ea0909..d803c98 100644
--- a/Tests/RunCMake/Android/common.cmake
+++ b/Tests/RunCMake/Android/common.cmake
@@ -43,6 +43,8 @@ elseif(CMAKE_ANDROID_STL_TYPE STREQUAL "system")
add_definitions(-DSTL_SYSTEM)
elseif(CMAKE_ANDROID_STL_TYPE MATCHES [[^gabi\+\+]])
add_definitions(-DSTL_GABI)
+elseif(CMAKE_ANDROID_STL_TYPE MATCHES [[^stlport]])
+ add_definitions(-DSTL_STLPORT)
endif()
string(REPLACE "-" "_" abi "${CMAKE_ANDROID_ARCH_ABI}")
diff --git a/Tests/RunCMake/AndroidMK/AndroidMK.cmake b/Tests/RunCMake/AndroidMK/AndroidMK.cmake
index ed21e58..2596e8c 100644
--- a/Tests/RunCMake/AndroidMK/AndroidMK.cmake
+++ b/Tests/RunCMake/AndroidMK/AndroidMK.cmake
@@ -2,7 +2,7 @@ project(build)
set(CMAKE_BUILD_TYPE Debug)
add_library(foo foo.cxx)
add_library(car foo.cxx)
-add_library(bar foo.cxx)
+add_library(bar bar.c)
add_library(dog foo.cxx)
target_link_libraries(foo car bar dog debug -lm)
export(TARGETS bar dog car foo ANDROID_MK
diff --git a/Tests/RunCMake/AndroidMK/bar.c b/Tests/RunCMake/AndroidMK/bar.c
new file mode 100644
index 0000000..e1f4df6
--- /dev/null
+++ b/Tests/RunCMake/AndroidMK/bar.c
@@ -0,0 +1,3 @@
+void bar(void)
+{
+}
diff --git a/Tests/RunCMake/AndroidMK/expectedBuildAndroidMK.txt b/Tests/RunCMake/AndroidMK/expectedBuildAndroidMK.txt
index def8fcb..bbf67a5 100644
--- a/Tests/RunCMake/AndroidMK/expectedBuildAndroidMK.txt
+++ b/Tests/RunCMake/AndroidMK/expectedBuildAndroidMK.txt
@@ -7,11 +7,13 @@ include.*PREBUILT_STATIC_LIBRARY.*
include.*CLEAR_VARS.*
LOCAL_MODULE.*dog
LOCAL_SRC_FILES.*.*dog.*
+LOCAL_HAS_CPP := true
include.*PREBUILT_STATIC_LIBRARY.*
.*
include.*CLEAR_VARS.*
LOCAL_MODULE.*car
LOCAL_SRC_FILES.*.*car.*
+LOCAL_HAS_CPP := true
include.*PREBUILT_STATIC_LIBRARY.*
.*
include.*CLEAR_VARS.*
@@ -20,4 +22,5 @@ LOCAL_SRC_FILES.*.*foo.*
LOCAL_CPP_FEATURES.*rtti exceptions
LOCAL_STATIC_LIBRARIES.*car bar dog
LOCAL_EXPORT_LDLIBS := -lm
+LOCAL_HAS_CPP := true
include.*PREBUILT_STATIC_LIBRARY.*
diff --git a/Tests/RunCMake/AndroidMK/expectedInstallAndroidMK.txt b/Tests/RunCMake/AndroidMK/expectedInstallAndroidMK.txt
index 1bdb308..3515fb9 100644
--- a/Tests/RunCMake/AndroidMK/expectedInstallAndroidMK.txt
+++ b/Tests/RunCMake/AndroidMK/expectedInstallAndroidMK.txt
@@ -9,11 +9,13 @@ include.*PREBUILT_STATIC_LIBRARY.*
include.*CLEAR_VARS.
LOCAL_MODULE.*dog
LOCAL_SRC_FILES.*_IMPORT_PREFIX./lib.*dog.*
+LOCAL_HAS_CPP := true
include.*PREBUILT_STATIC_LIBRARY.*
include.*CLEAR_VARS.*
LOCAL_MODULE.*car
LOCAL_SRC_FILES.*_IMPORT_PREFIX./lib.*car.*
+LOCAL_HAS_CPP := true
include.*PREBUILT_STATIC_LIBRARY.*
include.*CLEAR_VARS.*
@@ -22,4 +24,5 @@ LOCAL_SRC_FILES.*_IMPORT_PREFIX\)/lib.*foo.*
LOCAL_CPP_FEATURES.*rtti exceptions
LOCAL_STATIC_LIBRARIES.*car bar dog
LOCAL_EXPORT_LDLIBS := -lm
+LOCAL_HAS_CPP := true
include.*PREBUILT_STATIC_LIBRARY.*
diff --git a/Tests/RunCMake/CPack/VerifyResult.cmake b/Tests/RunCMake/CPack/VerifyResult.cmake
index 8bc2a58..ad2a651 100644
--- a/Tests/RunCMake/CPack/VerifyResult.cmake
+++ b/Tests/RunCMake/CPack/VerifyResult.cmake
@@ -27,10 +27,12 @@ if(NOT EXPECTED_FILES_COUNT EQUAL 0)
expected_content_list "${PACKAGE_CONTENT}")
if(NOT expected_content_list)
+ string(REPLACE "\n" "\n actual> " msg_actual "\n${PACKAGE_CONTENT}")
+ string(REPLACE "\n" "\n expect> " msg_expected "\n${EXPECTED_FILE_CONTENT_${file_no_}}")
message(FATAL_ERROR
"Unexpected file content for file No. '${file_no_}'!\n"
- " Content: '${PACKAGE_CONTENT}'\n\n"
- " Expected: '${EXPECTED_FILE_CONTENT_${file_no_}}'"
+ "The content was:${msg_actual}\n"
+ "which does not match:${msg_expected}\n"
"${output_error_message}")
endif()
else()