From 82486f6d43d1a3f85ddbf2e65bcc919b56a63e20 Mon Sep 17 00:00:00 2001 From: Alexis Hildebrandt Date: Mon, 27 Jan 2014 21:06:44 +0100 Subject: Build and shared python module when building library --- src/CMakeLists.txt | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/CMakeLists.txt') diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 9fd7d295..c6a9e28e 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -244,11 +244,20 @@ endif() add_pch_rule(${PROJECT_BINARY_DIR}/system.hh LEDGER_SOURCES main.cc global.cc) if(BUILD_LIBRARY) + add_library(pyledger SHARED ${LEDGER_SOURCES}) + add_ledger_library_dependencies(pyledger) + if(CMAKE_HOST_APPLE) + set_target_properties(pyledger PROPERTIES OUTPUT_NAME ledger) + set_target_properties(pyledger PROPERTIES SUFFIX .so) + set(CMAKE_SHARED_LIBRARY_PREFIX ) + endif() + add_library(libledger ${LEDGER_SOURCES} ${PROJECT_SOURCE_DIR}/lib/sha1.cpp) set_target_properties(libledger PROPERTIES OUTPUT_NAME ledger) add_executable(ledger main.cc global.cc) + install(TARGETS pyledger DESTINATION lib) install(TARGETS libledger DESTINATION lib) install(FILES ${LEDGER_INCLUDES} DESTINATION include/ledger) else() -- cgit v1.2.3