Does CMake has a "find-or-download-and-run-build-command" mechanism? -
cmake has find_package()
backed bunch of findxyz
scripts (which can add to).
what mechanism, if any, available me tell cmake: "find package, , if haven't found it, download , trigger build" - downloading , building part backed per-package scripts or settings (so downloading wget
or git clone
, building cmake
or maven
or package-specific command, etc.) ?
yeah, bitten friday.
so, cmake has externalproject
directive, meant that, get/update if necessary, configure, build , install , external project. awesome!
sadly, cmake isn't awesome.
you can't use target defined externalproject
library in target_link_libraries
. i've tried to.
the basic problem updating, building , installation of external project happens @ build time, whereas cmake insists on using libraries found during pre-build (i.e. during cmake run); can't re-detect stuff while running make/ninja/msvc… .
you can define custom target, tell .so you'd want link against later be, , try coerce cmake believing without checking @ pre-build. sadly, @ least in cmake versions had, broke dependency tracking, didn't build external library, because nothing needed it.
from error messages when trying use external project in target_link_library
, seems cmake assumes you'd want install tools need @ build time way, not libraries. bummer.
Comments
Post a Comment