2022-08-05 01:59:19 -04:00
|
|
|
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)
|
2022-11-14 05:22:34 -05:00
|
|
|
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../libultraship ${CMAKE_BINARY_DIR}/libultraship)
|
2022-08-05 01:59:19 -04:00
|
|
|
endif()
|
|
|
|
|
|
|
|
if (NOT TARGET ZAPD)
|
|
|
|
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../ZAPDTR/ZAPD ${CMAKE_BINARY_DIR}/ZAPD)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if (NOT TARGET ZAPDUtils)
|
2022-11-14 05:22:34 -05:00
|
|
|
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../libultraship/extern/ZAPDUtils ${CMAKE_BINARY_DIR}/ZAPDUtils)
|
2022-08-05 01:59:19 -04:00
|
|
|
endif()
|
|
|
|
|
|
|
|
add_subdirectory(OTRExporter)
|