diff --git a/CMakeLists.txt b/CMakeLists.txt index dae1737971..fbee2c7918 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -58,7 +58,6 @@ if(Boost_MAJOR_VERSION EQUAL 1 AND Boost_MINOR_VERSION GREATER 45) set(BOOST_LIBS ${BOOST_LIBS} "boost_random") endif(Boost_MAJOR_VERSION EQUAL 1 AND Boost_MINOR_VERSION GREATER 45) - # Default to debugging mode for developers. option(DEBUG "Compile with debugging information" ON) option(PROFILE "Compile with profiling information" ON) @@ -101,7 +100,6 @@ include_directories(${LIBXML2_INCLUDE_DIRS}) include(CMake/TargetDistclean.cmake OPTIONAL) include_directories(${CMAKE_SOURCE_DIR}) -#TODO link_directories() set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib/) set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/) diff --git a/src/mlpack/CMakeLists.txt b/src/mlpack/CMakeLists.txt index 2b70277c28..37146aa21d 100644 --- a/src/mlpack/CMakeLists.txt +++ b/src/mlpack/CMakeLists.txt @@ -51,21 +51,12 @@ endforeach() # collected to include/. install(DIRECTORY ${CMAKE_BINARY_DIR}/include/mlpack DESTINATION include) +# Set generated executables to be installed. Unfortunately they must manually +# be entered... install(TARGETS mlpack - RUNTIME DESTINATION bin - LIBRARY DESTINATION lib - ARCHIVE DESTINATION lib) - -# Set generated executables to be installed. -# This will have some odd effects if the user has placed anything else in bin/, -# but I think we can just hope that they haven't. At least, an auto-builder -# won't do that... -install(DIRECTORY ${CMAKE_BINARY_DIR}/bin/ - DESTINATION bin - USE_SOURCE_PERMISSIONS - COMPONENT mlpack - FILES_MATCHING - PATTERN *[^_test]) + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib) # For 'make test'. add_custom_target(test diff --git a/src/mlpack/methods/emst/CMakeLists.txt b/src/mlpack/methods/emst/CMakeLists.txt index 4c5cc8ad7f..8f1579e2a7 100644 --- a/src/mlpack/methods/emst/CMakeLists.txt +++ b/src/mlpack/methods/emst/CMakeLists.txt @@ -26,3 +26,4 @@ add_executable(emst target_link_libraries(emst mlpack ) +install(TARGETS emst RUNTIME DESTINATION bin) diff --git a/src/mlpack/methods/gmm/CMakeLists.txt b/src/mlpack/methods/gmm/CMakeLists.txt index 00f007934f..401efd6ac8 100644 --- a/src/mlpack/methods/gmm/CMakeLists.txt +++ b/src/mlpack/methods/gmm/CMakeLists.txt @@ -26,3 +26,4 @@ add_executable(gmm target_link_libraries(gmm mlpack ) +install(TARGETS gmm RUNTIME DESTINATION bin) diff --git a/src/mlpack/methods/hmm/CMakeLists.txt b/src/mlpack/methods/hmm/CMakeLists.txt index e1332e099b..28c77013e5 100644 --- a/src/mlpack/methods/hmm/CMakeLists.txt +++ b/src/mlpack/methods/hmm/CMakeLists.txt @@ -45,3 +45,6 @@ add_executable(hmm_generate target_link_libraries(hmm_generate mlpack ) + +install(TARGETS hmm_train hmm_loglik hmm_viterbi hmm_generate + RUNTIME DESTINATION bin) diff --git a/src/mlpack/methods/kernel_pca/CMakeLists.txt b/src/mlpack/methods/kernel_pca/CMakeLists.txt index 6ff57eeb8d..fe1b5cc594 100644 --- a/src/mlpack/methods/kernel_pca/CMakeLists.txt +++ b/src/mlpack/methods/kernel_pca/CMakeLists.txt @@ -19,8 +19,7 @@ set(MLPACK_SRCS ${MLPACK_SRCS} ${DIR_SRCS} PARENT_SCOPE) add_executable(kernel_pca kernel_pca_main.cpp ) - target_link_libraries(kernel_pca mlpack ) - +install(TARGETS kernel_pca RUNTIME DESTINATION bin) diff --git a/src/mlpack/methods/kmeans/CMakeLists.txt b/src/mlpack/methods/kmeans/CMakeLists.txt index bf605bb862..aa82952970 100644 --- a/src/mlpack/methods/kmeans/CMakeLists.txt +++ b/src/mlpack/methods/kmeans/CMakeLists.txt @@ -27,3 +27,4 @@ add_executable(kmeans target_link_libraries(kmeans mlpack ) +install(TARGETS kmeans RUNTIME DESTINATION bin) diff --git a/src/mlpack/methods/lars/CMakeLists.txt b/src/mlpack/methods/lars/CMakeLists.txt index 8d38dbea3f..17b3316c1a 100644 --- a/src/mlpack/methods/lars/CMakeLists.txt +++ b/src/mlpack/methods/lars/CMakeLists.txt @@ -18,7 +18,7 @@ set(MLPACK_SRCS ${MLPACK_SRCS} ${DIR_SRCS} PARENT_SCOPE) add_executable(lars lars_main.cpp ) - target_link_libraries(lars mlpack ) +install(TARGETS lars RUNTIME DESTINATION bin) diff --git a/src/mlpack/methods/linear_regression/CMakeLists.txt b/src/mlpack/methods/linear_regression/CMakeLists.txt index d0f823d48e..01bc333753 100644 --- a/src/mlpack/methods/linear_regression/CMakeLists.txt +++ b/src/mlpack/methods/linear_regression/CMakeLists.txt @@ -23,3 +23,4 @@ add_executable(linear_regression target_link_libraries(linear_regression mlpack ) +install(TARGETS linear_regression RUNTIME DESTINATION bin) diff --git a/src/mlpack/methods/mvu/CMakeLists.txt b/src/mlpack/methods/mvu/CMakeLists.txt index e240cd6c33..5689763c71 100644 --- a/src/mlpack/methods/mvu/CMakeLists.txt +++ b/src/mlpack/methods/mvu/CMakeLists.txt @@ -24,3 +24,4 @@ add_executable(mvu target_link_libraries(mvu mlpack ) +install(TARGETS mvu RUNTIME DESTINATION bin) diff --git a/src/mlpack/methods/naive_bayes/CMakeLists.txt b/src/mlpack/methods/naive_bayes/CMakeLists.txt index 8b0ab4112a..39420351bb 100644 --- a/src/mlpack/methods/naive_bayes/CMakeLists.txt +++ b/src/mlpack/methods/naive_bayes/CMakeLists.txt @@ -22,3 +22,4 @@ add_executable(nbc target_link_libraries(nbc mlpack ) +install(TARGETS nbc RUNTIME DESTINATION bin) diff --git a/src/mlpack/methods/nca/CMakeLists.txt b/src/mlpack/methods/nca/CMakeLists.txt index 0b399b03bb..f7cf99f96f 100644 --- a/src/mlpack/methods/nca/CMakeLists.txt +++ b/src/mlpack/methods/nca/CMakeLists.txt @@ -24,3 +24,4 @@ add_executable(nca target_link_libraries(nca mlpack ) +install(TARGETS nca RUNTIME DESTINATION bin) diff --git a/src/mlpack/methods/neighbor_search/CMakeLists.txt b/src/mlpack/methods/neighbor_search/CMakeLists.txt index 8570533122..3b494f5555 100644 --- a/src/mlpack/methods/neighbor_search/CMakeLists.txt +++ b/src/mlpack/methods/neighbor_search/CMakeLists.txt @@ -36,3 +36,5 @@ add_executable(allkfn target_link_libraries(allkfn mlpack ) + +install(TARGETS allknn allkfn RUNTIME DESTINATION bin) diff --git a/src/mlpack/methods/pca/CMakeLists.txt b/src/mlpack/methods/pca/CMakeLists.txt index 7f33af194b..6c2b63cc6d 100644 --- a/src/mlpack/methods/pca/CMakeLists.txt +++ b/src/mlpack/methods/pca/CMakeLists.txt @@ -22,3 +22,4 @@ add_executable(pca target_link_libraries(pca mlpack ) +install(TARGETS pca RUNTIME DESTINATION bin) diff --git a/src/mlpack/methods/radical/CMakeLists.txt b/src/mlpack/methods/radical/CMakeLists.txt index 94eed2d1a4..294644650a 100644 --- a/src/mlpack/methods/radical/CMakeLists.txt +++ b/src/mlpack/methods/radical/CMakeLists.txt @@ -16,9 +16,9 @@ endforeach() set(MLPACK_SRCS ${MLPACK_SRCS} ${DIR_SRCS} PARENT_SCOPE) add_executable(radical - radical_main.cpp + radical_main.cpp ) - target_link_libraries(radical mlpack ) +install(TARGETS radical RUNTIME DESTINATION bin)