Skip to content

Commit

Permalink
Add install target.
Browse files Browse the repository at this point in the history
* Export `dmlc` in CMake.
* Use GNUInstallDir instead.
  • Loading branch information
trivialfis committed Jan 4, 2019
1 parent d1e2846 commit fb33e45
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ list(APPEND CMAKE_MODULE_PATH ${CMAKE_LOCAL}/Modules)

include(CheckCXXSymbolExists)
include(cmake/Utils.cmake)
#include(cmake/dmlccore.cmake)

# Options
dmlccore_option(USE_HDFS "Build with HDFS support" OFF)
Expand Down Expand Up @@ -199,7 +198,17 @@ if(INSTALL_INCLUDE_DIR)
endif()

# ---[ Install the archive static lib and header files
install(TARGETS dmlc ARCHIVE DESTINATION lib${LIB_SUFFIX} LIBRARY DESTINATION lib${LIB_SUFFIX})
include(GNUInstallDirs)
install(TARGETS dmlc
EXPORT DMLCTargets
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
install(EXPORT DMLCTargets
FILE DMLCTargets.cmake
NAMESPACE dmlc::
EXPORT_LINK_INTERFACE_LIBRARIES
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/dmlc)

install(DIRECTORY include DESTINATION .)
install(DIRECTORY doc DESTINATION .)

Expand All @@ -216,4 +225,3 @@ if(GOOGLE_TEST)
include(CTest)
add_subdirectory(test/unittest)
endif()

0 comments on commit fb33e45

Please sign in to comment.