Skip to content

Commit

Permalink
Add simple cmake script. At the moment you still need to run configur…
Browse files Browse the repository at this point in the history
…e first to generate the config.h.
  • Loading branch information
dulsi committed Aug 13, 2021
1 parent dc2016d commit 11b669e
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
Project (thrust)
CMake_Minimum_Required (VERSION 3.1)

Set (BINDIR "bin" CACHE STRING "Where to install binaries")

include(FindPkgConfig)
pkg_search_module(SDL2 REQUIRED sdl2)
pkg_search_module(SDL2_MIXER REQUIRED SDL2_mixer)

add_definitions(-DHAVE_CONFIG_H)

#Add the include directories of the (found) libraries.
Include_Directories(
${SDL2_INCLUDE_DIRS}
${SDL2_MIXER_INCLUDE_DIRS}
)

file(GLOB SOURCES src/thrust.c src/fast_gr.c src/hiscore.c src/conf.c src/things.c
src/init.c src/level.c src/font5x5.c src/graphics.c
datasrc/blks.c datasrc/ship.c datasrc/shld.c datasrc/colors.c
datasrc/bullet.c datasrc/title.c datasrc/demomove.c
datasrc/level1.c datasrc/level2.c datasrc/level3.c
datasrc/level4.c datasrc/level5.c datasrc/level6.c
datasrc/font.c
datasrc/blip.c datasrc/boom.c datasrc/boom2.c datasrc/harp.c
datasrc/engine.c datasrc/zero.c
src/sdl.c src/sdlsound.c src/sdlkey.c
)

Add_Executable (sdlthrust ${SOURCES})
Target_Link_Libraries (
sdlthrust
${SDL2_LIBRARIES}
${SDL2_MIXER_LIBRARIES}
-lm
)

Install (TARGETS sdlthrust RUNTIME DESTINATION ${BINDIR})

0 comments on commit 11b669e

Please sign in to comment.