desktop/CMakeLists.txt

96 lines
2.7 KiB
CMake
Raw Normal View History

cmake_minimum_required(VERSION 2.6)
2011-02-16 23:21:45 +00:00
project(mirall)
2011-04-06 09:28:38 +00:00
set(PACKAGE "mirall")
set( CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules )
if ( EXISTS ${CMAKE_SOURCE_DIR}/OEM.cmake )
include ( ${CMAKE_SOURCE_DIR}/OEM.cmake )
else ()
include ( ${CMAKE_SOURCE_DIR}/OWNCLOUD.cmake )
endif()
2011-04-06 09:28:38 +00: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" )
include_directories(BEFORE "${CMAKE_CURRENT_BINARY_DIR}/src/mirall/")
2012-04-26 14:32:50 +00:00
include(GNUInstallDirs)
2012-04-26 14:32:50 +00:00
## stupid, we should upstream this
2012-10-05 21:01:43 +00:00
if("${CMAKE_INSTALL_PREFIX}" STREQUAL "/usr" AND NOT CMAKE_INSTALL_SYSCONFDIR)
2012-04-26 14:32:50 +00:00
set(CMAKE_INSTALL_SYSCONFDIR "/etc")
endif()
#####
## 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 08:51:20 +00:00
endif()
#####
2012-04-16 08:51:20 +00:00
find_package(Qt4 4.6.0 COMPONENTS QtCore QtGui QtXml QtNetwork QtTest REQUIRED )
find_package(Csync)
find_package(INotify)
set(WITH_CSYNC CSYNC_FOUND)
set(USE_INOTIFY ${INOTIFY_FOUND})
configure_file(config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h)
2011-04-06 09:28:38 +00:00
set(CPACK_SOURCE_IGNORE_FILES
# hidden files
"/\\\\..+$"
# temporary files
"\\\\.swp$"
# backup files
"~$"
# others
"\\\\.#"
"/#"
"/build/"
"/_build/"
# used before
"\\\\.o$"
"\\\\.lo$"
"\\\\.la$"
"Makefile\\\\.in$"
)
include(OwnCloudCPack.cmake)
2011-04-06 09:28:38 +00:00
#
# This cmake builds two targets (aka apps), mirall and owncloud. For the owncloud
# target, OWNCLOUD_CLIENT needs to be a compile flag. It is set in src/CMakeLists.txt
# but if that fails because cmake is too old, uncomment this here if you want to build
# owncloud.
# add_definitions(-DOWNCLOUD_CLIENT)
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 07:48:30 +00:00
2011-02-16 23:21:45 +00:00
add_subdirectory(src)
if(UNIT_TESTING)
2012-10-26 18:24:12 +00:00
include(CTest)
enable_testing()
add_subdirectory(test)
endif(UNIT_TESTING)
2012-03-26 07:48:30 +00:00
2012-04-16 08:51:20 +00:00
if(BUILD_OWNCLOUD_OSX_BUNDLE)
configure_file(sync-exclude.lst ${OWNCLOUD_OSX_BUNDLE}/Contents/Resources/sync-exclude.lst COPYONLY)
2012-04-16 08:51:20 +00:00
else()
install( FILES sync-exclude.lst DESTINATION ${CMAKE_INSTALL_SYSCONFDIR} )
2012-04-16 08:51:20 +00:00
endif()
2012-03-26 07:48:30 +00:00