Skip to content

Commit

Permalink
Change spheral_config file to set BLT location, update PolyClipper an…
Browse files Browse the repository at this point in the history
…d added variable for setting a separate install location for it, add a build-dir option to host-config-build.py
  • Loading branch information
ldowen committed Sep 20, 2023
1 parent 04be531 commit 94caa89
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 12 deletions.
5 changes: 3 additions & 2 deletions cmake/InstallTPLs.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,9 @@ if (NOT polyclipper_DIR)
set(polyclipper_DIR "${SPHERAL_ROOT_DIR}/extern/PolyClipper" CACHE PATH "")
endif()
# Must set this so PolyClipper doesn't include unnecessary python scripts
set(POLYCLIPPER_MODULE_GEN OFF CACHE BOOL "Turn off Python module generation for PolyClipper")
set(POLYCLIPPER_ENABLE_DOCS OFF CACHE BOOL "Turn off document building for PolyClipper")
set(POLYCLIPPER_MODULE_GEN OFF)
set(POLYCLIPPER_ENABLE_DOCS OFF)
set(POLYCLIPPER_INSTALL_DIR "PolyClipper/include")
add_subdirectory(${polyclipper_DIR})
# Treat includes as system to prevent warnings
blt_patch_target(NAME PolyClipperAPI TREAT_INCLUDES_AS_SYSTEM ON)
Expand Down
9 changes: 3 additions & 6 deletions cmake/spheral_cxx-config.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,14 @@ endif()
if(NOT qhull_DIR)
set(qhull_DIR "@qhull_DIR@" CACHE PATH "")
endif()
set(SPHERAL_CXX_ROOT_DIR "@SPHERAL_ROOT_DIR@")
set(SPHERAL_BLT_DIR "@SPHERAL_BLT_DIR@")
set(SPHERAL_CXX_INSTALL_PREFIX "@CMAKE_INSTALL_PREFIX@")
set(SPHERAL_CXX_INCLUDE_DIRS "${SPHERAL_CXX_INSTALL_PREFIX}/include")
if(NOT TARGET axom)
find_package(axom REQUIRED QUIET NO_DEFAULT_PATH PATHS ${axom_DIR}/lib/cmake)
find_package(axom REQUIRED QUIET NO_DEFAULT_PATH PATHS ${axom_DIR} ${axom_DIR}/lib ${axom_DIR}/lib/cmake)
endif()
include("${SPHERAL_CXX_INSTALL_PREFIX}/lib/cmake/spheral_cxx-targets.cmake")

set_property(TARGET Spheral_CXX
APPEND PROPERTY
INTERFACE_INCLUDE_DIRECTORIES ${SPHERAL_CXX_INCLUDE_DIRS}
)

set(spheral_cxx_FOUND TRUE)
INTERFACE_INCLUDE_DIRECTORIES ${SPHERAL_CXX_INCLUDE_DIRS})
2 changes: 1 addition & 1 deletion extern/PolyClipper
12 changes: 9 additions & 3 deletions scripts/devtools/host-config-build.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ def parse_args():
parser.add_argument('-i', '--install-dir', type=str, default="",
help='Location of spheral source directory.')

parser.add_argument('--build-dir', type=str, default="",
help='Name of build directory.')

parser.add_argument('--no-clean', action='store_true',
help='Do not delete build and install locations.')

Expand Down Expand Up @@ -63,12 +66,15 @@ def main():


# Set up our directory structure paths.
build_dir="{0}/build_{1}/build".format(source_dir, hostconfig)
if not args.build_dir:
build_dir="{0}/build_{1}".format(source_dir, hostconfig)
else:
build_dir="{0}/{1}".format(source_dir, args.build_dir)
if not args.install_dir:
install_dir="{0}/build_{1}/install".format(source_dir, hostconfig)
install_dir="{0}/install".format(build_dir)
else:
install_dir=args.install_dir

build_dir=build_dir+"/build"
# Pull the cmake command to use out of our host config.
cmake_cmd=sexe("grep 'CMake executable' \"{0}\"".format(hostconfig_path), ret_output=True, echo=True)[1].split()[-1]

Expand Down

0 comments on commit 94caa89

Please sign in to comment.