Convert grive to a pure shared library

In this way it's possible to develop independent clients, sharing
the same "functional" part.
pull/40/head
Massimo Gengarelli 2012-04-29 15:20:04 +02:00
parent 74d6b56630
commit 5bda75abb3
1 changed files with 33 additions and 1 deletions

View File

@ -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)