Closed Nordsoft91 closed 9 months ago
If you're using GLOB
or GLOB_RECURSE
in your project CMakeLists.txt
, then that would most likely be the source of the problem, and has nothing to do with Axmol.
Check this section in the file:
file(GLOB_RECURSE GAME_HEADER
Source/*.h
)
file(GLOB_RECURSE GAME_SOURCE
Source/*.cpp
)
From the CMake docs:
It only takes you a few seconds to manually add a new cpp/h file reference to CMakeLists.txt
, so save yourself the hassle and avoid using GLOB
/GLOB_RECURSE
.
Yes, but CMakeLists.txt is generated by axmol automatically and it's quite big. Possible solution would be to generate short CMakeLists.txt in Source
directory automatically which will be much shorter and contain (almost) those lines and include it in root CMakeLists.txt. Thus will be much easier to work with it.
I replaced adding of sources in root CMakeLists.txt:
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/Source)
Now Source/CMakeLists.txt
:
# The common cross-platforms source files and header files
file(GLOB_RECURSE GAME_HEADER
*.h
)
file(GLOB_RECURSE GAME_SOURCE
*.cpp
)
set(GAME_HEADER ${GAME_HEADER} PARENT_SCOPE)
set(GAME_SOURCE ${GAME_SOURCE} PARENT_SCOPE)
Try add param: -force
Yes, but CMakeLists.txt is generated by axmol automatically and it's quite big. Possible solution would be to generate short CMakeLists.txt in
Source
directory automatically which will be much shorter and contain (almost) those lines and include it in root CMakeLists.txt. Thus will be much easier to work with it.
That is something developers would most likely be doing already, but it may help to add it to the project templates just to make things a little clearer. Consider submitting a PR with the change.
axmol build -p osx -a x64 -configOnly
build_x64
folder and open .xcodeproj with XCodeSource
folderaxmol build -p osx -a x64 -configOnly
againExpected: xcode project is updated, new source file is added Actual: nothing changed, to get actual update you must delete CMakeCache.txt and do full rebuild