sl1pkn07 edited a comment on issue #14692: Fix cmake installation failed (Fix 
#13578)
URL: https://github.com/apache/incubator-mxnet/pull/14692#issuecomment-485555512
 
 
    super ugly quick workground
   
   ~~~
   # Not install dmlc-core docs in /
     sed '/doc/s/^/#/g' \
       -i 3rdparty/dmlc-core/CMakeLists.txt \
       -i 3rdparty/tvm/3rdparty/dmlc-core/CMakeLists.txt
   ~~~
   but this sould be fixed in upstream
   
   see https://github.com/dmlc/dmlc-core/blob/master/CMakeLists.txt#L216
   
   the https://github.com/dmlc/dmlc-core/blob/master/CMakeLists.txt#L215 also 
sould be fixed, but is less problematic because is installed in the "correct" 
path (`$prefix/./include` = `$prefix/include`)
   
   the latest one seems redundant because 
https://github.com/dmlc/dmlc-core/blob/master/CMakeLists.txt#L195-L201, but the 
option `INSTALL_INCLUDE_DIR` seems is not exposed in cmake-gui
   
   in resume:
   
   https://github.com/dmlc/dmlc-core/blob/master/CMakeLists.txt#L216 should be 
configurable by option or use `${CMAKE_INSTALL_DATADIR}` for install in 
`$prefix/shared/doc`
   https://github.com/dmlc/dmlc-core/blob/master/CMakeLists.txt#L215 should be 
remove, move https://github.com/dmlc/dmlc-core/blob/master/CMakeLists.txt#L204 
before https://github.com/dmlc/dmlc-core/blob/master/CMakeLists.txt#L195-L201 
and simplify it like `install(DIRECTORY ${PROJECT_SOURCE_DIR}/include/dmlc 
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})`
   
   ive try to make a PR with this changes in the dmlc-core, but idk when is 
merged/reviewed
   
   greetings
   
   
   something like:
   
   ~~~patch
   diff --git a/CMakeLists.txt b/CMakeLists.txt
   index 91f42fc..84fc0a3 100644
   --- a/CMakeLists.txt
   +++ b/CMakeLists.txt
   @@ -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")
   @@ -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}
   @@ -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)
   ~~~

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to