From 2994d96f3a58b732ef97dd4f3666e6d2dc5b9ba7 Mon Sep 17 00:00:00 2001 From: Peter Date: Wed, 25 Sep 2019 15:08:49 +0200 Subject: [PATCH 1/3] =?UTF-8?q?[FIX]=20Build=20process=20shouldn=E2=80=99t?= =?UTF-8?q?=20modify=20source=20tree?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 - CMakeLists.txt | 12 +++++------- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index 707d9ff8d5..124d39604b 100644 --- a/.gitignore +++ b/.gitignore @@ -46,4 +46,3 @@ build # CLion .idea cmake-build-* -/include/dmlc/build_config.h diff --git a/CMakeLists.txt b/CMakeLists.txt index ab5831772e..0b53dd5942 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -26,11 +26,6 @@ set(DMLC_ENABLED_SANITIZERS "address" "leak" CACHE STRING "Semicolon separated list of sanitizer names. E.g 'address;leak'. Supported sanitizers are address, leak and thread.") -# include path -set(INCLUDE_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/include") -set(INCLUDE_DMLC_DIR "${INCLUDE_ROOT}/dmlc") -# include_directories("${INCLUDE_ROOT}") - set(dmlccore_LINKER_LIBS "") # Sanitizer @@ -115,8 +110,8 @@ else() set(DMLC_CMAKE_LITTLE_ENDIAN 1) endif() -message(STATUS "${CMAKE_LOCAL}/build_config.h.in -> ${INCLUDE_DMLC_DIR}/build_config.h") -configure_file("${CMAKE_LOCAL}/build_config.h.in" "${INCLUDE_DMLC_DIR}/build_config.h") +message(STATUS "${CMAKE_LOCAL}/build_config.h.in -> include/dmlc/build_config.h") +configure_file("cmake/build_config.h.in" "include/dmlc/build_config.h") # compiler flags if(MSVC) @@ -205,6 +200,7 @@ add_library(dmlc ${SOURCE}) target_link_libraries(dmlc ${dmlccore_LINKER_LIBS}) 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 @@ -215,6 +211,8 @@ include(GNUInstallDirs) # ---[ Install Includes install(DIRECTORY ${PROJECT_SOURCE_DIR}/include/dmlc DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/include/dmlc/build_config.h + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/dmlc) # ---[ Install the archive static lib and header files install(TARGETS dmlc From 557c098166f20e01da53f23804dfb8ae5e5a6abc Mon Sep 17 00:00:00 2001 From: Philip Hyunsu Cho Date: Wed, 25 Sep 2019 20:10:54 -0700 Subject: [PATCH 2/3] Update CMakeLists.txt --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0b53dd5942..03e1874103 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -111,7 +111,7 @@ else() endif() message(STATUS "${CMAKE_LOCAL}/build_config.h.in -> include/dmlc/build_config.h") -configure_file("cmake/build_config.h.in" "include/dmlc/build_config.h") +configure_file("${CMAKE_LOCAL}/build_config.h.in" "include/dmlc/build_config.h") # compiler flags if(MSVC) From 8bfc2b7be47216f8998359c61fed42a274110139 Mon Sep 17 00:00:00 2001 From: Philip Cho Date: Thu, 26 Sep 2019 09:36:38 -0700 Subject: [PATCH 3/3] Revert "Update CMakeLists.txt" This reverts commit 557c098166f20e01da53f23804dfb8ae5e5a6abc. --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 03e1874103..0b53dd5942 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -111,7 +111,7 @@ else() endif() message(STATUS "${CMAKE_LOCAL}/build_config.h.in -> include/dmlc/build_config.h") -configure_file("${CMAKE_LOCAL}/build_config.h.in" "include/dmlc/build_config.h") +configure_file("cmake/build_config.h.in" "include/dmlc/build_config.h") # compiler flags if(MSVC)