2010-01-21 15:12:50 +00:00
|
|
|
# zerogs Plugin
|
|
|
|
|
|
|
|
# plugin name
|
2010-07-25 13:54:26 +00:00
|
|
|
set(Output zerogs)
|
2010-01-21 15:12:50 +00:00
|
|
|
|
2010-06-03 15:12:29 +00:00
|
|
|
set(CommonFlags
|
|
|
|
-Wall
|
|
|
|
)
|
|
|
|
|
|
|
|
set(OptimizationFlags
|
|
|
|
-O2
|
|
|
|
)
|
|
|
|
|
2010-01-22 04:36:49 +00:00
|
|
|
# Debug - Build
|
|
|
|
if(CMAKE_BUILD_TYPE STREQUAL Debug)
|
|
|
|
# add defines
|
2010-06-03 15:12:29 +00:00
|
|
|
add_definitions(${CommonFlags} -g)
|
2010-01-22 04:36:49 +00:00
|
|
|
endif(CMAKE_BUILD_TYPE STREQUAL Debug)
|
|
|
|
|
|
|
|
# Devel - Build
|
|
|
|
if(CMAKE_BUILD_TYPE STREQUAL Devel)
|
|
|
|
# add defines
|
2010-06-03 15:12:29 +00:00
|
|
|
add_definitions(${CommonFlags} ${OptimizationFlags})
|
2010-01-22 04:36:49 +00:00
|
|
|
endif(CMAKE_BUILD_TYPE STREQUAL Devel)
|
|
|
|
|
|
|
|
# Release - Build
|
|
|
|
if(CMAKE_BUILD_TYPE STREQUAL Release)
|
|
|
|
# add defines
|
2010-06-03 15:12:29 +00:00
|
|
|
add_definitions(${CommonFlags} ${OptimizationFlags})
|
2010-01-22 04:36:49 +00:00
|
|
|
endif(CMAKE_BUILD_TYPE STREQUAL Release)
|
2010-01-21 15:12:50 +00:00
|
|
|
|
|
|
|
# zerogs sources
|
|
|
|
set(zerogsSources
|
|
|
|
GifTransfer.cpp
|
|
|
|
glprocs.c
|
|
|
|
GSmain.cpp
|
|
|
|
GLWinX11.cpp
|
|
|
|
Mem.cpp
|
|
|
|
memcpy_amd.cpp
|
|
|
|
rasterfont.cpp
|
|
|
|
Regs.cpp
|
|
|
|
targets.cpp
|
|
|
|
x86.cpp
|
|
|
|
zerogs.cpp
|
|
|
|
zpipe.cpp)
|
2010-06-03 15:12:29 +00:00
|
|
|
|
2010-01-21 15:12:50 +00:00
|
|
|
# zerogs headers
|
|
|
|
set(zerogsHeaders
|
|
|
|
common.h
|
|
|
|
GifTransfer.h
|
|
|
|
glprocs.h
|
|
|
|
GS.h
|
|
|
|
Mem.h
|
|
|
|
rasterfont.h
|
|
|
|
Regs.h
|
|
|
|
targets.h
|
|
|
|
x86.h
|
|
|
|
zerogs.h
|
|
|
|
zerogsmath.h
|
|
|
|
zpipe.h)
|
|
|
|
|
|
|
|
# zerogs S sources
|
|
|
|
set(zerogsSSources
|
|
|
|
x86-32.S)
|
|
|
|
|
|
|
|
# zerogs shader sources
|
|
|
|
set(zerogsShaderSources
|
|
|
|
ctx0/ps2hw_ctx.fx
|
|
|
|
ctx1/ps2hw_ctx.fx)
|
|
|
|
|
|
|
|
# zerogs Linux sources
|
|
|
|
set(zerogsLinuxSources
|
|
|
|
# Linux/callbacks.c
|
|
|
|
Linux/Conf.cpp
|
|
|
|
Linux/interface.c
|
|
|
|
Linux/Linux.cpp
|
|
|
|
Linux/support.c)
|
|
|
|
|
|
|
|
# zerogs Linux headers
|
|
|
|
set(zerogsLinuxHeaders
|
|
|
|
Linux/callbacks.h
|
|
|
|
Linux/interface.h
|
|
|
|
Linux/Linux.h
|
|
|
|
Linux/support.h)
|
|
|
|
|
|
|
|
# zerogs Windows sources
|
|
|
|
set(zerogsWindowsSources
|
|
|
|
Win32/Conf.cpp
|
|
|
|
Win32/Win32.cpp
|
|
|
|
Win32/zerogs.def
|
|
|
|
Win32/zerogs.rc)
|
|
|
|
|
|
|
|
# zerogs Windows headers
|
|
|
|
set(zerogsWindowsHeaders
|
|
|
|
aviUtil.h
|
|
|
|
jcofig.h
|
|
|
|
jmorecfg.h
|
|
|
|
jpeglib.h
|
|
|
|
resource.h
|
|
|
|
resrc1.h
|
|
|
|
Win32.h)
|
|
|
|
|
|
|
|
# change language of .S-files to c++
|
|
|
|
set_source_files_properties(${zerogsSSources} PROPERTIES LANGUAGE CXX)
|
|
|
|
|
2010-01-22 04:36:49 +00:00
|
|
|
# add additional include directories
|
|
|
|
include_directories(.)
|
|
|
|
|
2010-01-21 15:12:50 +00:00
|
|
|
# add library
|
2010-07-25 13:54:26 +00:00
|
|
|
add_library(${Output} SHARED
|
2010-01-21 15:12:50 +00:00
|
|
|
${zerogsSources}
|
|
|
|
${zerogsHeaders}
|
|
|
|
${zerogsSSources}
|
|
|
|
${zerogsShaderSources}
|
|
|
|
${zerogsLinuxSources}
|
|
|
|
${zerogsLinuxHeaders})
|
|
|
|
|
|
|
|
# set output directory
|
2010-07-25 13:54:26 +00:00
|
|
|
set_target_properties(${Output} PROPERTIES
|
2014-03-30 14:28:59 +00:00
|
|
|
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin/plugins)
|
2010-01-21 15:12:50 +00:00
|
|
|
|
2010-01-22 04:36:49 +00:00
|
|
|
# copy ps2hw.dat to plugins folder
|
2010-07-25 13:54:26 +00:00
|
|
|
add_custom_command(TARGET ${Output} POST_BUILD
|
2014-03-30 14:28:59 +00:00
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/plugins/zerogs/opengl/Win32/ps2hw.dat ${CMAKE_SOURCE_DIR}/bin/plugins)
|
2010-01-21 15:12:50 +00:00
|
|
|
|
2010-01-22 04:36:49 +00:00
|
|
|
# link target with Cg
|
2010-07-25 13:54:26 +00:00
|
|
|
target_link_libraries(${Output} ${CG_LIBRARIES})
|
2010-01-21 15:12:50 +00:00
|
|
|
|
2010-01-22 04:36:49 +00:00
|
|
|
# link target with glew
|
2010-07-25 13:54:26 +00:00
|
|
|
target_link_libraries(${Output} ${GLEW_LIBRARY})
|
2010-01-21 15:12:50 +00:00
|
|
|
|
2010-01-22 04:36:49 +00:00
|
|
|
# link target with opengl
|
2010-07-25 13:54:26 +00:00
|
|
|
target_link_libraries(${Output} ${OPENGL_LIBRARIES})
|
2010-01-21 15:12:50 +00:00
|
|
|
|
2010-01-22 04:36:49 +00:00
|
|
|
# link target with X11
|
2010-07-25 13:54:26 +00:00
|
|
|
target_link_libraries(${Output} ${X11_LIBRARIES})
|
2010-01-22 04:36:49 +00:00
|
|
|
|
|
|
|
# link target with X11 videomod
|
2010-07-25 13:54:26 +00:00
|
|
|
target_link_libraries(${Output} ${X11_Xxf86vm_LIB})
|
2010-07-25 14:20:03 +00:00
|
|
|
|
|
|
|
# User flags options
|
|
|
|
if(NOT USER_CMAKE_LD_FLAGS STREQUAL "")
|
|
|
|
target_link_libraries(${Output} "${USER_CMAKE_LD_FLAGS}")
|
|
|
|
endif(NOT USER_CMAKE_LD_FLAGS STREQUAL "")
|