2020-11-21 23:25:44 -06:00
|
|
|
cmake_minimum_required(VERSION 3.19)
|
|
|
|
set(CMAKE_POLICY_DEFAULT_CMP0110 NEW) # requires CMake 3.19
|
2016-03-26 15:49:05 -05:00
|
|
|
|
2017-05-12 16:28:59 -05:00
|
|
|
project(nostalgia)
|
2016-03-26 15:49:05 -05:00
|
|
|
|
2021-03-26 22:02:33 -05:00
|
|
|
include(deps/buildcore/base.cmake)
|
2021-03-02 21:02:16 -06:00
|
|
|
|
2020-05-04 18:22:42 -05:00
|
|
|
set(NOSTALGIA_BUILD_PLAYER ON CACHE BOOL "Build Player")
|
2020-02-09 21:43:56 -06:00
|
|
|
set(NOSTALGIA_BUILD_STUDIO ON CACHE BOOL "Build Studio")
|
2021-03-02 21:02:16 -06:00
|
|
|
set(OX_ENABLE_TRACEHOOK OFF CACHE BOOL "Generate OxTraceHook shared library for uprobes")
|
|
|
|
|
|
|
|
if(BUILDCORE_TARGET STREQUAL "gba")
|
2021-04-03 02:40:57 -05:00
|
|
|
set(NOSTALGIA_BUILD_STUDIO OFF)
|
2021-03-02 21:02:16 -06:00
|
|
|
set(NOSTALGIA_BUILD_TYPE "GBA")
|
2021-04-03 02:40:57 -05:00
|
|
|
include(deps/gbabuildcore/base.cmake)
|
2021-03-02 21:02:16 -06:00
|
|
|
else()
|
|
|
|
set(NOSTALGIA_BUILD_TYPE "Native")
|
2021-03-28 00:58:15 -05:00
|
|
|
set(NOSTALGIA_CONAN_PATHS ${CMAKE_SOURCE_DIR}/.conanbuild/conan_paths.cmake)
|
2021-04-03 02:40:57 -05:00
|
|
|
if(EXISTS ${NOSTALGIA_CONAN_PATHS})
|
2021-03-28 00:58:15 -05:00
|
|
|
include(${NOSTALGIA_CONAN_PATHS})
|
|
|
|
endif()
|
2019-12-06 01:11:30 -06:00
|
|
|
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
|
|
|
endif()
|
2018-03-13 20:21:18 -05:00
|
|
|
|
2017-10-20 22:14:33 -05:00
|
|
|
if(APPLE)
|
|
|
|
set(CMAKE_MACOSX_RPATH OFF)
|
|
|
|
set(CMAKE_INSTALL_NAME_DIR "@executable_path/../Library/nostalgia")
|
2018-02-14 21:05:20 -06:00
|
|
|
set(NOSTALGIA_DIST_BIN nostalgia-studio.app/Contents/MacOS)
|
|
|
|
set(NOSTALGIA_DIST_LIB nostalgia-studio.app/Contents/Library)
|
2020-12-17 20:40:23 -06:00
|
|
|
set(NOSTALGIA_DIST_MODULE nostalgia-studio.app/Contents/Plugins)
|
2018-02-14 21:05:20 -06:00
|
|
|
set(NOSTALGIA_DIST_RESOURCES nostalgia-studio.app/Contents/Resources)
|
|
|
|
set(NOSTALGIA_DIST_MAC_APP_CONTENTS nostalgia-studio.app/Contents)
|
2017-10-17 19:16:22 -05:00
|
|
|
else()
|
2021-03-02 21:02:16 -06:00
|
|
|
set(CMAKE_INSTALL_RPATH "$ORIGIN" "$ORIGIN/../lib/ox" "$ORIGIN/../lib/nostalgia" "$ORIGIN/../")
|
2017-10-17 19:16:22 -05:00
|
|
|
set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
|
2017-10-20 22:14:33 -05:00
|
|
|
set(NOSTALGIA_DIST_BIN bin)
|
|
|
|
set(NOSTALGIA_DIST_LIB lib)
|
2020-12-17 20:40:23 -06:00
|
|
|
set(NOSTALGIA_DIST_MODULE lib/nostalgia/modules)
|
2017-10-20 22:14:33 -05:00
|
|
|
set(NOSTALGIA_DIST_RESOURCES share)
|
2017-10-17 19:16:22 -05:00
|
|
|
endif()
|
2017-06-30 18:00:10 -05:00
|
|
|
|
2020-05-29 19:36:00 -05:00
|
|
|
add_subdirectory(deps/ox)
|
2021-05-16 13:04:32 -05:00
|
|
|
include_directories(
|
|
|
|
SYSTEM
|
2022-03-11 22:16:59 -06:00
|
|
|
deps/glfw/include
|
2021-05-16 13:04:32 -05:00
|
|
|
deps/imgui/src
|
|
|
|
deps/ox/src
|
|
|
|
)
|
2020-05-29 19:36:00 -05:00
|
|
|
|
2021-04-03 02:40:57 -05:00
|
|
|
if(BUILDCORE_TARGET STREQUAL "gba")
|
2019-11-03 23:23:43 -06:00
|
|
|
add_subdirectory(deps/gbastartup)
|
2021-05-16 13:04:32 -05:00
|
|
|
else()
|
2022-03-11 22:16:59 -06:00
|
|
|
add_subdirectory(deps/glfw)
|
2021-05-16 13:04:32 -05:00
|
|
|
add_subdirectory(deps/imgui)
|
2019-11-03 23:23:43 -06:00
|
|
|
endif()
|
|
|
|
|
2016-03-26 15:49:05 -05:00
|
|
|
add_subdirectory(src)
|