123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215 |
- if(GJDM_ENABLE_DEV)
-
- if(SYS_WIN)
- if(NOT EXISTS "$<TARGET_FILE_DIR:${PROJECT_NAME}>/GJDM.ini")
- get_target_property(_qmake_executable Qt5::qmake IMPORTED_LOCATION)
- get_filename_component(_qt_bin_dir "${_qmake_executable}" DIRECTORY)
- foreach(_lib ${FastCAE_Runtimes_Libraries})
- add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
- COMMAND ${CMAKE_COMMAND} -E copy
- $<TARGET_FILE:${_lib}>
- $<TARGET_FILE_DIR:${PROJECT_NAME}>
- )
- endforeach()
- # 在windows环境需要拷贝所有依赖库的dll到构建目录
- add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
- #[[COMMAND ${CMAKE_COMMAND} -E copy
- $<TARGET_RUNTIME_DLLS:${PROJECT_NAME}>
- $<TARGET_FILE_DIR:${PROJECT_NAME}>
- COMMAND_EXPAND_LISTS]]
- # COMMAND ${CMAKE_COMMAND} -E copy
- # # 拷贝Gmsh执行程序
- # ${Gmsh_BINARY_DIRS}
- # $<TARGET_FILE_DIR:${PROJECT_NAME}>
- COMMAND ${CMAKE_COMMAND} -E copy
- # 拷贝CFD执行程序
- ${CFD_EXECUTABLE}
- $<TARGET_FILE_DIR:${PROJECT_NAME}>
-
- COMMAND ${CMAKE_COMMAND} -E copy
- # 拷贝IR执行程序
- ${IR_EXECUTABLE}
- $<TARGET_FILE_DIR:${PROJECT_NAME}>
- COMMAND ${CMAKE_COMMAND} -E copy
- # 拷贝Ps-Tools执行程序
- ${CMAKE_SOURCE_DIR}/extlib/PSTools/pssuspend.exe
- $<TARGET_FILE_DIR:${PROJECT_NAME}>
- COMMAND ${CMAKE_COMMAND} -E copy_directory
- # 拷贝python的Lib文件夹
- ${Python_DIRS}/Lib
- $<TARGET_FILE_DIR:${PROJECT_NAME}>/Lib
- COMMAND ${CMAKE_COMMAND} -E copy_directory
- # 拷贝python的DLLs文件夹
- ${Python_DIRS}/DLLs
- $<TARGET_FILE_DIR:${PROJECT_NAME}>/DLLs
- COMMAND ${CMAKE_COMMAND} -E copy_directory
- # 拷贝python的tcl文件夹
- ${Python_DIRS}/tcl
- $<TARGET_FILE_DIR:${PROJECT_NAME}>/tcl
- COMMAND ${CMAKE_COMMAND} -E copy
- # 拷贝python执行程序
- ${Python_EXECUTABLE}
- $<TARGET_FILE_DIR:${PROJECT_NAME}>
- COMMAND ${CMAKE_COMMAND} -E copy_directory
- # 拷贝Qt图片格式支持文件
- ${_qt_bin_dir}/../plugins/imageformats
- $<TARGET_FILE_DIR:${PROJECT_NAME}>/imageformats
- COMMAND ${CMAKE_COMMAND} -E copy_directory
- # 拷贝Qt平台支持文件
- ${_qt_bin_dir}/../plugins/platforms
- $<TARGET_FILE_DIR:${PROJECT_NAME}>/platforms
- COMMAND ${CMAKE_COMMAND} -E copy
- # 拷贝licensecc库
- ${licensecc_LIB}
- $<TARGET_FILE_DIR:${PROJECT_NAME}>
- COMMAND ${CMAKE_COMMAND} -E copy
- ${CMAKE_SOURCE_DIR}/src/CFD/reprocess.py
- ${CMAKE_SOURCE_DIR}/src/IR/irPlot.py
- $<TARGET_FILE_DIR:${PROJECT_NAME}>
- COMMAND ${CMAKE_COMMAND} -E copy_directory
- ${CMAKE_SOURCE_DIR}/extlib/Database
- $<TARGET_FILE_DIR:${PROJECT_NAME}>/Database
- COMMAND ${CMAKE_COMMAND} -E copy_directory
- # 拷贝cart需要的数据库目录
- ${CART_DIRS}/USER
- $<TARGET_FILE_DIR:${PROJECT_NAME}>/USER
- COMMAND ${CMAKE_COMMAND} -E copy_directory
- # 拷贝cart需要的数据库目录
- ${CART_DIRS}/DATA
- $<TARGET_FILE_DIR:${PROJECT_NAME}>/DATA
- COMMAND ${CMAKE_COMMAND} -E copy_directory
- # 拷贝cart需要的数据库目录
- ${CART_DIRS}/INPUT
- $<TARGET_FILE_DIR:${PROJECT_NAME}>/INPUT
- COMMAND ${CMAKE_COMMAND} -E copy_directory
- # 拷贝cart需要的数据库目录
- ${CART_DIRS}/OUTPUT
- $<TARGET_FILE_DIR:${PROJECT_NAME}>/OUTPUT
- COMMAND ${CMAKE_COMMAND} -E copy
- # 拷贝cart需要的库
- ${CART_DIRS}/msvcr110.dll
- ${CART_DIRS}/svml_dispmd.dll
- ${CART_DIRS}/Licensecode.txt
- $<TARGET_FILE_DIR:${PROJECT_NAME}>
- COMMAND ${CMAKE_COMMAND} -E copy_directory
- # 拷贝Modtran的Lib文件夹
- ${MODTRAN_DIRS}
- $<TARGET_FILE_DIR:${PROJECT_NAME}>/Modtran
- COMMAND ${CMAKE_COMMAND} -E copy_directory
- # 拷贝ParaView的Lib文件夹
- ${PARAVIEW_DIRS}
- $<TARGET_FILE_DIR:${PROJECT_NAME}>/ParaView
- COMMAND ${CMAKE_COMMAND} -E copy_directory
- # 拷贝mesh文件夹
- ${Gmsh_DIRS}/mesh
- $<TARGET_FILE_DIR:${PROJECT_NAME}>/mesh
- COMMAND ${CMAKE_COMMAND} -E copy_directory
- # 拷贝tecplot
- ${CMAKE_SOURCE_DIR}/extlib/tecplot
- $<TARGET_FILE_DIR:${PROJECT_NAME}>/Tecplot
- )
- endif()
- else()
- if(NOT EXISTS "$<TARGET_FILE_DIR:${PROJECT_NAME}>/GJDM.ini")
- get_target_property(_qmake_executable Qt5::qmake IMPORTED_LOCATION)
- get_filename_component(_qt_bin_dir "${_qmake_executable}" DIRECTORY)
-
- foreach(_lib ${FastCAE_Runtimes_Libraries})
- add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
- COMMAND ${CMAKE_COMMAND} -E copy
- $<TARGET_LINKER_FILE:${_lib}>
- $<TARGET_SONAME_FILE:${_lib}>
- $<TARGET_FILE_DIR:PythonModule>
- )
- endforeach()
- add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
- COMMAND ${CMAKE_COMMAND} -E copy
- ${Gmsh_EXECUTABLE}
- $<TARGET_FILE_DIR:${PROJECT_NAME}>
- COMMAND ${CMAKE_COMMAND} -E copy_directory
- # 拷贝python的python3.12文件夹
- ${Python_DIRS}/lib/python${Python_VERSION_MAJOR}.${Python_VERSION_MINOR}
- $<TARGET_FILE_DIR:PythonModule>/python${Python_VERSION_MAJOR}.${Python_VERSION_MINOR}
- COMMAND ${CMAKE_COMMAND} -E copy_directory
- # 拷贝Qt图片格式支持文件
- ${_qt_bin_dir}/../plugins/imageformats
- $<TARGET_FILE_DIR:${PROJECT_NAME}>/imageformats
- COMMAND ${CMAKE_COMMAND} -E copy_directory
- ${_qt_bin_dir}/../plugins/platforms
- $<TARGET_FILE_DIR:${PROJECT_NAME}>/platforms
- COMMAND ${CMAKE_COMMAND} -E copy_directory
- ${_qt_bin_dir}/../plugins/platforminputcontexts
- $<TARGET_FILE_DIR:${PROJECT_NAME}>/platforminputcontexts
- COMMAND ${CMAKE_COMMAND} -E copy_directory
- ${_qt_bin_dir}/../plugins/xcbglintegrations
- $<TARGET_FILE_DIR:${PROJECT_NAME}>/xcbglintegrations
- COMMAND ${CMAKE_COMMAND} -E copy
- $<TARGET_LINKER_FILE:Qt5::XcbQpa>
- $<TARGET_SONAME_FILE:Qt5::XcbQpa>
- $<TARGET_FILE_DIR:PythonModule>
- )
- file(
- COPY
- # 拷贝Qt多国语言支持文件
- ${_qt_bin_dir}/../lib
- DESTINATION ${DEVRUNTIME_LIBDIR}/..
- USE_SOURCE_PERMISSIONS
- FILES_MATCHING
- PATTERN "cmake*" EXCLUDE
- PATTERN "pkgconfig*" EXCLUDE
- PATTERN "libicu*.so*"
- )
- endif()
- endif()
- #配置文件,python脚本,有可能会修改,每次构建都会拷贝
- add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
- COMMAND ${CMAKE_COMMAND} -E copy_if_different
- ${CMAKE_SOURCE_DIR}/src/PythonModule/py/GJDM.ini
- ${CMAKE_SOURCE_DIR}/src/PythonModule/py/CAD.py
- ${CMAKE_SOURCE_DIR}/src/PythonModule/py/Case.py
- ${CMAKE_SOURCE_DIR}/src/PythonModule/py/ControlPanel.py
- ${CMAKE_SOURCE_DIR}/src/PythonModule/py/Geometry.py
- ${CMAKE_SOURCE_DIR}/src/PythonModule/py/MainWindow.py
- ${CMAKE_SOURCE_DIR}/src/PythonModule/py/Material.py
- ${CMAKE_SOURCE_DIR}/src/PythonModule/py/Mesh.py
- ${CMAKE_SOURCE_DIR}/src/PythonModule/py/Mesher.py
- ${CMAKE_SOURCE_DIR}/src/PythonModule/py/Post.py
- ${CMAKE_SOURCE_DIR}/src/PythonModule/py/PostProcess.py
- $<TARGET_FILE_DIR:${PROJECT_NAME}>
- )
- endif()
|