open-dis-cpp
open-dis-cpp copied to clipboard
building open-dis-cpp with cmake
I want to build open-dis ccp dis6 source as a shared library. I don't need examples. I am building on a machine that has cmake and most everything needed for development. If this build is going to need more than I can not install that, need to work with what I have, which should be enough anyhow, can I please have an example of linux command line to cmake and build
i tried ..
cmake -BUILD_SHARED_LIBS=ON -DBUILD_EXAMPLES=OFF -S src
(I'm sunning that in a directory that contains src/dis6, src/dis7 CMakeLists.txt
I tried using cmake3 as well
cmake -h doesn't help much :)
Do I need to make entries in CMakeLists?
I assumed, just download, install, and do cmake -S
There could be a couple of things going on here based on the command you ran. Try the following:
git clone https://github.com/open-dis/open-dis-cpp.git
cd open-dis-cpp
mkdir build
cd build
cmake -DBUILD_SHARED_LIBS=ON -DBUILD_EXAMPLES=OFF -DCMAKE_INSTALL_PREFIX=/path/to/install ..
cmake --build .
cmake --install .
The key is to do an out-of-source build and point the source directory to where the top-level CMakeLists.txt file is located.
@leif81 We could update the README to be a little more explicit on using CMake. I might throw this into #83.