From 978bf41ab07bec590afec5c39aeec46811c507ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Ortega=20Froysa?= Date: Tue, 31 Mar 2026 11:17:27 +0200 Subject: [PATCH] Rewrite parts of CMakeLists.txt. --- CMakeLists.txt | 37 ++++++++++++++++++++++++------------- 1 file changed, 24 insertions(+), 13 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c7d3209..856f59e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,10 +15,12 @@ # along with this program. If not, see . cmake_minimum_required(VERSION 3.10) -project(SpaceShipSim C) - -set(TARGET_NAME "spaceshipsim") -set(TARGET_VERSION "0.6") +project(spaceshipsim + VERSION 0.6 + SPDX_LICENSE "GPL-3.0-or-later" + DESCRIPTION "A simulation of a 2D space ship in the frictionless environment of space." + HOMEPAGE_URL "https://code.ortegas.org/nortega/spaceshipsim" + LANGUAGES C) if(NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE "release") @@ -42,13 +44,22 @@ include_directories( SYSTEM ${ALLEG5_INCLUDE_DIRS}) set(SRCS - src/event_manager.c - src/main.c - src/planet.c - src/ship.c - src/starfield.c) + "src/event_manager.c" + "src/main.c" + "src/planet.c" + "src/ship.c" + "src/starfield.c" +) -add_definitions(-DVERSION="${TARGET_VERSION}") +set(HDRS + "src/event_manager.h" + "src/globals.h" + "src/planet.h" + "src/ship.h" + "src/starfield.h" +) + +add_definitions(-DVERSION="${PROJECT_VERSION}") if(${CMAKE_BUILD_TYPE} STREQUAL "debug" OR ${CMAKE_BUILD_TYPE} STREQUAL "relwithdebinfo") add_definitions(-DDEBUG) @@ -56,14 +67,14 @@ else() add_definitions(-DNDEBUG) endif() -add_executable(${TARGET_NAME} ${SRCS}) +add_executable(${PROJECT_NAME} ${SRCS} ${HDRS}) -target_link_libraries(${TARGET_NAME} +target_link_libraries(${PROJECT_NAME} m # math library ${ALLEG5_LIBRARIES} ${ALLEG5-PRIM_LIBRARIES} ${ALLEG5-FONT_LIBRARIES}) -install(TARGETS ${TARGET_NAME} +install(TARGETS ${PROJECT_NAME} RUNTIME DESTINATION bin/ CONFIGURATIONS release minsizerel)