Skip to content

Commit

Permalink
Use GNUInstallDirs for standard conforming install target.
Browse files Browse the repository at this point in the history
  • Loading branch information
de-vri-es authored and rmensing committed May 26, 2017
1 parent d100d0f commit 536ba11
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -121,18 +121,14 @@ endif()
add_library(dmlc ${SOURCE})
target_link_libraries(dmlc ${dmlccore_LINKER_LIBS})

# ---[ Install Includes
if(INSTALL_INCLUDE_DIR)
add_custom_command(TARGET dmlc POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory
${PROJECT_SOURCE_DIR}/include ${INSTALL_INCLUDE_DIR}/
)
endif()

# ---[ Install the archive static lib and header files
install(TARGETS dmlc ARCHIVE DESTINATION lib)
install(DIRECTORY include DESTINATION .)
install(DIRECTORY doc DESTINATION .)
include(GNUInstallDirs)
install(TARGETS dmlc
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
)
install(DIRECTORY include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
install(DIRECTORY doc/ DESTINATION ${CMAKE_INSTALL_DATADIR}/doc/${PROJECT_NAME})

# ---[ Linter target
if(MSVC)
Expand Down

0 comments on commit 536ba11

Please sign in to comment.