CMakeLists.txt 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #-----------------------------------------------------------------------------
  2. # 头文件搜索路径
  3. #-----------------------------------------------------------------------------
  4. include_directories(${CMAKE_CURRENT_SOURCE_DIR}/..)
  5. #-----------------------------------------------------------------------------
  6. # 自动添加include目录
  7. #-----------------------------------------------------------------------------
  8. set(CMAKE_INCLUDE_CURRENT_DIR ON)
  9. #-----------------------------------------------------------------------------
  10. # 源码扫描
  11. #-----------------------------------------------------------------------------
  12. file(GLOB _header "*.h")
  13. file(GLOB _source "*.cpp")
  14. #-----------------------------------------------------------------------------
  15. # 添加动态库目标
  16. #-----------------------------------------------------------------------------
  17. add_library(ModelData
  18. ${_header}
  19. ${_source}
  20. )
  21. #-----------------------------------------------------------------------------
  22. # 添加接口声明宏
  23. #-----------------------------------------------------------------------------
  24. target_compile_definitions(ModelData PRIVATE "MODELDATA_API")
  25. list(APPEND _depend_library PythonModule Settings DataProperty MeshData Geometry BCBase ConfigOptions ParaClassFactory)
  26. list(APPEND _runtimes_libraries
  27. Qt5::Core Qt5::Gui Qt5::Xml Qt5::Widgets
  28. )
  29. #-----------------------------------------------------------------------------
  30. # 链接依赖库
  31. #-----------------------------------------------------------------------------
  32. target_link_libraries(ModelData PRIVATE
  33. ${_runtimes_libraries}
  34. ${_depend_library}
  35. )
  36. #-----------------------------------------------------------------------------
  37. # 添加依赖关系
  38. #-----------------------------------------------------------------------------
  39. add_dependencies(ModelData ${_depend_library})
  40. #-----------------------------------------------------------------------------
  41. # 添加运行时依赖关系
  42. #-----------------------------------------------------------------------------
  43. set(FastCAE_ModelData_Runtimes_Libraries ${_runtimes_libraries} PARENT_SCOPE)