@@ -15,31 +15,31 @@ add_executable(${PROJECT_NAME} src/v4l2compress.cpp)
1515
1616# v4l2wrapper
1717add_subdirectory (v4l2wrapper)
18- include_directories ( "v4l2wrapper/inc" )
18+ target_include_directories ( ${PROJECT_NAME} PUBLIC "v4l2wrapper/inc" )
1919target_link_libraries (${PROJECT_NAME} v4l2wrapper)
2020
2121#libjpeg
2222option (WITH_JPEG "Enable JPEG support" ON )
2323if (WITH_JPEG)
2424 include (FindJPEG)
2525 if (JPEG_FOUND)
26- include_directories ( ${JPEG_INCLUDE_DIR} )
26+ target_include_directories ( ${PROJECT_NAME} PUBLIC ${JPEG_INCLUDE_DIR} )
2727 target_link_libraries (${PROJECT_NAME} ${JPEG_LIBRARY} )
28- add_definitions ( -DHAVE_JPEG)
28+ target_compile_definitions ( ${PROJECT_NAME} PUBLIC -DHAVE_JPEG)
2929 else ()
30- message (WARNING "JPEG enabled but not found" )
30+ message (WARNING "JPEG not found" )
3131 endif ()
3232endif ()
3333
3434#neon support
3535MESSAGE ("CMAKE_SYSTEM_PROCESSOR = ${CMAKE_SYSTEM_PROCESSOR} " )
3636if (CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64" )
37- add_definitions ( -DLIBYUV_DISABLE_NEON)
37+ target_compile_definitions ( ${PROJECT_NAME} PUBLIC -DLIBYUV_DISABLE_NEON)
3838endif ()
3939
4040#yuv
4141add_subdirectory (libyuv EXCLUDE_FROM_ALL )
42- include_directories ( "libyuv/include" )
42+ target_include_directories ( ${PROJECT_NAME} PUBLIC "libyuv/include" )
4343target_link_libraries (${PROJECT_NAME} yuv)
4444
4545find_package (PkgConfig)
@@ -49,11 +49,11 @@ option (WITH_X264 "Enable x264 support" ON)
4949if (WITH_X264)
5050 pkg_check_modules(X264 x264)
5151 if (X264_FOUND)
52- include_directories ( ${X264_INCLUDE_DIR} )
52+ target_include_directories ( ${PROJECT_NAME} PUBLIC ${X264_INCLUDE_DIR} )
5353 target_link_libraries (${PROJECT_NAME} ${X264_LIBRARIES} )
54- add_definitions ( -DHAVE_X264)
54+ target_compile_definitions ( ${PROJECT_NAME} PUBLIC -DHAVE_X264)
5555 else ()
56- message (WARNING "x264 enabled but not found" )
56+ message (INFO "x264 not found" )
5757 endif ()
5858endif ()
5959
@@ -62,11 +62,11 @@ option (WITH_X265 "Enable x265 support" ON)
6262if (WITH_X265)
6363 pkg_check_modules(X265 x265)
6464 if (X265_FOUND)
65- include_directories ( ${X265_INCLUDE_DIR} )
65+ target_include_directories ( ${PROJECT_NAME} PUBLIC ${X265_INCLUDE_DIR} )
6666 target_link_libraries (${PROJECT_NAME} ${X265_LIBRARIES} )
67- add_definitions ( -DHAVE_X265)
67+ target_compile_definitions ( ${PROJECT_NAME} PUBLIC -DHAVE_X265)
6868 else ()
69- message (WARNING "x265 enabled but not found" )
69+ message (INFO "x265 not found" )
7070 endif ()
7171endif ()
7272
@@ -75,11 +75,11 @@ option (WITH_VPX "enable VPX support" ON)
7575if (WITH_VPX)
7676 pkg_check_modules(VPX vpx)
7777 if (VPX_FOUND)
78- include_directories ( ${VPX_INCLUDE_DIR} )
78+ target_include_directories ( ${PROJECT_NAME} PUBLIC ${VPX_INCLUDE_DIR} )
7979 target_link_libraries (${PROJECT_NAME} ${VPX_LIBRARIES} )
80- add_definitions ( -DHAVE_VPX)
80+ target_compile_definitions ( ${PROJECT_NAME} PUBLIC -DHAVE_VPX)
8181 else ()
82- message (WARNING "VPNX enabled but not found" )
82+ message (INFO "VPX not found" )
8383 endif ()
8484endif ()
8585
0 commit comments