diff --git a/cmake/SearchForStuff.cmake b/cmake/SearchForStuff.cmake index 62f1bdbebb..de5c1baf6b 100644 --- a/cmake/SearchForStuff.cmake +++ b/cmake/SearchForStuff.cmake @@ -290,3 +290,72 @@ endif() add_subdirectory(3rdparty/libchdr/libchdr EXCLUDE_FROM_ALL) include_directories(3rdparty/libchdr/libchdr/include) + + + +#------------------------------------------------------------------------------- +# Dependency message print +#------------------------------------------------------------------------------- +set(msg_dep_common_libs "check these libraries -> wxWidgets (>=3.0), aio") +set(msg_dep_pcsx2 "check these libraries -> wxWidgets (>=3.0), gtk2, zlib (>=1.2.4), pcsx2 common libs") +set(msg_dep_gsdx "check these libraries -> opengl, png (>=1.2), zlib (>=1.2.4), X11, liblzma") + +macro(print_dep str dep) + if (PACKAGE_MODE) + message(FATAL_ERROR "${str}:${dep}") + else() + message(STATUS "${str}:${dep}") + endif() +endmacro(print_dep) + +#------------------------------------------------------------------------------- +# Pcsx2 core & common libs +#------------------------------------------------------------------------------- +# Check for additional dependencies. +# If all dependencies are available, including OS, build it +#------------------------------------------------------------------------------- +if (GTK2_FOUND OR GTK3_FOUND) + set(GTKn_FOUND TRUE) +elseif(APPLE) # Not we have but that we don't change all if(gtkn) entries + set(GTKn_FOUND TRUE) +else() + set(GTKn_FOUND FALSE) +endif() + +if(SDL_FOUND OR SDL2_FOUND) + set(SDLn_FOUND TRUE) +else() + set(SDLn_FOUND FALSE) +endif() + +if(wxWidgets_FOUND) + set(common_libs TRUE) +elseif(NOT EXISTS "${CMAKE_SOURCE_DIR}/common/src") + set(common_libs FALSE) +else() + set(common_libs FALSE) + print_dep("Skip build of common libraries: missing dependencies" "${msg_dep_common_libs}") +endif() + +# Common dependancy +if(wxWidgets_FOUND AND ZLIB_FOUND AND common_libs AND NOT (Linux AND NOT AIO_FOUND)) + if(OPENGL_FOUND AND X11_FOUND AND GTKn_FOUND AND ZLIB_FOUND AND PNG_FOUND AND FREETYPE_FOUND AND LIBLZMA_FOUND AND ((EGL_FOUND AND X11_XCB_FOUND) OR APPLE)) + set(pcsx2_core TRUE) + else() + print_dep("Skip build of pcsx2 core: missing dependencies" "${msg_dep_pcsx2}") + set(pcsx2_core FALSE) + endif() +elseif(NOT EXISTS "${CMAKE_SOURCE_DIR}/pcsx2") + set(pcsx2_core FALSE) +else() + set(pcsx2_core FALSE) + print_dep("Skip build of pcsx2 core: missing dependencies" "${msg_dep_pcsx2}") +endif() + + + +# Linux, BSD, use gtk2, but not OSX +if(UNIX AND pcsx2_core AND NOT GTKn_FOUND AND NOT APPLE) + set(pcsx2_core FALSE) + print_dep("Skip build of pcsx2 core: missing dependencies" "${msg_dep_pcsx2}") +endif() diff --git a/pcsx2/CMakeLists.txt b/pcsx2/CMakeLists.txt index 16b701c5f1..5baca65f42 100644 --- a/pcsx2/CMakeLists.txt +++ b/pcsx2/CMakeLists.txt @@ -103,7 +103,6 @@ set(pcsx2Sources Patch.cpp Patch_Memory.cpp Pcsx2Config.cpp - PluginManager.cpp PrecompiledHeader.cpp R3000A.cpp R3000AInterpreter.cpp @@ -173,7 +172,6 @@ set(pcsx2Headers MemoryTypes.h Patch.h PathDefs.h - Plugins.h PrecompiledHeader.h R3000A.h R5900Exceptions.h @@ -581,154 +579,154 @@ set(pcsx2PADHeaders # GS sources set(pcsx2GSSources - GS.cpp - GSAlignedClass.cpp - GSBlock.cpp - GSCapture.cpp - GSClut.cpp - GSCodeBuffer.cpp - GSCrc.cpp - GSDrawingContext.cpp - GSDump.cpp - GSLocalMemory.cpp - GSLzma.cpp - GSPerfMon.cpp - GSPng.cpp - GSState.cpp - GSTables.cpp - GSUtil.cpp - GSVector.cpp - GSdx.cpp - GSdxResources.cpp - stdafx.cpp - Renderers/Common/GSDevice.cpp - Renderers/Common/GSDirtyRect.cpp - Renderers/Common/GSFunctionMap.cpp - Renderers/Common/GSOsdManager.cpp - Renderers/Common/GSRenderer.cpp - Renderers/Common/GSTexture.cpp - Renderers/Common/GSVertexTrace.cpp - Renderers/Null/GSDeviceNull.cpp - Renderers/Null/GSRendererNull.cpp - Renderers/Null/GSTextureNull.cpp - Renderers/HW/GSHwHack.cpp - Renderers/HW/GSRendererHW.cpp - Renderers/HW/GSTextureCache.cpp - Renderers/SW/GSDrawScanline.cpp - Renderers/SW/GSDrawScanlineCodeGenerator.cpp - Renderers/SW/GSDrawScanlineCodeGenerator.x64.cpp - Renderers/SW/GSDrawScanlineCodeGenerator.x64.avx.cpp - Renderers/SW/GSDrawScanlineCodeGenerator.x64.avx2.cpp - Renderers/SW/GSDrawScanlineCodeGenerator.x86.cpp - Renderers/SW/GSDrawScanlineCodeGenerator.x86.avx.cpp - Renderers/SW/GSDrawScanlineCodeGenerator.x86.avx2.cpp - Renderers/SW/GSRasterizer.cpp - Renderers/SW/GSRendererSW.cpp - Renderers/SW/GSSetupPrimCodeGenerator.cpp - Renderers/SW/GSSetupPrimCodeGenerator.x64.cpp - Renderers/SW/GSSetupPrimCodeGenerator.x64.avx.cpp - Renderers/SW/GSSetupPrimCodeGenerator.x64.avx2.cpp - Renderers/SW/GSSetupPrimCodeGenerator.x86.cpp - Renderers/SW/GSSetupPrimCodeGenerator.x86.avx.cpp - Renderers/SW/GSSetupPrimCodeGenerator.x86.avx2.cpp - Renderers/SW/GSTextureCacheSW.cpp - Renderers/SW/GSTextureSW.cpp - Renderers/OpenGL/GLLoader.cpp - Renderers/OpenGL/GLState.cpp - Renderers/OpenGL/GSDeviceOGL.cpp - Renderers/OpenGL/GSRendererOGL.cpp - Renderers/OpenGL/GSShaderOGL.cpp - Renderers/OpenGL/GSTextureCacheOGL.cpp - Renderers/OpenGL/GSTextureOGL.cpp - Window/GSSetting.cpp - Window/GSWnd.cpp - Window/GSLinuxDialog.cpp - Window/GSWndEGL.cpp + GS/GS.cpp + GS/GSAlignedClass.cpp + GS/GSBlock.cpp + GS/GSCapture.cpp + GS/GSClut.cpp + GS/GSCodeBuffer.cpp + GS/GSCrc.cpp + GS/GSDrawingContext.cpp + GS/GSDump.cpp + GS/GSLocalMemory.cpp + GS/GSLzma.cpp + GS/GSPerfMon.cpp + GS/GSPng.cpp + GS/GSState.cpp + GS/GSTables.cpp + GS/GSUtil.cpp + GS/GSVector.cpp + GS/GSdx.cpp + GS/GS_res.cpp + GS/stdafx.cpp + GS/Renderers/Common/GSDevice.cpp + GS/Renderers/Common/GSDirtyRect.cpp + GS/Renderers/Common/GSFunctionMap.cpp + GS/Renderers/Common/GSOsdManager.cpp + GS/Renderers/Common/GSRenderer.cpp + GS/Renderers/Common/GSTexture.cpp + GS/Renderers/Common/GSVertexTrace.cpp + GS/Renderers/Null/GSDeviceNull.cpp + GS/Renderers/Null/GSRendererNull.cpp + GS/Renderers/Null/GSTextureNull.cpp + GS/Renderers/HW/GSHwHack.cpp + GS/Renderers/HW/GSRendererHW.cpp + GS/Renderers/HW/GSTextureCache.cpp + GS/Renderers/SW/GSDrawScanline.cpp + GS/Renderers/SW/GSDrawScanlineCodeGenerator.cpp + GS/Renderers/SW/GSDrawScanlineCodeGenerator.x64.cpp + GS/Renderers/SW/GSDrawScanlineCodeGenerator.x64.avx.cpp + GS/Renderers/SW/GSDrawScanlineCodeGenerator.x64.avx2.cpp + GS/Renderers/SW/GSDrawScanlineCodeGenerator.x86.cpp + GS/Renderers/SW/GSDrawScanlineCodeGenerator.x86.avx.cpp + GS/Renderers/SW/GSDrawScanlineCodeGenerator.x86.avx2.cpp + GS/Renderers/SW/GSRasterizer.cpp + GS/Renderers/SW/GSRendererSW.cpp + GS/Renderers/SW/GSSetupPrimCodeGenerator.cpp + GS/Renderers/SW/GSSetupPrimCodeGenerator.x64.cpp + GS/Renderers/SW/GSSetupPrimCodeGenerator.x64.avx.cpp + GS/Renderers/SW/GSSetupPrimCodeGenerator.x64.avx2.cpp + GS/Renderers/SW/GSSetupPrimCodeGenerator.x86.cpp + GS/Renderers/SW/GSSetupPrimCodeGenerator.x86.avx.cpp + GS/Renderers/SW/GSSetupPrimCodeGenerator.x86.avx2.cpp + GS/Renderers/SW/GSTextureCacheSW.cpp + GS/Renderers/SW/GSTextureSW.cpp + GS/Renderers/OpenGL/GLLoader.cpp + GS/Renderers/OpenGL/GLState.cpp + GS/Renderers/OpenGL/GSDeviceOGL.cpp + GS/Renderers/OpenGL/GSRendererOGL.cpp + GS/Renderers/OpenGL/GSShaderOGL.cpp + GS/Renderers/OpenGL/GSTextureCacheOGL.cpp + GS/Renderers/OpenGL/GSTextureOGL.cpp + GS/Window/GSSetting.cpp + GS/Window/GSWnd.cpp + GS/Window/GSLinuxDialog.cpp + GS/Window/GSWndEGL.cpp ) # GS headers set(pcsx2GSHeaders - config.h - GSAlignedClass.h - GSBlock.h - GSCapture.h - GSClut.h - GSCodeBuffer.h - GSCrc.h - GSDrawingContext.h - GSDrawingEnvironment.h - GSDump.h - GSdx.h - GSdxResources.h - GS.h - GSLocalMemory.h - GSLzma.h - GSPerfMon.h - GSPng.h - GSState.h - GSTables.h - GSThread_CXX11.h - GSThread.h - GSUtil.h - GSVector.h - GSVector4.h - GSVector4i.h - GSVector8.h - GSVector8i.h - stdafx.h - Renderers/Common/GSDevice.h - Renderers/Common/GSDirtyRect.h - Renderers/Common/GSFastList.h - Renderers/Common/GSFunctionMap.h - Renderers/Common/GSOsdManager.h - Renderers/Common/GSRenderer.h - Renderers/Common/GSTexture.h - Renderers/Common/GSVertex.h - Renderers/Common/GSVertexList.h - Renderers/Common/GSVertexTrace.h - Renderers/Null/GSDeviceNull.h - Renderers/Null/GSRendererNull.h - Renderers/Null/GSTextureNull.h - Renderers/HW/GSRendererHW.h - Renderers/HW/GSTextureCache.h - Renderers/HW/GSVertexHW.h - Renderers/SW/GSDrawScanlineCodeGenerator.h - Renderers/SW/GSDrawScanline.h - Renderers/SW/GSRasterizer.h - Renderers/SW/GSRendererSW.h - Renderers/SW/GSScanlineEnvironment.h - Renderers/SW/GSSetupPrimCodeGenerator.h - Renderers/SW/GSTextureCacheSW.h - Renderers/SW/GSTextureSW.h - Renderers/SW/GSVertexSW.h - Renderers/OpenGL/GLLoader.h - Renderers/OpenGL/GLState.h - Renderers/OpenGL/GSDeviceOGL.h - Renderers/OpenGL/GSRendererOGL.h - Renderers/OpenGL/GSShaderOGL.h - Renderers/OpenGL/GSTextureCacheOGL.h - Renderers/OpenGL/GSTextureOGL.h - Renderers/OpenGL/GSUniformBufferOGL.h - Renderers/OpenGL/GSVertexArrayOGL.h - Window/GSCaptureDlg.h - Window/GSDialog.h - Window/GSSetting.h - Window/GSSettingsDlg.h - Window/GSWnd.h - Window/GSWndEGL.h + GS/config.h + GS/GSAlignedClass.h + GS/GSBlock.h + GS/GSCapture.h + GS/GSClut.h + GS/GSCodeBuffer.h + GS/GSCrc.h + GS/GSDrawingContext.h + GS/GSDrawingEnvironment.h + GS/GSDump.h + GS/GSdx.h + GS/GS_res.h + GS/GS.h + GS/GSLocalMemory.h + GS/GSLzma.h + GS/GSPerfMon.h + GS/GSPng.h + GS/GSState.h + GS/GSTables.h + GS/GSThread_CXX11.h + GS/GSThread.h + GS/GSUtil.h + GS/GSVector.h + GS/GSVector4.h + GS/GSVector4i.h + GS/GSVector8.h + GS/GSVector8i.h + GS/stdafx.h + GS/Renderers/Common/GSDevice.h + GS/Renderers/Common/GSDirtyRect.h + GS/Renderers/Common/GSFastList.h + GS/Renderers/Common/GSFunctionMap.h + GS/Renderers/Common/GSOsdManager.h + GS/Renderers/Common/GSRenderer.h + GS/Renderers/Common/GSTexture.h + GS/Renderers/Common/GSVertex.h + GS/Renderers/Common/GSVertexList.h + GS/Renderers/Common/GSVertexTrace.h + GS/Renderers/Null/GSDeviceNull.h + GS/Renderers/Null/GSRendererNull.h + GS/Renderers/Null/GSTextureNull.h + GS/Renderers/HW/GSRendererHW.h + GS/Renderers/HW/GSTextureCache.h + GS/Renderers/HW/GSVertexHW.h + GS/Renderers/SW/GSDrawScanlineCodeGenerator.h + GS/Renderers/SW/GSDrawScanline.h + GS/Renderers/SW/GSRasterizer.h + GS/Renderers/SW/GSRendererSW.h + GS/Renderers/SW/GSScanlineEnvironment.h + GS/Renderers/SW/GSSetupPrimCodeGenerator.h + GS/Renderers/SW/GSTextureCacheSW.h + GS/Renderers/SW/GSTextureSW.h + GS/Renderers/SW/GSVertexSW.h + GS/Renderers/OpenGL/GLLoader.h + GS/Renderers/OpenGL/GLState.h + GS/Renderers/OpenGL/GSDeviceOGL.h + GS/Renderers/OpenGL/GSRendererOGL.h + GS/Renderers/OpenGL/GSShaderOGL.h + GS/Renderers/OpenGL/GSTextureCacheOGL.h + GS/Renderers/OpenGL/GSTextureOGL.h + GS/Renderers/OpenGL/GSUniformBufferOGL.h + GS/Renderers/OpenGL/GSVertexArrayOGL.h + GS/Window/GSCaptureDlg.h + GS/Window/GSDialog.h + GS/Window/GSSetting.h + GS/Window/GSSettingsDlg.h + GS/Window/GSWnd.h + GS/Window/GSWndEGL.h ) # GS resources set(pcsx2GSResources - res/logo-ogl.bmp - res/fxaa.fx - res/glsl/common_header.glsl - res/glsl/convert.glsl - res/glsl/interlace.glsl - res/glsl/merge.glsl - res/glsl/shadeboost.glsl - res/glsl/tfx_fs.glsl - res/glsl/tfx_vgs.glsl) + GS/res/logo-ogl.bmp + GS/res/fxaa.fx + GS/res/glsl/common_header.glsl + GS/res/glsl/convert.glsl + GS/res/glsl/interlace.glsl + GS/res/glsl/merge.glsl + GS/res/glsl/shadeboost.glsl + GS/res/glsl/tfx_fs.glsl + GS/res/glsl/tfx_vgs.glsl) add_custom_command( OUTPUT ${CMAKE_BINARY_DIR}/pcsx2/GS/GS_res.h