RagePhoto-Extract: use C API when enabled

This commit is contained in:
Syping 2021-11-03 11:21:37 +01:00
parent 2fcc5b0ba7
commit d8c99b9067
3 changed files with 74 additions and 4 deletions

View file

@ -116,9 +116,12 @@ else()
option(WITH_EXTRACT "Build libragephoto with ragephoto-extract" OFF)
endif()
if (WITH_EXTRACT)
set(EXTRACT_SOURCES
src/RagePhoto-Extract.cpp
)
if (WITH_C_API)
enable_language(C)
set(EXTRACT_SOURCES src/RagePhoto-Extract.c)
else()
set(EXTRACT_SOURCES src/RagePhoto-Extract.cpp)
endif()
add_executable(ragephoto-extract ${RAGEPHOTO_HEADERS} ${EXTRACT_SOURCES})
target_link_libraries(ragephoto-extract PRIVATE ragephoto)
install(TARGETS ragephoto-extract DESTINATION ${CMAKE_INSTALL_BINDIR})