SET (suf "/presets/")
SET (PRESETS_DATA_DIR "${PKGDATADIR}${suf}")
SET (RELATIVE_PRESETS_DATA_DIR "${RELATIVE_PKGDATADIR}${suf}")
IF (WIN32 AND NOT UNIX)
    # We need to put an actual $ followed by { and EXE_DIRNAME so we
    # escape it.
    SET (PRESETS_DATA_DIR "\${EXE_DIRNAME}/../${RELATIVE_PRESETS_DATA_DIR}")
ENDIF ()

CONFIGURE_FILE(
    ${CMAKE_CURRENT_SOURCE_DIR}/presetrc.proto.in
    ${CMAKE_CURRENT_BINARY_DIR}/presetrc
)

INSTALL(
    FILES
        "${CMAKE_CURRENT_BINARY_DIR}/presetrc"
    DESTINATION
        "${RELATIVE_PKGDATADIR}"
)

ADD_SUBDIRECTORY ("presets")
