How-to demonstrating integration of binary OR-tools for C++ package inside of a cmake project.
Follow the steps here.
Note: this has only been tested on Ubuntu 18.04 but should work on other distros / OSes.
cd {path-to-this-repo}
mkdir build && cd build
cmake -DORTOOLS_ROOT:STRING="{path-to-ortools-root-dir}" ..
make
You'll see some warnings most likely.
The test executable built in the previous step uses the toy example provided by Google from here.
Run the test:
./test-app
You should see the following output:
WARNING: Logging before InitGoogleLogging() is written to STDERR
I0814 10:15:02.698244 12745 program.cc:12] Number of variables = 2
I0814 10:15:02.698365 12745 program.cc:19] Number of constraints = 1
I0814 10:15:02.700047 12745 program.cc:29] Solution:
I0814 10:15:02.700063 12745 program.cc:30] Objective value = 4
I0814 10:15:02.700076 12745 program.cc:31] x = 1
I0814 10:15:02.700080 12745 program.cc:32] y = 1