Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

YCMEPHelper: Set ExternalProject's BUILD_ALWAYS to ON to restore behaviour of old vendored YCM's ExternalProject #462

Merged
merged 1 commit into from
Sep 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions modules/YCMEPHelper.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ A helper for :module:`ExternalProject`::
[TYPE <type>]
[STYLE <style>]
[COMPONENT <component>] (default = "external")
[FOLDER <folder> (default = "<component>")
[FOLDER <folder>] (default = "<component>")
[REPOSITORY <repo>]
[EXCLUDE_FROM_ALL <0|1>]
#--Git only arguments-----------
Expand All @@ -38,6 +38,7 @@ A helper for :module:`ExternalProject`::
[PATCH_COMMAND]
[CONFIGURE_COMMAND]
[BUILD_COMMAND]
[BUILD_ALWAYS] (default = TRUE, while for ExternalProject the default is FALSE)
[INSTALL_COMMAND]
[TEST_COMMAND]
[CLEAN_COMMAND] (not in ExternalProject)
Expand Down Expand Up @@ -920,7 +921,8 @@ function(YCM_EP_HELPER _name)
CMAKE_GENERATOR
CMAKE_GENERATOR_PLATFORM
CMAKE_GENERATOR_TOOLSET
CMAKE_GENERATOR_INSTANCE)
CMAKE_GENERATOR_INSTANCE
BUILD_ALWAYS)
set(_multiValueArgs CMAKE_ARGS
CMAKE_CACHE_ARGS
CMAKE_CACHE_DEFAULT_ARGS
Expand Down Expand Up @@ -1114,7 +1116,7 @@ function(YCM_EP_HELPER _name)
endif()


unset(${_name}_EXTRA_ARGS})
unset(${_name}_EXTRA_ARGS)
if(DEFINED _YH_${_name}_EXCLUDE_FROM_ALL)
list(APPEND ${_name}_EXTRA_ARGS EXCLUDE_FROM_ALL ${_YH_${_name}_EXCLUDE_FROM_ALL})
endif()
Expand All @@ -1130,6 +1132,15 @@ function(YCM_EP_HELPER _name)
if(DEFINED _YH_${_name}_SOURCE_SUBDIR)
list(APPEND ${_name}_EXTRA_ARGS SOURCE_SUBDIR "${_YH_${_name}_SOURCE_SUBDIR}")
endif()
if(DEFINED _YH_${_name}_BUILD_ALWAYS)
list(APPEND ${_name}_EXTRA_ARGS BUILD_ALWAYS ${_YH_${_name}_BUILD_ALWAYS})
else()
# By default we set BUILD_ALWAYS to ON as this is how the YCM-superbuild always behaved using the
# vendored ExternalProject used in YCM until 0.16.* releases, see:
# * https://github.com/robotology/ycm-cmake-modules/issues/50
# * https://github.com/robotology/robotology-superbuild/issues/1700
list(APPEND ${_name}_EXTRA_ARGS BUILD_ALWAYS ON)
endif()

# Repository dependent variables
unset(${_name}_REPOSITORY_ARGS)
Expand Down
Loading