Skip to content

Commit

Permalink
Turn the launcher UI into a shared library
Browse files Browse the repository at this point in the history
This enables the re-use of some of its widgets in the QtCreator
integration.

Based on pull request #314
  • Loading branch information
vkrause committed Apr 4, 2017
1 parent ac96a4c commit 353fb37
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 11 deletions.
2 changes: 1 addition & 1 deletion app/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ if(APPLE)
${QT_QTGUI_LIBRARIES}
gammaray_common
gammaray_launcher
gammaray_launcher_ui_internal
gammaray_launcher_ui
gammaray_client
)

Expand Down
2 changes: 1 addition & 1 deletion launcher/app/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ add_executable(gammaray-launcher WIN32 ${gammaray_launcher_ui_srcs})
target_link_libraries(gammaray-launcher
${QT_QTGUI_LIBRARIES}
gammaray_common
gammaray_launcher_ui_internal
gammaray_launcher_ui
)

gammaray_embed_info_plist(gammaray-launcher ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist.in)
Expand Down
31 changes: 23 additions & 8 deletions launcher/ui/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
set(gammaray_launcher_ui_internal_srcs
set(gammaray_launcher_ui_srcs
${CMAKE_SOURCE_DIR}/ui/searchlinecontroller.cpp
promolabel.cpp
launcherwindow.cpp
Expand All @@ -11,23 +11,25 @@ set(gammaray_launcher_ui_internal_srcs
probeabimodel.cpp
)
if(NOT WIN32)
list(APPEND gammaray_launcher_ui_internal_srcs processlist_unix.cpp)
list(APPEND gammaray_launcher_ui_srcs processlist_unix.cpp)
else()
list(APPEND gammaray_launcher_ui_internal_srcs processlist_win.cpp)
list(APPEND gammaray_launcher_ui_srcs processlist_win.cpp)
endif()

qt4_wrap_ui(gammaray_launcher_ui_internal_srcs
qt4_wrap_ui(gammaray_launcher_ui_srcs
attachdialog.ui
launcherwindow.ui
launchpage.ui
selftestpage.ui
connectpage.ui
)

add_library(gammaray_launcher_ui_internal STATIC ${gammaray_launcher_ui_internal_srcs})
target_compile_definitions(gammaray_launcher_ui_internal PRIVATE GAMMARAY_UI_STATIC_DEFINE)
target_include_directories(gammaray_launcher PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>)
target_link_libraries(gammaray_launcher_ui_internal
add_library(gammaray_launcher_ui SHARED ${gammaray_launcher_ui_srcs})
generate_export_header(gammaray_launcher_ui)
set_target_properties(gammaray_launcher PROPERTIES ${GAMMARAY_DEFAULT_LIBRARY_PROPERTIES})

target_include_directories(gammaray_launcher PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>)
target_link_libraries(gammaray_launcher_ui
LINK_PUBLIC
gammaray_launcher

Expand All @@ -38,3 +40,16 @@ target_link_libraries(gammaray_launcher_ui_internal
${QT_QTNETWORK_LIBRARIES}
gammaray_ui
)

install(TARGETS gammaray_launcher_ui EXPORT GammaRayTargets ${INSTALL_TARGETS_DEFAULT_ARGS})

ecm_generate_pri_file(BASE_NAME GammaRayLauncherUi
LIB_NAME gammaray_launcher_ui
DEPS "core gui GammaRayLauncher"
FILENAME_VAR PRI_FILENAME
INCLUDE_INSTALL_DIR ${INCLUDE_INSTALL_DIR}
)
install(FILES ${PRI_FILENAME} DESTINATION ${ECM_MKSPECS_INSTALL_DIR})
if(MSVC)
install(FILES "$<TARGET_PDB_FILE_DIR:gammaray_launcher_ui>/$<TARGET_PDB_FILE_NAME:gammaray_launcher_ui>" DESTINATION ${BIN_INSTALL_DIR} CONFIGURATIONS Debug RelWithDebInfo)
endif()
4 changes: 3 additions & 1 deletion launcher/ui/launcherwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
#ifndef GAMMARAY_LAUNCHERWINDOW_H
#define GAMMARAY_LAUNCHERWINDOW_H

#include "gammaray_launcher_ui_export.h"

#include <QDialog>

namespace GammaRay {
Expand All @@ -37,7 +39,7 @@ namespace Ui {
class LauncherWindow;
}

class LauncherWindow : public QDialog
class GAMMARAY_LAUNCHER_UI_EXPORT LauncherWindow : public QDialog
{
Q_OBJECT
public:
Expand Down

0 comments on commit 353fb37

Please sign in to comment.