-
Notifications
You must be signed in to change notification settings - Fork 648
Description
In PR #4556 the option COMPILE_OPTIONS was added to the macro add_oiio_plugin which adds these to the plugin with target_compile_options. The reason for this was to pass the variable LibRaw_DEFINITIONS to the compiler. Unfortunately a mistake was made, because in FindLibRaw.cmake lines 99 and 100 this variable is used as a list for definitions as the name suggests.
| set (LibRaw_r_DEFINITIONS ${LibRaw_r_DEFINITIONS} LIBRAW_NODLL) |
The original code in the CMakeLists.txt of the raw plugin DEFINITIONS "USE_LIBRAW=1" ${LibRaw_r_DEFINITIONS} was therefore correct. The new variant COMPILE_OPTIONS ${LibRaw_r_DEFINITIONS} DEFINITIONS "USE_LIBRAW=1" treats the list of definitions as compiler flags, which does not work. LIBRAW_NODLL is not a valid compiler argument, so an attempt is made to compile the file LIBRAW_NODLL. As this file does not exist, an error occurs.
It is easy to fix by adding -D to lines 99 and 100 of FindLibRaw.cmake:
set (LibRaw_r_DEFINITIONS ${LibRaw_r_DEFINITIONS} -D LIBRAW_NODLL)
set (LibRaw_DEFINITIONS ${LibRaw_DEFINITIONS} -D LIBRAW_NODLL)