Skip to content

Commit

Permalink
Merge pull request #2310 from DARMA-tasking/2309-update-cmake-to-look…
Browse files Browse the repository at this point in the history
…-for-magistrate-target

#2309: Update `CMake` to look for `magistrate` target
  • Loading branch information
lifflander authored Jul 9, 2024
2 parents 07d404e + 7175daa commit ed79a65
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 19 deletions.
10 changes: 5 additions & 5 deletions ci/build_cpp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,13 @@ else
else
git clone -b "${checkpoint_rev}" --depth 1 https://github.com/DARMA-tasking/checkpoint.git
export CHECKPOINT=$PWD/checkpoint
export CHECKPOINT_BUILD=${build_dir}/checkpoint
mkdir -p "$CHECKPOINT_BUILD"
cd "$CHECKPOINT_BUILD"
export MAGISTRATE_BUILD=${build_dir}/checkpoint
mkdir -p "$MAGISTRATE_BUILD"
cd "$MAGISTRATE_BUILD"
mkdir build
cd build
cmake -G "${CMAKE_GENERATOR:-Ninja}" \
-DCMAKE_INSTALL_PREFIX="$CHECKPOINT_BUILD/install" \
-DCMAKE_INSTALL_PREFIX="$MAGISTRATE_BUILD/install" \
-Dkokkos_DIR="$KOKKOS_INSTALL" \
"$CHECKPOINT"
cmake --build . ${dashj} --target install
Expand Down Expand Up @@ -143,7 +143,7 @@ cmake -G "${CMAKE_GENERATOR:-Ninja}" \
-DCMAKE_CXX_COMPILER="${CXX:-c++}" \
-DCMAKE_C_COMPILER="${CC:-cc}" \
-DCMAKE_EXE_LINKER_FLAGS="${CMAKE_EXE_LINKER_FLAGS:-}" \
-Dcheckpoint_ROOT="$CHECKPOINT_BUILD/install" \
-Dmagistrate_ROOT="$MAGISTRATE_BUILD/install" \
-DCMAKE_PREFIX_PATH="${CMAKE_PREFIX_PATH:-}" \
-DCMAKE_INSTALL_PREFIX="$VT_BUILD/install" \
-Dvt_ci_build="${VT_CI_BUILD:-0}" \
Expand Down
8 changes: 4 additions & 4 deletions ci/ctest_build_all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,13 @@ else
else
git clone -b "${checkpoint_rev}" --depth 1 https://github.com/DARMA-tasking/checkpoint.git
export CHECKPOINT=$PWD/checkpoint
export CHECKPOINT_BUILD=${build_dir}/checkpoint
mkdir -p "$CHECKPOINT_BUILD"
cd "$CHECKPOINT_BUILD"
export MAGISTRATE_BUILD=${build_dir}/checkpoint
mkdir -p "$MAGISTRATE_BUILD"
cd "$MAGISTRATE_BUILD"
mkdir build
cd build
cmake -G "${CMAKE_GENERATOR:-Ninja}" \
-DCMAKE_INSTALL_PREFIX="$CHECKPOINT_BUILD/install" \
-DCMAKE_INSTALL_PREFIX="$MAGISTRATE_BUILD/install" \
"$CHECKPOINT"
cmake --build . ${dashj} --target install
fi
Expand Down
2 changes: 1 addition & 1 deletion ci/ctest_job_script.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ set(configureOpts
"-DCMAKE_CXX_COMPILER=$ENV{CXX}"
"-DCMAKE_C_COMPILER=$ENV{CC}"
"-DCMAKE_EXE_LINKER_FLAGS=$ENV{CMAKE_EXE_LINKER_FLAGS}"
"-Dcheckpoint_ROOT=$ENV{CHECKPOINT_BUILD}/install"
"-Dmagistrate_ROOT=$ENV{MAGISTRATE_BUILD}/install"
"-DCMAKE_PREFIX_PATH=$ENV{CMAKE_PREFIX_PATH}"
"-DCMAKE_INSTALL_PREFIX=$ENV{VT_BUILD}/install"
"-Dvt_ci_build=$ENV{VT_CI_BUILD}"
Expand Down
2 changes: 1 addition & 1 deletion cmake/link_vt.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ function(link_target_with_vt)
message(STATUS "link_target_with_vt: checkpoint=${ARG_LINK_CHECKPOINT}")
endif()
target_link_libraries(
${ARG_TARGET} PUBLIC ${ARG_BUILD_TYPE} ${CHECKPOINT_LIBRARY}
${ARG_TARGET} PUBLIC ${ARG_BUILD_TYPE} ${MAGISTRATE_LIBRARY}
)
endif()

Expand Down
4 changes: 2 additions & 2 deletions cmake/load_local_packages.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ if (EXISTS "${PROJECT_LIB_DIR}/checkpoint")
add_subdirectory(${PROJECT_LIB_DIR}/checkpoint)
else()
# find these required packages locally
find_package_local(checkpoint checkpoint)
find_package_local(magistrate)
endif()

set(CHECKPOINT_LIBRARY vt::lib::checkpoint)
set(MAGISTRATE_LIBRARY vt::lib::magistrate)
4 changes: 2 additions & 2 deletions cmake/local_package.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
macro(find_package_local pkg_name pkg_other_name)
macro(find_package_local pkg_name)
set(${pkg_name}_PACKAGE_LOADED 0)
if(hasParent)
# Skip this logic when this macro was not invoked from the
Expand All @@ -13,7 +13,7 @@ macro(find_package_local pkg_name pkg_other_name)

find_package(
${pkg_name}
NAMES ${pkg_name} ${pkg_other_name}
NAMES ${pkg_name}
NO_CMAKE_PACKAGE_REGISTRY
NO_CMAKE_BUILDS_PATH
NO_CMAKE_SYSTEM_PATH
Expand Down
10 changes: 6 additions & 4 deletions cmake/vtConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,19 @@ include(CMakeFindDependencyMacro)

find_dependency(MPI REQUIRED)

if (@checkpoint_PACKAGE_LOADED@)
set (checkpoint_DIR @checkpoint_DIR@)
find_dependency(checkpoint REQUIRED HINTS @checkpoint_DIR@)
if (@magistrate_PACKAGE_LOADED@)
set (magistrate_DIR @magistrate_DIR@)
set (magistrate_ROOT @magistrate_ROOT@)
find_dependency(magistrate REQUIRED HINTS @magistrate_DIR@ @magistrate_ROOT@)
endif()

set (VT_INCLUDE_DIRS "@CMAKE_INSTALL_PREFIX@/include")
set (VT_CXX_COMPILER "@CMAKE_CXX_COMPILER@")

if (@vt_external_fmt@)
set (fmt_DIR @fmt_DIR@)
find_dependency(fmt REQUIRED HINTS @fmt_DIR@)
set (fmt_ROOT @fmt_ROOT@)
find_dependency(fmt REQUIRED HINTS @fmt_DIR@ @fmt_ROOT@)
endif()

set(VT_HAS_FMT "TRUE")

0 comments on commit ed79a65

Please sign in to comment.