set (VSTPLUGIN_NAME            "abNinjam")
set (VSTPLUGIN_VENDOR          "Antanas Bruzas")
set (VSTPLUGIN_URL             "http://hippie.lt")
set (VSTPLUGIN_EMAIL           "antanas@hippie.lt")

include("cmake/modules/SetupVST3LibraryDefaultPath.cmake")

# here you can define the VST3 plug-ins folder (it will be created)
setup_default_vst3_path()
if ("${DEFAULT_VST3_FOLDER}" STREQUAL "")
    set (DEFAULT_VST3_FOLDER "${CMAKE_INSTALL_PREFIX}")
endif()
if (NOT VSTPLUGIN_INSTALL_DIR)
    set(VSTPLUGIN_INSTALL_DIR "${DEFAULT_VST3_FOLDER}")
endif()
if (NOT ${VSTPLUGIN_INSTALL_DIR} STREQUAL "")
    file(MAKE_DIRECTORY ${VSTPLUGIN_INSTALL_DIR})
    if(EXISTS ${VSTPLUGIN_INSTALL_DIR})
        message(STATUS "VSTPLUGIN_INSTALL_DIR is set to : " ${VSTPLUGIN_INSTALL_DIR})
    else()
        message(STATUS "VSTPLUGIN_INSTALL_DIR is not set!")
    endif()
endif()

option (WITHOUT_GUI "Disable VST GUI [default: OFF]" OFF)
if (WITHOUT_GUI)
   add_definitions(-DWITHOUT_GUI=${WITHOUT_GUI})
   message(STATUS "WITHOUT_GUI: ${WITHOUT_GUI}")
endif()

option (LOG_FILE "Enable logging to file [default: OFF]" OFF)
if (LOG_FILE)
   add_definitions(-DLOG_FILE=${LOG_FILE})
   message(STATUS "LOG_FILE: ${LOG_FILE}")
endif()


message(STATUS "System architecture: ${CMAKE_SYSTEM_PROCESSOR}")

# --- VST3 Bundle architecture ---
if(NOT VST3_PACKAGE_ARCHITECTURE)
    if(APPLE)
        # VST3 packages are universal on Apple, architecture string not needed
    else()
        if(CMAKE_SYSTEM_PROCESSOR MATCHES "^(x86_64|amd64|AMD64|x64|X64)$")
            set(VST3_PACKAGE_ARCHITECTURE "x86_64")
        elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^(i.86|x86|X86)$")
            if(WIN32)
                set(VST3_PACKAGE_ARCHITECTURE "x86")
            else()
                set(VST3_PACKAGE_ARCHITECTURE "i386")
            endif()
        elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^(armv7l)$")
                set(VST3_PACKAGE_ARCHITECTURE "armv7l")
        elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^(aarch64)$")
                set(VST3_PACKAGE_ARCHITECTURE "aarch64")
        else()
            message(FATAL_ERROR "Unknown architecture for VST3: ${CMAKE_SYSTEM_PROCESSOR}.")
        endif()
    endif()
endif()

message(STATUS "VST3 architecture: ${VST3_PACKAGE_ARCHITECTURE}")

