# Copyright (C) 2007-2012 LuaDist. # Created by Peter Kapec, David Manura # Redistribution and use of this file is allowed according to the terms of the MIT license. # For details see the COPYRIGHT file distributed with LuaDist. # Please note that the package source code is licensed under its own license. if (IOS) cmake_minimum_required(VERSION 3.5) else() cmake_minimum_required(VERSION 2.8) endif() project (libjpeg C) include_directories (${CMAKE_CURRENT_BINARY_DIR}) file(GLOB lib_srcs *.c) file(GLOB lib_hdrs *.h) if(ANDROID OR IOS OR APPLE) list(REMOVE_ITEM lib_srcs ${CMAKE_CURRENT_SOURCE_DIR}/jmemansi.c) else() list(REMOVE_ITEM lib_srcs ${CMAKE_CURRENT_SOURCE_DIR}/jmemnobs.c) endif() add_library (jpeg ${lib_srcs} ${lib_hdrs}) if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") set_source_files_properties(jcdctmgr.c PROPERTIES COMPILE_FLAGS "-O1") endif() if(NOT DEFINED CMAKE_INSTALL_LIBDIR) set(CMAKE_INSTALL_LIBDIR lib) endif(NOT DEFINED CMAKE_INSTALL_LIBDIR) install(TARGETS jpeg EXPORT libjpeg RUNTIME DESTINATION bin LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} FRAMEWORK DESTINATION ${CMAKE_INSTALL_LIBDIR}) install(FILES ${lib_hdrs} DESTINATION include) #install_doc ( README install.txt usage.txt wizard.txt example.c libjpeg.txt structure.txt # coderules.txt filelist.txt change.log )