Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

building open-dis-cpp with cmake #89

Open
AJPerriello opened this issue Dec 13, 2023 · 2 comments
Open

building open-dis-cpp with cmake #89

AJPerriello opened this issue Dec 13, 2023 · 2 comments

Comments

@AJPerriello
Copy link

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 -B and turn on SHARED_LIBS,
but so far isn't working.
thanks

@wadehunk
Copy link
Contributor

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.

@crhowell3
Copy link
Contributor

@leif81 We could update the README to be a little more explicit on using CMake. I might throw this into #83.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants