summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMathias Preiner <mathias.preiner@gmail.com>2018-09-24 11:44:41 -0700
committerGitHub <noreply@github.com>2018-09-24 11:44:41 -0700
commit7bfcbebe0f7db7d336cae04ccdfdc3c2b1aff69b (patch)
tree94737563af211d79513f353c5f5c86a72c849fcf
parent87e6a08ff94c74d13453c76adaba8f729c7a958c (diff)
cmake: Add program prefix option. (#2515)
-rw-r--r--CMakeLists.txt3
-rwxr-xr-xconfigure.sh7
-rw-r--r--src/main/CMakeLists.txt14
3 files changed, 22 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b097a70d7..453f1bcf7 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -95,6 +95,9 @@ set(GMP_DIR "" CACHE STRING "Set GMP install directory")
set(LFSC_DIR "" CACHE STRING "Set LFSC install directory")
set(SYMFPU_DIR "" CACHE STRING "Set SymFPU install directory")
+# Prepend binaries with prefix on make install
+set(PROGRAM_PREFIX "" CACHE STRING "Program prefix on make install")
+
# Supported language bindings
option(BUILD_BINDINGS_JAVA "Build Java bindings")
option(BUILD_BINDINGS_PYTHON "Build Python bindings")
diff --git a/configure.sh b/configure.sh
index b92c48ad4..16764dd8a 100755
--- a/configure.sh
+++ b/configure.sh
@@ -15,6 +15,7 @@ Build types:
General options;
-h, --help display this help and exit
--prefix=STR install directory
+ --program-prefix=STR prefix of binaries prepended on make install
--name=STR use custom build directory name (optionally: +path)
--best turn on dependencies known to give best performance
--gpl permit GPL dependencies, if available
@@ -95,6 +96,7 @@ msg () {
build_dir=build
install_prefix=default
+program_prefix=""
#--------------------------------------------------------------------------#
@@ -174,6 +176,9 @@ do
esac
;;
+ --program-prefix) die "missing argument to $1 (try -h)" ;;
+ --program-prefix=*) program_prefix=${1##*=} ;;
+
--name) die "missing argument to $1 (try -h)" ;;
--name=*) build_dir=${1##*=} ;;
@@ -401,6 +406,8 @@ cmake_opts=""
&& cmake_opts="$cmake_opts -DSYMFPU_DIR=$symfpu_dir"
[ "$install_prefix" != default ] \
&& cmake_opts="$cmake_opts -DCMAKE_INSTALL_PREFIX=$install_prefix"
+[ -n "$program_prefix" ] \
+ && cmake_opts="$cmake_opts -DPROGRAM_PREFIX=$program_prefix"
root_dir=$(pwd)
diff --git a/src/main/CMakeLists.txt b/src/main/CMakeLists.txt
index 30a246ba0..dba12006e 100644
--- a/src/main/CMakeLists.txt
+++ b/src/main/CMakeLists.txt
@@ -45,7 +45,12 @@ set_target_properties(cvc4-bin
OUTPUT_NAME cvc4
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
target_link_libraries(cvc4-bin cvc4 cvc4parser)
-install(TARGETS cvc4-bin DESTINATION bin)
+if(PROGRAM_PREFIX)
+ install(PROGRAMS
+ $<TARGET_FILE:cvc4-bin> DESTINATION bin RENAME ${PROGRAM_PREFIX}cvc4)
+else()
+ install(TARGETS cvc4-bin DESTINATION bin)
+endif()
# In order to get a fully static executable we have to make sure that we also
# use the static system libraries.
@@ -76,7 +81,12 @@ if(ENABLE_PORTFOLIO)
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
target_link_libraries(pcvc4-bin cvc4 cvc4parser ${Boost_LIBRARIES})
target_include_directories(pcvc4-bin PRIVATE ${Boost_INCLUDE_DIRS})
- install(TARGETS pcvc4-bin DESTINATION bin)
+ if(PROGRAM_PREFIX)
+ install(PROGRAMS
+ $<TARGET_FILE:pcvc4-bin> DESTINATION bin RENAME ${PROGRAM_PREFIX}pcvc4)
+ else()
+ install(TARGETS pcvc4-bin DESTINATION bin)
+ endif()
if(NOT ENABLE_SHARED)
set_target_properties(pcvc4-bin PROPERTIES LINK_FLAGS -static)
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback