Skip to content

Commit

Permalink
Fix python tick-tock symlink
Browse files Browse the repository at this point in the history
Signed-off-by: methylDragon <[email protected]>
  • Loading branch information
methylDragon committed Jul 14, 2022
1 parent 27a939c commit d567398
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,20 @@ function(configure_build_install_location _library_name)
# Install Python library symlinks
if(${GZ_PYTHON_INSTALL_PATH} MATCHES "gz$")
cmake_policy(SET CMP0087 NEW) # Allow evaluation of generator expressions in install(CODE )
file(MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/ignition")

string(REGEX REPLACE "gz$" "ignition" IGN_PYTHON_INSTALL_PATH ${GZ_PYTHON_INSTALL_PATH})
if (WIN32) # Windows requires copy instead of symlink
install(CODE "execute_process(COMMAND ${CMAKE_COMMAND} -E copy \
${CMAKE_INSTALL_PREFIX}\/${GZ_PYTHON_INSTALL_PATH}\/$<TARGET_FILE_NAME:${_library_name}> \
${PROJECT_BINARY_DIR}\/$<TARGET_FILE_NAME:${_library_name}>)")
../gz/${GZ_PYTHON_INSTALL_PATH}\/$<TARGET_FILE_NAME:${_library_name}> \
${PROJECT_BINARY_DIR}\/ignition/$<TARGET_FILE_NAME:${_library_name}>)")
else()
install(CODE "execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink \
${CMAKE_INSTALL_PREFIX}\/${GZ_PYTHON_INSTALL_PATH}\/$<TARGET_FILE_NAME:${_library_name}> \
${PROJECT_BINARY_DIR}\/$<TARGET_FILE_NAME:${_library_name}>)")
../gz/$<TARGET_FILE_NAME:${_library_name}> \
${PROJECT_BINARY_DIR}\/ignition/$<TARGET_FILE_NAME:${_library_name}>)")
endif()

install(FILES ${PROJECT_BINARY_DIR}\/$<TARGET_FILE_NAME:${_library_name}>
install(FILES ${PROJECT_BINARY_DIR}\/ignition/$<TARGET_FILE_NAME:${_library_name}>
DESTINATION "${IGN_PYTHON_INSTALL_PATH}/"
)
endif()
Expand Down

0 comments on commit d567398

Please sign in to comment.