diff --git a/CMakeLists.txt b/CMakeLists.txt index 581922b7..a3f1f7ea 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -63,8 +63,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 3cb00b94..b015040d 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-bitwuzla build with Bitwuzla (default: off) --with-msat build with MathSAT which has a custom non-BSD compliant license. (default : off) Required for interpolant based model checking @@ -35,6 +36,7 @@ die () { } build_dir=build +smt_switch_dir=$(pwd)/deps/smt-switch install_prefix=default build_type=default with_bitwuzla=default @@ -75,6 +77,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-bitwuzla) with_bitwuzla=ON;; --with-msat) with_msat=ON;; --with-msat-ic3ia) with_msat_ic3ia=ON;; @@ -104,7 +115,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)