ソースを参照

cmake added matio + hdf5 support

Johannes Ruehle 12 年 前
コミット
52795041fc
4 ファイル変更18 行追加3 行削除
  1. 13 1
      CMakeLists.txt
  2. 3 0
      core/CMakeLists.txt
  3. 1 1
      core/matlabAccess/MatFileIO.h
  4. 1 1
      templates/cppUnitTestRunner.cpp

+ 13 - 1
CMakeLists.txt

@@ -12,7 +12,7 @@ include(cmake/NiceModules.cmake REQUIRED)
 
 # The version number.
 set(NICELibrary_VERSION_MAJOR 1)
-set(NICELibrary_VERSION_MINOR 0)
+set(NICELibrary_VERSION_MINOR 2)
 
 set(CMAKE_VERBOSE_MAKEFILE off) 
 
@@ -36,6 +36,7 @@ IF (CPPUNIT_FOUND)
 	message(STATUS "CppUnit-dir: ${CPPUNIT_INCLUDE_DIR}")
     INCLUDE_DIRECTORIES(${CPPUNIT_INCLUDE_DIR})
     ADD_DEFINITIONS( "-DNICE_USELIB_CPPUNIT" )
+    ADD_DEFINITIONS( "-DCPPUNIT_USE_TYPEINFO_NAME") #converting test class name into test name
 else()
   #set(CPPUNIT_INCLUDE_DIR "/usr/include/") #can be found in  /usr/include/cppunit
  # ADD_DEFINITIONS( "-DNICE_USELIB_CPPUNIT" )
@@ -55,6 +56,17 @@ if (PNG_FOUND)
   ADD_DEFINITIONS( "-DNICE_USELIB_PNG")
 endif()
 
+find_package(HDF5)
+if(HDF5_FOUND)
+  message(STATUS "HDF5-dir: ${HDF5_INCLUDE_DIR}")
+endif()
+find_package(MATIO)
+if(MATIO_FOUND)
+  message(STATUS "Matio-dir: ${MATIO_INCLUDE_DIR}")
+  ADD_DEFINITIONS( "-DNICE_USELIB_MATIO")
+  INCLUDE_DIRECTORIES(${MATIO_INCLUDE_DIR})
+endif()
+
 
 find_package(ImageMagick COMPONENTS Magick++)
 if(ImageMagick_FOUND)

+ 3 - 0
core/CMakeLists.txt

@@ -15,6 +15,9 @@ include( testfiles.cmake)
 
 #add linkage dependencies to other libraries here
 set("nice_${the_library}_LINKING_DEPENDENCIES" "")
+if(MATIO_FOUND)
+  list(APPEND nice_${the_library}_LINKING_DEPENDENCIES ${MATIO_LIBRARIES})
+endif(MATIO_FOUND)
 
 #####################################################
 message(STATUS "adding library ${the_library}")

+ 1 - 1
core/matlabAccess/MatFileIO.h

@@ -24,7 +24,7 @@
 
 #else //#ifdef NICE_USELIB_MATIO
 
-#include <matio/matio.h>
+#include <matio.h>
 
 
 namespace NICE {

+ 1 - 1
templates/cppUnitTestRunner.cpp

@@ -38,7 +38,7 @@ int main(int argc, char* argv[]) {
   std::string sTestName = suite->getName();
   //std::string sTestName = runner.getName();
   sTestName.append( "_testresults.xml");
-  std::cout << sTestName <<std::endl;
+  //std::cout << sTestName <<std::endl;
   std::ofstream xmlFileOut(sTestName.c_str());
   CppUnit::XmlOutputter xmlOut(&result, xmlFileOut);
   xmlOut.write();