transition to cmake, caudio build mods

This commit is contained in:
Otto Naderer 2022-08-12 00:37:48 +02:00
parent 6a85967fff
commit 0e53024681
2 changed files with 61 additions and 9 deletions

57
CMakeLists.txt Normal file
View File

@ -0,0 +1,57 @@
# cmake for tes, ottona, 2022-03-09
cmake_minimum_required(VERSION 3.10)
set(FS_TARGET flasim)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_CURRENT_LIST_DIR}/lib")
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_LIST_DIR}/bin")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_LIST_DIR}/bin")
set(LIBRARY_OUTPUT_DIRECTORY ${CMAKE_LIBRARY_OUTPUT_DIRECTORY})
set(FS_EXT_DIR "${CMAKE_CURRENT_LIST_DIR}/ext")
set(FS_SRC_DIR "${CMAKE_CURRENT_LIST_DIR}/src")
#caudio stuff
option(CAUDIO_STATIC on)
set(CAUDIO_TARGET cAudio)
set(CAUDIO_DIR ${FS_EXT_DIR}/cAudio)
set(CAUDIO_INC_DIR ${FS_EXT_DIR}/cAudio/cAudio/include)
add_subdirectory(${CAUDIO_DIR})
#irrlicht stuff
set(IRRLICHT_INC_DIR /usr/include/irrlicht)
set(IRRLICHT_TARGET Irrlicht)
project(${FS_TARGET})
add_executable(flasim
${FS_SRC_DIR}/Aircraft.cpp
${FS_SRC_DIR}/Aircraft.hpp
${FS_SRC_DIR}/Dispatcher.cpp
${FS_SRC_DIR}/Dispatcher.hpp
${FS_SRC_DIR}/FireUnit.cpp
${FS_SRC_DIR}/FireUnit.hpp
${FS_SRC_DIR}/FlaSimApp.cpp
${FS_SRC_DIR}/FlaSimApp.hpp
${FS_SRC_DIR}/Globals.cpp
${FS_SRC_DIR}/Globals.hpp
${FS_SRC_DIR}/main.cpp
${FS_SRC_DIR}/TurretCamAnimator.cpp
${FS_SRC_DIR}/TurretCamAnimator.hpp
)
target_include_directories(${FS_TARGET} PRIVATE ${IRRLICHT_INC_DIR} ${CAUDIO_INC_DIR} ${CMAKE_BINARY_DIR}/include) #last is needed for caudio
target_link_libraries(${FS_TARGET}
${IRRLICHT_TARGET}
)
target_link_libraries(${FS_TARGET} ${CAUDIO_TARGET} ${IRRLICHT_TARGET})

View File

@ -14,18 +14,13 @@ About the visual content shown in the game: I did some parts myself (cannon mode
## Building flasim ## Building flasim
Currently only Linux works, should have a windows buildability in a couple of days. Currently only *Linux* works, should have a Windows buildability *in a couple of days* (yea, sure).
The game is written in QtCreator and hence uses the qmake build system. You should have gcc, qmake, irrlicht and OpenAL installed and handy. The game uses the CMake build system. Make sure you have GCC, Irrlicht and OpenAL available on your system.
### Prerequirements
1. Fetch the submodules. 1. Fetch the submodules.
1. `cd` into `ext/cAudio` and issue `cmake -DCAUDIO_BUILD_EAX_PLUGIN=ON -DCAUDIO_BUILD_MP3DECODER_PLUGIN=OFF -DCAUDIO_ENABLE_OGG=OFF -DCAUDIO_BUILD_SAMPLES=OFF -DCAUDIO_DEPENDENCIES_DIR=Dependencies64 -DCAUDIO_STATIC=ON` 1. Open `ext/cAudio/CMakeLists.txt` and head to line 29 and 30. Replace `${CMAKE_PROJECT_NAME}` by the word `cAudio`.
1. `make` cAudio 1. CMake & build *flasim*
### Build flasim
`cd` to the `prj` folder and run qmake to get a Makefile out of `flasim.pro`. Build the game using `make`. Done.
Questions? Reach me at otto@socialnerds.org Questions? Reach me at otto@socialnerds.org