Skip to content

Commit 46e6625

Browse files
Install goto-cc symlinks correctly
The previous way created symlinks at install time which led to a somewhat complicated installation logic. Instead, we should just install the symlinks we already produce at build time.
1 parent 2bd790d commit 46e6625

File tree

1 file changed

+10
-14
lines changed

1 file changed

+10
-14
lines changed

src/goto-cc/CMakeLists.txt

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,10 @@ add_if_library(goto-cc-lib jsil)
2626
add_executable(goto-cc goto_cc_main.cpp)
2727
target_link_libraries(goto-cc goto-cc-lib)
2828

29+
install(TARGETS goto-cc DESTINATION ${CMAKE_INSTALL_BINDIR})
30+
2931
if(WIN32)
3032
set_target_properties(goto-cc PROPERTIES OUTPUT_NAME goto-cl)
31-
install(TARGETS goto-cc DESTINATION ${CMAKE_INSTALL_BINDIR})
3233
else()
3334
add_custom_command(TARGET goto-cc
3435
POST_BUILD
@@ -40,19 +41,14 @@ else()
4041
COMMAND "${CMAKE_COMMAND}" -E create_symlink
4142
goto-cc $<TARGET_FILE_DIR:goto-cc>/goto-ld
4243
BYPRODUCTS ${CMAKE_BINARY_DIR}/bin/goto-ld)
43-
install(TARGETS goto-cc DESTINATION ${CMAKE_INSTALL_BINDIR})
44-
install(CODE "execute_process( \
45-
COMMAND ${CMAKE_COMMAND} -E create_symlink \
46-
goto-cc \
47-
\$ENV{DESTDIR}${CMAKE_INSTALL_FULL_BINDIR}/goto-gcc \
48-
)"
49-
)
50-
install(CODE "execute_process( \
51-
COMMAND ${CMAKE_COMMAND} -E create_symlink \
52-
goto-cc \
53-
\$ENV{DESTDIR}${CMAKE_INSTALL_FULL_BINDIR}/goto-ld \
54-
)"
55-
)
44+
45+
install(
46+
FILES
47+
${CMAKE_BINARY_DIR}/bin/goto-ld
48+
${CMAKE_BINARY_DIR}/bin/goto-gcc
49+
DESTINATION
50+
${CMAKE_INSTALL_BINDIR})
51+
5652
# Symlink man page to cbmc man page until a real man page is written
5753
install(CODE "execute_process( \
5854
COMMAND ${CMAKE_COMMAND} -E create_symlink \

0 commit comments

Comments
 (0)