Skip to content

Commit

Permalink
CMake: Rename add_slaves() to add_links()
Browse files Browse the repository at this point in the history
Sorry!
  • Loading branch information
julian-klode committed Jul 14, 2020
1 parent f21ca6d commit 9f78677
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
18 changes: 9 additions & 9 deletions CMake/Misc.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,17 @@ function(add_vendor_file)
endfunction()

# Add symbolic links to a file
function(add_slaves destination master)
set(slaves "")
foreach(slave ${ARGN})
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${slave}
COMMAND ${CMAKE_COMMAND} -E create_symlink ${master} ${CMAKE_CURRENT_BINARY_DIR}/${slave})
list(APPEND slaves ${CMAKE_CURRENT_BINARY_DIR}/${slave})
function(add_links directory target)
set(link_names "")
foreach(link_name ${ARGN})
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${link_name}
COMMAND ${CMAKE_COMMAND} -E create_symlink ${target} ${CMAKE_CURRENT_BINARY_DIR}/${link_name})
list(APPEND link_names ${CMAKE_CURRENT_BINARY_DIR}/${link_name})
endforeach()

STRING(REPLACE "/" "-" master "${master}")
add_custom_target(${master}-slaves ALL DEPENDS ${slaves})
install(FILES ${slaves} DESTINATION ${destination})
STRING(REPLACE "/" "-" target "${target}")
add_custom_target(${target}-link_names ALL DEPENDS ${link_names})
install(FILES ${link_names} DESTINATION ${directory})
endfunction()

# Generates a simple version script versioning everything with current SOVERSION
Expand Down
2 changes: 1 addition & 1 deletion cmdline/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ install(TARGETS apt-helper RUNTIME DESTINATION ${CMAKE_INSTALL_LIBEXECDIR}/apt/)
install(TARGETS apt-dump-solver apt-internal-solver RUNTIME DESTINATION ${CMAKE_INSTALL_LIBEXECDIR}/apt/solvers)
install(TARGETS apt-internal-planner RUNTIME DESTINATION ${CMAKE_INSTALL_LIBEXECDIR}/apt/planners)

add_slaves(${CMAKE_INSTALL_LIBEXECDIR}/apt/planners ../solvers/dump planners/dump)
add_links(${CMAKE_INSTALL_LIBEXECDIR}/apt/planners ../solvers/dump planners/dump)

# Install the not-to-be-compiled programs
INSTALL(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/apt-key DESTINATION ${CMAKE_INSTALL_BINDIR})
6 changes: 3 additions & 3 deletions methods/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ target_link_libraries(ftp ${GNUTLS_LIBRARIES})
install(TARGETS file copy store gpgv cdrom http ftp rred rsh mirror
RUNTIME DESTINATION ${CMAKE_INSTALL_LIBEXECDIR}/apt/methods)

add_slaves(${CMAKE_INSTALL_LIBEXECDIR}/apt/methods mirror mirror+ftp mirror+http mirror+https mirror+file mirror+copy)
add_slaves(${CMAKE_INSTALL_LIBEXECDIR}/apt/methods rsh ssh)
add_links(${CMAKE_INSTALL_LIBEXECDIR}/apt/methods mirror mirror+ftp mirror+http mirror+https mirror+file mirror+copy)
add_links(${CMAKE_INSTALL_LIBEXECDIR}/apt/methods rsh ssh)


add_slaves(${CMAKE_INSTALL_LIBEXECDIR}/apt/methods http https)
add_links(${CMAKE_INSTALL_LIBEXECDIR}/apt/methods http https)

0 comments on commit 9f78677

Please sign in to comment.