cmake: Start getting zzogl-pg and spu2-x support in the cmake build system. (I'm not enabling it yet, as I don't have time to get it working properly at the moment. That's probably a project for this weekend.)

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2984 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
arcum42 2010-05-12 09:51:46 +00:00
parent 36973bfb92
commit d24831f0d8
4 changed files with 288 additions and 0 deletions

View File

@ -105,6 +105,11 @@ if(zerogs)
add_subdirectory(zerogs)
endif(zerogs)
# make zzogl-pg
#if(zzogl)
# add_subdirectory(zzogl-pg)
#endif(zzogl)
# make zeropad
if(zeropad)
add_subdirectory(zeropad)

View File

@ -0,0 +1,131 @@
# spu2x Plugin
# plugin name
set(spu2xName spu2x)
# Clear default flags
set(CMAKE_C_FLAGS "")
set(CMAKE_CXX_FLAGS "")
set(CMAKE_C_FLAGS_DEBUG "")
set(CMAKE_CXX_FLAGS_DEBUG "")
set(CMAKE_C_FLAGS_DEVEL "")
set(CMAKE_CXX_FLAGS_DEVEL "")
set(CMAKE_C_FLAGS_RELEASE "")
set(CMAKE_CXX_FLAGS_RELEASE "")
# Debug - Build
if(CMAKE_BUILD_TYPE STREQUAL Debug)
# add defines
add_definitions(-Wall -fPIC -m32 -msse2 -g)
endif(CMAKE_BUILD_TYPE STREQUAL Debug)
# Devel - Build
if(CMAKE_BUILD_TYPE STREQUAL Devel)
# add defines
add_definitions(-Wall -fPIC -m32 -msse2 -DNDEBUG)
endif(CMAKE_BUILD_TYPE STREQUAL Devel)
# Release - Build
if(CMAKE_BUILD_TYPE STREQUAL Release)
# add defines
add_definitions(-Wall -fPIC -m32 -msse2 -s -DNDEBUG)
endif(CMAKE_BUILD_TYPE STREQUAL Release)
# spu2x sources
set(spu2xSources
ADSR.cpp
ConvertUTF.cpp
Debug.cpp
Decoder.cpp
Dma.cpp
iconvert.cpp
Lowpass.cpp
Mixer.cpp
PrecompiledHeader.cpp
PS2E-spu2.cpp
ReadInput.cpp
RegLog.cpp
RegTable.cpp
Reverb.cpp
SndOut.cpp
SndOut_Portaudio.cpp
spu2freeze.cpp
Spu2replay.cpp
spu2sys.cpp
Timestretcher.cpp
utf8.cpp
Wavedump_wav.cpp)
# spu2x headers
set(spu2xHeaders
Config.h
ConvertUTF.h
Debug.h
defs.h
Dma.h
DPLII.h
Global.h
Lowpass.h
Mixer.h
PS2E-spu2.h
regs.h
SndOut.h
spdif.h
Spu2replay.h
utf8.h)
# spu2x Linux sources
set(spu2xLinuxSources
Linux/AboutBox.cpp
Linux/Alsa.cpp
Linux/CfgHelpers.cpp
Linux/Config.cpp
Linux/ConfigDebug.cpp
Linux/ConfigSoundTouch.cpp
Linux/Dialogs.cpp)
# spu2x Linux headers
set(spu2xLinuxHeaders
Linux/Alsa.h
Linux/Config.h
Linux/Dialogs.h)
# add additional include directories
include_directories(.
Linux)
# add library
add_library(${spu2xName} SHARED
${spu2xSources}
${spu2xHeaders}
${spu2xLinuxSources}
${spu2xLinuxHeaders})
# set output directory
set_target_properties(${spu2xName} PROPERTIES
LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin/plugins)
# link target with project internal libraries
target_link_libraries(${spu2xName} Utilities x86emitter)
# link target with ALSA
target_link_libraries(${spu2xName} ${ALSA_LIBRARIES})
# # link target with PortAudio
if(PORTAUDIO_FOUND)
target_link_libraries(${spu2xName} ${PORTAUDIO_LIBRARIES})
endif(PORTAUDIO_FOUND)
# link target with SoundTouch
if(projectSoundTouch)
target_link_libraries(${spu2xName} SoundTouch)
else(projectSoundTouch)
target_link_libraries(${spu2xName} ${SOUNDTOUCH_LIBRARIES})
endif(projectSoundTouch)
# link target with A52
target_link_libraries(${spu2xName} ${A52_LIBRARIES})
target_link_libraries(${spu2xName} -m32)

View File

@ -0,0 +1,6 @@
# zzogl plugin
# zerogs plugin opengl
if(UNIX)
add_subdirectory(opengl)
endif(UNIX)

View File

@ -0,0 +1,146 @@
# zzogl Plugin
# Clear default flags
set(CMAKE_C_FLAGS "")
set(CMAKE_CXX_FLAGS "")
set(CMAKE_C_FLAGS_DEBUG "")
set(CMAKE_CXX_FLAGS_DEBUG "")
set(CMAKE_C_FLAGS_DEVEL "")
set(CMAKE_CXX_FLAGS_DEVEL "")
set(CMAKE_C_FLAGS_RELEASE "")
set(CMAKE_CXX_FLAGS_RELEASE "")
# Also clear shared library flag to remove fpic option
# that broke some asm code. The better solution will be to remove
# the asm or fix it.
set(CMAKE_SHARED_LIBRARY_CXX_FLAGS "")
set(CMAKE_SHARED_LIBRARY_C_FLAGS "")
# plugin name
set(zzoglName zzogl)
# Debug - Build
if(CMAKE_BUILD_TYPE STREQUAL Debug)
# add defines
add_definitions(-Wall -m32 -g)
endif(CMAKE_BUILD_TYPE STREQUAL Debug)
# Devel - Build
if(CMAKE_BUILD_TYPE STREQUAL Devel)
# add defines
add_definitions(-Wall -m32 -O2)
endif(CMAKE_BUILD_TYPE STREQUAL Devel)
# Release - Build
if(CMAKE_BUILD_TYPE STREQUAL Release)
# add defines
add_definitions(-Wall -m32 -O2 -s)
endif(CMAKE_BUILD_TYPE STREQUAL Release)
# zzogl sources
set(zzoglSources
GifTransfer.cpp
GLWin32.cpp
GLWinX11.cpp
GSmain.cpp
Mem.cpp
memcpy_amd.cpp
Mem_Swizzle.cpp
Mem_Tables.cpp
Profile.cpp
rasterfont.cpp
Regs.cpp
targets.cpp
x86.cpp
zerogs.cpp
zpipe.cpp
ZZoglCreate.cpp
ZZoglCRTC.cpp
ZZoglFlush.cpp
ZZoglSave.cpp
ZZoglShaders.cpp
ZZoglShoots.cpp
ZZoglVB.cpp)
# zzogl headers
set(zzoglHeaders
common.h
GifTransfer.h
glprocs.h
GS.h
Mem.h
Mem_Swizzle.h
Mem_Transmit.h
Profile.h
rasterfont.h
Regs.h
targets.h
Util.h
x86.h
zerogs.h
zerogsmath.h
zpipe.h)
# zzogl S sources
set(zzoglSSources
x86-32.S)
# zzogl shader sources
set(zzoglShaderSources
ctx0/ps2hw_ctx.fx
ctx1/ps2hw_ctx.fx)
# zzogl Linux sources
set(zzoglLinuxSources
Linux/Conf.cpp
Linux/Linux.cpp)
# zzogl Linux headers
set(zzoglLinuxHeaders
Linux/Linux.h)
# change language of .S-files to c++
set_source_files_properties(${zzoglSSources} PROPERTIES LANGUAGE CXX)
# add additional include directories
include_directories(.
Linux)
# add library
add_library(${zzoglName} SHARED
${zzoglSources}
${zzoglHeaders}
${zzoglSSources}
${zzoglShaderSources}
${zzoglLinuxSources}
${zzoglLinuxHeaders})
# set output directory
set_target_properties(${zzoglName} PROPERTIES
LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin/plugins)
# WARNING can conflict with zerogs plugin
# copy ps2hw.dat to plugins folder
add_custom_command(TARGET ${zzoglName} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${PROJECT_SOURCE_DIR}/plugins/zzogl-pg/opengl/ps2hw.dat ${PROJECT_SOURCE_DIR}/bin/plugins)
# link target with project internal libraries
target_link_libraries(${zzoglName} Utilities)
# link target with Cg
target_link_libraries(${zzoglName} ${CG_LIBRARIES})
# link target with glew
target_link_libraries(${zzoglName} ${GLEW_LIBRARY})
# link target with opengl
target_link_libraries(${zzoglName} ${OPENGL_LIBRARIES})
# link target with X11
target_link_libraries(${zzoglName} ${X11_LIBRARIES})
# link target with X11 videomod
target_link_libraries(${zzoglName} ${X11_Xxf86vm_LIB})
# Set link flag
target_link_libraries(${zzoglName} -m32)