Skip to content

Commit

Permalink
Merge pull request #507 from LLNL/build/essman/add_jsonschema
Browse files Browse the repository at this point in the history
Add jsonschema to devtools
  • Loading branch information
white238 committed Dec 6, 2023
2 parents 6ca21ec + 869a50b commit 7cf73c9
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 3 deletions.
6 changes: 6 additions & 0 deletions scripts/spack/packages/axom/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ class Axom(CachedCMakePackage, CudaPackage, ROCmPackage):
depends_on("python", when="+devtools")
depends_on("py-sphinx", when="+devtools")
depends_on("py-shroud", when="+devtools")
depends_on("py-jsonschema", when="+devtools")
depends_on("llvm+clang@10.0.0", when="+devtools", type="build")

# Hard requirement after Axom 0.6.1
Expand Down Expand Up @@ -506,6 +507,11 @@ def initconfig_package_entries(self):
python_path = python_path.replace(key, path_replacements[key])
entries.append(cmake_cache_path("PYTHON_EXECUTABLE", python_path))

if spec.satisfies("^py-jsonschema"):
jsonschema_dir = get_spec_path(spec, "py-jsonschema", path_replacements, use_bin=True)
jsonschema_path = os.path.join(jsonschema_dir, 'jsonschema')
entries.append(cmake_cache_path("JSONSCHEMA_EXECUTABLE", jsonschema_path))

enable_docs = spec.satisfies("^doxygen") or spec.satisfies("^py-sphinx")
entries.append(cmake_cache_option("ENABLE_DOCS", enable_docs))

Expand Down
1 change: 1 addition & 0 deletions scripts/spack/packages/axomdevtools/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@ class Axomdevtools(BundlePackage):
depends_on("py-sphinx")
depends_on("py-shroud")
depends_on("py-sphinxcontrib-jquery")
depends_on("py-jsonschema")
depends_on("llvm+clang@10.0.0")
4 changes: 4 additions & 0 deletions src/axom/config.hpp.in
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@
#cmakedefine AXOM_USE_SPARSEHASH
#cmakedefine AXOM_USE_UMPIRE

/*
* Compiler defines for third-party executables
*/
#cmakedefine JSONSCHEMA_EXECUTABLE "@JSONSCHEMA_EXECUTABLE@"

/*
* We need to explicitly add some definitions on Windows
Expand Down
2 changes: 1 addition & 1 deletion src/axom/inlet/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ axom_add_library(NAME inlet_test_utils
# Add Serial GTests based tests
set(gtest_inlet_tests
inlet_Reader.cpp
inlet_jsonschema_writer.cpp
inlet_restart.cpp
inlet_errors.cpp )

blt_list_append(TO gtest_inlet_tests ELEMENTS inlet_function.cpp IF SOL_FOUND)
blt_list_append(TO gtest_inlet_tests ELEMENTS inlet_jsonschema_writer.cpp IF JSONSCHEMA_FOUND)

foreach(test ${gtest_inlet_tests})
get_filename_component( test_name ${test} NAME_WE )
Expand Down
3 changes: 1 addition & 2 deletions src/axom/inlet/tests/inlet_jsonschema_writer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

#include "axom/slic.hpp"

#include "axom/config.hpp"
#include "axom/inlet/Inlet.hpp"
#include "axom/inlet/JSONSchemaWriter.hpp"
#include "axom/inlet/tests/inlet_test_utils.hpp"
Expand All @@ -21,8 +22,6 @@
using axom::inlet::Inlet;
using axom::inlet::JSONSchemaWriter;

#define JSONSCHEMA_EXECUTABLE "jsonschema"

bool hasSchemaUtility()
{
const static bool hasUtility =
Expand Down
6 changes: 6 additions & 0 deletions src/cmake/thirdparty/SetupAxomThirdParty.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,12 @@ if (TARGET blt::openmp)
set_target_properties(blt::openmp PROPERTIES INTERFACE_LINK_OPTIONS "")
endif()

#------------------------------------------------------------------------------
# jsonschema - for Inlet testing purposes
#------------------------------------------------------------------------------
set(ENABLE_JSONSCHEMA ON) # required by blt_find_executable
blt_find_executable(NAME jsonschema)

#------------------------------------------------------------------------------
# Targets that need to be exported but don't have a CMake config file
#------------------------------------------------------------------------------
Expand Down

0 comments on commit 7cf73c9

Please sign in to comment.