OpenImageIO icon indicating copy to clipboard operation
OpenImageIO copied to clipboard

[BUG] fancy_add_executable.cmake does not set DEFINITIONS

Open SebTV opened this issue 5 years ago • 3 comments

When adding a compile-definition to the fancy_add_executable() call like fancy_add_executable ( .... DEFINITIONS -DQT_DLL ) cmake ends with Cannot specify compile definitions for target "PRIVATE" which is not built The reason is maybe a spelling-error:

--- oiio-2.3.7.2/src/cmake/fancy_add_executable.cmake      2021-11-02 17:23:34.539999100 +0100
+++ oiio-2.3.7.2/src/cmake/fancy_add_executable.cmake  2021-11-02 17:23:46.228477800 +0100
@@ -42,7 +42,7 @@
             target_include_directories (${_target_NAME} SYSTEM PRIVATE ${_target_SYSTEM_INCLUDE_DIRS})
         endif ()
         if (_target_DEFINITIONS)
-            target_compile_definitions (${_target_name} PRIVATE ${_target_DEFINITIONS})
+            target_compile_definitions (${_target_NAME} PRIVATE ${_target_DEFINITIONS})
         endif ()
         if (_target_LINK_LIBRARIES)
             target_link_libraries (${_target_NAME} PRIVATE ${_target_LINK_LIBRARIES})

SebTV avatar Nov 02 '21 16:11 SebTV

Yes, that looks correct. I don't suppose you could submit the fix as a PR so I can just push a button to merge it?

lgritz avatar Nov 02 '21 16:11 lgritz

Did a pull-request. I am new to this git-thing, so it might be wrong.

SebTV avatar Nov 03 '21 07:11 SebTV

Looks like you did it right to me.

lgritz avatar Nov 03 '21 07:11 lgritz