
#-------------------------------------------------------------------------------
# Includes
#-------------------------------------------------------------------------------
include(SMTG_DetectPlatform)
include(SMTG_ConfigureCmakeGenerator)
include(SMTG_ExportedSymbols)

# Check for in-source build directotry.
#
# In order not to pollute the source directory, using a separate build directory is mandatory.
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR OR EXISTS "${CMAKE_BINARY_DIR}/CMakeLists.txt")
    message(SEND_ERROR "In-source builds are not allowed. Please create a separate build directory and run 'cmake /path/to/folder [options]' there.")
    message(FATAL_ERROR "You can remove the file \"CMakeCache.txt\" and directory \"CMakeFiles\" in ${CMAKE_SOURCE_DIR}.")
endif()

# Global setup functions/macros
#
# Call macros/functions which setup the SDK's basics.
smtg_detect_platform()
smtg_configure_cmake_generator()
smtg_setup_symbol_visibility()
smtg_detect_xcode_version()

# Enable VST3 SDK
#
# This macro should be called from a 3rd party's plug-in CMakeLists.txt file.
macro(smtg_enable_vst3_sdk)
    smtg_configure_cmake_generator()
    smtg_setup_platform_toolset()
    
    # Needs to bet set for 'smtg_add_library_main' function.
    set(public_sdk_SOURCE_DIR ${vst3sdk_SOURCE_DIR}/public.sdk)
endmacro()
