format cmake files

This commit is contained in:
Andrej730
2025-12-20 13:27:35 +05:00
parent b686c19a25
commit d41985f23a
24 changed files with 441 additions and 393 deletions
+19 -18
View File
@@ -21,7 +21,15 @@ message("Running CMakeLists.txt in /src/qtviewer")
# Specify the Qt version and components to use
set(QT_VERSION 6 CACHE STRING "Qt version")
set(QT_COMPONENTS Core Gui OpenGL OpenGLWidgets Widgets CACHE STRING "Qt components")
set(QT_COMPONENTS
Core
Gui
OpenGL
OpenGLWidgets
Widgets
CACHE STRING
"Qt components"
)
find_package(Qt${QT_VERSION} COMPONENTS ${QT_COMPONENTS} REQUIRED PATHS ${QT_DIR})
@@ -45,10 +53,7 @@ set(targetName "QtViewer")
# Scan for .qrc files and add to build process
set(CMAKE_AUTORCC ON)
set(RESOURCE_FILES
resources/qt_resources.qrc
resources/qt_res.rc
)
set(RESOURCE_FILES resources/qt_resources.qrc resources/qt_res.rc)
# The MACOSX_BUNDLE_ICON_FILE variable is added to the Info.plist
# generated by CMake. This variable contains the .icns file name,
@@ -57,10 +62,10 @@ set(MACOSX_BUNDLE_ICON_FILE ifcosLogo.icns)
# The following tells CMake where to find and install the file itself.
set(app_icon_macos "resources/ifcosLogo.icns")
set_source_files_properties(${app_icon_macos} PROPERTIES
MACOSX_PACKAGE_LOCATION "Resources")
set_source_files_properties(${app_icon_macos} PROPERTIES MACOSX_PACKAGE_LOCATION "Resources")
add_executable(${targetName}
add_executable(
${targetName}
MessageLogger.h
IfcViewerWidget.h
IfcViewerWidget.cpp
@@ -73,14 +78,13 @@ add_executable(${targetName}
${app_icon_macos}
)
set_target_properties(${targetName} PROPERTIES
AUTOMOC On
WIN32_EXECUTABLE ON
MACOSX_BUNDLE ON
RESOURCE "${RESOURCE_FILES}"
set_target_properties(
${targetName}
PROPERTIES AUTOMOC On WIN32_EXECUTABLE ON MACOSX_BUNDLE ON RESOURCE "${RESOURCE_FILES}"
)
target_link_libraries(${targetName}
target_link_libraries(
${targetName}
${IFCOPENSHELL_LIBRARIES}
${OpenCASCADE_LIBRARIES}
${OPENSCENEGRAPH_LIBRARIES}
@@ -91,10 +95,7 @@ target_link_libraries(${targetName}
Qt${QT_VERSION}::Widgets
)
target_include_directories(${targetName} PUBLIC
${QT_DIR}/include
${OPENSCENEGRAPH_INCLUDE_DIRS}
)
target_include_directories(${targetName} PUBLIC ${QT_DIR}/include ${OPENSCENEGRAPH_INCLUDE_DIRS})
get_target_property(targetIncludeDirs ${targetName} INCLUDE_DIRECTORIES)
message(STATUS "target_include_directories: ${targetIncludeDirs}")