CMakeLists.txt 1.4 KB

1234567891011121314151617181920212223242526272829303132
  1. # CMakeList.txt: robot 的 CMake 项目,在此处包括源代码并定义
  2. # 项目特定的逻辑。
  3. #
  4. if (WIN32)
  5. link_directories("${CMAKE_CURRENT_SOURCE_DIR}/../lib/windows/rttr" "${CMAKE_CURRENT_SOURCE_DIR}/../lib/windows/boost" "${CMAKE_CURRENT_SOURCE_DIR}/../lib/windows/logger" "${CMAKE_CURRENT_SOURCE_DIR}/../lib/windows/openssl" "${CMAKE_CURRENT_SOURCE_DIR}/../lib/windows/cppdb")
  6. elseif(IOS)
  7. elseif(UNIX)
  8. link_directories("${CMAKE_CURRENT_SOURCE_DIR}/../lib/linux/rttr" "${CMAKE_CURRENT_SOURCE_DIR}/../lib/linux/boost" "${CMAKE_CURRENT_SOURCE_DIR}/../lib/linux/logger" "${CMAKE_CURRENT_SOURCE_DIR}/../lib/linux/openssl" "${CMAKE_CURRENT_SOURCE_DIR}/../lib/linux/cppdb")
  9. endif()
  10. # 将源代码添加到此项目的可执行文件。
  11. add_executable (robot "main.cpp" )
  12. if (CMAKE_VERSION VERSION_GREATER 3.12)
  13. set_property(TARGET robot PROPERTY CXX_STANDARD 20)
  14. endif()
  15. include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../include)
  16. # 添加 /bigobj 选项
  17. if (MSVC)
  18. target_compile_options(robot PRIVATE /bigobj)
  19. endif()
  20. if (WIN32)
  21. target_link_libraries(robot rttr_core cppdb logger libcrypto libssl Crypt32)
  22. elseif(IOS)
  23. elseif(UNIX)
  24. target_link_libraries(robot pthread rttr_core cppdb logger crypto ssl dl)
  25. execute_process(COMMAND "/home/zxw/tools/generator/code_generator_command" "${CMAKE_CURRENT_SOURCE_DIR}")
  26. endif()
  27. # TODO: 如有需要,请添加测试并安装目标。