diff options
author | Craig Scott <craig.scott@crascit.com> | 2021-01-24 12:33:51 (GMT) |
---|---|---|
committer | Craig Scott <craig.scott@crascit.com> | 2021-01-29 13:12:23 (GMT) |
commit | 23aab9ecce264b7ea198fc9d36f382a4bb4fbe28 (patch) | |
tree | 3bccfb53d21520072a4b49b624c1f9cb42ab67cc /Tests/RunCMake/ExternalProject | |
parent | 36bb0e32d7e3976eed424078cf5cac459651f0f1 (diff) | |
download | CMake-23aab9ecce264b7ea198fc9d36f382a4bb4fbe28.zip CMake-23aab9ecce264b7ea198fc9d36f382a4bb4fbe28.tar.gz CMake-23aab9ecce264b7ea198fc9d36f382a4bb4fbe28.tar.bz2 |
ExternalProject: Avoid scanning docs for keywords, use include_guard()
The previous implementation was scanning the documentation in
the file at runtime to determine the set of supported keywords for
each public function. This was fragile, made it difficult to restructure
the documentation and was sometimes observable in runtime
performance measurements. Change to a more conventional
approach where supported keywords are explicitly listed in the
code.
The internal _ExternalProject_SELF variable is no longer needed.
CMake now provides CMAKE_CURRENT_FUNCTION_LIST_DIR which
can be used for the same purpose and avoids having to set a
variable when the module is read. This also removes the
requirement that the module must be included by the current or a
parent scope. It is now enough that the module has been included
once somewhere before calling any of its functions.
The above changes combined mean that the module can now use
include_guard() and avoid having to re-parse the very long file every
time.
Diffstat (limited to 'Tests/RunCMake/ExternalProject')
7 files changed, 0 insertions, 43 deletions
diff --git a/Tests/RunCMake/ExternalProject/IncludeScope-Add-result.txt b/Tests/RunCMake/ExternalProject/IncludeScope-Add-result.txt deleted file mode 100644 index d00491f..0000000 --- a/Tests/RunCMake/ExternalProject/IncludeScope-Add-result.txt +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/Tests/RunCMake/ExternalProject/IncludeScope-Add-stderr.txt b/Tests/RunCMake/ExternalProject/IncludeScope-Add-stderr.txt deleted file mode 100644 index ff3e5c1..0000000 --- a/Tests/RunCMake/ExternalProject/IncludeScope-Add-stderr.txt +++ /dev/null @@ -1,7 +0,0 @@ -^CMake Error at .*/Modules/ExternalProject.cmake:[0-9]+ \(message\): - error: ExternalProject module must be explicitly included before using - ExternalProject_Add function -Call Stack \(most recent call first\): - .*/Modules/ExternalProject.cmake:[0-9]+ \(_ep_parse_arguments\) - IncludeScope-Add.cmake:[0-9]+ \(ExternalProject_Add\) - CMakeLists.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/ExternalProject/IncludeScope-Add.cmake b/Tests/RunCMake/ExternalProject/IncludeScope-Add.cmake deleted file mode 100644 index 1061ffd..0000000 --- a/Tests/RunCMake/ExternalProject/IncludeScope-Add.cmake +++ /dev/null @@ -1,12 +0,0 @@ -function(IncludeScope_IncludeOnly) - include(ExternalProject) -endfunction() - -IncludeScope_IncludeOnly() - -ExternalProject_Add(MyProj - SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR} - CONFIGURE_COMMAND "" - BUILD_COMMAND "" - INSTALL_COMMAND "" -) diff --git a/Tests/RunCMake/ExternalProject/IncludeScope-Add_Step-result.txt b/Tests/RunCMake/ExternalProject/IncludeScope-Add_Step-result.txt deleted file mode 100644 index d00491f..0000000 --- a/Tests/RunCMake/ExternalProject/IncludeScope-Add_Step-result.txt +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/Tests/RunCMake/ExternalProject/IncludeScope-Add_Step-stderr.txt b/Tests/RunCMake/ExternalProject/IncludeScope-Add_Step-stderr.txt deleted file mode 100644 index cbad4be..0000000 --- a/Tests/RunCMake/ExternalProject/IncludeScope-Add_Step-stderr.txt +++ /dev/null @@ -1,7 +0,0 @@ -^CMake Error at .*/Modules/ExternalProject.cmake:[0-9]+ \(message\): - error: ExternalProject module must be explicitly included before using - ExternalProject_Add_Step function -Call Stack \(most recent call first\): - .*/Modules/ExternalProject.cmake:[0-9]+ \(_ep_parse_arguments\) - IncludeScope-Add_Step.cmake:[0-9]+ \(ExternalProject_Add_Step\) - CMakeLists.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/ExternalProject/IncludeScope-Add_Step.cmake b/Tests/RunCMake/ExternalProject/IncludeScope-Add_Step.cmake deleted file mode 100644 index 2a820f8..0000000 --- a/Tests/RunCMake/ExternalProject/IncludeScope-Add_Step.cmake +++ /dev/null @@ -1,13 +0,0 @@ -function(IncludeScope_DefineProj) - include(ExternalProject) - ExternalProject_Add(MyProj - SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR} - CONFIGURE_COMMAND "" - BUILD_COMMAND "" - INSTALL_COMMAND "" - ) -endfunction() - -IncludeScope_DefineProj() - -ExternalProject_Add_Step(MyProj extraStep COMMENT "Foo") diff --git a/Tests/RunCMake/ExternalProject/RunCMakeTest.cmake b/Tests/RunCMake/ExternalProject/RunCMakeTest.cmake index 976655a..3205dd5 100644 --- a/Tests/RunCMake/ExternalProject/RunCMakeTest.cmake +++ b/Tests/RunCMake/ExternalProject/RunCMakeTest.cmake @@ -8,8 +8,6 @@ unset(ENV{https_proxy}) run_cmake(BadIndependentStep1) run_cmake(BadIndependentStep2) -run_cmake(IncludeScope-Add) -run_cmake(IncludeScope-Add_Step) run_cmake(NoOptions) run_cmake(SourceEmpty) run_cmake(SourceMissing) |