diff --git a/CMakeLists.txt b/CMakeLists.txt index 7090e19a..9af2d3a8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -227,7 +227,7 @@ if(NANA_CMAKE_ENABLE_PNG) if(NANA_CMAKE_LIBPNG_FROM_OS) find_package(PNG) if (PNG_FOUND) - target_include_directories(${PROJECT_NAME} PRIVATE PNG::PNG) + target_include_directories(${PROJECT_NAME} SYSTEM PRIVATE PNG::PNG) target_compile_definitions(${PROJECT_NAME} PUBLIC USE_LIBPNG_FROM_OS) endif(PNG_FOUND) else() @@ -241,12 +241,12 @@ if(NANA_CMAKE_ENABLE_JPEG) if(NANA_CMAKE_LIBJPEG_FROM_OS) find_package(JPEG) if (JPEG_FOUND) - target_include_directories(${PROJECT_NAME PRIVATE ${JPEG_INCLUDE_DIR}) + target_include_directories(${PROJECT_NAME SYSTEM PRIVATE ${JPEG_INCLUDE_DIR}) target_link_libraries(${PROJECT_NAME} PRIVATE ${JPEG_LIBRARIES}) target_compile_definitions(${PROJECT_NAME} PUBLIC USE_LIBJPEG_FROM_OS) endif(JPEG_FOUND) else() - add_definitions(-DNANA_ENABLE_JPEG) + target_compile_definitions(${PROJECT_NAME} PUBLIC NANA_ENABLE_JPEG) endif(NANA_CMAKE_LIBJPEG_FROM_OS) endif(NANA_CMAKE_ENABLE_JPEG)