50 lines
1.5 KiB
CMake
50 lines
1.5 KiB
CMake
cmake_minimum_required(VERSION 3.26)
|
|
project(simpleGame)
|
|
|
|
if(WIN32)
|
|
message(STATUS "Platform: Windows")
|
|
set(FMOD_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../FMOD")
|
|
set(CPU_THING "x64")
|
|
set(FMOD_LIB_NAME "fmod_vc")
|
|
set(FMOD_DLL_NAME "fmod.dll")
|
|
elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
|
message(STATUS "Platform: Linux")
|
|
set(FMOD_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../fmodstudioapi20307linux")
|
|
set(CPU_THING "x86_64")
|
|
set(FMOD_LIB_NAME "fmod")
|
|
set(FMOD_DLL_NAME "libfmod.so")
|
|
else()
|
|
message(FATAL_ERROR "Platform not supported, please update the CMake script.")
|
|
endif()
|
|
|
|
add_executable(simpleGame
|
|
Source/Game.cpp Include/Game.hpp Source/Main.cpp
|
|
Source/RoundTarget.cpp Include/RoundTarget.hpp
|
|
Source/AudioEmitter.cpp Include/AudioEmitter.hpp
|
|
Source/NoteSprite.cpp Include/NoteSprite.hpp
|
|
Source/NoteTile.cpp Include/NoteTile.hpp Include/NotePlaceEnum.hpp
|
|
)
|
|
|
|
target_include_directories(simpleGame PRIVATE
|
|
"Include"
|
|
"${FMOD_PATH}/api/core/inc"
|
|
)
|
|
|
|
target_link_directories(simpleGame PRIVATE
|
|
"${FMOD_PATH}/api/core/lib/${CPU_THING}"
|
|
)
|
|
|
|
target_link_libraries(simpleGame PUBLIC
|
|
sfml-graphics
|
|
${FMOD_LIB_NAME}
|
|
)
|
|
|
|
file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/../media" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}")
|
|
|
|
add_custom_command(TARGET simpleGame POST_BUILD
|
|
COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
|
"${FMOD_PATH}/api/core/lib/${CPU_THING}/${FMOD_DLL_NAME}"
|
|
"$<TARGET_FILE_DIR:simpleGame>"
|
|
)
|
|
|
|
add_subdirectory(Test)
|