I am studying a C ++ developer writing a game first on a Mac platform using Xcode, but now moving to the platform using CMake. For now, I can compile it on my ickle linux netbook, and I am building a development environment on this machine for encoding. However, I find that gcc recompiles every file whenever I make changes. Obviously, I need additional customization for CMakeLists.txt. My current is very simple. Thus,
cmake_minimum_required (VERSION 2.8)
set (source
Creature.cpp
DisplayManager.cpp
Engine.cpp
EngineState.cpp
Entity.cpp
GameWorld.cpp
GfxSFML.cpp
Item.cpp
Map.cpp
Position.cpp
Projectile.cpp
ScreenTile.cpp
SquadAI.cpp
Terrain.cpp
UIButton.cpp
UICharPanel.cpp
UIView.cpp
Utility.cpp
Weapon.cpp
fov.cpp
main.cpp
)
find_package (OpenAL)
find_package (OpenGL)
find_package (SFML)
set(CMAKE_CXX_FLAGS "-g -Wall -pg")
add_executable (tractionedge ${source})
target_link_libraries(tractionedge ${SFML_LIBRARY} ${OPENGL_LIBRARY} ${OPENAL_LIBRARY})
So far, I have concentrated on C ++ as a language, rather than building systems, sticking with Xcode for everything. My knowledge of Autotools (make?) And Gcc is very limited. How can gcc only recompile a modified source?
user253094
source
share