mirror of
https://github.com/OPM/ResInsight.git
synced 2024-12-28 09:51:44 -06:00
Caf build fixes for CEE_USE_QT5
This commit is contained in:
parent
db97951a80
commit
5365f4dd7d
@ -9,7 +9,9 @@ if (MSVC AND (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 19.11))
|
||||
endif()
|
||||
|
||||
# Qt
|
||||
option(CEE_USE_QT5 "Use Qt5" OFF)
|
||||
if (NOT DEFINED(CEE_USE_QT5))
|
||||
option(CEE_USE_QT5 "Use Qt5" OFF)
|
||||
endif(NOT DEFINED(CEE_USE_QT5))
|
||||
|
||||
if (CEE_USE_QT5)
|
||||
find_package(Qt5 COMPONENTS REQUIRED Core Gui OpenGL Widgets)
|
||||
|
@ -12,8 +12,6 @@ set( MOC_HEADER_FILES
|
||||
cafMessagePanel.h
|
||||
)
|
||||
|
||||
option(CEE_USE_QT5 "Use Qt5" OFF)
|
||||
|
||||
if (CEE_USE_QT5)
|
||||
find_package(Qt5 COMPONENTS REQUIRED Core Gui Widgets OpenGL)
|
||||
set(QT_LIBRARIES Qt5::Core Qt5::Gui Qt5::Widgets Qt5::OpenGL)
|
||||
|
@ -9,8 +9,6 @@ set( MOC_HEADER_FILES
|
||||
cafPopupMenuButton.h
|
||||
)
|
||||
|
||||
option(CEE_USE_QT5 "Use Qt5" OFF)
|
||||
|
||||
if (CEE_USE_QT5)
|
||||
find_package(Qt5 COMPONENTS REQUIRED Core Gui Widgets)
|
||||
set(QT_LIBRARIES Qt5::Core Qt5::Gui Qt5::Widgets)
|
||||
|
@ -10,8 +10,6 @@ set (MOC_HEADER_FILES
|
||||
)
|
||||
|
||||
# Qt
|
||||
option(CEE_USE_QT5 "Use Qt5" OFF)
|
||||
|
||||
if (CEE_USE_QT5)
|
||||
find_package(Qt5 COMPONENTS REQUIRED Core Gui Widgets)
|
||||
set(QT_LIBRARIES Qt5::Core Qt5::Gui Qt5::Widgets)
|
||||
|
@ -3,8 +3,6 @@ cmake_minimum_required (VERSION 2.8.12)
|
||||
project (cafPdmCvf)
|
||||
|
||||
# Qt
|
||||
option(CEE_USE_QT5 "Use Qt5" OFF)
|
||||
|
||||
if (CEE_USE_QT5)
|
||||
find_package(Qt5 COMPONENTS REQUIRED Core Gui Widgets)
|
||||
set(QT_LIBRARIES Qt5::Core Qt5::Gui Qt5::Widgets)
|
||||
|
@ -3,8 +3,6 @@ cmake_minimum_required (VERSION 2.8.12)
|
||||
project (cafProjectDataModel)
|
||||
|
||||
# Qt
|
||||
option(CEE_USE_QT5 "Use Qt5" OFF)
|
||||
|
||||
if (CEE_USE_QT5)
|
||||
find_package(Qt5 COMPONENTS REQUIRED Core Gui Widgets)
|
||||
set(QT_LIBRARIES Qt5::Core Qt5::Gui Qt5::Widgets)
|
||||
|
@ -2,8 +2,6 @@ cmake_minimum_required (VERSION 2.8.12)
|
||||
project (cafPdmCore)
|
||||
|
||||
# Qt
|
||||
option(CEE_USE_QT5 "Use Qt5" OFF)
|
||||
|
||||
if (CEE_USE_QT5)
|
||||
find_package(Qt5 COMPONENTS REQUIRED Core)
|
||||
set(QT_LIBRARIES Qt5::Core)
|
||||
|
@ -2,13 +2,18 @@ cmake_minimum_required (VERSION 2.8.12)
|
||||
|
||||
project ( cafPdmCore_UnitTests )
|
||||
|
||||
find_package(Qt5Core CONFIG QUIET)
|
||||
if (Qt5Core_FOUND)
|
||||
find_package(Qt5 CONFIG REQUIRED Core Gui Widgets)
|
||||
# Qt
|
||||
if (NOT DEFINED(CEE_USE_QT5))
|
||||
option(CEE_USE_QT5 "Use Qt5" OFF)
|
||||
endif(NOT DEFINED(CEE_USE_QT5))
|
||||
|
||||
if (CEE_USE_QT5)
|
||||
find_package(Qt5 COMPONENTS REQUIRED Core Gui Widgets)
|
||||
set(QT_LIBRARIES Qt5::Core Qt5::Widgets Qt5::Gui)
|
||||
else()
|
||||
find_package(Qt4 COMPONENTS QtCore QtGui REQUIRED)
|
||||
include(${QT_USE_FILE})
|
||||
endif(Qt5Core_FOUND)
|
||||
find_package(Qt4 COMPONENTS REQUIRED QtCore QtGui)
|
||||
include(${QT_USE_FILE})
|
||||
endif(CEE_USE_QT5)
|
||||
|
||||
if (MSVC AND (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 19.11))
|
||||
# VS 2017 : Disable warnings from from gtest code, using deprecated code related to TR1
|
||||
@ -57,7 +62,7 @@ target_link_libraries ( ${PROJECT_NAME}
|
||||
)
|
||||
|
||||
# Copy Qt Dlls
|
||||
if (Qt5Core_FOUND)
|
||||
if (CEE_USE_QT5)
|
||||
foreach (qtlib ${QT_LIBRARIES})
|
||||
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different $<TARGET_FILE:${qtlib}> $<TARGET_FILE_DIR:${PROJECT_NAME}>
|
||||
@ -65,16 +70,12 @@ if (Qt5Core_FOUND)
|
||||
endforeach(qtlib)
|
||||
# Copy Qt Dlls
|
||||
else()
|
||||
# Copy Qt Dlls
|
||||
if (MSVC)
|
||||
set (QTLIBLIST QtCore QtGui )
|
||||
set (QTLIBLIST QtCore QtGui)
|
||||
foreach (qtlib ${QTLIBLIST})
|
||||
|
||||
# Debug
|
||||
execute_process(COMMAND cmake -E copy_if_different ${QT_BINARY_DIR}/${qtlib}d4.dll ${CMAKE_BINARY_DIR}/Debug/${qtlib}d4.dll)
|
||||
|
||||
# Release
|
||||
execute_process(COMMAND cmake -E copy_if_different ${QT_BINARY_DIR}/${qtlib}4.dll ${CMAKE_BINARY_DIR}/Release/${qtlib}4.dll)
|
||||
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${QT_BINARY_DIR}/$<IF:$<CONFIG:Debug>,${qtlib}d4.dll,${qtlib}4.dll> $<TARGET_FILE_DIR:${PROJECT_NAME}>
|
||||
)
|
||||
endforeach( qtlib )
|
||||
endif(MSVC)
|
||||
endif(Qt5Core_FOUND)
|
||||
endif(CEE_USE_QT5)
|
@ -11,8 +11,6 @@ set (MOC_HEADER_FILES
|
||||
)
|
||||
|
||||
# Qt
|
||||
option(CEE_USE_QT5 "Use Qt5" OFF)
|
||||
|
||||
if (CEE_USE_QT5)
|
||||
find_package(Qt5 COMPONENTS REQUIRED Core Gui Widgets)
|
||||
set(QT_LIBRARIES Qt5::Core Qt5::Gui Qt5::Widgets)
|
||||
|
@ -3,8 +3,6 @@ cmake_minimum_required (VERSION 2.8.12)
|
||||
project (cafPdmXml)
|
||||
|
||||
# Qt
|
||||
option(CEE_USE_QT5 "Use Qt5" OFF)
|
||||
|
||||
if (CEE_USE_QT5)
|
||||
find_package(Qt5 COMPONENTS REQUIRED Core Xml)
|
||||
set(QT_LIBRARIES Qt5::Core Qt5::Xml)
|
||||
|
@ -2,13 +2,17 @@ cmake_minimum_required (VERSION 2.8.12)
|
||||
|
||||
project ( cafPdmXml_UnitTests )
|
||||
|
||||
find_package(Qt5Core CONFIG QUIET)
|
||||
if (Qt5Core_FOUND)
|
||||
find_package(Qt5 CONFIG REQUIRED Core Xml)
|
||||
if (NOT DEFINED(CEE_USE_QT5))
|
||||
option(CEE_USE_QT5 "Use Qt5" OFF)
|
||||
endif(NOT DEFINED(CEE_USE_QT5))
|
||||
|
||||
if (CEE_USE_QT5)
|
||||
find_package(Qt5 COMPONENTS REQUIRED Core Xml)
|
||||
set(QT_LIBRARIES Qt5::Core Qt5::Xml)
|
||||
else()
|
||||
find_package(Qt4 COMPONENTS QtCore QtXml REQUIRED)
|
||||
include(${QT_USE_FILE})
|
||||
endif(Qt5Core_FOUND)
|
||||
find_package(Qt4 COMPONENTS REQUIRED QtCore QtXml)
|
||||
include(${QT_USE_FILE})
|
||||
endif(CEE_USE_QT5)
|
||||
|
||||
if (MSVC AND (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 19.11))
|
||||
# VS 2017 : Disable warnings from from gtest code, using deprecated code related to TR1
|
||||
@ -49,18 +53,13 @@ if (Qt5Core_FOUND)
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different $<TARGET_FILE:${qtlib}> $<TARGET_FILE_DIR:${PROJECT_NAME}>
|
||||
)
|
||||
endforeach(qtlib)
|
||||
# Copy Qt Dlls
|
||||
else()
|
||||
# Copy Qt Dlls
|
||||
if (MSVC)
|
||||
set (QTLIBLIST QtCore)
|
||||
set (QTLIBLIST QtCore QtXml)
|
||||
foreach (qtlib ${QTLIBLIST})
|
||||
|
||||
# Debug
|
||||
execute_process(COMMAND cmake -E copy_if_different ${QT_BINARY_DIR}/${qtlib}d4.dll ${CMAKE_BINARY_DIR}/Debug/${qtlib}d4.dll)
|
||||
|
||||
# Release
|
||||
execute_process(COMMAND cmake -E copy_if_different ${QT_BINARY_DIR}/${qtlib}4.dll ${CMAKE_BINARY_DIR}/Release/${qtlib}4.dll)
|
||||
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${QT_BINARY_DIR}/$<IF:$<CONFIG:Debug>,${qtlib}d4.dll,${qtlib}4.dll> $<TARGET_FILE_DIR:${PROJECT_NAME}>
|
||||
)
|
||||
endforeach( qtlib )
|
||||
endif(MSVC)
|
||||
endif(Qt5Core_FOUND)
|
@ -3,7 +3,9 @@ cmake_minimum_required (VERSION 2.8.12)
|
||||
project ( cafProjectDataModel_UnitTests )
|
||||
|
||||
# Qt
|
||||
option(CEE_USE_QT5 "Use Qt5" OFF)
|
||||
if (NOT DEFINED(CEE_USE_QT5))
|
||||
option(CEE_USE_QT5 "Use Qt5" OFF)
|
||||
endif(NOT DEFINED(CEE_USE_QT5))
|
||||
|
||||
if (CEE_USE_QT5)
|
||||
find_package(Qt5 COMPONENTS REQUIRED Core Xml Gui)
|
||||
@ -53,18 +55,13 @@ if (CEE_USE_QT5)
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different $<TARGET_FILE:${qtlib}> $<TARGET_FILE_DIR:${PROJECT_NAME}>
|
||||
)
|
||||
endforeach(qtlib)
|
||||
# Copy Qt Dlls
|
||||
else()
|
||||
# Copy Qt Dlls
|
||||
if (MSVC)
|
||||
set (QTLIBLIST QtCore QtXml)
|
||||
foreach (qtlib ${QTLIBLIST})
|
||||
|
||||
# Debug
|
||||
execute_process(COMMAND cmake -E copy_if_different ${QT_BINARY_DIR}/${qtlib}d4.dll ${CMAKE_BINARY_DIR}/Debug/${qtlib}d4.dll)
|
||||
|
||||
# Release
|
||||
execute_process(COMMAND cmake -E copy_if_different ${QT_BINARY_DIR}/${qtlib}4.dll ${CMAKE_BINARY_DIR}/Release/${qtlib}4.dll)
|
||||
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${QT_BINARY_DIR}/$<IF:$<CONFIG:Debug>,${qtlib}d4.dll,${qtlib}4.dll> $<TARGET_FILE_DIR:${PROJECT_NAME}>
|
||||
)
|
||||
endforeach( qtlib )
|
||||
endif(MSVC)
|
||||
endif(CEE_USE_QT5)
|
@ -20,7 +20,9 @@ set( QRC_FILES
|
||||
textedit.qrc
|
||||
)
|
||||
|
||||
option(CEE_USE_QT5 "Use Qt5" OFF)
|
||||
if (NOT DEFINED(CEE_USE_QT5))
|
||||
option(CEE_USE_QT5 "Use Qt5" OFF)
|
||||
endif(NOT DEFINED(CEE_USE_QT5))
|
||||
|
||||
if (CEE_USE_QT5)
|
||||
find_package(Qt5 COMPONENTS REQUIRED Core Gui Widgets OpenGL)
|
||||
@ -66,10 +68,6 @@ add_executable ( ${PROJECT_NAME}
|
||||
${QRC_FILES_CPP}
|
||||
)
|
||||
|
||||
if (Qt5Core_FOUND)
|
||||
set(QT_LIBRARIES Qt5::Core Qt5::Gui Qt5::OpenGL Qt5::Widgets)
|
||||
endif()
|
||||
|
||||
set (TAP_LINK_LIBRARIES
|
||||
cafUserInterface
|
||||
)
|
||||
|
@ -46,8 +46,6 @@ set (MOC_HEADER_FILES
|
||||
cafPdmUiPickableLineEditor.h
|
||||
)
|
||||
|
||||
option(CEE_USE_QT5 "Use Qt5" OFF)
|
||||
|
||||
if (CEE_USE_QT5)
|
||||
find_package(Qt5 COMPONENTS REQUIRED Core Gui Widgets)
|
||||
set(QT_LIBRARIES Qt5::Core Qt5::Gui Qt5::Widgets)
|
||||
|
@ -9,8 +9,6 @@ set( MOC_HEADER_FILES
|
||||
cafViewer.h
|
||||
)
|
||||
|
||||
option(CEE_USE_QT5 "Use Qt5" OFF)
|
||||
|
||||
if (CEE_USE_QT5)
|
||||
find_package(Qt5 COMPONENTS REQUIRED Core Gui Widgets OpenGL)
|
||||
set(QT_LIBRARIES Qt5::Core Qt5::Gui Qt5::Widgets Qt5::OpenGL)
|
||||
|
@ -6,8 +6,6 @@ project (cafVizExtensions)
|
||||
find_package( OpenGL )
|
||||
|
||||
# Qt
|
||||
option(CEE_USE_QT5 "Use Qt5" OFF)
|
||||
|
||||
if (CEE_USE_QT5)
|
||||
find_package(Qt5 COMPONENTS REQUIRED Core Gui Widgets OpenGL)
|
||||
set(QT_LIBRARIES Qt5::Core Qt5::Gui Qt5::Widgets Qt5::OpenGL)
|
||||
|
@ -2,13 +2,15 @@ cmake_minimum_required (VERSION 2.8.12)
|
||||
|
||||
project (TestCafAndVizFwk)
|
||||
|
||||
find_package(Qt5 CONFIG COMPONENTS Core)
|
||||
if (Qt5Core_FOUND)
|
||||
find_package(Qt5 CONFIG REQUIRED Core Gui OpenGL Widgets)
|
||||
option(CEE_USE_QT5 "Use Qt5" OFF)
|
||||
|
||||
if (CEE_USE_QT5)
|
||||
find_package(Qt5 COMPONENTS REQUIRED Core Gui OpenGL Widgets)
|
||||
set(QT_LIBRARIES Qt5::Core Qt5::Gui Qt5::OpenGL Qt5::Widgets)
|
||||
else()
|
||||
find_package(Qt4 COMPONENTS QtCore QtGui QtMain QtOpenGL REQUIRED)
|
||||
find_package(Qt4 COMPONENTS QtCore QtGui QtMain QtOpenGl REQUIRED)
|
||||
include(${QT_USE_FILE})
|
||||
endif(Qt5Core_FOUND)
|
||||
endif(CEE_USE_QT5)
|
||||
|
||||
# Libraries
|
||||
add_subdirectory(AppFwk/cafProjectDataModel/cafPdmCore)
|
||||
|
Loading…
Reference in New Issue
Block a user