summaryrefslogtreecommitdiff
path: root/src/CMakeLists.txt
diff options
context:
space:
mode:
authorJohann Klähn <kljohann@gmail.com>2014-02-01 10:23:51 +0100
committerJohann Klähn <kljohann@gmail.com>2014-02-01 10:23:51 +0100
commit36b4fc3e2fdfaa332373230d73b7fdd4f5afa5e8 (patch)
treeebbc6c7972744bac074f1753c71de0189d7fd213 /src/CMakeLists.txt
parent89c21e9967cec214597044aa582741470404977c (diff)
downloadfork-ledger-36b4fc3e2fdfaa332373230d73b7fdd4f5afa5e8.tar.gz
fork-ledger-36b4fc3e2fdfaa332373230d73b7fdd4f5afa5e8.tar.bz2
fork-ledger-36b4fc3e2fdfaa332373230d73b7fdd4f5afa5e8.zip
no RENAME option on older CMake versions
The RENAME option for install(TARGETS ...) does not seem to be available on all CMake versions.
Diffstat (limited to 'src/CMakeLists.txt')
-rw-r--r--src/CMakeLists.txt11
1 files 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
+ $<TARGET_FILE:libledger> "${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()