Some fixes in cmake.

Note that you need updated dependencies on windows.
This commit is contained in:
deve 2017-03-22 10:24:33 +01:00
parent 41e66bef37
commit 4df773d283

View File

@ -107,20 +107,19 @@ if((WIN32 AND NOT MINGW) OR APPLE)
add_subdirectory("${PROJECT_SOURCE_DIR}/lib/libpng") add_subdirectory("${PROJECT_SOURCE_DIR}/lib/libpng")
include_directories("${PROJECT_SOURCE_DIR}/lib/libpng") include_directories("${PROJECT_SOURCE_DIR}/lib/libpng")
# Add jpeg-turbo library set(PNG_PNG_INCLUDE_DIR "${PROJECT_SOURCE_DIR}/lib/libpng/")
if (APPLE) set(PNG_LIBRARY png15_static)
endif()
# Add jpeg-turbo library
if (APPLE)
add_subdirectory("${PROJECT_SOURCE_DIR}/lib/jpeglib") add_subdirectory("${PROJECT_SOURCE_DIR}/lib/jpeglib")
include_directories("${PROJECT_SOURCE_DIR}/lib/jpeglib") include_directories("${PROJECT_SOURCE_DIR}/lib/jpeglib")
set(JPEG_INCLUDE_DIR "${PROJECT_SOURCE_DIR}/lib/jpeglib/") set(JPEG_INCLUDE_DIR "${PROJECT_SOURCE_DIR}/lib/jpeglib/")
set(JPEG_LIBRARY jpeglib) set(JPEG_LIBRARY jpeglib)
else() else()
find_library(JPEG_LIBRARY NAMES libjpeg-62 PATHS "${PROJECT_SOURCE_DIR}/dependencies/lib") find_package(JPEG REQUIRED)
find_path(JPEG_INCLUDE_DIRS NAMES jpeglib.h PATHS "${PROJECT_SOURCE_DIR}/dependencies/include") include_directories(${JPEG_INCLUDE_DIR})
set(JPEG_LIBRARIES ${JPEG_LIBRARY})
endif()
set(PNG_PNG_INCLUDE_DIR "${PROJECT_SOURCE_DIR}/lib/libpng/")
set(PNG_LIBRARY png15_static)
endif() endif()
if(NOT SERVER_ONLY AND NOT USE_GLES2) if(NOT SERVER_ONLY AND NOT USE_GLES2)
@ -380,6 +379,7 @@ target_link_libraries(supertuxkart
${OGGVORBIS_LIBRARIES} ${OGGVORBIS_LIBRARIES}
${OPENAL_LIBRARY} ${OPENAL_LIBRARY}
${FREETYPE_LIBRARIES} ${FREETYPE_LIBRARIES}
${JPEG_LIBRARIES}
) )
if(NOT SERVER_ONLY) if(NOT SERVER_ONLY)
@ -420,10 +420,6 @@ if(USE_FRIBIDI)
add_definitions(-DENABLE_BIDI) add_definitions(-DENABLE_BIDI)
endif() endif()
if(MSVC)
target_link_libraries(supertuxkart ${JPEG_LIBRARIES})
endif()
# Wiiuse # Wiiuse
# ------ # ------
if(USE_WIIUSE) if(USE_WIIUSE)