61 lines
1.6 KiB
CMake
61 lines
1.6 KiB
CMake
cmake_minimum_required(VERSION 3.15)
|
|
project(Programmieren_3b LANGUAGES CXX)
|
|
|
|
set(CMAKE_CXX_STANDARD 17)
|
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|
|
|
include(FetchContent)
|
|
|
|
# -----------------------------
|
|
# Raylib
|
|
# -----------------------------
|
|
FetchContent_Declare(
|
|
raylib
|
|
GIT_REPOSITORY https://github.com/raysan5/raylib.git
|
|
GIT_TAG 5.0
|
|
)
|
|
FetchContent_MakeAvailable(raylib)
|
|
|
|
# -----------------------------
|
|
# pybind11
|
|
# -----------------------------
|
|
FetchContent_Declare(
|
|
pybind11
|
|
GIT_REPOSITORY https://github.com/pybind/pybind11.git
|
|
GIT_TAG v2.11.1
|
|
)
|
|
FetchContent_MakeAvailable(pybind11)
|
|
|
|
# -----------------------------
|
|
# Executable für das Spiel
|
|
# -----------------------------
|
|
add_executable(Programmieren_3b
|
|
main.cpp
|
|
gamecube.cpp
|
|
gamematrix.cpp
|
|
)
|
|
|
|
target_link_libraries(Programmieren_3b PRIVATE raylib)
|
|
|
|
# Windows-spezifische Abhängigkeiten für raylib
|
|
if(WIN32)
|
|
target_link_libraries(Programmieren_3b PRIVATE opengl32 gdi32 winmm kernel32)
|
|
endif()
|
|
|
|
target_include_directories(Programmieren_3b PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
|
|
|
|
# -----------------------------
|
|
# Python-Modul
|
|
# -----------------------------
|
|
pybind11_add_module(gamematrix_python
|
|
bindings.cpp
|
|
gamematrix.cpp
|
|
)
|
|
|
|
# Python-Modul braucht die Header
|
|
target_include_directories(gamematrix_python PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
|
|
|
|
# Raylib ist für das Python-Modul nicht nötig, nur für C++ Executable
|
|
# Optional: Falls du Gamematrix aus Python auch mit Raylib testen willst, kann man linken
|
|
# target_link_libraries(gamematrix_python PRIVATE raylib)
|