mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2024-11-22 09:22:18 -05:00
3914781ebf
Co-authored-by: briaguya <briaguya> Co-authored-by: Christopher Leggett <chris@leggett.dev> Co-authored-by: David Chavez <davi@dcvz.io>
97 lines
3.9 KiB
CMake
97 lines
3.9 KiB
CMake
cmake_minimum_required(VERSION 3.16.0 FATAL_ERROR)
|
|
|
|
set(CMAKE_SYSTEM_VERSION 10.0 CACHE STRING "" FORCE)
|
|
set(CMAKE_CXX_STANDARD 20 CACHE STRING "The C++ standard to use")
|
|
#set(CMAKE_C_STANDARD 11 CACHE STRING "The C standard to use")
|
|
set(CMAKE_C_STANDARD 11)
|
|
|
|
project(OTRExporter C CXX)
|
|
|
|
################################################################################
|
|
# Set target arch type if empty. Visual studio solution generator provides it.
|
|
################################################################################
|
|
if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
|
|
if(NOT CMAKE_VS_PLATFORM_NAME)
|
|
set(CMAKE_VS_PLATFORM_NAME "x64")
|
|
endif()
|
|
message("${CMAKE_VS_PLATFORM_NAME} architecture in use")
|
|
|
|
if(NOT ("${CMAKE_VS_PLATFORM_NAME}" STREQUAL "x64"
|
|
OR "${CMAKE_VS_PLATFORM_NAME}" STREQUAL "Win32"))
|
|
message(FATAL_ERROR "${CMAKE_VS_PLATFORM_NAME} arch is not supported!")
|
|
endif()
|
|
endif()
|
|
|
|
################################################################################
|
|
# Global configuration types
|
|
################################################################################
|
|
set(CMAKE_CONFIGURATION_TYPES
|
|
"Debug"
|
|
"Release"
|
|
CACHE STRING "" FORCE
|
|
)
|
|
|
|
################################################################################
|
|
# Global compiler options
|
|
################################################################################
|
|
if(MSVC)
|
|
# remove default flags provided with CMake for MSVC
|
|
set(CMAKE_C_FLAGS "")
|
|
set(CMAKE_C_FLAGS_DEBUG "")
|
|
set(CMAKE_C_FLAGS_RELEASE "")
|
|
set(CMAKE_CXX_FLAGS "")
|
|
set(CMAKE_CXX_FLAGS_DEBUG "")
|
|
set(CMAKE_CXX_FLAGS_RELEASE "")
|
|
endif()
|
|
|
|
################################################################################
|
|
# Global linker options
|
|
################################################################################
|
|
if(MSVC)
|
|
# remove default flags provided with CMake for MSVC
|
|
set(CMAKE_EXE_LINKER_FLAGS "")
|
|
set(CMAKE_MODULE_LINKER_FLAGS "")
|
|
set(CMAKE_SHARED_LINKER_FLAGS "")
|
|
set(CMAKE_STATIC_LINKER_FLAGS "")
|
|
set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS}")
|
|
set(CMAKE_MODULE_LINKER_FLAGS_DEBUG "${CMAKE_MODULE_LINKER_FLAGS}")
|
|
set(CMAKE_SHARED_LINKER_FLAGS_DEBUG "${CMAKE_SHARED_LINKER_FLAGS}")
|
|
set(CMAKE_STATIC_LINKER_FLAGS_DEBUG "${CMAKE_STATIC_LINKER_FLAGS}")
|
|
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS}")
|
|
set(CMAKE_MODULE_LINKER_FLAGS_RELEASE "${CMAKE_MODULE_LINKER_FLAGS}")
|
|
set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS}")
|
|
set(CMAKE_STATIC_LINKER_FLAGS_RELEASE "${CMAKE_STATIC_LINKER_FLAGS}")
|
|
endif()
|
|
|
|
################################################################################
|
|
# Common utils
|
|
################################################################################
|
|
include(CMake/Utils.cmake)
|
|
|
|
################################################################################
|
|
# Additional Global Settings(add specific info there)
|
|
################################################################################
|
|
include(CMake/GlobalSettingsInclude.cmake OPTIONAL)
|
|
|
|
################################################################################
|
|
# Use solution folders feature
|
|
################################################################################
|
|
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
|
|
|
|
################################################################################
|
|
# Sub-projects
|
|
################################################################################
|
|
if (NOT TARGET libultraship)
|
|
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../libultraship ${CMAKE_BINARY_DIR}/libultraship)
|
|
endif()
|
|
|
|
if (NOT TARGET ZAPD)
|
|
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../ZAPDTR/ZAPD ${CMAKE_BINARY_DIR}/ZAPD)
|
|
endif()
|
|
|
|
if (NOT TARGET ZAPDUtils)
|
|
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../libultraship/extern/ZAPDUtils ${CMAKE_BINARY_DIR}/ZAPDUtils)
|
|
endif()
|
|
|
|
add_subdirectory(OTRExporter)
|