open-dis / open-dis-cpp

C++ implementation of the IEEE-1278.1 Distributed Interactive Simulation (DIS) application protocol v6 and v7
BSD 2-Clause "Simplified" License
90 stars 65 forks source link

Modernize and modularize cmake build system for more robust usage #73

Closed wadehunk closed 1 year ago

wadehunk commented 1 year ago

I re-factored the cmake build system to be more consistent with modern cmake conventions and best practices. I think this also simplifies and makes the overall build more maintainable. There was a previous PR that attempted to do this a few years ago, but looked like it got bogged down with too many changes. This implementation is a bit more direct although I ran into some pre-existing issues will DLL linkage consistency that required tweaking the DLL import/export macro implementation.

A quick summary of the changes:

Things that did NOT change:

This should keep any impact to users of OpenDIS to a minimum if at all.

Tested locally on RedHat 8/9 (GCC) and Windows 10 (MSVC 2019)

wadehunk commented 1 year ago

@leif81 Had a false start on getting this submitted, but would love to get this merged. Looking to follow-up with re-integration of unit test suite and potentially Conan package support.

leif81 commented 1 year ago

Thank-you @wadehunk ! It'll likely be next week when I am able to take a close look.

leif81 commented 1 year ago

@wadehunk will this make #44 redundant?

leif81 commented 1 year ago

@wadehunk took a first look and it looks good to me. I'm by no means a cmake expert though.

@rodneyp290 you may be interested in taking a look at this too. Any comments are appreciated.

wadehunk commented 1 year ago

@wadehunk will this make #44 redundant?

@leif81 I believe so. Primary difference is I didn’t try to reorganize any folders or add a dis7 example. Figured if that was needed it could be a follow up PR.

rodneyp290 commented 1 year ago

Hey, long time no speak, I had a brief look. TBH, I've not that well verse in modern CMAKE - I've been meaning to learn properly it since #44 was made. But in general looks good, builds on my Linux System, and I see that it build on Windows through AppVeyor okay.

Nice work @wadehunk ! :+1: