if(GJDM_ENABLE_DEV) if(SYS_WIN) if(NOT EXISTS "$/FastCAE.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 $ $ ) endforeach() # 在windows环境需要拷贝所有依赖库的dll到构建目录 add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD #[[COMMAND ${CMAKE_COMMAND} -E copy $ $ COMMAND_EXPAND_LISTS]] COMMAND ${CMAKE_COMMAND} -E copy # 拷贝Gmsh执行程序 ${Gmsh_EXECUTABLE} $ COMMAND ${CMAKE_COMMAND} -E copy # 拷贝CFD执行程序 ${CFD_EXECUTABLE} $ COMMAND ${CMAKE_COMMAND} -E copy # 拷贝IR执行程序 ${IR_EXECUTABLE} $ COMMAND ${CMAKE_COMMAND} -E copy_directory # 拷贝python的Lib文件夹 ${Python_DIRS}/Lib $/Lib COMMAND ${CMAKE_COMMAND} -E copy_directory # 拷贝python的DLLs文件夹 ${Python_DIRS}/DLLs $/DLLs COMMAND ${CMAKE_COMMAND} -E copy_directory # 拷贝Qt图片格式支持文件 ${_qt_bin_dir}/../plugins/imageformats $/imageformats COMMAND ${CMAKE_COMMAND} -E copy_directory # 拷贝Qt平台支持文件 ${_qt_bin_dir}/../plugins/platforms $/platforms ) endif() else() if(NOT EXISTS "$/FastCAE.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 $ $ $ ) endforeach() add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy ${Gmsh_EXECUTABLE} $ COMMAND ${CMAKE_COMMAND} -E copy_directory # 拷贝python的python3.12文件夹 ${Python_DIRS}/lib/python${Python_VERSION_MAJOR}.${Python_VERSION_MINOR} $/python${Python_VERSION_MAJOR}.${Python_VERSION_MINOR} COMMAND ${CMAKE_COMMAND} -E copy_directory # 拷贝Qt图片格式支持文件 ${_qt_bin_dir}/../plugins/imageformats $/imageformats COMMAND ${CMAKE_COMMAND} -E copy_directory ${_qt_bin_dir}/../plugins/platforms $/platforms COMMAND ${CMAKE_COMMAND} -E copy_directory ${_qt_bin_dir}/../plugins/platforminputcontexts $/platforminputcontexts COMMAND ${CMAKE_COMMAND} -E copy_directory ${_qt_bin_dir}/../plugins/xcbglintegrations $/xcbglintegrations COMMAND ${CMAKE_COMMAND} -E copy $ $ $ ) 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() # FastCAE的配置文件,python脚本,有可能会修改,每次构建都会拷贝 add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_SOURCE_DIR}/src/PythonModule/py/FastCAE.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 $ ) endif()