Commit a7861a7f authored by Salko Jr, Robert's avatar Salko Jr, Robert
Browse files

Switch SubKit to use TriBITs for easier integration with other repos

parent 79516cc3
Loading
Loading
Loading
Loading
+22 −4
Original line number Diff line number Diff line
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.11 FATAL_ERROR)
project(SubKit)

IF (NOT TRIBITS_PROCESSING_PACKAGE)
   include("${CMAKE_CURRENT_SOURCE_DIR}/ProjectName.cmake")
   project(${PROJECT_NAME} NONE)
   set(${PROJECT_NAME}_TRIBITS_DIR "${CMAKE_CURRENT_SOURCE_DIR}/wasp/TriBITS/tribits" CACHE PATH "")
   include("${${PROJECT_NAME}_TRIBITS_DIR}/TriBITS.cmake")

   TRIBITS_PROJECT_ENABLE_ALL()
ELSE(NOT TRIBITS_PROCESSING_PACKAGE)
  INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
  INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR})
  TRIBITS_PACKAGE_DECL(SubKit)
  TRIBITS_PROCESS_SUBPACKAGES()
  TRIBITS_PACKAGE_DEF()
  TRIBITS_PACKAGE_POSTPROCESS()
ENDIF(NOT TRIBITS_PROCESSING_PACKAGE)

file(COPY SubKit doc tests LICENSE MANIFEST.in README.md DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
add_subdirectory(wasp)

find_package(PythonInterp 2.7 REQUIRED )
find_package(PythonLibs 2.7 REQUIRED )
@@ -21,7 +35,11 @@ if (PYTHON)
                       COMMAND ${CMAKE_COMMAND} -E touch ${OUTPUT}
                       DEPENDS ${DEPS})

    add_custom_target(target ALL DEPENDS ${OUTPUT})
    add_custom_target(subkit ALL DEPENDS ${OUTPUT})

    install(CODE "execute_process(COMMAND ${PYTHON} ${SETUP_PY} install)")
    # This next line does not work because python install complains this directory is not in the python path
    #install(CODE "execute_process(COMMAND ${PYTHON} ${CMAKE_CURRENT_BINARY_DIR}/setup.py install --home=${CMAKE_INSTALL_PREFIX})")
    # So we are stuck with installing SubKit to the site-packages instead
    # Specify --user to do a local install
    install(CODE "execute_process(COMMAND ${PYTHON} ${CMAKE_CURRENT_BINARY_DIR}/setup.py install --user)")
endif()

PackagesList.cmake

0 → 100644
+3 −0
Original line number Diff line number Diff line
TRIBITS_REPOSITORY_DEFINE_PACKAGES(
   wasp wasp PT
)

ProjectName.cmake

0 → 100644
+1 −0
Original line number Diff line number Diff line
SET(PROJECT_NAME SubKit)
+8 −3
Original line number Diff line number Diff line
@@ -9,15 +9,20 @@ import utils.utils as utils
from subprocess import Popen, PIPE, check_call
mypath = os.path.abspath(os.path.dirname(__file__))
localWaspPath = os.path.join(mypath, "../../wasp")
inCTFpath = os.path.join(mypath, '../..')
CIpath = "/Users/rsk/SubKit/SubKit/wasp/build/install"
if os.path.exists(localWaspPath):
    # This is where users should have built and installed WASP
    sys.path.append(sys.path.append(os.path.join(localWaspPath, "wasppy")))
    waspPath = localWaspPath
    waspPath = os.path.join(localWaspPath, 'wasputils')
elif os.path.exists(CIpath):
    # This is where the test CI will look for it on the testing machine
    sys.path.append(os.path.join(CIpath, "wasppy"))
    waspPath = CIpath
    waspPath = os.path.join(CIpath, 'wasputils')
elif os.path.exists(inCTFpath):
    # This is where wasppy will be when SubKit is installed as part of CTF
    sys.path.append(os.path.join(inCTFpath, "wasppy"))
    waspPath = os.path.join(inCTFpath, 'bin')
else:
    raise RuntimeError("WASP package was not found.  It must be installed in SubKit/wasp/build/install to use the input mode.")
from wasp2py import get_json_dict, get_wasp_utility_path
@@ -39,7 +44,7 @@ class InpParse(object):
        #me.inpDict = yaml.safe_load(open(inpFileName).read())

        # First run the validator to check if this is valid before loading it
        validator = os.path.join(waspPath, 'wasputils/ddivalid')
        validator = os.path.join(waspPath, 'ddivalid')
        schemaPath = os.path.join(mypath, 'input.sch')
        cmd = '"' + validator+ '" "' + schemaPath+ '" "' + inpFileName + '"'
        proc = Popen(cmd, shell=True)

TPLsList.cmake

0 → 100644
+1 −0
Original line number Diff line number Diff line
# No TPLs for SubKit
Loading