[mlpack-svn] r11877 - mlpack/trunk
fastlab-svn at coffeetalk-1.cc.gatech.edu
fastlab-svn at coffeetalk-1.cc.gatech.edu
Sat Mar 17 14:50:21 EDT 2012
Author: rcurtin
Date: 2012-03-17 14:50:20 -0400 (Sat, 17 Mar 2012)
New Revision: 11877
Modified:
mlpack/trunk/CMakeLists.txt
Log:
Look for possible dependencies of libxml2.dll, to issue a warning to the user in case they don't exist.
Modified: mlpack/trunk/CMakeLists.txt
===================================================================
--- mlpack/trunk/CMakeLists.txt 2012-03-17 16:16:10 UTC (rev 11876)
+++ mlpack/trunk/CMakeLists.txt 2012-03-17 18:50:20 UTC (rev 11877)
@@ -60,6 +60,33 @@
find_package(Armadillo 2.4.0 REQUIRED)
find_package(LibXml2 REQUIRED)
+# On Windows, LibXml2 has a couple dependencies and we want to make sure they
+# exist. We don't need the include directory, so we just use a find_library
+# call, looking for .dlls.
+if (WIN32)
+ # Find a .dll, not a .lib, because libxml2 is probably dynamically linked.
+ set(CMAKE_OLD_SUFFIXES "${CMAKE_FIND_LIBRARY_SUFFIXES}")
+ set(CMAKE_FIND_LIBRARY_SUFFIXES ".dll")
+
+ find_library(ZLIB_LIBRARY
+ zlib1
+ HINTS "[HKEY_LOCAL_MACHINE\\SOFTWARE\\GnuWin32\\ZLib:InstallPath]/lib"
+ )
+ if (NOT ZLIB_LIBRARY)
+ message(WARNING "zlib1.dll not found! libxml2.dll may depend on this, and
+ if it is not present MLPACK may not work.")
+ endif (NOT ZLIB_LIBRARY)
+
+ find_library(ICONV_LIBRARY iconv)
+ if (NOT ICONV_LIBRARY)
+ message(WARNING "iconv.dll not found! libxml2.dll may depend on this, and
+ if it is not present MLPACK may not work.")
+ endif (NOT ICONV_LIBRARY)
+
+ # Reset suffixes.
+ set(CMAKE_FIND_LIBRARY_SUFFIXES "${CMAKE_OLD_SUFFIXES}")
+endif (WIN32)
+
# Include directories for the previous dependencies.
include_directories(${ARMADILLO_INCLUDE_DIRS})
include_directories(${LIBXML2_INCLUDE_DIR})
More information about the mlpack-svn
mailing list