@@ -22,6 +22,44 @@ else()
2222 message (FATAL_ERROR "Could not find stdio.h" )
2323endif ()
2424
25+
26+ add_library (catchLibLogLibrary STATIC
27+ catchLibLog.cpp
28+ )
29+
30+ set (CMAKE_CXX_CLANG_TIDY "${CLANG_TIDY_DEFAULT} " )
31+
32+ # Set the default build libraries
33+ set (LIB_SOURCES "mapEncoding.cpp" "catchLibLog.cpp" "encoderKvazaar.cpp" )
34+
35+ if (ENABLE_FFMPEG)
36+ # check if ffmpeg is available if available include encoderFFmpeg.cpp
37+ find_package (PkgConfig QUIET )
38+ if (PKG_CONFIG_FOUND)
39+ pkg_check_modules(FFMPEG REQUIRED IMPORTED_TARGET
40+ libavcodec
41+ libavformat
42+ libavutil
43+ )
44+ message (STATUS "FFmpeg found: ${FFMPEG_VERSION} " )
45+ set (LIB_SOURCES ${LIB_SOURCES} encoderFFmpeg.cpp)
46+ set (FFMPEG_LIBS PkgConfig::FFMPEG)
47+ else ()
48+ message (WARNING "FFmpeg not found, skipping encoderFFmpeg" )
49+ set (FFMPEG_LIBS "" )
50+ endif ()
51+ endif ()
52+
53+ # Define the library
54+ add_library (mapEncodingLibrary STATIC
55+ ${LIB_SOURCES}
56+ )
57+
58+ if (FFMPEG_LIBS)
59+ target_link_libraries (mapEncodingLibrary PUBLIC ${FFMPEG_LIBS} )
60+ endif ()
61+
62+
2563set (STDIO_PREFIX "kvazaar" )
2664set (KVAZAAR_STDIO_LIB ${STDIO_PREFIX} _stdio)
2765configure_file (${CMAKE_CURRENT_SOURCE_DIR} /uvg_stdio.h.in ${CMAKE_CURRENT_BINARY_DIR} /include /${STDIO_PREFIX} _stdio.h @ONLY)
@@ -60,20 +98,9 @@ ExternalProject_Add(
6098)
6199add_dependencies (kvazaar ${KVAZAAR_STDIO_LIB} )
62100
63- # Define the library
64- add_library (catchLibLogLibrary STATIC
65- catchLibLog.cpp
66- )
67101
68102set (CMAKE_CXX_CLANG_TIDY "${CLANG_TIDY_DEFAULT} " )
69103
70- # Define the library
71- add_library (mapEncodingLibrary STATIC
72- encoderKvazaar.cpp
73- mapEncoding.cpp
74- catchLibLog.cpp
75- )
76-
77104# Include directories for headers
78105target_include_directories (mapEncodingLibrary PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} /include )
79106
0 commit comments