cmake-format: Allow dangling parenthesis

This commit is contained in:
Magne Sjaastad
2021-09-01 08:13:16 +02:00
committed by GitHub
parent 503d946bc1
commit 638f926429
108 changed files with 976 additions and 503 deletions

View File

@@ -52,12 +52,14 @@ set(MOC_HEADER_FILES
cafPdmUniqueIdValidator.h
cafPdmDoubleStringValidator.h
cafPdmUiPickableLineEditor.h
cafPdmUiLabelEditor.h)
cafPdmUiLabelEditor.h
)
find_package(
Qt5
COMPONENTS
REQUIRED Core Gui Widgets)
REQUIRED Core Gui Widgets
)
set(QT_LIBRARIES Qt5::Core Qt5::Gui Qt5::Widgets)
qt5_wrap_cpp(MOC_SOURCE_FILES ${MOC_HEADER_FILES})
@@ -162,14 +164,17 @@ set(PROJECT_FILES
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")
set_target_properties(
${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "/W4 /wd4100 /wd4127"
)
endif()
target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})

View File

@@ -9,28 +9,32 @@ if(CEE_USE_QT5)
find_package(
Qt5
COMPONENTS
REQUIRED Core Gui Widgets)
REQUIRED Core Gui Widgets
)
set(QT_LIBRARIES Qt5::Core Qt5::Gui Qt5::Widgets)
else()
find_package(
Qt4
COMPONENTS QtCore QtGui QtMain
REQUIRED)
REQUIRED
)
include(${QT_USE_FILE})
endif(CEE_USE_QT5)
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
set(PROJECT_FILES cafUserInterface_UnitTests.cpp cafPdmUiTreeViewModelTest.cpp
cafPdmUiTreeSelectionQModelTest.cpp gtest/gtest-all.cpp)
cafPdmUiTreeSelectionQModelTest.cpp gtest/gtest-all.cpp
)
# 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)
@@ -39,7 +43,8 @@ if(Qt5Core_FOUND)
TARGET ${PROJECT_NAME}
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different $<TARGET_FILE:${qtlib}>
$<TARGET_FILE_DIR:${PROJECT_NAME}>)
$<TARGET_FILE_DIR:${PROJECT_NAME}>
)
endforeach(qtlib)
# Copy Qt Dlls
else()
@@ -51,12 +56,14 @@ else()
# Debug
execute_process(
COMMAND cmake -E copy_if_different ${QT_BINARY_DIR}/${qtlib}d4.dll
${CMAKE_BINARY_DIR}/Debug/${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)
${CMAKE_BINARY_DIR}/Release/${qtlib}4.dll
)
endforeach(qtlib)
endif(MSVC)
endif(Qt5Core_FOUND)