Skip to content

Commit

Permalink
CMake: Enable installation of cpp-package headers (apache#13339)
Browse files Browse the repository at this point in the history
* Allow CMake based installation of cpp-package

* Add installation of missing nnvm headers

* Add documentation as to where public headers will be installed
  • Loading branch information
MoritzMaxeiner authored and haohuw committed Jun 23, 2019
1 parent 146ad33 commit 9380ffe
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -732,7 +732,12 @@ install(TARGETS ${MXNET_INSTALL_TARGETS}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
)

# NOTE: Public headers will be installed into ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}, see
# https://cmake.org/cmake/help/v3.0/variable/CMAKE_INSTALL_PREFIX.html
# https://cmake.org/cmake/help/v3.0/module/GNUInstallDirs.html

install(DIRECTORY include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
install(DIRECTORY 3rdparty/tvm/nnvm/include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
if (INSTALL_EXAMPLES)
install(DIRECTORY example DESTINATION ${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME})
endif()
Expand Down
2 changes: 2 additions & 0 deletions cpp-package/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,6 @@ if(USE_CPP_PACKAGE)
add_subdirectory(example)
endif()

install(DIRECTORY include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})

endif()

0 comments on commit 9380ffe

Please sign in to comment.