CMakeLists.txt 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. #
  2. # Copyright 2010 SRI International
  3. #
  4. # This program is free software: you can redistribute it and/or modify
  5. # it under the terms of the GNU Lesser General Public License as published by
  6. # the Free Software Foundation, either version 3 of the License, or
  7. # (at your option) any later version.
  8. #
  9. # This program is distributed in the hope that it will be useful,
  10. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. # GNU Lesser General Public License for more details.
  13. #
  14. # You should have received a copy of the GNU Lesser General Public License
  15. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  16. #
  17. ADD_DEFINITIONS(-DUSE_SPA)
  18. if(WIN32)
  19. ADD_DEFINITIONS(-DEIGEN_DONT_ALIGN)
  20. endif()
  21. if(WIN32)
  22. # turn off various warnings
  23. foreach(warning 4251)
  24. SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd${warning}")
  25. endforeach(warning)
  26. endif()
  27. ############################################################################
  28. # tutorial 1
  29. add_executable(
  30. Karto_Tutorial1
  31. samples/tutorial1.cpp
  32. )
  33. target_link_libraries(Karto_Tutorial1 karto)
  34. if (UNIX)
  35. target_link_libraries(Karto_Tutorial1 "pthread")
  36. endif()
  37. ############################################################################
  38. # tutorial 2
  39. include_directories(${EIGEN3_INCLUDE_DIRS})
  40. add_executable(
  41. Karto_Tutorial2
  42. samples/tutorial2.cpp
  43. samples/SpaSolver.h
  44. samples/SpaSolver.cpp
  45. )
  46. target_link_libraries(Karto_Tutorial2 karto ${catkin_LIBRARIES} ${Eigen_LIBRARIES})
  47. if(PNG_FOUND)
  48. target_link_libraries(Karto_Tutorial2 ${ZLIB_LIBRARIES})
  49. target_link_libraries(Karto_Tutorial2 ${PNG_LIBRARIES})
  50. endif()
  51. if (UNIX)
  52. target_link_libraries(Karto_Tutorial2 "pthread")
  53. endif()