diff --git a/cmake/CC_FindQt.cmake b/cmake/CC_FindQt.cmake index 02a492c..9437bd2 100644 --- a/cmake/CC_FindQt.cmake +++ b/cmake/CC_FindQt.cmake @@ -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) diff --git a/lib/src/CMakeLists.txt b/lib/src/CMakeLists.txt index efef428..8f83360 100644 --- a/lib/src/CMakeLists.txt +++ b/lib/src/CMakeLists.txt @@ -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 $