diff --git a/CMakeLists.txt b/CMakeLists.txt index 0302936e1..cc9ca6d4e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -108,9 +108,16 @@ if((WIN32 AND NOT MINGW) OR APPLE) include_directories("${PROJECT_SOURCE_DIR}/lib/libpng") # Add jpeg-turbo library - find_library(JPEG_LIBRARY NAMES libjpeg-62 PATHS "${PROJECT_SOURCE_DIR}/dependencies/lib") - find_path(JPEG_INCLUDE_DIRS NAMES jpeglib.h PATHS "${PROJECT_SOURCE_DIR}/dependencies/include") - set(JPEG_LIBRARIES ${JPEG_LIBRARY}) + if (APPLE) + add_subdirectory("${PROJECT_SOURCE_DIR}/lib/jpeglib") + include_directories("${PROJECT_SOURCE_DIR}/lib/jpeglib") + set(JPEG_INCLUDE_DIR "${PROJECT_SOURCE_DIR}/lib/jpeglib/") + set(JPEG_LIBRARY jpeglib) + else() + find_library(JPEG_LIBRARY NAMES libjpeg-62 PATHS "${PROJECT_SOURCE_DIR}/dependencies/lib") + find_path(JPEG_INCLUDE_DIRS NAMES jpeglib.h PATHS "${PROJECT_SOURCE_DIR}/dependencies/include") + set(JPEG_LIBRARIES ${JPEG_LIBRARY}) + endif() set(PNG_PNG_INCLUDE_DIR "${PROJECT_SOURCE_DIR}/lib/libpng/") set(PNG_LIBRARY png15_static)