2011-02-17 02:21:45 +03:00
|
|
|
include(${QT_USE_FILE})
|
|
|
|
|
2012-03-08 14:37:36 +04:00
|
|
|
include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR})
|
|
|
|
|
2011-10-19 13:53:12 +04:00
|
|
|
QT4_ADD_RESOURCES ( MIRALL_RC_SRC ../mirall.qrc)
|
|
|
|
|
2011-04-05 13:10:44 +04:00
|
|
|
set(mirall_UI
|
2011-04-05 20:31:14 +04:00
|
|
|
mirall/folderwizardsourcepage.ui
|
|
|
|
mirall/folderwizardtargetpage.ui
|
2011-09-26 15:12:00 +04:00
|
|
|
mirall/folderwizardnetworkpage.ui
|
|
|
|
mirall/folderwizardowncloudpage.ui
|
2011-09-26 23:46:26 +04:00
|
|
|
mirall/statusdialog.ui
|
2011-09-27 21:10:01 +04:00
|
|
|
mirall/owncloudwizardselecttypepage.ui
|
|
|
|
mirall/createanowncloudpage.ui
|
|
|
|
mirall/owncloudftpaccesspage.ui
|
|
|
|
mirall/owncloudwizardresultpage.ui
|
2011-09-30 14:51:56 +04:00
|
|
|
mirall/owncloudcredentialspage.ui
|
2012-04-06 10:53:57 +04:00
|
|
|
mirall/sslerrorsdialog.ui
|
2011-04-05 13:10:44 +04:00
|
|
|
)
|
2011-09-27 21:10:01 +04:00
|
|
|
|
2011-04-05 13:10:44 +04:00
|
|
|
qt4_wrap_ui(mirall_UI_SRCS ${mirall_UI})
|
|
|
|
|
2011-02-17 02:21:45 +03:00
|
|
|
set(mirall_SRCS
|
|
|
|
mirall/application.cpp
|
2011-03-18 03:14:45 +03:00
|
|
|
mirall/fileutils.cpp
|
2011-02-17 02:21:45 +03:00
|
|
|
mirall/folder.cpp
|
|
|
|
mirall/folderwatcher.cpp
|
2011-04-05 13:10:44 +04:00
|
|
|
mirall/folderwizard.cpp
|
2011-03-18 03:14:45 +03:00
|
|
|
mirall/gitfolder.cpp
|
2011-04-06 17:22:40 +04:00
|
|
|
mirall/networklocation.cpp
|
2011-03-18 03:14:45 +03:00
|
|
|
mirall/temporarydir.cpp
|
2011-04-08 13:36:53 +04:00
|
|
|
mirall/syncresult.cpp
|
2011-03-21 02:58:53 +03:00
|
|
|
mirall/unisonfolder.cpp
|
2011-09-26 17:00:12 +04:00
|
|
|
mirall/statusdialog.cpp
|
2011-09-27 21:10:01 +04:00
|
|
|
mirall/owncloudwizard.cpp
|
2012-02-17 14:11:18 +04:00
|
|
|
mirall/owncloudsetupwizard.cpp
|
2011-10-05 19:49:03 +04:00
|
|
|
mirall/owncloudinfo.cpp
|
2012-02-16 13:42:44 +04:00
|
|
|
mirall/theme.cpp
|
|
|
|
mirall/miralltheme.cpp
|
|
|
|
mirall/owncloudtheme.cpp
|
2012-02-17 12:48:31 +04:00
|
|
|
mirall/folderman.cpp
|
2012-02-17 14:11:18 +04:00
|
|
|
mirall/mirallconfigfile.cpp
|
2012-04-02 22:10:29 +04:00
|
|
|
mirall/updatedetector.cpp
|
|
|
|
mirall/occinfo.cpp
|
2012-04-06 10:53:57 +04:00
|
|
|
mirall/sslerrordialog.cpp
|
|
|
|
|
2011-03-18 03:14:45 +03:00
|
|
|
)
|
2011-10-26 15:59:06 +04:00
|
|
|
|
2012-03-01 19:10:08 +04:00
|
|
|
set(mirall_HEADERS
|
2012-04-14 06:17:27 +04:00
|
|
|
mirall/application.h
|
|
|
|
mirall/folder.h
|
2012-03-01 19:10:08 +04:00
|
|
|
mirall/folderman.h
|
|
|
|
mirall/folderwatcher.h
|
|
|
|
mirall/folderwizard.h
|
|
|
|
mirall/gitfolder.h
|
|
|
|
mirall/owncloudfolder.h
|
|
|
|
mirall/owncloudinfo.h
|
|
|
|
mirall/owncloudsetupwizard.h
|
|
|
|
mirall/owncloudwizard.h
|
|
|
|
mirall/statusdialog.h
|
|
|
|
mirall/unisonfolder.h
|
2012-03-14 14:57:08 +04:00
|
|
|
mirall/theme.h
|
2012-03-21 21:03:49 +04:00
|
|
|
mirall/csyncthread.h
|
2012-04-02 22:10:29 +04:00
|
|
|
mirall/updatedetector.h
|
2012-04-06 10:53:57 +04:00
|
|
|
mirall/sslerrordialog.h
|
2012-03-01 19:10:08 +04:00
|
|
|
)
|
|
|
|
|
2012-04-14 16:31:33 +04:00
|
|
|
if( UNIX AND NOT APPLE)
|
2012-04-17 15:08:27 +04:00
|
|
|
if(NOT DEFINED USE_INOTIFY)
|
2012-04-15 16:47:43 +04:00
|
|
|
set(USE_INOTIFY ON)
|
2012-04-14 16:31:33 +04:00
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
2012-04-15 16:47:43 +04:00
|
|
|
IF( USE_INOTIFY )
|
|
|
|
add_definitions( -DUSE_INOTIFY )
|
2012-03-01 19:56:08 +04:00
|
|
|
set(mirall_SRCS ${mirall_SRCS} mirall/inotify.cpp)
|
|
|
|
set(mirall_HEADERS ${mirall_HEADERS} mirall/inotify.h)
|
2012-04-15 20:30:31 +04:00
|
|
|
ENDIF()
|
2012-03-01 19:10:08 +04:00
|
|
|
|
|
|
|
# Disabled the csync found check. Csync required for now.
|
|
|
|
set(mirall_SRCS
|
2011-04-07 21:04:07 +04:00
|
|
|
${mirall_SRCS}
|
|
|
|
mirall/csyncfolder.cpp
|
2012-02-15 12:30:37 +04:00
|
|
|
mirall/owncloudfolder.cpp
|
|
|
|
mirall/csyncthread.cpp
|
2011-04-07 21:04:07 +04:00
|
|
|
)
|
2012-04-14 06:17:27 +04:00
|
|
|
include_directories(${CSYNC_INCLUDE_DIR}/csync ${CSYNC_INCLUDE_DIR})
|
2011-11-07 20:09:02 +04:00
|
|
|
|
2012-03-15 21:09:00 +04:00
|
|
|
set(mirall_HEADERS
|
|
|
|
${mirall_HEADERS}
|
|
|
|
mirall/csyncfolder.h
|
|
|
|
mirall/owncloudfolder.h)
|
2011-02-17 02:21:45 +03:00
|
|
|
|
2012-03-01 19:10:08 +04:00
|
|
|
qt4_wrap_cpp(mirallMoc ${mirall_HEADERS})
|
2011-04-05 13:10:44 +04:00
|
|
|
|
2012-03-26 11:48:30 +04:00
|
|
|
qt4_add_translation(mirall_I18N ${TRANSLATIONS})
|
|
|
|
|
|
|
|
add_library(mirall_static STATIC ${mirall_SRCS} ${mirall_UI_SRCS} ${mirallMoc} ${mirall_HEADERS} ${MIRALL_RC_SRC} ${mirall_I18N})
|
2011-04-08 14:03:09 +04:00
|
|
|
target_link_libraries(mirall_static ${QT_LIBRARIES})
|
2011-03-18 03:14:45 +03:00
|
|
|
|
2012-04-16 12:51:20 +04:00
|
|
|
set( final_src
|
|
|
|
${mirall_HEADERS}
|
|
|
|
${MIRALL_RC_SRC}
|
|
|
|
${mirall_SRCS}
|
|
|
|
${mirall_UI_SRCS}
|
|
|
|
${mirallMoc}
|
|
|
|
${mirall_HEADERS}
|
|
|
|
${mirall_I18N}
|
|
|
|
)
|
2012-03-01 19:10:08 +04:00
|
|
|
|
2012-04-02 15:44:00 +04:00
|
|
|
# add executable icon on windows and osx
|
|
|
|
include( AddAppIconMacro )
|
2012-04-16 12:51:20 +04:00
|
|
|
set(ownCloud_old ${ownCloud})
|
|
|
|
kde4_add_app_icon( ownCloud "${CMAKE_CURRENT_SOURCE_DIR}/../resources/mirall-*.png" )
|
|
|
|
list(APPEND final_src ${ownCloud})
|
|
|
|
set(ownCloud ${ownCloud_old})
|
2012-04-02 15:44:00 +04:00
|
|
|
|
2012-04-16 12:51:20 +04:00
|
|
|
if(NOT BUILD_OWNCLOUD_OSX_BUNDLE)
|
|
|
|
set(BIN_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
|
2012-03-01 19:56:08 +04:00
|
|
|
|
2012-04-16 12:51:20 +04:00
|
|
|
install(FILES mirall.png DESTINATION share/icons/hicolor/48x48/apps)
|
2012-04-18 15:59:03 +04:00
|
|
|
install(FILES ${mirall_I18N} DESTINATION share/mirall/i18n)
|
2012-04-16 12:51:20 +04:00
|
|
|
|
|
|
|
# we may not add MACOSX_BUNDLE here, if not building one
|
|
|
|
add_executable(owncloud WIN32 main.cpp ${final_src})
|
2012-05-02 17:45:38 +04:00
|
|
|
set_target_properties( owncloud PROPERTIES COMPILE_DEFINITIONS OWNCLOUD_CLIENT)
|
2012-04-23 12:58:15 +04:00
|
|
|
# add_executable(owncloud main.cpp ${final_src})
|
2012-04-16 12:51:20 +04:00
|
|
|
|
|
|
|
# mirall is not built for the bundle
|
|
|
|
add_executable( mirall WIN32 main.cpp )
|
|
|
|
target_link_libraries(mirall mirall_static)
|
|
|
|
target_link_libraries(mirall ${CSYNC_LIBRARY})
|
|
|
|
set_target_properties( mirall PROPERTIES
|
2012-03-01 19:56:08 +04:00
|
|
|
RUNTIME_OUTPUT_DIRECTORY ${BIN_OUTPUT_DIRECTORY} )
|
2012-04-16 12:51:20 +04:00
|
|
|
install(TARGETS mirall
|
|
|
|
RUNTIME DESTINATION bin
|
|
|
|
LIBRARY DESTINATION lib
|
|
|
|
ARCHIVE DESTINATION lib
|
|
|
|
BUNDLE DESTINATION library
|
|
|
|
)
|
|
|
|
else()
|
|
|
|
set(BIN_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}")
|
|
|
|
include(DeployQt4)
|
|
|
|
|
|
|
|
set(CMAKE_INSTALL_PREFIX ".") # Examples use /Applications. hurmpf.
|
|
|
|
set(MACOSX_BUNDLE_ICON_FILE "ownCloud.icns")
|
|
|
|
|
|
|
|
# we must add MACOSX_BUNDLE only if building a bundle
|
|
|
|
add_executable(owncloud WIN32 MACOSX_BUNDLE main.cpp ${final_src})
|
|
|
|
|
|
|
|
#FIXME: hardcoded path
|
|
|
|
install(FILES /usr/local/lib/csync-0/csync_owncloud.so DESTINATION ${OWNCLOUD_OSX_BUNDLE}/Contents/Plugins)
|
|
|
|
list(APPEND dirs "/usr/local/lib")
|
|
|
|
endif()
|
2012-03-01 19:56:08 +04:00
|
|
|
|
|
|
|
|
2012-04-16 12:51:20 +04:00
|
|
|
set_target_properties( owncloud PROPERTIES
|
|
|
|
RUNTIME_OUTPUT_DIRECTORY ${BIN_OUTPUT_DIRECTORY}
|
|
|
|
)
|
2012-03-01 19:10:08 +04:00
|
|
|
target_link_libraries(owncloud ${QT_LIBRARIES} )
|
|
|
|
|
|
|
|
target_link_libraries(owncloud ${CSYNC_LIBRARY})
|
2011-02-17 02:21:45 +03:00
|
|
|
|
2012-04-14 06:17:27 +04:00
|
|
|
install(TARGETS owncloud
|
2012-04-16 12:51:20 +04:00
|
|
|
RUNTIME DESTINATION bin
|
|
|
|
LIBRARY DESTINATION lib
|
|
|
|
ARCHIVE DESTINATION lib
|
|
|
|
BUNDLE DESTINATION "."
|
2011-11-07 20:09:02 +04:00
|
|
|
)
|
|
|
|
|
2012-04-16 12:51:20 +04:00
|
|
|
#FIXME: find a nice solution to make the second if(BUILD_OWNCLOUD_OSX_BUNDLE) unneccessary
|
|
|
|
# currently it needs to be done because the code right above needs to be executed no matter
|
|
|
|
# if building a bundle or not and the install_qt4_executable needs to be called afterwards
|
|
|
|
if(BUILD_OWNCLOUD_OSX_BUNDLE)
|
|
|
|
install_qt4_executable(${OWNCLOUD_OSX_BUNDLE} "" "${OWNCLOUD_OSX_BUNDLE}/Contents/Plugins/csync_owncloud.so" ${dirs})
|
2012-04-17 15:08:27 +04:00
|
|
|
endif()
|