I’ve a Podfile in folder native/ios . How one can mechanically copy it to folder construct/ios/proj after click on construct in cocos creator ?
There’s a downside with utilizing CocoaPods with CMake. Each time you regenerate the Xcode mission file with cmake, the earlier CocoaPods settings can be reset.
So you should allow the choice to skip Xcode mission updates, after which copy the Podfile.
Copying recordsdata may be performed with add_custom_commands
or utilizing the construct plugin.
2 Likes
Thanks for reply. The place to place add_custom_commands code ? is it in native/engine/ios/CMakeLists.txt ? @PatriceJiang
Are you able to write instance for me when use add_custom_commands ? @PatriceJiang
add_custom_command(TARGET ${target_name} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${file_path} ${CMAKE_BINARY_DIR}/${filename}
)
Do you imply like this ? @PatriceJiang . It’s not working
The motion may be set off after construct the goal with Xcode.
The copy vacation spot is inaccurate
add_custom_command(TARGET ${EXECUTABLE_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_LIST_DIR}/Podfile ${CMAKE_BINARY_DIR}/Podfile
)
If you should copy file throughout producing the Xcode mission, you should utilize file(COPY
)
file(COPY ${CMAKE_CURRENT_LIST_DIR}/Podfile ${CMAKE_BINARY_DIR}/Podfile)
Oh. I believed it should copy podfile after i click on construct in cocos creator
it’s didn’t construct. Do you imply ${CMAKE_BINARY_DIR) on this folder ?
@PatriceJiang I’ve construction mission like this
MyProject
→ native → ios → CMakeLists.txt
→ build->ios->proj
I need to copy file in native/ios to construct/ios/proj after i click on construct in cocos creator construct device