Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix installation paths and refactor #528

Merged
merged 1 commit into from
May 2, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 8 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ dmlccore_option(USE_S3 "Build with S3 support" OFF)
dmlccore_option(USE_OPENMP "Build with OpenMP" ON)
dmlccore_option(USE_CXX14_IF_AVAILABLE "Build with C++14 if the compiler supports it" OFF)
dmlccore_option(GOOGLE_TEST "Build google tests" OFF)
dmlccore_option(INSTALL_DOCUMENTATION "Install documentation" OFF)

# include path
set(INCLUDE_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/include")
Expand Down Expand Up @@ -192,16 +193,12 @@ target_include_directories(dmlc PUBLIC
target_compile_definitions(dmlc PRIVATE -D_XOPEN_SOURCE=700
-D_POSIX_SOURCE -D_POSIX_C_SOURCE=200809L -D_DARWIN_C_SOURCE)

include(GNUInstallDirs)
# ---[ 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(DIRECTORY ${PROJECT_SOURCE_DIR}/include/dmlc
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})

# ---[ Install the archive static lib and header files
include(GNUInstallDirs)
install(TARGETS dmlc
EXPORT DMLCTargets
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
Expand All @@ -212,8 +209,10 @@ install(EXPORT DMLCTargets
EXPORT_LINK_INTERFACE_LIBRARIES
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/dmlc)

install(DIRECTORY include DESTINATION .)
install(DIRECTORY doc DESTINATION .)
# ---[ Install documentation
if(INSTALL_DOCUMENTATION)
install(DIRECTORY doc DESTINATION ${CMAKE_INSTALL_DATADIR})
endif()

# ---[ Package configurations
include(CMakePackageConfigHelpers)
Expand Down