2011-02-20 17:01:03 +00:00
|
|
|
# Check that people use the good file
|
|
|
|
if(NOT TOP_CMAKE_WAS_SOURCED)
|
|
|
|
message(FATAL_ERROR "
|
|
|
|
You did not 'cmake' the good CMakeLists.txt file. Use the one in the top dir.
|
|
|
|
It is advice to delete all wrongly generated cmake stuff => CMakeFiles & CMakeCache.txt")
|
|
|
|
endif(NOT TOP_CMAKE_WAS_SOURCED)
|
|
|
|
|
|
|
|
|
|
|
|
# plugin name
|
2011-06-20 18:09:32 +00:00
|
|
|
set(Output GSdx-0.1.16)
|
2011-02-20 17:01:03 +00:00
|
|
|
|
|
|
|
set(CommonFlags
|
2012-06-12 18:14:01 +00:00
|
|
|
-DOGL_MT_HACK
|
2011-02-20 17:01:03 +00:00
|
|
|
-D_LINUX
|
|
|
|
-fno-operator-names
|
|
|
|
-mpreferred-stack-boundary=2
|
|
|
|
-mfpmath=sse
|
2011-10-30 00:32:22 +00:00
|
|
|
#-Wstrict-aliasing # Allow to track strict aliasing issue.
|
2011-02-20 17:01:03 +00:00
|
|
|
-Wunused-variable
|
2011-12-19 21:03:23 +00:00
|
|
|
-std=c++0x
|
2011-12-27 12:22:13 +00:00
|
|
|
-fno-strict-aliasing
|
2012-05-11 20:52:50 +00:00
|
|
|
#-DOGL_DEBUG # FIXME remove me when code is ready
|
2011-02-20 17:01:03 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
set(OptimizationFlags
|
|
|
|
-O2
|
|
|
|
-DNDEBUG
|
|
|
|
)
|
|
|
|
|
|
|
|
# Debug - Build
|
|
|
|
if(CMAKE_BUILD_TYPE STREQUAL Debug)
|
2012-08-15 10:22:19 +00:00
|
|
|
add_definitions(${CommonFlags} -DOGL_DEBUG -g -Wall)
|
2011-02-20 17:01:03 +00:00
|
|
|
endif(CMAKE_BUILD_TYPE STREQUAL Debug)
|
|
|
|
|
|
|
|
# Devel - Build
|
|
|
|
if(CMAKE_BUILD_TYPE STREQUAL Devel)
|
2012-08-15 10:22:19 +00:00
|
|
|
add_definitions(${CommonFlags} ${OptimizationFlags} -g -W)
|
2011-02-20 17:01:03 +00:00
|
|
|
endif(CMAKE_BUILD_TYPE STREQUAL Devel)
|
|
|
|
|
|
|
|
# Release - Build
|
|
|
|
if(CMAKE_BUILD_TYPE STREQUAL Release)
|
2012-08-15 10:22:19 +00:00
|
|
|
add_definitions(${CommonFlags} ${OptimizationFlags} -W)
|
2011-02-20 17:01:03 +00:00
|
|
|
endif(CMAKE_BUILD_TYPE STREQUAL Release)
|
|
|
|
|
2012-06-12 18:14:01 +00:00
|
|
|
if(XDG_STD)
|
|
|
|
add_definitions(-DXDG_STD)
|
|
|
|
endif(XDG_STD)
|
|
|
|
|
2011-02-20 17:01:03 +00:00
|
|
|
set(GSdxSources
|
|
|
|
GPU.cpp
|
|
|
|
GPUDrawScanline.cpp
|
|
|
|
GPUDrawScanlineCodeGenerator.cpp
|
|
|
|
GPULocalMemory.cpp
|
|
|
|
GPURenderer.cpp
|
|
|
|
GPURendererSW.cpp
|
|
|
|
GPUSetupPrimCodeGenerator.cpp
|
|
|
|
GPUState.cpp
|
|
|
|
GS.cpp
|
|
|
|
GSAlignedClass.cpp
|
|
|
|
GSBlock.cpp
|
|
|
|
GSCapture.cpp
|
|
|
|
GSClut.cpp
|
|
|
|
GSCodeBuffer.cpp
|
|
|
|
GSCrc.cpp
|
|
|
|
GSDevice.cpp
|
2011-11-16 22:17:37 +00:00
|
|
|
GSDeviceOGL.cpp
|
2011-02-26 20:02:22 +00:00
|
|
|
GSDeviceSW.cpp
|
2011-02-20 17:01:03 +00:00
|
|
|
GSDeviceNull.cpp
|
|
|
|
GSDirtyRect.cpp
|
|
|
|
GSDrawScanline.cpp
|
|
|
|
GSDrawScanlineCodeGenerator.cpp
|
2011-03-02 18:18:26 +00:00
|
|
|
GSDrawScanlineCodeGenerator.x86.avx.cpp
|
|
|
|
GSDrawScanlineCodeGenerator.x64.cpp
|
|
|
|
GSDrawScanlineCodeGenerator.x86.cpp
|
|
|
|
GSDrawScanlineCodeGenerator.x64.avx.cpp
|
2011-02-20 17:01:03 +00:00
|
|
|
GSDump.cpp
|
|
|
|
GSFunctionMap.cpp
|
|
|
|
GSLinuxDialog.cpp
|
|
|
|
GSLocalMemory.cpp
|
|
|
|
GSPerfMon.cpp
|
|
|
|
GSRasterizer.cpp
|
|
|
|
GSRenderer.cpp
|
2012-01-15 17:25:49 +00:00
|
|
|
GSRendererHW.cpp
|
2011-02-20 17:01:03 +00:00
|
|
|
GSRendererNull.cpp
|
2011-11-16 22:17:37 +00:00
|
|
|
GSRendererOGL.cpp
|
2011-02-20 17:01:03 +00:00
|
|
|
GSRendererSW.cpp
|
|
|
|
GSSetting.cpp
|
|
|
|
GSSetupPrimCodeGenerator.cpp
|
2011-03-02 18:18:26 +00:00
|
|
|
GSSetupPrimCodeGenerator.x86.avx.cpp
|
|
|
|
GSSetupPrimCodeGenerator.x64.avx.cpp
|
|
|
|
GSSetupPrimCodeGenerator.x86.cpp
|
|
|
|
GSSetupPrimCodeGenerator.x64.cpp
|
2011-02-20 17:01:03 +00:00
|
|
|
GSState.cpp
|
|
|
|
GSTables.cpp
|
|
|
|
GSTexture.cpp
|
|
|
|
GSTextureCache.cpp
|
|
|
|
GSTextureCacheSW.cpp
|
2011-11-16 22:17:37 +00:00
|
|
|
GSTextureCacheOGL.cpp
|
2011-12-19 21:03:23 +00:00
|
|
|
GSTextureFXOGL.cpp
|
2011-11-16 22:17:37 +00:00
|
|
|
GSTextureOGL.cpp
|
2011-02-20 17:01:03 +00:00
|
|
|
GSTextureNull.cpp
|
2011-02-26 20:02:22 +00:00
|
|
|
GSTextureSW.cpp
|
2011-02-20 17:01:03 +00:00
|
|
|
GSThread.cpp
|
|
|
|
GSUtil.cpp
|
|
|
|
GSVector.cpp
|
|
|
|
GSVertexTrace.cpp
|
|
|
|
GSWnd.cpp
|
2013-01-04 11:41:51 +00:00
|
|
|
GSWndOGL.cpp
|
2011-02-20 17:01:03 +00:00
|
|
|
GSdx.cpp
|
|
|
|
stdafx.cpp
|
|
|
|
)
|
|
|
|
|
|
|
|
set(GSdxHeaders
|
|
|
|
GPU.h
|
|
|
|
GPUDrawScanline.h
|
|
|
|
GPUDrawScanlineCodeGenerator.h
|
|
|
|
GPUDrawingEnvironment.h
|
|
|
|
GPULocalMemory.h
|
|
|
|
GPURenderer.h
|
|
|
|
GPURendererSW.h
|
|
|
|
GPUScanlineEnvironment.h
|
|
|
|
GPUSetupPrimCodeGenerator.h
|
|
|
|
GPUState.h
|
|
|
|
GPUVertex.h
|
|
|
|
GS.h
|
|
|
|
GSAlignedClass.h
|
|
|
|
GSBlock.h
|
|
|
|
GSCapture.h
|
|
|
|
GSClut.h
|
|
|
|
GSCodeBuffer.h
|
|
|
|
GSCrc.h
|
|
|
|
GSDevice.h
|
2011-11-16 22:17:37 +00:00
|
|
|
GSDeviceOGL.h
|
2011-02-20 17:01:03 +00:00
|
|
|
GSDeviceNull.h
|
|
|
|
GSDirtyRect.h
|
|
|
|
GSDrawScanline.h
|
|
|
|
GSDrawScanlineCodeGenerator.h
|
|
|
|
GSDrawingContext.h
|
|
|
|
GSDrawingEnvironment.h
|
|
|
|
GSDump.h
|
|
|
|
GSFunctionMap.h
|
2012-01-08 04:59:29 +00:00
|
|
|
GSLinuxLogo.h
|
2011-02-20 17:01:03 +00:00
|
|
|
GSLocalMemory.h
|
|
|
|
GSPerfMon.h
|
|
|
|
GSRasterizer.h
|
|
|
|
GSRenderer.h
|
|
|
|
GSRendererNull.h
|
|
|
|
GSRendererSW.h
|
2011-11-16 22:17:37 +00:00
|
|
|
GSRendererHW.h
|
|
|
|
GSRendererOGL.h
|
2011-02-20 17:01:03 +00:00
|
|
|
GSScanlineEnvironment.h
|
|
|
|
GSSetting.h
|
|
|
|
GSSetupPrimCodeGenerator.h
|
|
|
|
GSState.h
|
|
|
|
GSTables.h
|
|
|
|
GSTexture.h
|
|
|
|
GSTextureCache.h
|
|
|
|
GSTextureCacheSW.h
|
2011-11-16 22:17:37 +00:00
|
|
|
GSTextureCacheOGL.h
|
2011-02-20 17:01:03 +00:00
|
|
|
GSTextureNull.h
|
|
|
|
GSThread.h
|
|
|
|
GSUtil.h
|
|
|
|
GSVector.h
|
|
|
|
GSVertex.h
|
|
|
|
GSVertexHW.h
|
|
|
|
GSVertexList.h
|
|
|
|
GSVertexSW.h
|
|
|
|
GSVertexTrace.h
|
|
|
|
GSWnd.h
|
2013-01-04 11:41:51 +00:00
|
|
|
GSWndOGL.h
|
2011-02-20 17:01:03 +00:00
|
|
|
GSdx.h
|
|
|
|
stdafx.h
|
|
|
|
xbyak/xbyak.h
|
|
|
|
xbyak/xbyak_bin2hex.h
|
|
|
|
xbyak/xbyak_mnemonic.h
|
|
|
|
xbyak/xbyak_util.h
|
|
|
|
)
|
|
|
|
|
|
|
|
include_directories(.)
|
|
|
|
|
2012-01-06 21:43:39 +00:00
|
|
|
add_library(${Output} SHARED ${GSdxSources} ${GSdxHeaders})
|
|
|
|
|
2011-02-20 17:01:03 +00:00
|
|
|
target_link_libraries(${Output} ${X11_LIBRARIES})
|
2012-01-06 21:43:39 +00:00
|
|
|
target_link_libraries(${Output} ${GLEW_LIBRARY})
|
|
|
|
target_link_libraries(${Output} ${OPENGL_LIBRARIES})
|
2011-02-26 20:02:22 +00:00
|
|
|
|
2012-04-16 15:36:16 +00:00
|
|
|
if(Linux)
|
|
|
|
target_link_libraries(${Output} ${GTK2_LIBRARIES})
|
|
|
|
endif(Linux)
|
|
|
|
|
2011-02-20 17:01:03 +00:00
|
|
|
if(NOT USER_CMAKE_LD_FLAGS STREQUAL "")
|
|
|
|
target_link_libraries(${Output} "${USER_CMAKE_LD_FLAGS}")
|
|
|
|
endif(NOT USER_CMAKE_LD_FLAGS STREQUAL "")
|
2011-07-14 09:02:37 +00:00
|
|
|
|
|
|
|
if(PACKAGE_MODE)
|
2011-07-17 11:25:17 +00:00
|
|
|
install(TARGETS ${Output} DESTINATION ${PLUGIN_DIR})
|
2012-01-06 21:43:39 +00:00
|
|
|
|
2012-04-26 21:42:16 +00:00
|
|
|
foreach(glsl IN ITEMS convert.glsl interlace.glsl merge.glsl tfx.glsl shadeboost.glsl)
|
2012-05-07 16:29:06 +00:00
|
|
|
install(FILES ${PROJECT_SOURCE_DIR}/plugins/GSdx/res/${glsl} DESTINATION ${GLSL_SHADER_DIR})
|
2012-04-26 21:42:16 +00:00
|
|
|
endforeach(glsl IN ITEMS convert.glsl interlace.glsl merge.glsl tfx.glsl shadeboost.glsl)
|
2011-07-14 09:02:37 +00:00
|
|
|
else(PACKAGE_MODE)
|
|
|
|
install(TARGETS ${Output} DESTINATION ${CMAKE_SOURCE_DIR}/bin/plugins)
|
2012-01-06 21:43:39 +00:00
|
|
|
|
2012-04-26 21:42:16 +00:00
|
|
|
foreach(glsl IN ITEMS convert.glsl interlace.glsl merge.glsl tfx.glsl shadeboost.glsl)
|
|
|
|
install(FILES ${PROJECT_SOURCE_DIR}/plugins/GSdx/res/${glsl} DESTINATION ${CMAKE_SOURCE_DIR}/bin/plugins)
|
|
|
|
endforeach(glsl IN ITEMS convert.glsl interlace.glsl merge.glsl tfx.glsl shadeboost.glsl)
|
2011-07-14 09:02:37 +00:00
|
|
|
endif(PACKAGE_MODE)
|
2012-01-08 21:59:42 +00:00
|
|
|
|
|
|
|
################################### Replay Loader
|
2012-05-01 10:54:52 +00:00
|
|
|
if(BUILD_REPLAY_LOADERS)
|
|
|
|
set(Replay pcsx2_GSReplayLoader)
|
|
|
|
set(Static GSdx-static)
|
|
|
|
|
|
|
|
# We can have separate option for gsdx inside the player. It will only
|
|
|
|
# cost a 2nd rebuild of gsdx...
|
2012-08-15 10:22:19 +00:00
|
|
|
#add_definitions(${CommonFlags} ${OptimizationFlags} -W)
|
2012-05-01 10:54:52 +00:00
|
|
|
|
|
|
|
add_library(${Static} STATIC ${GSdxSources} ${GSdxHeaders})
|
|
|
|
|
|
|
|
add_executable(${Replay} linux_replay.cpp)
|
|
|
|
|
|
|
|
target_link_libraries(${Static} ${OPENGL_LIBRARIES})
|
|
|
|
target_link_libraries(${Static} ${X11_LIBRARIES})
|
|
|
|
target_link_libraries(${Static} ${GLEW_LIBRARY})
|
|
|
|
target_link_libraries(${Static} ${GTK2_LIBRARIES})
|
|
|
|
|
|
|
|
target_link_libraries(${Replay} ${Static})
|
|
|
|
# Warning others lib must be linked after GSdx...
|
|
|
|
target_link_libraries(${Replay} ${OPENGL_LIBRARIES})
|
|
|
|
target_link_libraries(${Replay} ${X11_LIBRARIES})
|
|
|
|
target_link_libraries(${Replay} ${GLEW_LIBRARY})
|
|
|
|
target_link_libraries(${Replay} ${GTK2_LIBRARIES})
|
|
|
|
|
|
|
|
if(NOT USER_CMAKE_LD_FLAGS STREQUAL "")
|
|
|
|
target_link_libraries(${Replay} "${USER_CMAKE_LD_FLAGS}")
|
|
|
|
endif(NOT USER_CMAKE_LD_FLAGS STREQUAL "")
|
|
|
|
|
|
|
|
if(PACKAGE_MODE)
|
|
|
|
install(TARGETS ${Replay} DESTINATION bin)
|
|
|
|
else(PACKAGE_MODE)
|
|
|
|
install(TARGETS ${Replay} DESTINATION ${CMAKE_SOURCE_DIR}/bin)
|
|
|
|
endif(PACKAGE_MODE)
|
|
|
|
endif(BUILD_REPLAY_LOADERS)
|