Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 2 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ jobs:
container: ''
install: |
brew update
brew upgrade
- os: ubuntu-latest
container: rockylinux:9
install: |
Expand All @@ -32,7 +31,7 @@ jobs:
run: |
cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release
cmake --build build --target FMACM -j
./bin/FMACM --version
./build/bin/FMACM --version



Expand Down Expand Up @@ -60,13 +59,4 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: test-results
path: unittest/*results.xml

# - name: Publish JUnit test results
# uses: dorny/test-reporter@v2
# if: always()
# with:
# name: Public Library Tests
# path: unittest/*results.xml
# reporter: jest-junit
# fail-on-error: true
path: build/unittest/*results.xml
35 changes: 21 additions & 14 deletions AircraftDynamicsTestFramework/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,33 +32,40 @@ set(SOURCE_FILES
WindInterpolator.cpp
)

set(LIBRARY_OUTPUT_PATH ${CMAKE_CURRENT_SOURCE_DIR}/lib)
set(FMACM_BADA_TARGET "" CACHE STRING "Optional BADA implementation target")
set(FMACM_FIM_SAMPLE_ALGORITHM_TARGET "" CACHE STRING "Optional FIM sample algorithm target")

# OPTIONAL Libraries ------
# a bada implementation is needed to run, but the definition is
# optional so that compiling will still occur if it is missing
# These optional local include files can define the legacy BADA_LIBRARY and
# SAMPLE_ALGORITHM_LIBRARY variables. Prefer the FMACM_*_TARGET cache hooks
# for downstream composition.
include(bada_library.cmake OPTIONAL)
#
# the DO-361A Sample Algorithm can be linked into this code, but
# its presence is not required for compiling
include(sample_algorithm_library.cmake OPTIONAL)
if("${FMACM_BADA_TARGET}" STREQUAL "" AND DEFINED BADA_LIBRARY)
set(FMACM_BADA_TARGET "${BADA_LIBRARY}")
endif()
if("${FMACM_FIM_SAMPLE_ALGORITHM_TARGET}" STREQUAL "" AND DEFINED SAMPLE_ALGORITHM_LIBRARY)
set(FMACM_FIM_SAMPLE_ALGORITHM_TARGET "${SAMPLE_ALGORITHM_LIBRARY}")
endif()
# ------

add_library(framework STATIC ${SOURCE_FILES} ${DATA_READER_FILES} ${DATA_LOADER_FILES} ${DATA_WRITER_FILES})
add_library(mitre::oss::fmacm_framework ALIAS framework)
set_target_properties(framework PROPERTIES
ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib
)
target_include_directories(framework PUBLIC
${aaesim_INCLUDE_DIRS})
target_link_libraries(framework
PUBLIC
mitre::fsloader
${BADA_LIBRARY}
${SAMPLE_ALGORITHM_LIBRARY}
log4cplus::log4cplus
mitre::oss::simcore)
if (DEFINED BADA_LIBRARY)
# Add a compile definition to the build
target_compile_definitions(framework PUBLIC "MITRE_BADA3_LIBRARY")
if (FMACM_BADA_TARGET)
target_link_libraries(framework PUBLIC ${FMACM_BADA_TARGET})
target_compile_definitions(framework PUBLIC MITRE_BADA3_LIBRARY)
endif()
if (DEFINED SAMPLE_ALGORITHM_LIBRARY)
# Add a compile definition to the build
target_compile_definitions(framework PUBLIC "SAMPLE_ALGORITHM_LIBRARY")
if (FMACM_FIM_SAMPLE_ALGORITHM_TARGET)
target_link_libraries(framework PUBLIC ${FMACM_FIM_SAMPLE_ALGORITHM_TARGET})
target_compile_definitions(framework PUBLIC SAMPLE_ALGORITHM_LIBRARY)
endif()
13 changes: 6 additions & 7 deletions AircraftDynamicsTestFramework/fmacm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,22 @@
#include <stdlib.h>
#include <unistd.h>

#include <algorithm>
#include <fstream>
#include <iostream>
#include <memory>
#include <string>
#include <utility>
#include <vector>

#include "cppmanifest/cppmanifest.h"
#include "framework/TestFrameworkScenario.h"
#include "public/Log4cplusSetup.h"
#include "public/ScenarioUtils.h"

#define _MAX_PATH 260
#ifndef FMACM_VERSION
#define FMACM_VERSION "unknown"
#endif

const std::vector<std::pair<std::string, std::shared_ptr<TestFrameworkScenario>>> LoadConfigurationFile(
const std::string &filename);
Expand All @@ -52,16 +55,12 @@ const std::string VERSION_FLAG("--version");
int main(int argc, char *argv[]) {
log4cplus::Initializer initializer;
LoadLoggerProperties();
LOG4CPLUS_INFO(logger, "running " << aaesim::cppmanifest::GetVersion());
LOG4CPLUS_INFO(logger, "running " << FMACM_VERSION);

if (argc == 2) {
std::string arg1(argv[1]);
if (arg1 == VERSION_FLAG) {
std::cout << "fmacm version " << aaesim::cppmanifest::GetVersion() << std::endl;
return EXIT_SUCCESS;
} else if (arg1 == aaesim::cppmanifest::BUILDINFO_CLI_FLAG) {
std::cout << "fmacm build info:" << std::endl;
aaesim::cppmanifest::PrintMetaData();
std::cout << "fmacm version " << FMACM_VERSION << std::endl;
return EXIT_SUCCESS;
}
} else {
Expand Down
23 changes: 4 additions & 19 deletions AircraftDynamicsTestFramework/framework.cmake
Original file line number Diff line number Diff line change
@@ -1,32 +1,17 @@
add_subdirectory(${FRAMEWORK_DIR})

if(NOT ${BUILD_LIBARIES_ONLY})
# CPMAddPackage(
# NAME cppmanifest_fmacm
# GIT_REPOSITORY https://mustache.mitre.org/scm/idea/cppmanifest.git
# GIT_TAG v1.7
# DOWNLOAD_ONLY TRUE
# )
# if(cppmanifest_fmacm_ADDED AND IS_READABLE "${cppmanifest_fmacm_SOURCE_DIR}")
# include(${cppmanifest_fmacm_SOURCE_DIR}/cppmanifest_configure.cmake)
# set(PATH_FOR_CPPMANIFEST "${CMAKE_CURRENT_BINARY_DIR}/include/cppmanifest")
# cppmanifest_configure(${PATH_FOR_CPPMANIFEST})
# set(cppmanifest_INCLUDE_DIR "${CMAKE_CURRENT_BINARY_DIR}/include")
# else()
# message(FATAL_ERROR "Unable to configure cppmanifest header files: ${cppmanifest_fmacm_SOURCE_DIR}")
# endif()
set(cppmanifest_INCLUDE_DIR "${CMAKE_CURRENT_BINARY_DIR}/include")

if(FMACM_BUILD_EXECUTABLE)
SET(FMACM_MAIN_SRC ${FRAMEWORK_DIR}/fmacm.cpp)

add_executable(FMACM ${FMACM_MAIN_SRC})
add_executable(mitre::oss::fmacm ALIAS FMACM)
target_link_libraries(FMACM framework)
target_compile_definitions(FMACM PRIVATE "FMACM_VERSION=\"${FMACM_VERSION}\"")
target_include_directories(FMACM PUBLIC
$<BUILD_INTERFACE:${cppmanifest_INCLUDE_DIR}>
$<BUILD_INTERFACE:${aaesim_INCLUDE_DIRS}>
)
set_target_properties(FMACM PROPERTIES
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin
RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin
)
else()
# Ensure framework library is a build target even though nothing depends on it
Expand Down
90 changes: 52 additions & 38 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.14)
project(aaesim VERSION 5.3.1.0) # the nano value is a boolean. 1 == SNAPSHOT, 0 == release # the nano value is a boolean. 1 == SNAPSHOT, 0 == release
project(aaesim VERSION 5.3.3)

set (CMAKE_CXX_STANDARD 20)

Expand All @@ -8,13 +8,33 @@ if (NOT DEFINED CMAKE_BUILD_TYPE)
endif()
message ("${PROJECT_NAME}: Build type set to ${CMAKE_BUILD_TYPE}")

option(BUILD_LIBARIES_ONLY "Build ${PROJECT_NAME} libraries only, no binaries" OFF)
if(${BUILD_LIBARIES_ONLY})
message(STATUS "${PROJECT_NAME}: only building libraries, skipping binaries")
if(CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR)
set(FMACM_IS_TOP_LEVEL ON)
else()
set(FMACM_IS_TOP_LEVEL OFF)
endif()

option(BUILD_TESTING "Enable building ${PROJECT_NAME} tests" ON)
if(NOT ${BUILD_TESTING})
set(FMACM_BUILD_EXECUTABLE_DEFAULT ON)
if(DEFINED BUILD_LIBARIES_ONLY AND BUILD_LIBARIES_ONLY)
set(FMACM_BUILD_EXECUTABLE_DEFAULT OFF)
endif()
option(FMACM_BUILD_EXECUTABLE "Build the FMACM executable" ${FMACM_BUILD_EXECUTABLE_DEFAULT})
if(DEFINED BUILD_LIBARIES_ONLY AND BUILD_LIBARIES_ONLY)
message(STATUS "BUILD_LIBARIES_ONLY is deprecated; use FMACM_BUILD_EXECUTABLE instead")
endif()
if(NOT FMACM_BUILD_EXECUTABLE)
message(STATUS "${PROJECT_NAME}: only building libraries, skipping executable")
endif()

set(FMACM_BUILD_TESTING_DEFAULT OFF)
if(FMACM_IS_TOP_LEVEL)
set(FMACM_BUILD_TESTING_DEFAULT ON)
if(DEFINED BUILD_TESTING)
set(FMACM_BUILD_TESTING_DEFAULT ${BUILD_TESTING})
endif()
endif()
option(FMACM_BUILD_TESTING "Build ${PROJECT_NAME} tests" ${FMACM_BUILD_TESTING_DEFAULT})
if(NOT FMACM_BUILD_TESTING)
message(STATUS "${PROJECT_NAME}: skipping test targets")
endif()

Expand All @@ -30,50 +50,44 @@ CPMAddPackage(
VERSION 1.2.5
)

# CPMAddPackage(
# NAME cppmanifest
# GIT_REPOSITORY https://mustache.mitre.org/scm/idea/cppmanifest.git
# GIT_TAG v1.7
# DOWNLOAD_ONLY TRUE
# )
# if (cppmanifest_ADDED)
# include(${cppmanifest_SOURCE_DIR}/cppmanifest_configure.cmake)
# cppmanifest_configure(${PROJECT_SOURCE_DIR}/include/cppmanifest)
# endif()

# cppmanifest does not do strings in the version, but we want them.
# Append -SNAPSHOT to the version name if this is a pre-release version
if (${PROJECT_VERSION_TWEAK})
set(aaesim_VERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}-SNAPSHOT)
if(PROJECT_VERSION_TWEAK)
set(FMACM_VERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}-SNAPSHOT)
else()
set(aaesim_VERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH})
set(FMACM_VERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH})
endif()
message("-- Generating build for ${PROJECT_NAME} version ${aaesim_VERSION}")
message("-- Generating build for ${PROJECT_NAME} version ${FMACM_VERSION}")

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-strict-aliasing")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wall -Wno-unused-function -Wno-sign-compare -O0 -g")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -Wall -Wno-unused-function -Wno-sign-compare -O3 -g3")

CPMAddPackage(
NAME fsloader
GIT_REPOSITORY https://github.com/mitre/fsloader.git
GIT_TAG 1.1.0
OPTIONS
"FSLOADER_BUILD_EXAMPLE OFF"
"BUILD_SHARED_LIBS FALSE"
)
if(NOT TARGET mitre::fsloader)
CPMAddPackage(
NAME fsloader
GIT_REPOSITORY https://github.com/mitre/fsloader.git
GIT_TAG 1.1.0
OPTIONS
"FSLOADER_BUILD_EXAMPLE OFF"
"BUILD_SHARED_LIBS FALSE"
)
endif()

CPMAddPackage(
NAME aircraft_simulation_core
GIT_REPOSITORY https://github.com/mitre/aircraft_simulation_core.git
GIT_TAG a84dc78805bf35b6a45c68ac99f1c47fe47ad892 # FIXME switch to a release tag when available
OPTIONS
"SIMCORE_BUILD_TESTING OFF"
)
if(NOT TARGET mitre::oss::simcore)
CPMAddPackage(
NAME aircraft_simulation_core
GIT_REPOSITORY https://github.com/mitre/aircraft_simulation_core.git
GIT_TAG a84dc78805bf35b6a45c68ac99f1c47fe47ad892 # FIXME switch to a release tag when available
OPTIONS
"SIMCORE_BUILD_TESTING OFF"
)
endif()

set (FRAMEWORK_DIR ${CMAKE_CURRENT_SOURCE_DIR}/AircraftDynamicsTestFramework)
set (aaesim_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/include )
set (UNITTEST_DIR ${CMAKE_CURRENT_SOURCE_DIR}/unittest)

include(${UNITTEST_DIR}/unittest.cmake OPTIONAL)
include(${FRAMEWORK_DIR}/framework.cmake OPTIONAL)
if(FMACM_BUILD_TESTING)
include(${UNITTEST_DIR}/unittest.cmake OPTIONAL)
endif()
3 changes: 1 addition & 2 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ Run from the terminal. Or compile the libraries here into a larger code base for
The [main entry point](https://github.com/mitre/FMACM/blob/master/AircraftDynamicsTestFramework/fmacm.cpp) provides:

- `--version`: report the build version;
- `--buildinfo`: report the build environment;
- a single positional argument is used to provide a configuration file.

The above command line arguments may not be combined.
Expand All @@ -80,7 +79,7 @@ An example is provided in [./Run_Files/](https://github.com/mitre/FMACM/blob/mas
The executable is then executed:

```bash
./bin/FMACM ./Run_Files/test-framework-configuration.txt
./build/bin/FMACM ./Run_Files/test-framework-configuration.txt
```

Data output is found in the run-time directory in the form of CSV files.
53 changes: 0 additions & 53 deletions include/cppmanifest/build_info.h

This file was deleted.

Loading
Loading