Skip to content

Commit

Permalink
Fix previous commit, KDChart_FOUND is used in many other places
Browse files Browse the repository at this point in the history
  • Loading branch information
dfaure-kdab committed Dec 13, 2023
1 parent f410a57 commit b3d1738
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -142,21 +142,22 @@ else()
endif()
include(KDQtInstallPaths) #to set QT_INSTALL_FOO variables

set(KDChartPackageName KDChart${${PROJECT_NAME}_LIBRARY_QTID})
# look for KDChart
if(TARGET KDChart::kdchart)
# already defined => it's probably in another gitsubmodule in the same overall cmake project
set(${KDChartPackageName}_FOUND TRUE)
set(KDChart_FOUND TRUE)
else()
set(KDChartPackageName KDChart${${PROJECT_NAME}_LIBRARY_QTID})
find_package(${KDChartPackageName} CONFIG)
set(KDChart_FOUND ${${KDChartPackageName}_FOUND})
endif()
# First try the cmake file provided by kdchart, ideal solution
if(NOT ${PROJECT_NAME}_QT6)
if(NOT KDChart_FOUND)
find_package(KDChart MODULE) # use FindKDChart.cmake in case kdchart was built with qmake
endif()
endif()
if(${KDChartPackageName}_FOUND)
if(KDChart_FOUND)
message(STATUS "Enabling KDChart support")
add_definitions(-DHAVE_KDCHART)
if(NOT TARGET KDChart::kdchart)
Expand Down

0 comments on commit b3d1738

Please sign in to comment.