Commit feaadf5d authored by Jan Möbius's avatar Jan Möbius

Reverted bunch of crap


git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@19086 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 30a13718
......@@ -58,7 +58,6 @@ set(INCLUDE_DIRS ${OPENMESH_INCLUDE_DIRS}
${GLUT_INCLUDE_DIR} )
set(ADDITIONAL_LINK_LIBRARIES "" )
set(ADDITIONAL_LINK_DIRS "" )
find_package (QJson)
if (QJSON_FOUND)
......@@ -74,7 +73,6 @@ if (NOT FORCE_QT4 AND QT5_FOUND)
add_definitions(-DWITH_QWT)
set(INCLUDE_DIRS ${INCLUDE_DIRS} ${QWT6_INCLUDE_DIRS} )
set(ADDITIONAL_LINK_LIBRARIES ${ADDITIONAL_LINK_LIBRARIES} ${QWT6_LIBRARIES})
set(ADDITIONAL_LINK_DIRS ${ADDITIONAL_LINK_DIRS} ${QWT6_LIBRARY_DIR})
endif()
else()
find_package(Qwt5)
......@@ -109,7 +107,6 @@ include_directories (
link_directories (
${GLEW_LIBRARY_DIR}
${GLUT_LIBRARY_DIR}
${ADDITIONAL_LINK_DIRS}
)
#===================================================================
......
......@@ -44,7 +44,7 @@
#ifdef WITH_QWT
// Include the plot header to get the qwt version
#include <qwt.h>
#include <qwt_plot.h>
// This file is for QWT >= 6.0 only
#if QWT_VERSION >= 0x060000
......
......@@ -45,7 +45,7 @@ include (package)
include (ACGOutput)
# try to use QT5 if possible otherwise stick to QT4
set (FORCE_QT4 OFF CACHE BOOL "Use Qt4 even if Qt5 was found")
set (FORCE_QT4 ON CACHE BOOL "Use Qt4 even if Qt5 was found")
if (NOT FORCE_QT4)
acg_qt5 ()
......@@ -53,18 +53,13 @@ else()
set (QT5_FOUND false)
endif()
if (NOT QT5_FOUND)
message(STATUS "Could not find QT5, searching for QT4")
message(STATUS "Using QT4 for OpenFlipper")
acg_qt4 (4.7.0)
endif()
if (QT4_FOUND)
message(STATUS "Using QT4 for OpenFlipper")
elseif(QT5_FOUND)
message(STATUS "Using QT5 for OpenFlipper")
else()
message(FATAL_ERROR "Could not found any QT Version. Please specify QT5_INSTALL_PATH to build with QT5 or specify the QT_QMAKE_EXECUTABLE to the QT4 qmake")
endif()
else ()
message(STATUS "Using QT5 for OpenFlipper")
endif ()
acg_openmp ()
#acg_ftgl ()
......
......@@ -24,7 +24,9 @@ if (NOT FORCE_QT4 AND QT5_FOUND)
if (QWT6_FOUND)
add_definitions(-DWITH_QWT)
openflipper_plugin( DEPS ${CURRENT_PLUGIN_DEPS} Qwt6)
openflipper_plugin( DEPS ${CURRENT_PLUGIN_DEPS}
INCDIRS ${QWT6_INCLUDE_DIRS}
LIBRARIES ${QWT6_LIBRARIES})
else()
openflipper_plugin( DEPS ${CURRENT_PLUGIN_DEPS})
endif()
......@@ -33,7 +35,9 @@ else()
if(Qwt5_Qt4_FOUND)
add_definitions(-DWITH_QWT)
openflipper_plugin( DEPS ${CURRENT_PLUGIN_DEPS} Qwt5)
openflipper_plugin( DEPS ${CURRENT_PLUGIN_DEPS}
INCDIRS ${Qwt5_INCLUDE_DIR}
LIBRARIES ${Qwt5_Qt4_LIBRARY})
else()
openflipper_plugin(DEPS ${CURRENT_PLUGIN_DEPS})
endif()
......
......@@ -221,76 +221,69 @@ macro (acg_qt5)
#set (QT_MIN_VERSION ${ARGN})
#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")
if (EXISTS "${QT5_INSTALL_PATH}/include")
set (CMAKE_PREFIX_PATH "${QT5_INSTALL_PATH}")
set (QT5_INSTALL_PATH_EXISTS TRUE)
endif()
#glu32.lib is needed by qt5 opengl version. it cannot find it by itself so we help qt
#this block has to be executed, before Qt5Gui is searched, otherwise we will end up with the (not so useful) QT5 error message
if ( WIN32 )
set(WINDOWS_SDK_LIBS "COULD_NOT_FOUND" CACHE PATH "Path to the latest windows sdk libs which includes glu32.lib. Used by Qt5")
if (EXISTS "${WINDOWS_SDK_LIBS}\\glu32.lib")
set (CMAKE_PREFIX_PATH "${CMAKE_PREFIX_PATH};${WINDOWS_SDK_LIBS}")
elseif(QT5_INSTALL_PATH_EXISTS) #trying to install qt5. notify about missing sdk before the qt message comes
message(FATAL_ERROR "Could not find glu32.lib. This is necessary for QT5 OpenGL version for windows, spleace specify glu32.lib in WINDOWS_SDK_LIB")
endif()
endif(WIN32)
find_package (Qt5Core QUIET)
find_package (Qt5Declarative QUIET)
find_package (Qt5Widgets QUIET)
find_package (Qt5Gui QUIET)
find_package (Qt5OpenGL QUIET)
find_package (Qt5Network QUIET)
find_package (Qt5Script QUIET)
find_package (Qt5ScriptTools QUIET)
find_package (Qt5Sql QUIET)
find_package (Qt5Xml QUIET)
find_package (Qt5XmlPatterns QUIET)
find_package (Qt5Help QUIET)
find_package (Qt5WebKit QUIET)
find_package (Qt5UiTools QUIET)
find_package (Qt5Concurrent QUIET)
find_package (Qt5PrintSupport QUIET)
if (Qt5Core_FOUND AND Qt5Declarative_FOUND AND Qt5Widgets_FOUND
AND Qt5Gui_FOUND AND Qt5OpenGL_FOUND AND Qt5Network_FOUND
AND Qt5Script_FOUND AND Qt5ScriptTools_FOUND AND Qt5Sql_FOUND
AND Qt5Xml_FOUND AND Qt5XmlPatterns_FOUND AND Qt5Help_FOUND
AND Qt5WebKit_FOUND AND Qt5UiTools_FOUND AND Qt5Concurrent_FOUND
AND Qt5PrintSupport_FOUND)
set (QT5_FOUND TRUE)
#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")
if (EXISTS ${QT5_INSTALL_PATH})
# if (NOT EXISTS "${QT5_INSTALL_PATH}/include")
# message( FATAL_ERROR "Could not find Qt5 include directory. Please set QT5_INSTALL_PATH to the directory which contains Qt5 lib and include folder.")
# endif()
# if (NOT EXISTS "${QT5_INSTALL_PATH}/lib")
# message( FATAL_ERROR "Could not find Qt5 lib directory. Please set QT5_INSTALL_PATH to the directory which contains Qt5 lib and include folder.")
# endif()
else()
message( FATAL_ERROR "The Given QT5_INSTALL_PATH does not exists")
endif()
if (QT5_FOUND)
#set plugin dir
list(GET Qt5Gui_PLUGINS 0 _plugin)
if (_plugin)
get_target_property(_plugin_full ${_plugin} LOCATION)
get_filename_component(_plugin_dir ${_plugin_full} PATH)
set (QT_PLUGINS_DIR "${_plugin_dir}/../" CACHE PATH "Path to the qt plugin directory")
elseif(QT5_INSTALL_PATH_EXISTS)
set (QT_PLUGINS_DIR "${QT5_INSTALL_PATH}/plugins/" CACHE PATH "Path to the qt plugin directory")
elseif()
set (QT_PLUGINS_DIR "QT_PLUGIN_DIR_NOT_FOUND" CACHE PATH "Path to the qt plugin directory")
endif()
set (CMAKE_PREFIX_PATH ${QT5_INSTALL_PATH})
set (CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
set (QT_PLUGINS_DIR "${QT5_INSTALL_PATH}/plugins" CACHE PATH "")
set (QT_BINARY_DIR "${QT5_INSTALL_PATH}/bin" CACHE PATH "Qt5 binary Directory")
#glu32.lib is needed by qt5 opengl version. it cannot find it by itself so we help qt
if ( WIN32 )
#set binary dir for fixupbundle
if(QT5_INSTALL_PATH_EXISTS)
set(_QT_BINARY_DIR "${QT5_INSTALL_PATH}/bin")
set(WINDOWS_SDK_LIBS "COULD_NOT_FOUND" CACHE PATH "Path to the latest windows sdk libs which includes glu32.lib")
if (EXISTS "${WINDOWS_SDK_LIBS}\\glu32.lib")
set (WINDOWS_SDK_LIBS ${WINDOWS_SDK_LIBS})
set (CMAKE_PREFIX_PATH "${QT5_INSTALL_PATH};${WINDOWS_SDK_LIBS}")
else()
get_target_property(_QT_BINARY_DIR ${Qt5Widgets_UIC_EXECUTABLE} LOCATION)
get_filename_component(_QT_BINARY_DIR ${_QT_BINARY_DIR} PATH)
message( FATAL_ERROR "Could not find glu32.lib in your Windows sdk libs.")
endif()
set (QT_BINARY_DIR "${_QT_BINARY_DIR}" CACHE PATH "Qt5 binary Directory")
endif()#WIN32
find_package (Qt5Core REQUIRED)
find_package (Qt5Declarative REQUIRED)
find_package (Qt5Widgets REQUIRED)
find_package (Qt5Gui REQUIRED)
find_package (Qt5OpenGL REQUIRED)
find_package (Qt5Network REQUIRED)
find_package (Qt5Script REQUIRED)
find_package (Qt5ScriptTools REQUIRED)
find_package (Qt5Sql REQUIRED)
find_package (Qt5Xml REQUIRED)
find_package (Qt5XmlPatterns REQUIRED)
find_package (Qt5Help REQUIRED)
find_package (Qt5WebKit REQUIRED)
find_package (Qt5UiTools REQUIRED)
find_package (Qt5Concurrent REQUIRED)
find_package (Qt5PrintSupport REQUIRED)
if (NOT WIN32 AND NOT APPLE)
find_package (Qt5X11Extras)
endif ()
set (QT5_FOUND ${Qt5Core_FOUND} AND ${Qt5Declarative} AND ${Qt5Widgets_FOUND}
AND ${Qt5Gui_FOUND} AND ${Qt5OpenGL_FOUND} AND ${Qt5Network_FOUND}
AND ${Qt5Script_FOUND} AND ${Qt5ScriptTools_FOUND} AND ${Qt5Sql_FOUND}
AND ${Qt5Xml_FOUND} AND ${Qt5XmlPatterns_FOUND} AND ${Qt5Help_FOUND}
AND ${Qt5WebKit_FOUND} AND ${Qt5UiTools_FOUND} AND ${Qt5Concurrent_FOUND}
AND ${Qt5PrintSupport_FOUND})
if (QT5_FOUND)
include_directories(${Qt5Core_INCLUDE_DIRS})
include_directories(${Qt5Declarative_INCLUDE_DIRS})
include_directories(${Qt5Widgets_INCLUDE_DIRS})
......@@ -331,7 +324,7 @@ macro (acg_qt5)
if ( NOT MSVC )
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
endif()
set (QT_LIBRARIES ${Qt5Core_LIBRARIES} ${Qt5Declarative_LIBRARIES} ${Qt5Widgets_LIBRARIES}
${Qt5Gui_LIBRARIES} ${Qt5OpenGL_LIBRARIES} ${Qt5Network_LIBRARIES}
${Qt5Script_LIBRARIES} ${Qt5ScriptTools_LIBRARIES} ${Qt5Sql_LIBRARIES}
......@@ -345,26 +338,28 @@ macro (acg_qt5)
if (MSVC)
set (QT_LIBRARIES ${QT_LIBRARIES} ${Qt5Core_QTMAIN_LIBRARIES})
endif()
#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_MINSIZEREL "${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)
endif (QT5_FOUND)
#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)
endif ()
endmacro ()
# unsets the given variable
......@@ -418,7 +413,7 @@ macro (acg_append_files ret ext)
foreach (_file ${_files})
get_filename_component (_filename ${_file} NAME)
if (_filename MATCHES "^[.]")
list (REMOVE_ITEM _files ${_file})
list (REMOVE_ITEM _files ${_file})
endif ()
endforeach ()
list (APPEND ${ret} ${_files})
......@@ -433,7 +428,7 @@ macro (acg_append_files_recursive ret ext)
foreach (_file ${_files})
get_filename_component (_filename ${_file} NAME)
if (_filename MATCHES "^[.]")
list (REMOVE_ITEM _files ${_file})
list (REMOVE_ITEM _files ${_file})
endif ()
endforeach ()
list (APPEND ${ret} ${_files})
......@@ -526,7 +521,11 @@ macro (acg_qt5_automoc moc_SRCS)
set (_header ${_abs_FILE})
set (_moc ${CMAKE_CURRENT_BINARY_DIR}/moc_${_basename}.cpp)
qt5_generate_moc(${_header} ${_moc})
add_custom_command (OUTPUT ${_moc}
COMMAND ${QT_MOC_EXECUTABLE}
ARGS ${_moc_INCS} ${_header} -o ${_moc}
DEPENDS ${_header}
)
add_file_dependencies (${_abs_FILE} ${_moc})
set (${moc_SRCS} ${${moc_SRCS}} ${_moc})
......
......@@ -3,13 +3,9 @@
# QWT6_FOUND - System has Qwt6
# QWT6_INCLUDE_DIRS - The Qwt6 include directories
# QWT6_LIBRARIES - The libraries needed to use Qwt6
# iQWT6_DEFINITIONS - Compiler switches required for using Qwt6
#
#
# QWT_SEARCH_PATH can be used to redirect the finder to a specific location
# QWT6_DEFINITIONS - Compiler switches required for using Qwt6
set (QWT_SEARCH_PATH CACHE PATH "Path to look for the qwt6 library")
if ( CMAKE_GENERATOR MATCHES "^Visual Studio 11.*Win64" )
SET(VS_SEARCH_PATH "c:/libs/vs2012/x64/")
......@@ -23,9 +19,11 @@ else ()
SET(VS_SEARCH_PATH "")
endif()
find_path(QWT6_INCLUDE_DIR qwt.h
PATHS ${QT_INCLUDE_DIR}
${QWT_SEARCH_PATH}/include
/usr/local/qwt/include
/usr/local/include
/opt/local/include
......@@ -42,9 +40,7 @@ find_path(QWT6_INCLUDE_DIR qwt.h
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
NO_DEFAULT_PATH
)
ENV PATH)
if (EXISTS "${QWT6_INCLUDE_DIR}/qwt_global.h")
file( READ ${QWT6_INCLUDE_DIR}/qwt_global.h QWT_GLOBAL_H )
......@@ -95,9 +91,8 @@ if (QWT6_VERSION_FOUND)
)
# MACOS and LINUX
else()
find_library(QWT6_LIBRARY NAMES qwt-qt5 qwt
find_library(QWT6_LIBRARY NAMES qwt
PATHS
${QWT_SEARCH_PATH}/lib
/usr/local/qwt/lib
/opt/local/lib
/usr/local/lib
......@@ -106,12 +101,11 @@ if (QWT6_VERSION_FOUND)
#sets the library dir
get_filename_component(_QWT6_LIBRARY_DIR ${QWT6_LIBRARY} PATH)
get_filename_component(_QWT6_LIBRARY_NAME ${QWT6_LIBRARY} NAME)
set (QWT6_LIBRARY_DIR "${_QWT6_LIBRARY_DIR}" CACHE PATH "The directory where the QWT6 libraries can be found.")
endif()
set(QWT6_LIBRARIES ${_QWT6_LIBRARY_NAME} CACHE PATH "The QWT6 libraries can be found.")
set(QWT6_LIBRARIES ${QWT6_LIBRARY} )
set(QWT6_INCLUDE_DIRS ${QWT6_INCLUDE_DIR} )
endif()
......
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