diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index c349419..b4e3c0e 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -11,12 +11,13 @@ endif() include(UsePkgConfig) pkgconfig(gtk+-2.0 GTK2_INCLUDE_DIR GTK2_LINK_DIR GTK2_LINK_FLAGS GTK2_CFLAGS) -option(ENABLE_GTK ON) +if (UNIX AND NOT APPLE) + set(LINUX TRUE) +endif() -if (ENABLE_GTK) +if (LINUX) include_directories(${GTK2_INCLUDE_DIR}) add_definitions(${GTK2_CFLAGS}) - add_definitions(-DENABLE_GTK) add_library(updatergtk SHARED UpdateDialogGtk.cpp UpdateDialogGtk.h) target_link_libraries(updatergtk ${GTK2_LINK_FLAGS}) endif() @@ -64,7 +65,7 @@ if (UNIX) set(SOURCES ${SOURCES} UpdateDialogAscii.cpp) endif() -if (ENABLE_GTK) +if (LINUX) # embed the GTK helper library into the updater binary. # At runtime it will be extracted and loaded if the # GTK libraries are available diff --git a/src/main.cpp b/src/main.cpp index db775f3..3774926 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -9,9 +9,7 @@ #include "tinythread.h" #if defined(PLATFORM_LINUX) - #if defined(ENABLE_GTK) - #include "UpdateDialogGtkWrapper.h" - #endif + #include "UpdateDialogGtkWrapper.h" #include "UpdateDialogAscii.h" #endif @@ -99,7 +97,6 @@ int main(int argc, char** argv) #ifdef PLATFORM_LINUX void runWithUi(int argc, char** argv, UpdateInstaller* installer) { -#ifdef ENABLE_GTK UpdateDialogAscii asciiDialog; UpdateDialogGtkWrapper dialog; bool useGtk = dialog.init(argc,argv); @@ -118,10 +115,6 @@ void runWithUi(int argc, char** argv, UpdateInstaller* installer) dialog.exec(); } updaterThread.join(); -#else - // no UI available - do a silent install - installer->run(); -#endif } #endif