JD2022-TU1/main/extern/UbiServices/custom/CMakeLists.txt

134 lines
No EOL
4.6 KiB
CMake

cmake_minimum_required(VERSION 3.0)
Project(ubiservices)
set(PACKAGE_LOCATION ${CMAKE_CURRENT_LIST_DIR})
include(./build/private/cmake/harbour_platform.cmake)
include(./build/private/cmake/harbour_harvest.cmake)
include(./build/private/cmake/harbour_configuration.cmake)
harbour_configure(ubiservices)
# Checks options and fails the solution generation if a conflict is found.
us_check_option_conflicts()
# Checks module dependencies and fails the solution generation if a requirement is not met.
us_check_module_dependencies()
if (HARBOUR_BUILD_HARBOUR_EAL)
set(HARBOUR_EAL_INCLUDE_DIRECTORY ${PACKAGE_LOCATION}/external/harbourcommon/libraries/harboureal/api/sources)
add_subdirectory(./external/harbourcommon/libraries/harboureal)
if(PS4)
set (SCE_PS4_SDK "$ENV{SCE_ORBIS_SDK_DIR}")
endif()
if(PS5)
set (SCE_PS5_SDK "$ENV{SCE_PROSPERO_SDK_DIR}")
endif()
# Profiler not working on Linux
if (US_ENABLE_PROFILE AND NOT LINUX)
add_subdirectory(./external/harbourcommon/libraries/harboureal/faprofiler)
endif()
endif()
add_subdirectory(./external/dependencies/zlib)
if ((ANDROID OR IOS OR TVOS OR OSX OR LINUX OR STADIA OR WIN) AND ("${EXTERNAL_LIBCURL_INCLUDE_DIR}" STREQUAL ""))
add_subdirectory(./external/dependencies/libcurl)
add_subdirectory(./external/dependencies/nghttp2)
endif()
if (SWITCH AND NOT DEFINED USE_SWITCH_OPENSSL)
file(READ "$ENV{NINTENDO_SDK_ROOT}/Include/nn/detail/nn_Version-spec.Generic.h" SWTICH_SDK_VERSION_FILE)
string(REGEX MATCH "#define NN_SDK_VERSION_MAJOR *([0-9]*)" _ ${SWTICH_SDK_VERSION_FILE})
set(SWTICH_SDK_VERSION_MAJOR ${CMAKE_MATCH_1})
string(REGEX MATCH "#define NN_SDK_VERSION_MINOR *([0-9]*)" _ ${SWTICH_SDK_VERSION_FILE})
set(SWTICH_SDK_VERSION_MINOR ${CMAKE_MATCH_1})
if ((SWTICH_SDK_VERSION_MAJOR GREATER 11) OR ((SWTICH_SDK_VERSION_MAJOR EQUAL 11) AND (SWTICH_SDK_VERSION_MINOR GREATER 1)))
set(USE_SWITCH_OPENSSL TRUE)
endif()
endif()
if ((ANDROID OR IOS OR TVOS OR OSX OR LINUX OR STADIA OR WIN OR PS4 OR PS5 OR (SWITCH AND NOT USE_SWITCH_OPENSSL)) AND ("${EXTERNAL_OPENSSL_INCLUDE_DIR}" STREQUAL ""))
if(HARBOUR_USE_DEPRECATED_OPENSSL_1_0_2)
add_subdirectory(./external/harbourcommon/libraries/openssl_deprecated) # 1.0.2
elseif(HARBOUR_USE_LATEST_OPENSSL_WITH_QUIC_SUPPORT)
add_subdirectory(./external/harbourcommon/libraries/openssl_latest) # 1.1.1k w/ QUIC
else()
add_subdirectory(./external/harbourcommon/libraries/openssl) # 1.1.1g
endif()
endif()
add_subdirectory(./client-sdk/private/ubiservices)
if ((${SDK_TYPE} MATCHES "US_SDK_LIGHT_MOBILE") OR (${SDK_TYPE} MATCHES "US_SDK_SERVER"))
set(US_DEMO_IN_TREE FALSE)
endif()
if (UNITY3D)
if(WIN AND NOT ((${SDK_TYPE} MATCHES "US_SDK_LIGHT_MOBILE") OR (${SDK_TYPE} MATCHES "US_SDK_SERVER")))
set(US_DEMO_IN_TREE FALSE)
else()
set(US_DEMO_IN_TREE FALSE)
endif()
if(PS4 OR XONE OR SWITCH OR PS5 OR STADIA OR "${US_BUILD_PRIVATE}" STREQUAL "")
set(US_TESTS_IN_TREE FALSE)
set(US_GTEST_IN_TREE FALSE)
else()
set(US_TESTS_IN_TREE TRUE)
set(US_GTEST_IN_TREE TRUE)
endif()
endif()
# Tests disabled in profile mode for Linux since that configuration does not support the profiler.
if(LINUX)
STRING(FIND ${CMAKE_CURRENT_BINARY_DIR} "Profile" IS_PROFILE)
if(NOT(${IS_PROFILE} EQUAL "-1"))
set(US_TESTS_IN_TREE FALSE)
set(US_GTEST_IN_TREE FALSE)
endif()
endif()
if (US_DEMO_IN_TREE OR US_TESTS_IN_TREE)
if(IS_DIRECTORY "${CMAKE_SOURCE_DIR}/external/framework/usCommon/s2s_cert_us")
set(US_BUILDING_FOR_US TRUE)
else()
set(US_BUILDING_FOR_US FALSE)
endif()
add_subdirectory(./external/framework/usCommon)
endif()
if (US_GTEST_IN_TREE OR US_TESTS_IN_TREE)
add_subdirectory(./external/harbourcommon/libraries/gtest)
add_subdirectory(./external/harbourcommon/libraries/gtestmutex)
add_subdirectory(./external/harbourcommon/libraries/gmock)
endif()
if (US_TESTS_IN_TREE)
add_subdirectory(./testsUnit)
add_subdirectory(./testsIntegration)
add_subdirectory(./tests)
if (IOS)
add_subdirectory(./build/private/ios/XcodeTestsLauncher XcodeTestsLauncher)
endif()
if (XONE)
add_subdirectory(./external/framework/winrtRegressionCheck)
endif()
if (STADIA)
add_subdirectory(./zPackageExcluded/external/dependencies/UMPLoader)
endif()
endif()
if (US_DEMO_IN_TREE)
MESSAGE("========================================> DEMO IN TREE")
add_subdirectory(./demo)
endif()
if(ANDROID)
target_compile_options(ubiservices PUBLIC -DANDROID)
endif()
harbour_create_export_target()