CMake: add missing variable initialization

Although CMake uses previously undefined variables like empty strings
it could happen that variables set in the calling context by other
projects initialized some variables with unexpected values.

Example: FLTK_LIBRARIES could have been initialized by previous
  execution of 'find_package(FLTK ...)' in a project using FLTK
This commit is contained in:
Albrecht Schlosser 2022-03-25 15:02:53 +01:00
parent 0ab3ca7cf6
commit 3fb66056d6

View File

@ -37,7 +37,6 @@ set (FLTK_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
include(GNUInstallDirs)
set (FLTK_BINDIR ${CMAKE_INSTALL_BINDIR} CACHE PATH
"Binary install path relative to CMAKE_INSTALL_PREFIX unless set to an absolute path.")
set (FLTK_LIBDIR ${CMAKE_INSTALL_LIBDIR} CACHE PATH
@ -52,6 +51,20 @@ set (FLTK_DOCDIR ${CMAKE_INSTALL_DATADIR}/doc CACHE PATH
"Non-arch doc install path relative to CMAKE_INSTALL_PREFIX unless set to an absolute path.")
#######################################################################
# initialize internally used variables
# some of these variables are used to *append* other values later
#######################################################################
set (FLTK_LDLIBS "")
set (FLTK_LIBRARIES "")
set (GLLIBS "")
set (IMAGELIBS "")
set (LDFLAGS "")
set (LIBS "")
set (LINK_LIBS "")
set (STATICIMAGELIBS "")
#######################################################################
# platform dependent information
#######################################################################