/[pcsx2_0.9.7]/trunk/CMakeLists.txt
ViewVC logotype

Diff of /trunk/CMakeLists.txt

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 61 by william, Tue Sep 7 03:24:11 2010 UTC revision 62 by william, Tue Sep 7 11:08:22 2010 UTC
# Line 1  Line 1 
   
1  # Project Name  # Project Name
2  project(Pcsx2)  project(Pcsx2)
3    
4  # need cmake version >=2.6  # There is some incompatible change with version 2.6 and below !
5  cmake_minimum_required(VERSION 2.6)  cmake_minimum_required(VERSION 2.8)
6    
7    # Variable to check that people use the good file
8    set(TOP_CMAKE_WAS_SOURCED TRUE)
9    
10    # Print a clear message that 64bits is not supported
11    # It would avoid compilation failure later.
12    if(CMAKE_SIZEOF_VOID_P MATCHES "8")
13        message(FATAL_ERROR "
14        PCSX2 does not support 64bits environment. Please install a 32bits chroot or a 32bits OS.
15        PCSX2 have neither no plan to support the 64bits architecture in the future.
16        It will need a complete rewrite of the core emulator and a lots of time
17        
18        However when linux distribution will support properly multi-arch package, it will
19        be at least possible to easily compile and install PCSX2 witout too much hassle (the chroot environment)")
20    endif(CMAKE_SIZEOF_VOID_P MATCHES "8")
21    
 #-------------------------------------------------------------------------------  
 # Detect the 32bit/64bit and set the 32bit library path 32_LD_LIBRARY_PATH  
 #-------------------------------------------------------------------------------  
 if (UNIX)  
     if (CMAKE_SIZEOF_VOID_P MATCHES "8")  
         # 64 bits machine  
         if (EXISTS /usr/lib32)  
             # 32 bits library in /usr/lib32  
             set(32_LD_LIBRARY_PATH /usr/lib32)  
         else (EXISTS /usr/lib32)  
             set(32_LD_LIBRARY_PATH /usr/lib)  
         endif (EXISTS /usr/lib32)  
     else (CMAKE_SIZEOF_VOID_P MATCHES "8")  
         # 32 bits machine  
         set(32_LD_LIBRARY_PATH /usr/lib)  
     endif (CMAKE_SIZEOF_VOID_P MATCHES "8")  
 endif (UNIX)  
22    
23  # set module path  # set module path
24  set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)  set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
25    
26  #-------------------------------------------------------------------------------  # include some generic functions
27  # if no build type is set, use Devel as default  include(Pcsx2Utils)
 #-------------------------------------------------------------------------------  
 if(CMAKE_BUILD_TYPE STREQUAL "")  
         set(CMAKE_BUILD_TYPE Devel)  
         message(STATUS "BuildType set to ${CMAKE_BUILD_TYPE} by default")  
 endif(CMAKE_BUILD_TYPE STREQUAL "")  
 #-------------------------------------------------------------------------------  
   
 #-------------------------------------------------------------------------------  
 # Set default strip option. Can be set with -DCMAKE_BUILD_STRIP=TRUE/FALSE  
 #-------------------------------------------------------------------------------  
 if(NOT DEFINED CMAKE_BUILD_STRIP)  
     if(CMAKE_BUILD_TYPE STREQUAL "Release")  
         set(CMAKE_BUILD_STRIP TRUE)  
         message(STATUS "Enable the stripping by default in ${CMAKE_BUILD_TYPE} build !!!")  
     else(CMAKE_BUILD_TYPE STREQUAL "Release")  
         set(CMAKE_BUILD_STRIP FALSE)  
         message(STATUS "Disable the stripping by default in ${CMAKE_BUILD_TYPE} build !!!")  
     endif(CMAKE_BUILD_TYPE STREQUAL "Release")  
 endif(NOT DEFINED CMAKE_BUILD_STRIP)  
   
  #-------------------------------------------------------------------------------  
   
 # Force the choice of 3rd party library either system one or pcsx2 one  
 # Use all         internal lib: -DFORCE_INTERNAL_ALL=TRUE  
 # Use a52         internal lib: -DFORCE_INTERNAL_A52=TRUE  
 # Use bzip        internal lib: -DFORCE_INTERNAL_BZIP2=TRUE  
 # Use soundtouch  internal lib: -DFORCE_INTERNAL_SOUNDTOUCH=TRUE  
 # Use zlib        internal lib: -DFORCE_INTERNAL_ZLIB=TRUE  
 #-------------------------------------------------------------------------------  
