Skip to content

Commit 7f6cef8

Browse files
authored
Merge pull request #226 from Fuad-HH/meshfields-target
Add meshFields as an exported target
2 parents d53185d + 64b55f7 commit 7f6cef8

File tree

4 files changed

+43
-0
lines changed

4 files changed

+43
-0
lines changed

.github/workflows/cmake-test.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,3 +221,15 @@ jobs:
221221

222222
- name: Print Test
223223
run: cat ${{ runner.temp }}/build-pcms/Testing/Temporary/LastTest.log
224+
225+
- name: Test PCMS Installation
226+
shell: bash
227+
run: |
228+
# Configure and build the test
229+
# it should only ask for pcms_DIR/ROOT to find all dependencies
230+
cmake \
231+
-B ${{github.workspace}}/examples/external-usage-example/build \
232+
-S ${{github.workspace}}/examples/external-usage-example/ \
233+
-Dpcms_DIR=${{ runner.temp }}/build-pcms/install/lib/cmake/pcms \
234+
235+
cmake --build ${{github.workspace}}/examples/external-usage-example/build

config.cmake.in

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,14 @@
33
include(CMakeFindDependencyMacro)
44
find_dependency(redev CONFIG HINTS @redev_DIR@)
55
find_dependency(Kokkos CONFIG HINTS @Kokkos_DIR@)
6+
find_dependency(meshfields CONFIG HINTS @meshfields_DIR@)
7+
find_dependency(ADIOS2 CONFIG HINTS @ADIOS2_DIR@)
68
find_dependency(MPI)
79

10+
if(@spdlog_FOUND)
11+
find_dependency(spdlog CONFIG HINTS @spdlog_DIR@)
12+
endif()
13+
814
if(@PCMS_ENABLE_OMEGA_H@)
915
find_dependency(Omega_h CONFIG HINTS @Omega_h_DIR@)
1016
endif()
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# ########### Configure and Link pcms Library ##################################
2+
# This is an example CMakeLists.txt file to configure and link the pcms library
3+
# with an external project.
4+
# ##############################################################################
5+
6+
cmake_minimum_required(VERSION 3.19)
7+
project(pcms_installation_test)
8+
9+
# It searches in pcms_ROOT, pcms_DIR, or other standard paths
10+
find_package(pcms REQUIRED)
11+
12+
add_executable(pcms_test main.cpp)
13+
14+
# Link the pcms library to the executable Other target names cound be found in
15+
# your installation's <pcms install dir>/lib64/cmake/pcms/pcms-targets.cmake
16+
target_link_libraries(pcms_test PUBLIC pcms::pcms)
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#include <iostream>
2+
#include <pcms/print.h>
3+
4+
int main()
5+
{
6+
std::cout << "Testing PCMS dependency export..." << std::endl;
7+
pcms::printInfo("Dependency test successful!\n");
8+
return 0;
9+
}

0 commit comments

Comments
 (0)