summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Help/command/cmake_minimum_required.rst45
-rw-r--r--Help/generator/Ninja.rst4
-rw-r--r--Help/manual/cmake-properties.7.rst1
-rw-r--r--Help/prop_test/TIMEOUT_AFTER_MATCH.rst37
-rw-r--r--Help/release/dev/add-bruce-c.rst4
-rw-r--r--Help/release/dev/find-blas-lapack-OpenBLAS.rst5
-rw-r--r--Help/release/dev/ninja-directory-targets.rst7
-rw-r--r--Help/release/dev/timeout_after_match.rst6
-rw-r--r--Help/variable/CMAKE_LANG_COMPILER_ID.rst1
-rw-r--r--Modules/CMakeCCompilerId.c.in22
-rw-r--r--Modules/CMakeCompilerIdDetection.cmake1
-rw-r--r--Modules/CMakeDetermineCCompiler.cmake3
-rw-r--r--Modules/CMakePackageConfigHelpers.cmake4
-rw-r--r--Modules/CMakePlatformId.h.in6
-rw-r--r--Modules/CPack.OSXX11.Info.plist.in2
-rw-r--r--Modules/Compiler/Bruce-C-DetermineCompiler.cmake1
-rw-r--r--Modules/Compiler/Bruce-C.cmake7
-rw-r--r--Modules/Compiler/GHS-C.cmake2
-rw-r--r--Modules/Compiler/GHS-CXX.cmake2
-rw-r--r--Modules/FindBLAS.cmake20
-rw-r--r--Modules/FindBoost.cmake2
-rw-r--r--Modules/FindCUDA.cmake7
-rw-r--r--Modules/FindLAPACK.cmake15
-rw-r--r--Modules/FindPkgConfig.cmake2
-rw-r--r--Modules/MacOSXBundleInfo.plist.in2
-rw-r--r--Modules/TestBigEndian.cmake2
-rw-r--r--Source/CMakeLists.txt15
-rw-r--r--Source/CMakeVersion.cmake2
-rw-r--r--Source/CPack/IFW/cmCPackIFWGenerator.cxx15
-rw-r--r--Source/CPack/IFW/cmCPackIFWGenerator.h5
-rw-r--r--Source/CPack/IFW/cmCPackIFWInstaller.cxx89
-rw-r--r--Source/CPack/IFW/cmCPackIFWInstaller.h4
-rw-r--r--Source/CPack/IFW/cmCPackIFWPackage.cxx67
-rw-r--r--Source/CPack/IFW/cmCPackIFWPackage.h4
-rw-r--r--Source/CPack/cmCPackDragNDropGenerator.cxx6
-rw-r--r--Source/CTest/cmCTestRunTest.cxx22
-rw-r--r--Source/CTest/cmCTestTestHandler.cxx25
-rw-r--r--Source/CTest/cmCTestTestHandler.h3
-rw-r--r--Source/CTest/cmProcess.cxx10
-rw-r--r--Source/CTest/cmProcess.h2
-rw-r--r--Source/cmExtraCodeBlocksGenerator.cxx234
-rw-r--r--Source/cmExtraCodeBlocksGenerator.h4
-rw-r--r--Source/cmExtraCodeLiteGenerator.cxx242
-rw-r--r--Source/cmExtraEclipseCDT4Generator.cxx687
-rw-r--r--Source/cmExtraEclipseCDT4Generator.h21
-rw-r--r--Source/cmGhsMultiTargetGenerator.cxx10
-rw-r--r--Source/cmGlobalKdevelopGenerator.cxx351
-rw-r--r--Source/cmGlobalNinjaGenerator.cxx82
-rw-r--r--Source/cmGlobalNinjaGenerator.h3
-rw-r--r--Source/cmXMLWriter.cxx14
-rw-r--r--Source/cmXMLWriter.h4
-rw-r--r--Templates/AppleInfo.plist2
-rw-r--r--Tests/RunCMake/CMakeLists.txt1
-rw-r--r--Tests/RunCMake/CTestTimeoutAfterMatch/CMakeLists.txt.in6
-rw-r--r--Tests/RunCMake/CTestTimeoutAfterMatch/CTestConfig.cmake.in1
-rw-r--r--Tests/RunCMake/CTestTimeoutAfterMatch/MissingArg1-stderr.txt1
-rw-r--r--Tests/RunCMake/CTestTimeoutAfterMatch/MissingArg2-stderr.txt1
-rw-r--r--Tests/RunCMake/CTestTimeoutAfterMatch/RunCMakeTest.cmake11
-rw-r--r--Tests/RunCMake/CTestTimeoutAfterMatch/ShouldPass-stdout.txt6
-rw-r--r--Tests/RunCMake/CTestTimeoutAfterMatch/ShouldTimeout-stdout.txt1
-rw-r--r--Tests/RunCMake/CTestTimeoutAfterMatch/SleepFor1Second.cmake4
-rw-r--r--Tests/RunCMake/CTestTimeoutAfterMatch/test.cmake.in21
-rw-r--r--Tests/RunCMake/FindPkgConfig/FindPkgConfig_cache_variables.cmake11
-rw-r--r--Tests/RunCMake/Ninja/RunCMakeTest.cmake16
-rw-r--r--Tests/RunCMake/Ninja/SubDir-build-stdout.txt1
-rw-r--r--Tests/RunCMake/Ninja/SubDir.cmake2
-rw-r--r--Tests/RunCMake/Ninja/SubDir/CMakeLists.txt2
-rw-r--r--Utilities/Release/win64_release.cmake4
68 files changed, 1359 insertions, 863 deletions
diff --git a/Help/command/cmake_minimum_required.rst b/Help/command/cmake_minimum_required.rst
index dc65a9e..9535bf3 100644
--- a/Help/command/cmake_minimum_required.rst
+++ b/Help/command/cmake_minimum_required.rst
@@ -1,29 +1,14 @@
cmake_minimum_required
----------------------
-Set the minimum required version of cmake for a project.
-
-::
+Set the minimum required version of cmake for a project and
+update `Policy Settings`_ to match the version given::
cmake_minimum_required(VERSION major.minor[.patch[.tweak]]
[FATAL_ERROR])
If the current version of CMake is lower than that required it will
-stop processing the project and report an error. When a version
-higher than 2.4 is specified the command implicitly invokes
-
-::
-
- cmake_policy(VERSION major[.minor[.patch[.tweak]]])
-
-which sets the cmake policy version level to the version specified.
-When version 2.4 or lower is given the command implicitly invokes
-
-::
-
- cmake_policy(VERSION 2.4)
-
-which enables compatibility features for CMake 2.4 and lower.
+stop processing the project and report an error.
The ``FATAL_ERROR`` option is accepted but ignored by CMake 2.6 and
higher. It should be specified so CMake versions 2.4 and lower fail
@@ -39,3 +24,27 @@ with an error instead of just a warning.
Calling ``cmake_minimum_required()`` inside a :command:`function`
limits some effects to the function scope when invoked. Such calls
should not be made with the intention of having global effects.
+
+Policy Settings
+^^^^^^^^^^^^^^^
+
+The ``cmake_minimum_required(VERSION)`` command implicitly invokes the
+:command:`cmake_policy(VERSION)` command to specify that the current
+project code is written for the given version of CMake.
+All policies introduced in the specified version or earlier will be
+set to use NEW behavior. All policies introduced after the specified
+version will be unset. This effectively requests behavior preferred
+as of a given CMake version and tells newer CMake versions to warn
+about their new policies.
+
+When a version higher than 2.4 is specified the command implicitly
+invokes::
+
+ cmake_policy(VERSION major[.minor[.patch[.tweak]]])
+
+which sets the cmake policy version level to the version specified.
+When version 2.4 or lower is given the command implicitly invokes::
+
+ cmake_policy(VERSION 2.4)
+
+which enables compatibility features for CMake 2.4 and lower.
diff --git a/Help/generator/Ninja.rst b/Help/generator/Ninja.rst
index 920abcb..d94e5f6 100644
--- a/Help/generator/Ninja.rst
+++ b/Help/generator/Ninja.rst
@@ -6,3 +6,7 @@ Generates build.ninja files.
A build.ninja file is generated into the build tree. Recent versions
of the ninja program can build the project through the "all" target.
An "install" target is also provided.
+
+For each subdirectory ``sub/dir`` of the project an additional target
+named ``sub/dir/all`` is generated that depends on all targets required
+by that subdirectory.
diff --git a/Help/manual/cmake-properties.7.rst b/Help/manual/cmake-properties.7.rst
index dadbc6e..73d1142 100644
--- a/Help/manual/cmake-properties.7.rst
+++ b/Help/manual/cmake-properties.7.rst
@@ -305,6 +305,7 @@ Properties on Tests
/prop_test/RUN_SERIAL
/prop_test/SKIP_RETURN_CODE
/prop_test/TIMEOUT
+ /prop_test/TIMEOUT_AFTER_MATCH
/prop_test/WILL_FAIL
/prop_test/WORKING_DIRECTORY
diff --git a/Help/prop_test/TIMEOUT_AFTER_MATCH.rst b/Help/prop_test/TIMEOUT_AFTER_MATCH.rst
new file mode 100644
index 0000000..a191a9c
--- /dev/null
+++ b/Help/prop_test/TIMEOUT_AFTER_MATCH.rst
@@ -0,0 +1,37 @@
+TIMEOUT_AFTER_MATCH
+-------------------
+
+Change a test's timeout duration after a matching line is encountered
+in its output.
+
+Usage
+^^^^^
+
+.. code-block:: cmake
+
+ add_test(mytest ...)
+ set_property(TEST mytest PROPERTY TIMEOUT_AFTER_MATCH "${seconds}" "${regex}")
+
+Description
+^^^^^^^^^^^
+
+Allow a test ``seconds`` to complete after ``regex`` is encountered in
+its output.
+
+When the test outputs a line that matches ``regex`` its start time is
+reset to the current time and its timeout duration is changed to
+``seconds``. Prior to this, the timeout duration is determined by the
+:prop_test:`TIMEOUT` property or the :variable:`CTEST_TEST_TIMEOUT`
+variable if either of these are set.
+
+:prop_test:`TIMEOUT_AFTER_MATCH` is useful for avoiding spurious
+timeouts when your test must wait for some system resource to become
+available before it can execute. Set :prop_test:`TIMEOUT` to a longer
+duration that accounts for resource acquisition and use
+:prop_test:`TIMEOUT_AFTER_MATCH` to control how long the actual test
+is allowed to run.
+
+If the required resource can be controlled by CTest you should use
+:prop_test:`RESOURCE_LOCK` instead of :prop_test:`TIMEOUT_AFTER_MATCH`.
+This property should be used when only the test itself can determine
+when its required resources are available.
diff --git a/Help/release/dev/add-bruce-c.rst b/Help/release/dev/add-bruce-c.rst
new file mode 100644
index 0000000..9e47900
--- /dev/null
+++ b/Help/release/dev/add-bruce-c.rst
@@ -0,0 +1,4 @@
+add-bruce-c
+-----------
+
+* Support was added for the Bruce C Compiler with compiler id ``Bruce``.
diff --git a/Help/release/dev/find-blas-lapack-OpenBLAS.rst b/Help/release/dev/find-blas-lapack-OpenBLAS.rst
new file mode 100644
index 0000000..893422a
--- /dev/null
+++ b/Help/release/dev/find-blas-lapack-OpenBLAS.rst
@@ -0,0 +1,5 @@
+find-blas-lapack-OpenBLAS
+-------------------------
+
+* The :module:`FindBLAS` and :module:`FindLAPACK` modules learned to
+ support `OpenBLAS <http://www.openblas.net>`__.
diff --git a/Help/release/dev/ninja-directory-targets.rst b/Help/release/dev/ninja-directory-targets.rst
new file mode 100644
index 0000000..4826228
--- /dev/null
+++ b/Help/release/dev/ninja-directory-targets.rst
@@ -0,0 +1,7 @@
+ninja-directory-targets
+-----------------------
+
+* The :generator:`Ninja` generator learned to produce phony targets
+ of the form ``sub/dir/all`` to drive the build of a subdirectory.
+ This is equivalent to ``cd sub/dir; make all`` with
+ :ref:`Makefile Generators`.
diff --git a/Help/release/dev/timeout_after_match.rst b/Help/release/dev/timeout_after_match.rst
new file mode 100644
index 0000000..83f316d
--- /dev/null
+++ b/Help/release/dev/timeout_after_match.rst
@@ -0,0 +1,6 @@
+timeout_after_match
+-------------------
+
+* CTest learned to optionally enforce a secondary timeout after matching
+ certain output from a test. See the :prop_test:`TIMEOUT_AFTER_MATCH` test
+ property.
diff --git a/Help/variable/CMAKE_LANG_COMPILER_ID.rst b/Help/variable/CMAKE_LANG_COMPILER_ID.rst
index 81976a9..ebd616e 100644
--- a/Help/variable/CMAKE_LANG_COMPILER_ID.rst
+++ b/Help/variable/CMAKE_LANG_COMPILER_ID.rst
@@ -12,6 +12,7 @@ include:
ADSP = Analog VisualDSP++ (analog.com)
AppleClang = Apple Clang (apple.com)
ARMCC = ARM Compiler (arm.com)
+ Bruce = Bruce C Compiler
CCur = Concurrent Fortran (ccur.com)
Clang = LLVM Clang (clang.llvm.org)
Cray = Cray Compiler (cray.com)
diff --git a/Modules/CMakeCCompilerId.c.in b/Modules/CMakeCCompilerId.c.in
index 5bfe0fd..c107dfd 100644
--- a/Modules/CMakeCCompilerId.c.in
+++ b/Modules/CMakeCCompilerId.c.in
@@ -5,6 +5,11 @@
#if defined(__18CXX)
# define ID_VOID_MAIN
#endif
+#if defined(__CLASSIC_C__)
+/* cv-qualifiers did not exist in K&R C */
+# define const
+# define volatile
+#endif
@CMAKE_C_COMPILER_ID_CONTENT@
@@ -28,23 +33,28 @@ char const *info_cray = "INFO" ":" "compiler_wrapper[CrayPrgEnv]";
@CMAKE_C_COMPILER_ID_PLATFORM_CONTENT@
@CMAKE_C_COMPILER_ID_ERROR_FOR_TEST@
-const char* info_language_dialect_default = "INFO" ":" "dialect_default["
-#if !defined(__STDC_VERSION__)
- "90"
+#if !defined(__STDC__)
+# define C_DIALECT
#elif __STDC_VERSION__ >= 201000L
- "11"
+# define C_DIALECT "11"
#elif __STDC_VERSION__ >= 199901L
- "99"
+# define C_DIALECT "99"
#else
+# define C_DIALECT "90"
#endif
-"]";
+const char* info_language_dialect_default =
+ "INFO" ":" "dialect_default[" C_DIALECT "]";
/*--------------------------------------------------------------------------*/
#ifdef ID_VOID_MAIN
void main() {}
#else
+# if defined(__CLASSIC_C__)
+int main(argc, argv) int argc; char *argv[];
+# else
int main(int argc, char* argv[])
+# endif
{
int require = 0;
require += info_compiler[argc];
diff --git a/Modules/CMakeCompilerIdDetection.cmake b/Modules/CMakeCompilerIdDetection.cmake
index cbc0055..1d341e5 100644
--- a/Modules/CMakeCompilerIdDetection.cmake
+++ b/Modules/CMakeCompilerIdDetection.cmake
@@ -79,6 +79,7 @@ function(compiler_id_detection outvar lang)
if (lang STREQUAL C)
list(APPEND ordered_compilers
TinyCC
+ Bruce
)
endif()
list(APPEND ordered_compilers
diff --git a/Modules/CMakeDetermineCCompiler.cmake b/Modules/CMakeDetermineCCompiler.cmake
index e0b5468..f8c6303 100644
--- a/Modules/CMakeDetermineCCompiler.cmake
+++ b/Modules/CMakeDetermineCCompiler.cmake
@@ -87,6 +87,9 @@ else()
# Try enabling ANSI mode on HP.
"-Aa"
+
+ # Try compiling K&R-compatible code (needed by Bruce C Compiler).
+ "-D__CLASSIC_C__"
)
endif()
diff --git a/Modules/CMakePackageConfigHelpers.cmake b/Modules/CMakePackageConfigHelpers.cmake
index 206ea7a..5e5302f 100644
--- a/Modules/CMakePackageConfigHelpers.cmake
+++ b/Modules/CMakePackageConfigHelpers.cmake
@@ -241,8 +241,10 @@ function(CONFIGURE_PACKAGE_CONFIG_FILE _inputFile _outputFile)
else()
message(FATAL_ERROR "INSTALL_PREFIX must be an absolute path")
endif()
- else()
+ elseif(IS_ABSOLUTE "${CMAKE_INSTALL_PREFIX}")
set(installPrefix "${CMAKE_INSTALL_PREFIX}")
+ else()
+ get_filename_component(installPrefix "${CMAKE_INSTALL_PREFIX}" ABSOLUTE)
endif()
if(IS_ABSOLUTE "${CCF_INSTALL_DESTINATION}")
diff --git a/Modules/CMakePlatformId.h.in b/Modules/CMakePlatformId.h.in
index da99b9e..47eb00a 100644
--- a/Modules/CMakePlatformId.h.in
+++ b/Modules/CMakePlatformId.h.in
@@ -91,11 +91,11 @@
# define PLATFORM_ID "Windows3x"
# else /* unknown platform */
-# define PLATFORM_ID ""
+# define PLATFORM_ID
# endif
#else /* unknown platform */
-# define PLATFORM_ID ""
+# define PLATFORM_ID
#endif
@@ -145,7 +145,7 @@
# endif
#else
-# define ARCHITECTURE_ID ""
+# define ARCHITECTURE_ID
#endif
/* Convert integer to decimal digit literals. */
diff --git a/Modules/CPack.OSXX11.Info.plist.in b/Modules/CPack.OSXX11.Info.plist.in
index 851b67b..23a1483 100644
--- a/Modules/CPack.OSXX11.Info.plist.in
+++ b/Modules/CPack.OSXX11.Info.plist.in
@@ -41,8 +41,6 @@
<string>@CPACK_APPLE_GUI_BUNDLE_VERSION@</string>
<key>CSResourcesFileMapped</key>
<true/>
- <key>LSRequiresCarbon</key>
- <true/>
<key>NSHumanReadableCopyright</key>
<string>@CPACK_APPLE_GUI_COPYRIGHT@</string>
</dict>
diff --git a/Modules/Compiler/Bruce-C-DetermineCompiler.cmake b/Modules/Compiler/Bruce-C-DetermineCompiler.cmake
new file mode 100644
index 0000000..bb9f4b9
--- /dev/null
+++ b/Modules/Compiler/Bruce-C-DetermineCompiler.cmake
@@ -0,0 +1 @@
+set(_compiler_id_pp_test "defined(__BCC__)")
diff --git a/Modules/Compiler/Bruce-C.cmake b/Modules/Compiler/Bruce-C.cmake
new file mode 100644
index 0000000..23676ec
--- /dev/null
+++ b/Modules/Compiler/Bruce-C.cmake
@@ -0,0 +1,7 @@
+# Bruce C Compiler ignores "-g" flag and optimization cannot be
+# enabled here (it is implemented only for 8086 target).
+set (CMAKE_C_FLAGS_INIT "-D__CLASSIC_C__")
+set (CMAKE_C_FLAGS_DEBUG_INIT "-g")
+set (CMAKE_C_FLAGS_MINSIZEREL_INIT "-DNDEBUG")
+set (CMAKE_C_FLAGS_RELEASE_INIT "-DNDEBUG")
+set (CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "-g -DNDEBUG")
diff --git a/Modules/Compiler/GHS-C.cmake b/Modules/Compiler/GHS-C.cmake
index e97d62c..a58d9b0 100644
--- a/Modules/Compiler/GHS-C.cmake
+++ b/Modules/Compiler/GHS-C.cmake
@@ -12,6 +12,8 @@ set(CMAKE_C_GHS_KERNEL_FLAGS_RELEASE_INIT "${CMAKE_C_FLAGS_RELEASE_INIT}")
set(CMAKE_C_GHS_KERNEL_FLAGS_RELWITHDEBINFO_INIT
"-ldebug ${CMAKE_C_FLAGS_RELWITHDEBINFO_INIT}")
+set(CMAKE_EXECUTABLE_SUFFIX ".as")
+
if(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
set (CMAKE_C_GHS_KERNEL_FLAGS_DEBUG "${CMAKE_C_GHS_KERNEL_FLAGS_DEBUG_INIT}"
CACHE STRING "Kernel flags used by the compiler during debug builds.")
diff --git a/Modules/Compiler/GHS-CXX.cmake b/Modules/Compiler/GHS-CXX.cmake
index 71a0dec..9e202d3 100644
--- a/Modules/Compiler/GHS-CXX.cmake
+++ b/Modules/Compiler/GHS-CXX.cmake
@@ -15,6 +15,8 @@ set(CMAKE_CXX_GHS_KERNEL_FLAGS_RELEASE_INIT
set(CMAKE_CXX_GHS_KERNEL_FLAGS_RELWITHDEBINFO_INIT
"-ldebug ${CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT}")
+set(CMAKE_EXECUTABLE_SUFFIX ".as")
+
if(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
set (CMAKE_CXX_GHS_KERNEL_FLAGS_DEBUG
"${CMAKE_CXX_GHS_KERNEL_FLAGS_DEBUG_INIT}"
diff --git a/Modules/FindBLAS.cmake b/Modules/FindBLAS.cmake
index 416b666..546ada1 100644
--- a/Modules/FindBLAS.cmake
+++ b/Modules/FindBLAS.cmake
@@ -30,9 +30,9 @@
# BLA_F95 if set on tries to find the f95 interfaces for BLAS/LAPACK
#
# ######### ## List of vendors (BLA_VENDOR) valid in this module #
-# Goto,ATLAS PhiPACK,CXML,DXML,SunPerf,SCSL,SGIMATH,IBMESSL,Intel10_32
-# (intel mkl v10 32 bit),Intel10_64lp (intel mkl v10 64 bit,lp thread
-# model, lp64 model), # Intel10_64lp_seq (intel mkl v10 64
+# Goto,OpenBLAS,ATLAS PhiPACK,CXML,DXML,SunPerf,SCSL,SGIMATH,IBMESSL,
+# Intel10_32 (intel mkl v10 32 bit),Intel10_64lp (intel mkl v10 64 bit,
+# lp thread model, lp64 model), # Intel10_64lp_seq (intel mkl v10 64
# bit,sequential code, lp64 model), # Intel( older versions of mkl 32
# and 64 bit), ACML,ACML_MP,ACML_GPU,Apple, NAS, Generic C/CXX should be
# enabled to use Intel mkl
@@ -172,6 +172,20 @@ if (BLA_VENDOR STREQUAL "Goto" OR BLA_VENDOR STREQUAL "All")
endif()
endif ()
+if (BLA_VENDOR STREQUAL "OpenBLAS" OR BLA_VENDOR STREQUAL "All")
+ if(NOT BLAS_LIBRARIES)
+ # OpenBLAS (http://www.openblas.net)
+ check_fortran_libraries(
+ BLAS_LIBRARIES
+ BLAS
+ sgemm
+ ""
+ "openblas"
+ ""
+ )
+ endif()
+endif ()
+
if (BLA_VENDOR STREQUAL "ATLAS" OR BLA_VENDOR STREQUAL "All")
if(NOT BLAS_LIBRARIES)
# BLAS in ATLAS library? (http://math-atlas.sourceforge.net/)
diff --git a/Modules/FindBoost.cmake b/Modules/FindBoost.cmake
index 728dcdf..9e6083db 100644
--- a/Modules/FindBoost.cmake
+++ b/Modules/FindBoost.cmake
@@ -464,6 +464,8 @@ function(_Boost_GUESS_COMPILER_PREFIX _ret)
set(_boost_COMPILER "-bcb")
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "SunPro")
set(_boost_COMPILER "-sw")
+ elseif(CMAKE_CXX_COMPILER_ID STREQUAL "XL")
+ set(_boost_COMPILER "-xlc")
elseif (MINGW)
if(${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION} VERSION_LESS 1.34)
set(_boost_COMPILER "-mgw") # no GCC version encoding prior to 1.34
diff --git a/Modules/FindCUDA.cmake b/Modules/FindCUDA.cmake
index 47c03f3..fe8b18e 100644
--- a/Modules/FindCUDA.cmake
+++ b/Modules/FindCUDA.cmake
@@ -1551,7 +1551,12 @@ function(CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS output_file cuda_target options
list( FIND nvcc_flags "-ccbin" ccbin_found0 )
list( FIND nvcc_flags "--compiler-bindir" ccbin_found1 )
if( ccbin_found0 LESS 0 AND ccbin_found1 LESS 0 AND CUDA_HOST_COMPILER )
- list(APPEND nvcc_flags -ccbin "\"${CUDA_HOST_COMPILER}\"")
+ # Match VERBATIM check below.
+ if(CUDA_HOST_COMPILER MATCHES "\\$\\(VCInstallDir\\)")
+ list(APPEND nvcc_flags -ccbin "\"${CUDA_HOST_COMPILER}\"")
+ else()
+ list(APPEND nvcc_flags -ccbin "${CUDA_HOST_COMPILER}")
+ endif()
endif()
# Create a list of flags specified by CUDA_NVCC_FLAGS_${CONFIG} and CMAKE_${CUDA_C_OR_CXX}_FLAGS*
diff --git a/Modules/FindLAPACK.cmake b/Modules/FindLAPACK.cmake
index b11edc3..2708de0 100644
--- a/Modules/FindLAPACK.cmake
+++ b/Modules/FindLAPACK.cmake
@@ -31,7 +31,7 @@
# BLA_F95 if set on tries to find the f95 interfaces for BLAS/LAPACK
#
# ## List of vendors (BLA_VENDOR) valid in this module # Intel(mkl),
-# ACML,Apple, NAS, Generic
+# OpenBLAS, ACML,Apple, NAS, Generic
#=============================================================================
# Copyright 2007-2009 Kitware, Inc.
@@ -181,6 +181,19 @@ if (BLA_VENDOR STREQUAL "Goto" OR BLA_VENDOR STREQUAL "All")
endif()
endif ()
+if (BLA_VENDOR STREQUAL "OpenBLAS" OR BLA_VENDOR STREQUAL "All")
+ if(NOT LAPACK_LIBRARIES)
+ check_lapack_libraries(
+ LAPACK_LIBRARIES
+ LAPACK
+ cheev
+ ""
+ "openblas"
+ "${BLAS_LIBRARIES}"
+ ""
+ )
+ endif()
+endif ()
#acml lapack
if (BLA_VENDOR MATCHES "ACML" OR BLA_VENDOR STREQUAL "All")
diff --git a/Modules/FindPkgConfig.cmake b/Modules/FindPkgConfig.cmake
index 4f50e38..447c526 100644
--- a/Modules/FindPkgConfig.cmake
+++ b/Modules/FindPkgConfig.cmake
@@ -383,7 +383,7 @@ macro(_pkg_check_modules_internal _is_required _is_silent _no_cmake_path _no_cma
pkg_get_variable("${_pkg_check_prefix}_INCLUDEDIR" ${_pkg_check_modules_pkg} "includedir")
pkg_get_variable("${_pkg_check_prefix}_LIBDIR" ${_pkg_check_modules_pkg} "libdir")
foreach (variable IN ITEMS PREFIX INCLUDEDIR LIBDIR)
- _pkgconfig_set("${_pkg_check_modules_pkg}_${variable}" "${${_pkg_check_modules_pkg}_${variable}}")
+ _pkgconfig_set("${_pkg_check_prefix}_${variable}" "${${_pkg_check_prefix}_${variable}}")
endforeach ()
if (NOT ${_is_silent})
diff --git a/Modules/MacOSXBundleInfo.plist.in b/Modules/MacOSXBundleInfo.plist.in
index a466dc7..a4009bc 100644
--- a/Modules/MacOSXBundleInfo.plist.in
+++ b/Modules/MacOSXBundleInfo.plist.in
@@ -28,8 +28,6 @@
<string>${MACOSX_BUNDLE_BUNDLE_VERSION}</string>
<key>CSResourcesFileMapped</key>
<true/>
- <key>LSRequiresCarbon</key>
- <true/>
<key>NSHumanReadableCopyright</key>
<string>${MACOSX_BUNDLE_COPYRIGHT}</string>
</dict>
diff --git a/Modules/TestBigEndian.cmake b/Modules/TestBigEndian.cmake
index fcb41ab..fdc3adb 100644
--- a/Modules/TestBigEndian.cmake
+++ b/Modules/TestBigEndian.cmake
@@ -104,7 +104,7 @@ macro(TEST_BIG_ENDIAN VARIABLE)
message(SEND_ERROR "TEST_BIG_ENDIAN found no result!")
endif()
- file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
+ file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Determining if the system is big endian passed with the following output:\n${OUTPUT}\nTestEndianess.c:\n${TEST_ENDIANESS_FILE_CONTENT}\n\n")
else()
diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt
index 8dd58af..467b692 100644
--- a/Source/CMakeLists.txt
+++ b/Source/CMakeLists.txt
@@ -724,7 +724,20 @@ endif()
add_library(CPackLib ${CPACK_SRCS})
target_link_libraries(CPackLib CMakeLib)
if(APPLE)
- target_link_libraries(CPackLib "-framework CoreServices")
+ # Some compilers produce errors in the CoreServices framework headers.
+ # Ideally such errors should be fixed by either the compiler vendor
+ # or the framework source, but we try to workaround it and build anyway.
+ # If it does not work, build with reduced functionality and warn.
+ check_include_file("CoreServices/CoreServices.h" HAVE_CoreServices)
+ if(HAVE_CoreServices)
+ set_property(SOURCE CPack/cmCPackDragNDropGenerator.cxx PROPERTY COMPILE_DEFINITIONS HAVE_CoreServices)
+ target_link_libraries(CPackLib "-framework CoreServices")
+ else()
+ message(WARNING "This compiler does not appear to support\n"
+ " #include <CoreServices/CoreServices.h>\n"
+ "Some CPack functionality may be limited.\n"
+ "See CMakeFiles/CMakeError.log for details of the failure.")
+ endif()
endif()
if(APPLE)
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index e667257..37e2b54 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 5)
-set(CMake_VERSION_PATCH 20160318)
+set(CMake_VERSION_PATCH 20160324)
#set(CMake_VERSION_RC 1)
diff --git a/Source/CPack/IFW/cmCPackIFWGenerator.cxx b/Source/CPack/IFW/cmCPackIFWGenerator.cxx
index 4eb23c1..50ac971 100644
--- a/Source/CPack/IFW/cmCPackIFWGenerator.cxx
+++ b/Source/CPack/IFW/cmCPackIFWGenerator.cxx
@@ -27,7 +27,7 @@
#include <cmSystemTools.h>
#include <cmMakefile.h>
#include <cmGeneratedFileStream.h>
-#include <cmXMLSafe.h>
+#include <cmXMLWriter.h>
#include <cmVersionConfig.h>
#include <cmTimestamp.h>
@@ -611,18 +611,19 @@ cmCPackIFWPackage* cmCPackIFWGenerator::GetComponentPackage(
}
//----------------------------------------------------------------------------
-void cmCPackIFWGenerator::WriteGeneratedByToStrim(cmGeneratedFileStream &xout)
+void cmCPackIFWGenerator::WriteGeneratedByToStrim(cmXMLWriter &xout)
{
- xout << "<!-- Generated by CPack " << CMake_VERSION << " IFW generator "
+ std::stringstream comment;
+ comment << "Generated by CPack " << CMake_VERSION << " IFW generator "
<< "for QtIFW ";
if(IsVersionLess("2.0"))
{
- xout << "less 2.0";
+ comment << "less 2.0";
}
else
{
- xout << FrameworkVersion;
+ comment << FrameworkVersion;
}
- xout << " tools at " << cmTimestamp().CurrentTime("", true) << " -->"
- << std::endl;
+ comment << " tools at " << cmTimestamp().CurrentTime("", true);
+ xout.Comment(comment.str().c_str());
}
diff --git a/Source/CPack/IFW/cmCPackIFWGenerator.h b/Source/CPack/IFW/cmCPackIFWGenerator.h
index 3246861..5770451 100644
--- a/Source/CPack/IFW/cmCPackIFWGenerator.h
+++ b/Source/CPack/IFW/cmCPackIFWGenerator.h
@@ -13,12 +13,13 @@
#ifndef cmCPackIFWGenerator_h
#define cmCPackIFWGenerator_h
-#include <cmGeneratedFileStream.h>
#include <CPack/cmCPackGenerator.h>
#include "cmCPackIFWPackage.h"
#include "cmCPackIFWInstaller.h"
+class cmXMLWriter;
+
/** \class cmCPackIFWGenerator
* \brief A generator for Qt Installer Framework tools
*
@@ -121,7 +122,7 @@ protected: // Methods
cmCPackIFWPackage* GetGroupPackage(cmCPackComponentGroup *group) const;
cmCPackIFWPackage* GetComponentPackage(cmCPackComponent *component) const;
- void WriteGeneratedByToStrim(cmGeneratedFileStream& xout);
+ void WriteGeneratedByToStrim(cmXMLWriter& xout);
protected: // Data
diff --git a/Source/CPack/IFW/cmCPackIFWInstaller.cxx b/Source/CPack/IFW/cmCPackIFWInstaller.cxx
index 8c77a2c..224d606 100644
--- a/Source/CPack/IFW/cmCPackIFWInstaller.cxx
+++ b/Source/CPack/IFW/cmCPackIFWInstaller.cxx
@@ -17,7 +17,7 @@
#include <CPack/cmCPackLog.h>
#include <cmGeneratedFileStream.h>
-#include <cmXMLSafe.h>
+#include <cmXMLWriter.h>
#ifdef cmCPackLogger
# undef cmCPackLogger
@@ -334,30 +334,27 @@ void cmCPackIFWInstaller::GenerateInstallerFile()
}
// Output stream
- cmGeneratedFileStream xout((Directory + "/config/config.xml").data());
+ cmGeneratedFileStream fout((Directory + "/config/config.xml").data());
+ cmXMLWriter xout(fout);
- xout << "<?xml version=\"1.0\"?>" << std::endl;
+ xout.StartDocument();
WriteGeneratedByToStrim(xout);
- xout << "<Installer>" << std::endl;
+ xout.StartElement("Installer");
- xout << " <Name>" << cmXMLSafe(Name).str() << "</Name>" << std::endl;
-
- xout << " <Version>" << Version << "</Version>" << std::endl;
-
- xout << " <Title>" << cmXMLSafe(Title).str() << "</Title>"
- << std::endl;
+ xout.Element("Name", Name);
+ xout.Element("Version", Version);
+ xout.Element("Title", Title);
if(!Publisher.empty())
{
- xout << " <Publisher>" << cmXMLSafe(Publisher).str()
- << "</Publisher>" << std::endl;
+ xout.Element("Publisher", Publisher);
}
if(!ProductUrl.empty())
{
- xout << " <ProductUrl>" << ProductUrl << "</ProductUrl>" << std::endl;
+ xout.Element("ProductUrl", ProductUrl);
}
// ApplicationIcon
@@ -369,8 +366,7 @@ void cmCPackIFWInstaller::GenerateInstallerFile()
name = cmSystemTools::GetFilenameWithoutExtension(name);
cmsys::SystemTools::CopyFileIfDifferent(
InstallerApplicationIcon.data(), path.data());
- xout << " <InstallerApplicationIcon>" << name
- << "</InstallerApplicationIcon>" << std::endl;
+ xout.Element("InstallerApplicationIcon", name);
}
// WindowIcon
@@ -380,8 +376,7 @@ void cmCPackIFWInstaller::GenerateInstallerFile()
std::string path = Directory + "/config/" + name;
cmsys::SystemTools::CopyFileIfDifferent(
InstallerWindowIcon.data(), path.data());
- xout << " <InstallerWindowIcon>" << name
- << "</InstallerWindowIcon>" << std::endl;
+ xout.Element("InstallerWindowIcon", name);
}
// Logo
@@ -390,104 +385,91 @@ void cmCPackIFWInstaller::GenerateInstallerFile()
std::string name = cmSystemTools::GetFilenameName(Logo);
std::string path = Directory + "/config/" + name;
cmsys::SystemTools::CopyFileIfDifferent(Logo.data(), path.data());
- xout << " <Logo>" << name << "</Logo>" << std::endl;
+ xout.Element("Logo", name);
}
// Start menu
if(!IsVersionLess("2.0"))
{
- xout << " <StartMenuDir>" << StartMenuDir
- << "</StartMenuDir>" << std::endl;
+ xout.Element("StartMenuDir", StartMenuDir);
}
// Target dir
if(!TargetDir.empty())
{
- xout << " <TargetDir>" << TargetDir << "</TargetDir>" << std::endl;
+ xout.Element("TargetDir", TargetDir);
}
// Admin target dir
if(!AdminTargetDir.empty())
{
- xout << " <AdminTargetDir>" << AdminTargetDir
- << "</AdminTargetDir>" << std::endl;
+ xout.Element("AdminTargetDir", AdminTargetDir);
}
// Remote repositories
if (!Repositories.empty())
{
- xout << " <RemoteRepositories>" << std::endl;
+ xout.StartElement("RemoteRepositories");
for(std::vector<RepositoryStruct>::iterator
rit = Repositories.begin(); rit != Repositories.end(); ++rit)
{
- xout << " <Repository>" << std::endl;
+ xout.StartElement("Repository");
// Url
- xout << " <Url>" << rit->Url
- << "</Url>" << std::endl;
+ xout.Element("Url", rit->Url);
// Enabled
if(!rit->Enabled.empty())
{
- xout << " <Enabled>" << rit->Enabled
- << "</Enabled>" << std::endl;
+ xout.Element("Enabled", rit->Enabled);
}
// Username
if(!rit->Username.empty())
{
- xout << " <Username>" << rit->Username
- << "</Username>" << std::endl;
+ xout.Element("Username", rit->Username);
}
// Password
if(!rit->Password.empty())
{
- xout << " <Password>" << rit->Password
- << "</Password>" << std::endl;
+ xout.Element("Password", rit->Password);
}
// DisplayName
if(!rit->DisplayName.empty())
{
- xout << " <DisplayName>" << rit->DisplayName
- << "</DisplayName>" << std::endl;
+ xout.Element("DisplayName", rit->DisplayName);
}
- xout << " </Repository>" << std::endl;
+ xout.EndElement();
}
- xout << " </RemoteRepositories>" << std::endl;
+ xout.EndElement();
}
// Maintenance tool
if(!IsVersionLess("2.0") && !MaintenanceToolName.empty())
{
- xout << " <MaintenanceToolName>" << MaintenanceToolName
- << "</MaintenanceToolName>" << std::endl;
+ xout.Element("MaintenanceToolName", MaintenanceToolName);
}
// Maintenance tool ini file
if(!IsVersionLess("2.0") && !MaintenanceToolIniFile.empty())
{
- xout << " <MaintenanceToolIniFile>" << MaintenanceToolIniFile
- << "</MaintenanceToolIniFile>" << std::endl;
+ xout.Element("MaintenanceToolIniFile", MaintenanceToolIniFile);
}
// Different allows
if(IsVersionLess("2.0"))
{
// CPack IFW default policy
- xout << " <!-- CPack IFW default policy for QtIFW less 2.0 -->"
- << std::endl;
- xout << " <AllowNonAsciiCharacters>true</AllowNonAsciiCharacters>"
- << std::endl;
- xout << " <AllowSpaceInPath>true</AllowSpaceInPath>" << std::endl;
+ xout.Comment("CPack IFW default policy for QtIFW less 2.0");
+ xout.Element("AllowNonAsciiCharacters", "true");
+ xout.Element("AllowSpaceInPath", "true");
}
else
{
if(!AllowNonAsciiCharacters.empty())
{
- xout << " <AllowNonAsciiCharacters>" << AllowNonAsciiCharacters
- << "</AllowNonAsciiCharacters>" << std::endl;
+ xout.Element("AllowNonAsciiCharacters", AllowNonAsciiCharacters);
}
if(!AllowSpaceInPath.empty())
{
- xout << " <AllowAllowSpaceInPath>" << AllowSpaceInPath
- << "</AllowSpaceInPath>" << std::endl;
+ xout.Element("AllowSpaceInPath", AllowSpaceInPath);
}
}
@@ -497,10 +479,11 @@ void cmCPackIFWInstaller::GenerateInstallerFile()
std::string name = cmSystemTools::GetFilenameName(ControlScript);
std::string path = Directory + "/config/" + name;
cmsys::SystemTools::CopyFileIfDifferent(ControlScript.data(), path.data());
- xout << " <ControlScript>" << name << "</ControlScript>" << std::endl;
+ xout.Element("ControlScript", name);
}
- xout << "</Installer>" << std::endl;
+ xout.EndElement();
+ xout.EndDocument();
}
//----------------------------------------------------------------------------
@@ -535,7 +518,7 @@ void cmCPackIFWInstaller::GeneratePackageFiles()
}
}
-void cmCPackIFWInstaller::WriteGeneratedByToStrim(cmGeneratedFileStream &xout)
+void cmCPackIFWInstaller::WriteGeneratedByToStrim(cmXMLWriter &xout)
{
if(Generator) Generator->WriteGeneratedByToStrim(xout);
}
diff --git a/Source/CPack/IFW/cmCPackIFWInstaller.h b/Source/CPack/IFW/cmCPackIFWInstaller.h
index 4cba5b2..04050c0 100644
--- a/Source/CPack/IFW/cmCPackIFWInstaller.h
+++ b/Source/CPack/IFW/cmCPackIFWInstaller.h
@@ -13,11 +13,11 @@
#ifndef cmCPackIFWInstaller_h
#define cmCPackIFWInstaller_h
-#include <cmGeneratedFileStream.h>
#include <cmStandardIncludes.h>
class cmCPackIFWPackage;
class cmCPackIFWGenerator;
+class cmXMLWriter;
/** \class cmCPackIFWInstaller
* \brief A binary installer to be created CPack IFW generator
@@ -115,7 +115,7 @@ public: // Internal implementation
std::string Directory;
protected:
- void WriteGeneratedByToStrim(cmGeneratedFileStream& xout);
+ void WriteGeneratedByToStrim(cmXMLWriter& xout);
};
#endif // cmCPackIFWInstaller_h
diff --git a/Source/CPack/IFW/cmCPackIFWPackage.cxx b/Source/CPack/IFW/cmCPackIFWPackage.cxx
index 5474ad1b..b71c7e3 100644
--- a/Source/CPack/IFW/cmCPackIFWPackage.cxx
+++ b/Source/CPack/IFW/cmCPackIFWPackage.cxx
@@ -18,6 +18,7 @@
#include <cmGeneratedFileStream.h>
#include <cmTimestamp.h>
+#include <cmXMLWriter.h>
//----------------------------------------------------------------- Logger ---
#ifdef cmCPackLogger
@@ -447,35 +448,28 @@ void cmCPackIFWPackage::GeneratePackageFile()
}
// Output stream
- cmGeneratedFileStream xout((Directory + "/meta/package.xml").data());
+ cmGeneratedFileStream fout((Directory + "/meta/package.xml").data());
+ cmXMLWriter xout(fout);
- xout << "<?xml version=\"1.0\"?>" << std::endl;
+ xout.StartDocument();
WriteGeneratedByToStrim(xout);
- xout << "<Package>" << std::endl;
+ xout.StartElement("Package");
- xout << " <DisplayName>" << DisplayName
- << "</DisplayName>" << std::endl;
+ xout.Element("DisplayName", DisplayName);
+ xout.Element("Description", Description);
+ xout.Element("Name", Name);
+ xout.Element("Version", Version);
- xout << " <Description>" << Description
- << "</Description>" << std::endl;
-
- xout << " <Name>" << Name << "</Name>" << std::endl;
-
- xout << " <Version>" << Version
- << "</Version>" << std::endl;
-
- xout << " <ReleaseDate>";
- if(ReleaseDate.empty())
+ if (!ReleaseDate.empty())
{
- xout << cmTimestamp().CurrentTime("%Y-%m-%d", true);
+ xout.Element("ReleaseDate", ReleaseDate);
}
else
{
- xout << ReleaseDate;
+ xout.Element("ReleaseDate", cmTimestamp().CurrentTime("%Y-%m-%d", true));
}
- xout << "</ReleaseDate>" << std::endl;
// Script (copy to meta dir)
if(!Script.empty())
@@ -483,7 +477,7 @@ void cmCPackIFWPackage::GeneratePackageFile()
std::string name = cmSystemTools::GetFilenameName(Script);
std::string path = Directory + "/meta/" + name;
cmsys::SystemTools::CopyFileIfDifferent(Script.data(), path.data());
- xout << " <Script>" << name << "</Script>" << std::endl;
+ xout.Element("Script", name);
}
// Dependencies
@@ -501,16 +495,16 @@ void cmCPackIFWPackage::GeneratePackageFile()
// Write dependencies
if (!compDepSet.empty())
{
- xout << " <Dependencies>";
+ std::stringstream dependencies;
std::set<DependenceStruct>::iterator it = compDepSet.begin();
- xout << it->NameWithCompare();
+ dependencies << it->NameWithCompare();
++it;
while(it != compDepSet.end())
{
- xout << "," << it->NameWithCompare();
+ dependencies << "," << it->NameWithCompare();
++it;
}
- xout << "</Dependencies>" << std::endl;
+ xout.Element("Dependencies", dependencies.str());
}
// Licenses (copy to meta dir)
@@ -524,43 +518,42 @@ void cmCPackIFWPackage::GeneratePackageFile()
}
if(!licenses.empty())
{
- xout << " <Licenses>" << std::endl;
+ xout.StartElement("Licenses");
for(size_t i = 0; i < licenses.size(); i += 2)
{
- xout << " <License "
- << "name=\"" << licenses[i] << "\" "
- << "file=\"" << licenses[i + 1] << "\" "
- << "/>" <<std::endl;
+ xout.StartElement("License");
+ xout.Attribute("name", licenses[i]);
+ xout.Attribute("file", licenses[i + 1]);
+ xout.EndElement();
}
- xout << " </Licenses>" << std::endl;
+ xout.EndElement();
}
if (!ForcedInstallation.empty())
{
- xout << " <ForcedInstallation>" << ForcedInstallation
- << "</ForcedInstallation>" << std::endl;
+ xout.Element("ForcedInstallation", ForcedInstallation);
}
if (!Virtual.empty())
{
- xout << " <Virtual>" << Virtual << "</Virtual>" << std::endl;
+ xout.Element("Virtual", Virtual);
}
else if (!Default.empty())
{
- xout << " <Default>" << Default << "</Default>" << std::endl;
+ xout.Element("Default", Default);
}
// Priority
if(!SortingPriority.empty())
{
- xout << " <SortingPriority>" << SortingPriority
- << "</SortingPriority>" << std::endl;
+ xout.Element("SortingPriority", SortingPriority);
}
- xout << "</Package>" << std::endl;
+ xout.EndElement();
+ xout.EndDocument();
}
-void cmCPackIFWPackage::WriteGeneratedByToStrim(cmGeneratedFileStream &xout)
+void cmCPackIFWPackage::WriteGeneratedByToStrim(cmXMLWriter &xout)
{
if(Generator) Generator->WriteGeneratedByToStrim(xout);
}
diff --git a/Source/CPack/IFW/cmCPackIFWPackage.h b/Source/CPack/IFW/cmCPackIFWPackage.h
index d2f7927..e647c16 100644
--- a/Source/CPack/IFW/cmCPackIFWPackage.h
+++ b/Source/CPack/IFW/cmCPackIFWPackage.h
@@ -14,12 +14,12 @@
#define cmCPackIFWPackage_h
#include <cmStandardIncludes.h>
-#include <cmGeneratedFileStream.h>
class cmCPackComponent;
class cmCPackComponentGroup;
class cmCPackIFWInstaller;
class cmCPackIFWGenerator;
+class cmXMLWriter;
/** \class cmCPackIFWPackage
* \brief A single component to be installed by CPack IFW generator
@@ -135,7 +135,7 @@ public: // Internal implementation
std::string Directory;
protected:
- void WriteGeneratedByToStrim(cmGeneratedFileStream& xout);
+ void WriteGeneratedByToStrim(cmXMLWriter& xout);
};
#endif // cmCPackIFWPackage_h
diff --git a/Source/CPack/cmCPackDragNDropGenerator.cxx b/Source/CPack/cmCPackDragNDropGenerator.cxx
index 521b395..d6de77d 100644
--- a/Source/CPack/cmCPackDragNDropGenerator.cxx
+++ b/Source/CPack/cmCPackDragNDropGenerator.cxx
@@ -22,10 +22,12 @@
#include <CoreFoundation/CoreFoundation.h>
+#ifdef HAVE_CoreServices
// For the old LocaleStringToLangAndRegionCodes() function, to convert
// to the old Script Manager RegionCode values needed for the 'LPic' data
// structure used for generating multi-lingual SLAs.
#include <CoreServices/CoreServices.h>
+#endif
static const char* SLAHeader =
"data 'LPic' (5000) {\n"
@@ -643,9 +645,11 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir,
kCFStringEncodingMacRoman);
LangCode lang = 0;
RegionCode region = 0;
+#ifdef HAVE_CoreServices
OSStatus err = LocaleStringToLangAndRegionCodes(iso_language_cstr,
&lang, &region);
if (err != noErr)
+#endif
{
cmCPackLogger(cmCPackLog::LOG_ERROR,
"No language/region code available for " << iso_language_cstr
@@ -653,10 +657,12 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir,
free(iso_language_cstr);
return 0;
}
+#ifdef HAVE_CoreServices
free(iso_language_cstr);
header_data.push_back(region);
header_data.push_back(i);
header_data.push_back(0);
+#endif
}
ofs << "data 'LPic' (5000) {\n";
ofs << std::hex << std::uppercase << std::setfill('0');
diff --git a/Source/CTest/cmCTestRunTest.cxx b/Source/CTest/cmCTestRunTest.cxx
index d108592..7f3a077 100644
--- a/Source/CTest/cmCTestRunTest.cxx
+++ b/Source/CTest/cmCTestRunTest.cxx
@@ -64,6 +64,28 @@ bool cmCTestRunTest::CheckOutput()
this->GetIndex() << ": " << line << std::endl);
this->ProcessOutput += line;
this->ProcessOutput += "\n";
+
+ // Check for TIMEOUT_AFTER_MATCH property.
+ if (!this->TestProperties->TimeoutRegularExpressions.empty())
+ {
+ std::vector<std::pair<cmsys::RegularExpression,
+ std::string> >::iterator regIt;
+ for ( regIt = this->TestProperties->TimeoutRegularExpressions.begin();
+ regIt != this->TestProperties->TimeoutRegularExpressions.end();
+ ++ regIt )
+ {
+ if ( regIt->first.find(this->ProcessOutput.c_str()) )
+ {
+ cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
+ "Test timeout changed to " <<
+ this->TestProperties->AlternateTimeout << std::endl);
+ this->TestProcess->ResetStartTime();
+ this->TestProcess->ChangeTimeout(
+ this->TestProperties->AlternateTimeout);
+ break;
+ }
+ }
+ }
}
else // if(p == cmsysProcess_Pipe_Timeout)
{
diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx
index b6a4819..59ed98e 100644
--- a/Source/CTest/cmCTestTestHandler.cxx
+++ b/Source/CTest/cmCTestTestHandler.cxx
@@ -2254,6 +2254,31 @@ bool cmCTestTestHandler::SetTestsProperties(
{
rtit->Directory = val;
}
+ if ( key == "TIMEOUT_AFTER_MATCH" )
+ {
+ std::vector<std::string> propArgs;
+ cmSystemTools::ExpandListArgument(val, propArgs);
+ if (propArgs.size() != 2)
+ {
+ cmCTestLog(this->CTest, WARNING,
+ "TIMEOUT_AFTER_MATCH expects two arguments, found " <<
+ propArgs.size() << std::endl);
+ }
+ else
+ {
+ rtit->AlternateTimeout = atof(propArgs[0].c_str());
+ std::vector<std::string> lval;
+ cmSystemTools::ExpandListArgument(propArgs[1], lval);
+ std::vector<std::string>::iterator crit;
+ for ( crit = lval.begin(); crit != lval.end(); ++ crit )
+ {
+ rtit->TimeoutRegularExpressions.push_back(
+ std::pair<cmsys::RegularExpression, std::string>(
+ cmsys::RegularExpression(crit->c_str()),
+ std::string(*crit)));
+ }
+ }
+ }
}
}
}
diff --git a/Source/CTest/cmCTestTestHandler.h b/Source/CTest/cmCTestTestHandler.h
index c635430..d12c2b6 100644
--- a/Source/CTest/cmCTestTestHandler.h
+++ b/Source/CTest/cmCTestTestHandler.h
@@ -104,6 +104,8 @@ public:
std::string> > ErrorRegularExpressions;
std::vector<std::pair<cmsys::RegularExpression,
std::string> > RequiredRegularExpressions;
+ std::vector<std::pair<cmsys::RegularExpression,
+ std::string> > TimeoutRegularExpressions;
std::map<std::string, std::string> Measurements;
bool IsInBasedOnREOptions;
bool WillFail;
@@ -112,6 +114,7 @@ public:
bool RunSerial;
double Timeout;
bool ExplicitTimeout;
+ double AlternateTimeout;
int Index;
//Requested number of process slots
int Processors;
diff --git a/Source/CTest/cmProcess.cxx b/Source/CTest/cmProcess.cxx
index 0c25f40..6441886 100644
--- a/Source/CTest/cmProcess.cxx
+++ b/Source/CTest/cmProcess.cxx
@@ -262,6 +262,16 @@ int cmProcess::ReportStatus()
}
+void cmProcess::ChangeTimeout(double t)
+{
+ this->Timeout = t;
+ cmsysProcess_SetTimeout(this->Process, this->Timeout);
+}
+
+void cmProcess::ResetStartTime()
+{
+ cmsysProcess_ResetStartTime(this->Process);
+}
int cmProcess::GetExitException()
{
diff --git a/Source/CTest/cmProcess.h b/Source/CTest/cmProcess.h
index eddeeab..c9fd859 100644
--- a/Source/CTest/cmProcess.h
+++ b/Source/CTest/cmProcess.h
@@ -32,6 +32,8 @@ public:
void SetCommandArguments(std::vector<std::string> const& arg);
void SetWorkingDirectory(const char* dir) { this->WorkingDirectory = dir;}
void SetTimeout(double t) { this->Timeout = t;}
+ void ChangeTimeout(double t);
+ void ResetStartTime();
// Return true if the process starts
bool StartProcess();
diff --git a/Source/cmExtraCodeBlocksGenerator.cxx b/Source/cmExtraCodeBlocksGenerator.cxx
index 476d3ac..52512a8 100644
--- a/Source/cmExtraCodeBlocksGenerator.cxx
+++ b/Source/cmExtraCodeBlocksGenerator.cxx
@@ -18,7 +18,7 @@
#include "cmSourceFile.h"
#include "cmGeneratedFileStream.h"
#include "cmSystemTools.h"
-#include "cmXMLSafe.h"
+#include "cmXMLWriter.h"
#include <cmsys/SystemTools.hxx>
@@ -101,11 +101,11 @@ struct Tree
void InsertPath(const std::vector<std::string>& splitted,
std::vector<std::string>::size_type start,
const std::string& fileName);
- void BuildVirtualFolder(std::string& virtualFolders) const;
+ void BuildVirtualFolder(cmXMLWriter& xml) const;
void BuildVirtualFolderImpl(std::string& virtualFolders,
const std::string& prefix) const;
- void BuildUnit(std::string& unitString, const std::string& fsPath) const;
- void BuildUnitImpl(std::string& unitString,
+ void BuildUnit(cmXMLWriter& xml, const std::string& fsPath) const;
+ void BuildUnitImpl(cmXMLWriter& xml,
const std::string& virtualFolderPath,
const std::string& fsPath) const;
};
@@ -159,16 +159,18 @@ void Tree::InsertPath(const std::vector<std::string>& splitted,
}
-void Tree::BuildVirtualFolder(std::string& virtualFolders) const
+void Tree::BuildVirtualFolder(cmXMLWriter& xml) const
{
- virtualFolders += "<Option virtualFolders=\"CMake Files\\;";
+ xml.StartElement("Option");
+ std::string virtualFolders = "CMake Files\\;";
for (std::vector<Tree>::const_iterator it = folders.begin();
it != folders.end();
++it)
{
it->BuildVirtualFolderImpl(virtualFolders, "");
}
- virtualFolders += "\" />";
+ xml.Attribute("virtualFolders", virtualFolders);
+ xml.EndElement();
}
@@ -185,26 +187,31 @@ void Tree::BuildVirtualFolderImpl(std::string& virtualFolders,
}
-void Tree::BuildUnit(std::string& unitString, const std::string& fsPath) const
+void Tree::BuildUnit(cmXMLWriter& xml, const std::string& fsPath) const
{
for (std::vector<std::string>::const_iterator it = files.begin();
it != files.end();
++it)
{
- unitString += " <Unit filename=\"" + fsPath + *it + "\">\n";
- unitString += " <Option virtualFolder=\"CMake Files\\\" />\n";
- unitString += " </Unit>\n";
+ xml.StartElement("Unit");
+ xml.Attribute("filename", fsPath + *it);
+
+ xml.StartElement("Option");
+ xml.Attribute("virtualFolder", "CMake Files\\");
+ xml.EndElement();
+
+ xml.EndElement();
}
for (std::vector<Tree>::const_iterator it = folders.begin();
it != folders.end();
++it)
{
- it->BuildUnitImpl(unitString, "", fsPath);
+ it->BuildUnitImpl(xml, "", fsPath);
}
}
-void Tree::BuildUnitImpl(std::string& unitString,
+void Tree::BuildUnitImpl(cmXMLWriter& xml,
const std::string& virtualFolderPath,
const std::string& fsPath) const
{
@@ -212,16 +219,21 @@ void Tree::BuildUnitImpl(std::string& unitString,
it != files.end();
++it)
{
- unitString += " <Unit filename=\"" +fsPath+path+ "/" + *it + "\">\n";
- unitString += " <Option virtualFolder=\"CMake Files\\"
- + virtualFolderPath + path + "\\\" />\n";
- unitString += " </Unit>\n";
+ xml.StartElement("Unit");
+ xml.Attribute("filename", fsPath + path + "/" + *it);
+
+ xml.StartElement("Option");
+ xml.Attribute("virtualFolder",
+ "CMake Files\\" + virtualFolderPath + path + "\\");
+ xml.EndElement();
+
+ xml.EndElement();
}
for (std::vector<Tree>::const_iterator it = folders.begin();
it != folders.end();
++it)
{
- it->BuildUnitImpl(unitString,
+ it->BuildUnitImpl(xml,
virtualFolderPath + path + "\\", fsPath + path + "/");
}
}
@@ -289,30 +301,41 @@ void cmExtraCodeBlocksGenerator
}
}
- // Now build a virtual tree string
- std::string virtualFolders;
- tree.BuildVirtualFolder(virtualFolders);
- // And one for <Unit>
- std::string unitFiles;
- tree.BuildUnit(unitFiles, std::string(lgs[0]->GetSourceDirectory()) + "/");
-
// figure out the compiler
std::string compiler = this->GetCBCompilerId(mf);
std::string make = mf->GetRequiredDefinition("CMAKE_MAKE_PROGRAM");
const std::string makeArgs = mf->GetSafeDefinition(
"CMAKE_CODEBLOCKS_MAKE_ARGUMENTS");
- fout<<"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\" ?>\n"
- "<CodeBlocks_project_file>\n"
- " <FileVersion major=\"1\" minor=\"6\" />\n"
- " <Project>\n"
- " <Option title=\"" << lgs[0]->GetProjectName()<<"\" />\n"
- " <Option makefile_is_custom=\"1\" />\n"
- " <Option compiler=\"" << compiler << "\" />\n"
- " "<<virtualFolders<<"\n"
- " <Build>\n";
-
- this->AppendTarget(fout, "all", 0, make.c_str(), lgs[0], compiler.c_str(),
+ cmXMLWriter xml(fout);
+ xml.StartDocument();
+ xml.StartElement("CodeBlocks_project_file");
+
+ xml.StartElement("FileVersion");
+ xml.Attribute("major", 1);
+ xml.Attribute("minor", 6);
+ xml.EndElement();
+
+ xml.StartElement("Project");
+
+ xml.StartElement("Option");
+ xml.Attribute("title", lgs[0]->GetProjectName());
+ xml.EndElement();
+
+ xml.StartElement("Option");
+ xml.Attribute("makefile_is_custom", 1);
+ xml.EndElement();
+
+ xml.StartElement("Option");
+ xml.Attribute("compiler", compiler);
+ xml.EndElement();
+
+ // Now build a virtual tree
+ tree.BuildVirtualFolder(xml);
+
+ xml.StartElement("Build");
+
+ this->AppendTarget(xml, "all", 0, make.c_str(), lgs[0], compiler.c_str(),
makeArgs);
// add all executable and library targets and some of the GLOBAL
@@ -334,7 +357,7 @@ void cmExtraCodeBlocksGenerator
if (strcmp((*lg)->GetCurrentBinaryDirectory(),
(*lg)->GetBinaryDirectory())==0)
{
- this->AppendTarget(fout, targetName, 0,
+ this->AppendTarget(xml, targetName, 0,
make.c_str(), *lg, compiler.c_str(),
makeArgs);
}
@@ -352,7 +375,7 @@ void cmExtraCodeBlocksGenerator
break;
}
- this->AppendTarget(fout, targetName, 0,
+ this->AppendTarget(xml, targetName, 0,
make.c_str(), *lg, compiler.c_str(),makeArgs);
break;
case cmState::EXECUTABLE:
@@ -362,11 +385,11 @@ void cmExtraCodeBlocksGenerator
case cmState::OBJECT_LIBRARY:
{
cmGeneratorTarget* gt = *ti;
- this->AppendTarget(fout, targetName, gt,
+ this->AppendTarget(xml, targetName, gt,
make.c_str(), *lg, compiler.c_str(), makeArgs);
std::string fastTarget = targetName;
fastTarget += "/fast";
- this->AppendTarget(fout, fastTarget, gt,
+ this->AppendTarget(xml, fastTarget, gt,
make.c_str(), *lg, compiler.c_str(), makeArgs);
}
break;
@@ -376,8 +399,7 @@ void cmExtraCodeBlocksGenerator
}
}
- fout<<" </Build>\n";
-
+ xml.EndElement(); // Build
// Collect all used source files in the project.
// Keep a list of C/C++ source files which might have an acompanying header
@@ -505,24 +527,27 @@ void cmExtraCodeBlocksGenerator
std::string const& unitFilename = sit->first;
CbpUnit const& unit = sit->second;
- fout<<" <Unit filename=\""<< cmXMLSafe(unitFilename) <<"\">\n";
+ xml.StartElement("Unit");
+ xml.Attribute("filename", unitFilename);
for(std::vector<const cmGeneratorTarget*>::const_iterator ti =
unit.Targets.begin();
ti != unit.Targets.end(); ++ti)
{
- std::string const& targetName = (*ti)->GetName();
- fout<<" <Option target=\""<< cmXMLSafe(targetName) <<"\"/>\n";
+ xml.StartElement("Option");
+ xml.Attribute("target", (*ti)->GetName());
+ xml.EndElement();
}
- fout<<" </Unit>\n";
+ xml.EndElement();
}
// Add CMakeLists.txt
- fout<<unitFiles;
+ tree.BuildUnit(xml, std::string(mf->GetHomeDirectory()) + "/");
- fout<<" </Project>\n"
- "</CodeBlocks_project_file>\n";
+ xml.EndElement(); // Project
+ xml.EndElement(); // CodeBlocks_project_file
+ xml.EndDocument();
}
@@ -553,7 +578,7 @@ std::string cmExtraCodeBlocksGenerator::CreateDummyTargetFile(
// Generate the xml code for one target.
-void cmExtraCodeBlocksGenerator::AppendTarget(cmGeneratedFileStream& fout,
+void cmExtraCodeBlocksGenerator::AppendTarget(cmXMLWriter& xml,
const std::string& targetName,
cmGeneratorTarget* target,
const char* make,
@@ -565,7 +590,9 @@ void cmExtraCodeBlocksGenerator::AppendTarget(cmGeneratedFileStream& fout,
std::string makefileName = lg->GetCurrentBinaryDirectory();
makefileName += "/Makefile";
- fout<<" <Target title=\"" << targetName << "\">\n";
+ xml.StartElement("Target");
+ xml.Attribute("title", targetName);
+
if (target!=0)
{
int cbTargetType = this->GetCBTargetType(target);
@@ -603,13 +630,29 @@ void cmExtraCodeBlocksGenerator::AppendTarget(cmGeneratedFileStream& fout,
location = target->GetLocation(buildType);
}
- fout<<" <Option output=\"" << location
- << "\" prefix_auto=\"0\" extension_auto=\"0\" />\n"
- " <Option working_dir=\"" << workingDir << "\" />\n"
- " <Option object_output=\"./\" />\n"
- " <Option type=\"" << cbTargetType << "\" />\n"
- " <Option compiler=\"" << compiler << "\" />\n"
- " <Compiler>\n";
+ xml.StartElement("Option");
+ xml.Attribute("output", location);
+ xml.Attribute("prefix_auto", 0);
+ xml.Attribute("extension_auto", 0);
+ xml.EndElement();
+
+ xml.StartElement("Option");
+ xml.Attribute("working_dir", workingDir);
+ xml.EndElement();
+
+ xml.StartElement("Option");
+ xml.Attribute("object_output", "./");
+ xml.EndElement();
+
+ xml.StartElement("Option");
+ xml.Attribute("type", cbTargetType);
+ xml.EndElement();
+
+ xml.StartElement("Option");
+ xml.Attribute("compiler", compiler);
+ xml.EndElement();
+
+ xml.StartElement("Compiler");
// the compilerdefines for this target
std::vector<std::string> cdefs;
@@ -619,8 +662,9 @@ void cmExtraCodeBlocksGenerator::AppendTarget(cmGeneratedFileStream& fout,
for(std::vector<std::string>::const_iterator di = cdefs.begin();
di != cdefs.end(); ++di)
{
- cmXMLSafe safedef(di->c_str());
- fout <<" <Add option=\"-D" << safedef.str() << "\" />\n";
+ xml.StartElement("Add");
+ xml.Attribute("option", "-D" + *di);
+ xml.EndElement();
}
// the include directories for this target
@@ -653,36 +697,48 @@ void cmExtraCodeBlocksGenerator::AppendTarget(cmGeneratedFileStream& fout,
dirIt != uniqIncludeDirs.end();
++dirIt)
{
- fout <<" <Add directory=\"" << *dirIt << "\" />\n";
+ xml.StartElement("Add");
+ xml.Attribute("directory", *dirIt);
+ xml.EndElement();
}
- fout<<" </Compiler>\n";
+ xml.EndElement(); // Compiler
}
else // e.g. all and the GLOBAL and UTILITY targets
{
- fout<<" <Option working_dir=\""
- << lg->GetCurrentBinaryDirectory() << "\" />\n"
- <<" <Option type=\"" << 4 << "\" />\n";
- }
-
- fout<<" <MakeCommands>\n"
- " <Build command=\""
- << this->BuildMakeCommand(make, makefileName.c_str(), targetName,
- makeFlags)
- << "\" />\n"
- " <CompileFile command=\""
- << this->BuildMakeCommand(make, makefileName.c_str(),"&quot;$file&quot;",
- makeFlags)
- << "\" />\n"
- " <Clean command=\""
- << this->BuildMakeCommand(make, makefileName.c_str(), "clean", makeFlags)
- << "\" />\n"
- " <DistClean command=\""
- << this->BuildMakeCommand(make, makefileName.c_str(), "clean", makeFlags)
- << "\" />\n"
- " </MakeCommands>\n"
- " </Target>\n";
+ xml.StartElement("Option");
+ xml.Attribute("working_dir", lg->GetCurrentBinaryDirectory());
+ xml.EndElement();
+
+ xml.StartElement("Option");
+ xml.Attribute("type", 4);
+ xml.EndElement();
+ }
+
+ xml.StartElement("MakeCommands");
+
+ xml.StartElement("Build");
+ xml.Attribute("command",
+ this->BuildMakeCommand(make, makefileName.c_str(), targetName, makeFlags));
+ xml.EndElement();
+
+ xml.StartElement("CompileFile");
+ xml.Attribute("command",
+ this->BuildMakeCommand(make, makefileName.c_str(),"\"$file\"", makeFlags));
+ xml.EndElement();
+ xml.StartElement("Clean");
+ xml.Attribute("command",
+ this->BuildMakeCommand(make, makefileName.c_str(), "clean", makeFlags));
+ xml.EndElement();
+
+ xml.StartElement("DistClean");
+ xml.Attribute("command",
+ this->BuildMakeCommand(make, makefileName.c_str(), "clean", makeFlags));
+ xml.EndElement();
+
+ xml.EndElement(); //MakeCommands
+ xml.EndElement(); //Target
}
@@ -825,7 +881,7 @@ std::string cmExtraCodeBlocksGenerator::BuildMakeCommand(
// http://public.kitware.com/Bug/view.php?id=13952
std::string makefileName = cmSystemTools::ConvertToOutputPath(makefile);
command += " /NOLOGO /f ";
- command += cmXMLSafe(makefileName).str();
+ command += makefileName;
command += " VERBOSE=1 ";
command += target;
}
@@ -834,9 +890,9 @@ std::string cmExtraCodeBlocksGenerator::BuildMakeCommand(
// no escaping of spaces in this case, see
// http://public.kitware.com/Bug/view.php?id=10014
std::string makefileName = makefile;
- command += " -f &quot;";
+ command += " -f \"";
command += makefileName;
- command += "&quot; ";
+ command += "\" ";
command += " VERBOSE=1 ";
command += target;
}
@@ -848,9 +904,9 @@ std::string cmExtraCodeBlocksGenerator::BuildMakeCommand(
else
{
std::string makefileName = cmSystemTools::ConvertToOutputPath(makefile);
- command += " -f &quot;";
+ command += " -f \"";
command += makefileName;
- command += "&quot; ";
+ command += "\" ";
command += " VERBOSE=1 ";
command += target;
}
diff --git a/Source/cmExtraCodeBlocksGenerator.h b/Source/cmExtraCodeBlocksGenerator.h
index 4abfa7e..e2f09de 100644
--- a/Source/cmExtraCodeBlocksGenerator.h
+++ b/Source/cmExtraCodeBlocksGenerator.h
@@ -18,7 +18,7 @@
class cmLocalGenerator;
class cmMakefile;
class cmGeneratorTarget;
-class cmGeneratedFileStream;
+class cmXMLWriter;
/** \class cmExtraCodeBlocksGenerator
* \brief Write CodeBlocks project files for Makefile based projects
@@ -56,7 +56,7 @@ private:
std::string BuildMakeCommand(const std::string& make, const char* makefile,
const std::string& target,
const std::string& makeFlags);
- void AppendTarget(cmGeneratedFileStream& fout,
+ void AppendTarget(cmXMLWriter& xml,
const std::string& targetName,
cmGeneratorTarget* target,
const char* make,
diff --git a/Source/cmExtraCodeLiteGenerator.cxx b/Source/cmExtraCodeLiteGenerator.cxx
index 67aa157..9fc7b1e 100644
--- a/Source/cmExtraCodeLiteGenerator.cxx
+++ b/Source/cmExtraCodeLiteGenerator.cxx
@@ -24,7 +24,7 @@
#include <cmsys/SystemInformation.hxx>
#include <cmsys/Directory.hxx>
#include "cmStandardIncludes.h"
-#include "cmXMLSafe.h"
+#include "cmXMLWriter.h"
//----------------------------------------------------------------------------
void cmExtraCodeLiteGenerator::GetDocumentation(cmDocumentationEntry& entry,
@@ -54,16 +54,14 @@ void cmExtraCodeLiteGenerator::Generate()
std::string workspaceOutputDir;
std::string workspaceFileName;
std::string workspaceSourcePath;
- std::string lprjdebug;
- cmGeneratedFileStream fout;
+ const std::map<std::string, std::vector<cmLocalGenerator*> >& projectMap =
+ this->GlobalGenerator->GetProjectMap();
// loop projects and locate the root project.
// and extract the information for creating the worspace
for (std::map<std::string, std::vector<cmLocalGenerator*> >::const_iterator
- it = this->GlobalGenerator->GetProjectMap().begin();
- it!= this->GlobalGenerator->GetProjectMap().end();
- ++it)
+ it = projectMap.begin(); it!= projectMap.end(); ++it)
{
const cmMakefile* mf =it->second[0]->GetMakefile();
this->ConfigName = GetConfigurationName( mf );
@@ -77,18 +75,20 @@ void cmExtraCodeLiteGenerator::Generate()
workspaceFileName = workspaceOutputDir+"/";
workspaceFileName += workspaceProjectName + ".workspace";
this->WorkspacePath = it->second[0]->GetCurrentBinaryDirectory();;
-
- fout.Open(workspaceFileName.c_str(), false, false);
- fout << "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"
- "<CodeLite_Workspace Name=\"" << workspaceProjectName << "\" >\n";
+ break;
}
}
+ cmGeneratedFileStream fout(workspaceFileName.c_str());
+ cmXMLWriter xml(fout);
+
+ xml.StartDocument("utf-8");
+ xml.StartElement("CodeLite_Workspace");
+ xml.Attribute("Name", workspaceProjectName);
+
// for each sub project in the workspace create a codelite project
for (std::map<std::string, std::vector<cmLocalGenerator*> >::const_iterator
- it = this->GlobalGenerator->GetProjectMap().begin();
- it!= this->GlobalGenerator->GetProjectMap().end();
- ++it)
+ it = projectMap.begin(); it!= projectMap.end(); ++it)
{
// retrive project information
std::string outputDir = it->second[0]->GetCurrentBinaryDirectory();
@@ -101,19 +101,33 @@ void cmExtraCodeLiteGenerator::Generate()
// create a project file
this->CreateProjectFile(it->second);
- fout << " <Project Name=\"" << projectName << "\" Path=\""
- << filename << "\" Active=\"No\"/>\n";
- lprjdebug += "<Project Name=\"" + projectName
- + "\" ConfigName=\"" + this->ConfigName + "\"/>\n";
+ xml.StartElement("Project");
+ xml.Attribute("Name", projectName);
+ xml.Attribute("Path", filename);
+ xml.Attribute("Active", "No");
+ xml.EndElement();
+ }
+
+ xml.StartElement("BuildMatrix");
+ xml.StartElement("WorkspaceConfiguration");
+ xml.Attribute("Name", this->ConfigName);
+ xml.Attribute("Selected", "yes");
+
+ for (std::map<std::string, std::vector<cmLocalGenerator*> >::const_iterator
+ it = projectMap.begin(); it!= projectMap.end(); ++it)
+ {
+ // retrive project information
+ std::string projectName = it->second[0]->GetProjectName();
+
+ xml.StartElement("Project");
+ xml.Attribute("Name", projectName);
+ xml.Attribute("ConfigName", this->ConfigName);
+ xml.EndElement();
}
- fout << " <BuildMatrix>\n"
- " <WorkspaceConfiguration Name=\""
- << this->ConfigName << "\" Selected=\"yes\">\n"
- " " << lprjdebug << ""
- " </WorkspaceConfiguration>\n"
- " </BuildMatrix>\n"
- "</CodeLite_Workspace>\n";
+ xml.EndElement(); // WorkspaceConfiguration
+ xml.EndElement(); // BuildMatrix
+ xml.EndElement(); // CodeLite_Workspace
}
/* create the project file */
@@ -138,11 +152,13 @@ void cmExtraCodeLiteGenerator
{
return;
}
+ cmXMLWriter xml(fout);
////////////////////////////////////
- fout << "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"
- "<CodeLite_Project Name=\"" << lgs[0]->GetProjectName()
- << "\" InternalType=\"\">\n";
+ xml.StartDocument("utf-8");
+ xml.StartElement("CodeLite_Project");
+ xml.Attribute("Name", lgs[0]->GetProjectName());
+ xml.Attribute("InternalType", "");
// Collect all used source files in the project
// Sort them into two containers, one for C/C++ implementation files
@@ -285,7 +301,8 @@ void cmExtraCodeLiteGenerator
// Create 2 virtual folders: src and include
// and place all the implementation files into the src
// folder, the rest goes to the include folder
- fout<< " <VirtualDirectory Name=\"src\">\n";
+ xml.StartElement("VirtualDirectory");
+ xml.Attribute("Name", "src");
// insert all source files in the codelite project
// first the C/C++ implementation files, then all others
@@ -294,22 +311,25 @@ void cmExtraCodeLiteGenerator
sit!=cFiles.end();
++sit)
{
- std::string relativePath =
- cmSystemTools::RelativePath(projectPath.c_str(), sit->first.c_str());
- fout<< " <File Name=\"" << relativePath << "\"/>\n";
+ xml.StartElement("File");
+ xml.Attribute("Name",
+ cmSystemTools::RelativePath(projectPath.c_str(), sit->first.c_str()));
+ xml.EndElement();
}
- fout<< " </VirtualDirectory>\n";
- fout<< " <VirtualDirectory Name=\"include\">\n";
+ xml.EndElement(); // VirtualDirectory
+ xml.StartElement("VirtualDirectory");
+ xml.Attribute("Name", "include");
for (std::set<std::string>::const_iterator
sit=otherFiles.begin();
sit!=otherFiles.end();
++sit)
{
- std::string relativePath =
- cmSystemTools::RelativePath(projectPath.c_str(), sit->c_str());
- fout << " <File Name=\"" << relativePath << "\"/>\n";
+ xml.StartElement("File");
+ xml.Attribute("Name",
+ cmSystemTools::RelativePath(projectPath.c_str(), sit->c_str()));
+ xml.EndElement();
}
- fout << " </VirtualDirectory>\n";
+ xml.EndElement(); // VirtualDirectory
// Get the number of CPUs. We use this information for the make -jN
// command
@@ -319,63 +339,99 @@ void cmExtraCodeLiteGenerator
this->CpuCount = info.GetNumberOfLogicalCPU() *
info.GetNumberOfPhysicalCPU();
- std::string cleanCommand = GetCleanCommand(mf);
- std::string buildCommand = GetBuildCommand(mf);
- std::string rebuildCommand = GetRebuildCommand(mf);
- std::string singleFileCommand = GetSingleFileBuildCommand(mf);
-
std::string codeliteCompilerName = this->GetCodeLiteCompilerName(mf);
- fout << "\n"
- " <Settings Type=\"" << projectType << "\">\n"
- " <Configuration Name=\"" << this->ConfigName << "\" CompilerType=\""
- << codeliteCompilerName << "\" DebuggerType=\"GNU gdb debugger\" "
- "Type=\""
- << projectType << "\" BuildCmpWithGlobalSettings=\"append\" "
- "BuildLnkWithGlobalSettings=\"append\" "
- "BuildResWithGlobalSettings=\"append\">\n"
- " <Compiler Options=\"-g\" "
- "Required=\"yes\" PreCompiledHeader=\"\">\n"
- " <IncludePath Value=\".\"/>\n"
- " </Compiler>\n"
- " <Linker Options=\"\" Required=\"yes\"/>\n"
- " <ResourceCompiler Options=\"\" Required=\"no\"/>\n"
- " <General OutputFile=\"$(IntermediateDirectory)/$(ProjectName)\" "
- "IntermediateDirectory=\"./\" Command=\"./$(ProjectName)\" "
- "CommandArguments=\"\" WorkingDirectory=\"$(IntermediateDirectory)\" "
- "PauseExecWhenProcTerminates=\"yes\"/>\n"
- " <Debugger IsRemote=\"no\" RemoteHostName=\"\" "
- "RemoteHostPort=\"\" DebuggerPath=\"\">\n"
- " <PostConnectCommands/>\n"
- " <StartupCommands/>\n"
- " </Debugger>\n"
- " <PreBuild/>\n"
- " <PostBuild/>\n"
- " <CustomBuild Enabled=\"yes\">\n"
- " <RebuildCommand>" << rebuildCommand << "</RebuildCommand>\n"
- " <CleanCommand>" << cleanCommand << "</CleanCommand>\n"
- " <BuildCommand>" << buildCommand << "</BuildCommand>\n"
- " <SingleFileCommand>" << singleFileCommand
- << "</SingleFileCommand>\n"
- " <PreprocessFileCommand/>\n"
- " <WorkingDirectory>$(WorkspacePath)</WorkingDirectory>\n"
- " </CustomBuild>\n"
- " <AdditionalRules>\n"
- " <CustomPostBuild/>\n"
- " <CustomPreBuild/>\n"
- " </AdditionalRules>\n"
- " </Configuration>\n"
- " <GlobalSettings>\n"
- " <Compiler Options=\"\">\n"
- " <IncludePath Value=\".\"/>\n"
- " </Compiler>\n"
- " <Linker Options=\"\">\n"
- " <LibraryPath Value=\".\"/>\n"
- " </Linker>\n"
- " <ResourceCompiler Options=\"\"/>\n"
- " </GlobalSettings>\n"
- " </Settings>\n"
- "</CodeLite_Project>\n";
+ xml.StartElement("Settings");
+ xml.Attribute("Type", projectType);
+
+ xml.StartElement("Configuration");
+ xml.Attribute("Name", this->ConfigName);
+ xml.Attribute("CompilerType", this->GetCodeLiteCompilerName(mf));
+ xml.Attribute("DebuggerType", "GNU gdb debugger");
+ xml.Attribute("Type", projectType);
+ xml.Attribute("BuildCmpWithGlobalSettings", "append");
+ xml.Attribute("BuildLnkWithGlobalSettings", "append");
+ xml.Attribute("BuildResWithGlobalSettings", "append");
+
+ xml.StartElement("Compiler");
+ xml.Attribute("Options", "-g");
+ xml.Attribute("Required", "yes");
+ xml.Attribute("PreCompiledHeader", "");
+ xml.StartElement("IncludePath");
+ xml.Attribute("Value", ".");
+ xml.EndElement(); // IncludePath
+ xml.EndElement(); // Compiler
+
+ xml.StartElement("Linker");
+ xml.Attribute("Options", "");
+ xml.Attribute("Required", "yes");
+ xml.EndElement(); // Linker
+
+ xml.StartElement("ResourceCompiler");
+ xml.Attribute("Options", "");
+ xml.Attribute("Required", "no");
+ xml.EndElement(); // ResourceCompiler
+
+ xml.StartElement("General");
+ xml.Attribute("OutputFile", "$(IntermediateDirectory)/$(ProjectName)");
+ xml.Attribute("IntermediateDirectory", "./");
+ xml.Attribute("Command", "./$(ProjectName)");
+ xml.Attribute("CommandArguments", "");
+ xml.Attribute("WorkingDirectory", "$(IntermediateDirectory)");
+ xml.Attribute("PauseExecWhenProcTerminates", "yes");
+ xml.EndElement(); // General
+
+ xml.StartElement("Debugger");
+ xml.Attribute("IsRemote", "no");
+ xml.Attribute("RemoteHostName", "");
+ xml.Attribute("RemoteHostPort", "");
+ xml.Attribute("DebuggerPath", "");
+ xml.Element("PostConnectCommands");
+ xml.Element("StartupCommands");
+ xml.EndElement(); // Debugger
+
+ xml.Element("PreBuild");
+ xml.Element("PostBuild");
+
+ xml.StartElement("CustomBuild");
+ xml.Attribute("Enabled", "yes");
+ xml.Element("RebuildCommand", GetRebuildCommand(mf));
+ xml.Element("CleanCommand", GetCleanCommand(mf));
+ xml.Element("BuildCommand", GetBuildCommand(mf));
+ xml.Element("SingleFileCommand", GetSingleFileBuildCommand(mf));
+ xml.Element("PreprocessFileCommand");
+ xml.Element("WorkingDirectory", "$(WorkspacePath)");
+ xml.EndElement(); // CustomBuild
+
+ xml.StartElement("AdditionalRules");
+ xml.Element("CustomPostBuild");
+ xml.Element("CustomPreBuild");
+ xml.EndElement(); // AdditionalRules
+
+ xml.EndElement(); // Configuration
+ xml.StartElement("GlobalSettings");
+
+ xml.StartElement("Compiler");
+ xml.Attribute("Options", "");
+ xml.StartElement("IncludePath");
+ xml.Attribute("Value", ".");
+ xml.EndElement(); // IncludePath
+ xml.EndElement(); // Compiler
+
+ xml.StartElement("Linker");
+ xml.Attribute("Options", "");
+ xml.StartElement("LibraryPath");
+ xml.Attribute("Value", ".");
+ xml.EndElement(); // LibraryPath
+ xml.EndElement(); // Linker
+
+ xml.StartElement("ResourceCompiler");
+ xml.Attribute("Options", "");
+ xml.EndElement(); // ResourceCompiler
+
+ xml.EndElement(); // GlobalSettings
+ xml.EndElement(); // Settings
+ xml.EndElement(); // CodeLite_Project
}
std::string
@@ -454,7 +510,7 @@ cmExtraCodeLiteGenerator::GetCleanCommand(const cmMakefile* mf) const
std::string
cmExtraCodeLiteGenerator::GetRebuildCommand(const cmMakefile* mf) const
{
- return GetCleanCommand(mf) + cmXMLSafe(" && ").str() + GetBuildCommand(mf);
+ return GetCleanCommand(mf) + " && " + GetBuildCommand(mf);
}
std::string
diff --git a/Source/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx
index 133a85a..f0227b0 100644
--- a/Source/cmExtraEclipseCDT4Generator.cxx
+++ b/Source/cmExtraEclipseCDT4Generator.cxx
@@ -19,11 +19,29 @@
#include "cmState.h"
#include "cmTarget.h"
#include "cmSourceFile.h"
+#include "cmXMLWriter.h"
#include "cmSystemTools.h"
#include <stdlib.h>
#include <assert.h>
+static void AppendAttribute(cmXMLWriter& xml, const char* keyval)
+{
+ xml.StartElement("attribute");
+ xml.Attribute("key", keyval);
+ xml.Attribute("value", keyval);
+ xml.EndElement();
+}
+
+template<typename T>
+void AppendDictionary(cmXMLWriter& xml, const char* key, T const& value)
+{
+ xml.StartElement("dictionary");
+ xml.Element("key", key);
+ xml.Element("value", value);
+ xml.EndElement();
+}
+
//----------------------------------------------------------------------------
cmExtraEclipseCDT4Generator
::cmExtraEclipseCDT4Generator() : cmExternalMakefileProjectGenerator()
@@ -172,34 +190,30 @@ void cmExtraEclipseCDT4Generator::CreateSourceProjectFile()
return;
}
- fout <<
- "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
- "<projectDescription>\n"
- "\t<name>" << this->EscapeForXML(name) << "</name>\n"
- "\t<comment></comment>\n"
- "\t<projects>\n"
- "\t</projects>\n"
- "\t<buildSpec>\n"
- "\t</buildSpec>\n"
- "\t<natures>\n"
- "\t</natures>\n"
- "\t<linkedResources>\n";
+ cmXMLWriter xml(fout);
+ xml.StartDocument("UTF-8");
+ xml.StartElement("projectDescription");
+ xml.Element("name", name);
+ xml.Element("comment", "");
+ xml.Element("projects", "");
+ xml.Element("buildSpec", "");
+ xml.Element("natures", "");
+ xml.StartElement("linkedResources");
if (this->SupportsVirtualFolders)
{
- this->CreateLinksToSubprojects(fout, this->HomeDirectory);
+ this->CreateLinksToSubprojects(xml, this->HomeDirectory);
this->SrcLinkedResources.clear();
}
- fout <<
- "\t</linkedResources>\n"
- "</projectDescription>\n"
- ;
+ xml.EndElement(); // linkedResources
+ xml.EndElement(); // projectDescription
+ xml.EndDocument();
}
//----------------------------------------------------------------------------
-void cmExtraEclipseCDT4Generator::AddEnvVar(cmGeneratedFileStream& fout,
+void cmExtraEclipseCDT4Generator::AddEnvVar(std::ostream& out,
const char* envVar,
cmLocalGenerator* lg)
{
@@ -257,7 +271,7 @@ void cmExtraEclipseCDT4Generator::AddEnvVar(cmGeneratedFileStream& fout,
if (!valueToUse.empty())
{
- fout << envVar << "=" << valueToUse << "|";
+ out << envVar << "=" << valueToUse << "|";
}
}
@@ -282,197 +296,125 @@ void cmExtraEclipseCDT4Generator::CreateProjectFile()
compilerId = mf->GetSafeDefinition("CMAKE_CXX_COMPILER_ID");
}
- fout <<
- "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
- "<projectDescription>\n"
- "\t<name>" <<
- this->GenerateProjectName(lg->GetProjectName(),
- mf->GetSafeDefinition("CMAKE_BUILD_TYPE"),
- this->GetPathBasename(this->HomeOutputDirectory))
- << "</name>\n"
- "\t<comment></comment>\n"
- "\t<projects>\n"
- "\t</projects>\n"
- "\t<buildSpec>\n"
- "\t\t<buildCommand>\n"
- "\t\t\t<name>org.eclipse.cdt.make.core.makeBuilder</name>\n"
- "\t\t\t<triggers>clean,full,incremental,</triggers>\n"
- "\t\t\t<arguments>\n"
- ;
+ cmXMLWriter xml(fout);
+
+ xml.StartDocument("UTF-8");
+ xml.StartElement("projectDescription");
+
+ xml.Element("name", this->GenerateProjectName(lg->GetProjectName(),
+ mf->GetSafeDefinition("CMAKE_BUILD_TYPE"),
+ this->GetPathBasename(this->HomeOutputDirectory)));
+
+ xml.Element("comment", "");
+ xml.Element("projects", "");
+
+ xml.StartElement("buildSpec");
+ xml.StartElement("buildCommand");
+ xml.Element("name", "org.eclipse.cdt.make.core.makeBuilder");
+ xml.Element("triggers", "clean,full,incremental,");
+ xml.StartElement("arguments");
// use clean target
- fout <<
- "\t\t\t\t<dictionary>\n"
- "\t\t\t\t\t<key>org.eclipse.cdt.make.core.cleanBuildTarget</key>\n"
- "\t\t\t\t\t<value>clean</value>\n"
- "\t\t\t\t</dictionary>\n"
- "\t\t\t\t<dictionary>\n"
- "\t\t\t\t\t<key>org.eclipse.cdt.make.core.enableCleanBuild</key>\n"
- "\t\t\t\t\t<value>true</value>\n"
- "\t\t\t\t</dictionary>\n"
- "\t\t\t\t<dictionary>\n"
- "\t\t\t\t\t<key>org.eclipse.cdt.make.core.append_environment</key>\n"
- "\t\t\t\t\t<value>true</value>\n"
- "\t\t\t\t</dictionary>\n"
- "\t\t\t\t<dictionary>\n"
- "\t\t\t\t\t<key>org.eclipse.cdt.make.core.stopOnError</key>\n"
- "\t\t\t\t\t<value>true</value>\n"
- "\t\t\t\t</dictionary>\n"
- ;
+ AppendDictionary(xml, "org.eclipse.cdt.make.core.cleanBuildTarget", "clean");
+ AppendDictionary(xml, "org.eclipse.cdt.make.core.enableCleanBuild", "true");
+ AppendDictionary(xml, "org.eclipse.cdt.make.core.append_environment","true");
+ AppendDictionary(xml, "org.eclipse.cdt.make.core.stopOnError", "true");
// set the make command
- std::string make = mf->GetRequiredDefinition("CMAKE_MAKE_PROGRAM");
- const std::string makeArgs = mf->GetSafeDefinition(
- "CMAKE_ECLIPSE_MAKE_ARGUMENTS");
-
- fout <<
- "\t\t\t\t<dictionary>\n"
- "\t\t\t\t\t<key>org.eclipse.cdt.make.core.enabledIncrementalBuild</key>\n"
- "\t\t\t\t\t<value>true</value>\n"
- "\t\t\t\t</dictionary>\n"
- "\t\t\t\t<dictionary>\n"
- "\t\t\t\t\t<key>org.eclipse.cdt.make.core.build.command</key>\n"
- "\t\t\t\t\t<value>" << this->GetEclipsePath(make) << "</value>\n"
- "\t\t\t\t</dictionary>\n"
- "\t\t\t\t<dictionary>\n"
- "\t\t\t\t\t<key>org.eclipse.cdt.make.core.contents</key>\n"
- "\t\t\t\t\t<value>org.eclipse.cdt.make.core.activeConfigSettings</value>\n"
- "\t\t\t\t</dictionary>\n"
- "\t\t\t\t<dictionary>\n"
- "\t\t\t\t\t<key>org.eclipse.cdt.make.core.build.target.inc</key>\n"
- "\t\t\t\t\t<value>all</value>\n"
- "\t\t\t\t</dictionary>\n"
- "\t\t\t\t<dictionary>\n"
- "\t\t\t\t\t<key>org.eclipse.cdt.make.core.build.arguments</key>\n"
- "\t\t\t\t\t<value>" << makeArgs << "</value>\n"
- "\t\t\t\t</dictionary>\n"
- "\t\t\t\t<dictionary>\n"
- "\t\t\t\t\t<key>org.eclipse.cdt.make.core.buildLocation</key>\n"
- "\t\t\t\t\t<value>"
- << this->GetEclipsePath(this->HomeOutputDirectory) << "</value>\n"
- "\t\t\t\t</dictionary>\n"
- "\t\t\t\t<dictionary>\n"
- "\t\t\t\t\t<key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>\n"
- "\t\t\t\t\t<value>false</value>\n"
- "\t\t\t\t</dictionary>\n"
- ;
+ AppendDictionary(xml, "org.eclipse.cdt.make.core.enabledIncrementalBuild",
+ "true");
+ AppendDictionary(xml, "org.eclipse.cdt.make.core.build.command",
+ this->GetEclipsePath(mf->GetRequiredDefinition("CMAKE_MAKE_PROGRAM")));
+ AppendDictionary(xml, "org.eclipse.cdt.make.core.contents",
+ "org.eclipse.cdt.make.core.activeConfigSettings");
+ AppendDictionary(xml, "org.eclipse.cdt.make.core.build.target.inc", "all");
+ AppendDictionary(xml, "org.eclipse.cdt.make.core.build.arguments",
+ mf->GetSafeDefinition("CMAKE_ECLIPSE_MAKE_ARGUMENTS"));
+ AppendDictionary(xml, "org.eclipse.cdt.make.core.buildLocation",
+ this->GetEclipsePath(this->HomeOutputDirectory));
+ AppendDictionary(xml,
+ "org.eclipse.cdt.make.core.useDefaultBuildCmd", "false");
// set project specific environment
- fout <<
- "\t\t\t\t<dictionary>\n"
- "\t\t\t\t\t<key>org.eclipse.cdt.make.core.environment</key>\n"
- "\t\t\t\t\t<value>VERBOSE=1|CMAKE_NO_VERBOSE=1|" //verbose Makefile output
- ;
+ std::stringstream environment;
+ environment << "VERBOSE=1|CMAKE_NO_VERBOSE=1|"; //verbose Makefile output
// set vsvars32.bat environment available at CMake time,
// but not necessarily when eclipse is open
if (compilerId == "MSVC")
{
- AddEnvVar(fout, "PATH", lg);
- AddEnvVar(fout, "INCLUDE", lg);
- AddEnvVar(fout, "LIB", lg);
- AddEnvVar(fout, "LIBPATH", lg);
+ AddEnvVar(environment, "PATH", lg);
+ AddEnvVar(environment, "INCLUDE", lg);
+ AddEnvVar(environment, "LIB", lg);
+ AddEnvVar(environment, "LIBPATH", lg);
}
else if (compilerId == "Intel")
{
// if the env.var is set, use this one and put it in the cache
// if the env.var is not set, but the value is in the cache,
// use it from the cache:
- AddEnvVar(fout, "INTEL_LICENSE_FILE", lg);
+ AddEnvVar(environment, "INTEL_LICENSE_FILE", lg);
}
- fout <<
- "</value>\n"
- "\t\t\t\t</dictionary>\n"
- ;
-
- fout <<
- "\t\t\t\t<dictionary>\n"
- "\t\t\t\t\t<key>org.eclipse.cdt.make.core.enableFullBuild</key>\n"
- "\t\t\t\t\t<value>true</value>\n"
- "\t\t\t\t</dictionary>\n"
- "\t\t\t\t<dictionary>\n"
- "\t\t\t\t\t<key>org.eclipse.cdt.make.core.build.target.auto</key>\n"
- "\t\t\t\t\t<value>all</value>\n"
- "\t\t\t\t</dictionary>\n"
- "\t\t\t\t<dictionary>\n"
- "\t\t\t\t\t<key>org.eclipse.cdt.make.core.enableAutoBuild</key>\n"
- "\t\t\t\t\t<value>false</value>\n"
- "\t\t\t\t</dictionary>\n"
- "\t\t\t\t<dictionary>\n"
- "\t\t\t\t\t<key>org.eclipse.cdt.make.core.build.target.clean</key>\n"
- "\t\t\t\t\t<value>clean</value>\n"
- "\t\t\t\t</dictionary>\n"
- "\t\t\t\t<dictionary>\n"
- "\t\t\t\t\t<key>org.eclipse.cdt.make.core.fullBuildTarget</key>\n"
- "\t\t\t\t\t<value>all</value>\n"
- "\t\t\t\t</dictionary>\n"
- "\t\t\t\t<dictionary>\n"
- "\t\t\t\t\t<key>org.eclipse.cdt.make.core.buildArguments</key>\n"
- "\t\t\t\t\t<value></value>\n"
- "\t\t\t\t</dictionary>\n"
- "\t\t\t\t<dictionary>\n"
- "\t\t\t\t\t<key>org.eclipse.cdt.make.core.build.location</key>\n"
- "\t\t\t\t\t<value>"
- << this->GetEclipsePath(this->HomeOutputDirectory) << "</value>\n"
- "\t\t\t\t</dictionary>\n"
- "\t\t\t\t<dictionary>\n"
- "\t\t\t\t\t<key>org.eclipse.cdt.make.core.autoBuildTarget</key>\n"
- "\t\t\t\t\t<value>all</value>\n"
- "\t\t\t\t</dictionary>\n"
- ;
+ AppendDictionary(xml, "org.eclipse.cdt.make.core.environment",
+ environment.str());
+
+ AppendDictionary(xml, "org.eclipse.cdt.make.core.enableFullBuild", "true");
+ AppendDictionary(xml, "org.eclipse.cdt.make.core.build.target.auto", "all");
+ AppendDictionary(xml, "org.eclipse.cdt.make.core.enableAutoBuild", "false");
+ AppendDictionary(xml, "org.eclipse.cdt.make.core.build.target.clean",
+ "clean");
+ AppendDictionary(xml, "org.eclipse.cdt.make.core.fullBuildTarget", "all");
+ AppendDictionary(xml, "org.eclipse.cdt.make.core.buildArguments", "");
+ AppendDictionary(xml, "org.eclipse.cdt.make.core.build.location",
+ this->GetEclipsePath(this->HomeOutputDirectory));
+ AppendDictionary(xml, "org.eclipse.cdt.make.core.autoBuildTarget", "all");
// set error parsers
- fout <<
- "\t\t\t\t<dictionary>\n"
- "\t\t\t\t\t<key>org.eclipse.cdt.core.errorOutputParser</key>\n"
- "\t\t\t\t\t<value>"
- ;
+ std::stringstream errorOutputParser;
+
if (compilerId == "MSVC")
{
- fout << "org.eclipse.cdt.core.VCErrorParser;";
+ errorOutputParser << "org.eclipse.cdt.core.VCErrorParser;";
}
else if (compilerId == "Intel")
{
- fout << "org.eclipse.cdt.core.ICCErrorParser;";
+ errorOutputParser << "org.eclipse.cdt.core.ICCErrorParser;";
}
if (this->SupportsGmakeErrorParser)
{
- fout << "org.eclipse.cdt.core.GmakeErrorParser;";
+ errorOutputParser << "org.eclipse.cdt.core.GmakeErrorParser;";
}
else
{
- fout << "org.eclipse.cdt.core.MakeErrorParser;";
+ errorOutputParser << "org.eclipse.cdt.core.MakeErrorParser;";
}
- fout <<
+ errorOutputParser <<
"org.eclipse.cdt.core.GCCErrorParser;"
"org.eclipse.cdt.core.GASErrorParser;"
"org.eclipse.cdt.core.GLDErrorParser;"
- "</value>\n"
- "\t\t\t\t</dictionary>\n"
- ;
-
- fout <<
- "\t\t\t</arguments>\n"
- "\t\t</buildCommand>\n"
- "\t\t<buildCommand>\n"
- "\t\t\t<name>org.eclipse.cdt.make.core.ScannerConfigBuilder</name>\n"
- "\t\t\t<arguments>\n"
- "\t\t\t</arguments>\n"
- "\t\t</buildCommand>\n"
- "\t</buildSpec>\n"
;
+ AppendDictionary(xml, "org.eclipse.cdt.core.errorOutputParser",
+ errorOutputParser.str());
+
+ xml.EndElement(); // arguments
+ xml.EndElement(); // buildCommand
+ xml.StartElement("buildCommand");
+ xml.Element("name", "org.eclipse.cdt.make.core.ScannerConfigBuilder");
+ xml.StartElement("arguments");
+ xml.EndElement(); // arguments
+ xml.EndElement(); // buildCommand
+ xml.EndElement(); // buildSpec
// set natures for c/c++ projects
- fout <<
- "\t<natures>\n"
- "\t\t<nature>org.eclipse.cdt.make.core.makeNature</nature>\n"
- "\t\t<nature>org.eclipse.cdt.make.core.ScannerConfigNature</nature>\n";
+ xml.StartElement("natures");
+ xml.Element("nature", "org.eclipse.cdt.make.core.makeNature");
+ xml.Element("nature", "org.eclipse.cdt.make.core.ScannerConfigNature");;
for (std::set<std::string>::const_iterator nit=this->Natures.begin();
nit != this->Natures.end(); ++nit)
{
- fout << "\t\t<nature>" << *nit << "</nature>\n";
+ xml.Element("nature", *nit);
}
if (const char *extraNaturesProp = mf->GetState()
@@ -483,13 +425,13 @@ void cmExtraEclipseCDT4Generator::CreateProjectFile()
for (std::vector<std::string>::const_iterator nit = extraNatures.begin();
nit != extraNatures.end(); ++nit)
{
- fout << "\t\t<nature>" << *nit << "</nature>\n";
+ xml.Element("nature", *nit);
}
}
- fout << "\t</natures>\n";
+ xml.EndElement(); // natures
- fout << "\t<linkedResources>\n";
+ xml.StartElement("linkedResources");
// create linked resources
if (this->IsOutOfSourceBuild)
{
@@ -506,7 +448,7 @@ void cmExtraEclipseCDT4Generator::CreateProjectFile()
if (!cmSystemTools::IsSubDirectory(this->HomeOutputDirectory,
linkSourceDirectory))
{
- this->AppendLinkedResource(fout, sourceLinkedResourceName,
+ this->AppendLinkedResource(xml, sourceLinkedResourceName,
this->GetEclipsePath(linkSourceDirectory),
LinkToFolder);
this->SrcLinkedResources.push_back(sourceLinkedResourceName);
@@ -516,23 +458,21 @@ void cmExtraEclipseCDT4Generator::CreateProjectFile()
if (this->SupportsVirtualFolders)
{
- this->CreateLinksToSubprojects(fout, this->HomeOutputDirectory);
+ this->CreateLinksToSubprojects(xml, this->HomeOutputDirectory);
- this->CreateLinksForTargets(fout);
+ this->CreateLinksForTargets(xml);
}
- fout << "\t</linkedResources>\n";
-
- fout << "</projectDescription>\n";
+ xml.EndElement(); // linkedResources
+ xml.EndElement(); // projectDescription
}
//----------------------------------------------------------------------------
-void cmExtraEclipseCDT4Generator::CreateLinksForTargets(
- cmGeneratedFileStream& fout)
+void cmExtraEclipseCDT4Generator::CreateLinksForTargets(cmXMLWriter& xml)
{
std::string linkName = "[Targets]";
- this->AppendLinkedResource(fout, linkName, "virtual:/virtual",VirtualFolder);
+ this->AppendLinkedResource(xml, linkName, "virtual:/virtual", VirtualFolder);
for (std::vector<cmLocalGenerator*>::const_iterator
lgIt = this->GlobalGenerator->GetLocalGenerators().begin();
@@ -560,7 +500,7 @@ void cmExtraEclipseCDT4Generator::CreateLinksForTargets(
"[exe] " : "[lib] ");
linkName2 += prefix;
linkName2 += (*ti)->GetName();
- this->AppendLinkedResource(fout, linkName2, "virtual:/virtual",
+ this->AppendLinkedResource(xml, linkName2, "virtual:/virtual",
VirtualFolder);
if (!this->GenerateLinkedResources)
{
@@ -590,7 +530,7 @@ void cmExtraEclipseCDT4Generator::CreateLinksForTargets(
std::string linkName3 = linkName2;
linkName3 += "/";
linkName3 += sgIt->GetFullName();
- this->AppendLinkedResource(fout, linkName3, "virtual:/virtual",
+ this->AppendLinkedResource(xml, linkName3, "virtual:/virtual",
VirtualFolder);
std::vector<const cmSourceFile*> sFiles = sgIt->GetSourceFiles();
@@ -605,7 +545,7 @@ void cmExtraEclipseCDT4Generator::CreateLinksForTargets(
std::string linkName4 = linkName3;
linkName4 += "/";
linkName4 += cmSystemTools::GetFilenameName(fullPath);
- this->AppendLinkedResource(fout, linkName4,
+ this->AppendLinkedResource(xml, linkName4,
this->GetEclipsePath(fullPath),
LinkToFile);
}
@@ -624,7 +564,7 @@ void cmExtraEclipseCDT4Generator::CreateLinksForTargets(
//----------------------------------------------------------------------------
void cmExtraEclipseCDT4Generator::CreateLinksToSubprojects(
- cmGeneratedFileStream& fout, const std::string& baseDir)
+ cmXMLWriter& xml, const std::string& baseDir)
{
if (!this->GenerateLinkedResources)
{
@@ -633,7 +573,7 @@ void cmExtraEclipseCDT4Generator::CreateLinksToSubprojects(
// for each sub project create a linked resource to the source dir
// - only if it is an out-of-source build
- this->AppendLinkedResource(fout, "[Subprojects]",
+ this->AppendLinkedResource(xml, "[Subprojects]",
"virtual:/virtual", VirtualFolder);
for (std::map<std::string, std::vector<cmLocalGenerator*> >::const_iterator
@@ -651,7 +591,7 @@ void cmExtraEclipseCDT4Generator::CreateLinksToSubprojects(
{
std::string linkName = "[Subprojects]/";
linkName += it->first;
- this->AppendLinkedResource(fout, linkName,
+ this->AppendLinkedResource(xml, linkName,
this->GetEclipsePath(linkSourceDirectory),
LinkToFolder
);
@@ -664,7 +604,7 @@ void cmExtraEclipseCDT4Generator::CreateLinksToSubprojects(
//----------------------------------------------------------------------------
void cmExtraEclipseCDT4Generator::AppendIncludeDirectories(
- cmGeneratedFileStream& fout,
+ cmXMLWriter& xml,
const std::vector<std::string>& includeDirs,
std::set<std::string>& emittedDirs)
{
@@ -688,10 +628,13 @@ void cmExtraEclipseCDT4Generator::AppendIncludeDirectories(
if(emittedDirs.find(dir) == emittedDirs.end())
{
emittedDirs.insert(dir);
- fout << "<pathentry include=\""
- << cmExtraEclipseCDT4Generator::EscapeForXML(
- cmExtraEclipseCDT4Generator::GetEclipsePath(dir))
- << "\" kind=\"inc\" path=\"\" system=\"true\"/>\n";
+ xml.StartElement("pathentry");
+ xml.Attribute("include",
+ cmExtraEclipseCDT4Generator::GetEclipsePath(dir));
+ xml.Attribute("kind", "inc");
+ xml.Attribute("path", "");
+ xml.Attribute("system", "true");
+ xml.EndElement();
}
}
}
@@ -713,95 +656,100 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const
return;
}
+ cmXMLWriter xml(fout);
+
// add header
- fout <<
- "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n"
- "<?fileVersion 4.0.0?>\n\n"
- "<cproject>\n"
- "<storageModule moduleId=\"org.eclipse.cdt.core.settings\">\n"
- ;
+ xml.StartDocument("UTF-8");
+ xml.ProcessingInstruction("fileVersion", "4.0.0");
+ xml.StartElement("cproject");
+ xml.StartElement("storageModule");
+ xml.Attribute("moduleId", "org.eclipse.cdt.core.settings");
- fout << "<cconfiguration id=\"org.eclipse.cdt.core.default.config.1\">\n";
+ xml.StartElement("cconfiguration");
+ xml.Attribute("id", "org.eclipse.cdt.core.default.config.1");
// Configuration settings...
- fout <<
- "<storageModule"
- " buildSystemId=\"org.eclipse.cdt.core.defaultConfigDataProvider\""
- " id=\"org.eclipse.cdt.core.default.config.1\""
- " moduleId=\"org.eclipse.cdt.core.settings\" name=\"Configuration\">\n"
- "<externalSettings/>\n"
- "<extensions>\n"
- ;
+ xml.StartElement("storageModule");
+ xml.Attribute("buildSystemId",
+ "org.eclipse.cdt.core.defaultConfigDataProvider");
+ xml.Attribute("id", "org.eclipse.cdt.core.default.config.1");
+ xml.Attribute("moduleId", "org.eclipse.cdt.core.settings");
+ xml.Attribute("name", "Configuration");
+ xml.Element("externalSettings");
+ xml.StartElement("extensions");
+
// TODO: refactor this out...
std::string executableFormat = mf->GetSafeDefinition(
"CMAKE_EXECUTABLE_FORMAT");
if (executableFormat == "ELF")
{
- fout << "<extension id=\"org.eclipse.cdt.core.ELF\""
- " point=\"org.eclipse.cdt.core.BinaryParser\"/>\n"
- ;
- fout << "<extension id=\"org.eclipse.cdt.core.GNU_ELF\""
- " point=\"org.eclipse.cdt.core.BinaryParser\">\n"
- "<attribute key=\"addr2line\" value=\"addr2line\"/>\n"
- "<attribute key=\"c++filt\" value=\"c++filt\"/>\n"
- "</extension>\n"
- ;
+ xml.StartElement("extension");
+ xml.Attribute("id", "org.eclipse.cdt.core.ELF");
+ xml.Attribute("point", "org.eclipse.cdt.core.BinaryParser");
+ xml.EndElement(); // extension
+
+ xml.StartElement("extension");
+ xml.Attribute("id", "org.eclipse.cdt.core.GNU_ELF");
+ xml.Attribute("point", "org.eclipse.cdt.core.BinaryParser");
+ AppendAttribute(xml, "addr2line");
+ AppendAttribute(xml, "c++filt");
+ xml.EndElement(); // extension
}
else
{
std::string systemName = mf->GetSafeDefinition("CMAKE_SYSTEM_NAME");
if (systemName == "CYGWIN")
{
- fout << "<extension id=\"org.eclipse.cdt.core.Cygwin_PE\""
- " point=\"org.eclipse.cdt.core.BinaryParser\">\n"
- "<attribute key=\"addr2line\" value=\"addr2line\"/>\n"
- "<attribute key=\"c++filt\" value=\"c++filt\"/>\n"
- "<attribute key=\"cygpath\" value=\"cygpath\"/>\n"
- "<attribute key=\"nm\" value=\"nm\"/>\n"
- "</extension>\n"
- ;
+ xml.StartElement("extension");
+ xml.Attribute("id", "org.eclipse.cdt.core.Cygwin_PE");
+ xml.Attribute("point", "org.eclipse.cdt.core.BinaryParser");
+ AppendAttribute(xml, "addr2line");
+ AppendAttribute(xml, "c++filt");
+ AppendAttribute(xml, "cygpath");
+ AppendAttribute(xml, "nm");
+ xml.EndElement(); // extension
}
else if (systemName == "Windows")
{
- fout << "<extension id=\"org.eclipse.cdt.core.PE\""
- " point=\"org.eclipse.cdt.core.BinaryParser\"/>\n"
- ;
+ xml.StartElement("extension");
+ xml.Attribute("id", "org.eclipse.cdt.core.PE");
+ xml.Attribute("point", "org.eclipse.cdt.core.BinaryParser");
+ xml.EndElement(); // extension
}
else if (systemName == "Darwin")
{
- fout << "<extension id=\"" <<
- (this->SupportsMachO64Parser ? "org.eclipse.cdt.core.MachO64"
- : "org.eclipse.cdt.core.MachO") << "\""
- " point=\"org.eclipse.cdt.core.BinaryParser\">\n"
- "<attribute key=\"c++filt\" value=\"c++filt\"/>\n"
- "</extension>\n"
- ;
+ xml.StartElement("extension");
+ xml.Attribute("id", this->SupportsMachO64Parser ?
+ "org.eclipse.cdt.core.MachO64" : "org.eclipse.cdt.core.MachO");
+ xml.Attribute("point", "org.eclipse.cdt.core.BinaryParser");
+ AppendAttribute(xml, "c++filt");
+ xml.EndElement(); // extension
}
else
{
// *** Should never get here ***
- fout << "<error_toolchain_type/>\n";
+ xml.Element("error_toolchain_type");
}
}
- fout << "</extensions>\n"
- "</storageModule>\n"
- ;
+ xml.EndElement(); // extensions
+ xml.EndElement(); // storageModule
// ???
- fout <<
- "<storageModule moduleId=\"org.eclipse.cdt.core.language.mapping\">\n"
- "<project-mappings/>\n"
- "</storageModule>\n"
- ;
+ xml.StartElement("storageModule");
+ xml.Attribute("moduleId", "org.eclipse.cdt.core.language.mapping");
+ xml.Element("project-mappings");
+ xml.EndElement(); // storageModule
// ???
- fout<<"<storageModule moduleId=\"org.eclipse.cdt.core.externalSettings\"/>\n"
- ;
+ xml.StartElement("storageModule");
+ xml.Attribute("moduleId", "org.eclipse.cdt.core.externalSettings");
+ xml.EndElement(); // storageModule
// set the path entries (includes, libs, source dirs, etc.)
- fout << "<storageModule moduleId=\"org.eclipse.cdt.core.pathentry\">\n"
- ;
+ xml.StartElement("storageModule");
+ xml.Attribute("moduleId", "org.eclipse.cdt.core.pathentry");
+
// for each sub project with a linked resource to the source dir:
// - make it type 'src'
// - and exclude it from type 'out'
@@ -824,21 +772,27 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const
it != this->SrcLinkedResources.end();
++it)
{
- fout << "<pathentry kind=\"src\" path=\"" << this->EscapeForXML(*it)
- << "\"/>\n";
+ xml.StartElement("pathentry");
+ xml.Attribute("kind", "src");
+ xml.Attribute("path", *it);
+ xml.EndElement();
// exlude source directory from output search path
// - only if not named the same as an output directory
if (!cmSystemTools::FileIsDirectory(
std::string(this->HomeOutputDirectory + "/" + *it)))
{
- excludeFromOut += this->EscapeForXML(*it) + "/|";
+ excludeFromOut += *it + "/|";
}
}
excludeFromOut += "**/CMakeFiles/";
- fout << "<pathentry excluding=\"" << excludeFromOut
- << "\" kind=\"out\" path=\"\"/>\n";
+
+ xml.StartElement("pathentry");
+ xml.Attribute("excluding", excludeFromOut);
+ xml.Attribute("kind", "out");
+ xml.Attribute("path", "");
+ xml.EndElement();
// add pre-processor definitions to allow eclipse to gray out sections
emmited.clear();
@@ -884,9 +838,12 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const
if(emmited.find(def) == emmited.end())
{
emmited.insert(def);
- fout << "<pathentry kind=\"mac\" name=\"" << def
- << "\" path=\"\" value=\"" << this->EscapeForXML(val)
- << "\"/>\n";
+ xml.StartElement("pathentry");
+ xml.Attribute("kind", "mac");
+ xml.Attribute("name", def);
+ xml.Attribute("path", "");
+ xml.Attribute("value", val);
+ xml.EndElement();
}
}
}
@@ -919,9 +876,12 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const
if(emmited.find(def) == emmited.end())
{
emmited.insert(def);
- fout << "<pathentry kind=\"mac\" name=\"" << def
- << "\" path=\"\" value=\"" << this->EscapeForXML(val)
- << "\"/>\n";
+ xml.StartElement("pathentry");
+ xml.Attribute("kind", "mac");
+ xml.Attribute("name", def);
+ xml.Attribute("path", "");
+ xml.Attribute("value", val);
+ xml.EndElement();
}
}
}
@@ -954,9 +914,12 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const
if(emmited.find(def) == emmited.end())
{
emmited.insert(def);
- fout << "<pathentry kind=\"mac\" name=\"" << def
- << "\" path=\"\" value=\"" << this->EscapeForXML(val)
- << "\"/>\n";
+ xml.StartElement("pathentry");
+ xml.Attribute("kind", "mac");
+ xml.Attribute("name", def);
+ xml.Attribute("path", "");
+ xml.Attribute("value", val);
+ xml.EndElement();
}
}
}
@@ -976,7 +939,7 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const
std::vector<std::string> includeDirs;
std::string config = mf->GetSafeDefinition("CMAKE_BUILD_TYPE");
(*it)->GetIncludeDirectories(includeDirs, *l, "C", config);
- this->AppendIncludeDirectories(fout, includeDirs, emmited);
+ this->AppendIncludeDirectories(xml, includeDirs, emmited);
}
}
// now also the system include directories, in case we found them in
@@ -989,7 +952,7 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const
"CMAKE_EXTRA_GENERATOR_C_SYSTEM_INCLUDE_DIRS");
std::vector<std::string> dirs;
cmSystemTools::ExpandListArgument(systemIncludeDirs, dirs);
- this->AppendIncludeDirectories(fout, dirs, emmited);
+ this->AppendIncludeDirectories(xml, dirs, emmited);
}
compiler = mf->GetSafeDefinition("CMAKE_CXX_COMPILER");
if (this->CXXEnabled && !compiler.empty())
@@ -998,16 +961,15 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const
"CMAKE_EXTRA_GENERATOR_CXX_SYSTEM_INCLUDE_DIRS");
std::vector<std::string> dirs;
cmSystemTools::ExpandListArgument(systemIncludeDirs, dirs);
- this->AppendIncludeDirectories(fout, dirs, emmited);
+ this->AppendIncludeDirectories(xml, dirs, emmited);
}
- fout << "</storageModule>\n";
+ xml.EndElement(); // storageModule
// add build targets
- fout <<
- "<storageModule moduleId=\"org.eclipse.cdt.make.core.buildtargets\">\n"
- "<buildTargets>\n"
- ;
+ xml.StartElement("storageModule");
+ xml.Attribute("moduleId", "org.eclipse.cdt.make.core.buildtargets");
+ xml.StartElement("buildTargets");
emmited.clear();
const std::string make = mf->GetRequiredDefinition("CMAKE_MAKE_PROGRAM");
const std::string makeArgs = mf->GetSafeDefinition(
@@ -1055,7 +1017,7 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const
// not from the subdirs
if (subdir.empty())
{
- this->AppendTarget(fout, targetName, make, makeArgs, subdir, ": ");
+ this->AppendTarget(xml, targetName, make, makeArgs, subdir, ": ");
}
}
break;
@@ -1070,7 +1032,7 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const
break;
}
- this->AppendTarget(fout, targetName, make, makeArgs, subdir, ": ");
+ this->AppendTarget(xml, targetName, make, makeArgs, subdir, ": ");
break;
case cmState::EXECUTABLE:
case cmState::STATIC_LIBRARY:
@@ -1080,10 +1042,10 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const
{
const char* prefix = ((*ti)->GetType()==cmState::EXECUTABLE ?
"[exe] " : "[lib] ");
- this->AppendTarget(fout, targetName, make, makeArgs, subdir, prefix);
+ this->AppendTarget(xml, targetName, make, makeArgs, subdir, prefix);
std::string fastTarget = targetName;
fastTarget += "/fast";
- this->AppendTarget(fout, fastTarget, make, makeArgs, subdir, prefix);
+ this->AppendTarget(xml, fastTarget, make, makeArgs, subdir, prefix);
// Add Build and Clean targets in the virtual folder of targets:
if (this->SupportsVirtualFolders)
@@ -1095,7 +1057,7 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const
buildArgs += (*it)->GetBinaryDirectory();
buildArgs += "\" ";
buildArgs += makeArgs;
- this->AppendTarget(fout, "Build", make, buildArgs, virtDir, "",
+ this->AppendTarget(xml, "Build", make, buildArgs, virtDir, "",
targetName.c_str());
std::string cleanArgs = "-E chdir \"";
@@ -1106,7 +1068,7 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const
cmGeneratorTarget* gt = *ti;
cleanArgs += (*it)->GetTargetDirectory(gt);
cleanArgs += "/cmake_clean.cmake\"";
- this->AppendTarget(fout, "Clean", cmSystemTools::GetCMakeCommand(),
+ this->AppendTarget(xml, "Clean", cmSystemTools::GetCMakeCommand(),
cleanArgs, virtDir, "", "");
}
}
@@ -1119,11 +1081,11 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const
// insert the all and clean targets in every subdir
if (!allTarget.empty())
{
- this->AppendTarget(fout, allTarget, make, makeArgs, subdir, ": ");
+ this->AppendTarget(xml, allTarget, make, makeArgs, subdir, ": ");
}
if (!cleanTarget.empty())
{
- this->AppendTarget(fout, cleanTarget, make, makeArgs, subdir, ": ");
+ this->AppendTarget(xml, cleanTarget, make, makeArgs, subdir, ": ");
}
//insert rules for compiling, preprocessing and assembling individual files
@@ -1142,25 +1104,29 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const
{
prefix = "[pre] ";
}
- this->AppendTarget(fout, *fit, make, makeArgs, subdir, prefix);
+ this->AppendTarget(xml, *fit, make, makeArgs, subdir, prefix);
}
}
- fout << "</buildTargets>\n"
- "</storageModule>\n"
- ;
-
- this->AppendStorageScanners(fout, *mf);
-
- fout << "</cconfiguration>\n"
- "</storageModule>\n"
- "<storageModule moduleId=\"cdtBuildSystem\" version=\"4.0.0\">\n"
- "<project id=\"" << this->EscapeForXML(lg->GetProjectName())
- << ".null.1\" name=\"" << this->EscapeForXML(lg->GetProjectName())
- << "\"/>\n"
- "</storageModule>\n"
- "</cproject>\n"
- ;
+ xml.EndElement(); // buildTargets
+ xml.EndElement(); // storageModule
+
+ this->AppendStorageScanners(xml, *mf);
+
+ xml.EndElement(); // cconfiguration
+ xml.EndElement(); // storageModule
+
+ xml.StartElement("storageModule");
+ xml.Attribute("moduleId", "cdtBuildSystem");
+ xml.Attribute("version", "4.0.0");
+
+ xml.StartElement("project");
+ xml.Attribute("id", std::string(lg->GetProjectName()) + ".null.1");
+ xml.Attribute("name", lg->GetProjectName());
+ xml.EndElement(); // project
+
+ xml.EndElement(); // storageModule
+ xml.EndElement(); // cproject
}
//----------------------------------------------------------------------------
@@ -1208,28 +1174,14 @@ cmExtraEclipseCDT4Generator::GenerateProjectName(const std::string& name,
const std::string& type,
const std::string& path)
{
- return cmExtraEclipseCDT4Generator::EscapeForXML(name)
- +(type.empty() ? "" : "-") + type + "@" + path;
-}
-
-std::string cmExtraEclipseCDT4Generator::EscapeForXML(const std::string& value)
-{
- std::string str = value;
- cmSystemTools::ReplaceString(str, "&", "&amp;");
- cmSystemTools::ReplaceString(str, "<", "&lt;");
- cmSystemTools::ReplaceString(str, ">", "&gt;");
- cmSystemTools::ReplaceString(str, "\"", "&quot;");
- // NOTE: This one is not necessary, since as of Eclipse CDT4 it will
- // automatically change this to the original value (').
- //cmSystemTools::ReplaceString(str, "'", "&apos;");
- return str;
+ return name + (type.empty() ? "" : "-") + type + "@" + path;
}
//----------------------------------------------------------------------------
// Helper functions
//----------------------------------------------------------------------------
void cmExtraEclipseCDT4Generator
-::AppendStorageScanners(cmGeneratedFileStream& fout,
+::AppendStorageScanners(cmXMLWriter& xml,
const cmMakefile& makefile)
{
// we need the "make" and the C (or C++) compiler which are used, Alex
@@ -1255,24 +1207,28 @@ void cmExtraEclipseCDT4Generator
compilerArgs = arg1 + compilerArgs;
}
- fout <<
- "<storageModule moduleId=\"scannerConfiguration\">\n"
- "<autodiscovery enabled=\"true\" problemReportingEnabled=\"true\""
- " selectedProfileId="
- "\"org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile\"/>\n"
- ;
- cmExtraEclipseCDT4Generator::AppendScannerProfile(fout,
+ xml.StartElement("storageModule");
+ xml.Attribute("moduleId", "scannerConfiguration");
+
+ xml.StartElement("autodiscovery");
+ xml.Attribute("enabled", "true");
+ xml.Attribute("problemReportingEnabled", "true");
+ xml.Attribute("selectedProfileId",
+ "org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile");
+ xml.EndElement(); // autodiscovery
+
+ cmExtraEclipseCDT4Generator::AppendScannerProfile(xml,
"org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile",
true, "", true, "specsFile",
compilerArgs,
compiler, true, true);
- cmExtraEclipseCDT4Generator::AppendScannerProfile(fout,
+ cmExtraEclipseCDT4Generator::AppendScannerProfile(xml,
"org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile",
true, "", true, "makefileGenerator",
"-f ${project_name}_scd.mk",
make, true, true);
- fout << "</storageModule>\n";
+ xml.EndElement(); // storageModule
}
// The prefix is prepended before the actual name of the target. The purpose
@@ -1283,7 +1239,7 @@ void cmExtraEclipseCDT4Generator
// finally the assembly files "[to asm] ". Note the "to" in "to asm",
// without it, "asm" would be the first targets in the list, with the "to"
// they are the last targets, which makes more sense.
-void cmExtraEclipseCDT4Generator::AppendTarget(cmGeneratedFileStream& fout,
+void cmExtraEclipseCDT4Generator::AppendTarget(cmXMLWriter& xml,
const std::string& target,
const std::string& make,
const std::string& makeArgs,
@@ -1292,31 +1248,21 @@ void cmExtraEclipseCDT4Generator::AppendTarget(cmGeneratedFileStream& fout,
const char* makeTarget
)
{
- std::string targetXml = cmExtraEclipseCDT4Generator::EscapeForXML(target);
- std::string makeTargetXml = targetXml;
- if (makeTarget != NULL)
- {
- makeTargetXml = cmExtraEclipseCDT4Generator::EscapeForXML(makeTarget);
- }
- cmExtraEclipseCDT4Generator::EscapeForXML(target);
- std::string pathXml = cmExtraEclipseCDT4Generator::EscapeForXML(path);
- fout <<
- "<target name=\"" << prefix << targetXml << "\""
- " path=\"" << pathXml << "\""
- " targetID=\"org.eclipse.cdt.make.MakeTargetBuilder\">\n"
- "<buildCommand>"
- << cmExtraEclipseCDT4Generator::GetEclipsePath(make)
- << "</buildCommand>\n"
- "<buildArguments>" << makeArgs << "</buildArguments>\n"
- "<buildTarget>" << makeTargetXml << "</buildTarget>\n"
- "<stopOnError>true</stopOnError>\n"
- "<useDefaultCommand>false</useDefaultCommand>\n"
- "</target>\n"
- ;
+ xml.StartElement("target");
+ xml.Attribute("name", prefix + target);
+ xml.Attribute("path", path);
+ xml.Attribute("targetID", "org.eclipse.cdt.make.MakeTargetBuilder");
+ xml.Element("buildCommand",
+ cmExtraEclipseCDT4Generator::GetEclipsePath(make));
+ xml.Element("buildArguments", makeArgs);
+ xml.Element("buildTarget", makeTarget ? makeTarget : target.c_str());
+ xml.Element("stopOnError", "true");
+ xml.Element("useDefaultCommand", "false");
+ xml.EndElement();
}
void cmExtraEclipseCDT4Generator
-::AppendScannerProfile(cmGeneratedFileStream& fout,
+::AppendScannerProfile(cmXMLWriter& xml,
const std::string& profileID,
bool openActionEnabled,
const std::string& openActionFilePath,
@@ -1327,49 +1273,54 @@ void cmExtraEclipseCDT4Generator
bool runActionUseDefault,
bool sipParserEnabled)
{
- fout <<
- "<profile id=\"" << profileID << "\">\n"
- "<buildOutputProvider>\n"
- "<openAction enabled=\"" << (openActionEnabled ? "true" : "false")
- << "\" filePath=\"" << openActionFilePath << "\"/>\n"
- "<parser enabled=\"" << (pParserEnabled ? "true" : "false") << "\"/>\n"
- "</buildOutputProvider>\n"
- "<scannerInfoProvider id=\"" << scannerInfoProviderID << "\">\n"
- "<runAction arguments=\"" << runActionArguments << "\""
- " command=\"" << runActionCommand
- << "\" useDefault=\"" << (runActionUseDefault ? "true":"false") << "\"/>\n"
- "<parser enabled=\"" << (sipParserEnabled ? "true" : "false") << "\"/>\n"
- "</scannerInfoProvider>\n"
- "</profile>\n"
- ;
+ xml.StartElement("profile");
+ xml.Attribute("id", profileID);
+
+ xml.StartElement("buildOutputProvider");
+ xml.StartElement("openAction");
+ xml.Attribute("enabled", openActionEnabled ? "true" : "false");
+ xml.Attribute("filePath", openActionFilePath);
+ xml.EndElement(); // openAction
+ xml.StartElement("parser");
+ xml.Attribute("enabled", pParserEnabled ? "true" : "false");
+ xml.EndElement(); // parser
+ xml.EndElement(); // buildOutputProvider
+
+ xml.StartElement("scannerInfoProvider");
+ xml.Attribute("id", scannerInfoProviderID);
+ xml.StartElement("runAction");
+ xml.Attribute("arguments", runActionArguments);
+ xml.Attribute("command", runActionCommand);
+ xml.Attribute("useDefault", runActionUseDefault ? "true" : "false");
+ xml.EndElement(); // runAction
+ xml.StartElement("parser");
+ xml.Attribute("enabled", sipParserEnabled ? "true" : "false");
+ xml.EndElement(); // parser
+ xml.EndElement(); // scannerInfoProvider
+
+ xml.EndElement(); // profile
}
void cmExtraEclipseCDT4Generator
-::AppendLinkedResource (cmGeneratedFileStream& fout,
+::AppendLinkedResource (cmXMLWriter& xml,
const std::string& name,
const std::string& path,
LinkType linkType)
{
const char* locationTag = "location";
- const char* typeTag = "2";
+ int typeTag = 2;
if (linkType == VirtualFolder) // ... and not a linked folder
{
locationTag = "locationURI";
}
if (linkType == LinkToFile)
{
- typeTag = "1";
+ typeTag = 1;
}
- fout <<
- "\t\t<link>\n"
- "\t\t\t<name>"
- << cmExtraEclipseCDT4Generator::EscapeForXML(name)
- << "</name>\n"
- "\t\t\t<type>" << typeTag << "</type>\n"
- "\t\t\t<" << locationTag << ">"
- << cmExtraEclipseCDT4Generator::EscapeForXML(path)
- << "</" << locationTag << ">\n"
- "\t\t</link>\n"
- ;
+ xml.StartElement("link");
+ xml.Element("name", name);
+ xml.Element("type", typeTag);
+ xml.Element(locationTag, path);
+ xml.EndElement();
}
diff --git a/Source/cmExtraEclipseCDT4Generator.h b/Source/cmExtraEclipseCDT4Generator.h
index 1da2077..4032a6c 100644
--- a/Source/cmExtraEclipseCDT4Generator.h
+++ b/Source/cmExtraEclipseCDT4Generator.h
@@ -17,7 +17,7 @@
#include "cmExternalMakefileProjectGenerator.h"
class cmMakefile;
-class cmGeneratedFileStream;
+class cmXMLWriter;
/** \class cmExtraEclipseCDT4Generator
* \brief Write Eclipse project files for Makefile based projects
@@ -67,19 +67,17 @@ private:
const std::string& type,
const std::string& path);
- static std::string EscapeForXML(const std::string& value);
-
// Helper functions
- static void AppendStorageScanners(cmGeneratedFileStream& fout,
+ static void AppendStorageScanners(cmXMLWriter& xml,
const cmMakefile& makefile);
- static void AppendTarget (cmGeneratedFileStream& fout,
+ static void AppendTarget (cmXMLWriter& xml,
const std::string& target,
const std::string& make,
const std::string& makeArguments,
const std::string& path,
const char* prefix = "",
const char* makeTarget = NULL);
- static void AppendScannerProfile (cmGeneratedFileStream& fout,
+ static void AppendScannerProfile (cmXMLWriter& xml,
const std::string& profileID,
bool openActionEnabled,
const std::string& openActionFilePath,
@@ -90,21 +88,20 @@ private:
bool runActionUseDefault,
bool sipParserEnabled);
- static void AppendLinkedResource (cmGeneratedFileStream& fout,
+ static void AppendLinkedResource (cmXMLWriter& xml,
const std::string& name,
const std::string& path,
LinkType linkType);
- static void AppendIncludeDirectories(cmGeneratedFileStream& fout,
+ static void AppendIncludeDirectories(cmXMLWriter& xml,
const std::vector<std::string>& includeDirs,
std::set<std::string>& emittedDirs);
- static void AddEnvVar(cmGeneratedFileStream& fout, const char* envVar,
+ static void AddEnvVar(std::ostream& out, const char* envVar,
cmLocalGenerator* lg);
- void CreateLinksToSubprojects(cmGeneratedFileStream& fout,
- const std::string& baseDir);
- void CreateLinksForTargets(cmGeneratedFileStream& fout);
+ void CreateLinksToSubprojects(cmXMLWriter& xml, const std::string& baseDir);
+ void CreateLinksForTargets(cmXMLWriter& xml);
std::vector<std::string> SrcLinkedResources;
std::set<std::string> Natures;
diff --git a/Source/cmGhsMultiTargetGenerator.cxx b/Source/cmGhsMultiTargetGenerator.cxx
index 18e140e..c5813ba 100644
--- a/Source/cmGhsMultiTargetGenerator.cxx
+++ b/Source/cmGhsMultiTargetGenerator.cxx
@@ -217,8 +217,11 @@ void cmGhsMultiTargetGenerator::WriteTypeSpecifics(const std::string &config,
if (this->GeneratorTarget->GetType() == cmState::STATIC_LIBRARY)
{
+ std::string const static_library_suffix =
+ this->Makefile->GetSafeDefinition("CMAKE_STATIC_LIBRARY_SUFFIX");
*this->GetFolderBuildStreams() << " -o \""
- << outputDir << outputFilename << ".a\""
+ << outputDir << outputFilename
+ << static_library_suffix << "\""
<< std::endl;
}
else if (this->GeneratorTarget->GetType() == cmState::EXECUTABLE)
@@ -238,8 +241,11 @@ void cmGhsMultiTargetGenerator::WriteTypeSpecifics(const std::string &config,
}
else
{
+ std::string const executable_suffix =
+ this->Makefile->GetSafeDefinition("CMAKE_EXECUTABLE_SUFFIX");
*this->GetFolderBuildStreams() << " -o \""
- << outputDir << outputFilename << ".as\""
+ << outputDir << outputFilename
+ << executable_suffix << "\""
<< std::endl;
}
}
diff --git a/Source/cmGlobalKdevelopGenerator.cxx b/Source/cmGlobalKdevelopGenerator.cxx
index 018ab24..b4f7670 100644
--- a/Source/cmGlobalKdevelopGenerator.cxx
+++ b/Source/cmGlobalKdevelopGenerator.cxx
@@ -18,6 +18,7 @@
#include "cmSourceFile.h"
#include "cmGeneratedFileStream.h"
#include "cmSystemTools.h"
+#include "cmXMLWriter.h"
#include <cmsys/SystemTools.hxx>
#include <cmsys/Directory.hxx>
@@ -397,6 +398,7 @@ void cmGlobalKdevelopGenerator
{
return;
}
+ cmXMLWriter xml(fout);
// check for a version control system
bool hasSvn = cmSystemTools::FileExists((projectDir + "/.svn").c_str());
@@ -411,182 +413,230 @@ void cmGlobalKdevelopGenerator
primaryLanguage="Fortran77";
}
- fout<<"<?xml version = '1.0'?>\n"
- "<kdevelop>\n"
- " <general>\n"
- " <author></author>\n"
- " <email></email>\n"
- " <version>$VERSION$</version>\n"
- " <projectmanagement>KDevCustomProject</projectmanagement>\n"
- " <primarylanguage>" << primaryLanguage << "</primarylanguage>\n"
- " <ignoreparts/>\n"
- " <projectdirectory>" << projectDir <<
- "</projectdirectory>\n"; //this one is important
- fout<<" <absoluteprojectpath>true</absoluteprojectpath>\n"; //and this one
+ xml.StartDocument();
+ xml.StartElement("kdevelop");
+ xml.StartElement("general");
+
+ xml.Element("author", "");
+ xml.Element("email", "");
+ xml.Element("version", "$VERSION$");
+ xml.Element("projectmanagement", "KDevCustomProject");
+ xml.Element("primarylanguage", primaryLanguage);
+ xml.Element("ignoreparts");
+ xml.Element("projectdirectory", projectDir); // this one is important
+ xml.Element("absoluteprojectpath", "true"); // and this one
// setup additional languages
- fout<<" <secondaryLanguages>\n";
+ xml.StartElement("secondaryLanguages");
if (enableFortran && enableCxx)
{
- fout<<" <language>Fortran</language>\n";
+ xml.Element("language", "Fortran");
}
if (enableCxx)
{
- fout<<" <language>C</language>\n";
+ xml.Element("language", "C");
}
- fout<<" </secondaryLanguages>\n";
+ xml.EndElement();
if (hasSvn)
{
- fout << " <versioncontrol>kdevsubversion</versioncontrol>\n";
+ xml.Element("versioncontrol", "kdevsubversion");
}
else if (hasCvs)
{
- fout << " <versioncontrol>kdevcvsservice</versioncontrol>\n";
+ xml.Element("versioncontrol", "kdevcvsservice");
}
- fout<<" </general>\n"
- " <kdevcustomproject>\n"
- " <filelistdirectory>" << outputDir <<
- "</filelistdirectory>\n"
- " <run>\n"
- " <mainprogram>" << executable << "</mainprogram>\n"
- " <directoryradio>custom</directoryradio>\n"
- " <customdirectory>"<<outputDir<<"</customdirectory>\n"
- " <programargs></programargs>\n"
- " <terminal>false</terminal>\n"
- " <autocompile>true</autocompile>\n"
- " <envvars/>\n"
- " </run>\n"
- " <build>\n"
- " <buildtool>make</buildtool>\n"; //this one is important
- fout<<" <builddir>"<<outputDir<<"</builddir>\n"; //and this one
- fout<<" </build>\n"
- " <make>\n"
- " <abortonerror>false</abortonerror>\n"
- " <numberofjobs>1</numberofjobs>\n"
- " <dontact>false</dontact>\n"
- " <makebin>" << this->GlobalGenerator->GetLocalGenerators()[0]->
- GetMakefile()->GetRequiredDefinition("CMAKE_MAKE_PROGRAM")
- << " </makebin>\n"
- " <selectedenvironment>default</selectedenvironment>\n"
- " <environments>\n"
- " <default>\n"
- " <envvar value=\"1\" name=\"VERBOSE\" />\n"
- " <envvar value=\"1\" name=\"CMAKE_NO_VERBOSE\" />\n"
- " </default>\n"
- " </environments>\n"
- " </make>\n";
-
- fout<<" <blacklist>\n";
+ xml.EndElement(); // general
+ xml.StartElement("kdevcustomproject");
+
+ xml.Element("filelistdirectory", outputDir);
+
+ xml.StartElement("run");
+ xml.Element("mainprogram", executable);
+ xml.Element("directoryradio", "custom");
+ xml.Element("customdirectory", outputDir);
+ xml.Element("programargs", "");
+ xml.Element("terminal", "false");
+ xml.Element("autocompile", "true");
+ xml.Element("envvars");
+ xml.EndElement();
+
+ xml.StartElement("build");
+ xml.Element("buildtool", "make"); // this one is important
+ xml.Element("builddir", outputDir); // and this one
+ xml.EndElement();
+
+ xml.StartElement("make");
+ xml.Element("abortonerror", "false");
+ xml.Element("numberofjobs", 1);
+ xml.Element("dontact", "false");
+ xml.Element("makebin", this->GlobalGenerator->GetLocalGenerators()[0]->
+ GetMakefile()->GetRequiredDefinition("CMAKE_MAKE_PROGRAM"));
+ xml.Element("selectedenvironment", "default");
+
+ xml.StartElement("environments");
+ xml.StartElement("default");
+
+ xml.StartElement("envvar");
+ xml.Attribute("value", 1);
+ xml.Attribute("name", "VERBOSE");
+ xml.EndElement();
+
+ xml.StartElement("envvar");
+ xml.Attribute("value", 1);
+ xml.Attribute("name", "CMAKE_NO_VERBOSE");
+ xml.EndElement();
+
+ xml.EndElement(); // default
+ xml.EndElement(); // environments
+ xml.EndElement(); // make
+
+ xml.StartElement("blacklist");
for(std::vector<std::string>::const_iterator dirIt=this->Blacklist.begin();
dirIt != this->Blacklist.end();
++dirIt)
{
- fout<<" <path>" << *dirIt << "</path>\n";
+ xml.Element("path", *dirIt);
}
- fout<<" </blacklist>\n";
-
- fout<<" </kdevcustomproject>\n"
- " <kdevfilecreate>\n"
- " <filetypes/>\n"
- " <useglobaltypes>\n"
- " <type ext=\"ui\" />\n"
- " <type ext=\"cpp\" />\n"
- " <type ext=\"h\" />\n"
- " </useglobaltypes>\n"
- " </kdevfilecreate>\n"
- " <kdevdoctreeview>\n"
- " <projectdoc>\n"
- " <userdocDir>html/</userdocDir>\n"
- " <apidocDir>html/</apidocDir>\n"
- " </projectdoc>\n"
- " <ignoreqt_xml/>\n"
- " <ignoredoxygen/>\n"
- " <ignorekdocs/>\n"
- " <ignoretocs/>\n"
- " <ignoredevhelp/>\n"
- " </kdevdoctreeview>\n";
+ xml.EndElement();
+
+ xml.EndElement(); // kdevcustomproject
+
+ xml.StartElement("kdevfilecreate");
+ xml.Element("filetypes");
+ xml.StartElement("useglobaltypes");
+
+ xml.StartElement("type");
+ xml.Attribute("ext", "ui");
+ xml.EndElement();
+
+ xml.StartElement("type");
+ xml.Attribute("ext", "cpp");
+ xml.EndElement();
+
+ xml.StartElement("type");
+ xml.Attribute("ext", "h");
+ xml.EndElement();
+
+ xml.EndElement(); // useglobaltypes
+ xml.EndElement(); // kdevfilecreate
+
+ xml.StartElement("kdevdoctreeview");
+ xml.StartElement("projectdoc");
+ xml.Element("userdocDir", "html/");
+ xml.Element("apidocDir", "html/");
+ xml.EndElement(); // projectdoc
+ xml.Element("ignoreqt_xml");
+ xml.Element("ignoredoxygen");
+ xml.Element("ignorekdocs");
+ xml.Element("ignoretocs");
+ xml.Element("ignoredevhelp");
+ xml.EndElement(); // kdevdoctreeview;
if (enableCxx)
{
- fout<<" <cppsupportpart>\n"
- " <filetemplates>\n"
- " <interfacesuffix>.h</interfacesuffix>\n"
- " <implementationsuffix>.cpp</implementationsuffix>\n"
- " </filetemplates>\n"
- " </cppsupportpart>\n"
- " <kdevcppsupport>\n"
- " <codecompletion>\n"
- " <includeGlobalFunctions>true</includeGlobalFunctions>\n"
- " <includeTypes>true</includeTypes>\n"
- " <includeEnums>true</includeEnums>\n"
- " <includeTypedefs>false</includeTypedefs>\n"
- " <automaticCodeCompletion>true</automaticCodeCompletion>\n"
- " <automaticArgumentsHint>true</automaticArgumentsHint>\n"
- " <automaticHeaderCompletion>true</automaticHeaderCompletion>\n"
- " <codeCompletionDelay>250</codeCompletionDelay>\n"
- " <argumentsHintDelay>400</argumentsHintDelay>\n"
- " <headerCompletionDelay>250</headerCompletionDelay>\n"
- " </codecompletion>\n"
- " <references/>\n"
- " </kdevcppsupport>\n";
+ xml.StartElement("cppsupportpart");
+ xml.StartElement("filetemplates");
+ xml.Element("interfacesuffix", ".h");
+ xml.Element("implementationsuffix", ".cpp");
+ xml.EndElement(); // filetemplates
+ xml.EndElement(); // cppsupportpart
+
+ xml.StartElement("kdevcppsupport");
+ xml.StartElement("codecompletion");
+ xml.Element("includeGlobalFunctions", "true");
+ xml.Element("includeTypes", "true");
+ xml.Element("includeEnums", "true");
+ xml.Element("includeTypedefs", "false");
+ xml.Element("automaticCodeCompletion", "true");
+ xml.Element("automaticArgumentsHint", "true");
+ xml.Element("automaticHeaderCompletion", "true");
+ xml.Element("codeCompletionDelay", 250);
+ xml.Element("argumentsHintDelay", 400);
+ xml.Element("headerCompletionDelay", 250);
+ xml.EndElement(); // codecompletion
+ xml.Element("references");
+ xml.EndElement(); // kdevcppsupport;
}
if (enableFortran)
{
- fout<<" <kdevfortransupport>\n"
- " <ftnchek>\n"
- " <division>false</division>\n"
- " <extern>false</extern>\n"
- " <declare>false</declare>\n"
- " <pure>false</pure>\n"
- " <argumentsall>false</argumentsall>\n"
- " <commonall>false</commonall>\n"
- " <truncationall>false</truncationall>\n"
- " <usageall>false</usageall>\n"
- " <f77all>false</f77all>\n"
- " <portabilityall>false</portabilityall>\n"
- " <argumentsonly/>\n"
- " <commononly/>\n"
- " <truncationonly/>\n"
- " <usageonly/>\n"
- " <f77only/>\n"
- " <portabilityonly/>\n"
- " </ftnchek>\n"
- " </kdevfortransupport>\n";
+ xml.StartElement("kdevfortransupport");
+ xml.StartElement("ftnchek");
+ xml.Element("division", "false");
+ xml.Element("extern", "false");
+ xml.Element("declare", "false");
+ xml.Element("pure", "false");
+ xml.Element("argumentsall", "false");
+ xml.Element("commonall", "false");
+ xml.Element("truncationall", "false");
+ xml.Element("usageall", "false");
+ xml.Element("f77all", "false");
+ xml.Element("portabilityall", "false");
+ xml.Element("argumentsonly");
+ xml.Element("commononly");
+ xml.Element("truncationonly");
+ xml.Element("usageonly");
+ xml.Element("f77only");
+ xml.Element("portabilityonly");
+ xml.EndElement(); // ftnchek
+ xml.EndElement(); // kdevfortransupport;
}
// set up file groups. maybe this can be used with the CMake SOURCE_GROUP()
// command
- fout<<" <kdevfileview>\n"
- " <groups>\n"
- " <group pattern=\"" << cmakeFilePattern <<
- "\" name=\"CMake\" />\n";
+ xml.StartElement("kdevfileview");
+ xml.StartElement("groups");
+
+ xml.StartElement("group");
+ xml.Attribute("pattern", cmakeFilePattern);
+ xml.Attribute("name", "CMake");
+ xml.EndElement();
if (enableCxx)
{
- fout<<" <group pattern=\"*.h;*.hxx;*.hpp\" name=\"Header\" />\n"
- " <group pattern=\"*.c\" name=\"C Sources\" />\n"
- " <group pattern=\"*.cpp;*.C;*.cxx;*.cc\" name=\"C++ Sources\""
- "/>\n";
+ xml.StartElement("group");
+ xml.Attribute("pattern", "*.h;*.hxx;*.hpp");
+ xml.Attribute("name", "Header");
+ xml.EndElement();
+
+ xml.StartElement("group");
+ xml.Attribute("pattern", "*.c");
+ xml.Attribute("name", "C Sources");
+ xml.EndElement();
+
+ xml.StartElement("group");
+ xml.Attribute("pattern", "*.cpp;*.C;*.cxx;*.cc");
+ xml.Attribute("name", "C++ Sources");
+ xml.EndElement();
}
if (enableFortran)
{
- fout<<" <group pattern=\"*.f;*.F;*.f77;*.F77;*.f90;*.F90;*.for;*.f95;"
- "*.F95\" name=\"Fortran Sources\" />\n";
+ xml.StartElement("group");
+ xml.Attribute("pattern",
+ "*.f;*.F;*.f77;*.F77;*.f90;*.F90;*.for;*.f95;*.F95");
+ xml.Attribute("name", "Fortran Sources");
+ xml.EndElement();
}
- fout<<" <group pattern=\"*.ui\" name=\"Qt Designer files\" />\n"
- " <hidenonprojectfiles>true</hidenonprojectfiles>\n"
- " </groups>\n"
- " <tree>\n"
- " <hidepatterns>*.o,*.lo,CVS,*~,cmake*</hidepatterns>\n"
- " <hidenonprojectfiles>true</hidenonprojectfiles>\n"
- " </tree>\n"
- " </kdevfileview>\n"
- "</kdevelop>\n";
+ xml.StartElement("group");
+ xml.Attribute("pattern", "*.ui");
+ xml.Attribute("name", "Qt Designer files");
+ xml.EndElement();
+
+ xml.Element("hidenonprojectfiles", "true");
+ xml.EndElement(); // groups
+
+ xml.StartElement("tree");
+ xml.Element("hidepatterns", "*.o,*.lo,CVS,*~,cmake*");
+ xml.Element("hidenonprojectfiles", "true");
+ xml.EndElement(); // tree
+
+ xml.EndElement(); // kdevfileview
+ xml.EndElement(); // kdevelop;
+ xml.EndDocument();
if (sessionFilename.empty())
{
@@ -600,15 +650,24 @@ void cmGlobalKdevelopGenerator
{
return;
}
- devses<<"<?xml version = '1.0' encoding = \'UTF-8\'?>\n"
- "<!DOCTYPE KDevPrjSession>\n"
- "<KDevPrjSession>\n"
- " <DocsAndViews NumberOfDocuments=\"1\" >\n"
- " <Doc0 NumberOfViews=\"1\" URL=\"file://" << fileToOpen <<
- "\" >\n"
- " <View0 line=\"0\" Type=\"Source\" />\n"
- " </Doc0>\n"
- " </DocsAndViews>\n"
- "</KDevPrjSession>\n";
+ cmXMLWriter sesxml(devses);
+ sesxml.StartDocument("UTF-8");
+ sesxml.Doctype("KDevPrjSession");
+ sesxml.StartElement("KDevPrjSession");
+
+ sesxml.StartElement("DocsAndViews");
+ sesxml.Attribute("NumberOfDocuments", 1);
+
+ sesxml.StartElement("Doc0");
+ sesxml.Attribute("NumberOfViews", 1);
+ sesxml.Attribute("URL", "file://" + fileToOpen);
+
+ sesxml.StartElement("View0");
+ sesxml.Attribute("line", 0);
+ sesxml.Attribute("Type", "Source");
+ sesxml.EndElement(); // View0
+
+ sesxml.EndElement(); // Doc0
+ sesxml.EndElement(); // DocsAndViews
+ sesxml.EndElement(); // KDevPrjSession;
}
-
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx
index 83422b7..f12396f 100644
--- a/Source/cmGlobalNinjaGenerator.cxx
+++ b/Source/cmGlobalNinjaGenerator.cxx
@@ -577,6 +577,7 @@ void cmGlobalNinjaGenerator::Generate()
this->WriteAssumedSourceDependencies();
this->WriteTargetAliases(*this->BuildFileStream);
+ this->WriteFolderTargets(*this->BuildFileStream);
this->WriteUnknownExplicitDependencies(*this->BuildFileStream);
this->WriteBuiltinTargets(*this->BuildFileStream);
@@ -848,6 +849,18 @@ std::string cmGlobalNinjaGenerator::ConvertToNinjaPath(const std::string& path)
return convPath;
}
+std::string
+cmGlobalNinjaGenerator::ConvertToNinjaFolderRule(const std::string& path)
+{
+ cmLocalNinjaGenerator *ng =
+ static_cast<cmLocalNinjaGenerator *>(this->LocalGenerators[0]);
+ std::string convPath = ng->Convert(path+"/all", cmOutputConverter::HOME);
+#ifdef _WIN32
+ cmSystemTools::ReplaceString(convPath, "/", "\\");
+#endif
+ return convPath;
+}
+
void cmGlobalNinjaGenerator::AddCXXCompileCommand(
const std::string &commandLine,
const std::string &sourceFile)
@@ -1044,6 +1057,75 @@ void cmGlobalNinjaGenerator::WriteTargetAliases(std::ostream& os)
}
}
+void cmGlobalNinjaGenerator::WriteFolderTargets(std::ostream& os)
+{
+ cmGlobalNinjaGenerator::WriteDivider(os);
+ os << "# Folder targets.\n\n";
+
+ std::map<std::string, cmNinjaDeps> targetsPerFolder;
+ for (std::vector<cmLocalGenerator *>::const_iterator
+ lgi = this->LocalGenerators.begin();
+ lgi != this->LocalGenerators.end(); ++lgi)
+ {
+ cmLocalGenerator const* lg = *lgi;
+ const std::string currentSourceFolder(
+ lg->GetStateSnapshot().GetDirectory().GetCurrentSource());
+ // The directory-level rule should depend on the target-level rules
+ // for all targets in the directory.
+ targetsPerFolder[currentSourceFolder] = cmNinjaDeps();
+ for (std::vector<cmGeneratorTarget*>::const_iterator
+ ti = lg->GetGeneratorTargets().begin();
+ ti != lg->GetGeneratorTargets().end(); ++ti)
+ {
+ cmGeneratorTarget const* gt = *ti;
+ cmState::TargetType const type = gt->GetType();
+ if((type == cmState::EXECUTABLE ||
+ type == cmState::STATIC_LIBRARY ||
+ type == cmState::SHARED_LIBRARY ||
+ type == cmState::MODULE_LIBRARY ||
+ type == cmState::OBJECT_LIBRARY ||
+ type == cmState::UTILITY) &&
+ !gt->GetPropertyAsBool("EXCLUDE_FROM_ALL"))
+ {
+ targetsPerFolder[currentSourceFolder].push_back(gt->GetName());
+ }
+ }
+
+ // The directory-level rule should depend on the directory-level
+ // rules of the subdirectories.
+ std::vector<cmState::Snapshot> const& children =
+ lg->GetStateSnapshot().GetChildren();
+ for(std::vector<cmState::Snapshot>::const_iterator
+ stateIt = children.begin(); stateIt != children.end(); ++stateIt)
+ {
+ targetsPerFolder[currentSourceFolder].push_back(
+ this->ConvertToNinjaFolderRule(
+ stateIt->GetDirectory().GetCurrentSource()));
+ }
+ }
+
+ std::string const rootSourceDir =
+ this->LocalGenerators[0]->GetSourceDirectory();
+ for (std::map<std::string, cmNinjaDeps >::const_iterator it =
+ targetsPerFolder.begin(); it != targetsPerFolder.end(); ++it)
+ {
+ cmGlobalNinjaGenerator::WriteDivider( os );
+ std::string const& currentSourceDir = it->first;
+
+ // Do not generate a rule for the root source dir.
+ if (rootSourceDir.length() >= currentSourceDir.length())
+ {
+ continue;
+ }
+
+ std::string const comment = "Folder: " + currentSourceDir;
+ cmNinjaDeps output(1);
+ output.push_back(this->ConvertToNinjaFolderRule(currentSourceDir));
+
+ this->WritePhonyBuild(os, comment, output, it->second);
+ }
+}
+
void cmGlobalNinjaGenerator::WriteUnknownExplicitDependencies(std::ostream& os)
{
if (!this->ComputingUnknownDependencies)
diff --git a/Source/cmGlobalNinjaGenerator.h b/Source/cmGlobalNinjaGenerator.h
index 8656590..3023a95 100644
--- a/Source/cmGlobalNinjaGenerator.h
+++ b/Source/cmGlobalNinjaGenerator.h
@@ -228,6 +228,8 @@ public:
return this->RulesFileStream; }
std::string ConvertToNinjaPath(const std::string& path);
+ std::string ConvertToNinjaFolderRule(const std::string& path);
+
struct MapToNinjaPathImpl {
cmGlobalNinjaGenerator* GG;
@@ -342,6 +344,7 @@ private:
void WriteAssumedSourceDependencies();
void WriteTargetAliases(std::ostream& os);
+ void WriteFolderTargets(std::ostream& os);
void WriteUnknownExplicitDependencies(std::ostream& os);
void WriteBuiltinTargets(std::ostream& os);
diff --git a/Source/cmXMLWriter.cxx b/Source/cmXMLWriter.cxx
index f9b3b49..6a9172a 100644
--- a/Source/cmXMLWriter.cxx
+++ b/Source/cmXMLWriter.cxx
@@ -67,6 +67,13 @@ void cmXMLWriter::EndElement()
this->ElementOpen = false;
}
+void cmXMLWriter::Element(const char* name)
+{
+ this->CloseStartElement();
+ this->ConditionalLineBreak(!this->IsContent, this->Elements.size());
+ this->Output << '<' << name << "/>";
+}
+
void cmXMLWriter::BreakAttributes()
{
this->BreakAttrib = true;
@@ -85,6 +92,13 @@ void cmXMLWriter::CData(std::string const& data)
this->Output << "<![CDATA[" << data << "]]>";
}
+void cmXMLWriter::Doctype(const char* doctype)
+{
+ this->CloseStartElement();
+ this->ConditionalLineBreak(!this->IsContent, this->Elements.size());
+ this->Output << "<!DOCTYPE " << doctype << ">";
+}
+
void cmXMLWriter::ProcessingInstruction(const char* target, const char* data)
{
this->CloseStartElement();
diff --git a/Source/cmXMLWriter.h b/Source/cmXMLWriter.h
index c38c0de..3083059 100644
--- a/Source/cmXMLWriter.h
+++ b/Source/cmXMLWriter.h
@@ -41,6 +41,8 @@ public:
this->Output << name << "=\"" << SafeAttribute(value) << '"';
}
+ void Element(const char* name);
+
template <typename T>
void Element(std::string const& name, T const& value)
{
@@ -60,6 +62,8 @@ public:
void CData(std::string const& data);
+ void Doctype(const char* doctype);
+
void ProcessingInstruction(const char* target, const char* data);
void FragmentFile(const char* fname);
diff --git a/Templates/AppleInfo.plist b/Templates/AppleInfo.plist
index 1f68ccf..3445e53 100644
--- a/Templates/AppleInfo.plist
+++ b/Templates/AppleInfo.plist
@@ -28,8 +28,6 @@
<string>${APPLE_GUI_BUNDLE_VERSION}</string>
<key>CSResourcesFileMapped</key>
<true/>
- <key>LSRequiresCarbon</key>
- <true/>
<key>NSHumanReadableCopyright</key>
<string>${APPLE_GUI_COPYRIGHT}</string>
</dict>
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt
index 0207753..d22c39c 100644
--- a/Tests/RunCMake/CMakeLists.txt
+++ b/Tests/RunCMake/CMakeLists.txt
@@ -217,6 +217,7 @@ add_RunCMake_test(alias_targets)
add_RunCMake_test(interface_library)
add_RunCMake_test(no_install_prefix)
add_RunCMake_test(configure_file)
+add_RunCMake_test(CTestTimeoutAfterMatch)
find_package(Qt4 QUIET)
find_package(Qt5Core QUIET)
diff --git a/Tests/RunCMake/CTestTimeoutAfterMatch/CMakeLists.txt.in b/Tests/RunCMake/CTestTimeoutAfterMatch/CMakeLists.txt.in
new file mode 100644
index 0000000..e9592f6
--- /dev/null
+++ b/Tests/RunCMake/CTestTimeoutAfterMatch/CMakeLists.txt.in
@@ -0,0 +1,6 @@
+cmake_minimum_required(VERSION 3.4)
+project(TimeoutAfterMatch NONE)
+include(CTest)
+add_test(NAME SleepFor1Second COMMAND "${CMAKE_COMMAND}" -P ${CMAKE_SOURCE_DIR}/SleepFor1Second.cmake)
+set_property(TEST SleepFor1Second PROPERTY TIMEOUT 30)
+set_property(TEST SleepFor1Second PROPERTY TIMEOUT_AFTER_MATCH "${arg1}" "${arg2}")
diff --git a/Tests/RunCMake/CTestTimeoutAfterMatch/CTestConfig.cmake.in b/Tests/RunCMake/CTestTimeoutAfterMatch/CTestConfig.cmake.in
new file mode 100644
index 0000000..58b11af
--- /dev/null
+++ b/Tests/RunCMake/CTestTimeoutAfterMatch/CTestConfig.cmake.in
@@ -0,0 +1 @@
+set(CTEST_PROJECT_NAME "TimeoutAfterMatch@CASE_NAME@")
diff --git a/Tests/RunCMake/CTestTimeoutAfterMatch/MissingArg1-stderr.txt b/Tests/RunCMake/CTestTimeoutAfterMatch/MissingArg1-stderr.txt
new file mode 100644
index 0000000..7766c68
--- /dev/null
+++ b/Tests/RunCMake/CTestTimeoutAfterMatch/MissingArg1-stderr.txt
@@ -0,0 +1 @@
+TIMEOUT_AFTER_MATCH expects two arguments, found 1
diff --git a/Tests/RunCMake/CTestTimeoutAfterMatch/MissingArg2-stderr.txt b/Tests/RunCMake/CTestTimeoutAfterMatch/MissingArg2-stderr.txt
new file mode 100644
index 0000000..7766c68
--- /dev/null
+++ b/Tests/RunCMake/CTestTimeoutAfterMatch/MissingArg2-stderr.txt
@@ -0,0 +1 @@
+TIMEOUT_AFTER_MATCH expects two arguments, found 1
diff --git a/Tests/RunCMake/CTestTimeoutAfterMatch/RunCMakeTest.cmake b/Tests/RunCMake/CTestTimeoutAfterMatch/RunCMakeTest.cmake
new file mode 100644
index 0000000..ee4db83
--- /dev/null
+++ b/Tests/RunCMake/CTestTimeoutAfterMatch/RunCMakeTest.cmake
@@ -0,0 +1,11 @@
+include(RunCTest)
+
+function(run_ctest_TimeoutAfterMatch CASE_NAME)
+ set(CASE_PROPERTY_ARGS "${ARGN}")
+ run_ctest(${CASE_NAME})
+endfunction()
+
+run_ctest_TimeoutAfterMatch(MissingArg1 "\"-Darg2=Test started\"")
+run_ctest_TimeoutAfterMatch(MissingArg2 "\"-Darg1=2\"")
+run_ctest_TimeoutAfterMatch(ShouldTimeout "\"-Darg1=1\" \"-Darg2=Test started\"")
+run_ctest_TimeoutAfterMatch(ShouldPass "\"-Darg1=15\" \"-Darg2=Test started\"")
diff --git a/Tests/RunCMake/CTestTimeoutAfterMatch/ShouldPass-stdout.txt b/Tests/RunCMake/CTestTimeoutAfterMatch/ShouldPass-stdout.txt
new file mode 100644
index 0000000..89aae56
--- /dev/null
+++ b/Tests/RunCMake/CTestTimeoutAfterMatch/ShouldPass-stdout.txt
@@ -0,0 +1,6 @@
+ Start 1: SleepFor1Second
+1/1 Test #1: SleepFor1Second .................. Passed +[0-9.]+ sec
++
+100% tests passed, 0 tests failed out of 1
++
+Total Test time \(real\) = +[0-9.]+ sec$
diff --git a/Tests/RunCMake/CTestTimeoutAfterMatch/ShouldTimeout-stdout.txt b/Tests/RunCMake/CTestTimeoutAfterMatch/ShouldTimeout-stdout.txt
new file mode 100644
index 0000000..c031eb0
--- /dev/null
+++ b/Tests/RunCMake/CTestTimeoutAfterMatch/ShouldTimeout-stdout.txt
@@ -0,0 +1 @@
+1 - SleepFor1Second \(Timeout\)
diff --git a/Tests/RunCMake/CTestTimeoutAfterMatch/SleepFor1Second.cmake b/Tests/RunCMake/CTestTimeoutAfterMatch/SleepFor1Second.cmake
new file mode 100644
index 0000000..82c2a44
--- /dev/null
+++ b/Tests/RunCMake/CTestTimeoutAfterMatch/SleepFor1Second.cmake
@@ -0,0 +1,4 @@
+execute_process(COMMAND "${CMAKE_COMMAND}" -E echo "Gathering required resources")
+execute_process(COMMAND "${CMAKE_COMMAND}" -E sleep 2)
+execute_process(COMMAND "${CMAKE_COMMAND}" -E echo "Test started")
+execute_process(COMMAND "${CMAKE_COMMAND}" -E sleep 1)
diff --git a/Tests/RunCMake/CTestTimeoutAfterMatch/test.cmake.in b/Tests/RunCMake/CTestTimeoutAfterMatch/test.cmake.in
new file mode 100644
index 0000000..d049c9f
--- /dev/null
+++ b/Tests/RunCMake/CTestTimeoutAfterMatch/test.cmake.in
@@ -0,0 +1,21 @@
+cmake_minimum_required(VERSION 3.4)
+
+set(CTEST_SITE "test-site")
+set(CTEST_BUILD_NAME "test-build-name")
+set(CTEST_SOURCE_DIRECTORY "@RunCMake_BINARY_DIR@/@CASE_NAME@")
+set(CTEST_BINARY_DIRECTORY "@RunCMake_BINARY_DIR@/@CASE_NAME@-build")
+set(CTEST_CMAKE_GENERATOR "@RunCMake_GENERATOR@")
+set(CTEST_CMAKE_GENERATOR_PLATFORM "@RunCMake_GENERATOR_PLATFORM@")
+set(CTEST_CMAKE_GENERATOR_TOOLSET "@RunCMake_GENERATOR_TOOLSET@")
+set(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}")
+
+configure_file(
+ "@RunCMake_SOURCE_DIR@/SleepFor1Second.cmake"
+ "${CTEST_SOURCE_DIRECTORY}/SleepFor1Second.cmake"
+ COPYONLY)
+
+set(options @CASE_PROPERTY_ARGS@)
+
+ctest_start(Experimental)
+ctest_configure(OPTIONS "${options}")
+ctest_test()
diff --git a/Tests/RunCMake/FindPkgConfig/FindPkgConfig_cache_variables.cmake b/Tests/RunCMake/FindPkgConfig/FindPkgConfig_cache_variables.cmake
index 8d8d000..d0046ca 100644
--- a/Tests/RunCMake/FindPkgConfig/FindPkgConfig_cache_variables.cmake
+++ b/Tests/RunCMake/FindPkgConfig/FindPkgConfig_cache_variables.cmake
@@ -1,14 +1,15 @@
+cmake_minimum_required(VERSION 3.3)
+
find_package(PkgConfig REQUIRED)
pkg_check_modules(NCURSES QUIET ncurses)
if (NCURSES_FOUND)
foreach (variable IN ITEMS PREFIX INCLUDEDIR LIBDIR)
- get_property("${variable}"
+ get_property(value
CACHE "NCURSES_${variable}"
- PROPERTY TYPE
- SET)
- if (NOT ${variable})
- message(FATAL_ERROR "Failed to set cache entry for NCURSES_${variable}")
+ PROPERTY VALUE)
+ if (NOT value STREQUAL NCURSES_${variable})
+ message(FATAL_ERROR "Failed to set cache entry for NCURSES_${variable}:\nexpected -->${value}<--\nreceived -->${NCURSES_${variable}}<--")
endif ()
endforeach ()
else ()
diff --git a/Tests/RunCMake/Ninja/RunCMakeTest.cmake b/Tests/RunCMake/Ninja/RunCMakeTest.cmake
index 64f97bc..4e06888 100644
--- a/Tests/RunCMake/Ninja/RunCMakeTest.cmake
+++ b/Tests/RunCMake/Ninja/RunCMakeTest.cmake
@@ -16,3 +16,19 @@ run_CMP0058(WARN-no)
run_CMP0058(WARN-by)
run_CMP0058(NEW-no)
run_CMP0058(NEW-by)
+
+function(run_SubDir)
+ # Use a single build tree for a few tests without cleaning.
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/SubDir-build)
+ set(RunCMake_TEST_NO_CLEAN 1)
+ file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
+ file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
+ run_cmake(SubDir)
+ if(WIN32)
+ set(SubDir_all [[SubDir\all]])
+ else()
+ set(SubDir_all [[SubDir/all]])
+ endif()
+ run_cmake_command(SubDir-build ${CMAKE_COMMAND} --build . --target ${SubDir_all})
+endfunction()
+run_SubDir()
diff --git a/Tests/RunCMake/Ninja/SubDir-build-stdout.txt b/Tests/RunCMake/Ninja/SubDir-build-stdout.txt
new file mode 100644
index 0000000..e4b4662
--- /dev/null
+++ b/Tests/RunCMake/Ninja/SubDir-build-stdout.txt
@@ -0,0 +1 @@
+Building InAll
diff --git a/Tests/RunCMake/Ninja/SubDir.cmake b/Tests/RunCMake/Ninja/SubDir.cmake
new file mode 100644
index 0000000..7224ec3
--- /dev/null
+++ b/Tests/RunCMake/Ninja/SubDir.cmake
@@ -0,0 +1,2 @@
+add_subdirectory(SubDir)
+add_custom_target(TopFail ALL COMMAND does_not_exist)
diff --git a/Tests/RunCMake/Ninja/SubDir/CMakeLists.txt b/Tests/RunCMake/Ninja/SubDir/CMakeLists.txt
new file mode 100644
index 0000000..73ae431
--- /dev/null
+++ b/Tests/RunCMake/Ninja/SubDir/CMakeLists.txt
@@ -0,0 +1,2 @@
+add_custom_target(SubFail COMMAND does_not_exist)
+add_custom_target(InAll ALL COMMAND ${CMAKE_COMMAND} -E echo "Building InAll")
diff --git a/Utilities/Release/win64_release.cmake b/Utilities/Release/win64_release.cmake
index cc1f37f..b2d4ad1 100644
--- a/Utilities/Release/win64_release.cmake
+++ b/Utilities/Release/win64_release.cmake
@@ -26,4 +26,8 @@ set(CXXFLAGS "${ppflags}")
set(ENV ". ~/rel/env64")
get_filename_component(path "${CMAKE_CURRENT_LIST_FILE}" PATH)
set(GIT_EXTRA "git config core.autocrlf true")
+if(CMAKE_CREATE_VERSION STREQUAL "nightly")
+ # Some tests fail spuriously too often.
+ set(EXTRA_CTEST_ARGS "-E Qt5Autogen")
+endif()
include(${path}/release_cmake.cmake)