CMakeLists.txt 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. cmake_minimum_required(VERSION 3.10)
  2. set(this_exe show3)
  3. #设置第三方库路径
  4. link_directories(
  5. ${CMAKE_SOURCE_DIR}/ThreeLib/signalstats/lib
  6. )
  7. #包含源文件
  8. file(GLOB LOCAL_SRC
  9. ${CMAKE_CURRENT_SOURCE_DIR}/*.qrc
  10. ${CMAKE_CURRENT_SOURCE_DIR}/*.rc
  11. ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp
  12. ${CMAKE_CURRENT_SOURCE_DIR}/*.ui
  13. ${CMAKE_SOURCE_DIR}/External/module/ThreadPool/*.cpp
  14. )
  15. link_directories(${CMAKE_SOURCE_DIR}/ThreeLib/signalstats/lib)
  16. # 生成可执行程序
  17. add_executable(${this_exe}
  18. # WIN32
  19. ${GLOBAL_SRC}
  20. ${LOCAL_SRC}
  21. )
  22. # set_target_properties(${this_exe} PROPERTIES
  23. # )
  24. #添加头文件
  25. target_include_directories(${this_exe} PRIVATE
  26. ${CMAKE_CURRENT_SOURCE_DIR}
  27. ${CMAKE_SOURCE_DIR}
  28. ${CMAKE_SOURCE_DIR}/External/common
  29. ${CMAKE_SOURCE_DIR}/External/module
  30. ${CMAKE_SOURCE_DIR}/External/module/ThreadPool
  31. ${CMAKE_SOURCE_DIR}/External/module/RingQueue
  32. ${CMAKE_SOURCE_DIR}/ThreeLib/signalstats/include
  33. ${spdlog_INCLUDE_DIR}
  34. )
  35. target_link_libraries(${this_exe} PRIVATE
  36. Qt${QT_VERSION_MAJOR}::Widgets
  37. Qt${QT_VERSION_MAJOR}::Core
  38. Qt${QT_VERSION_MAJOR}::Network
  39. )
  40. # message(STATUS "可执行文件输出位置: ${EXECUTABLE_OUTPUT_PATH}")
  41. target_link_libraries(${this_exe} PRIVATE
  42. ${spdlog_LIBRARY}
  43. libsignalstats.so
  44. )