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

Prepare for qt 5.7

- Split qt macros into extra source file to make early qt discovery possible
- Enable c++11 support by default on unix with qt 5.7 and greater
- Simplify compiler macro setup
parent 31e76d0f
......@@ -2,9 +2,9 @@ cmake_minimum_required (VERSION 2.8.9)
# ACG Environment default settings
# This is ugly but currently we need to work around the default installed 5.3 on debian
if ( EXISTS /ACG/acgdev/gcc-4.9-x86_64/qt-5.6.0/5.6/gcc_64/ )
if ( EXISTS /ACG/acgdev/gcc-4.9-x86_64/qt-5.7.0/5.7/gcc_64/ )
# Default to this install path for QT%_INSTALL_DIR
set (QT5_INSTALL_PATH /ACG/acgdev/gcc-4.9-x86_64/qt-5.6.0/5.6/gcc_64/ CACHE PATH "Qt5 install path set for ACG environment" )
set (QT5_INSTALL_PATH /ACG/acgdev/gcc-4.9-x86_64/qt-5.7.0/5.7/gcc_64/ CACHE PATH "Qt5 install path set for ACG environment" )
endif()
......@@ -38,6 +38,42 @@ file (
)
set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${_more_macro_directories})
# ========================================================================
# QT Setup
# ========================================================================
# Qt setup
include(ACGQt)
# try to use QT5 if possible otherwise stick to QT4
set (FORCE_QT4 OFF CACHE BOOL "Use Qt4 even if Qt5 was found")
if (NOT FORCE_QT4)
acg_qt5 ()
else()
set (QT5_FOUND false)
endif()
if (NOT QT5_FOUND)
message(STATUS "Could not find QT5, searching for QT4")
acg_qt4 (4.7.0)
endif()
if (QT4_FOUND)
message(STATUS "Using QT4 for OpenFlipper")
elseif(QT5_FOUND)
message(STATUS "Using QT5 for OpenFlipper")
set (OF_MAX_QT_VERSION "5.6.0")
if (${Qt5Core_VERSION_STRING} STRGREATER ${OF_MAX_QT_VERSION})
message(WARNING "Detected QT Version higher than ${OF_MAX_QT_VERSION}!\n" "OpenFlipper has not been tested with this QT Version.")
endif()
else()
message(FATAL_ERROR "Could not found any QT Version. Please specify QT5_INSTALL_PATH (path to bin and include dir) to build with QT5 or specify the QT_QMAKE_EXECUTABLE to build with QT4")
endif()
# ========================================================================
# ========================================================================
# include our cmake files
include (ACGCommon)
include (MSVCMacros)
......@@ -48,8 +84,6 @@ acg_get_version (OpenFlipper)
# Branding
# ========================================================================
# search all branding dirs in the packages and in toplevel
file (
GLOB _local_branding_in
......@@ -103,33 +137,6 @@ add_definitions(-DPRODUCT_NAME=${OPENFLIPPER_PRODUCT_NAME})
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")
if (NOT FORCE_QT4)
acg_qt5 ()
else()
set (QT5_FOUND false)
endif()
if (NOT QT5_FOUND)
message(STATUS "Could not find QT5, searching for QT4")
acg_qt4 (4.7.0)
endif()
if (QT4_FOUND)
message(STATUS "Using QT4 for OpenFlipper")
elseif(QT5_FOUND)
message(STATUS "Using QT5 for OpenFlipper")
set (OF_MAX_QT_VERSION "5.5.1")
if (${Qt5Core_VERSION_STRING} STRGREATER ${OF_MAX_QT_VERSION})
message(WARNING "Detected QT Version higher than ${OF_MAX_QT_VERSION}!\n"
"OpenFlipper has not been tested with this QT Version on Windows.")
endif()
else()
message(FATAL_ERROR "Could not found any QT Version. Please specify QT5_INSTALL_PATH (path to bin and include dir) to build with QT5 or specify the QT_QMAKE_EXECUTABLE to build with QT4")
endif()
acg_openmp ()
# check for OpenGL, GLEW and GLUT as our required dependencies
......
This diff is collapsed.
......@@ -46,19 +46,29 @@ if (UNIX)
set ( ADDITIONAL_CXX_DEBUG_FLAGS )
set ( ADDITIONAL_CXX_RELEASE_FLAGS )
set ( ADDITIONAL_CXX_RELWITHDEBINFO_FLAGS )
set ( ADDITIONAL_C_DEBUG_FLAGS )
set ( ADDITIONAL_C_RELEASE_FLAGS )
set ( ADDITIONAL_C_RELWITHDEBINFO_FLAGS )
if (${Qt5Core_VERSION_STRING} STRGREATER "5.6")
message(WARNING "Detected QT Version which requires C++11 support!\n" "C++ automatically activated.")
if (NOT WIN32 AND NOT APPLE)
set(ADDITIONAL_CXX_DEBUG_FLAGS "${ADDITIONAL_CXX_DEBUG_FLAGS} -std=c++11" )
set(ADDITIONAL_CXX_RELEASE_FLAGS "${ADDITIONAL_CXX_RELEASE_FLAGS} -std=c++11" )
set(ADDITIONAL_CXX_RELWITHDEBINFO_FLAGS "${ADDITIONAL_CXX_RELWITHDEBINFO_FLAGS} -std=c++11" )
endif()
endif()
################################################################################
# Defaults
################################################################################
# add our standard flags for Template inclusion
list(APPEND ADDITIONAL_CXX_DEBUG_FLAGS "-DINCLUDE_TEMPLATES" )
list(APPEND ADDITIONAL_CXX_RELEASE_FLAGS "-DINCLUDE_TEMPLATES" )
list(APPEND ADDITIONAL_CXX_RELWITHDEBINFO_FLAGS "-DINCLUDE_TEMPLATES" )
set( ADDITIONAL_CXX_DEBUG_FLAGS "${ADDITIONAL_CXX_DEBUG_FLAGS} -DINCLUDE_TEMPLATES" )
set( ADDITIONAL_CXX_RELEASE_FLAGS "${ADDITIONAL_CXX_RELEASE_FLAGS} -DINCLUDE_TEMPLATES" )
set( ADDITIONAL_CXX_RELWITHDEBINFO_FLAGS "${ADDITIONAL_CXX_RELWITHDEBINFO_FLAGS} -DINCLUDE_TEMPLATES" )
# add our standard flags for Template inclusion
list(APPEND ADDITIONAL_C_DEBUG_FLAGS "-DINCLUDE_TEMPLATES" )
......@@ -86,9 +96,9 @@ if (UNIX)
# Build/Release Defines
################################################################################
IF( NOT CMAKE_SYSTEM MATCHES "SunOS*")
list(APPEND ADDITIONAL_CXX_DEBUG_FLAGS "-DDEBUG" )
list(APPEND ADDITIONAL_CXX_RELEASE_FLAGS "-DNDEBUG" )
list(APPEND ADDITIONAL_CXX_RELWITHDEBINFO_FLAGS "-DDEBUG" )
set( ADDITIONAL_CXX_DEBUG_FLAGS "${ADDITIONAL_CXX_DEBUG_FLAGS} -DDEBUG" )
set( ADDITIONAL_CXX_RELEASE_FLAGS "${ADDITIONAL_CXX_RELEASE_FLAGS} -DNDEBUG" )
set( ADDITIONAL_CXX_RELWITHDEBINFO_FLAGS "${ADDITIONAL_CXX_RELWITHDEBINFO_FLAGS} -DDEBUG" )
list(APPEND ADDITIONAL_C_DEBUG_FLAGS "-DDEBUG" )
list(APPEND ADDITIONAL_C_RELEASE_FLAGS "-DNDEBUG" )
......@@ -104,20 +114,20 @@ if (UNIX)
IF ( APPLE )
# Skip unused parameters as it has to be used for the documentation via doxygen and the interfaces
set ( COMPILER_WARNINGS "-W" "-Wall" "-Wno-unused" "-Wextra" "-Wno-non-virtual-dtor" "-Wno-unused-parameter" "-Wno-variadic-macros" CACHE STRINGLIST "This list contains the warning flags used during compilation " )
set ( COMPILER_WARNINGS "-W -Wall -Wno-unused -Wextra -Wno-non-virtual-dtor -Wno-unused-parameter -Wno-variadic-macros" CACHE STRING "This list contains the warning flags used during compilation " )
elseif ("${CMAKE_CXX_COMPILER} ${CMAKE_CXX_COMPILER_ARG1}" MATCHES ".*clang")
set ( COMPILER_WARNINGS "-W" "-Wall" "-Wextra" "-Wno-non-virtual-dtor" "-Wno-unused-parameter" "-Wno-variadic-macros" CACHE STRINGLIST "This list contains the warning flags used during compilation " )
set ( COMPILER_WARNINGS "-W -Wall -Wextra -Wno-non-virtual-dtor -Wno-unused-parameter -Wno-variadic-macros" CACHE STRING "This list contains the warning flags used during compilation " )
ELSEIF ( CMAKE_SYSTEM MATCHES "SunOS*" )
set ( COMPILER_WARNINGS "" CACHE STRINGLIST "This list contains the warning flags used during compilation " )
ELSE ()
set ( COMPILER_WARNINGS "-W" "-Wall" "-Wno-unused" "-Wextra" "-Wno-variadic-macros" CACHE STRINGLIST "This list contains the warning flags used during compilation " )
set ( COMPILER_WARNINGS "-W -Wall -Wno-unused -Wextra -Wno-variadic-macros" CACHE STRING "This list contains the warning flags used during compilation " )
ENDIF()
endif ( NOT COMPILER_WARNINGS )
list(APPEND ADDITIONAL_CXX_DEBUG_FLAGS ${COMPILER_WARNINGS} )
list(APPEND ADDITIONAL_CXX_RELEASE_FLAGS ${COMPILER_WARNINGS} )
list(APPEND ADDITIONAL_CXX_RELWITHDEBINFO_FLAGS ${COMPILER_WARNINGS} )
set( ADDITIONAL_CXX_DEBUG_FLAGS "${ADDITIONAL_CXX_DEBUG_FLAGS} ${COMPILER_WARNINGS}" )
set( ADDITIONAL_CXX_RELEASE_FLAGS "${ADDITIONAL_CXX_RELEASE_FLAGS} ${COMPILER_WARNINGS}" )
set( ADDITIONAL_CXX_RELWITHDEBINFO_FLAGS "${ADDITIONAL_CXX_RELWITHDEBINFO_FLAGS} ${COMPILER_WARNINGS}" )
list(APPEND ADDITIONAL_C_DEBUG_FLAGS ${COMPILER_WARNINGS} )
list(APPEND ADDITIONAL_C_RELEASE_FLAGS ${COMPILER_WARNINGS} )
......@@ -134,10 +144,10 @@ if (UNIX)
# Add a flag to check stl vectors in debugging mode
if ( STL_VECTOR_CHECKS AND NOT CMAKE_SYSTEM MATCHES "SunOS*" )
list(APPEND ADDITIONAL_CXX_DEBUG_FLAGS "-D_GLIBCXX_DEBUG" )
list(APPEND ADDITIONAL_CXX_DEBUG_FLAGS "-D_GLIBCXX_DEBUG_PEDANTIC")
list(APPEND ADDITIONAL_CXX_RELWITHDEBINFO_FLAGS "-D_GLIBCXX_DEBUG" )
list(APPEND ADDITIONAL_CXX_RELWITHDEBINFO_FLAGS "-D_GLIBCXX_DEBUG_PEDANTIC")
set(ADDITIONAL_CXX_DEBUG_FLAGS "${ADDITIONAL_CXX_DEBUG_FLAGS} -D_GLIBCXX_DEBUG" )
set(ADDITIONAL_CXX_DEBUG_FLAGS "${ADDITIONAL_CXX_DEBUG_FLAGS} -D_GLIBCXX_DEBUG_PEDANTIC")
set(ADDITIONAL_CXX_RELWITHDEBINFO_FLAGS "${ADDITIONAL_CXX_RELWITHDEBINFO_FLAGS} -D_GLIBCXX_DEBUG" )
set(ADDITIONAL_CXX_RELWITHDEBINFO_FLAGS "${ADDITIONAL_CXX_RELWITHDEBINFO_FLAGS} -D_GLIBCXX_DEBUG_PEDANTIC")
list(APPEND ADDITIONAL_C_DEBUG_FLAGS "-D_GLIBCXX_DEBUG" )
list(APPEND ADDITIONAL_C_DEBUG_FLAGS "-D_GLIBCXX_DEBUG_PEDANTIC")
......@@ -150,43 +160,31 @@ if (UNIX)
################################################################################
# Add the debug flags
foreach( flag ${ADDITIONAL_CXX_DEBUG_FLAGS} )
if( NOT CMAKE_CXX_FLAGS_DEBUG MATCHES "${flag}" )
set( CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${flag} ")
endif()
endforeach()
set( CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${ADDITIONAL_CXX_DEBUG_FLAGS} ")
# Add the release flags
foreach( flag ${ADDITIONAL_CXX_RELEASE_FLAGS} )
if( NOT CMAKE_CXX_FLAGS_RELEASE MATCHES "${flag}" )
set( CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${flag} ")
endif()
endforeach()
set( CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${ADDITIONAL_CXX_RELEASE_FLAGS} ")
# Add the release with debug info flags
foreach( flag ${ADDITIONAL_CXX_RELWITHDEBINFO_FLAGS} )
if( NOT CMAKE_CXX_FLAGS_RELWITHDEBINFO MATCHES "${flag}" )
set( CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} ${flag} ")
endif()
endforeach()
set( CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} ${ADDITIONAL_CXX_RELWITHDEBINFO_FLAGS} ")
# Add the debug flags
foreach( flag ${ADDITIONAL_C_DEBUG_FLAGS} )
if( NOT CMAKE_C_FLAGS_DEBUG MATCHES "${flag}" )
if( NOT CMAKE_C_FLAGS_DEBUG STREQUAL "${flag}" )
set( CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} ${flag} ")
endif()
endforeach()
# Add the release flags
foreach( flag ${ADDITIONAL_C_RELEASE_FLAGS} )
if( NOT CMAKE_C_FLAGS_RELEASE MATCHES "${flag}" )
if( NOT CMAKE_C_FLAGS_RELEASE STREQUAL "${flag}" )
set( CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} ${flag} ")
endif()
endforeach()
# Add the release with debug info flags
foreach( flag ${ADDITIONAL_C_RELWITHDEBINFO_FLAGS} )
if( NOT CMAKE_C_FLAGS_RELWITHDEBINFO MATCHES "${flag}" )
if( NOT CMAKE_C_FLAGS_RELWITHDEBINFO STREQUAL "${flag}" )
set( CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} ${flag} ")
endif()
endforeach()
......
This diff is collapsed.
......@@ -29,9 +29,9 @@ endif()
if (QT5_FOUND)
if (${Qt5Core_VERSION_STRING} VERSION_EQUAL "5.5.1" OR ${Qt5Core_VERSION_STRING} VERSION_GREATER "5.5.1")
SET(ACG_SEARCH_PATH "/ACG/acgdev/gcc-4.9-x86_64/qwt-6.1.2-qt5.6")
SET(ACG_SEARCH_PATH "/ACG/acgdev/gcc-4.9-x86_64/qwt-6.1.2-qt5.7.0")
else()
SET(ACG_SEARCH_PATH "/ACG/acgdev/gcc-4.9-x86_64/qwt-6.1-qt5")
SET(ACG_SEARCH_PATH "/ACG/acgdev/gcc-4.9-x86_64/qwt-6.1-qt5.7.0")
endif()
else()
SET(ACG_SEARCH_PATH "/usr/local/qwt/")
......
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