From 38cd3513fdb96b8ff85cca45b017f60974b101cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20M=C3=B6bius?= Date: Wed, 9 Mar 2011 09:52:57 +0000 Subject: [PATCH] Get rid of glew dependencies Remove a lot of unused qt libraries which were linked before Don't link libXi and Xmu as we don't need it git-svn-id: http://www.openmesh.org/svnrepo/OpenMesh/trunk@378 fdac6126-5c0c-442c-9429-916003d36597 --- CMakeLists.txt | 30 +++++++++----- cmake/FindGLUT.cmake | 5 +-- src/OpenMesh/Apps/CMakeLists.txt | 41 +++++++++++++------ .../Decimating/DecimaterGui/CMakeLists.txt | 3 +- src/OpenMesh/Apps/ProgViewer/CMakeLists.txt | 2 - src/OpenMesh/Apps/QtViewer/CMakeLists.txt | 2 - .../Subdivider/SubdividerGui/CMakeLists.txt | 2 - .../VDProgMesh/Synthesizer/CMakeLists.txt | 2 - src/OpenMesh/Core/CMakeLists.txt | 11 +++++ src/OpenMesh/Tools/CMakeLists.txt | 12 ++++++ 10 files changed, 74 insertions(+), 36 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 59c16c8a..c38f4a40 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -19,13 +19,31 @@ if (WIN32) ) endif () +# ======================================================================== +# Add bundle targets here +# ======================================================================== +if (WIN32) + add_custom_target (fixbundle ALL + COMMAND ${CMAKE_COMMAND} -P "${CMAKE_BINARY_DIR}/fixbundle.win.cmake" ) +endif() + +if (APPLE) + add_custom_target (fixbundle ALL + COMMAND ${CMAKE_COMMAND} -P "${CMAKE_BINARY_DIR}/fixbundle.cmake" + ) +endif() + +# ======================================================================== +# Call the subdirectories with there projects +# ======================================================================== + add_subdirectory (src/OpenMesh/Core) add_subdirectory (src/OpenMesh/Tools) add_subdirectory (src/OpenMesh/Apps) add_subdirectory (Doc) # ======================================================================== -# Bundle generation +# Bundle generation (Targets exist, now configure them) # ======================================================================== if (WIN32 ) @@ -33,9 +51,6 @@ if (WIN32 ) configure_file ("${CMAKE_SOURCE_DIR}/cmake/fixbundle.cmake.win.in" "${CMAKE_BINARY_DIR}/fixbundle.win.cmake" @ONLY IMMEDIATE) - add_custom_target (fixbundle ALL - COMMAND ${CMAKE_COMMAND} -P "${CMAKE_BINARY_DIR}/fixbundle.win.cmake" ) - # let bundle generation depend on all targets add_dependencies (fixbundle QtViewer DecimaterGui) @@ -46,9 +61,7 @@ if (APPLE) # prepare bundle generation cmake file and add a build target for it configure_file ("${CMAKE_SOURCE_DIR}/cmake/fixbundle.cmake.in" "${CMAKE_BINARY_DIR}/fixbundle.cmake" @ONLY IMMEDIATE) - add_custom_target (fixbundle ALL - COMMAND ${CMAKE_COMMAND} -P "${CMAKE_BINARY_DIR}/fixbundle.cmake" - ) + # let bundle generation depend on all targets add_dependencies (fixbundle DecimaterGui ProgViewer QtViewer SubdividerGui) @@ -60,9 +73,6 @@ if (APPLE) ) endif () - # install bundle - #install (DIRECTORY ${CMAKE_BINARY_DIR}/Build/OpenMesh.app DESTINATION . - # USE_SOURCE_PERMISSIONS) endif () # ======================================================================== diff --git a/cmake/FindGLUT.cmake b/cmake/FindGLUT.cmake index 0f1716fe..d69ce4a4 100644 --- a/cmake/FindGLUT.cmake +++ b/cmake/FindGLUT.cmake @@ -69,12 +69,9 @@ ENDIF (WIN32) SET( GLUT_FOUND "NO" ) IF(GLUT_INCLUDE_DIR) IF(GLUT_glut_LIBRARY) - # Is -lXi and -lXmu required on all platforms that have it? - # If not, we need some way to figure out what platform we are on. + SET( GLUT_LIBRARIES ${GLUT_glut_LIBRARY} - ${GLUT_Xmu_LIBRARY} - ${GLUT_Xi_LIBRARY} ${GLUT_cocoa_LIBRARY} ) SET( GLUT_FOUND "YES" ) diff --git a/src/OpenMesh/Apps/CMakeLists.txt b/src/OpenMesh/Apps/CMakeLists.txt index b88bb6a8..d230db09 100644 --- a/src/OpenMesh/Apps/CMakeLists.txt +++ b/src/OpenMesh/Apps/CMakeLists.txt @@ -1,11 +1,5 @@ include (ACGCommon) -# find needed packages -find_package (OpenGL) -find_package (GLUT) -find_package (GLEW) - -acg_qt4 () add_subdirectory (Dualizer) add_subdirectory (Decimating/commandlineDecimater) @@ -16,13 +10,40 @@ add_subdirectory (mconvert) add_subdirectory (VDProgMesh/mkbalancedpm) add_subdirectory (VDProgMesh/Analyzer) -# check for OpenGL, GLEW and GLUT as our required dependencies -if (QT4_FOUND AND OPENGL_FOUND AND GLEW_FOUND AND GLUT_FOUND AND NOT BUILD_APPS STREQUAL OFF ) +# Add non ui apps as dependency before fixbundle +if ( WIN32 OR APPLE) + # let bundle generation depend on all targets + add_dependencies (fixbundle commandlineDecimater Dualizer mconvert Smoothing commandlineAdaptiveSubdivider commandlineSubdivider mkbalancedpm Analyzer ) +endif() + +# find needed packages for gui applications +find_package (OpenGL) +find_package (GLUT) + +# For the apps, we need qt and opengl to build them +if (NOT QT4_FOUND) + find_package (Qt4 COMPONENTS QtCore QtGui ) + + set (QT_USE_QTOPENGL 1) + + include (${QT_USE_FILE}) +endif () + + +# check for OpenGL and GLUT as our required dependencies +if (QT4_FOUND AND OPENGL_FOUND AND GLUT_FOUND AND NOT BUILD_APPS STREQUAL OFF ) add_subdirectory (Decimating/DecimaterGui) add_subdirectory (QtViewer) add_subdirectory (Subdivider/SubdividerGui) add_subdirectory (ProgViewer) add_subdirectory (VDProgMesh/Synthesizer) + + # Add ui apps as dependency before fixbundle + if ( WIN32 OR APPLE) + # let bundle generation depend on all targets + add_dependencies (fixbundle DecimaterGui ProgViewer QtViewer SubdividerGui Synthesizer) + endif() + else () if ( BUILD_APPS STREQUAL OFF ) message ("Building Apps disabled by user.") @@ -36,10 +57,6 @@ else () message ("OpengGL not found! Skipping some apps.") endif () - if (NOT GLEW_FOUND) - message ("GLEW not found! Skipping some apps.") - endif () - if (NOT GLUT_FOUND) message ("GLUT not found! Skipping some apps.") endif () diff --git a/src/OpenMesh/Apps/Decimating/DecimaterGui/CMakeLists.txt b/src/OpenMesh/Apps/Decimating/DecimaterGui/CMakeLists.txt index 46c8505e..0749f13e 100644 --- a/src/OpenMesh/Apps/Decimating/DecimaterGui/CMakeLists.txt +++ b/src/OpenMesh/Apps/Decimating/DecimaterGui/CMakeLists.txt @@ -3,11 +3,11 @@ include (ACGCommon) include_directories ( ../../../.. ${CMAKE_CURRENT_SOURCE_DIR} - ${GLEW_INCLUDE_DIR} ${GLUT_INCLUDE_DIR} ${QT_INCLUDE_DIR} ) + set (targetName DecimaterGui) # source code directories @@ -45,7 +45,6 @@ target_link_libraries (${targetName} OpenMeshTools ${QT_LIBRARIES} ${OPENGL_LIBRARIES} - ${GLEW_LIBRARY} ${GLUT_LIBRARIES} ) diff --git a/src/OpenMesh/Apps/ProgViewer/CMakeLists.txt b/src/OpenMesh/Apps/ProgViewer/CMakeLists.txt index df9b5e17..bdbecc90 100644 --- a/src/OpenMesh/Apps/ProgViewer/CMakeLists.txt +++ b/src/OpenMesh/Apps/ProgViewer/CMakeLists.txt @@ -3,7 +3,6 @@ include (ACGCommon) include_directories ( ../../.. ${CMAKE_CURRENT_SOURCE_DIR} - ${GLEW_INCLUDE_DIR} ${GLUT_INCLUDE_DIR} ${QT_INCLUDE_DIR} ) @@ -56,7 +55,6 @@ target_link_libraries (${targetName} OpenMeshTools ${QT_LIBRARIES} ${OPENGL_LIBRARIES} - ${GLEW_LIBRARY} ${GLUT_LIBRARIES} ) diff --git a/src/OpenMesh/Apps/QtViewer/CMakeLists.txt b/src/OpenMesh/Apps/QtViewer/CMakeLists.txt index 5c66ee0d..5599334f 100644 --- a/src/OpenMesh/Apps/QtViewer/CMakeLists.txt +++ b/src/OpenMesh/Apps/QtViewer/CMakeLists.txt @@ -3,7 +3,6 @@ include (ACGCommon) include_directories ( ../../.. ${CMAKE_CURRENT_SOURCE_DIR} - ${GLEW_INCLUDE_DIR} ${GLUT_INCLUDE_DIR} ${QT_INCLUDE_DIR} ) @@ -41,7 +40,6 @@ target_link_libraries (${targetName} OpenMeshTools ${QT_LIBRARIES} ${OPENGL_LIBRARIES} - ${GLEW_LIBRARY} ${GLUT_LIBRARIES} ) diff --git a/src/OpenMesh/Apps/Subdivider/SubdividerGui/CMakeLists.txt b/src/OpenMesh/Apps/Subdivider/SubdividerGui/CMakeLists.txt index 0302c5f8..9d1c436a 100644 --- a/src/OpenMesh/Apps/Subdivider/SubdividerGui/CMakeLists.txt +++ b/src/OpenMesh/Apps/Subdivider/SubdividerGui/CMakeLists.txt @@ -3,7 +3,6 @@ include (ACGCommon) include_directories ( ../../../.. ${CMAKE_CURRENT_SOURCE_DIR} - ${GLEW_INCLUDE_DIR} ${GLUT_INCLUDE_DIR} ${QT_INCLUDE_DIR} ) @@ -45,7 +44,6 @@ target_link_libraries (${targetName} OpenMeshTools ${QT_LIBRARIES} ${OPENGL_LIBRARIES} - ${GLEW_LIBRARY} ${GLUT_LIBRARIES} ) diff --git a/src/OpenMesh/Apps/VDProgMesh/Synthesizer/CMakeLists.txt b/src/OpenMesh/Apps/VDProgMesh/Synthesizer/CMakeLists.txt index 8eccd3f1..858ffa2c 100644 --- a/src/OpenMesh/Apps/VDProgMesh/Synthesizer/CMakeLists.txt +++ b/src/OpenMesh/Apps/VDProgMesh/Synthesizer/CMakeLists.txt @@ -3,7 +3,6 @@ include (ACGCommon) include_directories ( ../../../.. ${CMAKE_CURRENT_SOURCE_DIR} - ${GLEW_INCLUDE_DIR} ${GLUT_INCLUDE_DIR} ${QT_INCLUDE_DIR} ) @@ -39,6 +38,5 @@ target_link_libraries (${targetName} OpenMeshTools ${QT_LIBRARIES} ${OPENGL_LIBRARIES} - ${GLEW_LIBRARY} ${GLUT_LIBRARIES} ) diff --git a/src/OpenMesh/Core/CMakeLists.txt b/src/OpenMesh/Core/CMakeLists.txt index 28ee74b3..aa24a962 100644 --- a/src/OpenMesh/Core/CMakeLists.txt +++ b/src/OpenMesh/Core/CMakeLists.txt @@ -40,6 +40,17 @@ else () endif () +# Add core as dependency before fixbundle +if ( WIN32 OR APPLE) + # let bundle generation depend on targets + add_dependencies (fixbundle OpenMeshCore) +endif () + +if ( APPLE) + # let bundle generation depend on target + add_dependencies (fixbundle OpenMeshToolsStatic) +endif() + # Install Header Files (Apple) if ( NOT ACG_PROJECT_MACOS_BUNDLE AND APPLE ) diff --git a/src/OpenMesh/Tools/CMakeLists.txt b/src/OpenMesh/Tools/CMakeLists.txt index 5831db99..55d23815 100644 --- a/src/OpenMesh/Tools/CMakeLists.txt +++ b/src/OpenMesh/Tools/CMakeLists.txt @@ -47,6 +47,18 @@ IF( NOT WIN32 ) target_link_libraries (OpenMeshToolsStatic OpenMeshCoreStatic) ENDIF(NOT WIN32) +# Add tools as dependency before fixbundle +if ( WIN32 OR APPLE) + # let bundle generation depend on target + add_dependencies (fixbundle OpenMeshTools) +endif() + +if ( APPLE) + # let bundle generation depend on target + add_dependencies (fixbundle OpenMeshToolsStatic) +endif() + + # Install Header Files (Apple) if ( NOT ACG_PROJECT_MACOS_BUNDLE AND APPLE ) FILE(GLOB files_install_Decimater "${CMAKE_CURRENT_SOURCE_DIR}/Decimater/*.hh" "${CMAKE_CURRENT_SOURCE_DIR}/Decimater/*T.cc" )