[Cmake] Empty include and library variables

Chris Scharver scharver at evl . uic . edu
Mon, 20 Oct 2003 14:15:50 -0500


At 2:09 PM -0400 10/20/2003, William A. Hoffman wrote:
>A space is a valid name in cmake, (with spaces in paths it has to be....).
>Also, if you refer to a variable that is NOTFOUND or uninitialized in
>a LINK or INCLUDE command cmake will warn that you are using a variable that should
>have been set.

The -NOTFOUND issue was why I tried to initialize them as blank. Your suggestion of using a proxy approach worked perfectly:

OPTION(USE_COIN_EVENTS "Use custom Coin3D event library." OFF)
IF (USE_COIN_EVENTS)
  FIND_PATH( COINEVENTS_INC SbTrackerInfo.h ../coinevents
    DOC "Location for the SbTrackerInfo header.")
  FIND_LIBRARY( COINEVENTS_LIB coinevents ${COINEVENTS_INC})
  SET(COINEVENTS_INCLUDE_DIR ${COINEVENTS_INC} FORCE)
  SET(COINEVENTS_LIBRARY ${COINEVENTS_LIB) FORCE)
ENDIF (USE_COIN_EVENTS)

Works like a charm!

Thanks,
Chris
--
Chris Scharver
Electronic Visualization Laboratory
The University of Illinois at Chicago
Ph: 312-996-3002   FAX: 312-413-7585
<http://www . evl . uic . edu/scharver/>