Open daixtrose opened 1 year ago
Not sure if
if(NOT REPOMAN_DEPENDENCY_URI)
string(TOLOWER ${REPOMAN_DEPENDENCY_NAME} LOWER_NAME)
string(TOUPPER ${REPOMAN_DEPENDENCY_NAME} UPPER_NAME)
set(FETCHCONTENT_SOURCE_DIR_${UPPER_NAME} "${${LOWER_NAME}_SOURCE_DIR}")
endif()
is a good idea. To be discussed.
The variables used here are not set by us, nor FetchContent. They are set by CMake when using add_subdirectory() with a directory that contains a project() call. They are always using the subproject name, regardless of the name used by us. Another option would be to use FetchContent_GetProperties() with our selected name to get the proper variables.
Summary
Not sure if this is a bug.
FetchContent
allows one to declare private names for dependencies (please note the lowercasecatch2
):But it seems that the directory population uses the original uppercase name. To my surprise the reference to the
_SOURCE_DIR
must use the original upper case name, i.e.How to reproduce
Use the testsuite in https://github.com/dep-heaven/tool_1:
Output