patrickziegler / example-cmake-export-target

Example on how to export and reuse CMake targets

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to run the container

docker build \
    --build-arg USER_NAME=$(whoami) \
    --build-arg USER_ID=$(id -u) \
    --build-arg USER_GID=$(id -g) \
    -t example-cmake-export-target-build .
docker run -it --rm -v ${PWD}:/usr/src/ example-cmake-export-target-build

How to execute the example

cd /usr/src/

# build and install the library
mkdir build_lib && cd build_lib
cmake ../lib/ && make -j10 && sudo make install

# build and test the client
mkdir ../build_cli && cd ../build_cli
cmake ../cli/ && make -j10
./add

References:

About

Example on how to export and reuse CMake targets

License:MIT License


Languages

Language:CMake 71.3%Language:Dockerfile 17.8%Language:C++ 10.9%