mirror of
https://github.com/OPM/ResInsight.git
synced 2026-11-03 12:50:52 -06:00
Fixes by cmake-format (#6874)
This commit is contained in:
1 parent
787dae4044
commit
223fe756fe
33 files changed
+1870
-2069
No files matched your search
@@ -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