Skip to content

Commit

Permalink
Not requiring Widgets for the library.
Browse files Browse the repository at this point in the history
  • Loading branch information
arobenko committed Nov 4, 2024
1 parent f7950ac commit e198225
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion cmake/CC_FindQt.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
macro (cc_find_qt_major)
find_package(Qt${CC_TOOLS_QT_MAJOR_QT_VERSION} REQUIRED COMPONENTS Core Widgets)
set (qt_components Core)
if (CC_TOOLS_QT_BUILD_APPS)
list (APPEND qt_components Widgets)
endif ()

find_package(Qt${CC_TOOLS_QT_MAJOR_QT_VERSION} REQUIRED COMPONENTS ${qt_components})
message (STATUS "Using Qt${CC_TOOLS_QT_MAJOR_QT_VERSION}")

if (NOT TARGET Qt::Core)
Expand Down
2 changes: 1 addition & 1 deletion lib/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ function (lib_tools)
add_library(${name} SHARED ${src})
add_library (cc::${PROJECT_NAME} ALIAS ${name})

target_link_libraries(${name} PUBLIC cc::comms Qt::Widgets Qt::Core ${CC_PLATFORM_SPECIFIC})
target_link_libraries(${name} PUBLIC cc::comms Qt::Core ${CC_PLATFORM_SPECIFIC})
target_include_directories(${name} BEFORE
PRIVATE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
Expand Down

0 comments on commit e198225

Please sign in to comment.