nextcloud-desktop/CMakeLists.txt

111 lines
3.3 KiB
Text
Raw Normal View History

cmake_minimum_required(VERSION 2.6)
2011-02-17 02:21:45 +03:00
project(mirall)
2011-04-06 13:28:38 +04:00
set(PACKAGE "mirall")
2013-11-14 23:41:23 +04:00
set( CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules )
include(Warnings)
2013-05-17 22:56:17 +04:00
set(OEM_THEME_DIR "" CACHE STRING "Define directory containing a custom theme")
if ( EXISTS ${OEM_THEME_DIR}/OEM.cmake )
include ( ${OEM_THEME_DIR}/OEM.cmake )
else ()
include ( ${CMAKE_SOURCE_DIR}/OWNCLOUD.cmake )
endif()
if (NOT DEFINED APPLICATION_SHORTNAME)
set ( APPLICATION_SHORTNAME ${APPLICATION_NAME} )
endif()
2011-04-06 13:28:38 +04:00
include(${CMAKE_SOURCE_DIR}/VERSION.cmake)
configure_file( ${CMAKE_SOURCE_DIR}/src/mirall/version.h.in "${CMAKE_CURRENT_BINARY_DIR}/src/mirall/version.h" )
2013-04-25 15:19:13 +04:00
include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR} "${CMAKE_CURRENT_BINARY_DIR}/src/mirall/")
2012-04-26 18:32:50 +04:00
2013-09-05 20:41:49 +04:00
#####
## handle DBUS for Fdo notifications
if( UNIX AND NOT APPLE )
add_definitions( -DUSE_FDO_NOTIFICATIONS)
set(WITH_DBUS ON)
endif()
####
include(GNUInstallDirs)
include(DefineInstallationPaths)
include(QtVersionAbstraction)
2013-08-28 22:14:40 +04:00
setup_qt()
2012-12-20 23:05:56 +04:00
include(GetGitRevisionDescription)
get_git_head_revision(GIT_REFSPEC GIT_SHA1)
# if we cannot get it from git, directly try .tag (packages)
# this will work if the tar balls have been properly created
# via git-archive.
if (${GIT_SHA1} STREQUAL "GITDIR-NOTFOUND")
file(READ ${CMAKE_SOURCE_DIR}/.tag sha1_candidate)
string(REPLACE "\n" "" sha1_candidate ${sha1_candidate})
if (NOT ${sha1_candidate} STREQUAL "$Format:%H$")
message("${sha1_candidate}")
set (GIT_SHA1 "${sha1_candidate}")
endif()
endif()
set(SYSCONFDIR ${SYSCONF_INSTALL_DIR})
set(DATADIR ${DATA_INSTALL_DIR})
#####
## handle BUILD_OWNCLOUD_OSX_BUNDLE
# BUILD_OWNCLOUD_OSX_BUNDLE was not initialized OR set to true on OSX
if(APPLE AND (NOT DEFINED BUILD_OWNCLOUD_OSX_BUNDLE OR BUILD_OWNCLOUD_OSX_BUNDLE))
set(BUILD_OWNCLOUD_OSX_BUNDLE ON)
set(OWNCLOUD_OSX_BUNDLE "${APPLICATION_EXECUTABLE}.app")
# BUILD_OWNCLOUD_OSX_BUNDLE was disabled on OSX
elseif(APPLE AND NOT BUILD_OWNCLOUD_OSX_BUNDLE)
message(FATAL_ERROR "Building in non-bundle mode on OSX is currently not supported. Comment this error out if you want to work on/test it.")
# any other platform
else()
set(BUILD_OWNCLOUD_OSX_BUNDLE OFF)
2012-04-16 12:51:20 +04:00
endif()
#####
2012-04-16 12:51:20 +04:00
#### find libs
#find_package(Qt4 4.7.0 COMPONENTS QtCore QtGui QtXml QtNetwork QtTest QtWebkit REQUIRED )
#if( UNIX AND NOT APPLE ) # Fdo notifications
# find_package(Qt4 4.7.0 COMPONENTS QtDBus REQUIRED )
#endif()
2013-09-10 21:50:44 +04:00
find_package(Neon REQUIRED)
2013-11-11 18:36:29 +04:00
find_package(QtKeychain REQUIRED)
find_package(Sphinx)
find_package(PdfLatex)
2012-11-28 10:54:57 +04:00
set(WITH_QTKEYCHAIN ${QTKEYCHAIN_FOUND})
configure_file(config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h)
include(OwnCloudCPack.cmake)
2011-04-06 13:28:38 +04:00
add_definitions(-DUNICODE)
add_definitions(-D_UNICODE)
# Handle Translations, pick all mirall_* files from trans directory.
file( GLOB TRANS_FILES ${CMAKE_SOURCE_DIR}/translations/mirall_*.ts)
set(TRANSLATIONS ${TRANS_FILES})
2012-03-26 11:48:30 +04:00
add_subdirectory(csync)
2011-02-17 02:21:45 +03:00
add_subdirectory(src)
add_subdirectory(doc)
if(UNIT_TESTING)
2012-10-26 22:24:12 +04:00
include(CTest)
enable_testing()
add_subdirectory(test)
endif(UNIT_TESTING)
2012-03-26 11:48:30 +04:00
2012-04-16 12:51:20 +04:00
if(BUILD_OWNCLOUD_OSX_BUNDLE)
configure_file(sync-exclude.lst ${OWNCLOUD_OSX_BUNDLE}/Contents/Resources/sync-exclude.lst COPYONLY)
2012-04-16 12:51:20 +04:00
else()
2013-08-22 11:51:35 +04:00
install( FILES sync-exclude.lst DESTINATION ${SYSCONFDIR}/${APPLICATION_SHORTNAME} )
2012-04-16 12:51:20 +04:00
endif()