caching - Switch between different build settings -
sorry vague title, i'm not sure how phrase correctly. write cmake script allows build target different settings bit width (forced 32 bit, forced 64 bit or native bit width) , static linking. figured out how set build under each status , far i'm using cmake options switch between different setups.
my problem changing 1 of these build options ccmake or on command line requires new library paths. since these paths cached, have delete cache when changing bit width. way users loose other settings options independent of bit width , static linking.
is there mutual way handle this?
use different build directories different settings:
cmake -h. -b_builds/arch64 -dcmake_cxx_flags=-m64 cmake -h. -b_builds/arch32 -dcmake_cxx_flags=-m32 cmake -h. -b_builds/shared -dbuild_shared_libs=on cmake -h. -b_builds/static -dbuild_shared_libs=off cmake -h. -b_builds/debug -dcmake_build_type=debug cmake -h. -b_builds/release -dcmake_build_type=release exceptionsnote in each case there may exceptions, like:
add_library(foo static ${foo_sources}) # build_shared_libs ignored
or visual studio , xcode debug/release be:
cmake -h. -b_builds/xcode -gxcode cmake --build _builds/xcode --config debug # build debug cmake --build _builds/xcode --config release # build release
instead of xcode-debug
, xcode-release
caching cmake cmake-gui
No comments:
Post a Comment