diff --git a/cmake/ACGQt.cmake b/cmake/ACGQt.cmake index c5c6a5a94de1b806288a33f40304d35a8825829f..0648ccc31eed34fd09e61dcd8bbb66f35ab2ce27 100644 --- a/cmake/ACGQt.cmake +++ b/cmake/ACGQt.cmake @@ -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} ) - - if (Qt5X11Extras_FOUND) - list (APPEND QT_LIBRARIES ${Qt5X11Extras_LIBRARIES}) - endif () - - if (MSVC) - set (QT_LIBRARIES ${QT_LIBRARIES} ${Qt5Core_QTMAIN_LIBRARIES}) - endif() - - #add_definitions(-DQT_NO_OPENGL) - - #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) + #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) endmacro () diff --git a/src/OpenMesh/Apps/Decimating/DecimaterGui/CMakeLists.txt b/src/OpenMesh/Apps/Decimating/DecimaterGui/CMakeLists.txt index 5357f844698d589c4197469780709e4302fdb74f..fa9f6f14f3f68534a654b6bb93fce200c67ea6f1 100644 --- a/src/OpenMesh/Apps/Decimating/DecimaterGui/CMakeLists.txt +++ b/src/OpenMesh/Apps/Decimating/DecimaterGui/CMakeLists.txt @@ -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} ) diff --git a/src/OpenMesh/Apps/ProgViewer/CMakeLists.txt b/src/OpenMesh/Apps/ProgViewer/CMakeLists.txt index e25a2c6b48bc0f805c644a72d5323f0a0e78e647..e0cc7053162c7d5fac2e8adde537daca06250b7c 100644 --- a/src/OpenMesh/Apps/ProgViewer/CMakeLists.txt +++ b/src/OpenMesh/Apps/ProgViewer/CMakeLists.txt @@ -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} ) diff --git a/src/OpenMesh/Apps/QtViewer/CMakeLists.txt b/src/OpenMesh/Apps/QtViewer/CMakeLists.txt index 2cfb0fc549b7e7f82ebd20398cae4025c1daf4cd..0409d3082122297975cd42e6a6a55254a0ae8d0c 100644 --- a/src/OpenMesh/Apps/QtViewer/CMakeLists.txt +++ b/src/OpenMesh/Apps/QtViewer/CMakeLists.txt @@ -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} ) diff --git a/src/OpenMesh/Apps/Subdivider/SubdividerGui/CMakeLists.txt b/src/OpenMesh/Apps/Subdivider/SubdividerGui/CMakeLists.txt index 112eb22659d4bf4c5b502d098689b28384acee15..62d61541410379fa9c1868015e9083769d5da3b8 100644 --- a/src/OpenMesh/Apps/Subdivider/SubdividerGui/CMakeLists.txt +++ b/src/OpenMesh/Apps/Subdivider/SubdividerGui/CMakeLists.txt @@ -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} ) diff --git a/src/OpenMesh/Apps/VDProgMesh/Synthesizer/CMakeLists.txt b/src/OpenMesh/Apps/VDProgMesh/Synthesizer/CMakeLists.txt index 2beaac5352b9d2238847b2a6f73299fb074668e7..22b1ceec662b0f38b64d23c9201a3a425bbcf4d5 100644 --- a/src/OpenMesh/Apps/VDProgMesh/Synthesizer/CMakeLists.txt +++ b/src/OpenMesh/Apps/VDProgMesh/Synthesizer/CMakeLists.txt @@ -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} )