mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-26 15:06:08 +03:00
aad928a6be
Installing to lib/${APPLICATION_EXECUTABLE} has caused a bunch of irritations in the past and subtle annoying to fix bugs. To avoid name clashes with branded clients ${APPLICATION_EXECUTABLE} becomes now part of the filename instead of the subfolder. The concrete motivation to change this now is that on Windows there is no RPATH and it's not possible to run owncloud directly from the Craft Root folder, which is nice when you're developing on Windows. It would have been possible to change this just for Windows but as written earlier this has caused lots of issues and thus I think it's a good idea to just stay consistent accross platforms when touching it.
63 lines
2.5 KiB
CMake
63 lines
2.5 KiB
CMake
PROJECT( CrashReporter )
|
|
cmake_policy(SET CMP0017 NEW)
|
|
|
|
list(APPEND crashreporter_SOURCES main.cpp)
|
|
list(APPEND crashreporter_RC resources.qrc)
|
|
|
|
# TODO: differentiate release channel
|
|
# if(BUILD_RELEASE)
|
|
# set(CRASHREPORTER_RELEASE_CHANNEL "release")
|
|
# else()
|
|
set(CRASHREPORTER_RELEASE_CHANNEL "nightly")
|
|
# endif()
|
|
|
|
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/CrashReporterConfig.h.in
|
|
${CMAKE_CURRENT_BINARY_DIR}/CrashReporterConfig.h)
|
|
|
|
|
|
|
|
if(NOT BUILD_LIBRARIES_ONLY)
|
|
add_executable( ${CRASHREPORTER_EXECUTABLE} WIN32
|
|
${crashreporter_SOURCES}
|
|
${crashreporter_HEADERS_MOC}
|
|
${crashreporter_UI_HEADERS}
|
|
${crashreporter_RC_RCC}
|
|
)
|
|
|
|
find_package(Qt5 REQUIRED COMPONENTS Widgets)
|
|
|
|
target_include_directories(${CRASHREPORTER_EXECUTABLE} PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
|
|
set_target_properties(${CRASHREPORTER_EXECUTABLE} PROPERTIES AUTOMOC ON)
|
|
set_target_properties(${CRASHREPORTER_EXECUTABLE} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${BIN_OUTPUT_DIRECTORY} )
|
|
target_link_libraries(${CRASHREPORTER_EXECUTABLE}
|
|
crashreporter-gui
|
|
Qt5::Core Qt5::Widgets
|
|
)
|
|
|
|
if(BUILD_OWNCLOUD_OSX_BUNDLE)
|
|
install(TARGETS ${CRASHREPORTER_EXECUTABLE} DESTINATION ${OWNCLOUD_OSX_BUNDLE}/Contents/MacOS)
|
|
elseif(NOT BUILD_LIBRARIES_ONLY)
|
|
install(TARGETS ${CRASHREPORTER_EXECUTABLE}
|
|
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
|
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
|
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
|
endif()
|
|
|
|
# FIXME: The following lines are dup in src/gui and src/cmd because it needs to be done after both are installed
|
|
#FIXME: find a nice solution to make the second if(BUILD_OWNCLOUD_OSX_BUNDLE) unnecessary
|
|
# 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)
|
|
get_target_property (QT_QMAKE_EXECUTABLE Qt5::qmake IMPORTED_LOCATION)
|
|
get_filename_component(QT_BIN_DIR "${QT_QMAKE_EXECUTABLE}" DIRECTORY)
|
|
find_program(MACDEPLOYQT_EXECUTABLE macdeployqt HINTS "${QT_BIN_DIR}")
|
|
|
|
add_custom_command(TARGET ${CRASHREPORTER_EXECUTABLE} POST_BUILD
|
|
COMMAND "${MACDEPLOYQT_EXECUTABLE}"
|
|
"$<TARGET_FILE_DIR:${CRASHREPORTER_EXECUTABLE}>/../.."
|
|
-qmldir=${CMAKE_SOURCE_DIR}/src/gui
|
|
-always-overwrite
|
|
COMMENT "Running macdeployqt..."
|
|
)
|
|
endif()
|
|
endif()
|