From 5bda75abb39d47780274dd45c00773ad1c1267e7 Mon Sep 17 00:00:00 2001 From: Massimo Gengarelli Date: Sun, 29 Apr 2012 15:20:04 +0200 Subject: [PATCH 1/2] Convert grive to a pure shared library In this way it's possible to develop independent clients, sharing the same "functional" part. --- CMakeLists.txt | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e2f363a..1245548 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,7 +8,19 @@ include_directories( ${grive_SOURCE_DIR}/src ) -add_executable( grive +file(GLOB DRIVE_HEADERS + ${grive_SOURCE_DIR}/src/drive/*.hh +) + +file (GLOB PROTOCOL_HEADERS + ${grive_SOURCE_DIR}/src/protocol/*.hh +) + +file (GLOB UTIL_HEADERS + ${grive_SOURCE_DIR}/src/util/*.hh +) + +add_library( grive SHARED src/main.cc src/drive/Collection.cc src/drive/Drive.cc @@ -21,12 +33,24 @@ add_executable( grive src/util/OS.cc ) +add_executable( grive_cli + src/main.cc +) + target_link_libraries( grive curl json ${OPENSSL_LIBRARIES} ) +target_link_libraries( grive_cli + grive +) + +set_target_properties(grive PROPERTIES + SOVERSION 0 VERSION 0.0.1 +) + add_executable( unittest test/UnitTest.cc src/util/DateTime.cc @@ -37,3 +61,11 @@ add_executable( unittest target_link_libraries( unittest cppunit ) + + +## Install targets +install(TARGETS grive LIBRARY DESTINATION lib) +install(TARGETS grive_cli RUNTIME DESTINATION bin) +install(FILES ${DRIVE_HEADERS} DESTINATION include/grive/drive) +install(FILES ${PROTOCOL_HEADERS} DESTINATION include/grive/protocol) +install(FILES ${UTIL_HEADERS} DESTINATION include/grive/util) From 72d40c9d0c37ffcef7ec079b124378344cbdfa07 Mon Sep 17 00:00:00 2001 From: Massimo Gengarelli Date: Tue, 1 May 2012 12:24:12 +0200 Subject: [PATCH 2/2] Don't compile the main.cc in the library Whops, I've forgot to remove this, probably because of the merge. --- CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8330aa4..01168e2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -31,7 +31,6 @@ file (GLOB UTIL_HEADERS ) add_library( fgrive SHARED - src/main.cc src/drive/Collection.cc src/drive/Drive.cc src/protocol/Download.cc