Skip to content

Commit

Permalink
Add Treelite_BINARY_DIR include to cuml++ build interface include p…
Browse files Browse the repository at this point in the history
…aths (#4018)

This PR fixes an issue causing cuML source builds to fail when CPM adds Treelite.

Treelite's generated include path isn't in their `INTERFACE_INCLUDE_DIRECTORIES`, so this path isn't added to the `cuml++` target's include dirs either. The fix is to add Treelite's generated include path to the `cuml++` target.

```shell
In file included from _deps/cuml-src/cpp/src/decisiontree/decisiontree_impl.cuh:20,
                 from _deps/cuml-src/cpp/src/decisiontree/decisiontree.cu:22:
_deps/treelite-src/include/treelite/tree.h:11:10: fatal error: treelite/version.h: No such file or directory
   11 | #include <treelite/version.h>
```

Authors:
  - Paul Taylor (https://github.com/trxcllnt)

Approvers:
  - Dante Gama Dessavre (https://github.com/dantegd)

URL: #4018
  • Loading branch information
trxcllnt authored Jul 1, 2021
1 parent 0744a2f commit 56d0794
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,7 @@ if(BUILD_CUML_CPP_LIBRARY)
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<BUILD_INTERFACE:$<$<BOOL:${ENABLE_CUMLPRIMS_MG}>:${cumlprims_mg_INCLUDE_DIRS}>>
$<BUILD_INTERFACE:$<$<BOOL:Treelite_ADDED>:${Treelite_BINARY_DIR}/include>>
$<$<BOOL:Treelite_ADDED>:${Treelite_SOURCE_DIR}/include>
PRIVATE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src>
Expand Down

0 comments on commit 56d0794

Please sign in to comment.