diff --git a/CMakeLists.txt b/CMakeLists.txt index aee44168..df6e5184 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,7 +6,13 @@ set(NOSTALGIA_BUILD_TYPE "Native" CACHE STRING "The type of build to produce(Nat set(NOSTALGIA_IDE_BUILD "ON" CACHE STRING "Build for IDE's to run") set(NOSTALGIA_QT_PATH "" CACHE STRING "Path to Qt Libraries") -set(CMAKE_PREFIX_PATH ${NOSTALGIA_QT_PATH}) +if(NOSTALGIA_QT_PATH STREQUAL "" OR NOSTALGIA_BUILD_TYPE STREQUAL "GBA") + SET(NOSTALGIA_BUILD_STUDIO FALSE) +else() + SET(NOSTALGIA_BUILD_STUDIO TRUE) + set(CMAKE_PREFIX_PATH ${NOSTALGIA_QT_PATH}) +endif() + list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/Modules) include(address_sanitizer) diff --git a/src/nostalgia/CMakeLists.txt b/src/nostalgia/CMakeLists.txt index 4953afa3..4111e6cd 100644 --- a/src/nostalgia/CMakeLists.txt +++ b/src/nostalgia/CMakeLists.txt @@ -1,7 +1,7 @@ #setup libraries -if(NOT NOSTALGIA_BUILD_TYPE STREQUAL "GBA") +if(NOSTALGIA_BUILD_STUDIO) find_package(Qt5Widgets) set(CMAKE_AUTOMOC ON) endif() @@ -13,7 +13,7 @@ add_subdirectory(common) add_subdirectory(player) add_subdirectory(world) -if(NOT NOSTALGIA_BUILD_TYPE STREQUAL "GBA") +if(NOSTALGIA_BUILD_STUDIO) add_subdirectory(tools) add_subdirectory(studio) endif() diff --git a/src/nostalgia/Makefile b/src/nostalgia/Makefile deleted file mode 100644 index 5580c8f5..00000000 --- a/src/nostalgia/Makefile +++ /dev/null @@ -1,194 +0,0 @@ -# CMAKE generated file: DO NOT EDIT! -# Generated by "Unix Makefiles" Generator, CMake Version 3.7 - -# Default target executed when no arguments are given to make. -default_target: all - -.PHONY : default_target - -# Allow only one "make -f Makefile2" at a time, but pass parallelism. -.NOTPARALLEL: - - -#============================================================================= -# Special targets provided by cmake. - -# Disable implicit rules so canonical targets will work. -.SUFFIXES: - - -# Remove some rules from gmake that .SUFFIXES does not remove. -SUFFIXES = - -.SUFFIXES: .hpux_make_needs_suffix_list - - -# Suppress display of executed commands. -$(VERBOSE).SILENT: - - -# A target that is always out of date. -cmake_force: - -.PHONY : cmake_force - -#============================================================================= -# Set environment variables for the build. - -# The shell in which to execute make rules. -SHELL = /bin/sh - -# The CMake executable. -CMAKE_COMMAND = /usr/bin/cmake - -# The command to remove a file. -RM = /usr/bin/cmake -E remove -f - -# Escaping for special characters. -EQUALS = = - -# The top-level source directory on which CMake was run. -CMAKE_SOURCE_DIR = /home/gary/projects/nostalgia - -# The top-level build directory on which CMake was run. -CMAKE_BINARY_DIR = /home/gary/projects/nostalgia - -#============================================================================= -# Targets provided globally by CMake. - -# Special rule for the target install/strip -install/strip: preinstall - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing the project stripped..." - /usr/bin/cmake -DCMAKE_INSTALL_DO_STRIP=1 -P cmake_install.cmake -.PHONY : install/strip - -# Special rule for the target install/strip -install/strip/fast: install/strip - -.PHONY : install/strip/fast - -# Special rule for the target install/local -install/local: preinstall - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing only the local directory..." - /usr/bin/cmake -DCMAKE_INSTALL_LOCAL_ONLY=1 -P cmake_install.cmake -.PHONY : install/local - -# Special rule for the target install/local -install/local/fast: install/local - -.PHONY : install/local/fast - -# Special rule for the target test -test: - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running tests..." - /usr/bin/ctest --force-new-ctest-process $(ARGS) -.PHONY : test - -# Special rule for the target test -test/fast: test - -.PHONY : test/fast - -# Special rule for the target edit_cache -edit_cache: - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "No interactive CMake dialog available..." - /usr/bin/cmake -E echo No\ interactive\ CMake\ dialog\ available. -.PHONY : edit_cache - -# Special rule for the target edit_cache -edit_cache/fast: edit_cache - -.PHONY : edit_cache/fast - -# Special rule for the target rebuild_cache -rebuild_cache: - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..." - /usr/bin/cmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) -.PHONY : rebuild_cache - -# Special rule for the target rebuild_cache -rebuild_cache/fast: rebuild_cache - -.PHONY : rebuild_cache/fast - -# Special rule for the target install -install: preinstall - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..." - /usr/bin/cmake -P cmake_install.cmake -.PHONY : install - -# Special rule for the target install -install/fast: preinstall/fast - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..." - /usr/bin/cmake -P cmake_install.cmake -.PHONY : install/fast - -# Special rule for the target list_install_components -list_install_components: - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Available install components are: \"Unspecified\"" -.PHONY : list_install_components - -# Special rule for the target list_install_components -list_install_components/fast: list_install_components - -.PHONY : list_install_components/fast - -# The main all target -all: cmake_check_build_system - cd /home/gary/projects/nostalgia && $(CMAKE_COMMAND) -E cmake_progress_start /home/gary/projects/nostalgia/CMakeFiles /home/gary/projects/nostalgia/src/nostalgia/CMakeFiles/progress.marks - cd /home/gary/projects/nostalgia && $(MAKE) -f CMakeFiles/Makefile2 src/nostalgia/all - $(CMAKE_COMMAND) -E cmake_progress_start /home/gary/projects/nostalgia/CMakeFiles 0 -.PHONY : all - -# The main clean target -clean: - cd /home/gary/projects/nostalgia && $(MAKE) -f CMakeFiles/Makefile2 src/nostalgia/clean -.PHONY : clean - -# The main clean target -clean/fast: clean - -.PHONY : clean/fast - -# Prepare targets for installation. -preinstall: all - cd /home/gary/projects/nostalgia && $(MAKE) -f CMakeFiles/Makefile2 src/nostalgia/preinstall -.PHONY : preinstall - -# Prepare targets for installation. -preinstall/fast: - cd /home/gary/projects/nostalgia && $(MAKE) -f CMakeFiles/Makefile2 src/nostalgia/preinstall -.PHONY : preinstall/fast - -# clear depends -depend: - cd /home/gary/projects/nostalgia && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1 -.PHONY : depend - -# Help Target -help: - @echo "The following are some of the valid targets for this Makefile:" - @echo "... all (the default if no target is provided)" - @echo "... clean" - @echo "... depend" - @echo "... install/strip" - @echo "... install/local" - @echo "... test" - @echo "... edit_cache" - @echo "... rebuild_cache" - @echo "... install" - @echo "... list_install_components" -.PHONY : help - - - -#============================================================================= -# Special targets to cleanup operation of make. - -# Special rule to run CMake to check the build system integrity. -# No rule that depends on this can have commands that come from listfiles -# because they might be regenerated. -cmake_check_build_system: - cd /home/gary/projects/nostalgia && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0 -.PHONY : cmake_check_build_system - diff --git a/src/nostalgia/core/CMakeLists.txt b/src/nostalgia/core/CMakeLists.txt index 69b38626..841daa46 100644 --- a/src/nostalgia/core/CMakeLists.txt +++ b/src/nostalgia/core/CMakeLists.txt @@ -9,7 +9,7 @@ if(NOSTALGIA_BUILD_TYPE STREQUAL "GBA") gba/mem.cpp gba/panic.cpp ) -elseif(NOSTALGIA_BUILD_TYPE STREQUAL "Native") +elseif(NOSTALGIA_BUILD_STUDIO) set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_AUTOMOC ON) @@ -19,6 +19,13 @@ elseif(NOSTALGIA_BUILD_TYPE STREQUAL "Native") userland/media.cpp userland/mem.cpp ) +else() + set( + CPP + qt/gfx.cpp # does not currently use any Qt stuff, but will need to replace with SDL version + userland/media.cpp + userland/mem.cpp + ) endif() add_library( @@ -27,7 +34,7 @@ add_library( core.cpp ) -if(NOSTALGIA_BUILD_TYPE STREQUAL "Native") +if(NOSTALGIA_BUILD_STUDIO) add_subdirectory(studio) endif() diff --git a/src/nostalgia/world/CMakeLists.txt b/src/nostalgia/world/CMakeLists.txt index c2285a49..47d6fb15 100644 --- a/src/nostalgia/world/CMakeLists.txt +++ b/src/nostalgia/world/CMakeLists.txt @@ -12,6 +12,6 @@ install( include/nostalgia/world ) -if(NOSTALGIA_BUILD_TYPE STREQUAL "Native") +if(NOSTALGIA_BUILD_STUDIO) add_subdirectory(studio) endif() diff --git a/src/nostalgia/world/world.hpp b/src/nostalgia/world/world.hpp index ff022adb..eab840ae 100644 --- a/src/nostalgia/world/world.hpp +++ b/src/nostalgia/world/world.hpp @@ -26,7 +26,7 @@ struct Tile { template ox::Error ioOpRead(T *io, Tile *obj) { ox::Error err = 0; - io->setFields(2); + io->setTypeInfo("nostalgia::world::Tile", 2); err |= io->op("bgTile", &obj->bgTile); err |= io->op("type", &obj->type); return err; @@ -98,14 +98,14 @@ struct Region { template ox::Error ioOpRead(T *io, Region *obj) { ox::Error err = 0; - io->setFields(Region::FIELDS); + io->setTypeInfo("nostalgia::world::Tile", Region::FIELDS); return err; } template ox::Error ioOpWrite(T *io, Region *obj) { ox::Error err = 0; - io->setFields(Region::FIELDS); + io->setTypeInfo("nostalgia::world::Tile", Region::FIELDS); return err; }