28    
29  # There have been issues in the past with sound quality depending on the version  # Detect current OS
30  # of Soundtouch, so for the moment, we'll use the internal version.  detectOperatingSystem()
 set(FORCE_INTERNAL_SOUNDTOUCH TRUE)  
   
 if(FORCE_INTERNAL_ALL)  
     set(FORCE_INTERNAL_A52 TRUE)  
     set(FORCE_INTERNAL_BZIP2 TRUE)  
     set(FORCE_INTERNAL_SOUNDTOUCH TRUE)  
     set(FORCE_INTERNAL_ZLIB TRUE)  
 endif(FORCE_INTERNAL_ALL)  
   
 if(NOT DEFINED FORCE_INTERNAL_A52)  
     set(FORCE_INTERNAL_A52 FALSE)  
 endif(NOT DEFINED FORCE_INTERNAL_A52)  
   
 if(NOT DEFINED FORCE_INTERNAL_BZIP2)  
     set(FORCE_INTERNAL_BZIP2 FALSE)  
 endif(NOT DEFINED FORCE_INTERNAL_BZIP2)  
   
 if(NOT DEFINED FORCE_INTERNAL_SOUNDTOUCH)  
     set(FORCE_INTERNAL_SOUNDTOUCH FALSE)  
 endif(NOT DEFINED FORCE_INTERNAL_SOUNDTOUCH)  
   
 if(NOT DEFINED FORCE_INTERNAL_ZLIB)  
     set(FORCE_INTERNAL_ZLIB FALSE)  
 endif(NOT DEFINED FORCE_INTERNAL_ZLIB)  
31    
32  #-------------------------------------------------------------------------------  #-------------------------------------------------------------------------------
33  # include modules  # Include specific module
34  include(Pcsx2Utils)  # BuildParameters Must be done before SearchForStuff
35    include(BuildParameters)
36    # SearchForStuff be done before SelectPcsx2Plugins
37  include(SearchForStuff)  include(SearchForStuff)
38    include(SelectPcsx2Plugins)
39    
40  # add additional project-wide include directories  # add additional project-wide include directories
41  include_directories(${PROJECT_SOURCE_DIR}/3rdparty  include_directories(${PROJECT_SOURCE_DIR}/common/include
                                         ${PROJECT_SOURCE_DIR}/common/include  
42                                          ${PROJECT_SOURCE_DIR}/common/include/Utilities                                          ${PROJECT_SOURCE_DIR}/common/include/Utilities
43                                          ${PROJECT_SOURCE_DIR}/common/include/x86emitter)                                          ${PROJECT_SOURCE_DIR}/common/include/x86emitter)
44    
45  # make 3rdParty  # make 3rdParty
46  add_subdirectory(3rdparty)  if(EXISTS "${PROJECT_SOURCE_DIR}/3rdparty")
47        add_subdirectory(3rdparty)
48    endif(EXISTS "${PROJECT_SOURCE_DIR}/3rdparty")
49    
50  # make common  # make common
51  add_subdirectory(common)  if(common_libs)
52        add_subdirectory(common/src/Utilities)
53        add_subdirectory(common/src/x86emitter)
54    endif(common_libs)
55    
56  # make tools  # make tools
57  add_subdirectory(tools)  add_subdirectory(tools)
58    
59  # make pcsx2  # make pcsx2
60  add_subdirectory(pcsx2)  if(EXISTS "${PROJECT_SOURCE_DIR}/pcsx2" AND pcsx2_core)
61        add_subdirectory(pcsx2)
62    endif(EXISTS "${PROJECT_SOURCE_DIR}/pcsx2" AND pcsx2_core)
63    
64  # make plugins  # make plugins
65  add_subdirectory(plugins)  if(EXISTS "${PROJECT_SOURCE_DIR}/plugins")
66        add_subdirectory(plugins)
67    endif(EXISTS "${PROJECT_SOURCE_DIR}/plugins")
68    
69  #-------------------------------------------------------------------------------  #-------------------------------------------------------------------------------
70  #                                                               Resources  #                                                               Resources
# Line 131  set(resourceList AppIcon16.png Line 86  set(resourceList AppIcon16.png
86                                   ConfigIcon_Speedhacks.png                                   ConfigIcon_Speedhacks.png
87                                   ConfigIcon_Video.png                                   ConfigIcon_Video.png
88                                   Dualshock.jpg)                                   Dualshock.jpg)
89                                    
90  createResourceTarget(${resourceList})  createResourceTarget(${resourceList})
91  #-------------------------------------------------------------------------------  #-------------------------------------------------------------------------------
92    

Legend:
Removed from v.61  
changed lines
  Added in v.62

  ViewVC Help
Powered by ViewVC 1.1.22