grive2/CMakeLists.txt

88 lines
1.7 KiB
CMake
Raw Normal View History

2012-04-25 20:13:17 +04:00
project(grive)
cmake_minimum_required(VERSION 2.8)
2012-04-29 20:48:11 +04:00
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
2012-04-29 20:48:11 +04:00
find_package(OpenSSL REQUIRED)
find_package(JSONC REQUIRED)
find_package(CURL REQUIRED)
2012-04-29 21:16:13 +04:00
find_package(CppUnit)
2012-04-29 21:16:13 +04:00
IF ( CPPUNIT_FOUND )
2012-04-30 20:32:29 +04:00
set( OPT_INCS ${CPPUNIT_INCLUDE_DIR} )
2012-04-29 21:16:13 +04:00
ENDIF ( CPPUNIT_FOUND )
include_directories(
${grive_SOURCE_DIR}/src
2012-04-30 20:32:29 +04:00
${OPT_INCS}
)
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
)
2012-05-01 14:16:26 +04:00
add_library( fgrive SHARED
src/drive/Collection.cc
src/drive/Drive.cc
src/drive/File.cc
src/protocol/Download.cc
src/protocol/HTTP.cc
src/protocol/Json.cc
src/protocol/OAuth2.cc
src/util/Crypt.cc
src/util/DateTime.cc
src/util/OS.cc
2012-05-01 13:44:17 +04:00
src/util/Path.cc
)
2012-04-25 20:13:17 +04:00
2012-05-01 14:16:26 +04:00
add_executable( grive
src/main.cc
)
2012-05-01 14:16:26 +04:00
target_link_libraries( fgrive
2012-04-30 20:32:29 +04:00
${CURL_LIBRARIES}
${JSONC_LIBRARY}
${OPENSSL_LIBRARIES}
)
2012-05-01 14:16:26 +04:00
target_link_libraries( grive
fgrive
)
2012-05-01 14:16:26 +04:00
set_target_properties(fgrive PROPERTIES
SOVERSION 0 VERSION 0.0.1
)
IF ( CPPUNIT_FOUND )
2012-04-30 20:32:29 +04:00
add_executable( unittest
2012-05-01 13:44:17 +04:00
test/UnitTest.cc
2012-04-30 20:32:29 +04:00
test/util/DateTimeTest.cc
test/util/FunctionTest.cc
2012-05-01 13:44:17 +04:00
test/util/PathTest.cc
2012-04-30 20:32:29 +04:00
)
2012-04-29 22:38:56 +04:00
target_link_libraries( unittest
fgrive
2012-04-30 20:32:29 +04:00
${CPPUNIT_LIBRARY}
2012-04-29 22:38:56 +04:00
)
else ( CPPUNIT_FOUND )
message( STATUS "skip building unittest" )
endif ( CPPUNIT_FOUND )
2012-04-29 21:18:21 +04:00
## Install targets
2012-05-01 14:16:26 +04:00
install(TARGETS fgrive LIBRARY DESTINATION lib)
install(TARGETS grive 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)