summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Help/manual/cmake.1.rst12
-rw-r--r--Help/prop_tgt/MACOSX_BUNDLE.rst2
-rw-r--r--Help/prop_tgt/MACOSX_RPATH.rst6
-rw-r--r--Help/prop_tgt/RESOURCE.rst66
-rw-r--r--Help/release/dev/FindBoost-imported-targets.rst5
-rw-r--r--Help/release/dev/cmake-E-copy-multiple-inputs.rst5
-rw-r--r--Help/release/dev/regex-explorer.rst6
-rw-r--r--Modules/CMakeDetermineFortranCompiler.cmake2
-rw-r--r--Modules/Compiler/Embarcadero-DetermineCompiler.cmake2
-rw-r--r--Modules/FindBoost.cmake386
-rw-r--r--Modules/FindJNI.cmake6
-rw-r--r--Modules/FindJava.cmake6
-rw-r--r--Modules/GenerateExportHeader.cmake4
-rw-r--r--Modules/Platform/Windows-Embarcadero.cmake6
-rw-r--r--Modules/UseJava.cmake2
-rw-r--r--Source/CMakeVersion.cmake2
-rw-r--r--Source/QtDialog/CMakeLists.txt4
-rw-r--r--Source/QtDialog/CMakeSetupDialog.cxx10
-rw-r--r--Source/QtDialog/CMakeSetupDialog.h1
-rw-r--r--Source/QtDialog/RegexExplorer.cxx166
-rw-r--r--Source/QtDialog/RegexExplorer.h48
-rw-r--r--Source/QtDialog/RegexExplorer.ui155
-rw-r--r--Source/cmGeneratorTarget.cxx6
-rw-r--r--Source/cmcmd.cxx73
-rw-r--r--Source/kwsys/SystemTools.cxx26
-rw-r--r--Source/kwsys/testSystemTools.cxx188
-rw-r--r--Tests/CMakeLists.txt7
-rw-r--r--Tests/CMakeOnly/CompilerIdC/CMakeLists.txt7
-rw-r--r--Tests/CMakeOnly/CompilerIdCXX/CMakeLists.txt7
-rw-r--r--Tests/CMakeOnly/CompilerIdFortran/CMakeLists.txt7
-rw-r--r--Tests/CompileOptions/CMakeLists.txt2
-rw-r--r--Tests/FindBoost/CMakeLists.txt10
-rw-r--r--Tests/FindBoost/Test/CMakeLists.txt18
-rw-r--r--Tests/FindBoost/Test/main.cxx26
-rw-r--r--Tests/RunCMake/CommandLine/E-no-arg-stderr.txt2
-rw-r--r--Tests/RunCMake/CommandLine/E_copy-one-source-directory-target-is-directory-result.txt1
-rw-r--r--Tests/RunCMake/CommandLine/E_copy-one-source-directory-target-is-directory-stderr.txt0
-rw-r--r--Tests/RunCMake/CommandLine/E_copy-one-source-file-result.txt1
-rw-r--r--Tests/RunCMake/CommandLine/E_copy-one-source-file-stderr.txt1
-rw-r--r--Tests/RunCMake/CommandLine/E_copy-three-source-files-target-is-directory-result.txt1
-rw-r--r--Tests/RunCMake/CommandLine/E_copy-three-source-files-target-is-directory-stderr.txt0
-rw-r--r--Tests/RunCMake/CommandLine/E_copy-three-source-files-target-is-file-result.txt1
-rw-r--r--Tests/RunCMake/CommandLine/E_copy-three-source-files-target-is-file-stderr.txt1
-rw-r--r--Tests/RunCMake/CommandLine/E_copy-two-good-and-one-bad-source-files-target-is-directory-result.txt1
-rw-r--r--Tests/RunCMake/CommandLine/E_copy-two-good-and-one-bad-source-files-target-is-directory-stderr.txt1
-rw-r--r--Tests/RunCMake/CommandLine/E_copy_if_different-one-source-directory-target-is-directory-result.txt1
-rw-r--r--Tests/RunCMake/CommandLine/E_copy_if_different-one-source-directory-target-is-directory-stderr.txt0
-rw-r--r--Tests/RunCMake/CommandLine/E_copy_if_different-three-source-files-target-is-directory-result.txt1
-rw-r--r--Tests/RunCMake/CommandLine/E_copy_if_different-three-source-files-target-is-directory-stderr.txt0
-rw-r--r--Tests/RunCMake/CommandLine/E_copy_if_different-three-source-files-target-is-file-result.txt1
-rw-r--r--Tests/RunCMake/CommandLine/E_copy_if_different-three-source-files-target-is-file-stderr.txt1
-rw-r--r--Tests/RunCMake/CommandLine/E_create_symlink-no-arg-stderr.txt2
-rw-r--r--Tests/RunCMake/CommandLine/E_rename-no-arg-stderr.txt2
-rw-r--r--Tests/RunCMake/CommandLine/E_touch_nocreate-no-arg-stderr.txt2
-rw-r--r--Tests/RunCMake/CommandLine/RunCMakeTest.cmake23
-rw-r--r--Tests/RunCMake/CommandLine/copy_input/f1.txt0
-rw-r--r--Tests/RunCMake/CommandLine/copy_input/f2.txt0
-rw-r--r--Tests/RunCMake/CommandLine/copy_input/f3.txt0
-rw-r--r--Tests/RunCMake/Framework/FrameworkLayout.cmake10
-rw-r--r--Tests/RunCMake/Framework/OSXFrameworkLayout-build-check.cmake17
-rw-r--r--Tests/RunCMake/Framework/foo.h1
-rw-r--r--Tests/RunCMake/Framework/iOSFrameworkLayout-build-check.cmake17
-rw-r--r--Tests/RunCMake/Framework/res.txt0
-rw-r--r--Utilities/Scripts/BoostScanDeps.cmake217
64 files changed, 1507 insertions, 77 deletions
diff --git a/Help/manual/cmake.1.rst b/Help/manual/cmake.1.rst
index dac16bf..086f259 100644
--- a/Help/manual/cmake.1.rst
+++ b/Help/manual/cmake.1.rst
@@ -169,14 +169,14 @@ Available commands are:
``compare_files <file1> <file2>``
Check if file1 is same as file2.
-``copy <file> <destination>``
- Copy file to destination (either file or directory).
+``copy <file>... <destination>``
+ Copy files to 'destination' (either file or directory).
``copy_directory <source> <destination>``
Copy directory 'source' content to directory 'destination'.
-``copy_if_different <in-file> <out-file>``
- Copy file if input has changed.
+``copy_if_different <file>... <destination>``
+ Copy files if input has changed. Destination could be file or directory.
``echo [<string>...]``
Displays arguments as text.
@@ -193,10 +193,10 @@ Available commands are:
``make_directory <dir>``
Create a directory.
-``md5sum [<file>...]``
+``md5sum <file>...``
Compute md5sum of files.
-``remove [-f] [<file>...]``
+``remove [-f] <file>...``
Remove the file(s), use ``-f`` to force it.
``remove_directory <dir>``
diff --git a/Help/prop_tgt/MACOSX_BUNDLE.rst b/Help/prop_tgt/MACOSX_BUNDLE.rst
index 8d7d914..7cd8046 100644
--- a/Help/prop_tgt/MACOSX_BUNDLE.rst
+++ b/Help/prop_tgt/MACOSX_BUNDLE.rst
@@ -3,7 +3,7 @@ MACOSX_BUNDLE
Build an executable as an Application Bundle on OS X or iOS.
-When this property is set to true the executable when built on OS X
+When this property is set to ``TRUE`` the executable when built on OS X
or iOS will be created as an application bundle. This makes it
a GUI executable that can be launched from the Finder. See the
:prop_tgt:`MACOSX_FRAMEWORK_INFO_PLIST` target property for information about
diff --git a/Help/prop_tgt/MACOSX_RPATH.rst b/Help/prop_tgt/MACOSX_RPATH.rst
index 41bb8cc..1f9a036 100644
--- a/Help/prop_tgt/MACOSX_RPATH.rst
+++ b/Help/prop_tgt/MACOSX_RPATH.rst
@@ -3,8 +3,8 @@ MACOSX_RPATH
Whether this target on OS X or iOS is located at runtime using rpaths.
-When this property is set to true, the directory portion of
-the "install_name" field of this shared library will be ``@rpath``
+When this property is set to ``TRUE``, the directory portion of
+the ``install_name`` field of this shared library will be ``@rpath``
unless overridden by :prop_tgt:`INSTALL_NAME_DIR`. This indicates
the shared library is to be found at runtime using runtime
paths (rpaths).
@@ -18,6 +18,6 @@ can be controlled by the :prop_tgt:`INSTALL_RPATH` target property on
the target linking to this target.
Policy :policy:`CMP0042` was introduced to change the default value of
-``MACOSX_RPATH`` to ``TRUE. This is because use of ``@rpath`` is a
+``MACOSX_RPATH`` to ``TRUE``. This is because use of ``@rpath`` is a
more flexible and powerful alternative to ``@executable_path`` and
``@loader_path``.
diff --git a/Help/prop_tgt/RESOURCE.rst b/Help/prop_tgt/RESOURCE.rst
index 5dad3ea..d837f7b 100644
--- a/Help/prop_tgt/RESOURCE.rst
+++ b/Help/prop_tgt/RESOURCE.rst
@@ -1,11 +1,61 @@
RESOURCE
--------
-Specify resource files in a :prop_tgt:`FRAMEWORK` shared library target.
-
-Shared library targets marked with the :prop_tgt:`FRAMEWORK` property generate
-frameworks on OS X, iOS and normal shared libraries on other platforms.
-This property may be set to a list of files to be placed in the
-``Resources`` directory inside the framework folder. On non-Apple
-platforms these files may be installed using the ``RESOURCE`` option to
-the ``install(TARGETS)`` command.
+Specify resource files in a :prop_tgt:`FRAMEWORK` or :prop_tgt:`BUNDLE`.
+
+Target marked with the :prop_tgt:`FRAMEWORK` or :prop_tgt:`BUNDLE` property
+generate framework or application bundle (both OS X and iOS is supported)
+or normal shared libraries on other platforms.
+This property may be set to a list of files to be placed in the corresponding
+directory (eg. ``Resources`` directory for OS X) inside the bundle.
+On non-Apple platforms these files may be installed using the ``RESOURCE``
+option to the ``install(TARGETS)`` command.
+
+Following example of Application Bundle:
+
+.. code-block:: cmake
+
+ add_executable(ExecutableTarget
+ addDemo.c
+ resourcefile.txt
+ appresourcedir/appres.txt
+ )
+
+ target_link_libraries(ExecutableTarget heymath mul)
+
+ set(RESOURCE_FILES
+ resourcefile.txt
+ appresourcedir/appres.txt
+ )
+
+ set_target_properties(ExecutableTarget PROPERTIES
+ MACOSX_BUNDLE TRUE
+ MACOSX_FRAMEWORK_IDENTIFIER org.cmake.ExecutableTarget
+ RESOURCE "${RESOURCE_FILES}"
+ )
+
+will produce flat structure for iOS systems::
+
+ ExecutableTarget.app
+ appres.txt
+ ExecutableTarget
+ Info.plist
+ resourcefile.txt
+
+For OS X systems it will produce following directory structure::
+
+ ExecutableTarget.app/
+ Contents
+ Info.plist
+ MacOS
+ ExecutableTarget
+ Resources
+ appres.txt
+ resourcefile.txt
+
+For Linux, such cmake script produce following files::
+
+ ExecutableTarget
+ Resources
+ appres.txt
+ resourcefile.txt
diff --git a/Help/release/dev/FindBoost-imported-targets.rst b/Help/release/dev/FindBoost-imported-targets.rst
new file mode 100644
index 0000000..1129ded
--- /dev/null
+++ b/Help/release/dev/FindBoost-imported-targets.rst
@@ -0,0 +1,5 @@
+FindBoost-imported-targets
+--------------------------
+
+* The :module:`FindBoost` module now provides imported targets
+ such as ``Boost::boost`` and ``Boost::filesystem``.
diff --git a/Help/release/dev/cmake-E-copy-multiple-inputs.rst b/Help/release/dev/cmake-E-copy-multiple-inputs.rst
new file mode 100644
index 0000000..798af53
--- /dev/null
+++ b/Help/release/dev/cmake-E-copy-multiple-inputs.rst
@@ -0,0 +1,5 @@
+cmake-E-copy-multiple-inputs
+----------------------------
+
+* The :manual:`cmake(1)` ``-E copy`` and ``-E copy_if_different`` command-line
+ tools learned to support copying multiple input files to a directory.
diff --git a/Help/release/dev/regex-explorer.rst b/Help/release/dev/regex-explorer.rst
new file mode 100644
index 0000000..2147816
--- /dev/null
+++ b/Help/release/dev/regex-explorer.rst
@@ -0,0 +1,6 @@
+regex-explorer
+--------------
+
+* The Qt base CMake GUI got a Regular Expression Explorer which could be used to
+ create and evaluate regular expressions in real-time. The explorer window
+ is available via the ``Tools`` menu.
diff --git a/Modules/CMakeDetermineFortranCompiler.cmake b/Modules/CMakeDetermineFortranCompiler.cmake
index 911ffac..ccafb07 100644
--- a/Modules/CMakeDetermineFortranCompiler.cmake
+++ b/Modules/CMakeDetermineFortranCompiler.cmake
@@ -54,6 +54,7 @@ else()
if(NOT CMAKE_Fortran_COMPILER_INIT)
# Known compilers:
# f77/f90/f95: generic compiler names
+ # ftn: Cray fortran compiler wrapper
# g77: GNU Fortran 77 compiler
# gfortran: putative GNU Fortran 95+ compiler (in progress)
# fort77: native F77 compiler under HP-UX (and some older Crays)
@@ -73,6 +74,7 @@ else()
# then 77 or older compilers, gnu is always last in the group,
# so if you paid for a compiler it is picked by default.
set(CMAKE_Fortran_COMPILER_LIST
+ ftn
ifort ifc af95 af90 efc f95 pathf2003 pathf95 pgf95 pgfortran lf95 xlf95
fort gfortran gfortran-4 g95 f90 pathf90 pgf90 xlf90 epcf90 fort77
frt pgf77 xlf fl32 af77 g77 f77
diff --git a/Modules/Compiler/Embarcadero-DetermineCompiler.cmake b/Modules/Compiler/Embarcadero-DetermineCompiler.cmake
index 2feedac..8375624 100644
--- a/Modules/Compiler/Embarcadero-DetermineCompiler.cmake
+++ b/Modules/Compiler/Embarcadero-DetermineCompiler.cmake
@@ -4,4 +4,4 @@ set(_compiler_id_pp_test "defined(__BORLANDC__) && defined(__CODEGEARC_VERSION__
set(_compiler_id_version_compute "
# define @PREFIX@COMPILER_VERSION_MAJOR @MACRO_HEX@(__CODEGEARC_VERSION__>>24 & 0x00FF)
# define @PREFIX@COMPILER_VERSION_MINOR @MACRO_HEX@(__CODEGEARC_VERSION__>>16 & 0x00FF)
-# define @PREFIX@COMPILER_VERSION_PATCH @MACRO_HEX@(__CODEGEARC_VERSION__ & 0xFFFF)")
+# define @PREFIX@COMPILER_VERSION_PATCH @MACRO_DEC@(__CODEGEARC_VERSION__ & 0xFFFF)")
diff --git a/Modules/FindBoost.cmake b/Modules/FindBoost.cmake
index 33e6a49..e517a6a 100644
--- a/Modules/FindBoost.cmake
+++ b/Modules/FindBoost.cmake
@@ -54,6 +54,33 @@
# Boost_<C>_LIBRARY_DEBUG - Component <C> library debug variant
# Boost_<C>_LIBRARY_RELEASE - Component <C> library release variant
#
+# The following :prop_tgt:`IMPORTED` targets are also defined::
+#
+# Boost::boost - Target for header-only dependencies
+# (Boost include directory)
+# Boost::<C> - Target for specific component dependency
+# (shared or static library); <C> is lower-
+# case
+# Boost::diagnostic_definitions - interface target to enable diagnostic
+# information about Boost's automatic linking
+# during compilation (adds BOOST_LIB_DIAGNOSTIC)
+# Boost::disable_autolinking - interface target to disable automatic
+# linking with MSVC (adds BOOST_ALL_NO_LIB)
+# Boost::dynamic_linking - interface target to enable dynamic linking
+# linking with MSVC (adds BOOST_ALL_DYN_LINK)
+#
+# Implicit dependencies such as Boost::filesystem requiring
+# Boost::system will be automatically detected and satisfied, even
+# if system is not specified when using find_package and if
+# Boost::system is not added to target_link_libraries. If using
+# Boost::thread, then Thread::Thread will also be added automatically.
+#
+# It is important to note that the imported targets behave differently
+# than variables created by this module: multiple calls to
+# find_package(Boost) in the same directory or sub-directories with
+# different options (e.g. static or shared) will not override the
+# values of the targets created by the first call.
+#
# Users may set these hints or results as cache entries. Projects
# should not read these entries directly but instead use the above
# result variables. Note that some hint names start in upper-case
@@ -142,6 +169,14 @@
# add_executable(foo foo.cc)
# endif()
#
+# Example to find Boost libraries and use imported targets::
+#
+# find_package(Boost 1.56 REQUIRED COMPONENTS
+# date_time filesystem iostreams)
+# add_executable(foo foo.cc)
+# target_link_libraries(foo Boost::date_time Boost::filesystem
+# Boost::iostreams)
+#
# Example to find Boost headers and some *static* libraries::
#
# set(Boost_USE_STATIC_LIBS ON) # only find static libs
@@ -472,6 +507,262 @@ function(_Boost_GUESS_COMPILER_PREFIX _ret)
endfunction()
#
+# Get component dependencies. Requires the dependencies to have been
+# defined for the Boost release version.
+#
+# component - the component to check
+# _ret - list of library dependencies
+#
+function(_Boost_COMPONENT_DEPENDENCIES component _ret)
+ # Note: to add a new Boost release, run
+ #
+ # % cmake -DBOOST_DIR=/path/to/boost/source -P Utilities/Scripts/BoostScanDeps.cmake
+ #
+ # The output may be added in a new block below. If it's the same as
+ # the previous release, simply update the version range of the block
+ # for the previous release.
+ #
+ # This information was originally generated by running
+ # BoostScanDeps.cmake against every boost release to date supported
+ # by FindBoost:
+ #
+ # % for version in /path/to/boost/sources/*
+ # do
+ # cmake -DBOOST_DIR=$version -P Utilities/Scripts/BoostScanDeps.cmake
+ # done
+ #
+ # The output was then updated by search and replace with these regexes:
+ #
+ # - Strip message(STATUS) prefix dashes
+ # s;^-- ;;
+ # - Indent
+ # s;^set(; set(;;
+ # - Add conditionals
+ # s;Scanning /path/to/boost/sources/boost_\(.*\)_\(.*\)_\(.*); elseif(NOT Boost_VERSION VERSION_LESS \10\20\3 AND Boost_VERSION VERSION_LESS xxxx);
+ #
+ # This results in the logic seen below, but will require the xxxx
+ # replacing with the following Boost release version (or the next
+ # minor version to be released, e.g. 1.59 was the latest at the time
+ # of writing, making 1.60 the next, so 106000 is the needed version
+ # number). Identical consecutive releases were then merged together
+ # by updating the end range of the first block and removing the
+ # following redundant blocks.
+ #
+ # Running the script against all historical releases should be
+ # required only if the BoostScanDeps.cmake script logic is changed.
+ # The addition of a new release should only require it to be run
+ # against the new release.
+ set(_Boost_IMPORTED_TARGETS TRUE)
+ if(NOT Boost_VERSION VERSION_LESS 103300 AND Boost_VERSION VERSION_LESS 103500)
+ set(_Boost_IOSTREAMS_DEPENDENCIES regex thread)
+ set(_Boost_REGEX_DEPENDENCIES thread)
+ set(_Boost_WAVE_DEPENDENCIES filesystem thread)
+ set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
+ elseif(NOT Boost_VERSION VERSION_LESS 103500 AND Boost_VERSION VERSION_LESS 103600)
+ set(_Boost_FILESYSTEM_DEPENDENCIES system)
+ set(_Boost_IOSTREAMS_DEPENDENCIES regex)
+ set(_Boost_MPI_DEPENDENCIES serialization)
+ set(_Boost_MPI_PYTHON_DEPENDENCIES python mpi serialization)
+ set(_Boost_WAVE_DEPENDENCIES filesystem system thread)
+ set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
+ elseif(NOT Boost_VERSION VERSION_LESS 103600 AND Boost_VERSION VERSION_LESS 103800)
+ set(_Boost_FILESYSTEM_DEPENDENCIES system)
+ set(_Boost_IOSTREAMS_DEPENDENCIES regex)
+ set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l)
+ set(_Boost_MPI_DEPENDENCIES serialization)
+ set(_Boost_MPI_PYTHON_DEPENDENCIES python mpi serialization)
+ set(_Boost_WAVE_DEPENDENCIES filesystem system thread)
+ set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
+ elseif(NOT Boost_VERSION VERSION_LESS 103800 AND Boost_VERSION VERSION_LESS 104300)
+ set(_Boost_FILESYSTEM_DEPENDENCIES system)
+ set(_Boost_IOSTREAMS_DEPENDENCIES regex)
+ set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l)
+ set(_Boost_MPI_DEPENDENCIES serialization)
+ set(_Boost_MPI_PYTHON_DEPENDENCIES python mpi serialization)
+ set(_Boost_THREAD_DEPENDENCIES date_time)
+ set(_Boost_WAVE_DEPENDENCIES filesystem system thread date_time)
+ set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
+ elseif(NOT Boost_VERSION VERSION_LESS 104300 AND Boost_VERSION VERSION_LESS 104400)
+ set(_Boost_FILESYSTEM_DEPENDENCIES system)
+ set(_Boost_IOSTREAMS_DEPENDENCIES regex)
+ set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l random)
+ set(_Boost_MPI_DEPENDENCIES serialization)
+ set(_Boost_MPI_PYTHON_DEPENDENCIES python mpi serialization)
+ set(_Boost_THREAD_DEPENDENCIES date_time)
+ set(_Boost_WAVE_DEPENDENCIES filesystem system thread date_time)
+ set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
+ elseif(NOT Boost_VERSION VERSION_LESS 104400 AND Boost_VERSION VERSION_LESS 104500)
+ set(_Boost_FILESYSTEM_DEPENDENCIES system)
+ set(_Boost_IOSTREAMS_DEPENDENCIES regex)
+ set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l random serialization)
+ set(_Boost_MPI_DEPENDENCIES serialization)
+ set(_Boost_MPI_PYTHON_DEPENDENCIES python mpi serialization)
+ set(_Boost_THREAD_DEPENDENCIES date_time)
+ set(_Boost_WAVE_DEPENDENCIES serialization filesystem system thread date_time)
+ set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
+ elseif(NOT Boost_VERSION VERSION_LESS 104500 AND Boost_VERSION VERSION_LESS 104700)
+ set(_Boost_FILESYSTEM_DEPENDENCIES system)
+ set(_Boost_IOSTREAMS_DEPENDENCIES regex)
+ set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l random)
+ set(_Boost_MPI_DEPENDENCIES serialization)
+ set(_Boost_MPI_PYTHON_DEPENDENCIES python mpi serialization)
+ set(_Boost_THREAD_DEPENDENCIES date_time)
+ set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread date_time)
+ set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
+ elseif(NOT Boost_VERSION VERSION_LESS 104700 AND Boost_VERSION VERSION_LESS 104800)
+ set(_Boost_CHRONO_DEPENDENCIES system)
+ set(_Boost_FILESYSTEM_DEPENDENCIES system)
+ set(_Boost_IOSTREAMS_DEPENDENCIES regex)
+ set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l random)
+ set(_Boost_MPI_DEPENDENCIES serialization)
+ set(_Boost_MPI_PYTHON_DEPENDENCIES python mpi serialization)
+ set(_Boost_THREAD_DEPENDENCIES date_time)
+ set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread date_time)
+ set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
+ elseif(NOT Boost_VERSION VERSION_LESS 104800 AND Boost_VERSION VERSION_LESS 105000)
+ set(_Boost_CHRONO_DEPENDENCIES system)
+ set(_Boost_FILESYSTEM_DEPENDENCIES system)
+ set(_Boost_IOSTREAMS_DEPENDENCIES regex)
+ set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l random)
+ set(_Boost_MPI_DEPENDENCIES serialization)
+ set(_Boost_MPI_PYTHON_DEPENDENCIES python mpi serialization)
+ set(_Boost_THREAD_DEPENDENCIES date_time)
+ set(_Boost_TIMER_DEPENDENCIES chrono system)
+ set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread date_time)
+ set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
+ elseif(NOT Boost_VERSION VERSION_LESS 105000 AND Boost_VERSION VERSION_LESS 105300)
+ set(_Boost_CHRONO_DEPENDENCIES system)
+ set(_Boost_FILESYSTEM_DEPENDENCIES system)
+ set(_Boost_IOSTREAMS_DEPENDENCIES regex)
+ set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l regex random)
+ set(_Boost_MPI_DEPENDENCIES serialization)
+ set(_Boost_MPI_PYTHON_DEPENDENCIES python mpi serialization)
+ set(_Boost_THREAD_DEPENDENCIES chrono system date_time)
+ set(_Boost_TIMER_DEPENDENCIES chrono system)
+ set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread chrono date_time)
+ set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
+ elseif(NOT Boost_VERSION VERSION_LESS 105300 AND Boost_VERSION VERSION_LESS 105400)
+ set(_Boost_ATOMIC_DEPENDENCIES thread chrono system date_time)
+ set(_Boost_CHRONO_DEPENDENCIES system)
+ set(_Boost_FILESYSTEM_DEPENDENCIES system)
+ set(_Boost_IOSTREAMS_DEPENDENCIES regex)
+ set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l regex random)
+ set(_Boost_MPI_DEPENDENCIES serialization)
+ set(_Boost_MPI_PYTHON_DEPENDENCIES python mpi serialization)
+ set(_Boost_THREAD_DEPENDENCIES chrono system date_time atomic)
+ set(_Boost_TIMER_DEPENDENCIES chrono system)
+ set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread chrono date_time)
+ set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
+ elseif(NOT Boost_VERSION VERSION_LESS 105400 AND Boost_VERSION VERSION_LESS 105500)
+ set(_Boost_ATOMIC_DEPENDENCIES thread chrono system date_time)
+ set(_Boost_CHRONO_DEPENDENCIES system)
+ set(_Boost_FILESYSTEM_DEPENDENCIES system)
+ set(_Boost_IOSTREAMS_DEPENDENCIES regex)
+ set(_Boost_LOG_DEPENDENCIES log_setup date_time system filesystem thread regex chrono)
+ set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l regex random)
+ set(_Boost_MPI_DEPENDENCIES serialization)
+ set(_Boost_MPI_PYTHON_DEPENDENCIES python mpi serialization)
+ set(_Boost_THREAD_DEPENDENCIES chrono system date_time atomic)
+ set(_Boost_TIMER_DEPENDENCIES chrono system)
+ set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread chrono date_time atomic)
+ set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
+ elseif(NOT Boost_VERSION VERSION_LESS 105500 AND Boost_VERSION VERSION_LESS 105600)
+ set(_Boost_CHRONO_DEPENDENCIES system)
+ set(_Boost_COROUTINE_DEPENDENCIES context system)
+ set(_Boost_FILESYSTEM_DEPENDENCIES system)
+ set(_Boost_IOSTREAMS_DEPENDENCIES regex)
+ set(_Boost_LOG_DEPENDENCIES log_setup date_time system filesystem thread regex chrono)
+ set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l regex random)
+ set(_Boost_MPI_DEPENDENCIES serialization)
+ set(_Boost_MPI_PYTHON_DEPENDENCIES python mpi serialization)
+ set(_Boost_THREAD_DEPENDENCIES chrono system date_time atomic)
+ set(_Boost_TIMER_DEPENDENCIES chrono system)
+ set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread chrono date_time atomic)
+ set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
+ elseif(NOT Boost_VERSION VERSION_LESS 105600 AND Boost_VERSION VERSION_LESS 105900)
+ set(_Boost_CHRONO_DEPENDENCIES system)
+ set(_Boost_COROUTINE_DEPENDENCIES context system)
+ set(_Boost_FILESYSTEM_DEPENDENCIES system)
+ set(_Boost_IOSTREAMS_DEPENDENCIES regex)
+ set(_Boost_LOG_DEPENDENCIES log_setup date_time system filesystem thread regex chrono)
+ set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l atomic)
+ set(_Boost_MPI_DEPENDENCIES serialization)
+ set(_Boost_MPI_PYTHON_DEPENDENCIES python mpi serialization)
+ set(_Boost_RANDOM_DEPENDENCIES system)
+ set(_Boost_THREAD_DEPENDENCIES chrono system date_time atomic)
+ set(_Boost_TIMER_DEPENDENCIES chrono system)
+ set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread chrono date_time atomic)
+ set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
+ elseif(NOT Boost_VERSION VERSION_LESS 105900 AND Boost_VERSION VERSION_LESS 106000)
+ set(_Boost_CHRONO_DEPENDENCIES system)
+ set(_Boost_COROUTINE_DEPENDENCIES context system)
+ set(_Boost_FILESYSTEM_DEPENDENCIES system)
+ set(_Boost_IOSTREAMS_DEPENDENCIES regex)
+ set(_Boost_LOG_DEPENDENCIES log_setup date_time system filesystem thread regex chrono atomic)
+ set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l atomic)
+ set(_Boost_MPI_DEPENDENCIES serialization)
+ set(_Boost_MPI_PYTHON_DEPENDENCIES python mpi serialization)
+ set(_Boost_RANDOM_DEPENDENCIES system)
+ set(_Boost_THREAD_DEPENDENCIES chrono system date_time atomic)
+ set(_Boost_TIMER_DEPENDENCIES chrono system)
+ set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread chrono date_time atomic)
+ set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
+ else()
+ message(WARNING "Imported targets not available for Boost version ${Boost_VERSION}")
+ set(_Boost_IMPORTED_TARGETS FALSE)
+ endif()
+
+ string(TOUPPER ${component} uppercomponent)
+ set(${_ret} ${_Boost_${uppercomponent}_DEPENDENCIES} PARENT_SCOPE)
+ set(_Boost_IMPORTED_TARGETS ${_Boost_IMPORTED_TARGETS} PARENT_SCOPE)
+
+ string(REGEX REPLACE ";" " " _boost_DEPS_STRING "${_Boost_${uppercomponent}_DEPENDENCIES}")
+ if (NOT _boost_DEPS_STRING)
+ set(_boost_DEPS_STRING "(none)")
+ endif()
+ # message(STATUS "Dependencies for Boost::${component}: ${_boost_DEPS_STRING}")
+endfunction()
+
+#
+# Determine if any missing dependencies require adding to the component list.
+#
+# Sets _Boost_${COMPONENT}_DEPENDENCIES for each required component,
+# plus _Boost_IMPORTED_TARGETS (TRUE if imported targets should be
+# defined; FALSE if dependency information is unavailable).
+#
+# componentvar - the component list variable name
+#
+#
+function(_Boost_MISSING_DEPENDENCIES componentvar)
+ # _boost_unprocessed_components - list of components requiring processing
+ # _boost_processed_components - components already processed (or currently being processed)
+ # _boost_new_components - new components discovered for future processing
+ #
+ list(APPEND _boost_unprocessed_components ${${componentvar}})
+
+ while(_boost_unprocessed_components)
+ list(APPEND _boost_processed_components ${_boost_unprocessed_components})
+ foreach(component ${_boost_unprocessed_components})
+ string(TOUPPER ${component} uppercomponent)
+ set(${_ret} ${_Boost_${uppercomponent}_DEPENDENCIES} PARENT_SCOPE)
+ _Boost_COMPONENT_DEPENDENCIES("${component}" _Boost_${uppercomponent}_DEPENDENCIES)
+ set(_Boost_${uppercomponent}_DEPENDENCIES ${_Boost_${uppercomponent}_DEPENDENCIES} PARENT_SCOPE)
+ set(_Boost_IMPORTED_TARGETS ${_Boost_IMPORTED_TARGETS} PARENT_SCOPE)
+ foreach(componentdep ${_Boost_${uppercomponent}_DEPENDENCIES})
+ list(FIND _boost_processed_components "${componentdep}" _boost_component_found)
+ list(FIND _boost_new_components "${componentdep}" _boost_component_new)
+ if (_boost_component_found EQUAL -1 AND _boost_component_new EQUAL -1)
+ list(APPEND _boost_new_components ${componentdep})
+ endif()
+ endforeach()
+ endforeach()
+ set(_boost_unprocessed_components ${_boost_new_components})
+ unset(_boost_new_components)
+ endwhile()
+ set(${componentvar} ${_boost_processed_components} PARENT_SCOPE)
+endfunction()
+
+#
# End functions/macros
#
#-------------------------------------------------------------------------------
@@ -511,6 +802,10 @@ if(Boost_FIND_VERSION_EXACT)
else()
# The user has not requested an exact version. Among known
# versions, find those that are acceptable to the user request.
+ #
+ # Note: When adding a new Boost release, also update the dependency
+ # information in _Boost_COMPONENT_DEPENDENCIES. See the
+ # instructions at the top of _Boost_COMPONENT_DEPENDENCIES.
set(_Boost_KNOWN_VERSIONS ${Boost_ADDITIONAL_VERSIONS}
"1.59.0" "1.59" "1.58.0" "1.58" "1.57.0" "1.57" "1.56.0" "1.56" "1.55.0" "1.55"
@@ -562,6 +857,16 @@ if(Boost_DEBUG)
"Boost_NO_SYSTEM_PATHS = ${Boost_NO_SYSTEM_PATHS}")
endif()
+# Supply Boost_LIB_DIAGNOSTIC_DEFINITIONS as a convenience target. It
+# will only contain any interface definitions on WIN32, but is created
+# on all platforms to keep end user code free from platform dependent
+# code. Also provide convenience targets to disable autolinking and
+# enable dynamic linking.
+if(NOT TARGET Boost::diagnostic_definitions)
+ add_library(Boost::diagnostic_definitions INTERFACE IMPORTED)
+ add_library(Boost::disable_autolinking INTERFACE IMPORTED)
+ add_library(Boost::dynamic_linking INTERFACE IMPORTED)
+endif()
if(WIN32)
# In windows, automatic linking is performed, so you do not have
# to specify the libraries. If you are linking to a dynamic
@@ -581,6 +886,12 @@ if(WIN32)
# code to emit a #pragma message each time a library is selected
# for linking.
set(Boost_LIB_DIAGNOSTIC_DEFINITIONS "-DBOOST_LIB_DIAGNOSTIC")
+ set_target_properties(Boost::diagnostic_definitions PROPERTIES
+ INTERFACE_COMPILE_DEFINITIONS "BOOST_LIB_DIAGNOSTIC")
+ set_target_properties(Boost::disable_autolinking PROPERTIES
+ INTERFACE_COMPILE_DEFINITIONS "BOOST_ALL_NO_LIB")
+ set_target_properties(Boost::dynamic_linking PROPERTIES
+ INTERFACE_COMPILE_DEFINITIONS "BOOST_ALL_DYN_LINK")
endif()
_Boost_CHECK_SPELLING(Boost_ROOT)
@@ -979,6 +1290,17 @@ if(Boost_VERSION AND Boost_FIND_COMPONENTS)
endif()
endif()
+# Additional components may be required via component dependencies.
+# Add any missing components to the list.
+_Boost_MISSING_DEPENDENCIES(Boost_FIND_COMPONENTS)
+
+# If thread is required, get the thread libs as a dependency
+list(FIND Boost_FIND_COMPONENTS thread _Boost_THREAD_DEPENDENCY_LIBS)
+if(NOT _Boost_THREAD_DEPENDENCY_LIBS EQUAL -1)
+ include(CMakeFindDependencyMacro)
+ find_dependency(Threads)
+endif()
+
# If the user changed any of our control inputs flush previous results.
if(_Boost_CHANGE_LIBDIR OR _Boost_CHANGE_LIBNAME)
foreach(COMPONENT ${_Boost_COMPONENTS_SEARCHED})
@@ -1222,6 +1544,70 @@ else()
endif()
# ------------------------------------------------------------------------
+# Add imported targets
+# ------------------------------------------------------------------------
+
+if(Boost_FOUND AND _Boost_IMPORTED_TARGETS)
+ # For header-only libraries
+ if(NOT TARGET Boost::boost)
+ add_library(Boost::boost INTERFACE IMPORTED)
+ if(Boost_INCLUDE_DIRS)
+ set_target_properties(Boost::boost PROPERTIES
+ INTERFACE_INCLUDE_DIRECTORIES "${Boost_INCLUDE_DIRS}")
+ endif()
+ endif()
+
+ foreach(COMPONENT ${Boost_FIND_COMPONENTS})
+ if(NOT TARGET Boost::${COMPONENT})
+ string(TOUPPER ${COMPONENT} UPPERCOMPONENT)
+ if(Boost_${UPPERCOMPONENT}_FOUND)
+ if(Boost_USE_STATIC_LIBS)
+ add_library(Boost::${COMPONENT} STATIC IMPORTED)
+ else()
+ # Even if Boost_USE_STATIC_LIBS is OFF, we might have static
+ # libraries as a result.
+ add_library(Boost::${COMPONENT} UNKNOWN IMPORTED)
+ endif()
+ if(Boost_INCLUDE_DIRS)
+ set_target_properties(Boost::${COMPONENT} PROPERTIES
+ INTERFACE_INCLUDE_DIRECTORIES "${Boost_INCLUDE_DIRS}")
+ endif()
+ if(EXISTS "${Boost_${UPPERCOMPONENT}_LIBRARY}")
+ set_target_properties(Boost::${COMPONENT} PROPERTIES
+ IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
+ IMPORTED_LOCATION "${Boost_${UPPERCOMPONENT}_LIBRARY}")
+ endif()
+ if(EXISTS "${Boost_${UPPERCOMPONENT}_LIBRARY_DEBUG}")
+ set_property(TARGET Boost::${COMPONENT} APPEND PROPERTY
+ IMPORTED_CONFIGURATIONS DEBUG)
+ set_target_properties(Boost::${COMPONENT} PROPERTIES
+ IMPORTED_LINK_INTERFACE_LANGUAGES_DEBUG "CXX"
+ IMPORTED_LOCATION_DEBUG "${Boost_${UPPERCOMPONENT}_LIBRARY_DEBUG}")
+ endif()
+ if(EXISTS "${Boost_${UPPERCOMPONENT}_LIBRARY_RELEASE}")
+ set_property(TARGET Boost::${COMPONENT} APPEND PROPERTY
+ IMPORTED_CONFIGURATIONS RELEASE)
+ set_target_properties(Boost::${COMPONENT} PROPERTIES
+ IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE "CXX"
+ IMPORTED_LOCATION_RELEASE "${Boost_${UPPERCOMPONENT}_LIBRARY_RELEASE}")
+ endif()
+ if(_Boost_${UPPERCOMPONENT}_DEPENDENCIES)
+ unset(_Boost_${UPPERCOMPONENT}_TARGET_DEPENDENCIES)
+ foreach(dep ${_Boost_${UPPERCOMPONENT}_DEPENDENCIES})
+ list(APPEND _Boost_${UPPERCOMPONENT}_TARGET_DEPENDENCIES Boost::${dep})
+ endforeach()
+ if(COMPONENT STREQUAL "thread")
+ list(APPEND _Boost_${UPPERCOMPONENT}_TARGET_DEPENDENCIES Threads::Threads)
+ endif()
+ set_target_properties(Boost::${COMPONENT} PROPERTIES
+ INTERFACE_LINK_LIBRARIES "${_Boost_${UPPERCOMPONENT}_TARGET_DEPENDENCIES}")
+ endif()
+ endif()
+ endif()
+ endforeach()
+endif()
+
+# ------------------------------------------------------------------------
# Notification to end user about what was found
# ------------------------------------------------------------------------
diff --git a/Modules/FindJNI.cmake b/Modules/FindJNI.cmake
index cbe21d7..135038c 100644
--- a/Modules/FindJNI.cmake
+++ b/Modules/FindJNI.cmake
@@ -63,7 +63,7 @@ macro(java_append_library_directories _var)
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^(powerpc|ppc)64")
set(_java_libarch "ppc64" "ppc")
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^(powerpc|ppc)")
- set(_java_libarch "ppc")
+ set(_java_libarch "ppc" "ppc64")
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^sparc")
# Both flavours can run on the same processor
set(_java_libarch "${CMAKE_SYSTEM_PROCESSOR}" "sparc" "sparcv9")
@@ -271,7 +271,8 @@ find_path(JAVA_INCLUDE_PATH jni.h
${JAVA_AWT_INCLUDE_DIRECTORIES}
)
-find_path(JAVA_INCLUDE_PATH2 jni_md.h
+find_path(JAVA_INCLUDE_PATH2 NAMES jni_md.h jniport.h
+ PATHS
${JAVA_INCLUDE_PATH}
${JAVA_INCLUDE_PATH}/darwin
${JAVA_INCLUDE_PATH}/win32
@@ -281,6 +282,7 @@ find_path(JAVA_INCLUDE_PATH2 jni_md.h
${JAVA_INCLUDE_PATH}/solaris
${JAVA_INCLUDE_PATH}/hp-ux
${JAVA_INCLUDE_PATH}/alpha
+ ${JAVA_INCLUDE_PATH}/aix
)
find_path(JAVA_AWT_INCLUDE_PATH jawt.h
diff --git a/Modules/FindJava.cmake b/Modules/FindJava.cmake
index 9f87997..cc67df6 100644
--- a/Modules/FindJava.cmake
+++ b/Modules/FindJava.cmake
@@ -228,12 +228,12 @@ if(Java_FIND_COMPONENTS)
endif()
elseif(component STREQUAL "IdlJ")
list(APPEND _JAVA_REQUIRED_VARS Java_IDLJ_EXECUTABLE)
- if(Java_IdlJ_EXECUTABLE)
- set(Java_Extra_FOUND TRUE)
+ if(Java_IDLJ_EXECUTABLE)
+ set(Java_IdlJ_FOUND TRUE)
endif()
elseif(component STREQUAL "JarSigner")
list(APPEND _JAVA_REQUIRED_VARS Java_JARSIGNER_EXECUTABLE)
- if(Java_IDLJ_EXECUTABLE)
+ if(Java_JARSIGNER_EXECUTABLE)
set(Java_JarSigner_FOUND TRUE)
endif()
else()
diff --git a/Modules/GenerateExportHeader.cmake b/Modules/GenerateExportHeader.cmake
index 8205425..4f4efbc 100644
--- a/Modules/GenerateExportHeader.cmake
+++ b/Modules/GenerateExportHeader.cmake
@@ -230,7 +230,11 @@ macro(_test_compiler_hidden_visibility)
endmacro()
macro(_test_compiler_has_deprecated)
+ # NOTE: Some Embarcadero compilers silently compile __declspec(deprecated)
+ # without error, but this is not a documented feature and the attribute does
+ # not actually generate any warnings.
if(CMAKE_CXX_COMPILER_ID MATCHES Borland
+ OR CMAKE_CXX_COMPILER_ID MATCHES Embarcadero
OR CMAKE_CXX_COMPILER_ID MATCHES HP
OR GCC_TOO_OLD
OR CMAKE_CXX_COMPILER_ID MATCHES PGI
diff --git a/Modules/Platform/Windows-Embarcadero.cmake b/Modules/Platform/Windows-Embarcadero.cmake
index 5295a48e..102e3a6 100644
--- a/Modules/Platform/Windows-Embarcadero.cmake
+++ b/Modules/Platform/Windows-Embarcadero.cmake
@@ -78,7 +78,11 @@ set (CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO_INIT ${CMAKE_SHARED_LINKER_FLAGS_R
# invocations within a single working directory.
if(NOT DEFINED CMAKE_JOB_POOL_LINK)
set(CMAKE_JOB_POOL_LINK BCC32LinkPool)
- set_property(GLOBAL APPEND PROPERTY JOB_POOLS BCC32LinkPool=1)
+ get_property(_bccjp GLOBAL PROPERTY JOB_POOLS)
+ if(NOT _bccjp MATCHES "BCC32LinkPool=")
+ set_property(GLOBAL APPEND PROPERTY JOB_POOLS BCC32LinkPool=1)
+ endif()
+ unset(_bccjp)
endif()
macro(__embarcadero_language lang)
diff --git a/Modules/UseJava.cmake b/Modules/UseJava.cmake
index dced6ec..6146d78 100644
--- a/Modules/UseJava.cmake
+++ b/Modules/UseJava.cmake
@@ -444,7 +444,7 @@ function(add_jar _TARGET_NAME)
if (_add_jar_MANIFEST)
set(_MANIFEST_OPTION m)
- set(_MANIFEST_VALUE ${_add_jar_MANIFEST})
+ get_filename_component (_MANIFEST_VALUE "${_add_jar_MANIFEST}" ABSOLUTE)
endif ()
if (LIBRARY_OUTPUT_PATH)
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index 141015d..21c4ab4 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 4)
-set(CMake_VERSION_PATCH 20151203)
+set(CMake_VERSION_PATCH 20151207)
#set(CMake_VERSION_RC 1)
diff --git a/Source/QtDialog/CMakeLists.txt b/Source/QtDialog/CMakeLists.txt
index 66fd18b..cad11f5 100644
--- a/Source/QtDialog/CMakeLists.txt
+++ b/Source/QtDialog/CMakeLists.txt
@@ -113,12 +113,15 @@ set(SRCS
QCMakeCacheView.h
QCMakeWidgets.cxx
QCMakeWidgets.h
+ RegexExplorer.cxx
+ RegexExplorer.h
)
QT4_WRAP_UI(UI_SRCS
CMakeSetupDialog.ui
Compilers.ui
CrossCompiler.ui
AddCacheEntry.ui
+ RegexExplorer.ui
)
QT4_WRAP_CPP(MOC_SRCS
AddCacheEntry.h
@@ -128,6 +131,7 @@ QT4_WRAP_CPP(MOC_SRCS
QCMake.h
QCMakeCacheView.h
QCMakeWidgets.h
+ RegexExplorer.h
)
QT4_ADD_RESOURCES(RC_SRCS CMakeSetup.qrc)
diff --git a/Source/QtDialog/CMakeSetupDialog.cxx b/Source/QtDialog/CMakeSetupDialog.cxx
index 748dd7d..2b12834 100644
--- a/Source/QtDialog/CMakeSetupDialog.cxx
+++ b/Source/QtDialog/CMakeSetupDialog.cxx
@@ -33,6 +33,7 @@
#include "QCMakeCacheView.h"
#include "AddCacheEntry.h"
#include "FirstConfigure.h"
+#include "RegexExplorer.h"
#include "cmSystemTools.h"
#include "cmVersion.h"
@@ -125,6 +126,9 @@ CMakeSetupDialog::CMakeSetupDialog()
this, SLOT(doInstallForCommandLine()));
#endif
ToolsMenu->addSeparator();
+ ToolsMenu->addAction(tr("Regular Expression Explorer..."),
+ this, SLOT(doRegexExplorerDialog()));
+ ToolsMenu->addSeparator();
ToolsMenu->addAction(tr("&Find in Output..."),
this, SLOT(doOutputFindDialog()),
QKeySequence::Find);
@@ -1272,6 +1276,12 @@ void CMakeSetupDialog::doOutputFindDialog()
}
}
+void CMakeSetupDialog::doRegexExplorerDialog()
+{
+ RegexExplorer dialog(this);
+ dialog.exec();
+}
+
void CMakeSetupDialog::doOutputFindPrev()
{
doOutputFindNext(false);
diff --git a/Source/QtDialog/CMakeSetupDialog.h b/Source/QtDialog/CMakeSetupDialog.h
index 1b26c64..bfd2bc9 100644
--- a/Source/QtDialog/CMakeSetupDialog.h
+++ b/Source/QtDialog/CMakeSetupDialog.h
@@ -82,6 +82,7 @@ protected slots:
void doOutputFindNext(bool directionForward = true);
void doOutputFindPrev();
void doOutputErrorNext();
+ void doRegexExplorerDialog();
protected:
diff --git a/Source/QtDialog/RegexExplorer.cxx b/Source/QtDialog/RegexExplorer.cxx
new file mode 100644
index 0000000..dfcf048
--- /dev/null
+++ b/Source/QtDialog/RegexExplorer.cxx
@@ -0,0 +1,166 @@
+/*============================================================================
+ CMake - Cross Platform Makefile Generator
+ Copyright 2015 Kitware, Inc., Gregor Jasny
+
+ Distributed under the OSI-approved BSD License (the "License");
+ see accompanying file Copyright.txt for details.
+
+ This software is distributed WITHOUT ANY WARRANTY; without even the
+ implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ See the License for more information.
+============================================================================*/
+
+#include "RegexExplorer.h"
+
+RegexExplorer::RegexExplorer(QWidget* p) : QDialog(p), m_matched(false)
+{
+ this->setupUi(this);
+
+ for(int i = 1; i < cmsys::RegularExpression::NSUBEXP; ++i)
+ {
+ matchNumber->addItem(
+ QString("Match %1").arg(QString::number(i)),
+ QVariant(i));
+ }
+ matchNumber->setCurrentIndex(0);
+}
+
+void RegexExplorer::setStatusColor(QWidget* widget, bool successful)
+{
+ QColor color = successful ? QColor(0, 127, 0) : Qt::red;
+
+ QPalette palette = widget->palette();
+ palette.setColor(QPalette::Foreground, color);
+ widget->setPalette(palette);
+}
+
+void RegexExplorer::on_regularExpression_textChanged(const QString& text)
+{
+#ifdef QT_NO_STL
+ m_regex = text.toAscii().constData();
+#else
+ m_regex = text.toStdString();
+#endif
+
+ bool validExpression =
+ stripEscapes(m_regex) && m_regexParser.compile(m_regex);
+ if(!validExpression)
+ {
+ m_regexParser.set_invalid();
+ }
+
+ setStatusColor(labelRegexValid, validExpression);
+
+ on_inputText_textChanged();
+}
+
+void RegexExplorer::on_inputText_textChanged()
+{
+ if(m_regexParser.is_valid())
+ {
+ QString plainText = inputText->toPlainText();
+#ifdef QT_NO_STL
+ m_text = plainText.toAscii().constData();
+#else
+ m_text = plainText.toStdString();
+#endif
+ m_matched = m_regexParser.find(m_text);
+ }
+ else
+ {
+ m_matched = false;
+ }
+
+ setStatusColor(labelRegexMatch, m_matched);
+
+ if(!m_matched)
+ {
+ clearMatch();
+ return;
+ }
+
+#ifdef QT_NO_STL
+ QString matchText = m_regexParser.match(0).c_str();
+#else
+ QString matchText = QString::fromStdString(m_regexParser.match(0));
+#endif
+ match0->setPlainText(matchText);
+
+ on_matchNumber_currentIndexChanged(matchNumber->currentIndex());
+}
+
+void RegexExplorer::on_matchNumber_currentIndexChanged(int index)
+{
+ if(!m_matched)
+ {
+ return;
+ }
+
+ QVariant itemData = matchNumber->itemData(index);
+ int idx = itemData.toInt();
+
+ if(idx < 1 || idx >= cmsys::RegularExpression::NSUBEXP)
+ {
+ return;
+ }
+
+#ifdef QT_NO_STL
+ QString match = m_regexParser.match(idx).c_str();
+#else
+ QString match = QString::fromStdString(m_regexParser.match(idx));
+#endif
+ matchN->setPlainText(match);
+}
+
+void RegexExplorer::clearMatch()
+{
+ match0->clear();
+ matchN->clear();
+}
+
+bool RegexExplorer::stripEscapes(std::string& source)
+{
+ const char* in = source.c_str();
+
+ std::string result;
+ result.reserve(source.size());
+
+ for(char inc = *in; inc != '\0'; inc = *++in)
+ {
+ if(inc == '\\')
+ {
+ char nextc = in[1];
+ if(nextc == 't')
+ {
+ result.append(1, '\t');
+ in++;
+ }
+ else if(nextc == 'n')
+ {
+ result.append(1, '\n');
+ in++;
+ }
+ else if(nextc == 't')
+ {
+ result.append(1, '\t');
+ in++;
+ }
+ else if(isalnum(nextc) || nextc == '\0')
+ {
+ return false;
+ }
+ else
+ {
+ result.append(1, nextc);
+ in++;
+ }
+ }
+ else
+ {
+ result.append(1, inc);
+ }
+ }
+
+ source = result;
+ return true;
+}
diff --git a/Source/QtDialog/RegexExplorer.h b/Source/QtDialog/RegexExplorer.h
new file mode 100644
index 0000000..2ac9c3e
--- /dev/null
+++ b/Source/QtDialog/RegexExplorer.h
@@ -0,0 +1,48 @@
+/*============================================================================
+ CMake - Cross Platform Makefile Generator
+ Copyright 2015 Kitware, Inc., Gregor Jasny
+
+ Distributed under the OSI-approved BSD License (the "License");
+ see accompanying file Copyright.txt for details.
+
+ This software is distributed WITHOUT ANY WARRANTY; without even the
+ implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ See the License for more information.
+============================================================================*/
+
+#ifndef RegexExplorer_h
+#define RegexExplorer_h
+
+#include <string>
+#include <cmsys/RegularExpression.hxx>
+#include <QDialog>
+
+#include "ui_RegexExplorer.h"
+
+class QString;
+class QWidget;
+
+class RegexExplorer : public QDialog, public Ui::RegexExplorer
+{
+ Q_OBJECT
+public:
+ RegexExplorer(QWidget* p);
+
+private slots:
+ void on_regularExpression_textChanged(const QString& text);
+ void on_inputText_textChanged();
+ void on_matchNumber_currentIndexChanged(int index);
+
+private:
+ static void setStatusColor(QWidget* widget, bool successful);
+ static bool stripEscapes(std::string& regex);
+
+ void clearMatch();
+
+ cmsys::RegularExpression m_regexParser;
+ std::string m_text;
+ std::string m_regex;
+ bool m_matched;
+};
+
+#endif
diff --git a/Source/QtDialog/RegexExplorer.ui b/Source/QtDialog/RegexExplorer.ui
new file mode 100644
index 0000000..2c2d761
--- /dev/null
+++ b/Source/QtDialog/RegexExplorer.ui
@@ -0,0 +1,155 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>RegexExplorer</class>
+ <widget class="QDialog" name="RegexExplorer">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>639</width>
+ <height>555</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>Regular Expression Explorer</string>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout">
+ <item>
+ <widget class="QLabel" name="label">
+ <property name="text">
+ <string>Input Text</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPlainTextEdit" name="inputText"/>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_2">
+ <item>
+ <widget class="QLabel" name="label_2">
+ <property name="text">
+ <string>Regular Expression</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer_3">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>QSizePolicy::Fixed</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QLabel" name="labelRegexValid">
+ <property name="text">
+ <string>Valid</string>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignCenter</set>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer_4">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>QSizePolicy::Fixed</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QLabel" name="labelRegexMatch">
+ <property name="text">
+ <string>Match</string>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignCenter</set>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer_2">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="regularExpression"/>
+ </item>
+ <item>
+ <widget class="QLabel" name="label_3">
+ <property name="text">
+ <string>Complete Match</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPlainTextEdit" name="match0">
+ <property name="readOnly">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout">
+ <item>
+ <widget class="QComboBox" name="matchNumber">
+ <property name="editable">
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <widget class="QPlainTextEdit" name="matchN">
+ <property name="readOnly">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index cc424b4..b05fb41 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -3752,7 +3752,11 @@ void cmGeneratorTarget::ConstructSourceFileFlags() const
if(cmSourceFile* sf = this->Makefile->GetSource(*it))
{
SourceFileFlags& flags = this->SourceFlagsMap[sf];
- flags.MacFolder = "Resources";
+ flags.MacFolder = "";
+ if(!this->Makefile->PlatformIsAppleIos())
+ {
+ flags.MacFolder = "Resources";
+ }
flags.Type = cmGeneratorTarget::SourceFileTypeResource;
}
}
diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx
index 21b126b..0dc5a9a 100644
--- a/Source/cmcmd.cxx
+++ b/Source/cmcmd.cxx
@@ -52,25 +52,25 @@ void CMakeCommandUsage(const char* program)
// If you add new commands, change here,
// and in cmakemain.cxx in the options table
errorStream
- << "Usage: " << program << " -E [command] [arguments ...]\n"
+ << "Usage: " << program << " -E <command> [arguments...]\n"
<< "Available commands: \n"
<< " chdir dir cmd [args]... - run command in a given directory\n"
<< " compare_files file1 file2 - check if file1 is same as file2\n"
- << " copy file destination - copy file to destination (either file "
- "or directory)\n"
+ << " copy <file>... destination - copy files to destination "
+ "(either file or directory)\n"
<< " copy_directory source destination - copy directory 'source' "
"content to directory 'destination'\n"
- << " copy_if_different in-file out-file - copy file if input has "
+ << " copy_if_different <file>... destination - copy files if it has "
"changed\n"
- << " echo [string]... - displays arguments as text\n"
- << " echo_append [string]... - displays arguments as text but no new "
+ << " echo [<string>...] - displays arguments as text\n"
+ << " echo_append [<string>...] - displays arguments as text but no new "
"line\n"
<< " env [--unset=NAME]... [NAME=VALUE]... COMMAND [ARG]...\n"
<< " - run command in a modified environment\n"
<< " environment - display the current environment\n"
<< " make_directory dir - create a directory\n"
- << " md5sum file1 [...] - compute md5sum of files\n"
- << " remove [-f] file1 file2 ... - remove the file(s), use -f to force "
+ << " md5sum <file>... - compute md5sum of files\n"
+ << " remove [-f] <file>... - remove the file(s), use -f to force "
"it\n"
<< " remove_directory dir - remove a directory and its contents\n"
<< " rename oldname newname - rename a file or directory "
@@ -78,7 +78,7 @@ void CMakeCommandUsage(const char* program)
<< " tar [cxt][vf][zjJ] file.tar [file/dir1 file/dir2 ...]\n"
<< " - create or extract a tar or zip archive\n"
<< " sleep <number>... - sleep for given number of seconds\n"
- << " time command [args] ... - run command and return elapsed time\n"
+ << " time command [args...] - run command and return elapsed time\n"
<< " touch file - touch a file.\n"
<< " touch_nocreate file - touch a file but do not create it.\n"
#if defined(_WIN32) && !defined(__CYGWIN__)
@@ -149,29 +149,60 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args)
if (args.size() > 1)
{
// Copy file
- if (args[1] == "copy" && args.size() == 4)
+ if (args[1] == "copy" && args.size() > 3)
{
- if(!cmSystemTools::cmCopyFile(args[2].c_str(), args[3].c_str()))
+ // If multiple source files specified,
+ // then destination must be directory
+ if ((args.size() > 4) &&
+ (!cmSystemTools::FileIsDirectory(args[args.size() - 1])))
{
- std::cerr << "Error copying file \"" << args[2]
- << "\" to \"" << args[3] << "\".\n";
+ std::cerr << "Error: Target (for copy command) \""
+ << args[args.size() - 1]
+ << "\" is not a directory.\n";
return 1;
}
- return 0;
+ // If error occurs we want to continue copying next files.
+ bool return_value = 0;
+ for (std::string::size_type cc = 2; cc < args.size() - 1; cc ++)
+ {
+ if(!cmSystemTools::cmCopyFile(args[cc].c_str(),
+ args[args.size() - 1].c_str()))
+ {
+ std::cerr << "Error copying file \"" << args[cc]
+ << "\" to \"" << args[args.size() - 1] << "\".\n";
+ return_value = 1;
+ }
+ }
+ return return_value;
}
// Copy file if different.
- if (args[1] == "copy_if_different" && args.size() == 4)
+ if (args[1] == "copy_if_different" && args.size() > 3)
{
- if(!cmSystemTools::CopyFileIfDifferent(args[2].c_str(),
- args[3].c_str()))
+ // If multiple source files specified,
+ // then destination must be directory
+ if ((args.size() > 4) &&
+ (!cmSystemTools::FileIsDirectory(args[args.size() - 1])))
{
- std::cerr << "Error copying file (if different) from \""
- << args[2] << "\" to \"" << args[3]
- << "\".\n";
+ std::cerr << "Error: Target (for copy_if_different command) \""
+ << args[args.size() - 1]
+ << "\" is not a directory.\n";
return 1;
}
- return 0;
+ // If error occurs we want to continue copying next files.
+ bool return_value = 0;
+ for (std::string::size_type cc = 2; cc < args.size() - 1; cc ++)
+ {
+ if(!cmSystemTools::CopyFileIfDifferent(args[cc].c_str(),
+ args[args.size() - 1].c_str()))
+ {
+ std::cerr << "Error copying file (if different) from \""
+ << args[cc] << "\" to \"" << args[args.size() - 1]
+ << "\".\n";
+ return_value = 1;
+ }
+ }
+ return return_value;
}
// Copy directory content
diff --git a/Source/kwsys/SystemTools.cxx b/Source/kwsys/SystemTools.cxx
index 37fe421..82087f0 100644
--- a/Source/kwsys/SystemTools.cxx
+++ b/Source/kwsys/SystemTools.cxx
@@ -2402,8 +2402,7 @@ bool SystemTools::CopyFileAlways(const std::string& source, const std::string& d
// name as the source in that directory.
std::string destination_dir;
- if(SystemTools::FileExists(destination) &&
- SystemTools::FileIsDirectory(destination))
+ if(SystemTools::FileIsDirectory(destination))
{
destination_dir = real_destination;
SystemTools::ConvertToUnixSlashes(real_destination);
@@ -2969,19 +2968,14 @@ std::string SystemTools::FindProgram(
const std::vector<std::string>& userPaths,
bool no_system_path)
{
- std::vector<std::string> extensions;
std::string tryPath;
#if defined (_WIN32) || defined(__CYGWIN__) || defined(__MINGW32__)
- bool hasExtension = false;
+ std::vector<std::string> extensions;
// check to see if the name already has a .xxx at
// the end of it
- if(name.size() > 3 && name[name.size()-4] == '.')
- {
- hasExtension = true;
- }
// on windows try .com then .exe
- if(!hasExtension)
+ if(name.size() <= 3 || name[name.size()-4] != '.')
{
extensions.push_back(".com");
extensions.push_back(".exe");
@@ -2992,8 +2986,7 @@ std::string SystemTools::FindProgram(
{
tryPath = name;
tryPath += *i;
- if(SystemTools::FileExists(tryPath) &&
- !SystemTools::FileIsDirectory(tryPath))
+ if(SystemTools::FileExists(tryPath, true))
{
return SystemTools::CollapseFullPath(tryPath);
}
@@ -3002,11 +2995,9 @@ std::string SystemTools::FindProgram(
#endif
// now try just the name
- tryPath = name;
- if(SystemTools::FileExists(tryPath) &&
- !SystemTools::FileIsDirectory(tryPath))
+ if(SystemTools::FileExists(name, true))
{
- return SystemTools::CollapseFullPath(tryPath);
+ return SystemTools::CollapseFullPath(name);
}
// now construct the path
std::vector<std::string> path;
@@ -3043,6 +3034,7 @@ std::string SystemTools::FindProgram(
// Remove double quotes from the path on windows
SystemTools::ReplaceString(*p, "\"", "");
#endif
+#if defined (_WIN32) || defined(__CYGWIN__) || defined(__MINGW32__)
// first try with extensions
for(std::vector<std::string>::iterator ext
= extensions.begin(); ext != extensions.end(); ++ext)
@@ -3055,6 +3047,7 @@ std::string SystemTools::FindProgram(
return SystemTools::CollapseFullPath(tryPath);
}
}
+#endif
// now try it without them
tryPath = *p;
tryPath += name;
@@ -3133,8 +3126,7 @@ std::string SystemTools
tryPath = *p;
tryPath += name;
tryPath += ".framework";
- if(SystemTools::FileExists(tryPath)
- && SystemTools::FileIsDirectory(tryPath))
+ if(SystemTools::FileIsDirectory(tryPath))
{
return SystemTools::CollapseFullPath(tryPath);
}
diff --git a/Source/kwsys/testSystemTools.cxx b/Source/kwsys/testSystemTools.cxx
index a0f904f..4d97688 100644
--- a/Source/kwsys/testSystemTools.cxx
+++ b/Source/kwsys/testSystemTools.cxx
@@ -172,6 +172,63 @@ static bool CheckFileOperations()
<< testNewDir << std::endl;
res = false;
}
+ // calling it again should just return true
+ if (!kwsys::SystemTools::MakeDirectory(testNewDir))
+ {
+ std::cerr
+ << "Problem with second call to MakeDirectory for: "
+ << testNewDir << std::endl;
+ res = false;
+ }
+ // calling with 0 pointer should return false
+ if (kwsys::SystemTools::MakeDirectory(0))
+ {
+ std::cerr
+ << "Problem with MakeDirectory(0)"
+ << std::endl;
+ res = false;
+ }
+ // calling with an empty string should return false
+ if (kwsys::SystemTools::MakeDirectory(std::string()))
+ {
+ std::cerr
+ << "Problem with MakeDirectory(std::string())"
+ << std::endl;
+ res = false;
+ }
+ // check existence
+ if (!kwsys::SystemTools::FileExists(testNewDir.c_str(), false))
+ {
+ std::cerr
+ << "Problem with FileExists as C string and not file for: "
+ << testNewDir << std::endl;
+ res = false;
+ }
+ // remove it
+ if (!kwsys::SystemTools::RemoveADirectory(testNewDir))
+ {
+ std::cerr
+ << "Problem with RemoveADirectory for: "
+ << testNewDir << std::endl;
+ res = false;
+ }
+ // check existence
+ if (kwsys::SystemTools::FileExists(testNewDir.c_str(), false))
+ {
+ std::cerr
+ << "After RemoveADirectory: "
+ << "Problem with FileExists as C string and not file for: "
+ << testNewDir << std::endl;
+ res = false;
+ }
+ // create it using the char* version
+ if (!kwsys::SystemTools::MakeDirectory(testNewDir.c_str()))
+ {
+ std::cerr
+ << "Problem with second call to MakeDirectory as C string for: "
+ << testNewDir << std::endl;
+ res = false;
+ }
if (!kwsys::SystemTools::Touch(testNewFile.c_str(), true))
{
@@ -180,6 +237,97 @@ static bool CheckFileOperations()
<< testNewFile << std::endl;
res = false;
}
+ // calling MakeDirectory with something that is no file should fail
+ if (kwsys::SystemTools::MakeDirectory(testNewFile))
+ {
+ std::cerr
+ << "Problem with to MakeDirectory for: "
+ << testNewFile << std::endl;
+ res = false;
+ }
+
+ // calling with 0 pointer should return false
+ if (kwsys::SystemTools::FileExists(0))
+ {
+ std::cerr
+ << "Problem with FileExists(0)"
+ << std::endl;
+ res = false;
+ }
+ if (kwsys::SystemTools::FileExists(0, true))
+ {
+ std::cerr
+ << "Problem with FileExists(0) as file"
+ << std::endl;
+ res = false;
+ }
+ // calling with an empty string should return false
+ if (kwsys::SystemTools::FileExists(std::string()))
+ {
+ std::cerr
+ << "Problem with FileExists(std::string())"
+ << std::endl;
+ res = false;
+ }
+ // FileExists(x, true) should return false on a directory
+ if (kwsys::SystemTools::FileExists(testNewDir, true))
+ {
+ std::cerr
+ << "Problem with FileExists as file for: "
+ << testNewDir << std::endl;
+ res = false;
+ }
+ if (kwsys::SystemTools::FileExists(testNewDir.c_str(), true))
+ {
+ std::cerr
+ << "Problem with FileExists as C string and file for: "
+ << testNewDir << std::endl;
+ res = false;
+ }
+ // FileExists(x, false) should return true even on a directory
+ if (!kwsys::SystemTools::FileExists(testNewDir, false))
+ {
+ std::cerr
+ << "Problem with FileExists as not file for: "
+ << testNewDir << std::endl;
+ res = false;
+ }
+ if (!kwsys::SystemTools::FileExists(testNewDir.c_str(), false))
+ {
+ std::cerr
+ << "Problem with FileExists as C string and not file for: "
+ << testNewDir << std::endl;
+ res = false;
+ }
+ // should work, was created as new file before
+ if (!kwsys::SystemTools::FileExists(testNewFile))
+ {
+ std::cerr
+ << "Problem with FileExists for: "
+ << testNewDir << std::endl;
+ res = false;
+ }
+ if (!kwsys::SystemTools::FileExists(testNewFile.c_str()))
+ {
+ std::cerr
+ << "Problem with FileExists as C string for: "
+ << testNewDir << std::endl;
+ res = false;
+ }
+ if (!kwsys::SystemTools::FileExists(testNewFile, true))
+ {
+ std::cerr
+ << "Problem with FileExists as file for: "
+ << testNewDir << std::endl;
+ res = false;
+ }
+ if (!kwsys::SystemTools::FileExists(testNewFile.c_str(), true))
+ {
+ std::cerr
+ << "Problem with FileExists as C string and file for: "
+ << testNewDir << std::endl;
+ res = false;
+ }
// Reset umask
#if defined(_WIN32) && !defined(__CYGWIN__)
@@ -851,6 +999,44 @@ static bool CheckGetPath()
return res;
}
+static bool CheckFind()
+{
+ bool res = true;
+ const std::string testFindFileName("testFindFile.txt");
+ const std::string testFindFile(TEST_SYSTEMTOOLS_BINARY_DIR "/"
+ + testFindFileName);
+
+ if (!kwsys::SystemTools::Touch(testFindFile.c_str(), true))
+ {
+ std::cerr
+ << "Problem with Touch for: "
+ << testFindFile << std::endl;
+ // abort here as the existence of the file only makes the test meaningful
+ return false;
+ }
+
+ std::vector<std::string> searchPaths;
+ searchPaths.push_back(TEST_SYSTEMTOOLS_BINARY_DIR);
+ if (kwsys::SystemTools::FindFile(testFindFileName,
+ searchPaths, true).empty())
+ {
+ std::cerr
+ << "Problem with FindFile without system paths for: "
+ << testFindFileName << std::endl;
+ res = false;
+ }
+ if (kwsys::SystemTools::FindFile(testFindFileName,
+ searchPaths, false).empty())
+ {
+ std::cerr
+ << "Problem with FindFile with system paths for: "
+ << testFindFileName << std::endl;
+ res = false;
+ }
+
+ return res;
+}
+
//----------------------------------------------------------------------------
int testSystemTools(int, char*[])
{
@@ -888,5 +1074,7 @@ int testSystemTools(int, char*[])
res &= CheckGetPath();
+ res &= CheckFind();
+
return res ? 0 : 1;
}
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index a040ec0..5d492cf 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -269,8 +269,7 @@ if(BUILD_TESTING)
set(TEST_RESOURCES TRUE)
endif()
# for borland and watcom there is no resource support
- if("${CMAKE_GENERATOR}" MATCHES "WMake" OR
- "${CMAKE_GENERATOR}" MATCHES "Borland")
+ if(WATCOM OR BORLAND)
set(TEST_RESOURCES FALSE)
endif()
if(TEST_RESOURCES)
@@ -1356,6 +1355,10 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release
endif()
endif()
+ if(CMake_TEST_FindBoost)
+ add_subdirectory(FindBoost)
+ endif()
+
if(CMake_TEST_FindGSL)
add_subdirectory(FindGSL)
endif()
diff --git a/Tests/CMakeOnly/CompilerIdC/CMakeLists.txt b/Tests/CMakeOnly/CompilerIdC/CMakeLists.txt
index 848ffdd..6fea73e 100644
--- a/Tests/CMakeOnly/CompilerIdC/CMakeLists.txt
+++ b/Tests/CMakeOnly/CompilerIdC/CMakeLists.txt
@@ -12,3 +12,10 @@ foreach(v
message(SEND_ERROR "${v} not set!")
endif()
endforeach()
+
+# Version numbers may only contain numbers and periods.
+if(NOT CMAKE_C_COMPILER_VERSION MATCHES
+ "^([0-9]+)(\\.([0-9]+))?(\\.([0-9]+))?(\\.([0-9]+))?$"
+ )
+ message(SEND_ERROR "Compiler version is not numeric!")
+endif()
diff --git a/Tests/CMakeOnly/CompilerIdCXX/CMakeLists.txt b/Tests/CMakeOnly/CompilerIdCXX/CMakeLists.txt
index 94ac31e..05e6bb2 100644
--- a/Tests/CMakeOnly/CompilerIdCXX/CMakeLists.txt
+++ b/Tests/CMakeOnly/CompilerIdCXX/CMakeLists.txt
@@ -12,3 +12,10 @@ foreach(v
message(SEND_ERROR "${v} not set!")
endif()
endforeach()
+
+# Version numbers may only contain numbers and periods.
+if(NOT CMAKE_CXX_COMPILER_VERSION MATCHES
+ "^([0-9]+)(\\.([0-9]+))?(\\.([0-9]+))?(\\.([0-9]+))?$"
+ )
+ message(SEND_ERROR "Compiler version is not numeric!")
+endif()
diff --git a/Tests/CMakeOnly/CompilerIdFortran/CMakeLists.txt b/Tests/CMakeOnly/CompilerIdFortran/CMakeLists.txt
index 02e4668..067fb8c 100644
--- a/Tests/CMakeOnly/CompilerIdFortran/CMakeLists.txt
+++ b/Tests/CMakeOnly/CompilerIdFortran/CMakeLists.txt
@@ -12,3 +12,10 @@ foreach(v
message(SEND_ERROR "${v} not set!")
endif()
endforeach()
+
+# Version numbers may only contain numbers and periods.
+if(NOT CMAKE_Fortran_COMPILER_VERSION MATCHES
+ "^([0-9]+)(\\.([0-9]+))?(\\.([0-9]+))?(\\.([0-9]+))?$"
+ )
+ message(SEND_ERROR "Compiler version is not numeric!")
+endif()
diff --git a/Tests/CompileOptions/CMakeLists.txt b/Tests/CompileOptions/CMakeLists.txt
index 05a5f82..692e0de 100644
--- a/Tests/CompileOptions/CMakeLists.txt
+++ b/Tests/CompileOptions/CMakeLists.txt
@@ -22,7 +22,7 @@ set_property(TARGET CompileOptions PROPERTY COMPILE_OPTIONS
${cxx_tests}
)
-if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang|Borland")
+if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang|Borland|Embarcadero")
set_property(TARGET CompileOptions APPEND PROPERTY COMPILE_OPTIONS
"-DTEST_OCTOTHORPE=\"#\""
)
diff --git a/Tests/FindBoost/CMakeLists.txt b/Tests/FindBoost/CMakeLists.txt
new file mode 100644
index 0000000..259ee26
--- /dev/null
+++ b/Tests/FindBoost/CMakeLists.txt
@@ -0,0 +1,10 @@
+add_test(NAME FindBoost.Test COMMAND
+ ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/FindBoost/Test"
+ "${CMake_BINARY_DIR}/Tests/FindBoost/Test"
+ ${build_generator_args}
+ --build-project TestFindBoost
+ --build-options ${build_options}
+ --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
+ )
diff --git a/Tests/FindBoost/Test/CMakeLists.txt b/Tests/FindBoost/Test/CMakeLists.txt
new file mode 100644
index 0000000..ce50fc7
--- /dev/null
+++ b/Tests/FindBoost/Test/CMakeLists.txt
@@ -0,0 +1,18 @@
+cmake_minimum_required(VERSION 3.1)
+project(TestFindBoost CXX)
+include(CTest)
+
+find_package(Boost REQUIRED COMPONENTS filesystem thread)
+
+add_executable(test_boost_tgt main.cxx)
+target_link_libraries(test_boost_tgt
+ Boost::dynamic_linking
+ Boost::disable_autolinking
+ Boost::filesystem
+ Boost::thread)
+add_test(NAME test_boost_tgt COMMAND test_boost_tgt)
+
+add_executable(test_boost_var main.cxx)
+target_include_directories(test_boost_var PRIVATE ${Boost_INCLUDE_DIRS})
+target_link_libraries(test_boost_var PRIVATE ${Boost_FILESYSTEM_LIBRARIES} ${Boost_SYSTEM_LIBRARIES} ${Boost_THREAD_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
+add_test(NAME test_boost_var COMMAND test_boost_var)
diff --git a/Tests/FindBoost/Test/main.cxx b/Tests/FindBoost/Test/main.cxx
new file mode 100644
index 0000000..0f44f30
--- /dev/null
+++ b/Tests/FindBoost/Test/main.cxx
@@ -0,0 +1,26 @@
+#include <boost/filesystem.hpp>
+#include <boost/thread.hpp>
+
+namespace
+{
+
+ boost::mutex m1;
+ boost::recursive_mutex m2;
+
+ void
+ threadmain()
+ {
+ boost::lock_guard<boost::mutex> lock1(m1);
+ boost::lock_guard<boost::recursive_mutex> lock2(m2);
+
+ boost::filesystem::path p(boost::filesystem::current_path());
+ }
+
+}
+
+int main() {
+ boost::thread foo(threadmain);
+ foo.join();
+
+ return 0;
+}
diff --git a/Tests/RunCMake/CommandLine/E-no-arg-stderr.txt b/Tests/RunCMake/CommandLine/E-no-arg-stderr.txt
index 056ce05..50d9b03 100644
--- a/Tests/RunCMake/CommandLine/E-no-arg-stderr.txt
+++ b/Tests/RunCMake/CommandLine/E-no-arg-stderr.txt
@@ -1,3 +1,3 @@
^CMake Error: cmake version .*
-Usage: .* -E \[command\] \[arguments ...\]
+Usage: .* -E <command> \[arguments\.\.\.\]
Available commands:
diff --git a/Tests/RunCMake/CommandLine/E_copy-one-source-directory-target-is-directory-result.txt b/Tests/RunCMake/CommandLine/E_copy-one-source-directory-target-is-directory-result.txt
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_copy-one-source-directory-target-is-directory-result.txt
@@ -0,0 +1 @@
+0
diff --git a/Tests/RunCMake/CommandLine/E_copy-one-source-directory-target-is-directory-stderr.txt b/Tests/RunCMake/CommandLine/E_copy-one-source-directory-target-is-directory-stderr.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_copy-one-source-directory-target-is-directory-stderr.txt
diff --git a/Tests/RunCMake/CommandLine/E_copy-one-source-file-result.txt b/Tests/RunCMake/CommandLine/E_copy-one-source-file-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_copy-one-source-file-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CommandLine/E_copy-one-source-file-stderr.txt b/Tests/RunCMake/CommandLine/E_copy-one-source-file-stderr.txt
new file mode 100644
index 0000000..9a9301d
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_copy-one-source-file-stderr.txt
@@ -0,0 +1 @@
+^CMake Error: .*
diff --git a/Tests/RunCMake/CommandLine/E_copy-three-source-files-target-is-directory-result.txt b/Tests/RunCMake/CommandLine/E_copy-three-source-files-target-is-directory-result.txt
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_copy-three-source-files-target-is-directory-result.txt
@@ -0,0 +1 @@
+0
diff --git a/Tests/RunCMake/CommandLine/E_copy-three-source-files-target-is-directory-stderr.txt b/Tests/RunCMake/CommandLine/E_copy-three-source-files-target-is-directory-stderr.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_copy-three-source-files-target-is-directory-stderr.txt
diff --git a/Tests/RunCMake/CommandLine/E_copy-three-source-files-target-is-file-result.txt b/Tests/RunCMake/CommandLine/E_copy-three-source-files-target-is-file-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_copy-three-source-files-target-is-file-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CommandLine/E_copy-three-source-files-target-is-file-stderr.txt b/Tests/RunCMake/CommandLine/E_copy-three-source-files-target-is-file-stderr.txt
new file mode 100644
index 0000000..9504216
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_copy-three-source-files-target-is-file-stderr.txt
@@ -0,0 +1 @@
+^Error: Target \(for copy command\).* is not a directory.$
diff --git a/Tests/RunCMake/CommandLine/E_copy-two-good-and-one-bad-source-files-target-is-directory-result.txt b/Tests/RunCMake/CommandLine/E_copy-two-good-and-one-bad-source-files-target-is-directory-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_copy-two-good-and-one-bad-source-files-target-is-directory-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CommandLine/E_copy-two-good-and-one-bad-source-files-target-is-directory-stderr.txt b/Tests/RunCMake/CommandLine/E_copy-two-good-and-one-bad-source-files-target-is-directory-stderr.txt
new file mode 100644
index 0000000..2d0d986
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_copy-two-good-and-one-bad-source-files-target-is-directory-stderr.txt
@@ -0,0 +1 @@
+^Error copying file .*not_existing_file.bad\" to .*
diff --git a/Tests/RunCMake/CommandLine/E_copy_if_different-one-source-directory-target-is-directory-result.txt b/Tests/RunCMake/CommandLine/E_copy_if_different-one-source-directory-target-is-directory-result.txt
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_copy_if_different-one-source-directory-target-is-directory-result.txt
@@ -0,0 +1 @@
+0
diff --git a/Tests/RunCMake/CommandLine/E_copy_if_different-one-source-directory-target-is-directory-stderr.txt b/Tests/RunCMake/CommandLine/E_copy_if_different-one-source-directory-target-is-directory-stderr.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_copy_if_different-one-source-directory-target-is-directory-stderr.txt
diff --git a/Tests/RunCMake/CommandLine/E_copy_if_different-three-source-files-target-is-directory-result.txt b/Tests/RunCMake/CommandLine/E_copy_if_different-three-source-files-target-is-directory-result.txt
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_copy_if_different-three-source-files-target-is-directory-result.txt
@@ -0,0 +1 @@
+0
diff --git a/Tests/RunCMake/CommandLine/E_copy_if_different-three-source-files-target-is-directory-stderr.txt b/Tests/RunCMake/CommandLine/E_copy_if_different-three-source-files-target-is-directory-stderr.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_copy_if_different-three-source-files-target-is-directory-stderr.txt
diff --git a/Tests/RunCMake/CommandLine/E_copy_if_different-three-source-files-target-is-file-result.txt b/Tests/RunCMake/CommandLine/E_copy_if_different-three-source-files-target-is-file-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_copy_if_different-three-source-files-target-is-file-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CommandLine/E_copy_if_different-three-source-files-target-is-file-stderr.txt b/Tests/RunCMake/CommandLine/E_copy_if_different-three-source-files-target-is-file-stderr.txt
new file mode 100644
index 0000000..64b7b1b
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_copy_if_different-three-source-files-target-is-file-stderr.txt
@@ -0,0 +1 @@
+^Error: Target \(for copy_if_different command\).* is not a directory.$
diff --git a/Tests/RunCMake/CommandLine/E_create_symlink-no-arg-stderr.txt b/Tests/RunCMake/CommandLine/E_create_symlink-no-arg-stderr.txt
index 056ce05..50d9b03 100644
--- a/Tests/RunCMake/CommandLine/E_create_symlink-no-arg-stderr.txt
+++ b/Tests/RunCMake/CommandLine/E_create_symlink-no-arg-stderr.txt
@@ -1,3 +1,3 @@
^CMake Error: cmake version .*
-Usage: .* -E \[command\] \[arguments ...\]
+Usage: .* -E <command> \[arguments\.\.\.\]
Available commands:
diff --git a/Tests/RunCMake/CommandLine/E_rename-no-arg-stderr.txt b/Tests/RunCMake/CommandLine/E_rename-no-arg-stderr.txt
index 056ce05..50d9b03 100644
--- a/Tests/RunCMake/CommandLine/E_rename-no-arg-stderr.txt
+++ b/Tests/RunCMake/CommandLine/E_rename-no-arg-stderr.txt
@@ -1,3 +1,3 @@
^CMake Error: cmake version .*
-Usage: .* -E \[command\] \[arguments ...\]
+Usage: .* -E <command> \[arguments\.\.\.\]
Available commands:
diff --git a/Tests/RunCMake/CommandLine/E_touch_nocreate-no-arg-stderr.txt b/Tests/RunCMake/CommandLine/E_touch_nocreate-no-arg-stderr.txt
index 056ce05..50d9b03 100644
--- a/Tests/RunCMake/CommandLine/E_touch_nocreate-no-arg-stderr.txt
+++ b/Tests/RunCMake/CommandLine/E_touch_nocreate-no-arg-stderr.txt
@@ -1,3 +1,3 @@
^CMake Error: cmake version .*
-Usage: .* -E \[command\] \[arguments ...\]
+Usage: .* -E <command> \[arguments\.\.\.\]
Available commands:
diff --git a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
index 6b4b384..dbc235d 100644
--- a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
@@ -101,6 +101,29 @@ if(UNIX)
)
endif()
+set(in ${RunCMake_SOURCE_DIR}/copy_input)
+set(out ${RunCMake_BINARY_DIR}/copy_output)
+file(REMOVE_RECURSE "${out}")
+file(MAKE_DIRECTORY ${out})
+run_cmake_command(E_copy-one-source-file
+ ${CMAKE_COMMAND} -E copy ${out}/f1.txt)
+run_cmake_command(E_copy-one-source-directory-target-is-directory
+ ${CMAKE_COMMAND} -E copy ${in}/f1.txt ${out})
+run_cmake_command(E_copy-three-source-files-target-is-directory
+ ${CMAKE_COMMAND} -E copy ${in}/f1.txt ${in}/f2.txt ${in}/f3.txt ${out})
+run_cmake_command(E_copy-three-source-files-target-is-file
+ ${CMAKE_COMMAND} -E copy ${in}/f1.txt ${in}/f2.txt ${in}/f3.txt ${out}/f1.txt)
+run_cmake_command(E_copy-two-good-and-one-bad-source-files-target-is-directory
+ ${CMAKE_COMMAND} -E copy ${in}/f1.txt ${in}/not_existing_file.bad ${in}/f3.txt ${out})
+run_cmake_command(E_copy_if_different-one-source-directory-target-is-directory
+ ${CMAKE_COMMAND} -E copy_if_different ${in}/f1.txt ${out})
+run_cmake_command(E_copy_if_different-three-source-files-target-is-directory
+ ${CMAKE_COMMAND} -E copy_if_different ${in}/f1.txt ${in}/f2.txt ${in}/f3.txt ${out})
+run_cmake_command(E_copy_if_different-three-source-files-target-is-file
+ ${CMAKE_COMMAND} -E copy_if_different ${in}/f1.txt ${in}/f2.txt ${in}/f3.txt ${out}/f1.txt)
+unset(in)
+unset(out)
+
run_cmake_command(E_env-no-command0 ${CMAKE_COMMAND} -E env)
run_cmake_command(E_env-no-command1 ${CMAKE_COMMAND} -E env TEST_ENV=1)
run_cmake_command(E_env-bad-arg1 ${CMAKE_COMMAND} -E env -bad-arg1)
diff --git a/Tests/RunCMake/CommandLine/copy_input/f1.txt b/Tests/RunCMake/CommandLine/copy_input/f1.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/copy_input/f1.txt
diff --git a/Tests/RunCMake/CommandLine/copy_input/f2.txt b/Tests/RunCMake/CommandLine/copy_input/f2.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/copy_input/f2.txt
diff --git a/Tests/RunCMake/CommandLine/copy_input/f3.txt b/Tests/RunCMake/CommandLine/copy_input/f3.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/copy_input/f3.txt
diff --git a/Tests/RunCMake/Framework/FrameworkLayout.cmake b/Tests/RunCMake/Framework/FrameworkLayout.cmake
index 107afdf..5184755 100644
--- a/Tests/RunCMake/Framework/FrameworkLayout.cmake
+++ b/Tests/RunCMake/Framework/FrameworkLayout.cmake
@@ -1,5 +1,11 @@
cmake_minimum_required(VERSION 3.4)
enable_language(C)
-add_library(Framework SHARED foo.c)
-set_target_properties(Framework PROPERTIES FRAMEWORK TRUE)
+add_library(Framework SHARED
+ foo.c
+ foo.h
+ res.txt)
+set_target_properties(Framework PROPERTIES
+ FRAMEWORK TRUE
+ PUBLIC_HEADER foo.h
+ RESOURCE "res.txt")
diff --git a/Tests/RunCMake/Framework/OSXFrameworkLayout-build-check.cmake b/Tests/RunCMake/Framework/OSXFrameworkLayout-build-check.cmake
index 27d10d8..da1ccb4 100644
--- a/Tests/RunCMake/Framework/OSXFrameworkLayout-build-check.cmake
+++ b/Tests/RunCMake/Framework/OSXFrameworkLayout-build-check.cmake
@@ -1,7 +1,10 @@
set(framework-dir "${RunCMake_TEST_BINARY_DIR}/Framework.framework")
-set(plist-file "${framework-dir}/Resources/Info.plist")
+set(framework-resources "${framework-dir}/Resources")
+set(framework-resource-file "${framework-resources}/res.txt")
set(framework-library "${framework-dir}/Framework")
set(framework-versions "${framework-dir}/Versions")
+set(plist-file "${framework-resources}/Info.plist")
+set(framework-header "${framework-dir}/Headers/foo.h")
if(NOT IS_DIRECTORY ${framework-dir})
message(SEND_ERROR "Framework not found at ${framework-dir}")
@@ -15,6 +18,18 @@ if(NOT EXISTS ${framework-library})
message(SEND_ERROR "Framework library not found at ${framework-library}")
endif()
+if(NOT EXISTS ${framework-resource-file})
+ message(SEND_ERROR "Framework resource file not found at ${framework-resource-file}")
+endif()
+
if(NOT EXISTS ${framework-versions})
message(SEND_ERROR "Framework versions not found at ${framework-versions}")
endif()
+
+if(NOT EXISTS ${framework-resources})
+ message(SEND_ERROR "Framework Resources not found at ${framework-resources}")
+endif()
+
+if(NOT EXISTS ${framework-header})
+ message(SEND_ERROR "Framework header file not found at ${framework-header}")
+endif()
diff --git a/Tests/RunCMake/Framework/foo.h b/Tests/RunCMake/Framework/foo.h
new file mode 100644
index 0000000..5d5f8f0
--- /dev/null
+++ b/Tests/RunCMake/Framework/foo.h
@@ -0,0 +1 @@
+int foo();
diff --git a/Tests/RunCMake/Framework/iOSFrameworkLayout-build-check.cmake b/Tests/RunCMake/Framework/iOSFrameworkLayout-build-check.cmake
index 373baad..b81a5f7 100644
--- a/Tests/RunCMake/Framework/iOSFrameworkLayout-build-check.cmake
+++ b/Tests/RunCMake/Framework/iOSFrameworkLayout-build-check.cmake
@@ -1,7 +1,10 @@
set(framework-dir "${RunCMake_TEST_BINARY_DIR}/Framework.framework")
-set(plist-file "${framework-dir}/Info.plist")
+set(framework-resources "${framework-dir}/Resources")
+set(framework-resource-file "${framework-dir}/res.txt")
set(framework-library "${framework-dir}/Framework")
set(framework-versions "${framework-dir}/Versions")
+set(plist-file "${framework-dir}/Info.plist")
+set(framework-header "${framework-dir}/Headers/foo.h")
if(NOT IS_DIRECTORY ${framework-dir})
message(SEND_ERROR "Framework not found at ${framework-dir}")
@@ -15,6 +18,18 @@ if(NOT EXISTS ${framework-library})
message(SEND_ERROR "Framework library not found at ${framework-library}")
endif()
+if(NOT EXISTS ${framework-resource-file})
+ message(SEND_ERROR "Framework resource file not found at ${framework-resource-file}")
+endif()
+
if(EXISTS ${framework-versions})
message(SEND_ERROR "Framework versions found at ${framework-versions}")
endif()
+
+if(EXISTS ${framework-resources})
+ message(SEND_ERROR "Framework Resources found at ${framework-resources}")
+endif()
+
+if(NOT EXISTS ${framework-header})
+ message(SEND_ERROR "Framework headers not found at ${framework-header}")
+endif()
diff --git a/Tests/RunCMake/Framework/res.txt b/Tests/RunCMake/Framework/res.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/Tests/RunCMake/Framework/res.txt
diff --git a/Utilities/Scripts/BoostScanDeps.cmake b/Utilities/Scripts/BoostScanDeps.cmake
new file mode 100644
index 0000000..1fbea4b
--- /dev/null
+++ b/Utilities/Scripts/BoostScanDeps.cmake
@@ -0,0 +1,217 @@
+# Scan the Boost headers and determine the library dependencies. Note
+# that this script only scans one Boost version at once; invoke once
+# for each Boost release. Note that this does require the headers for
+# a given component to match the library name, since this computes
+# inter-library dependencies. Library components for which this
+# assumption does not hold true and which have dependencies on other
+# Boost libraries will require special-casing. It also doesn't handle
+# private dependencies not described in the headers, for static
+# library dependencies--this is also a limitation of auto-linking, and
+# I'm unaware of any specific instances where this would be
+# problematic.
+#
+# Invoke in script mode, defining these variables:
+# BOOST_DIR - the root of the boost includes
+#
+# The script will process each directory under the root as a
+# "component". For each component, all the headers will be scanned to
+# determine the components it depends upon by following all the
+# possible includes from this component. This is to match the
+# behaviour of autolinking.
+
+# Written by Roger Leigh <rleigh@codelibre.net>
+
+#=============================================================================
+# Copyright 2014-2015 University of Dundee
+#
+# Distributed under the OSI-approved BSD License (the "License");
+# see accompanying file Copyright.txt for details.
+#
+# This software is distributed WITHOUT ANY WARRANTY; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the License for more information.
+#=============================================================================
+# (To distribute this file outside of CMake, substitute the full
+# License text for the above reference.)
+
+# Determine header dependencies on libraries using the embedded dependency information.
+#
+# component - the component to check (uses all headers from boost/${component})
+# includedir - the path to the Boost headers
+# _ret_libs - list of library dependencies
+#
+function(_Boost_FIND_COMPONENT_DEPENDENCIES component includedir _ret_libs)
+ # _boost_unprocessed_headers - list of headers requiring parsing
+ # _boost_processed_headers - headers already parsed (or currently being parsed)
+ # _boost_new_headers - new headers discovered for future processing
+
+ set(library_component FALSE)
+
+ # Start by finding all headers for the component; header
+ # dependencies via #include will be solved by future passes
+
+ # Special-case since it is part of mpi; look only in boost/mpi/python*
+ if(component STREQUAL "mpi_python")
+ set(_boost_DEPS "python")
+ set(library_component TRUE)
+ file(GLOB_RECURSE _boost_unprocessed_headers
+ RELATIVE "${includedir}"
+ "${includedir}/boost/mpi/python/*")
+ list(INSERT _boost_unprocessed_headers 0 "${includedir}/boost/mpi/python.hpp")
+ # Special-case since it is a serialization variant; look in boost/serialization
+ elseif(component STREQUAL "wserialization")
+ set(library_component TRUE)
+ file(GLOB_RECURSE _boost_unprocessed_headers
+ RELATIVE "${includedir}"
+ "${includedir}/boost/serialization/*")
+ list(INSERT _boost_unprocessed_headers 0 "${includedir}/boost/serialization.hpp")
+ # Not really a library in its own right, but treat it as one
+ elseif(component STREQUAL "math")
+ set(library_component TRUE)
+ file(GLOB_RECURSE _boost_unprocessed_headers
+ RELATIVE "${includedir}"
+ "${includedir}/boost/math/*")
+ list(INSERT _boost_unprocessed_headers 0 "${includedir}/boost/math.hpp")
+ # Single test header
+ elseif(component STREQUAL "unit_test_framework")
+ set(library_component TRUE)
+ set(_boost_unprocessed_headers "${BOOST_DIR}/test/unit_test.hpp")
+ # Single test header
+ elseif(component STREQUAL "prg_exec_monitor")
+ set(library_component TRUE)
+ set(_boost_unprocessed_headers "${BOOST_DIR}/test/prg_exec_monitor.hpp")
+ # Single test header
+ elseif(component STREQUAL "test_exec_monitor")
+ set(library_component TRUE)
+ set(_boost_unprocessed_headers "${BOOST_DIR}/test/test_exec_monitor.hpp")
+ else()
+ # Default behaviour where header directory is the same as the library name.
+ file(GLOB_RECURSE _boost_unprocessed_headers
+ RELATIVE "${includedir}"
+ "${includedir}/boost/${component}/*")
+ list(INSERT _boost_unprocessed_headers 0 "${includedir}/boost/${component}.hpp")
+ endif()
+
+ while(_boost_unprocessed_headers)
+ list(APPEND _boost_processed_headers ${_boost_unprocessed_headers})
+ foreach(header ${_boost_unprocessed_headers})
+ if(EXISTS "${includedir}/${header}")
+ file(STRINGS "${includedir}/${header}" _boost_header_includes REGEX "^#[ \t]*include[ \t]*<boost/[^>][^>]*>")
+ # The optional whitespace before "#" is intentional
+ # (boost/serialization/config.hpp bug).
+ file(STRINGS "${includedir}/${header}" _boost_header_deps REGEX "^[ \t]*#[ \t]*define[ \t][ \t]*BOOST_LIB_NAME[ \t][ \t]*boost_")
+
+ foreach(line ${_boost_header_includes})
+ string(REGEX REPLACE "^#[ \t]*include[ \t]*<(boost/[^>][^>]*)>.*" "\\1" _boost_header_match "${line}")
+ list(FIND _boost_processed_headers "${_boost_header_match}" _boost_header_processed)
+ list(FIND _boost_new_headers "${_boost_header_match}" _boost_header_new)
+ if (_boost_header_processed EQUAL -1 AND _boost_header_new EQUAL -1)
+ list(APPEND _boost_new_headers ${_boost_header_match})
+ endif()
+ endforeach()
+
+ foreach(line ${_boost_header_deps})
+ string(REGEX REPLACE "^[ \t]*#[ \t]*define[ \t][ \t]*BOOST_LIB_NAME[ \t][ \t]*boost_([^ \t][^ \t]*).*" "\\1" _boost_component_match "${line}")
+ list(FIND _boost_DEPS "${_boost_component_match}" _boost_dep_found)
+ if(_boost_component_match STREQUAL "bzip2" OR
+ _boost_component_match STREQUAL "zlib")
+ # These components may or may not be required; not
+ # possible to tell without knowing where and when
+ # BOOST_BZIP2_BINARY and BOOST_ZLIB_BINARY are defined.
+ # If building against an external zlib or bzip2, this is
+ # undesirable.
+ continue()
+ endif()
+ if(component STREQUAL "mpi" AND
+ (_boost_component_match STREQUAL "mpi_python" OR
+ _boost_component_match STREQUAL "python"))
+ # Optional python dependency; skip to avoid making it a
+ # hard dependency (handle as special-case for mpi_python).
+ continue()
+ endif()
+ if (_boost_dep_found EQUAL -1 AND
+ NOT "${_boost_component_match}" STREQUAL "${component}")
+ list(APPEND _boost_DEPS "${_boost_component_match}")
+ endif()
+ if("${_boost_component_match}" STREQUAL "${component}")
+ set(library_component TRUE)
+ endif()
+ endforeach()
+ endif()
+ endforeach()
+ set(_boost_unprocessed_headers ${_boost_new_headers})
+ unset(_boost_new_headers)
+ endwhile()
+
+ # message(STATUS "Unfiltered dependencies for Boost::${component}: ${_boost_DEPS}")
+
+ if(NOT library_component)
+ unset(_boost_DEPS)
+ endif()
+ set(${_ret_libs} ${_boost_DEPS} PARENT_SCOPE)
+
+ #string(REGEX REPLACE ";" " " _boost_DEPS_STRING "${_boost_DEPS}")
+ #if (NOT _boost_DEPS_STRING)
+ # set(_boost_DEPS_STRING "(none)")
+ #endif()
+ #message(STATUS "Dependencies for Boost::${component}: ${_boost_DEPS_STRING}")
+endfunction()
+
+
+message(STATUS "Scanning ${BOOST_DIR}")
+
+# List of all directories and files
+file(GLOB boost_contents RELATIVE "${BOOST_DIR}/boost" "${BOOST_DIR}/boost/*")
+
+# Components as directories
+foreach(component ${boost_contents})
+ if(IS_DIRECTORY "${BOOST_DIR}/boost/${component}")
+ list(APPEND boost_components "${component}")
+ endif()
+endforeach()
+
+# The following components are not top-level directories, so require
+# special-casing:
+
+# Special-case mpi_python, since it's a part of mpi
+if(IS_DIRECTORY "${BOOST_DIR}/boost/mpi" AND
+ IS_DIRECTORY "${BOOST_DIR}/boost/python")
+ list(APPEND boost_components "mpi_python")
+endif()
+# Special-case wserialization, which is a variant of serialization
+if(IS_DIRECTORY "${BOOST_DIR}/boost/serialization")
+ list(APPEND boost_components "wserialization")
+endif()
+# Special-case math* since there are six libraries, but no actual math
+# library component. Handle specially when scanning above.
+#
+# Special-case separate test libraries, which are all part of test
+if(EXISTS "${BOOST_DIR}/test/unit_test.hpp")
+ list(APPEND boost_components "unit_test_framework")
+endif()
+if(EXISTS "${BOOST_DIR}/test/prg_exec_monitor.hpp")
+ list(APPEND boost_components "prg_exec_monitor")
+endif()
+if(EXISTS "${BOOST_DIR}/test/test_exec_monitor.hpp")
+ list(APPEND boost_components "test_exec_monitor")
+endif()
+
+if(boost_components)
+ list(SORT boost_components)
+endif()
+
+# Process each component defined above
+foreach(component ${boost_components})
+ string(TOUPPER ${component} UPPERCOMPONENT)
+ _Boost_FIND_COMPONENT_DEPENDENCIES("${component}" "${BOOST_DIR}"
+ _Boost_${UPPERCOMPONENT}_LIBRARY_DEPENDENCIES)
+endforeach()
+
+# Output results
+foreach(component ${boost_components})
+ string(TOUPPER ${component} UPPERCOMPONENT)
+ if(_Boost_${UPPERCOMPONENT}_LIBRARY_DEPENDENCIES)
+ string(REGEX REPLACE ";" " " _boost_DEPS_STRING "${_Boost_${UPPERCOMPONENT}_LIBRARY_DEPENDENCIES}")
+ message(STATUS "set(_Boost_${UPPERCOMPONENT}_DEPENDENCIES ${_boost_DEPS_STRING})")
+ endif()
+endforeach()