ref: 9a69eb1940dc9469f48a10a9d6dee302766e78d4
parent: c34dca177af8139fd3fc735036b0aa881c4ead1f
author: Iliyas Jorio <iliyas@jor.io>
date: Wed Feb 2 11:39:50 EST 2022
Simplify CMakeLists.txt
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.16)
-project(Candy_Crisis)
+project(CandyCrisis)
set(CMAKE_CXX_STANDARD 17)
@@ -8,76 +8,8 @@
find_package( SDL2_image REQUIRED)
include_directories(${SDL2_INCLUDE_DIRS} ${SDL2_IMAGE_INCLUDE_DIRS})
-include_directories(.)
+file(GLOB_RECURSE GAME_SOURCES CONFIGURE_DEPENDS src/*.cpp src/*.c src/*.h)
-add_executable(Candy_Crisis
- src/support/cmixer.cpp
- src/support/cmixer.h
- src/support/ibxm.c
- src/support/ibxm.h
- src/support/ModStream.cpp
- src/support/ModStream.h
- src/blitter.cpp
- src/blitter.h
- src/CandyCrisis.cpp
- src/CandyCrisis.h
- src/control.cpp
- src/control.h
- src/font.cpp
- src/font.h
- src/gameticks.cpp
- src/gameticks.h
- src/graphics.cpp
- src/graphics.h
- src/graymonitor.cpp
- src/graymonitor.h
- src/grays.cpp
- src/grays.h
- src/gworld.cpp
- src/gworld.h
- src/hiscore.cpp
- src/hiscore.h
- src/keyselect.cpp
- src/keyselect.h
- src/level.cpp
- src/level.h
- src/main.cpp
- src/main.h
- src/moving.cpp
- src/moving.h
- src/MTypes.cpp
- src/MTypes.h
- src/music.cpp
- src/music.h
- src/next.cpp
- src/next.h
- src/opponent.cpp
- src/opponent.h
- src/pause.cpp
- src/pause.h
- src/players.cpp
- src/players.h
- src/prefs.cpp
- src/prefs.h
- src/random.cpp
- src/random.h
- src/Resource.h
- src/score.cpp
- src/score.h
- src/SDLU.cpp
- src/SDLU.h
- src/soundfx.cpp
- src/soundfx.h
- src/stdafx.cpp
- src/stdafx.h
- src/targetver.h
- src/tutorial.cpp
- src/tutorial.h
- src/tweak.cpp
- src/tweak.h
- src/victory.cpp
- src/victory.h
- src/zap.cpp
- src/zap.h)
+add_executable(CandyCrisis ${GAME_SOURCES})
-target_link_libraries(Candy_Crisis ${SDL2_LIBRARIES} ${SDL2_IMAGE_LIBRARIES} SDL2 SDL2_image)
+target_link_libraries(CandyCrisis ${SDL2_LIBRARIES} ${SDL2_IMAGE_LIBRARIES} SDL2 SDL2_image)