Friday, August 5, 2022
HomeGame DevelopmentHow one can copy file in native/engine/ios to construct/ios/proj ? cc 3.5.2...

How one can copy file in native/engine/ios to construct/ios/proj ? cc 3.5.2 – Cocos Creator


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
image

it’s didn’t construct. Do you imply ${CMAKE_BINARY_DIR) on this folder ?
image

@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

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments