summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt76
1 files changed, 14 insertions, 62 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7dfe756..d8f662f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -9,19 +9,22 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.8.0)
IF (CMAKE_BUILD_TYPE STREQUAL "")
SET(CMAKE_BUILD_TYPE Debug)
ENDIF()
-SET(CMAKE_C_FLAGS_DEBUG "-O0 -g -Wall -Wunused -Wunreachable-code -pedantic -fno-strict-aliasing -std=gnu99")
-SET(CMAKE_C_FLAGS_RELEASE "-O2 -fno-strict-aliasing -std=gnu99")
-SET(CMAKE_CXX_FLAGS_DEBUG "-O0 -g -Wall -Wunused -Wunreachable-code -pedantic -fno-strict-aliasing -std=gnu++0x")
-SET(CMAKE_CXX_FLAGS_RELEASE "-O2 -fno-strict-aliasing -std=gnu++0x" )
+SET(CMAKE_C_FLAGS_DEBUG "-O0 -g -Wall -Wunused -Wunreachable-code -pedantic -fno-strict-aliasing -std=c++11")
+SET(CMAKE_C_FLAGS_RELEASE "-O2 -fno-strict-aliasing -std=c++11")
+SET(CMAKE_CXX_FLAGS_DEBUG "-O0 -g -Wall -Wunused -Wunreachable-code -pedantic -fno-strict-aliasing -std=c++11")
+SET(CMAKE_CXX_FLAGS_RELEASE "-O2 -fno-strict-aliasing -std=c++11" )
# local cmake modules
SET(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
# this command finds libraries and sets all required variables
-FIND_PACKAGE(Qt4 REQUIRED)
+FIND_PACKAGE(Qt5 COMPONENTS Widgets REQUIRED)
FIND_PACKAGE(Cups REQUIRED)
FIND_PACKAGE(X11 REQUIRED)
+SET(CMAKE_AUTOMOC ON)
+#SET(CMAKE_AUTORCC ON)
+
# some includes
INCLUDE_DIRECTORIES(
${CMAKE_SOURCE_DIR}
@@ -57,56 +60,9 @@ FILE(GLOB PWGUI_UIS
src/pwgui/*.ui
)
-# .qrc files
-#SET(MAINGUI_RCS pvsmgr.qrc)
-#SET(PWGUI_RCS pvsclient.qrc)
-
-# includes all header files that should be treated with moc
-SET(MAINGUI_MOC_HDRS
- src/maingui/printergui.h
- src/backdrop.h
-)
-
-SET(PWGUI_MOC_HDRS
- src/pwgui/pwgui.h
- src/backdrop.h
-)
-
-# i18n
-#FILE(GLOB MAINGUI_TSS
-# i18n/server/*.ts
-#)
-
-#FILE(GLOB PWGUI_TSS
-# i18n/client/*.ts
-#)
-
-
-# include Qt modules
-#SET(QT_USE_QTDBUS TRUE)
-#SET(QT_USE_QTNETWORK TRUE)
-#SET(QT_USE_QTWEBKIT TRUE)
-
-# add some useful macros and variables
-# (QT_USE_FILE is a variable defined by FIND_PACKAGE( Qt4 ) that contains
-# a path to CMake script)
-INCLUDE(${QT_USE_FILE})
-
-# this will run rcc on .qrc files
-#QT4_ADD_RESOURCES(MAINGUI_RC_SRCS ${MAINGUI_RCS})
-#QT4_ADD_RESOURCES(PWGUI_RC_SRCS ${PWGUI_RCS})
-
# this will run uic on .ui files
-QT4_WRAP_UI(MAINGUI_UI_HDRS ${MAINGUI_UIS})
-QT4_WRAP_UI(PWGUI_UI_HDRS ${PWGUI_UIS})
-
-# this will run moc
-QT4_WRAP_CPP(MAINGUI_MOC_SRCS ${MAINGUI_MOC_HDRS})
-QT4_WRAP_CPP(PWGUI_MOC_SRCS ${PWGUI_MOC_HDRS})
-
-# i18n, run lupdate and lrelease)
-#QT4_CREATE_TRANSLATION(MAINGUI_QMS ${MAINGUI_SRCS} ${MAINGUI_UI_HDRS} ${MAINGUI_TSS})
-#QT4_CREATE_TRANSLATION(PWGUI_QMS ${PWGUI_SRCS} ${PWGUI_UI_HDRS} ${PWGUI_TSS})
+QT5_WRAP_UI(MAINGUI_UI_HDRS ${MAINGUI_UIS})
+QT5_WRAP_UI(PWGUI_UI_HDRS ${PWGUI_UIS})
################################################################################
# Build
@@ -114,29 +70,25 @@ QT4_WRAP_CPP(PWGUI_MOC_SRCS ${PWGUI_MOC_HDRS})
ADD_EXECUTABLE(printergui
${MAINGUI_SRCS}
- ${MAINGUI_MOC_SRCS}
${MAINGUI_UI_HDRS}
- ${MAINGUI_RC_SRCS}
- ${MAINGUI_QMS}
+# ${MAINGUI_RC_SRCS}
)
ADD_EXECUTABLE(printpwgui
${PWGUI_SRCS}
- ${PWGUI_MOC_SRCS}
${PWGUI_UI_HDRS}
- ${PWGUI_RC_SRCS}
- ${PWGUI_QMS}
+# ${PWGUI_RC_SRCS}
)
# link
TARGET_LINK_LIBRARIES(printergui
- ${QT_LIBRARIES}
+ Qt5::Widgets
${CUPS_LIBRARIES}
${X11_LIBRARIES}
)
TARGET_LINK_LIBRARIES(printpwgui
- ${QT_LIBRARIES}
+ Qt5::Widgets
${X11_LIBRARIES}
)