cmake

PROJECT-NAME_SOURCE_DIR

generate makefile or ninja file

#makefile
cmake -B build -S . -DCMAKE_INSTALL_PREFIX=install
or
# ninja
cmake -G Ninja -B build -S . -DCMAKE_INSTALL_PREFIX=install

build

cmake --build build/ --target all

install

# custom prefix when install:
cmake --install build --prefix install-v2
# using  -DCMAKE_INSTALL_PREFIX dir
cmake --install build

Leave a Comment