Reduce Qt footprint even more
This commit is contained in:
@@ -12,11 +12,6 @@ endmacro()
|
||||
|
||||
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
|
||||
#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")
|
||||
@@ -50,13 +45,12 @@ macro (acg_qt5)
|
||||
find_package (Qt5Widgets 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 (Qt5Network QUIET PATHS ${QT_DEFAULT_PATH} ${QT5_FINDER_FLAGS})
|
||||
|
||||
if (NOT WIN32 AND NOT APPLE)
|
||||
find_package (Qt5X11Extras QUIET PATHS ${QT_DEFAULT_PATH} ${QT5_FINDER_FLAGS})
|
||||
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)
|
||||
endif()
|
||||
|
||||
@@ -90,17 +84,6 @@ macro (acg_qt5)
|
||||
|
||||
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)
|
||||
include_directories(${Qt5X11Extras_INCLUDE_DIRS})
|
||||
add_definitions(${Qt5X11Extras_DEFINITIONS})
|
||||
@@ -110,39 +93,26 @@ macro (acg_qt5)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
|
||||
endif()
|
||||
|
||||
set (QT_LIBRARIES ${Qt5Core_LIBRARIES} ${Qt5Widgets_LIBRARIES}
|
||||
${Qt5Gui_LIBRARIES} ${Qt5OpenGL_LIBRARIES} ${Qt5Network_LIBRARIES} )
|
||||
#adding QT_NO_DEBUG to all release modes.
|
||||
# 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 (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")
|
||||
|
||||
if (Qt5X11Extras_FOUND)
|
||||
list (APPEND QT_LIBRARIES ${Qt5X11Extras_LIBRARIES})
|
||||
endif ()
|
||||
set(CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_RELEASE} /DQT_NO_DEBUG")
|
||||
set(CMAKE_CXX_FLAGS_MINSITEREL "${CMAKE_C_FLAGS_RELEASE} /DQT_NO_DEBUG")
|
||||
|
||||
if (MSVC)
|
||||
set (QT_LIBRARIES ${QT_LIBRARIES} ${Qt5Core_QTMAIN_LIBRARIES})
|
||||
endif()
|
||||
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)
|
||||
|
||||
#add_definitions(-DQT_NO_OPENGL)
|
||||
# Enable automoc
|
||||
set(CMAKE_AUTOMOC ON)
|
||||
|
||||
#adding QT_NO_DEBUG to all release modes.
|
||||
# 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 (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")
|
||||
|
||||
set(CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_RELEASE} /DQT_NO_DEBUG")
|
||||
set(CMAKE_CXX_FLAGS_MINSITEREL "${CMAKE_C_FLAGS_RELEASE} /DQT_NO_DEBUG")
|
||||
|
||||
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)
|
||||
endif (QT5_FOUND)
|
||||
endmacro ()
|
||||
|
||||
@@ -4,7 +4,6 @@ include_directories (
|
||||
../../../..
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
${GLUT_INCLUDE_DIR}
|
||||
${QT_INCLUDE_DIR}
|
||||
)
|
||||
|
||||
# source code directories
|
||||
@@ -28,8 +27,6 @@ acg_drop_templates (sources)
|
||||
|
||||
if (WIN32)
|
||||
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 ()
|
||||
acg_add_executable (DecimaterGui ${sources} ${headers} )
|
||||
endif ()
|
||||
@@ -37,7 +34,7 @@ endif ()
|
||||
target_link_libraries (DecimaterGui
|
||||
OpenMeshCore
|
||||
OpenMeshTools
|
||||
${QT_LIBRARIES}
|
||||
Qt5::OpenGL
|
||||
${OPENGL_LIBRARIES}
|
||||
${GLUT_LIBRARIES}
|
||||
)
|
||||
|
||||
@@ -4,7 +4,6 @@ include_directories (
|
||||
../../..
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
${GLUT_INCLUDE_DIR}
|
||||
${QT_INCLUDE_DIR}
|
||||
)
|
||||
|
||||
|
||||
@@ -23,8 +22,6 @@ acg_drop_templates (sources)
|
||||
|
||||
if (WIN32)
|
||||
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 ()
|
||||
acg_add_executable( ProgViewer ${sources} ${headers})
|
||||
endif ()
|
||||
@@ -32,7 +29,7 @@ endif ()
|
||||
target_link_libraries ( ProgViewer
|
||||
OpenMeshCore
|
||||
OpenMeshTools
|
||||
${QT_LIBRARIES}
|
||||
Qt5::OpenGL
|
||||
${OPENGL_LIBRARIES}
|
||||
${GLUT_LIBRARIES}
|
||||
)
|
||||
|
||||
@@ -4,7 +4,6 @@ include_directories (
|
||||
../../..
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
${GLUT_INCLUDE_DIR}
|
||||
${QT_INCLUDE_DIR}
|
||||
)
|
||||
|
||||
# source code directories
|
||||
@@ -21,8 +20,6 @@ acg_drop_templates (sources)
|
||||
|
||||
if (WIN32)
|
||||
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 ()
|
||||
acg_add_executable (QtViewer ${sources} ${headers})
|
||||
endif ()
|
||||
@@ -30,7 +27,7 @@ endif ()
|
||||
target_link_libraries (QtViewer
|
||||
OpenMeshCore
|
||||
OpenMeshTools
|
||||
${QT_LIBRARIES}
|
||||
Qt5::OpenGL
|
||||
${OPENGL_LIBRARIES}
|
||||
${GLUT_LIBRARIES}
|
||||
)
|
||||
|
||||
@@ -4,7 +4,6 @@ include_directories (
|
||||
../../../..
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
${GLUT_INCLUDE_DIR}
|
||||
${QT_INCLUDE_DIR}
|
||||
)
|
||||
|
||||
# source code directories
|
||||
@@ -28,8 +27,6 @@ acg_drop_templates (sources)
|
||||
|
||||
if (WIN32)
|
||||
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 ()
|
||||
acg_add_executable (SubdividerGui ${sources} ${headers})
|
||||
endif ()
|
||||
@@ -37,7 +34,7 @@ endif ()
|
||||
target_link_libraries (SubdividerGui
|
||||
OpenMeshCore
|
||||
OpenMeshTools
|
||||
${QT_LIBRARIES}
|
||||
Qt5::OpenGL
|
||||
${OPENGL_LIBRARIES}
|
||||
${GLUT_LIBRARIES}
|
||||
)
|
||||
|
||||
@@ -4,7 +4,6 @@ include_directories (
|
||||
../../../..
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
${GLUT_INCLUDE_DIR}
|
||||
${QT_INCLUDE_DIR}
|
||||
)
|
||||
|
||||
# collect all header and source files
|
||||
@@ -22,8 +21,6 @@ acg_drop_templates (sources)
|
||||
|
||||
if (WIN32)
|
||||
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 ()
|
||||
acg_add_executable (Synthesizer ${sources} ${headers})
|
||||
endif ()
|
||||
@@ -31,7 +28,7 @@ endif ()
|
||||
target_link_libraries (Synthesizer
|
||||
OpenMeshCore
|
||||
OpenMeshTools
|
||||
${QT_LIBRARIES}
|
||||
Qt5::OpenGL
|
||||
${OPENGL_LIBRARIES}
|
||||
${GLUT_LIBRARIES}
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user