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
55 changes: 55 additions & 0 deletions .github/workflows/install.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Install Test

on:
workflow_call:
push:
branches: [ develop ]
tags: [ 'v*' ]
pull_request:
branches: [ develop ]

jobs:
install-test:
name: ${{ matrix.distro }} (Multiheader=${{ matrix.multiheader }})
runs-on: ubuntu-latest
container: ${{ matrix.image }}
strategy:
fail-fast: false
matrix:
distro: [ubuntu-24.04, ubuntu-22.04, debian-bookworm, fedora]
multiheader: [ON, OFF]
include:
- distro: ubuntu-24.04
image: ubuntu:24.04
install_deps: apt-get update && apt-get install -y cmake ninja-build build-essential libeigen3-dev
- distro: ubuntu-22.04
image: ubuntu:22.04
install_deps: apt-get update && apt-get install -y cmake ninja-build build-essential libeigen3-dev
- distro: debian-bookworm
image: debian:bookworm
install_deps: apt-get update && apt-get install -y cmake ninja-build build-essential libeigen3-dev
- distro: fedora
image: fedora:latest
install_deps: dnf install -y cmake ninja-build gcc-c++ eigen3-devel

steps:
- uses: actions/checkout@v4

- name: Install Dependencies
run: ${{ matrix.install_deps }}

- name: Install OpenABF
run: |
cmake -G Ninja -S . -B build \
-DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/install \
-DOPENABF_MULTIHEADER=${{ matrix.multiheader }}
cmake --install build

- name: Build Test Project
run: |
cmake -G Ninja -S tests/install -B build_install_test \
-DCMAKE_PREFIX_PATH=${{ github.workspace }}/install
cmake --build build_install_test

- name: Run Test
run: ./build_install_test/install_test
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ if(OPENABF_MULTIHEADER)
include/OpenABF/ABFPlusPlus.hpp
include/OpenABF/Exceptions.hpp
include/OpenABF/HalfEdgeMesh.hpp
include/OpenABF/HierarchicalLSCM.hpp
include/OpenABF/AngleBasedLSCM.hpp
include/OpenABF/Math.hpp
include/OpenABF/Vec.hpp
Expand Down
6 changes: 3 additions & 3 deletions cmake/InstallProject.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ install(
EXPORT OpenABFTargets
FILE OpenABFTargets.cmake
NAMESPACE OpenABF::
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/OpenABF
DESTINATION ${CMAKE_INSTALL_DATADIR}/cmake/OpenABF
)

install(
FILES
"${CMAKE_CURRENT_BINARY_DIR}/OpenABFConfig.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/OpenABFConfigVersion.cmake"
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/OpenABF
)
DESTINATION ${CMAKE_INSTALL_DATADIR}/cmake/OpenABF
)
7 changes: 7 additions & 0 deletions tests/install/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
cmake_minimum_required(VERSION 3.15)
project(OpenABF_InstallTest)

find_package(OpenABF REQUIRED)

add_executable(install_test main.cpp)
target_link_libraries(install_test OpenABF::OpenABF)
16 changes: 16 additions & 0 deletions tests/install/main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#include <cstdlib>
#include <iostream>

#include <OpenABF/OpenABF.hpp>

int main()
{
// Verify OpenABF types work (depends on Eigen being found transitively)
OpenABF::Vec3f v{1.0f, 2.0f, 3.0f};
if (v[0] != 1.0f || v[1] != 2.0f || v[2] != 3.0f) {
std::cerr << "Vec3f value mismatch" << std::endl;
return EXIT_FAILURE;
}
std::cout << "OpenABF find_package test passed" << std::endl;
return EXIT_SUCCESS;
}
Loading