fornwall commented on code in PR #4471:
URL: https://github.com/apache/arrow-adbc/pull/4471#discussion_r3543367618


##########
c/driver/sqlite/CMakeLists.txt:
##########
@@ -27,17 +27,28 @@ else()
   # vcpkg
   find_package(unofficial-sqlite3 CONFIG REQUIRED)
   set(SQLite3_LINK_LIBRARIES unofficial::sqlite3::sqlite3)
-  set(SQLite3_INCLUDE_DIRS)
+  get_target_property(SQLite3_INCLUDE_DIRS unofficial::sqlite3::sqlite3
+                      INTERFACE_INCLUDE_DIRECTORIES)
+  if(NOT SQLite3_INCLUDE_DIRS)
+    set(SQLite3_INCLUDE_DIRS)
+  endif()

Review Comment:
   Yes! We're using:
   
   ```cmake
     get_target_property(SQLite3_INCLUDE_DIRS unofficial::sqlite3::sqlite3
                         INTERFACE_INCLUDE_DIRECTORIES)
   ```
   
   See 
[get_target_property](https://cmake.org/cmake/help/latest/command/get_target_property.html):
   
   > If the target property is not found, <variable> will be set to 
<variable>-NOTFOUND
   
   So `SQLite3_INCLUDE_DIRS` might be set to `SQLite3_INCLUDE_DIRS-NOTFOUND` if 
the include dir cannot be found.
   
   This evalues to false in the if check (see [cmake 
if](https://cmake.org/cmake/help/latest/command/if.html#basic-expressions) - 
`False if the constant is 0, OFF, NO, FALSE, N, IGNORE, NOTFOUND, the empty 
string, or ends in the suffix -NOTFOUND`), so if the value is the `-NOTFOUND` 
sentinel we replace it with an empty string, instead of letting the phony value 
propagate as a path later down in the file.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to