You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "James E. King III (JIRA)" <ji...@apache.org> on 2019/01/24 15:30:00 UTC

[jira] [Commented] (THRIFT-4394) Incorrect CMake build tree when thrift is added by add_subdirectory

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

James E. King III commented on THRIFT-4394:
-------------------------------------------

Can you submit a pull request for this?

> Incorrect CMake build tree when thrift is added by add_subdirectory
> -------------------------------------------------------------------
>
>                 Key: THRIFT-4394
>                 URL: https://issues.apache.org/jira/browse/THRIFT-4394
>             Project: Thrift
>          Issue Type: Bug
>          Components: C++ - Library
>         Environment: Ubuntu 16.04, CMake 3.1
>            Reporter: Cheng Chen
>            Priority: Major
>
> My project uses thrift as a third-party git submodule, and build it using CMake.  I have a few other third-party submodules, so I added my CMakeLists.txt to build them together, here is my project tree:
> {code:java}
> -myproj
>     -build (where out-of-source build happens)
>     -src
>         -CMakeLists.txt (to build my project sources)
>     -thirdparty
>         -thrift (using branch 0.11.0 as git submodule)
>         -foo (another git submodule)
>         -CMakeLists.txt (to build all third-party components)
> {code}
> To build all third-party components:
> {code:java}
> myproj/build$ cmake ../thirdparty
> sudo make install
> {code}
> From the output of "make install" there is 
> {code:java}
> -- Installing: /usr/local/include/thrift/thrift/config.h
> {code}
> The expected result is "/usr/local/include/thrift/config.h".
> This is because [thrift/lib/cpp/CMakeLists.txt|https://github.com/apache/thrift/blob/0.11.0/lib/cpp/CMakeLists.txt] line 212 uses CMAKE_BINARY_DIR, which your expect is the root binary directory of thrift, but now is changed because I defined a "wrapper" CMakeLists.txt, hence "thrift/thrift/config.h", then compile error occurs. Maybe CMAKE_CURRENT_BINARY_DIR is a better option here?



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