nostalgia/CMakeLists.txt

79 lines
2.2 KiB
CMake
Raw Normal View History

cmake_minimum_required(VERSION 3.19)
set(CMAKE_POLICY_DEFAULT_CMP0110 NEW) # requires CMake 3.19
2016-03-26 15:49:05 -05:00
if(BUILDCORE_TARGET STREQUAL "gba")
project(nostalgia ASM CXX)
elseif(APPLE)
project(nostalgia C CXX OBJC OBJCXX)
else()
project(nostalgia C CXX)
endif()
2016-03-26 15:49:05 -05:00
include(deps/buildcore/base.cmake)
set(NOSTALGIA_BUILD_PLAYER ON CACHE BOOL "Build Player")
set(NOSTALGIA_BUILD_STUDIO ON CACHE BOOL "Build Studio")
set(OX_ENABLE_TRACEHOOK OFF CACHE BOOL "Generate OxTraceHook shared library for uprobes")
if(BUILDCORE_TARGET STREQUAL "gba")
set(NOSTALGIA_BUILD_STUDIO OFF)
set(TURBINE_BUILD_TYPE "GBA")
include(deps/gbabuildcore/base.cmake)
else()
set(TURBINE_BUILD_TYPE "Native")
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
endif()
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
if(APPLE)
set(CMAKE_MACOSX_RPATH OFF)
set(CMAKE_INSTALL_NAME_DIR "@executable_path/../Library/nostalgia")
2023-12-16 10:35:28 -06:00
set(NOSTALGIA_DIST_BIN NostalgiaStudio.app/Contents/MacOS)
set(NOSTALGIA_DIST_LIB NostalgiaStudio.app/Contents/Library)
set(NOSTALGIA_DIST_MODULE NostalgiaStudio.app/Contents/Plugins)
set(NOSTALGIA_DIST_RESOURCES NostalgiaStudio.app/Contents/Resources)
set(NOSTALGIA_DIST_MAC_APP_CONTENTS NostalgiaStudio.app/Contents)
2017-10-17 19:16:22 -05:00
else()
if(UNIX)
set(BUILD_SHARED_LIBS ON)
endif()
set(CMAKE_INSTALL_RPATH "$ORIGIN/../lib")
2017-10-17 19:16:22 -05:00
set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
set(NOSTALGIA_DIST_BIN bin)
set(NOSTALGIA_DIST_LIB lib)
set(NOSTALGIA_DIST_MODULE lib)
set(NOSTALGIA_DIST_RESOURCES share)
2017-10-17 19:16:22 -05:00
endif()
add_subdirectory(deps/ox)
2021-05-16 13:04:32 -05:00
include_directories(
deps/ox/src
2021-05-16 13:04:32 -05:00
)
add_subdirectory(deps/teagba)
if(NOT BUILDCORE_TARGET STREQUAL "gba")
include_directories(
SYSTEM
2022-07-09 20:20:37 -05:00
deps/glfw/deps
deps/glfw/include
deps/imgui
deps/imgui/backends
deps/nfde/src/include
2023-08-08 23:58:08 -05:00
/usr/local/include
)
2022-07-09 20:20:37 -05:00
add_subdirectory(deps/glad)
set(GLFW_BUILD_EXAMPLES OFF)
set(GLFW_BUILD_TESTS OFF)
set(GLFW_BUILD_DOCS OFF)
add_subdirectory(deps/glfw)
2023-12-11 22:54:55 -06:00
add_subdirectory(deps/glutils)
2021-05-16 13:04:32 -05:00
add_subdirectory(deps/imgui)
add_subdirectory(deps/lodepng)
add_subdirectory(deps/nfde)
endif()
2016-03-26 15:49:05 -05:00
add_subdirectory(src)