Projektarbeit Line Following Robot bei Prof. Chowanetz im WS22/23
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

CMakeLists.txt 2.5KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. INCLUDE_DIRECTORIES(.)
  2. SET(private_hdrs_base "private/private_types.h private/private_impl.h exceptions.h private/threadcondition.h ")
  3. SET(private_still_hdrs_base "private_still/private_still_types.h private/private_still_impl.h")
  4. SET(public_hdrs_base raspicamtypes.h raspicam.h)
  5. SET(srcs_base raspicam.cpp raspicam_still.cpp private/private_impl.cpp private/threadcondition.cpp private_still/private_still_impl.cpp)
  6. if(NOT( ${CMAKE_SYSTEM_PROCESSOR} MATCHES arm*) )#in a pc, adds fake dependencies to mmal functions to enable compilation
  7. SET(srcs_base ${srcs_base} private/fake_mmal_dependencies.cpp)
  8. endif()
  9. INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR} )
  10. ADD_LIBRARY(${PROJECT_NAME} ${hdrs_base} ${srcs_base} )
  11. SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES # create *nix style library versions + symbolic links
  12. DEFINE_SYMBOL DSO_EXPORTS
  13. VERSION ${PROJECT_VERSION}
  14. SOVERSION ${PROJECT_SOVERSION}
  15. CLEAN_DIRECT_OUTPUT 1 # allow creating static and shared libs without conflicts
  16. OUTPUT_NAME "${PROJECT_NAME}${PROJECT_DLLVERSION}" # avoid conflicts between library and binary target names
  17. )
  18. TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${REQUIRED_LIBRARIES} )
  19. INSTALL(TARGETS ${PROJECT_NAME}
  20. RUNTIME DESTINATION bin COMPONENT main
  21. LIBRARY DESTINATION lib PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE COMPONENT main
  22. ARCHIVE DESTINATION lib COMPONENT main)
  23. #Add opencv component if required
  24. #Opencv Lib
  25. IF (${OpenCV_FOUND})
  26. message(STATUS "Adding cv library")
  27. SET(hdrs_cv raspicam_cv.h raspicam_still_cv.h)
  28. SET(srcs_cv raspicam_cv.cpp raspicam_still_cv.cpp)
  29. ADD_LIBRARY(${PROJECT_NAME}_cv ${hdrs_cv} ${srcs_cv} ${srcs_base})
  30. SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES # create *nix style library versions + symbolic links
  31. DEFINE_SYMBOL DSO_EXPORTS
  32. VERSION ${PROJECT_VERSION}
  33. SOVERSION ${PROJECT_SOVERSION}
  34. CLEAN_DIRECT_OUTPUT 1 # allow creating static and shared libs without conflicts
  35. OUTPUT_NAME "${PROJECT_NAME}${PROJECT_DLLVERSION}" # avoid conflicts between library and binary target names
  36. )
  37. TARGET_LINK_LIBRARIES(${PROJECT_NAME}_cv ${REQUIRED_LIBRARIES} ${OpenCV_LIBS} )
  38. INSTALL(TARGETS ${PROJECT_NAME}_cv
  39. RUNTIME DESTINATION bin COMPONENT main
  40. LIBRARY DESTINATION lib PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE COMPONENT main
  41. ARCHIVE DESTINATION lib COMPONENT main)
  42. ENDIF()
  43. #Installation of all header files
  44. INSTALL(FILES ${public_hdrs_base} ${hdrs_cv}
  45. DESTINATION include/${PROJECT_NAME}
  46. COMPONENT main)