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.
A quick summary of the changes:
Utilized hierarchical CMakeLists.txt to manage files within each directory
Library targets are created at the top-level with default library type, this allows the user to define whether a STATIC or SHARED library is created with a build option (-DBUILD_SHARED_LIBS=ON)
Sources are added to library targets explicitly within each directory, avoid using GLOB operations as that is not recommended for managing build dependencies
Compilation of example sender/receiver applications is now specified with a CMake build option (-DBUILD_EXAMPLES=ON)
SDL2 dependency options and targets are managed by FindSDL2*.cmake scripts now, which are modified versions of the Kitware FindSDL.cmake scripts
More consistently utilized the GNUInstallDirs variables for file/target installation
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.
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 and 9.