diff options
-rw-r--r-- | Help/manual/OPTIONS_BUILD.txt | 2 | ||||
-rw-r--r-- | Modules/FindDoxygen.cmake | 12 | ||||
-rw-r--r-- | Modules/FindPerl.cmake | 1 | ||||
-rw-r--r-- | Source/CMakeVersion.cmake | 2 | ||||
-rw-r--r-- | Source/cmake.h | 2 | ||||
-rw-r--r-- | Tests/FindDoxygen/AllTarget/CMakeLists.txt | 42 | ||||
-rw-r--r-- | Tests/FindDoxygen/CMakeLists.txt | 10 | ||||
-rwxr-xr-x | bootstrap | 10 |
8 files changed, 72 insertions, 9 deletions
diff --git a/Help/manual/OPTIONS_BUILD.txt b/Help/manual/OPTIONS_BUILD.txt index e8b87c9..33d27af 100644 --- a/Help/manual/OPTIONS_BUILD.txt +++ b/Help/manual/OPTIONS_BUILD.txt @@ -11,7 +11,7 @@ cache-format file. ``-D <var>:<type>=<value>, -D <var>=<value>`` - Create a cmake cache entry. + Create or update a cmake cache entry. When cmake is first run in an empty build tree, it creates a CMakeCache.txt file and populates it with customizable settings for diff --git a/Modules/FindDoxygen.cmake b/Modules/FindDoxygen.cmake index 599d799..945ee0e 100644 --- a/Modules/FindDoxygen.cmake +++ b/Modules/FindDoxygen.cmake @@ -69,6 +69,7 @@ Functions doxygen_add_docs(targetName [filesOrDirs...] + [ALL] [WORKING_DIRECTORY dir] [COMMENT comment]) @@ -91,6 +92,8 @@ Functions the :command:`add_custom_target` command used to create the custom target internally. + If ALL is set, the target will be added to the default build target. + The contents of the generated ``Doxyfile`` can be customized by setting CMake variables before calling ``doxygen_add_docs()``. Any variable with a name of the form ``DOXYGEN_<tag>`` will have its value substituted for the @@ -788,7 +791,7 @@ function(doxygen_list_to_quoted_strings LIST_VARIABLE) endfunction() function(doxygen_add_docs targetName) - set(_options) + set(_options ALL) set(_one_value_args WORKING_DIRECTORY COMMENT) set(_multi_value_args) cmake_parse_arguments(_args @@ -1089,8 +1092,13 @@ doxygen_add_docs() for target ${targetName}") set(_target_doxyfile "${CMAKE_CURRENT_BINARY_DIR}/Doxyfile.${targetName}") configure_file("${_doxyfile_template}" "${_target_doxyfile}") + unset(_all) + if(${_args_ALL}) + set(_all ALL) + endif() + # Add the target - add_custom_target( ${targetName} VERBATIM + add_custom_target( ${targetName} ${_all} VERBATIM COMMAND ${CMAKE_COMMAND} -E make_directory ${_original_doxygen_output_dir} COMMAND "${DOXYGEN_EXECUTABLE}" "${_target_doxyfile}" WORKING_DIRECTORY "${_args_WORKING_DIRECTORY}" diff --git a/Modules/FindPerl.cmake b/Modules/FindPerl.cmake index 423fc69..c38527c 100644 --- a/Modules/FindPerl.cmake +++ b/Modules/FindPerl.cmake @@ -28,6 +28,7 @@ if(WIN32) NAME) set(PERL_POSSIBLE_BIN_PATHS ${PERL_POSSIBLE_BIN_PATHS} "C:/Perl/bin" + "C:/Strawberry/perl/bin" [HKEY_LOCAL_MACHINE\\SOFTWARE\\ActiveState\\ActivePerl\\${ActivePerl_CurrentVersion}]/bin ) endif() diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 36f8c7e..d3930be 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 11) -set(CMake_VERSION_PATCH 20180525) +set(CMake_VERSION_PATCH 20180529) #set(CMake_VERSION_RC 1) diff --git a/Source/cmake.h b/Source/cmake.h index 63dbe9f..dafe622 100644 --- a/Source/cmake.h +++ b/Source/cmake.h @@ -550,7 +550,7 @@ private: #define CMAKE_STANDARD_OPTIONS_TABLE \ { "-C <initial-cache>", "Pre-load a script to populate the cache." }, \ - { "-D <var>[:<type>]=<value>", "Create a cmake cache entry." }, \ + { "-D <var>[:<type>]=<value>", "Create or update a cmake cache entry." }, \ { "-U <globbing_expr>", "Remove matching entries from CMake cache." }, \ { "-G <generator-name>", "Specify a build system generator." }, \ { "-T <toolset-name>", \ diff --git a/Tests/FindDoxygen/AllTarget/CMakeLists.txt b/Tests/FindDoxygen/AllTarget/CMakeLists.txt new file mode 100644 index 0000000..69aa518 --- /dev/null +++ b/Tests/FindDoxygen/AllTarget/CMakeLists.txt @@ -0,0 +1,42 @@ +cmake_minimum_required(VERSION 3.10) +project(TestFindDoxygen VERSION 1.0 LANGUAGES NONE) +enable_testing() + +find_package(Doxygen REQUIRED) + +file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/main.cpp [[ +/** + * \file + * \brief One C++ file w/ sample Doxygen comment just to produce any docs... + */ +]]) + +set(DOXYGEN_OUTPUT_DIRECTORY outDirWithout) +file(REMOVE_RECURSE ${CMAKE_CURRENT_BINARY_DIR}/${DOXYGEN_OUTPUT_DIRECTORY}) +doxygen_add_docs(docsNoAll ${CMAKE_CURRENT_BINARY_DIR}/main.cpp) + +set(DOXYGEN_OUTPUT_DIRECTORY outDirWith) +file(REMOVE_RECURSE ${CMAKE_CURRENT_BINARY_DIR}/${DOXYGEN_OUTPUT_DIRECTORY}) +doxygen_add_docs(docsWithAll ALL ${CMAKE_CURRENT_BINARY_DIR}/main.cpp) + +# Define tests cases that check whether targets were built +file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/dirExists.cmake [[ +cmake_minimum_required(VERSION 3.11) +if(NOT EXISTS ${dirName}) + message(FATAL_ERROR "Directory does not exist: ${dirName}") +endif() +]]) + +add_test(NAME checkWith COMMAND + ${CMAKE_COMMAND} + -D dirName=${CMAKE_CURRENT_BINARY_DIR}/outDirWith + -P dirExists.cmake +) +add_test(NAME checkWithout COMMAND + ${CMAKE_COMMAND} + -D dirName=${CMAKE_CURRENT_BINARY_DIR}/outDirWithout + -P dirExists.cmake +) +set_tests_properties(checkWithout PROPERTIES + WILL_FAIL TRUE +) diff --git a/Tests/FindDoxygen/CMakeLists.txt b/Tests/FindDoxygen/CMakeLists.txt index 69b9eed..7ce98d5 100644 --- a/Tests/FindDoxygen/CMakeLists.txt +++ b/Tests/FindDoxygen/CMakeLists.txt @@ -18,6 +18,16 @@ add_test(NAME FindDoxygen.QuotingTest COMMAND --build-options ${build_options} ) +add_test(NAME FindDoxygen.AllTarget COMMAND + ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> + --build-and-test + "${CMake_SOURCE_DIR}/Tests/FindDoxygen/AllTarget" + "${CMake_BINARY_DIR}/Tests/FindDoxygen/AllTarget" + ${build_generator_args} + --build-options ${build_options} + --test-command ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> +) + if(CMake_TEST_FindDoxygen_Dot) add_test(NAME FindDoxygen.DotComponentTest COMMAND ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> @@ -1250,6 +1250,12 @@ else echo "${cmake_cxx_compiler} does not have <ext/stdio_filebuf.h>" fi +if [ -n "${cmake_ccache_enabled}" ]; then + echo "Building CMake with ccache" + cmake_c_compiler="ccache ${cmake_c_compiler}" + cmake_cxx_compiler="ccache ${cmake_cxx_compiler}" +fi + # Just to be safe, let us store compiler and flags to the header file cmake_bootstrap_version='$Revision$' @@ -1536,10 +1542,6 @@ cd "${cmake_binary_dir}" # build with same compiler and make CC="${cmake_c_compiler}" CXX="${cmake_cxx_compiler}" -if [ -n "${cmake_ccache_enabled}" ]; then - CC="ccache ${CC}" - CXX="ccache ${CXX}" -fi MAKE="${cmake_make_processor}" export CC export CXX |