diff options
author | Johann Klähn <kljohann@gmail.com> | 2014-02-01 12:10:53 +0100 |
---|---|---|
committer | Johann Klähn <kljohann@gmail.com> | 2014-02-01 12:10:53 +0100 |
commit | 0dc2b97813009c0e5f9953209a5e2fd073989dfc (patch) | |
tree | b8c52c355fc1898c27d747abb36c1b9612a8647e /src/CMakeLists.txt | |
parent | 6eeda8bcea1000793103bc6f9633ca5804ee01b2 (diff) | |
download | fork-ledger-0dc2b97813009c0e5f9953209a5e2fd073989dfc.tar.gz fork-ledger-0dc2b97813009c0e5f9953209a5e2fd073989dfc.tar.bz2 fork-ledger-0dc2b97813009c0e5f9953209a5e2fd073989dfc.zip |
python module file suffix is platform dependent
Diffstat (limited to 'src/CMakeLists.txt')
-rw-r--r-- | src/CMakeLists.txt | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 65fd9c12..b34e1c52 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -257,7 +257,7 @@ if(BUILD_LIBRARY) set_target_properties(libledger PROPERTIES PREFIX "" #INSTALL_NAME_DIR "@executable_path/../lib" - INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib" + INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}" VERSION ${Ledger_VERSION_MAJOR} SOVERSION ${Ledger_VERSION_MAJOR}) @@ -287,8 +287,18 @@ print(s.get_python_lib(True, prefix=''))" CACHE PATH "python module directory (${_TMP_PYTHON_SITE_PACKAGES})") if (PYTHON_SITE_PACKAGES) - # FIXME: symlink would be sufficient - set(_ledger_python_module_name "ledger${CMAKE_SHARED_LIBRARY_SUFFIX}") + if(WIN32 AND NOT CYGWIN) + set(_ledger_python_module_name "ledger.pyd") + elseif(CMAKE_HOST_APPLE) + set(_ledger_python_module_name "ledger.so") + else() + set(_ledger_python_module_name "ledger${CMAKE_SHARED_LIBRARY_SUFFIX}") + endif() + + # FIXME: symlink would be sufficient: + # maybe using install(CODE "...") and + # execute_process(COMMAND "${CMAKE_COMMAND}" -E create_symlink ...). + # Windows will need a special case due to not supporting symlinks. add_custom_command( TARGET libledger POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different |