nextcloud-desktop/src/CMakeLists.txt

173 lines
4.8 KiB
Text
Raw Normal View History

2011-02-17 02:21:45 +03:00
include(${QT_USE_FILE})
include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR})
QT4_ADD_RESOURCES ( MIRALL_RC_SRC ../mirall.qrc)
2011-04-05 13:10:44 +04:00
set(mirall_UI
mirall/folderwizardsourcepage.ui
mirall/folderwizardtargetpage.ui
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
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
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
mirall/gitfolder.cpp
mirall/networklocation.cpp
mirall/temporarydir.cpp
2011-04-08 13:36:53 +04:00
mirall/syncresult.cpp
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
mirall/owncloudsetupwizard.cpp
2011-10-05 19:49:03 +04:00
mirall/owncloudinfo.cpp
mirall/theme.cpp
mirall/miralltheme.cpp
mirall/owncloudtheme.cpp
mirall/folderman.cpp
mirall/mirallconfigfile.cpp
mirall/updatedetector.cpp
mirall/occinfo.cpp
mirall/sslerrordialog.cpp
)
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
mirall/csyncthread.h
mirall/updatedetector.h
mirall/sslerrordialog.h
2012-03-01 19:10:08 +04:00
)
if( UNIX AND NOT APPLE)
2012-04-15 16:47:43 +04:00
if(NOT USE_INOTIFY)
set(USE_INOTIFY ON)
endif()
endif()
2012-04-15 16:47:43 +04:00
IF( USE_INOTIFY )
add_definitions( -DUSE_INOTIFY )
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
${mirall_SRCS}
mirall/csyncfolder.cpp
mirall/owncloudfolder.cpp
mirall/csyncthread.cpp
)
2012-04-14 06:17:27 +04:00
include_directories(${CSYNC_INCLUDE_DIR}/csync ${CSYNC_INCLUDE_DIR})
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})
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-04-16 12:51:20 +04:00
install(FILES mirall.png DESTINATION share/icons/hicolor/48x48/apps)
# we may not add MACOSX_BUNDLE here, if not building one
add_executable(owncloud WIN32 main.cpp ${final_src})
# 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
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-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 "."
)
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})
endif()