[mlpack-git] master: Only depend on automatic linking when MSVC is used, and prep for OpenMP support. (fea90d0)
gitdub at big.cc.gt.atl.ga.us
gitdub at big.cc.gt.atl.ga.us
Thu Mar 5 21:58:31 EST 2015
Repository : https://github.com/mlpack/mlpack
On branch : master
Link : https://github.com/mlpack/mlpack/compare/904762495c039e345beba14c1142fd719b3bd50e...f94823c800ad6f7266995c700b1b630d5ffdcf40
>---------------------------------------------------------------
commit fea90d035b79767a1f11028e2b68ad45726aab9b
Author: Ryan Curtin <ryan at ratml.org>
Date: Mon Aug 18 14:32:51 2014 +0000
Only depend on automatic linking when MSVC is used, and prep for OpenMP support.
>---------------------------------------------------------------
fea90d035b79767a1f11028e2b68ad45726aab9b
CMakeLists.txt | 19 ++++++++++++++-----
1 file changed, 14 insertions(+), 5 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 13cd8fa..82a97e9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -182,19 +182,28 @@ include_directories(${Boost_INCLUDE_DIRS})
link_directories(${Boost_LIBRARY_DIRS})
-# On Windows, automatic linking is performed, so we don't need to worry about
-# it. Clear the list of libraries to link against and let Visual Studio handle
-# it.
-if (WIN32)
+# In Visual Studio, automatic linking is performed, so we don't need to worry
+# about it. Clear the list of libraries to link against and let Visual Studio
+# handle it.
+if (MSVC)
link_directories(${Boost_LIBRARY_DIRS})
set(Boost_LIBRARIES "")
-endif (WIN32)
+endif (MSVC)
# For Boost testing framework (will have no effect on non-testing executables).
# This specifies to Boost that we are dynamically linking to the Boost test
# library.
add_definitions(-DBOOST_TEST_DYN_LINK)
+# We require OpenMP now.
+#find_package(OpenMP REQUIRED)
+#if (OPENMP_FOUND)
+# set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
+# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
+# set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}
+# ${OpenMP_EXE_LINKER_FLAGS}")
+#endif (OPENMP_FOUND)
+
# Create a 'distclean' target in case the user is using an in-source build for
# some reason.
include(CMake/TargetDistclean.cmake OPTIONAL)
More information about the mlpack-git
mailing list