diff options
author | Mathias Preiner <mathias.preiner@gmail.com> | 2021-04-05 20:58:13 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-06 03:58:13 +0000 |
commit | 7f0ea0fafaca1bc40dd1f6f5891526956de857b1 (patch) | |
tree | a850f5a0e5a892c192fcc1757cb0f9fadcce130c | |
parent | 44af184778fbc4bb31c13cb52c20942dc3ef0842 (diff) |
genkinds: Do not use relative paths to find src directory. (#6293)
-rw-r--r-- | src/api/java/CMakeLists.txt | 5 | ||||
-rw-r--r-- | src/api/java/genkinds.py.in (renamed from src/api/java/genkinds.py) | 27 |
2 files changed, 15 insertions, 17 deletions
diff --git a/src/api/java/CMakeLists.txt b/src/api/java/CMakeLists.txt index 38c12aa5c..231473075 100644 --- a/src/api/java/CMakeLists.txt +++ b/src/api/java/CMakeLists.txt @@ -13,16 +13,17 @@ file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/cvc") # Generate cvc/Kind.java +configure_file(genkinds.py.in genkinds.py) add_custom_target( gen-java-kinds ALL COMMAND "${PYTHON_EXECUTABLE}" - "${CMAKE_CURRENT_LIST_DIR}/genkinds.py" + "${CMAKE_CURRENT_BINARY_DIR}/genkinds.py" --kinds-header "${PROJECT_SOURCE_DIR}/src/api/cpp/cvc5_kind.h" --kinds-file-prefix "${CMAKE_CURRENT_BINARY_DIR}/cvc/Kind" DEPENDS - genkinds.py + "${CMAKE_CURRENT_BINARY_DIR}/genkinds.py" COMMENT "Generate Kind.java" ) diff --git a/src/api/java/genkinds.py b/src/api/java/genkinds.py.in index 8dc3c84d8..5e1a969c2 100644 --- a/src/api/java/genkinds.py +++ b/src/api/java/genkinds.py.in @@ -1,14 +1,14 @@ #!/usr/bin/env python -# -# genkinds.py -# Top contributors (to current version): -# Mudathir Mohamed -# This file is part of the CVC4 project. -# Copyright (c) 2009-2021 by the authors listed in the file AUTHORS -# in the top-level source directory and their institutional affiliations. -# All rights reserved. See the file COPYING in the top-level source -# directory for licensing information. -# +##################### +## genkinds.py +## Top contributors (to current version): +## Mudathir Mohamed +## This file is part of the CVC4 project. +## Copyright (c) 2009-2021 by the authors listed in the file AUTHORS +## in the top-level source directory and their institutional affiliations. +## All rights reserved. See the file COPYING in the top-level source +## directory for licensing information. +## """ This script reads CVC4/src/api/cpp/cvc5_kind.h and generates @@ -19,11 +19,8 @@ import argparse import os import sys -# the following command in CVC4/build/src/api/java/CMakeFiles/gen-java-kinds.dir/build.make -# cd CVC4/build/src/api/java && /usr/bin/python3 CVC4/src/api/java/genkinds.py ... -# indicates we are in directory CVC4/build/src/api/java -# so we use ../../../../src/api to access CVC4/src/api/parsekinds.py -sys.path.insert(0, os.path.abspath('../../../../src/api')) +# get access to CVC4/src/api/parsekinds.py +sys.path.insert(0, os.path.abspath('${CMAKE_SOURCE_DIR}/src/api')) from parsekinds import * |