|
@@ -1,72 +0,0 @@
|
|
|
-set(SON_PROJECT_NAME clamp_lidar)
|
|
|
-message("========== Load son project ${SON_PROJECT_NAME} ==========" )
|
|
|
-option(OPTION_COMMUNICATION_WITH_PLC "plc通信" OFF)
|
|
|
-message("<=${SON_PROJECT_NAME}=> OPTION_COMMUNICATION_WITH_PLC: " ${OPTION_COMMUNICATION_WITH_PLC})
|
|
|
-
|
|
|
-if(OPTION_COMMUNICATION_WITH_PLC AND NOT ENABLE_LIBRARY_PLC)
|
|
|
- message(FATAL_ERROR "OPTION_COMMUNICATION_WITH_PLC ON but ENABLE_LIBRARY_PLC OFF")
|
|
|
-endif ()
|
|
|
-
|
|
|
-if(NOT ENABLE_LIBRARY_PCL)
|
|
|
- message(FATAL_ERROR "ENABLE_LIBRARY_PCL OFF")
|
|
|
-endif ()
|
|
|
-
|
|
|
-if (NOT ENABLE_LIBRARY_GOOGLE_LOG)
|
|
|
- message(FATAL_ERROR "ENABLE_LIBRARY_GOOGLE_LOG OFF")
|
|
|
-endif ()
|
|
|
-
|
|
|
-if (NOT ENABLE_LIBRARY_JSON)
|
|
|
- message(FATAL_ERROR "ENABLE_LIBRARY_JSON OFF")
|
|
|
-endif ()
|
|
|
-
|
|
|
-if (NOT ENABLE_LIBRARY_THREAD)
|
|
|
- message(FATAL_ERROR "Not enable ENABLE_LIBRARY_THREAD")
|
|
|
-endif ()
|
|
|
-
|
|
|
-if (OPTION_COMMUNICATION_WITH_PLC)
|
|
|
- set(snap7_include "/usr/local/include/snap7")
|
|
|
- if(IS_DIRECTORY ${snap7_include})
|
|
|
- include_directories(${snap7_include})
|
|
|
- else ()
|
|
|
- message(FATAL_ERROR "Not found snap7 directory ${snap7_include}")
|
|
|
- endif ()
|
|
|
-
|
|
|
- aux_source_directory(${CMAKE_CURRENT_LIST_DIR}/plc plc)
|
|
|
- set(SON_PROJECT_SOURCE_LIST ${SON_PROJECT_SOURCE_LIST} ${plc})
|
|
|
- set(SON_PROJECT_DEPEND_LIST ${SON_PROJECT_DEPEND_LIST} libplc)
|
|
|
- add_definitions(-DOPTION_COMMUNICATION_WITH_PLC=1)
|
|
|
-else ()
|
|
|
- add_definitions(-DOPTION_COMMUNICATION_WITH_PLC=0)
|
|
|
-endif ()
|
|
|
-
|
|
|
-include_directories(
|
|
|
- ${PCL_INCLUDE_DIRS}
|
|
|
-)
|
|
|
-
|
|
|
-aux_source_directory(${CMAKE_CURRENT_LIST_DIR}/lidar lidar)
|
|
|
-aux_source_directory(${CMAKE_CURRENT_LIST_DIR}/detect detect)
|
|
|
-set(SON_PROJECT_SOURCE_LIST ${SON_PROJECT_SOURCE_LIST}
|
|
|
- ${lidar}
|
|
|
- ${detect}
|
|
|
- ${CMAKE_CURRENT_LIST_DIR}/main.cpp
|
|
|
-)
|
|
|
-
|
|
|
-set(SON_PROJECT_DEPEND_LIST ${SON_PROJECT_DEPEND_LIST}
|
|
|
- libjson
|
|
|
- liblog
|
|
|
- libpcl
|
|
|
- libthread
|
|
|
- ${PROTOBUF_LIBRARIES}
|
|
|
-)
|
|
|
-
|
|
|
-add_executable(${SON_PROJECT_NAME} ${SON_PROJECT_SOURCE_LIST})
|
|
|
-target_link_libraries(${SON_PROJECT_NAME} ${SON_PROJECT_DEPEND_LIST})
|
|
|
-target_compile_definitions(${SON_PROJECT_NAME} PRIVATE PROJECT_NAME="${SON_PROJECT_NAME}")
|
|
|
-
|
|
|
-install(TARGETS ${SON_PROJECT_NAME}
|
|
|
- LIBRARY DESTINATION lib # 动态库安装路径
|
|
|
- ARCHIVE DESTINATION lib # 静态库安装路径
|
|
|
- RUNTIME DESTINATION bin # 可执行文件安装路径
|
|
|
- PUBLIC_HEADER DESTINATION include # 头文件安装路径
|
|
|
-)
|
|
|
-
|