[mlpack-git] master, mlpack-1.0.x: Create separate target for moving mlpack headers. This should fix #322. (554f12c)
gitdub at big.cc.gt.atl.ga.us
gitdub at big.cc.gt.atl.ga.us
Thu Mar 5 21:50:32 EST 2015
Repository : https://github.com/mlpack/mlpack
On branches: master,mlpack-1.0.x
Link : https://github.com/mlpack/mlpack/compare/904762495c039e345beba14c1142fd719b3bd50e...f94823c800ad6f7266995c700b1b630d5ffdcf40
>---------------------------------------------------------------
commit 554f12cdadfa128fe6877bb9db1f9b80b0fab266
Author: Ryan Curtin <ryan at ratml.org>
Date: Wed Jul 2 19:01:41 2014 +0000
Create separate target for moving mlpack headers. This should fix #322.
>---------------------------------------------------------------
554f12cdadfa128fe6877bb9db1f9b80b0fab266
src/mlpack/CMakeLists.txt | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/mlpack/CMakeLists.txt b/src/mlpack/CMakeLists.txt
index 655035d..5d52218 100644
--- a/src/mlpack/CMakeLists.txt
+++ b/src/mlpack/CMakeLists.txt
@@ -48,14 +48,15 @@ set(INCLUDE_FILES ${INCLUDE_H_FILES} ${INCLUDE_HPP_FILES})
# Move all of these header files to <builddir>/include/mlpack/ after the library
# is built. First we have to create that directory though.
-add_custom_command(TARGET mlpack POST_BUILD
+add_custom_target(mlpack_headers)
+add_custom_command(TARGET mlpack_headers POST_BUILD
COMMENT "Moving header files to include/mlpack/"
COMMAND ${CMAKE_COMMAND} ARGS -E
make_directory ${CMAKE_BINARY_DIR}/include/mlpack/)
# Then copy each of the header files over to that directory.
foreach(incl_file ${INCLUDE_FILES})
- add_custom_command(TARGET mlpack POST_BUILD
+ add_custom_command(TARGET mlpack_headers POST_BUILD
COMMAND ${CMAKE_COMMAND} ARGS -E
copy ${CMAKE_CURRENT_SOURCE_DIR}/${incl_file}
${CMAKE_BINARY_DIR}/include/mlpack/${incl_file})
@@ -72,6 +73,8 @@ install(TARGETS mlpack
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib)
+add_dependencies(mlpack mlpack_headers)
+
# For 'make test'.
add_custom_target(test
${CMAKE_BINARY_DIR}/bin/mlpack_test
More information about the mlpack-git
mailing list