You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 lines
979 B
CMake

FIND_PATH(REPLAY_GAIN_INCLUDE_DIR replaygain/gain_analysis.h
/usr/include
/usr/local/include
${libmpc_SOURCE_DIR}/../libreplaygain/include
)
FIND_LIBRARY(REPLAY_GAIN_LIBRARY NAMES replaygain replaygain_static PATHS
/usr/lib
/usr/local/lib
${libmpc_SOURCE_DIR}/../libreplaygain/bin/src/release
)
if(REPLAY_GAIN_INCLUDE_DIR AND REPLAY_GAIN_LIBRARY)
message(STATUS "Building mpcgain with replaygain support")
include_directories(${libmpc_SOURCE_DIR}/include)
include_directories(${REPLAY_GAIN_INCLUDE_DIR})
link_directories(${libmpc_BINARY_DIR}/libmpcdec)
add_executable(mpcgain mpcgain.c)
target_link_libraries(mpcgain ${REPLAY_GAIN_LIBRARY})
if(SHARED)
target_link_libraries(mpcgain mpcdec)
else()
target_link_libraries(mpcgain mpcdec_static)
endif()
if(NOT MSVC)
target_link_libraries(mpcgain m)
endif()
install(TARGETS mpcgain RUNTIME DESTINATION bin)
else()
message(STATUS "Skipping mpcgain (libreplaygain not found)")
endif()