2

I'm hardcoding a library path before hand and want to set the path to NOTFOUND manually if the file doesn't exist.

set(MY_LIB "path that doesn't exist")
if(NOT EXISTS "${MY_LIB}")
 message("not found")
 // set it back to NOTFOUND ??
endif()
if (MY_LIB)
 // set flags
endif()
puio
  • 1,208
  • 6
  • 19

1 Answers1

2

How to manually set a CMake path variable to NOTFOUND?

Just set it to the string:

set(MY_LIB "NOTFOUND")
KamilCuk
  • 120,984
  • 8
  • 59
  • 111