niotso/CMakeLists.txt

53 lines
1.7 KiB
Text
Raw Normal View History

#########################################
#### 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)
2012-10-20 13:23:42 -05:00
#########################################
#### Project
add_subdirectory(niotso)
2012-10-20 13:23:42 -05:00
if(NIOTSO_BUILD_TOOLS)
add_subdirectory(tools)
endif()
if(NIOTSO_BUILD_EXAMPLES)
add_subdirectory(examples)
2012-10-20 13:23:42 -05:00
endif()
#########################################
#### Unset Options
unset(BUILD_SHARED_LIBS CACHE)
unset(NIOTSO_BUILD_EXAMPLES CACHE)
unset(NIOTSO_BUILD_TOOLS CACHE)