2024-07-30 16:57:32 +00:00
|
|
|
cmake_minimum_required(VERSION 3.22)
|
|
|
|
|
2024-07-29 15:59:40 +00:00
|
|
|
project(editor)
|
|
|
|
|
|
|
|
set(NAME ferx)
|
|
|
|
set(EDITOR_SOURCE_DIR src)
|
|
|
|
set(EDITOR_INCLUDE_DIR include)
|
2024-11-27 16:52:57 +00:00
|
|
|
set(EDITOR_RESOURCES_DIR ${CMAKE_CURRENT_SOURCE_DIR}/resources)
|
|
|
|
set(EDITOR_RESOURCES_DIR ${EDITOR_RESOURCES_DIR} PARENT_SCOPE)
|
2024-07-29 15:59:40 +00:00
|
|
|
|
|
|
|
file(GLOB_RECURSE EDITOR_SOURCES ${EDITOR_SOURCE_DIR}/*.cpp)
|
|
|
|
|
2024-07-30 16:57:32 +00:00
|
|
|
add_executable(${NAME})
|
2024-07-29 15:59:40 +00:00
|
|
|
|
2024-11-22 13:40:41 +00:00
|
|
|
# Add resources folder
|
|
|
|
if(CMAKE_BUILD_TYPE STREQUAL "Release")
|
|
|
|
file(COPY ${EDITOR_RESOURCES_DIR} DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
|
2024-11-22 16:15:11 +00:00
|
|
|
target_compile_definitions(${NAME} PUBLIC EDITOR_RESOURCES_PATH="${CMAKE_CURRENT_BINARY_DIR}/resources/")
|
2024-11-22 13:40:41 +00:00
|
|
|
else()
|
2024-11-27 16:52:57 +00:00
|
|
|
target_compile_definitions(${NAME} PUBLIC EDITOR_RESOURCES_PATH="${EDITOR_RESOURCES_DIR}/")
|
2024-11-22 13:40:41 +00:00
|
|
|
endif()
|
|
|
|
|
2024-07-29 15:59:40 +00:00
|
|
|
target_sources(${NAME} PRIVATE ${EDITOR_SOURCES})
|
|
|
|
target_include_directories(${NAME} PRIVATE ${EDITOR_INCLUDE_DIR})
|
|
|
|
target_link_libraries(${NAME} engine)
|