mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Fixes by cmake-format (#6874)
This commit is contained in:
committed by
GitHub
parent
787dae4044
commit
223fe756fe
@@ -1,27 +1,27 @@
|
||||
cmake_minimum_required (VERSION 3.12)
|
||||
cmake_minimum_required(VERSION 3.12)
|
||||
|
||||
project (cafUserInterface)
|
||||
project(cafUserInterface)
|
||||
|
||||
# Unity Build
|
||||
if (CAF_ENABLE_UNITY_BUILD)
|
||||
if(CAF_ENABLE_UNITY_BUILD)
|
||||
message("Cmake Unity build is enabled on : ${PROJECT_NAME}")
|
||||
set(CMAKE_UNITY_BUILD true)
|
||||
endif()
|
||||
|
||||
if (MSVC)
|
||||
# Define this one to tell windows.h to not define min() and max() as macros
|
||||
add_definitions(-DNOMINMAX)
|
||||
endif (MSVC)
|
||||
if(MSVC)
|
||||
# Define this one to tell windows.h to not define min() and max() as macros
|
||||
add_definitions(-DNOMINMAX)
|
||||
endif(MSVC)
|
||||
|
||||
# These headers need to go through Qt's MOC compiler
|
||||
set (MOC_HEADER_FILES
|
||||
set(MOC_HEADER_FILES
|
||||
cafPdmUiCheckBoxDelegate.h
|
||||
cafPdmUiCheckBoxEditor.h
|
||||
cafPdmUiCheckBoxTristateEditor.h
|
||||
cafPdmUiColorEditor.h
|
||||
cafPdmUiComboBoxEditor.h
|
||||
cafPdmUiDateEditor.h
|
||||
cafPdmUiTimeEditor.h
|
||||
cafPdmUiTimeEditor.h
|
||||
cafPdmUiDefaultObjectEditor.h
|
||||
cafPdmUiDoubleSliderEditor.h
|
||||
cafPdmUiFilePathEditor.h
|
||||
@@ -44,7 +44,7 @@ set (MOC_HEADER_FILES
|
||||
cafPdmUiTreeViewEditor.h
|
||||
cafUiProcess.h
|
||||
QMinimizePanel.h
|
||||
cafQStyledProgressBar.h
|
||||
cafQStyledProgressBar.h
|
||||
cafPdmUiTreeSelectionEditor.h
|
||||
cafPdmUiTreeSelectionQModel.h
|
||||
cafPdmUiFormLayoutObjectEditor.h
|
||||
@@ -52,15 +52,16 @@ set (MOC_HEADER_FILES
|
||||
cafPdmUniqueIdValidator.h
|
||||
cafPdmDoubleStringValidator.h
|
||||
cafPdmUiPickableLineEditor.h
|
||||
cafPdmUiLabelEditor.h
|
||||
)
|
||||
cafPdmUiLabelEditor.h)
|
||||
|
||||
find_package(Qt5 COMPONENTS REQUIRED Core Gui Widgets)
|
||||
find_package(
|
||||
Qt5
|
||||
COMPONENTS
|
||||
REQUIRED Core Gui Widgets)
|
||||
set(QT_LIBRARIES Qt5::Core Qt5::Gui Qt5::Widgets)
|
||||
qt5_wrap_cpp(MOC_SOURCE_FILES ${MOC_HEADER_FILES} )
|
||||
qt5_wrap_cpp(MOC_SOURCE_FILES ${MOC_HEADER_FILES})
|
||||
|
||||
set( PROJECT_FILES
|
||||
|
||||
set(PROJECT_FILES
|
||||
# field editors
|
||||
cafPdmUiCheckBoxDelegate.cpp
|
||||
cafPdmUiCheckBoxDelegate.h
|
||||
@@ -74,8 +75,8 @@ set( PROJECT_FILES
|
||||
cafPdmUiComboBoxEditor.h
|
||||
cafPdmUiDateEditor.cpp
|
||||
cafPdmUiDateEditor.h
|
||||
cafPdmUiTimeEditor.cpp
|
||||
cafPdmUiTimeEditor.h
|
||||
cafPdmUiTimeEditor.cpp
|
||||
cafPdmUiTimeEditor.h
|
||||
cafPdmUiDoubleSliderEditor.cpp
|
||||
cafPdmUiDoubleSliderEditor.h
|
||||
cafPdmUiDragDropInterface.h
|
||||
@@ -104,8 +105,6 @@ set( PROJECT_FILES
|
||||
cafPdmUiFieldEditorHelper.h
|
||||
cafPdmUiFieldEditorHelper.cpp
|
||||
cafPdmUiLabelEditor.cpp
|
||||
|
||||
|
||||
# object editors
|
||||
cafPdmUiDefaultObjectEditor.cpp
|
||||
cafPdmUiDefaultObjectEditor.h
|
||||
@@ -141,8 +140,6 @@ set( PROJECT_FILES
|
||||
cafPdmUiFormLayoutObjectEditor.h
|
||||
cafPdmUiDoubleValueEditor.cpp
|
||||
cafPdmUiDoubleValueEditor.h
|
||||
|
||||
|
||||
# div
|
||||
cafAboutDialog.cpp
|
||||
cafAboutDialog.h
|
||||
@@ -152,8 +149,8 @@ set( PROJECT_FILES
|
||||
cafUiProcess.h
|
||||
QMinimizePanel.cpp
|
||||
QMinimizePanel.h
|
||||
cafQStyledProgressBar.cpp
|
||||
cafQStyledProgressBar.h
|
||||
cafQStyledProgressBar.cpp
|
||||
cafQStyledProgressBar.h
|
||||
cafQTreeViewStateSerializer.h
|
||||
cafQTreeViewStateSerializer.cpp
|
||||
cafMemoryInspector.h
|
||||
@@ -162,30 +159,21 @@ set( PROJECT_FILES
|
||||
cafPdmDoubleStringValidator.cpp
|
||||
cafPickEventHandler.h
|
||||
cafPdmUiPickableLineEditor.cpp
|
||||
cafStyleSheetTools.h
|
||||
cafStyleSheetTools.cpp
|
||||
cafStyleSheetTools.h
|
||||
cafStyleSheetTools.cpp
|
||||
cafPdmUiTabbedPropertyViewDialog.h
|
||||
cafPdmUiTabbedPropertyViewDialog.cpp
|
||||
)
|
||||
cafPdmUiTabbedPropertyViewDialog.cpp)
|
||||
|
||||
add_library( ${PROJECT_NAME}
|
||||
${PROJECT_FILES}
|
||||
${MOC_SOURCE_FILES}
|
||||
${QRC_FILES_CPP}
|
||||
)
|
||||
add_library(${PROJECT_NAME} ${PROJECT_FILES} ${MOC_SOURCE_FILES}
|
||||
${QRC_FILES_CPP})
|
||||
|
||||
if (MSVC)
|
||||
set_target_properties(${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "/W4 /wd4100 /wd4127")
|
||||
endif()
|
||||
if(MSVC)
|
||||
set_target_properties(${PROJECT_NAME} PROPERTIES COMPILE_FLAGS
|
||||
"/W4 /wd4100 /wd4127")
|
||||
endif()
|
||||
|
||||
target_include_directories(${PROJECT_NAME}
|
||||
PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
)
|
||||
target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
||||
target_link_libraries ( ${PROJECT_NAME}
|
||||
cafProjectDataModel
|
||||
${QT_LIBRARIES}
|
||||
)
|
||||
target_link_libraries(${PROJECT_NAME} cafProjectDataModel ${QT_LIBRARIES})
|
||||
|
||||
source_group("" FILES ${PROJECT_FILES})
|
||||
|
||||
@@ -1,64 +1,62 @@
|
||||
cmake_minimum_required (VERSION 2.8.12)
|
||||
cmake_minimum_required(VERSION 2.8.12)
|
||||
|
||||
project ( cafUserInterface_UnitTests )
|
||||
project(cafUserInterface_UnitTests)
|
||||
|
||||
# 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)
|
||||
if(CEE_USE_QT5)
|
||||
find_package(
|
||||
Qt5
|
||||
COMPONENTS
|
||||
REQUIRED Core Gui Widgets)
|
||||
set(QT_LIBRARIES Qt5::Core Qt5::Gui Qt5::Widgets)
|
||||
else()
|
||||
find_package(Qt4 COMPONENTS QtCore QtGui QtMain REQUIRED)
|
||||
include(${QT_USE_FILE})
|
||||
find_package(
|
||||
Qt4
|
||||
COMPONENTS QtCore QtGui QtMain
|
||||
REQUIRED)
|
||||
include(${QT_USE_FILE})
|
||||
endif(CEE_USE_QT5)
|
||||
|
||||
include_directories (
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
)
|
||||
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
||||
set( PROJECT_FILES
|
||||
set(PROJECT_FILES cafUserInterface_UnitTests.cpp cafPdmUiTreeViewModelTest.cpp
|
||||
cafPdmUiTreeSelectionQModelTest.cpp gtest/gtest-all.cpp)
|
||||
|
||||
cafUserInterface_UnitTests.cpp
|
||||
|
||||
cafPdmUiTreeViewModelTest.cpp
|
||||
cafPdmUiTreeSelectionQModelTest.cpp
|
||||
|
||||
gtest/gtest-all.cpp
|
||||
)
|
||||
|
||||
# add the executable
|
||||
add_executable (${PROJECT_NAME}
|
||||
${PROJECT_FILES}
|
||||
)
|
||||
# add the executable
|
||||
add_executable(${PROJECT_NAME} ${PROJECT_FILES})
|
||||
|
||||
source_group("" FILES ${PROJECT_FILES})
|
||||
|
||||
target_link_libraries ( ${PROJECT_NAME}
|
||||
cafUserInterface
|
||||
${QT_LIBRARIES}
|
||||
${THREAD_LIBRARY}
|
||||
)
|
||||
target_link_libraries(${PROJECT_NAME} cafUserInterface ${QT_LIBRARIES}
|
||||
${THREAD_LIBRARY})
|
||||
|
||||
# Copy Qt Dlls
|
||||
if (Qt5Core_FOUND)
|
||||
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}>
|
||||
)
|
||||
endforeach(qtlib)
|
||||
# Copy Qt Dlls
|
||||
if(Qt5Core_FOUND)
|
||||
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}>)
|
||||
endforeach(qtlib)
|
||||
# Copy Qt Dlls
|
||||
else()
|
||||
# Copy Qt Dlls
|
||||
if (MSVC)
|
||||
set (QTLIBLIST QtCore QtGui QtOpenGl )
|
||||
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)
|
||||
endforeach( qtlib )
|
||||
endif(MSVC)
|
||||
# Copy Qt Dlls
|
||||
if(MSVC)
|
||||
set(QTLIBLIST QtCore QtGui QtOpenGl)
|
||||
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)
|
||||
endforeach(qtlib)
|
||||
endif(MSVC)
|
||||
endif(Qt5Core_FOUND)
|
||||
|
||||
Reference in New Issue
Block a user