CMakeLists.txt 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. cmake_minimum_required(VERSION 3.17)
  2. project(gtcvr)
  3. set(CMAKE_CXX_STANDARD 14)
  4. #Set include and link file path of libpq for connecting postgresql
  5. INCLUDE_DIRECTORIES(/usr/include/postgresql)
  6. LINK_DIRECTORIES(/usr/lib/x86_64-linux-gnu)
  7. #find_package(libpq-devel REQUIRED)
  8. #find_path(GD_INCLUDE NAMES libpq-fe.h
  9. # PATHS /usr/lib/x86_64-linux-gnu /usr/include/postgresql
  10. # NO_DEFAULT_PATH)
  11. #find_library(libpq NAMES "libpq.so")
  12. #message(STATUS "libpq library status:")
  13. #message(STATUS " library:${libpq-devel_LIBS}")
  14. #Set include and link file path of libpq for mobus API
  15. INCLUDE_DIRECTORIES(/usr/local/modbus/include/modbus)
  16. LINK_DIRECTORIES(/usr/local/modbus/lib)
  17. #Set include and link file path of all api libraries ,eg:yaml-cpp
  18. INCLUDE_DIRECTORIES(/usr/local/include)
  19. LINK_DIRECTORIES(/usr/local/lib/)
  20. #find C libraries:thread
  21. find_package(Threads REQUIRED)
  22. # Find OpenCV, you may need to set OpenCV_DIR variable
  23. # to the absolute path to the directory containing OpenCVConfig.cmake file
  24. # via the command line or GUI
  25. find_package(OpenCV REQUIRED)
  26. # If the package has been found, several variables will
  27. # be set, you can find the full list with descriptions
  28. # in the OpenCVConfig.cmake file.
  29. # Print some message showing some of them
  30. message(STATUS "OpenCV library status:")
  31. message(STATUS " config: ${OpenCV_DIR}")
  32. message(STATUS " version: ${OpenCV_VERSION}")
  33. message(STATUS " libraries: ${OpenCV_LIBS}")
  34. message(STATUS " include path: ${OpenCV_INCLUDE_DIRS}")
  35. add_executable(gtcvr main.cpp
  36. gtbaseparamanalysize.cpp gtbaseparamanalysize.h gtstandardlization.cpp gtstandardlization.h gtcvcore.cpp gtcvcore.h
  37. gtimgcreator.cpp gtimgcreator.h gtrunconf.h gtcommonkits.cpp gtcommonkits.h
  38. gtsecondanalysize.cpp gtsecondanalysize.h gtdatasource.cpp gtdatasource.h
  39. DataMapping/dgns_gtbaseparam.cpp DataMapping/dgns_gtbaseparam.h DataMapping/dgns_gtcvrparam.cpp
  40. DataMapping/dgns_gtcvrparam.h DataMapping/dgns_gtcvrresult.cpp DataMapping/dgns_gtcvrresult.h
  41. DataMapping/dgns_gtserverrunlog.cpp DataMapping/dgns_gtserverrunlog.h DataMapping/gtpgcnn.cpp
  42. DataMapping/gtpgcnn.h DataMapping/gtdgnsdao.cpp DataMapping/gtdgnsdao.h
  43. Jsonxx/json.hpp Jsonxx/json_basic.hpp Jsonxx/json_exception.hpp Jsonxx/json_iterator.hpp
  44. Jsonxx/json_parser.hpp Jsonxx/json_serializer.hpp Jsonxx/json_value.hpp
  45. # Test/jsontest.hpp Test/modbustest.hpp Test/modbustcpserver.cpp
  46. DataMapping/dgns_gtstandard.cpp DataMapping/dgns_gtstandard.h DataMapping/dgns_gtgktype.cpp
  47. DataMapping/dgns_gtgktype.h DataMapping/dgns_gtmloutcode.cpp DataMapping/dgns_gtmloutcode.h
  48. DataMapping/aoid_daily_yield.cpp DataMapping/aoid_daily_yield.h DataMapping/aoid_singlegt_yield.cpp DataMapping/aoid_singlegt_yield.h
  49. gtselectstandardgt.cpp gtselectstandardgt.h gtaoidcore.cpp gtaoidcore.h DataMapping/gtaoiddao.cpp DataMapping/gtaoiddao.h DataMapping/aoid_singlewell_config.cpp DataMapping/aoid_singlewell_config.h DataMapping/aoid_config_data.cpp DataMapping/aoid_config_data.h DataMapping/aoid_gk_model.cpp DataMapping/aoid_gk_model.h
  50. md5lib/MD5.cpp md5lib/MD5.h)
  51. # Link your application with OpenCV libraries
  52. target_link_libraries(gtcvr PRIVATE ${OpenCV_LIBS} libpq.so libmodbus.so Threads::Threads libyaml-cpp.so)