mirror of
https://github.com/simtactics/niotso.git
synced 2025-03-15 08:11:22 +00:00
53 lines
No EOL
1.7 KiB
CMake
53 lines
No EOL
1.7 KiB
CMake
#########################################
|
|
#### CMake generator file for Niotso ####
|
|
cmake_minimum_required(VERSION 3.21)
|
|
project(Niotso)
|
|
|
|
enable_language(ASM)
|
|
|
|
#########################################
|
|
#### Options
|
|
option(BUILD_SHARED_LIBS "Build using shared libraries" ON) # default cmake
|
|
option(NIOTSO_BUILD_EXAMPLES "Build the render demos" ON)
|
|
option(NIOTSO_BUILD_TOOLS "Build niotso tools" ON)
|
|
|
|
if(WIN32)
|
|
set(DIST_NAME "windows" CACHE STRING "Output folder name for the _dist folder (no start or end slash)")
|
|
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
|
|
if(BUILD_SHARED_LIBS)
|
|
# TODO-jip: this is terrible for release
|
|
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
|
|
endif()
|
|
elseif(APPLE)
|
|
set(DIST_NAME "mac" CACHE STRING "Output folder name for the _dist folder (no start or end slash)")
|
|
elseif(UNIX)
|
|
set(DIST_NAME "linux" CACHE STRING "Output folder name for the _dist folder (no start or end slash)")
|
|
else()
|
|
set(DIST_NAME "unknown" CACHE STRING "Output folder name for the _dist folder (no start or end slash)")
|
|
endif()
|
|
|
|
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/_dist/${DIST_NAME}")
|
|
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/_dist/${DIST_NAME}")
|
|
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/_dist/${DIST_NAME}")
|
|
|
|
#########################################
|
|
#### Dependencies
|
|
add_subdirectory(deps)
|
|
|
|
#########################################
|
|
#### Project
|
|
add_subdirectory(niotso)
|
|
|
|
if(NIOTSO_BUILD_TOOLS)
|
|
add_subdirectory(tools)
|
|
endif()
|
|
|
|
if(NIOTSO_BUILD_EXAMPLES)
|
|
add_subdirectory(examples)
|
|
endif()
|
|
|
|
#########################################
|
|
#### Unset Options
|
|
unset(BUILD_SHARED_LIBS CACHE)
|
|
unset(NIOTSO_BUILD_EXAMPLES CACHE)
|
|
unset(NIOTSO_BUILD_TOOLS CACHE) |