mirror of
https://github.com/Kitware/CMake.git
synced 2025-12-31 19:00:54 -06:00
Since in some situations, ExternalProject module may be included in a sub-directory, functions will be available in the global scope but local variables like "_ep_keywords_<keyword>" will not be defined, this commit checks and reports an error indicating that the ExternalProject module must be explicitly included before using any of the ExternalProject_* functions that require the module's inclusion within the current scope or above. Co-authored-by: Pablo Hernandez <pablo.hernandez@kitware.com> Co-authored-by: Craig Scott <craig.scott@crascit.com>
14 lines
311 B
CMake
14 lines
311 B
CMake
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")
|