From 36b4fc3e2fdfaa332373230d73b7fdd4f5afa5e8 Mon Sep 17 00:00:00 2001 From: Johann Klähn Date: Sat, 1 Feb 2014 10:23:51 +0100 Subject: no RENAME option on older CMake versions The RENAME option for install(TARGETS ...) does not seem to be available on all CMake versions. --- src/CMakeLists.txt | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 06d12bac..f229375c 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -278,8 +278,15 @@ print(s.get_python_lib(True, prefix=''))" if (PYTHON_SITE_PACKAGES) # FIXME: symlink would be sufficient - install(TARGETS libledger - DESTINATION ${PYTHON_SITE_PACKAGES} RENAME "ledger${CMAKE_SHARED_LIBRARY_SUFFIX}") + set(_ledger_python_module_name "ledger${CMAKE_SHARED_LIBRARY_SUFFIX}") + add_custom_command( + TARGET libledger POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_if_different + $ "${CMAKE_BINARY_DIR}/${_ledger_python_module_name}") + install( + FILES "${CMAKE_BINARY_DIR}/${_ledger_python_module_name}" + DESTINATION ${PYTHON_SITE_PACKAGES}) + else() message(WARNING "PYTHON_SITE_PACKAGES not set. Will not install python module.") endif() -- cgit v1.2.3