Commit 0beeb7f9 authored by Jan Möbius's avatar Jan Möbius

Reduce Qt footprint even more

parent 49ad640c
Pipeline #8105 passed with stage
in 114 minutes and 23 seconds
...@@ -12,11 +12,6 @@ endmacro() ...@@ -12,11 +12,6 @@ endmacro()
macro (acg_qt5) macro (acg_qt5)
if(POLICY CMP0020)
# Automatically link Qt executables to qtmain target on Windows
cmake_policy(SET CMP0020 NEW)
endif(POLICY CMP0020)
#try to find qt5 automatically #try to find qt5 automatically
#for custom installation of qt5, dont use any of these variables #for custom installation of qt5, dont use any of these variables
set (QT5_INSTALL_PATH "" CACHE PATH "Path to Qt5 directory which contains lib and include folder") set (QT5_INSTALL_PATH "" CACHE PATH "Path to Qt5 directory which contains lib and include folder")
...@@ -50,13 +45,12 @@ macro (acg_qt5) ...@@ -50,13 +45,12 @@ macro (acg_qt5)
find_package (Qt5Widgets QUIET PATHS ${QT_DEFAULT_PATH} ${QT5_FINDER_FLAGS}) find_package (Qt5Widgets QUIET PATHS ${QT_DEFAULT_PATH} ${QT5_FINDER_FLAGS})
find_package (Qt5Gui QUIET PATHS ${QT_DEFAULT_PATH} ${QT5_FINDER_FLAGS}) find_package (Qt5Gui QUIET PATHS ${QT_DEFAULT_PATH} ${QT5_FINDER_FLAGS})
find_package (Qt5OpenGL QUIET PATHS ${QT_DEFAULT_PATH} ${QT5_FINDER_FLAGS}) find_package (Qt5OpenGL QUIET PATHS ${QT_DEFAULT_PATH} ${QT5_FINDER_FLAGS})
find_package (Qt5Network QUIET PATHS ${QT_DEFAULT_PATH} ${QT5_FINDER_FLAGS})
if (NOT WIN32 AND NOT APPLE) if (NOT WIN32 AND NOT APPLE)
find_package (Qt5X11Extras QUIET PATHS ${QT_DEFAULT_PATH} ${QT5_FINDER_FLAGS}) find_package (Qt5X11Extras QUIET PATHS ${QT_DEFAULT_PATH} ${QT5_FINDER_FLAGS})
endif () endif ()
if (Qt5Core_FOUND AND Qt5Widgets_FOUND AND Qt5Gui_FOUND AND Qt5OpenGL_FOUND AND Qt5Network_FOUND ) if (Qt5Core_FOUND AND Qt5Widgets_FOUND AND Qt5Gui_FOUND AND Qt5OpenGL_FOUND )
set (QT5_FOUND TRUE) set (QT5_FOUND TRUE)
endif() endif()
...@@ -90,17 +84,6 @@ macro (acg_qt5) ...@@ -90,17 +84,6 @@ macro (acg_qt5)
set (CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) set (CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
include_directories(${Qt5Core_INCLUDE_DIRS})
include_directories(${Qt5Widgets_INCLUDE_DIRS})
include_directories(${Qt5Gui_INCLUDE_DIRS})
include_directories(${Qt5OpenGL_INCLUDE_DIRS})
include_directories(${Qt5Network_INCLUDE_DIRS})
add_definitions(${Qt5Core_DEFINITIONS})
add_definitions(${Qt5Widgets_DEFINITIONS})
add_definitions(${Qt5Gui_DEFINITIONS})
add_definitions(${Qt5OpenGL_DEFINITIONS})
add_definitions(${Qt5Network_DEFINITIONS})
if (Qt5X11Extras_FOUND) if (Qt5X11Extras_FOUND)
include_directories(${Qt5X11Extras_INCLUDE_DIRS}) include_directories(${Qt5X11Extras_INCLUDE_DIRS})
add_definitions(${Qt5X11Extras_DEFINITIONS}) add_definitions(${Qt5X11Extras_DEFINITIONS})
...@@ -110,39 +93,26 @@ macro (acg_qt5) ...@@ -110,39 +93,26 @@ macro (acg_qt5)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
endif() endif()
set (QT_LIBRARIES ${Qt5Core_LIBRARIES} ${Qt5Widgets_LIBRARIES} #adding QT_NO_DEBUG to all release modes.
${Qt5Gui_LIBRARIES} ${Qt5OpenGL_LIBRARIES} ${Qt5Network_LIBRARIES} ) # Note: for multi generators like msvc you cannot set this definition depending of
# the current build type, because it may change in the future inside the ide and not via cmake
if (Qt5X11Extras_FOUND) if (MSVC_IDE)
list (APPEND QT_LIBRARIES ${Qt5X11Extras_LIBRARIES}) set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /DQT_NO_DEBUG")
endif () set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /DQT_NO_DEBUG")
if (MSVC) set(CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_RELEASE} /DQT_NO_DEBUG")
set (QT_LIBRARIES ${QT_LIBRARIES} ${Qt5Core_QTMAIN_LIBRARIES}) set(CMAKE_CXX_FLAGS_MINSITEREL "${CMAKE_C_FLAGS_RELEASE} /DQT_NO_DEBUG")
endif()
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELEASE} /DQT_NO_DEBUG")
#add_definitions(-DQT_NO_OPENGL) set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELEASE} /DQT_NO_DEBUG")
else(MSVC_IDE)
#adding QT_NO_DEBUG to all release modes. if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
# Note: for multi generators like msvc you cannot set this definition depending of add_definitions(-DQT_NO_DEBUG)
# the current build type, because it may change in the future inside the ide and not via cmake endif()
if (MSVC_IDE) endif(MSVC_IDE)
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /DQT_NO_DEBUG")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /DQT_NO_DEBUG") # Enable automoc
set(CMAKE_AUTOMOC ON)
set(CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_RELEASE} /DQT_NO_DEBUG")
set(CMAKE_CXX_FLAGS_MINSITEREL "${CMAKE_C_FLAGS_RELEASE} /DQT_NO_DEBUG") endif (QT5_FOUND)
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELEASE} /DQT_NO_DEBUG")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELEASE} /DQT_NO_DEBUG")
else(MSVC_IDE)
if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
add_definitions(-DQT_NO_DEBUG)
endif()
endif(MSVC_IDE)
# Enable automoc
set(CMAKE_AUTOMOC ON)
endif (QT5_FOUND)
endmacro () endmacro ()
...@@ -4,7 +4,6 @@ include_directories ( ...@@ -4,7 +4,6 @@ include_directories (
../../../.. ../../../..
${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}
${GLUT_INCLUDE_DIR} ${GLUT_INCLUDE_DIR}
${QT_INCLUDE_DIR}
) )
# source code directories # source code directories
...@@ -28,8 +27,6 @@ acg_drop_templates (sources) ...@@ -28,8 +27,6 @@ acg_drop_templates (sources)
if (WIN32) if (WIN32)
acg_add_executable (DecimaterGui WIN32 ${sources} ${headers}) acg_add_executable (DecimaterGui WIN32 ${sources} ${headers})
# link to qtmain library to get WinMain function for a non terminal app
target_link_libraries (DecimaterGui ${QT_QTMAIN_LIBRARY})
else () else ()
acg_add_executable (DecimaterGui ${sources} ${headers} ) acg_add_executable (DecimaterGui ${sources} ${headers} )
endif () endif ()
...@@ -37,7 +34,7 @@ endif () ...@@ -37,7 +34,7 @@ endif ()
target_link_libraries (DecimaterGui target_link_libraries (DecimaterGui
OpenMeshCore OpenMeshCore
OpenMeshTools OpenMeshTools
${QT_LIBRARIES} Qt5::OpenGL
${OPENGL_LIBRARIES} ${OPENGL_LIBRARIES}
${GLUT_LIBRARIES} ${GLUT_LIBRARIES}
) )
......
...@@ -4,7 +4,6 @@ include_directories ( ...@@ -4,7 +4,6 @@ include_directories (
../../.. ../../..
${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}
${GLUT_INCLUDE_DIR} ${GLUT_INCLUDE_DIR}
${QT_INCLUDE_DIR}
) )
...@@ -23,8 +22,6 @@ acg_drop_templates (sources) ...@@ -23,8 +22,6 @@ acg_drop_templates (sources)
if (WIN32) if (WIN32)
acg_add_executable( ProgViewer WIN32 ${sources} ${headers}) acg_add_executable( ProgViewer WIN32 ${sources} ${headers})
# link to qtmain library to get WinMain function for a non terminal app
target_link_libraries( ProgViewer ${QT_QTMAIN_LIBRARY})
else () else ()
acg_add_executable( ProgViewer ${sources} ${headers}) acg_add_executable( ProgViewer ${sources} ${headers})
endif () endif ()
...@@ -32,7 +29,7 @@ endif () ...@@ -32,7 +29,7 @@ endif ()
target_link_libraries ( ProgViewer target_link_libraries ( ProgViewer
OpenMeshCore OpenMeshCore
OpenMeshTools OpenMeshTools
${QT_LIBRARIES} Qt5::OpenGL
${OPENGL_LIBRARIES} ${OPENGL_LIBRARIES}
${GLUT_LIBRARIES} ${GLUT_LIBRARIES}
) )
......
...@@ -4,7 +4,6 @@ include_directories ( ...@@ -4,7 +4,6 @@ include_directories (
../../.. ../../..
${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}
${GLUT_INCLUDE_DIR} ${GLUT_INCLUDE_DIR}
${QT_INCLUDE_DIR}
) )
# source code directories # source code directories
...@@ -21,8 +20,6 @@ acg_drop_templates (sources) ...@@ -21,8 +20,6 @@ acg_drop_templates (sources)
if (WIN32) if (WIN32)
acg_add_executable (QtViewer WIN32 ${sources} ${headers}) acg_add_executable (QtViewer WIN32 ${sources} ${headers})
# link to qtmain library to get WinMain function for a non terminal app
target_link_libraries (QtViewer ${QT_QTMAIN_LIBRARY})
else () else ()
acg_add_executable (QtViewer ${sources} ${headers}) acg_add_executable (QtViewer ${sources} ${headers})
endif () endif ()
...@@ -30,7 +27,7 @@ endif () ...@@ -30,7 +27,7 @@ endif ()
target_link_libraries (QtViewer target_link_libraries (QtViewer
OpenMeshCore OpenMeshCore
OpenMeshTools OpenMeshTools
${QT_LIBRARIES} Qt5::OpenGL
${OPENGL_LIBRARIES} ${OPENGL_LIBRARIES}
${GLUT_LIBRARIES} ${GLUT_LIBRARIES}
) )
......
...@@ -4,7 +4,6 @@ include_directories ( ...@@ -4,7 +4,6 @@ include_directories (
../../../.. ../../../..
${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}
${GLUT_INCLUDE_DIR} ${GLUT_INCLUDE_DIR}
${QT_INCLUDE_DIR}
) )
# source code directories # source code directories
...@@ -28,8 +27,6 @@ acg_drop_templates (sources) ...@@ -28,8 +27,6 @@ acg_drop_templates (sources)
if (WIN32) if (WIN32)
acg_add_executable (SubdividerGui WIN32 ${sources} ${headers}) acg_add_executable (SubdividerGui WIN32 ${sources} ${headers})
# link to qtmain library to get WinMain function for a non terminal app
target_link_libraries (SubdividerGui ${QT_QTMAIN_LIBRARY})
else () else ()
acg_add_executable (SubdividerGui ${sources} ${headers}) acg_add_executable (SubdividerGui ${sources} ${headers})
endif () endif ()
...@@ -37,7 +34,7 @@ endif () ...@@ -37,7 +34,7 @@ endif ()
target_link_libraries (SubdividerGui target_link_libraries (SubdividerGui
OpenMeshCore OpenMeshCore
OpenMeshTools OpenMeshTools
${QT_LIBRARIES} Qt5::OpenGL
${OPENGL_LIBRARIES} ${OPENGL_LIBRARIES}
${GLUT_LIBRARIES} ${GLUT_LIBRARIES}
) )
......
...@@ -4,7 +4,6 @@ include_directories ( ...@@ -4,7 +4,6 @@ include_directories (
../../../.. ../../../..
${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}
${GLUT_INCLUDE_DIR} ${GLUT_INCLUDE_DIR}
${QT_INCLUDE_DIR}
) )
# collect all header and source files # collect all header and source files
...@@ -22,8 +21,6 @@ acg_drop_templates (sources) ...@@ -22,8 +21,6 @@ acg_drop_templates (sources)
if (WIN32) if (WIN32)
acg_add_executable (Synthesizer WIN32 ${sources} ${headers}) acg_add_executable (Synthesizer WIN32 ${sources} ${headers})
# link to qtmain library to get WinMain function for a non terminal app
target_link_libraries (Synthesizer ${QT_QTMAIN_LIBRARY})
else () else ()
acg_add_executable (Synthesizer ${sources} ${headers}) acg_add_executable (Synthesizer ${sources} ${headers})
endif () endif ()
...@@ -31,7 +28,7 @@ endif () ...@@ -31,7 +28,7 @@ endif ()
target_link_libraries (Synthesizer target_link_libraries (Synthesizer
OpenMeshCore OpenMeshCore
OpenMeshTools OpenMeshTools
${QT_LIBRARIES} Qt5::OpenGL
${OPENGL_LIBRARIES} ${OPENGL_LIBRARIES}
${GLUT_LIBRARIES} ${GLUT_LIBRARIES}
) )
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment