Open ClausKlein opened 1 year ago
Not sure I understand. Is this a CPM problem or an issue with the starter project?
A CPM.cmake feature: EXCLUDE_FROM_ALL
is default set!
fmt
target will NOT be installed!option(FMT_INSTALL "create an installable target" YES)
CPMAddPackage(
NAME fmt
GIT_TAG 9.1.0
GITHUB_REPOSITORY fmtlib/fmt
EXCLUDE_FROM_ALL NO
# TODO DOWNLOAD_ONLY YES
SYSTEM YES # used in case of cmake v3.25
)
if(fmt_SOURCE_DIR) # TODO AND NOT TARGET fmt::fmt)
# TODO add_subdirectory(${fmt_SOURCE_DIR} fmt SYSTEM)
message(TRACE "add_subdirectory(${fmt_SOURCE_DIR} fmt SYSTEM)")
target_disable_clang_tidy(fmt)
check_system_property(${fmt_SOURCE_DIR})
endif()
# ...
packageProject(
NAME ${PROJECT_NAME}
VERSION ${PROJECT_VERSION} NAMESPACE ${PROJECT_NAME}
BINARY_DIR ${PROJECT_BINARY_DIR}
INCLUDE_DIR ${PROJECT_SOURCE_DIR}/include
INCLUDE_DESTINATION include/${PROJECT_NAME}
VERSION_HEADER ${VERSION_HEADER_LOCATION} DISABLE_VERSION_SUFFIX YES
COMPATIBILITY SameMajorVersion
DEPENDENCIES "fmt 9.1.0"
)
see https://discourse.cmake.org/t/is-install-of-a-target-with-exclude-from-all-true-really-undefined/5666/6 and https://github.com/ClausKlein/ModernCmakeStarter/pull/5