chore: Refactor CMakeLists.txt and app.cmake files for better organization
This commit is contained in:
@@ -1,16 +1,18 @@
|
||||
# Yet Another Zelda3 Editor
|
||||
# by scawful
|
||||
cmake_minimum_required(VERSION 3.10)
|
||||
project(yaze VERSION 0.2.0)
|
||||
project(yaze VERSION 0.2.0
|
||||
DESCRIPTION "Yet Another Zelda3 Editor"
|
||||
LANGUAGES CXX)
|
||||
|
||||
# Build Flags
|
||||
set(YAZE_BUILD_APP ON)
|
||||
set(YAZE_BUILD_LIB ON)
|
||||
set(YAZE_BUILD_EMU ON)
|
||||
set(YAZE_BUILD_Z3ED ON)
|
||||
set(YAZE_BUILD_PYTHON ON)
|
||||
set(YAZE_BUILD_CLIB ON)
|
||||
set(YAZE_INSTALL_CLIB OFF)
|
||||
set(YAZE_BUILD_PYTHON OFF)
|
||||
set(YAZE_BUILD_TESTS OFF)
|
||||
set(YAZE_INSTALL_LIB OFF)
|
||||
|
||||
# libpng features in bitmap.cc
|
||||
add_definitions("-DYAZE_LIB_PNG=1")
|
||||
|
||||
@@ -1,33 +1,3 @@
|
||||
set(
|
||||
YAZE_APP_CORE_SRC
|
||||
app/core/common.cc
|
||||
app/core/controller.cc
|
||||
app/core/labeling.cc
|
||||
app/emu/emulator.cc
|
||||
app/core/message.cc
|
||||
)
|
||||
|
||||
set(
|
||||
YAZE_APP_GFX_SRC
|
||||
app/gfx/bitmap.cc
|
||||
app/gfx/compression.cc
|
||||
app/gfx/scad_format.cc
|
||||
app/gfx/snes_palette.cc
|
||||
app/gfx/snes_tile.cc
|
||||
app/gfx/snes_color.cc
|
||||
app/gfx/tilesheet.cc
|
||||
)
|
||||
|
||||
set(
|
||||
YAZE_GUI_SRC
|
||||
app/gui/asset_browser.cc
|
||||
app/gui/canvas.cc
|
||||
app/gui/input.cc
|
||||
app/gui/style.cc
|
||||
app/gui/color.cc
|
||||
app/gui/zeml.cc
|
||||
)
|
||||
|
||||
set(
|
||||
YAZE_APP_EMU_SRC
|
||||
app/emu/audio/apu.cc
|
||||
@@ -44,30 +14,6 @@ set(
|
||||
app/emu/snes.cc
|
||||
)
|
||||
|
||||
if (WIN32 OR MINGW OR UNIX AND NOT APPLE)
|
||||
list(APPEND YAZE_APP_CORE_SRC
|
||||
app/core/platform/font_loader.cc
|
||||
app/core/platform/clipboard.cc
|
||||
app/core/platform/file_dialog.cc
|
||||
)
|
||||
endif()
|
||||
|
||||
if(APPLE)
|
||||
list(APPEND YAZE_APP_CORE_SRC
|
||||
app/core/platform/file_dialog.mm
|
||||
app/core/platform/app_delegate.mm
|
||||
app/core/platform/font_loader.mm
|
||||
app/core/platform/clipboard.mm
|
||||
app/core/platform/file_path.mm
|
||||
)
|
||||
|
||||
find_library(COCOA_LIBRARY Cocoa)
|
||||
if(NOT COCOA_LIBRARY)
|
||||
message(FATAL_ERROR "Cocoa not found")
|
||||
endif()
|
||||
set(CMAKE_EXE_LINKER_FLAGS "-framework ServiceManagement -framework Foundation -framework Cocoa")
|
||||
endif()
|
||||
|
||||
if (YAZE_BUILD_APP)
|
||||
include(app/app.cmake)
|
||||
endif()
|
||||
@@ -119,7 +65,7 @@ endif()
|
||||
|
||||
include(test/CMakeLists.txt)
|
||||
|
||||
if (YAZE_BUILD_CLIB)
|
||||
if (YAZE_BUILD_LIB)
|
||||
# Yaze C API
|
||||
add_library(
|
||||
yaze_c SHARED
|
||||
@@ -154,7 +100,7 @@ target_link_libraries(
|
||||
ImGui
|
||||
)
|
||||
|
||||
if (YAZE_INSTALL_CLIB)
|
||||
if (YAZE_INSTALL_LIB)
|
||||
install(TARGETS yaze_c
|
||||
RUNTIME DESTINATION bin
|
||||
LIBRARY DESTINATION lib
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
include(app/core/core.cmake)
|
||||
include(app/editor/editor.cmake)
|
||||
include(app/gfx/gfx.cmake)
|
||||
include(app/gui/gui.cmake)
|
||||
include(app/zelda3/zelda3.cmake)
|
||||
|
||||
add_executable(
|
||||
|
||||
32
src/app/core/core.cmake
Normal file
32
src/app/core/core.cmake
Normal file
@@ -0,0 +1,32 @@
|
||||
set(
|
||||
YAZE_APP_CORE_SRC
|
||||
app/core/common.cc
|
||||
app/core/controller.cc
|
||||
app/core/labeling.cc
|
||||
app/emu/emulator.cc
|
||||
app/core/message.cc
|
||||
)
|
||||
|
||||
if (WIN32 OR MINGW OR UNIX AND NOT APPLE)
|
||||
list(APPEND YAZE_APP_CORE_SRC
|
||||
app/core/platform/font_loader.cc
|
||||
app/core/platform/clipboard.cc
|
||||
app/core/platform/file_dialog.cc
|
||||
)
|
||||
endif()
|
||||
|
||||
if(APPLE)
|
||||
list(APPEND YAZE_APP_CORE_SRC
|
||||
app/core/platform/file_dialog.mm
|
||||
app/core/platform/app_delegate.mm
|
||||
app/core/platform/font_loader.mm
|
||||
app/core/platform/clipboard.mm
|
||||
app/core/platform/file_path.mm
|
||||
)
|
||||
|
||||
find_library(COCOA_LIBRARY Cocoa)
|
||||
if(NOT COCOA_LIBRARY)
|
||||
message(FATAL_ERROR "Cocoa not found")
|
||||
endif()
|
||||
set(CMAKE_EXE_LINKER_FLAGS "-framework ServiceManagement -framework Foundation -framework Cocoa")
|
||||
endif()
|
||||
@@ -11,7 +11,7 @@
|
||||
#include "app/gfx/scad_format.h"
|
||||
#include "app/gfx/snes_palette.h"
|
||||
#include "app/gfx/snes_tile.h"
|
||||
#include "app/gui/asset_browser.h"
|
||||
#include "app/gui/modules/asset_browser.h"
|
||||
#include "app/gui/canvas.h"
|
||||
#include "app/gui/color.h"
|
||||
#include "app/gui/input.h"
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#include "app/editor/utils/editor.h"
|
||||
#include "app/gfx/bitmap.h"
|
||||
#include "app/gfx/snes_tile.h"
|
||||
#include "app/gui/asset_browser.h"
|
||||
#include "app/gui/modules/asset_browser.h"
|
||||
#include "app/gui/canvas.h"
|
||||
#include "app/gui/input.h"
|
||||
#include "app/rom.h"
|
||||
|
||||
10
src/app/gfx/gfx.cmake
Normal file
10
src/app/gfx/gfx.cmake
Normal file
@@ -0,0 +1,10 @@
|
||||
set(
|
||||
YAZE_APP_GFX_SRC
|
||||
app/gfx/bitmap.cc
|
||||
app/gfx/compression.cc
|
||||
app/gfx/scad_format.cc
|
||||
app/gfx/snes_palette.cc
|
||||
app/gfx/snes_tile.cc
|
||||
app/gfx/snes_color.cc
|
||||
app/gfx/tilesheet.cc
|
||||
)
|
||||
9
src/app/gui/gui.cmake
Normal file
9
src/app/gui/gui.cmake
Normal file
@@ -0,0 +1,9 @@
|
||||
set(
|
||||
YAZE_GUI_SRC
|
||||
app/gui/modules/asset_browser.cc
|
||||
app/gui/canvas.cc
|
||||
app/gui/input.cc
|
||||
app/gui/style.cc
|
||||
app/gui/color.cc
|
||||
app/gui/zeml.cc
|
||||
)
|
||||
Reference in New Issue
Block a user