diff options
author | Robert Maynard <rmaynard@nvidia.com> | 2021-09-14 15:08:42 (GMT) |
---|---|---|
committer | Robert Maynard <rmaynard@nvidia.com> | 2021-09-14 15:10:28 (GMT) |
commit | 51fd21736b10e2fa04382c5aa71f2044d31e362f (patch) | |
tree | 28286e0980554a1a5f7b8d474d0d0da11a803e3c /Modules/FindFLTK.cmake | |
parent | 69c0a5daf98958ba6ad4311781ec72fe8b9bfb0a (diff) | |
download | CMake-51fd21736b10e2fa04382c5aa71f2044d31e362f.zip CMake-51fd21736b10e2fa04382c5aa71f2044d31e362f.tar.gz CMake-51fd21736b10e2fa04382c5aa71f2044d31e362f.tar.bz2 |
FindFLTK: Safe to include multiple times
FindFLTK could store multiple entries in `FLTK_INCLUDE_DIR`,
and when re-executed would stored into `FLTK_DIR` which had
uses which presumed single entries.
Fixes #13198
Diffstat (limited to 'Modules/FindFLTK.cmake')
-rw-r--r-- | Modules/FindFLTK.cmake | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/Modules/FindFLTK.cmake b/Modules/FindFLTK.cmake index bab7256..d54d2f6 100644 --- a/Modules/FindFLTK.cmake +++ b/Modules/FindFLTK.cmake @@ -152,13 +152,17 @@ if(NOT FLTK_DIR) endif() # Check if FLTK was built using CMake -if(EXISTS ${FLTK_DIR}/FLTKConfig.cmake) - set(FLTK_BUILT_WITH_CMAKE 1) -endif() +foreach(fltk_include IN LISTS FLTK_DIR) + if(EXISTS "${fltk_include}/FLTKConfig.cmake") + set(FLTK_BUILT_WITH_CMAKE 1) + set(FLTK_CMAKE_PATH "${fltk_include}/FLTKConfig.cmake") + break() + endif() +endforeach() if(FLTK_BUILT_WITH_CMAKE) set(FLTK_FOUND 1) - include(${FLTK_DIR}/FLTKConfig.cmake) + include("${FLTK_CMAKE_PATH}") # Fluid if(FLUID_COMMAND) |