[ 
https://issues.apache.org/jira/browse/ARROW-4660?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16775600#comment-16775600
 ] 

Kouhei Sutou commented on ARROW-4660:
-------------------------------------

Could you confirm the patch solve this problem on you environment?

{noformat}
diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake 
b/cpp/cmake_modules/ThirdpartyToolchain.cmake
index 726db851..446d717b 100644
--- a/cpp/cmake_modules/ThirdpartyToolchain.cmake
+++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake
@@ -655,7 +655,9 @@ if(ARROW_NEED_GFLAGS)
     ADD_THIRDPARTY_LIB(gflags
       STATIC_LIB ${GFLAGS_STATIC_LIB})
     set(GFLAGS_LIBRARY gflags_static)
-    target_compile_definitions(${GFLAGS_LIBRARY} INTERFACE "GFLAGS_IS_A_DLL=0")
+    set_target_properties(${GFLAGS_LIBRARY}
+      PROPERTIES
+      INTERFACE_COMPILE_DEFINITIONS "GFLAGS_IS_A_DLL=0")
     if(MSVC)
       set_target_properties(${GFLAGS_LIBRARY}
        PROPERTIES
{noformat}

target_compile_definitions for imported target is supported since CMake 3.11:

https://cmake.org/cmake/help/v3.11/release/3.11.html#commands

The target_compile_definitions() command learned to set the 
INTERFACE_COMPILE_DEFINITIONS property on Imported Targets.

> [C++] gflags fails to build due to CMake error
> ----------------------------------------------
>
>                 Key: ARROW-4660
>                 URL: https://issues.apache.org/jira/browse/ARROW-4660
>             Project: Apache Arrow
>          Issue Type: Bug
>          Components: C++
>    Affects Versions: 0.13.0
>            Reporter: Francois Saint-Jacques
>            Assignee: Kouhei Sutou
>            Priority: Major
>
> gflags fails to build as a thirdparty download on linux and cmake 3.10.2. 
> Removing the line `target_compile_definitions(${GFLAGS_LIBRARY} INTERFACE 
> "GFLAGS_IS_A_DLL=0")` makes it build without issue.
> {code}
> CMake Error at cmake_modules/ThirdpartyToolchain.cmake:658 
> (target_compile_definitions):
> Cannot specify compile definitions for imported target "gflags_static".
> Call Stack (most recent call first):
> CMakeLists.txt:506 (include)
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to