readme.txt 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. General CMake Notes:
  2. =========================================
  3. 1. Indexing source code files:
  4. Never use GLOB_RECURSE. It's evil. E.g. if you add or remove source files, CMake has no way of knowing that it should be re-run. Just list all the files in your CMakeLists.txt (or, if you think the list is excessively long, create a file called e.g. files.cmake, put the list in there and INCLUDE it in the CMakeLists.txt file.
  5. 2. Never do in-source builds. CMake creates many, many files, and you don't want to delete them all individually for a clean build. And there's no way to implement a safe "make clean" (e.g. your build system might be running a custom utility which generates files CMake knows nothing about).
  6. Notes on NICE to CMAKE transformation
  7. ========================================
  8. Todos
  9. -----
  10. - libmagic++ scheint sehr aufwendig in der benutzung unter Windows: How to build it with vs, anleitung:http://www.graphicsmagick.org/INSTALL-windows.html#windows-xp-vista-7-visual-c-6-0-through-9-0-compilation
  11. unter windows doch einfacher: http://www.imagemagick.org/script/binary-releases.php#windows (sind nur die binaries, keine includes und libs)
  12. http://www.imagemagick.org/Magick++/ sources runterladen (getan. TODO: entpacken c/libraries/ImageMagick-6.8.3-6-windows.zip)
  13. braucht man überhaupt libmagick? warum nicht lieber opencv zum bilderlesen benutzen: momentan ist das lesen und schreiben eh mit throw exception not implemented verbunden:
  14. void ImageFile::readerMagick ( GrayColorImageCommonImplementationT<P> *image )
  15. {
  16. fthrow ( ImageException, "Format not yet implemented (only available for standard images)." );
  17. }
  18. weil magick momentan der default imagereader ist: void ImageFile::reader(...), wenn keine libPNG und LibJpeg gegeben ist.
  19. - make compilable without Qt
  20. - make compileable without opengl
  21. - regex lib nutzen von boost (->config.h)
  22. - substitue FileMgt::DirectoryRecursive by platform independend code using boost::filesystem
  23. - Implement ResouceStatistics for windows
  24. - braucht man GLUT noch ? Alt??? enable build without glut atleast!!
  25. - remove all warnings for function shadowing
  26. - remove all warning unreachable code
  27. - fixing all these includes of template definitons:
  28. //#ifdef __GNUC__
  29. #include "core/vector/RowMatrixT.tcc"
  30. //#endif
  31. tcc are not cpps, they need to be included into the header file otherwise template usage will result in linking errors
  32. See, Inclusion model of Template classes: http://stackoverflow.com/questions/3705740/c-lnk2019-error-unresolved-external-symbol-template-classs-constructor-and
  33. - porting core/basics/timer.h/cpp
  34. highly unix dependend, better use 3rd party time functionality for now()
  35. better use boost::timer ??
  36. - stringtools highly os dependented
  37. ->recursive dir scan with "ls -r" syntax!!
  38. use 3rd party lib like boost oder qt
  39. use boost regex for regex syntax in stringtools::regex bla
  40. NICE defs to care about
  41. -----------------------
  42. NICE_USELIB_CUDACHOLESKY
  43. NICE_USELIB_IPP
  44. NICE_USELIB_OPENMP
  45. #ifdef NICE_USELIB_MATIO
  46. NICE_USELIB_PNG
  47. NICE_USELIB_JPG
  48. NICE_USELIB_LIBMAGICK
  49. #eigene definiton zum builden der sub-test-ordners
  50. Notes Using Libraries:
  51. ======================
  52. needed libraries windows:
  53. ------------------------
  54. - freeglut (download from: http://freeglut.sourceforge.net/index.php#download)
  55. adjust pathes GLUT_ROOT_PATH in root-CMakeLists.txt
  56. CPPUNIT verwenden
  57. ---------------------
  58. 1) installation
  59. 1-a) linux
  60. if not already in path then:
  61. download source from http://sourceforge.net/projects/cppunit/files/cppunit/1.12.1/cppunit-1.12.1.tar.gz/download
  62. unzip
  63. create build_<pcname> dir
  64. cd build_<pcname>
  65. ../configure - -prefix=<path>/build_<pcname>/install
  66. make
  67. make install
  68. put <path>/build_<pcname>/install/include into system path variable, example in .bashrc:
  69. PATH=/home/ruehle/libs/cppunit-1.12.1/build_sigma15/install/include/:$PATH
  70. 1-b) Windows:
  71. download http://www.comp.nus.edu.sg/~cs3215/tools/cppunitAll.html
  72. build with visual studio
  73. put path to generated lib in path variable (pointing to the */include path)
  74. 2) enabling building cpp unit tests
  75. NICE_BUILD_TESTS
  76. running tests: <build ordner>: cmake
  77. make
  78. 3) run the unit tests
  79. im <build ordner>: cmake --output-on-failure
  80. OpenCV inspired CMake notes:
  81. ===========================
  82. Interessante Funktionen der OpenCV:
  83. ----------------------------------
  84. macro add_all_subdirs()
  85. set(_all_headers)
  86. set(_all_sources)
  87. set(_all_linkings)
  88. #ge
  89. foreach dir in subdirlist
  90. {
  91. add_directories( dir )
  92. #add header, sources, linkings from subdir to _all_* variables
  93. }
  94. endmacro
  95. set(NICE_CURR_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
  96. aus OpenCVUtils.cmake:
  97. macro(ocv_convert_to_full_paths VAR) # convert list of paths to full paths
  98. macro(ocv_get_real_path VAR PATHSTR) # get absolute path with symlinks resolved
  99. macro(ocv_list_add_suffix LST SUFFIX) # add suffix to each item in the list
  100. macro(ocv_list_add_prefix LST PREFIX) # add prefix to each item in the list
  101. macro(ocv_list_unique __lst)# stable & safe duplicates removal macro
  102. OpenCVModule.cmake
  103. ocv_glob_modules(pathcurrdir) -->in modules
  104. in jedem untermodel, eg core
  105. ocv_add_module(modname)
  106. sets variable "the_module" => set(the_module opencv_${name})
  107. extra abhängikeitens über zweites argument in der funktion, eg. ocv_add_module(core ${ZLIB_Lbla})
  108. ocv_module_include_directories() ( auch mit zusatzincludes dann übergeben ${ZLib_include_Dir})
  109. ocv_glob_module_sources() holt cpps und hpp h aus unterordnern -- sources bilden
  110. ocv_create_module (binary build the module ->add_library, set_target etc