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

Getting Github actions to build correctly. #73

Merged
merged 7 commits into from
Nov 23, 2024
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
12 changes: 9 additions & 3 deletions .github/workflows/c-cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,14 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: "install boost"
run: sudo apt-get -y install libboost-dev
run: sudo apt-get -y install libboost-all-dev
- name: "install nlohmann-json"
run: sudo apt-get -y install nlohmann-json3-dev
- name: "set boost path"
run: export BOOST_ROOT=/usr/lib/x86_64-linux-gnu/cmake/Boost-1.74.0/
- name: "debug print"
run: ls -l /usr/local/include
- name: "run CMake"
run: cmake -S . build
run: cmake -S . build -DCMAKE_PREFIX_PATH=/usr/lib/x86_64-linux-gnu/cmake/Boost-1.74.0/
- name: "build project"
run: cmake --build build --target all -j4
run: cmake --build build --target formatter foxsimile
43 changes: 17 additions & 26 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -216,38 +216,29 @@ endif()
set(Boost_USE_STATIC_LIBS OFF)
set(Boost_USE_MULTITHREADED ON)
set(Boost_USE_STATIC_RUNTIME OFF)
find_package(Boost 1.70 REQUIRED COMPONENTS filesystem program_options)
find_package(Boost 1.74 REQUIRED COMPONENTS program_options)
if(Boost_FOUND)
message(STATUS "Boost version: ${Boost_VERSION}")

# Check if Boost version newer than CMake, or if CMake is too old:
if(NOT TARGET Boost::filesystem)
add_library(Boost::filesystem IMPORTED INTERFACE)
set_property(TARGET Boost::filesystem PROPERTY
INTERFACE_INCLUDE_DIRECTORIES ${Boost_INCLUDE_DIR})
set_property(TARGET Boost::filesystem PROPERTY
INTERFACE_LINK_LIBRARIES ${Boost_LIBRARIES})
endif()

# link the user libraries to Boost
target_link_libraries(libcom PUBLIC Boost::filesystem Boost::program_options)
target_link_libraries(libsubsys PUBLIC Boost::filesystem Boost::program_options)
target_link_libraries(libutil PUBLIC Boost::filesystem Boost::program_options)
target_link_libraries(libgse PUBLIC Boost::filesystem Boost::program_options)
target_link_libraries(libcom PUBLIC Boost::program_options)
target_link_libraries(libsubsys PUBLIC Boost::program_options)
target_link_libraries(libutil PUBLIC Boost::program_options)
target_link_libraries(libgse PUBLIC Boost::program_options)

# then link them all to the executables
target_link_libraries(formatter PUBLIC Boost::filesystem libcom libsubsys libutil)
target_link_libraries(stop PUBLIC Boost::filesystem libcom libsubsys libutil)
target_link_libraries(shutdown PUBLIC Boost::filesystem libcom libsubsys libutil)
target_link_libraries(log PUBLIC Boost::filesystem libcom libsubsys libutil libgse)
target_link_libraries(foxsimile PUBLIC Boost::filesystem libcom libsubsys libutil libgse)
target_link_libraries(test_spw_crc PUBLIC Boost::filesystem libcom libsubsys libutil)
target_link_libraries(test_spw_ping PUBLIC Boost::filesystem libcom libsubsys libutil)
target_link_libraries(test_spw_reply PUBLIC Boost::filesystem libcom libsubsys libutil)
target_link_libraries(test_loop PUBLIC Boost::filesystem libcom libsubsys libutil)
target_link_libraries(test_buffers PUBLIC Boost::filesystem libcom libsubsys libutil)
target_link_libraries(test PUBLIC Boost::filesystem libcom libsubsys libutil)
target_link_libraries(test_uart PUBLIC Boost::filesystem libcom libsubsys libutil)
target_link_libraries(formatter PUBLIC libcom libsubsys libutil)
target_link_libraries(stop PUBLIC libcom libsubsys libutil)
target_link_libraries(shutdown PUBLIC libcom libsubsys libutil)
target_link_libraries(log PUBLIC libcom libsubsys libutil libgse)
target_link_libraries(foxsimile PUBLIC libcom libsubsys libutil libgse)
target_link_libraries(test_spw_crc PUBLIC libcom libsubsys libutil)
target_link_libraries(test_spw_ping PUBLIC libcom libsubsys libutil)
target_link_libraries(test_spw_reply PUBLIC libcom libsubsys libutil)
target_link_libraries(test_loop PUBLIC libcom libsubsys libutil)
target_link_libraries(test_buffers PUBLIC libcom libsubsys libutil)
target_link_libraries(test PUBLIC libcom libsubsys libutil)
target_link_libraries(test_uart PUBLIC libcom libsubsys libutil)
elseif(NOT Boost_FOUND)
error("Boost not found.")
endif()
Expand Down