CMakeLists.txt hinzugefügt
This commit is contained in:
parent
039728b49a
commit
8292548584
35
CMakeLists.txt
Normal file
35
CMakeLists.txt
Normal file
@ -0,0 +1,35 @@
|
||||
cmake_minimum_required(VERSION 3.28)
|
||||
project(Prog3B)
|
||||
set(EXECUTABLE_NAME Prog3B)
|
||||
|
||||
# Generate compile_commands.json
|
||||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||
set(CMAKE_CXX_STANDARD 20)
|
||||
|
||||
# Set the default build type if not specified
|
||||
if(NOT CMAKE_BUILD_TYPE)
|
||||
set(CMAKE_BUILD_TYPE Release CACHE STRING "Build type" FORCE)
|
||||
endif()
|
||||
|
||||
set(SRC_FILES
|
||||
${CMAKE_CURRENT_LIST_DIR}/main.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/gamecube.cpp
|
||||
)
|
||||
|
||||
set(INCLUDE_DIRS
|
||||
${CMAKE_CURRENT_LIST_DIR}/linux
|
||||
)
|
||||
|
||||
add_executable(${EXECUTABLE_NAME} ${SRC_FILES})
|
||||
target_include_directories(${EXECUTABLE_NAME} PRIVATE ${INCLUDE_DIRS})
|
||||
target_link_libraries(${EXECUTABLE_NAME} PRIVATE
|
||||
${CMAKE_CURRENT_LIST_DIR}/linux/libgamematrix.a
|
||||
${CMAKE_CURRENT_LIST_DIR}/linux/libraylib.a
|
||||
)
|
||||
|
||||
# Checks if OSX and links appropriate frameworks (Only required on MacOS)
|
||||
if (APPLE)
|
||||
target_link_libraries(Prog3B "-framework IOKit")
|
||||
target_link_libraries(Prog3B "-framework Cocoa")
|
||||
target_link_libraries(Prog3B "-framework OpenGL")
|
||||
endif()
|
Loading…
x
Reference in New Issue
Block a user