From 196b2b722c5474dfbba84ad843f70ff9173d2810 Mon Sep 17 00:00:00 2001 From: Benau Date: Wed, 22 Mar 2017 07:42:48 +0800 Subject: [PATCH] Fix mac build --- CMakeLists.txt | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) 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)