Skip to content

Commit f1660cc

Browse files
committed
changed absolut path to bash scripts using CMAKE_SOURCE_DIR to relative path with CMAKE_CURRENT_SOURCE_DIR.
1 parent 3974c4e commit f1660cc

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ string(REGEX REPLACE "CBMC_VERSION = (.*)" "\\1" CBMC_VERSION ${CBMC_VERSION})
4545

4646
project(CBMC VERSION ${CBMC_VERSION})
4747

48+
set(CBMC_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR})
49+
4850
# when config.inc changes we’ll need to reconfigure to check if the version changed
4951
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/src/config.inc")
5052

src/cbmc/CMakeLists.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,15 +58,15 @@ endif()
5858

5959
# bash completion
6060
if(NOT WIN32)
61-
add_custom_command(OUTPUT "${CMAKE_SOURCE_DIR}/scripts/bash-autocomplete/cbmc.sh"
62-
COMMAND "${CMAKE_SOURCE_DIR}/scripts/bash-autocomplete/extract_switches.sh"
61+
add_custom_command(OUTPUT "${CBMC_ROOT_DIR}/scripts/bash-autocomplete/cbmc.sh"
62+
COMMAND "${CBMC_ROOT_DIR}/scripts/bash-autocomplete/extract_switches.sh"
6363
DEPENDS $<TARGET_FILE:cbmc>
6464
)
6565
add_custom_target(cbmc.sh ALL
66-
DEPENDS "${CMAKE_SOURCE_DIR}/scripts/bash-autocomplete/cbmc.sh"
66+
DEPENDS "${CBMC_ROOT_DIR}/scripts/bash-autocomplete/cbmc.sh"
6767
)
6868
install(
69-
FILES ${CMAKE_SOURCE_DIR}/scripts/bash-autocomplete/cbmc.sh
69+
FILES ${CBMC_ROOT_DIR}/scripts/bash-autocomplete/cbmc.sh
7070
DESTINATION etc/bash_completion.d
7171
RENAME cbmc
7272
)

0 commit comments

Comments
 (0)