Skip to content

Commit

Permalink
Merge pull request #76 from wadehunk/pdu-utils-reorg
Browse files Browse the repository at this point in the history
Utilities reorganization based on DIS version
  • Loading branch information
leif81 authored Feb 4, 2023
2 parents 84e17b6 + dbdab8b commit a17466d
Show file tree
Hide file tree
Showing 352 changed files with 866 additions and 376 deletions.
22 changes: 11 additions & 11 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ option(BUILD_SHARED_LIBS "build shared libraries" ON)
option(BUILD_EXAMPLES "build example sender/receiver applications" OFF)
option(BUILD_TESTS "build unit tests" OFF)

# Enforce a C++11 compliant compiler
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)

# include GNUInstallDirs Module to get more generic directory handling
include(GNUInstallDirs)

Expand All @@ -21,20 +26,15 @@ target_include_directories(OpenDIS6
# Define OpenDIS7 Library
add_library(OpenDIS7 "")

# Add src/ to the include directories to OpenDIS6
# Add src/ to the include directories to DIS7
target_include_directories(OpenDIS7
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src>
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/src>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)

# Add compile definition EXPORT_LIBRARY for shared libs
if(NOT BUILD_SHARED_LIBS)
target_compile_definitions(OpenDIS6 PRIVATE OpenDIS6_STATIC_DEFINE)
target_compile_definitions(OpenDIS7 PRIVATE OpenDIS7_STATIC_DEFINE)
endif()

# Add source directories
add_subdirectory(src)
add_subdirectory(cmake)

# Build example applications
if(BUILD_EXAMPLES)
Expand All @@ -48,10 +48,10 @@ if(BUILD_TESTS)
endif()

# Configure install target (i.e. what files to install)
install(TARGETS OpenDIS6 EXPORT OpenDIS6Config DESTINATION "${CMAKE_INSTALL_LIBDIR}")
install(EXPORT OpenDIS6Config DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/OpenDIS6")
install(TARGETS OpenDIS7 EXPORT OpenDIS7Config DESTINATION "${CMAKE_INSTALL_LIBDIR}")
install(EXPORT OpenDIS7Config DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/OpenDIS7")
install(TARGETS OpenDIS6 OpenDIS7 EXPORT OpenDISTargets DESTINATION "${CMAKE_INSTALL_LIBDIR}")
install(EXPORT OpenDISTargets
NAMESPACE OpenDIS::
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/OpenDIS")

# configure package target (i.e. Package Types, and meta data)
set(CPACK_GENERATOR "DEB" "RPM" "TXZ" "TGZ")
Expand Down
18 changes: 18 additions & 0 deletions cmake/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
set(OPENDIS_PACKAGE_DIR "${CMAKE_INSTALL_LIBDIR}/cmake/OpenDIS")

include(CMakePackageConfigHelpers)

configure_package_config_file(
OpenDISConfig.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/OpenDISConfig.cmake
INSTALL_DESTINATION ${OPENDIS_PACKAGE_DIR}
)

write_basic_package_version_file(
"${CMAKE_CURRENT_BINARY_DIR}/OpenDISConfigVersion.cmake"
VERSION "${PROJECT_VERSION_FULL}"
COMPATIBILITY SameMajorVersion)

install(FILES ${CMAKE_CURRENT_BINARY_DIR}/OpenDISConfig.cmake
${CMAKE_CURRENT_BINARY_DIR}/OpenDISConfigVersion.cmake
DESTINATION ${OPENDIS_PACKAGE_DIR})
12 changes: 12 additions & 0 deletions cmake/OpenDISConfig.cmake.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
@PACKAGE_INIT@

include(${CMAKE_CURRENT_LIST_DIR}/OpenDISTargets.cmake)

## Add target aliases
add_library(OpenDIS::DIS6 ALIAS OpenDIS::OpenDIS6)
add_library(OpenDIS::DIS7 ALIAS OpenDIS::OpenDIS7)

## These are deprecated target names. All new references to the targets
## should utilize the new namespace wrapped version
add_library(OpenDIS6 ALIAS OpenDIS::OpenDIS6)
add_library(OpenDIS7 ALIAS OpenDIS::OpenDIS7)
2 changes: 1 addition & 1 deletion examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")

# Require the OpenDIS6 target
if(NOT TARGET OpenDIS6)
find_package(OpenDIS6 REQUIRED)
find_package(OpenDIS REQUIRED)
endif()

# SDL2 is required to build the examples
Expand Down
2 changes: 1 addition & 1 deletion examples/EntityStatePduProcessor.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#pragma once

#include <dis6/EntityStatePdu.h> // for typedef
#include <utils/IPacketProcessor.h> // for base class
#include <dis6/utils/IPacketProcessor.h> // for base class

namespace Example
{
Expand Down
4 changes: 2 additions & 2 deletions examples/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
// the DIS library usage
#include <dis6/EntityStatePdu.h>
#include <dis6/DetonationPdu.h>
#include <utils/DataStream.h>
#include <dis6/utils/DataStream.h>
#include <dis6/Vector3Double.h>
#include <dis6/BurstDescriptor.h>

#include <utils/Conversion.h>
#include <dis6/utils/Conversion.h>

#include <iostream>

Expand Down
2 changes: 1 addition & 1 deletion examples/main_receive.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include "EntityStatePduProcessor.h" // for usage
#include "Utils.h"

#include <utils/IncomingMessage.h> // for library usage
#include <dis6/utils/IncomingMessage.h> // for library usage
#include <dis6/EntityStatePdu.h> // for library usage

#include <cstring> // for strlen
Expand Down
1 change: 0 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# Add all subdirectories
add_subdirectory(dis6)
add_subdirectory(dis7)
add_subdirectory(utils)
2 changes: 1 addition & 1 deletion src/dis6/AcknowledgePdu.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#pragma once

#include <dis6/SimulationManagementFamilyPdu.h>
#include <utils/DataStream.h>
#include <dis6/utils/DataStream.h>
#include <dis6/opendis6_export.h>


Expand Down
2 changes: 1 addition & 1 deletion src/dis6/AcknowledgeReliablePdu.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#pragma once

#include <dis6/SimulationManagementWithReliabilityFamilyPdu.h>
#include <utils/DataStream.h>
#include <dis6/utils/DataStream.h>
#include <dis6/opendis6_export.h>


Expand Down
2 changes: 1 addition & 1 deletion src/dis6/AcousticBeamData.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#pragma once

#include <dis6/AcousticBeamFundamentalParameter.h>
#include <utils/DataStream.h>
#include <dis6/utils/DataStream.h>
#include <dis6/opendis6_export.h>


Expand Down
2 changes: 1 addition & 1 deletion src/dis6/AcousticBeamFundamentalParameter.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include <utils/DataStream.h>
#include <dis6/utils/DataStream.h>
#include <dis6/opendis6_export.h>


Expand Down
2 changes: 1 addition & 1 deletion src/dis6/AcousticEmitter.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include <utils/DataStream.h>
#include <dis6/utils/DataStream.h>
#include <dis6/opendis6_export.h>


Expand Down
2 changes: 1 addition & 1 deletion src/dis6/AcousticEmitterSystem.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include <utils/DataStream.h>
#include <dis6/utils/DataStream.h>
#include <dis6/opendis6_export.h>


Expand Down
2 changes: 1 addition & 1 deletion src/dis6/AcousticEmitterSystemData.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include <dis6/Vector3Float.h>
#include <dis6/AcousticBeamData.h>
#include <vector>
#include <utils/DataStream.h>
#include <dis6/utils/DataStream.h>
#include <dis6/opendis6_export.h>


Expand Down
2 changes: 1 addition & 1 deletion src/dis6/ActionRequestPdu.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include <dis6/VariableDatum.h>
#include <vector>
#include <dis6/SimulationManagementFamilyPdu.h>
#include <utils/DataStream.h>
#include <dis6/utils/DataStream.h>
#include <dis6/opendis6_export.h>


Expand Down
2 changes: 1 addition & 1 deletion src/dis6/ActionRequestReliablePdu.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include <dis6/VariableDatum.h>
#include <vector>
#include <dis6/SimulationManagementWithReliabilityFamilyPdu.h>
#include <utils/DataStream.h>
#include <dis6/utils/DataStream.h>
#include <dis6/opendis6_export.h>


Expand Down
2 changes: 1 addition & 1 deletion src/dis6/ActionResponsePdu.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include <dis6/VariableDatum.h>
#include <vector>
#include <dis6/SimulationManagementFamilyPdu.h>
#include <utils/DataStream.h>
#include <dis6/utils/DataStream.h>
#include <dis6/opendis6_export.h>


Expand Down
2 changes: 1 addition & 1 deletion src/dis6/ActionResponseReliablePdu.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include <dis6/VariableDatum.h>
#include <vector>
#include <dis6/SimulationManagementWithReliabilityFamilyPdu.h>
#include <utils/DataStream.h>
#include <dis6/utils/DataStream.h>
#include <dis6/opendis6_export.h>


Expand Down
2 changes: 1 addition & 1 deletion src/dis6/AggregateID.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include <utils/DataStream.h>
#include <dis6/utils/DataStream.h>
#include <dis6/opendis6_export.h>


Expand Down
2 changes: 1 addition & 1 deletion src/dis6/AggregateMarking.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include <utils/DataStream.h>
#include <dis6/utils/DataStream.h>
#include <dis6/opendis6_export.h>


Expand Down
2 changes: 1 addition & 1 deletion src/dis6/AggregateStatePdu.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#include <dis6/VariableDatum.h>
#include <vector>
#include <dis6/EntityManagementFamilyPdu.h>
#include <utils/DataStream.h>
#include <dis6/utils/DataStream.h>
#include <dis6/opendis6_export.h>


Expand Down
2 changes: 1 addition & 1 deletion src/dis6/AggregateType.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include <utils/DataStream.h>
#include <dis6/utils/DataStream.h>
#include <dis6/opendis6_export.h>


Expand Down
2 changes: 1 addition & 1 deletion src/dis6/AngularVelocityVector.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include <utils/DataStream.h>
#include <dis6/utils/DataStream.h>
#include <dis6/opendis6_export.h>


Expand Down
2 changes: 1 addition & 1 deletion src/dis6/AntennaLocation.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#include <dis6/Vector3Double.h>
#include <dis6/Vector3Float.h>
#include <utils/DataStream.h>
#include <dis6/utils/DataStream.h>
#include <dis6/opendis6_export.h>


Expand Down
2 changes: 1 addition & 1 deletion src/dis6/ApaData.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include <utils/DataStream.h>
#include <dis6/utils/DataStream.h>
#include <dis6/opendis6_export.h>


Expand Down
2 changes: 1 addition & 1 deletion src/dis6/ArealObjectStatePdu.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include <dis6/Vector3Double.h>
#include <vector>
#include <dis6/SyntheticEnvironmentFamilyPdu.h>
#include <utils/DataStream.h>
#include <dis6/utils/DataStream.h>
#include <dis6/opendis6_export.h>


Expand Down
2 changes: 1 addition & 1 deletion src/dis6/ArticulationParameter.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include <utils/DataStream.h>
#include <dis6/utils/DataStream.h>
#include <dis6/opendis6_export.h>


Expand Down
2 changes: 1 addition & 1 deletion src/dis6/BeamAntennaPattern.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#pragma once

#include <dis6/Orientation.h>
#include <utils/DataStream.h>
#include <dis6/utils/DataStream.h>
#include <dis6/opendis6_export.h>


Expand Down
2 changes: 1 addition & 1 deletion src/dis6/BeamData.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include <utils/DataStream.h>
#include <dis6/utils/DataStream.h>
#include <dis6/opendis6_export.h>


Expand Down
2 changes: 1 addition & 1 deletion src/dis6/BurstDescriptor.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#pragma once

#include <dis6/EntityType.h>
#include <utils/DataStream.h>
#include <dis6/utils/DataStream.h>
#include <dis6/opendis6_export.h>


Expand Down
2 changes: 2 additions & 0 deletions src/dis6/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
add_subdirectory(utils)

# Create list of all headers
set(dis6_hdr
AcknowledgePdu.h
Expand Down
2 changes: 1 addition & 1 deletion src/dis6/ClockTime.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include <utils/DataStream.h>
#include <dis6/utils/DataStream.h>
#include <dis6/opendis6_export.h>


Expand Down
2 changes: 1 addition & 1 deletion src/dis6/CollisionElasticPdu.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include <dis6/Vector3Float.h>
#include <dis6/Vector3Float.h>
#include <dis6/EntityInformationFamilyPdu.h>
#include <utils/DataStream.h>
#include <dis6/utils/DataStream.h>
#include <dis6/opendis6_export.h>


Expand Down
2 changes: 1 addition & 1 deletion src/dis6/CollisionPdu.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include <dis6/Vector3Float.h>
#include <dis6/Vector3Float.h>
#include <dis6/EntityInformationFamilyPdu.h>
#include <utils/DataStream.h>
#include <dis6/utils/DataStream.h>
#include <dis6/opendis6_export.h>


Expand Down
2 changes: 1 addition & 1 deletion src/dis6/CommentPdu.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include <dis6/VariableDatum.h>
#include <vector>
#include <dis6/SimulationManagementFamilyPdu.h>
#include <utils/DataStream.h>
#include <dis6/utils/DataStream.h>
#include <dis6/opendis6_export.h>


Expand Down
2 changes: 1 addition & 1 deletion src/dis6/CommentReliablePdu.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include <dis6/VariableDatum.h>
#include <vector>
#include <dis6/SimulationManagementWithReliabilityFamilyPdu.h>
#include <utils/DataStream.h>
#include <dis6/utils/DataStream.h>
#include <dis6/opendis6_export.h>


Expand Down
2 changes: 1 addition & 1 deletion src/dis6/CreateEntityPdu.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#pragma once

#include <dis6/SimulationManagementFamilyPdu.h>
#include <utils/DataStream.h>
#include <dis6/utils/DataStream.h>
#include <dis6/opendis6_export.h>


Expand Down
2 changes: 1 addition & 1 deletion src/dis6/CreateEntityReliablePdu.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#pragma once

#include <dis6/SimulationManagementWithReliabilityFamilyPdu.h>
#include <utils/DataStream.h>
#include <dis6/utils/DataStream.h>
#include <dis6/opendis6_export.h>


Expand Down
Loading

0 comments on commit a17466d

Please sign in to comment.