Problem
Since the move to core-cpp (#806), core-cpp is always added with CPMAddPackage, and the CPM bootstrap (cmake/CPM.cmake) always runs file(DOWNLOAD ...) for CPM.cmake itself. There is no find_package(core-cpp) first, unlike glaze, which is found first and fetched only when missing.
That makes morph awkward to package. A package manager build (vcpkg, Conan, a distro) must not reach the network during the build, and should use its own copy of every dependency. Today a vcpkg port has to:
- download core-cpp itself and pass
-DCPM_core-cpp_SOURCE=<dir> so CPMAddPackage uses it, and
- pre-seed
CPM_SOURCE_CACHE/cpm/CPM_<version>.cmake with the exact bootstrap file, so the unconditional file(DOWNLOAD) is skipped by its hash check.
Both work, but they depend on CPM internals (the cache layout and the CPM_<name>_SOURCE variable) and break silently if the pinned CPM version or cache layout changes.
Expected
The same treatment glaze gets:
find_package(core-cpp 0.5 CONFIG QUIET)
if(NOT core-cpp_FOUND)
CPMAddPackage(NAME core-cpp ...)
endif()
and the CPM bootstrap only included when something actually needs fetching. With core-cpp installed (it already installs a core-cpp CMake package), a packaged build would then need no CPM at all.
Notes
morphConfig.cmake already does find_dependency(core-cpp 0.5 CONFIG), so an installed core-cpp is the expected consumer shape.
- If core-cpp is found rather than built in-tree, morph's install should not try to install core-cpp again (currently
CORE_CPP_INSTALL follows MORPH_INSTALL).
Problem
Since the move to core-cpp (#806), core-cpp is always added with
CPMAddPackage, and the CPM bootstrap (cmake/CPM.cmake) always runsfile(DOWNLOAD ...)forCPM.cmakeitself. There is nofind_package(core-cpp)first, unlike glaze, which is found first and fetched only when missing.That makes morph awkward to package. A package manager build (vcpkg, Conan, a distro) must not reach the network during the build, and should use its own copy of every dependency. Today a vcpkg port has to:
-DCPM_core-cpp_SOURCE=<dir>soCPMAddPackageuses it, andCPM_SOURCE_CACHE/cpm/CPM_<version>.cmakewith the exact bootstrap file, so the unconditionalfile(DOWNLOAD)is skipped by its hash check.Both work, but they depend on CPM internals (the cache layout and the
CPM_<name>_SOURCEvariable) and break silently if the pinned CPM version or cache layout changes.Expected
The same treatment glaze gets:
and the CPM bootstrap only included when something actually needs fetching. With core-cpp installed (it already installs a
core-cppCMake package), a packaged build would then need no CPM at all.Notes
morphConfig.cmakealready doesfind_dependency(core-cpp 0.5 CONFIG), so an installed core-cpp is the expected consumer shape.CORE_CPP_INSTALLfollowsMORPH_INSTALL).