forked from RPCS3/rpcs3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
78 lines (64 loc) · 2.59 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
cmake_minimum_required(VERSION 2.8.12)
# uncomment next line if you want to build with GDB stub
# add_definitions(-DWITH_GDB_DEBUGGER)
set(CMAKE_CXX_STANDARD 14)
set(ASMJIT_STATIC TRUE)
if (NOT CMAKE_BUILD_TYPE)
message(STATUS "No build type selected, default to Release")
set(CMAKE_BUILD_TYPE "Release")
endif()
if(NOT CMAKE_SIZEOF_VOID_P EQUAL 8)
message( FATAL_ERROR "RPCS3 can only be compiled on 64-bit platforms." )
endif()
if (CMAKE_COMPILER_IS_GNUCC AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.1)
message( FATAL_ERROR "RPCS3 requires at least gcc-5.1." )
endif()
if (CMAKE_COMPILER_IS_GNUCC AND CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 6.1)
message( FATAL_ERROR "RPCS3 can't be compiled with gcc-6.1, see #1691." )
endif()
find_program(CCACHE_FOUND ccache)
if (CCACHE_FOUND)
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache)
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)
# Select the version of libpng to use, default is builtin
if (NOT USE_SYSTEM_LIBPNG)
add_subdirectory( 3rdparty/libpng )
endif()
option(VULKAN_PREBUILT "" OFF)
# 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")
add_subdirectory( Vulkan )
add_subdirectory( rpcs3 )
add_subdirectory( rsx_program_decompiler )
include_directories(3rdparty/hidapi/hidapi)
if(APPLE)
add_subdirectory(3rdparty/hidapi/mac)
#list(APPEND LIBS hidapi)
elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
add_subdirectory(3rdparty/hidapi/linux)
elseif(MSVC)
add_subdirectory(3rdparty/hidapi/windows)
else()
add_subdirectory(3rdparty/hidapi/libusb)
#list(APPEND LIBS hidapi-libusb)
endif()
# Linux installation
if(CMAKE_SYSTEM_NAME MATCHES "Linux|FreeBSD|OpenBSD")
# Install the application icon and menu item
install(FILES rpcs3/rpcs3.svg
DESTINATION ${CMAKE_INSTALL_PREFIX}/share/icons/hicolor/scalable/apps)
install(FILES rpcs3/rpcs3.png
DESTINATION ${CMAKE_INSTALL_PREFIX}/share/icons/hicolor/48x48/apps)
install(FILES rpcs3/rpcs3.desktop
DESTINATION ${CMAKE_INSTALL_PREFIX}/share/applications)
# Install the binary
install(FILES "${PROJECT_BINARY_DIR}/bin/rpcs3"
DESTINATION ${CMAKE_INSTALL_PREFIX}/bin
PERMISSIONS OWNER_EXECUTE OWNER_READ OWNER_WRITE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) # i.e. 755
endif()