Commit f136cca2 authored by Isaak Lim's avatar Isaak Lim
Browse files

added a Qwt6 finder, which is required for QT5 and adjusted plugins accordingly

refs #1753

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@17639 383ad7c9-94d9-4d36-a494-682f7c89f535
parent a619c379
......@@ -59,14 +59,26 @@ set(INCLUDE_DIRS ${OPENMESH_INCLUDE_DIR}
set(ADDITIONAL_LINK_LIBRARIES "" )
find_package(Qwt5)
# use Qwt6 for QT5
if (NOT FORCE_QT4 AND QT5_FOUND)
find_package(Qwt6)
if (QWT6_FOUND)
add_definitions(-DWITH_QWT)
set(INCLUDE_DIRS ${INCLUDE_DIRS} ${QWT6_INCLUDE_DIRS} )
set(ADDITIONAL_LINK_LIBRARIES ${ADDITIONAL_LINK_LIBRARIES} ${QWT6_LIBRARIES})
endif()
else()
find_package(Qwt5)
if(Qwt5_Qt4_FOUND)
add_definitions(-DWITH_QWT)
set(INCLUDE_DIRS ${INCLUDE_DIRS} ${Qwt5_INCLUDE_DIR} )
set(ADDITIONAL_LINK_LIBRARIES ${ADDITIONAL_LINK_LIBRARIES} ${Qwt5_Qt4_LIBRARY})
if(Qwt5_Qt4_FOUND)
add_definitions(-DWITH_QWT)
set(INCLUDE_DIRS ${INCLUDE_DIRS} ${Qwt5_INCLUDE_DIR} )
set(ADDITIONAL_LINK_LIBRARIES ${ADDITIONAL_LINK_LIBRARIES} ${Qwt5_Qt4_LIBRARY})
endif()
endif()
find_package( Freetype)
if (NOT FREETYPE_FOUND)
message (MESSAGE "FREETYPE not found! Disabled ftgl support!")
......
......@@ -150,11 +150,23 @@ if ( NOT found EQUAL -1 )
endif()
endif()
find_package(Qwt5)
# use Qwt6 for QT5
if (NOT FORCE_QT4 AND QT5_FOUND)
find_package(Qwt6)
if (QWT6_FOUND)
add_definitions(-DWITH_QWT)
set(INCLUDE_DIRS ${INCLUDE_DIRS} ${QWT6_INCLUDE_DIRS} )
set(ADDITIONAL_LINK_LIBRARIES ${COREAPP_ADDITIONAL_LINK_LIBRARIES} ${QWT6_LIBRARIES})
endif()
else()
find_package(Qwt5)
if(Qwt5_Qt4_FOUND)
add_definitions(-DWITH_QWT)
set(COREAPP_ADDITIONAL_LINK_LIBRARIES ${COREAPP_ADDITIONAL_LINK_LIBRARIES} ${Qwt5_Qt4_LIBRARY})
if(Qwt5_Qt4_FOUND)
add_definitions(-DWITH_QWT)
set(INCLUDE_DIRS ${INCLUDE_DIRS} ${Qwt5_INCLUDE_DIR} )
set(ADDITIONAL_LINK_LIBRARIES ${COREAPP_ADDITIONAL_LINK_LIBRARIES} ${Qwt5_Qt4_LIBRARY})
endif()
endif()
......
include(plugin)
find_package(Qwt5)
# use Qwt6 for QT5
if (NOT FORCE_QT4 AND QT5_FOUND)
find_package(Qwt6)
if(Qwt5_Qt4_FOUND)
add_definitions(-DWITH_QWT)
openflipper_plugin(INCDIRS ${Qwt5_INCLUDE_DIR}
LIBRARIES ${Qwt5_Qt4_LIBRARY}
INSTALLDATA Icons
)
if (QWT6_FOUND)
add_definitions(-DWITH_QWT)
openflipper_plugin(INCDIRS ${QWT6_INCLUDE_DIRS}
LIBRARIES ${QWT6_LIBRARIES}
INSTALLDATA Icons
)
else()
openflipper_plugin(INSTALLDATA Icons)
endif()
else()
openflipper_plugin(INSTALLDATA Icons)
find_package(Qwt5)
if(Qwt5_Qt4_FOUND)
add_definitions(-DWITH_QWT)
openflipper_plugin(INCDIRS ${Qwt5_INCLUDE_DIR}
LIBRARIES ${Qwt5_Qt4_LIBRARY}
INSTALLDATA Icons
)
else()
openflipper_plugin(INSTALLDATA Icons)
endif()
endif()
......@@ -78,6 +78,8 @@
#include <ACG/QtWidgets/QwtHistogramm.hh>
#include <vector>
#include <QDialog>
//== FORWARDDECLARATIONS ======================================================
//== NAMESPACES ===============================================================
......
include(plugin)
find_package(Qwt5)
if (EXISTS ${CMAKE_SOURCE_DIR}/ObjectTypes/PolyhedralMesh)
add_definitions (-DENABLE_OPENVOLUMEMESH_SUPPORT)
add_definitions (-DENABLE_OPENVOLUMEMESH_POLYHEDRAL_SUPPORT)
......@@ -12,19 +10,23 @@ if (EXISTS ${CMAKE_SOURCE_DIR}/ObjectTypes/HexahedralMesh)
add_definitions (-DENABLE_OPENVOLUMEMESH_HEXAHEDRAL_SUPPORT)
endif()
if(Qwt5_Qt4_FOUND)
add_definitions(-DWITH_QWT)
openflipper_plugin(INCDIRS ${Qwt5_INCLUDE_DIR} LIBRARIES ${Qwt5_Qt4_LIBRARY})
# use Qwt6 for QT5
if (NOT FORCE_QT4 AND QT5_FOUND)
find_package(Qwt6)
if (QWT6_FOUND)
add_definitions(-DWITH_QWT)
openflipper_plugin(INCDIRS ${QWT6_INCLUDE_DIRS} LIBRARIES ${QWT6_LIBRARIES})
else()
openflipper_plugin()
endif()
else()
openflipper_plugin()
find_package(Qwt5)
if(Qwt5_Qt4_FOUND)
add_definitions(-DWITH_QWT)
openflipper_plugin(INCDIRS ${Qwt5_INCLUDE_DIR} LIBRARIES ${Qwt5_Qt4_LIBRARY})
else()
openflipper_plugin()
endif()
endif()
......@@ -72,6 +72,8 @@
#include <qwt_scale_engine.h>
#include <qwt_plot_marker.h>
#include <QDialog>
// qmake users have to include pc
#include <ui_QwtFunctionPlotBase.hh>
......
......@@ -7,8 +7,6 @@
# - the Qwt .lib is where the other LIBs for Qt are (QT_DIR\lib) or in the path
#
# Qwt5_INCLUDE_DIR - where to find qwt.h if Qwt
# Qwt5_Qt5_LIBRARY - The Qwt5 library linked against Qt5 (if it exists)#
# Qwt5_Qt5_LIBRARY_DIR
# Qwt5_Qt4_LIBRARY - The Qwt5 library linked against Qt4 (if it exists)#
# Qwt5_Qt4_LIBRARY_DIR
# Qwt5_Qt3_LIBRARY - The Qwt5 library linked against Qt4 (if it exists)
......@@ -35,6 +33,8 @@ ENDIF()
IF( QT5_FOUND )
message (WARNING "Qwt5 is not compatible with QT5! Use Qwt6 instead.")
ELSEIF( QT4_FOUND )
if ( CMAKE_GENERATOR MATCHES "Visual Studio 9*" )
set( SEARCHPATH "./" )
......
# - Try to find Qwt6
# Once done this will define
# QWT6_FOUND - System has Qwt6
# QWT6_INCLUDE_DIRS - The Qwt6 include directories
# QWT6_LIBRARIES - The libraries needed to use Qwt6
# QWT6_DEFINITIONS - Compiler switches required for using Qwt6
find_path(QWT6_INCLUDE_DIR qwt.h
PATHS ${QT_INCLUDE_DIR}
/usr/local/qwt/include
/usr/local/include
/opt/local/include
/opt/local/include/qwt
/usr/include
c:\\libs\\${SEARCHPATH}\\x32\\Qwt-6.1.0
c:\\libs\\${SEARCHPATH}\\x32\\Qwt-6.0.2
c:\\libs\\${SEARCHPATH}\\x32\\Qwt-6.0.1
c:\\libs\\Qwt-6.1.0
c:\\libs\\Qwt-6.0.2
c:\\libs\\Qwt-6.0.1
c:\\libs\\qwt-6.1.0
c:\\libs\\qwt-6.0.2
c:\\libs\\qwt-6.0.1
PATH_SUFFIXES qwt qwt6 qwt-6.1.0 qwt-6.0.2 qwt-6.0.1 include qwt/include qwt6/include
ENV PATH)
if (EXISTS "${QWT6_INCLUDE_DIR}/qwt_global.h")
file( READ ${QWT6_INCLUDE_DIR}/qwt_global.h QWT_GLOBAL_H )
string( REGEX MATCH "#define *QWT_VERSION *(0x06*)" QWT6_VERSION_FOUND ${QWT_GLOBAL_H})
if (NOT QWT6_VERSION_FOUND)
message(WARNING "Qwt is not version 6")
endif()
else()
message(WARNING "Could not find qwt_global.h")
endif()
if (QWT6_VERSION_FOUND)
find_library(QWT6_LIBRARY NAMES qwt
PATHS
"c:\\libs\\${SEARCHPATH}\\x32\\Qwt-6.0.2\\lib"
"c:\\libs\\${SEARCHPATH}\\x32\\Qwt-6.1.0\\lib"
"c:\\libs\\Qwt-6.1.0\\lib"
"c:\\libs\\Qwt-6.0.2\\lib"
"c:\\libs\\qwt-6.0.1\\lib"
/usr/local/qwt/lib
/opt/local/lib
/usr/local/lib
/usr/lib
)
set(QWT6_LIBRARIES ${QWT6_LIBRARY} )
set(QWT6_INCLUDE_DIRS ${QWT6_INCLUDE_DIR} )
endif()
include(FindPackageHandleStandardArgs)
# handle the QUIETLY and REQUIRED arguments and set LIBXML2_FOUND to TRUE
# if all listed variables are TRUE
find_package_handle_standard_args(QWT6 DEFAULT_MSG
QWT6_LIBRARY QWT6_INCLUDE_DIR)
mark_as_advanced(QWT6_INCLUDE_DIR QWT6_LIBRARY)
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