diff --git a/CMakeLists.txt b/CMakeLists.txt index 01d38281..61f65d78 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -61,8 +61,6 @@ message("-- FOUND FLEX INCLUDE DIRS: ${FLEX_INCLUDE_DIRS}") # find package #list(APPEND CMAKE_PREFIX_PATH "${PROJECT_SOURCE_DIR}/smt-switch") -set(SMT_SWITCH_DIR "${PROJECT_SOURCE_DIR}/deps/smt-switch") - # rely on cmake modules from smt-switch (required anyway) set(CMAKE_MODULE_PATH ${SMT_SWITCH_DIR}/cmake) diff --git a/configure.sh b/configure.sh index 74e4f740..39036089 100755 --- a/configure.sh +++ b/configure.sh @@ -13,6 +13,7 @@ Configures the CMAKE build environment. -h, --help display this message and exit --prefix=STR install directory (default: /usr/local/) --build-dir=STR custom build directory (default: build) +--smt-switch-dir=STR custom smt-switch directory (default: deps/smt-switch) --with-msat build with MathSAT which has a custom non-BSD compliant license. (default : off) Required for interpolant based model checking --with-msat-ic3ia build with the open-source IC3IA implementation as a backend. (default: off) @@ -33,6 +34,7 @@ die () { } build_dir=build +smt_switch_dir=$(pwd)/deps/smt-switch install_prefix=default build_type=default with_msat=default @@ -71,6 +73,15 @@ do *) build_dir=$(pwd)/$build_dir ;; # make absolute path esac ;; + --smt-switch-dir) die "missing argument to $1 (see -h)" ;; + --smt-switch-dir=*) + smt_switch_dir=${1##*=} + # Check if this is an absolute path and if not, make it absolute. + case $smt_switch_dir in + /*) ;; # absolute path + *) smt_switch_dir=$(pwd)/$smt_switch_dir ;; # make absolute path + esac + ;; --with-msat) with_msat=ON;; --with-msat-ic3ia) with_msat_ic3ia=ON;; --with-coreir) with_coreir=ON;; @@ -98,7 +109,7 @@ done [ $lib_type = STATIC ] && [ $with_coreir = ON -o $with_coreir_extern = ON ] && \ die "CoreIR and static build are incompatible, must omit either '--static/--static-lib' or '--with-coreir/--with-coreir-extern'" -cmake_opts="-DCMAKE_BUILD_TYPE=$buildtype -DPONO_LIB_TYPE=${lib_type} -DPONO_STATIC_EXEC=${static_exec}" +cmake_opts="-DCMAKE_BUILD_TYPE=$buildtype -DPONO_LIB_TYPE=${lib_type} -DPONO_STATIC_EXEC=${static_exec} -DSMT_SWITCH_DIR=${smt_switch_dir}" [ $install_prefix != default ] \ && cmake_opts="$cmake_opts -DCMAKE_INSTALL_PREFIX=$install_prefix" diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt index bc05785b..d69946ae 100644 --- a/python/CMakeLists.txt +++ b/python/CMakeLists.txt @@ -35,7 +35,7 @@ else() CACHE STRING "Extra flags to the cython compiler." FORCE) endif() -include_directories("${PROJECT_SOURCE_DIR}/deps/smt-switch/python/smt_switch") +include_directories("${SMT_SWITCH_DIR}/python/smt_switch") # Everything from here up to line 'include(FindPythonExtensions)' is copied # from smt-switch python/CMakefile: @@ -105,7 +105,7 @@ add_cython_target(pono CXX) add_library(pono MODULE ${pono}) target_link_libraries(pono pono-lib) -target_include_directories(pono PUBLIC "${PROJECT_SOURCE_DIR}/deps/smt-switch/local/include/smt-switch") +target_include_directories(pono PUBLIC "${SMT_SWITCH_DIR}/local/include/smt-switch") python_extension_module(pono)