Add optimal build options to CMakeLists (#1841)

Provides two options when building RPCS3

    USE_SYSTEM_FFMPEG BOOL (default: OFF)
    USE_SYSTEM_LIBPNG BOOL (default: OFF)

These options lets the user select between the system provided and builtin libraries of ffmpeg and libpng to overcome possible system issues.

Also adds support for older libpng releases if the user doesn't have libpng 1.5 or higher.
This commit is contained in:
Lena 2016-07-01 06:07:16 +02:00 committed by raven02
parent 246b593783
commit 869e10027d
4 changed files with 65 additions and 10 deletions

View file

@ -11,13 +11,17 @@ if(NOT CMAKE_SIZEOF_VOID_P EQUAL 8)
message( FATAL_ERROR "RPCS3 can only be compiled on 64-bit platforms." )
endif()
add_definitions(-DCMAKE_BUILD)
# We use libpng's static library and don't need to build the shared library and run the tests
set(PNG_SHARED OFF CACHE BOOL "Build shared lib." FORCE)
set(PNG_TESTS OFF CACHE BOOL "Build tests." FORCE)
add_definitions(-DCMAKE_BUILD)
# Select the version of libpng to use, default is builtin
if (NOT USE_SYSTEM_LIBPNG)
add_subdirectory( 3rdparty/libpng )
endif()
add_subdirectory( 3rdparty/libpng )
# TODO: do real installation, including copying directory structure
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE "${PROJECT_BINARY_DIR}/bin")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG "${PROJECT_BINARY_DIR}/bin")