no RENAME option on older CMake versions
The RENAME option for install(TARGETS ...) does not seem to be available on all CMake versions.
This commit is contained in:
parent
89c21e9967
commit
36b4fc3e2f
1 changed files with 9 additions and 2 deletions
|
|
@ -278,8 +278,15 @@ print(s.get_python_lib(True, prefix=''))"
|
||||||
|
|
||||||
if (PYTHON_SITE_PACKAGES)
|
if (PYTHON_SITE_PACKAGES)
|
||||||
# FIXME: symlink would be sufficient
|
# FIXME: symlink would be sufficient
|
||||||
install(TARGETS libledger
|
set(_ledger_python_module_name "ledger${CMAKE_SHARED_LIBRARY_SUFFIX}")
|
||||||
DESTINATION ${PYTHON_SITE_PACKAGES} RENAME "ledger${CMAKE_SHARED_LIBRARY_SUFFIX}")
|
add_custom_command(
|
||||||
|
TARGET libledger POST_BUILD
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
||||||
|
$<TARGET_FILE:libledger> "${CMAKE_BINARY_DIR}/${_ledger_python_module_name}")
|
||||||
|
install(
|
||||||
|
FILES "${CMAKE_BINARY_DIR}/${_ledger_python_module_name}"
|
||||||
|
DESTINATION ${PYTHON_SITE_PACKAGES})
|
||||||
|
|
||||||
else()
|
else()
|
||||||
message(WARNING "PYTHON_SITE_PACKAGES not set. Will not install python module.")
|
message(WARNING "PYTHON_SITE_PACKAGES not set. Will not install python module.")
|
||||||
endif()
|
endif()
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue