mirror of
https://github.com/wiiu-env/wut.git
synced 2024-12-13 04:22:37 +01:00
69 lines
2.3 KiB
CMake
69 lines
2.3 KiB
CMake
cmake_minimum_required(VERSION 3.2)
|
|
project(wut)
|
|
include(ExternalProject)
|
|
|
|
option(WUT_BUILD_DOCS "Build documentation" OFF)
|
|
|
|
set(DEVKITPPC $ENV{DEVKITPPC} CACHE STRING "Path to devkitPPC install")
|
|
|
|
# Check for DEVKITPPC
|
|
if(NOT DEVKITPPC)
|
|
message(FATAL_ERROR "You must have defined DEVKITPPC before calling cmake.")
|
|
endif()
|
|
|
|
set(WUT_ROOT ${CMAKE_CURRENT_SOURCE_DIR})
|
|
set(WUT_TOOLCHAIN "${CMAKE_CURRENT_SOURCE_DIR}/share/wut.toolchain.cmake")
|
|
set(WUT_STAGING "${CMAKE_BINARY_DIR}/staging")
|
|
|
|
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib")
|
|
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG "${CMAKE_BINARY_DIR}/lib")
|
|
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE "${CMAKE_BINARY_DIR}/lib")
|
|
|
|
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib")
|
|
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG "${CMAKE_BINARY_DIR}/lib")
|
|
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE "${CMAKE_BINARY_DIR}/lib")
|
|
|
|
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
|
|
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG "${CMAKE_BINARY_DIR}/bin")
|
|
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE "${CMAKE_BINARY_DIR}/bin")
|
|
|
|
if(WUT_BUILD_DOCS)
|
|
add_subdirectory(docs)
|
|
endif()
|
|
|
|
add_subdirectory(tools)
|
|
|
|
externalproject_add(cafe
|
|
SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/cafe"
|
|
CMAKE_GENERATOR "Unix Makefiles"
|
|
INSTALL_DIR "${WUT_STAGING}"
|
|
CMAKE_CACHE_ARGS
|
|
-DDEVKITPPC:string=${DEVKITPPC}
|
|
-DWUT_ROOT:filepath=${WUT_ROOT}
|
|
-DWUT_RPLIMPORTGEN:filepath=$<TARGET_FILE:rplimportgen>
|
|
-DCMAKE_TOOLCHAIN_FILE:filepath=${WUT_TOOLCHAIN}
|
|
-DCMAKE_INSTALL_PREFIX:string=<INSTALL_DIR>
|
|
DEPENDS rplimportgen
|
|
BUILD_ALWAYS 1)
|
|
|
|
externalproject_add(libraries
|
|
SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/libraries"
|
|
CMAKE_GENERATOR "Unix Makefiles"
|
|
INSTALL_DIR "${WUT_STAGING}"
|
|
CMAKE_CACHE_ARGS
|
|
-DDEVKITPPC:string=${DEVKITPPC}
|
|
-DWUT_ROOT:filepath=${WUT_ROOT}
|
|
-DCMAKE_TOOLCHAIN_FILE:filepath=${WUT_TOOLCHAIN}
|
|
-DCMAKE_INSTALL_PREFIX:string=<INSTALL_DIR>
|
|
BUILD_ALWAYS 1)
|
|
|
|
install(DIRECTORY "${CMAKE_SOURCE_DIR}/include/"
|
|
DESTINATION "${CMAKE_INSTALL_PREFIX}/include"
|
|
FILES_MATCHING PATTERN "*.h*")
|
|
|
|
install(DIRECTORY "${CMAKE_SOURCE_DIR}/share/"
|
|
DESTINATION "${CMAKE_INSTALL_PREFIX}/share")
|
|
|
|
install(DIRECTORY "${CMAKE_BINARY_DIR}/staging/"
|
|
DESTINATION "${CMAKE_INSTALL_PREFIX}")
|