get_filename_component(CCSD_NAME ${CMAKE_CURRENT_SOURCE_DIR} NAME)
string(TOUPPER ${CCSD_NAME} CCSD_NAME_UPPER)
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/broadwell AND SQISIGN_BUILD_TYPE MATCHES "broadwell")
    add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/broadwell)
elseif(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/opt AND SQISIGN_BUILD_TYPE MATCHES "opt")
    add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/opt)
elseif(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/ref)
    add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/ref)
else()
    message(FATAL_ERROR "No matching implementation found")
endif()
