1 |
william |
31 |
|
2 |
|
|
# Project Name |
3 |
|
|
project(Pcsx2) |
4 |
|
|
|
5 |
|
|
# need cmake version >=2.6 |
6 |
|
|
cmake_minimum_required(VERSION 2.6) |
7 |
|
|
|
8 |
|
|
#------------------------------------------------------------------------------- |
9 |
|
|
# Detect the 32bit/64bit and set the 32bit library path 32_LD_LIBRARY_PATH |
10 |
|
|
#------------------------------------------------------------------------------- |
11 |
|
|
if (UNIX) |
12 |
|
|
if (CMAKE_SIZEOF_VOID_P MATCHES "8") |
13 |
|
|
# 64 bits machine |
14 |
|
|
if (EXISTS /usr/lib32) |
15 |
|
|
# 32 bits library in /usr/lib32 |
16 |
|
|
set(32_LD_LIBRARY_PATH /usr/lib32) |
17 |
|
|
else (EXISTS /usr/lib32) |
18 |
|
|
set(32_LD_LIBRARY_PATH /usr/lib) |
19 |
|
|
endif (EXISTS /usr/lib32) |
20 |
|
|
else (CMAKE_SIZEOF_VOID_P MATCHES "8") |
21 |
|
|
# 32 bits machine |
22 |
|
|
set(32_LD_LIBRARY_PATH /usr/lib) |
23 |
|
|
endif (CMAKE_SIZEOF_VOID_P MATCHES "8") |
24 |
|
|
endif (UNIX) |
25 |
|
|
|
26 |
|
|
# set module path |
27 |
|
|
set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake) |
28 |
|
|
|
29 |
|
|
#------------------------------------------------------------------------------- |
30 |
|
|
# if no build type is set, use Devel as default |
31 |
|
|
#------------------------------------------------------------------------------- |
32 |
|
|
if(CMAKE_BUILD_TYPE STREQUAL "") |
33 |
|
|
set(CMAKE_BUILD_TYPE Devel) |
34 |
|
|
message(STATUS "BuildType set to ${CMAKE_BUILD_TYPE} by default") |
35 |
|
|
endif(CMAKE_BUILD_TYPE STREQUAL "") |
36 |
|
|
#------------------------------------------------------------------------------- |
37 |
|
|
|
38 |
|
|
#------------------------------------------------------------------------------- |
39 |
|
|
# Set default strip option. Can be set with -DCMAKE_BUILD_STRIP=TRUE/FALSE |
40 |
|
|
#------------------------------------------------------------------------------- |
41 |
|
|
if(NOT DEFINED CMAKE_BUILD_STRIP) |
42 |
|
|
if(CMAKE_BUILD_TYPE STREQUAL "Release") |
43 |
|
|
set(CMAKE_BUILD_STRIP TRUE) |
44 |
|
|
message(STATUS "Enable the stripping by default in ${CMAKE_BUILD_TYPE} build !!!") |
45 |
|
|
else(CMAKE_BUILD_TYPE STREQUAL "Release") |
46 |
|
|
set(CMAKE_BUILD_STRIP FALSE) |
47 |
|
|
message(STATUS "Disable the stripping by default in ${CMAKE_BUILD_TYPE} build !!!") |
48 |
|
|
endif(CMAKE_BUILD_TYPE STREQUAL "Release") |
49 |
|
|
endif(NOT DEFINED CMAKE_BUILD_STRIP) |
50 |
|
|
|
51 |
|
|
#------------------------------------------------------------------------------- |
52 |
|
|
|
53 |
|
|
# Force the choice of 3rd party library either system one or pcsx2 one |
54 |
|
|
# Use all internal lib: -DFORCE_INTERNAL_ALL=TRUE |
55 |
|
|
# Use a52 internal lib: -DFORCE_INTERNAL_A52=TRUE |
56 |
|
|
# Use bzip internal lib: -DFORCE_INTERNAL_BZIP2=TRUE |
57 |
|
|
# Use soundtouch internal lib: -DFORCE_INTERNAL_SOUNDTOUCH=TRUE |
58 |
|
|
# Use zlib internal lib: -DFORCE_INTERNAL_ZLIB=TRUE |
59 |
|
|
#------------------------------------------------------------------------------- |
60 |
|
|
|
61 |
|
|
# There have been issues in the past with sound quality depending on the version |
62 |
|
|
# of Soundtouch, so for the moment, we'll use the internal version. |
63 |
|
|
set(FORCE_INTERNAL_SOUNDTOUCH TRUE) |
64 |
|
|
|
65 |
|
|
if(FORCE_INTERNAL_ALL) |
66 |
|
|
set(FORCE_INTERNAL_A52 TRUE) |
67 |
|
|
set(FORCE_INTERNAL_BZIP2 TRUE) |
68 |
|
|
set(FORCE_INTERNAL_SOUNDTOUCH TRUE) |
69 |
|
|
set(FORCE_INTERNAL_ZLIB TRUE) |
70 |
|
|
endif(FORCE_INTERNAL_ALL) |
71 |
|
|
|
72 |
|
|
if(NOT DEFINED FORCE_INTERNAL_A52) |
73 |
|
|
set(FORCE_INTERNAL_A52 FALSE) |
74 |
|
|
endif(NOT DEFINED FORCE_INTERNAL_A52) |
75 |
|
|
|
76 |
|
|
if(NOT DEFINED FORCE_INTERNAL_BZIP2) |
77 |
|
|
set(FORCE_INTERNAL_BZIP2 FALSE) |
78 |
|
|
endif(NOT DEFINED FORCE_INTERNAL_BZIP2) |
79 |
|
|
|
80 |
|
|
if(NOT DEFINED FORCE_INTERNAL_SOUNDTOUCH) |
81 |
|
|
set(FORCE_INTERNAL_SOUNDTOUCH FALSE) |
82 |
|
|
endif(NOT DEFINED FORCE_INTERNAL_SOUNDTOUCH) |
83 |
|
|
|
84 |
|
|
if(NOT DEFINED FORCE_INTERNAL_ZLIB) |
85 |
|
|
set(FORCE_INTERNAL_ZLIB FALSE) |
86 |
|
|
endif(NOT DEFINED FORCE_INTERNAL_ZLIB) |
87 |
|
|
|
88 |
|
|
#------------------------------------------------------------------------------- |
89 |
|
|
# include modules |
90 |
|
|
include(Pcsx2Utils) |
91 |
|
|
include(SearchForStuff) |
92 |
|
|
|
93 |
|
|
# add additional project-wide include directories |
94 |
|
|
include_directories(${PROJECT_SOURCE_DIR}/3rdparty |
95 |
|
|
${PROJECT_SOURCE_DIR}/common/include |
96 |
|
|
${PROJECT_SOURCE_DIR}/common/include/Utilities |
97 |
|
|
${PROJECT_SOURCE_DIR}/common/include/x86emitter) |
98 |
|
|
|
99 |
|
|
# make 3rdParty |
100 |
|
|
add_subdirectory(3rdparty) |
101 |
|
|
|
102 |
|
|
# make common |
103 |
|
|
add_subdirectory(common) |
104 |
|
|
|
105 |
|
|
# make tools |
106 |
|
|
add_subdirectory(tools) |
107 |
|
|
|
108 |
|
|
# make pcsx2 |
109 |
|
|
add_subdirectory(pcsx2) |
110 |
|
|
|
111 |
|
|
# make plugins |
112 |
|
|
add_subdirectory(plugins) |
113 |
|
|
|
114 |
|
|
#------------------------------------------------------------------------------- |
115 |
|
|
# Resources |
116 |
|
|
#------------------------------------------------------------------------------- |
117 |
|
|
# Specify all binary images to convert them into c/c++ header files. |
118 |
|
|
# |
119 |
|
|
#------------------------------------------------------------------------------- |
120 |
|
|
# add resources here |
121 |
|
|
set(resourceList AppIcon16.png |
122 |
|
|
AppIcon32.png |
123 |
|
|
AppIcon64.png |
124 |
|
|
BackgroundLogo.png |
125 |
|
|
ButtonIcon_Camera.png |
126 |
|
|
ConfigIcon_Cpu.png |
127 |
|
|
ConfigIcon_Gamefixes.png |
128 |
|
|
ConfigIcon_MemoryCard.png |
129 |
|
|
ConfigIcon_Paths.png |
130 |
|
|
ConfigIcon_Plugins.png |
131 |
|
|
ConfigIcon_Speedhacks.png |
132 |
|
|
ConfigIcon_Video.png |
133 |
|
|
Dualshock.jpg) |
134 |
|
|
|
135 |
|
|
createResourceTarget(${resourceList}) |
136 |
|
|
#------------------------------------------------------------------------------- |
137 |
|
|
|