2010-06-22 13:30:36 +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)
|
|
|
|
|
2010-05-12 09:51:46 +00:00
|
|
|
|
|
|
|
# plugin name
|
2010-07-25 13:54:26 +00:00
|
|
|
set(Output zzogl)
|
2010-05-12 09:51:46 +00:00
|
|
|
|
2010-05-13 11:03:39 +00:00
|
|
|
set(CommonFlags
|
|
|
|
-pthread
|
2010-08-09 19:05:02 +00:00
|
|
|
-DZEROGS_SSE2
|
|
|
|
-fno-regmove
|
|
|
|
-fno-strict-aliasing
|
2010-09-15 16:54:19 +00:00
|
|
|
-Wstrict-aliasing # Allow to track strict aliasing issue.
|
2010-05-13 11:03:39 +00:00
|
|
|
-Wno-format
|
|
|
|
-Wno-unused-parameter
|
|
|
|
-Wno-unused-value
|
|
|
|
-Wunused-variable
|
|
|
|
)
|
|
|
|
|
2010-06-03 15:12:29 +00:00
|
|
|
set(OptimizationFlags
|
|
|
|
-O2
|
2010-06-05 11:56:52 +00:00
|
|
|
-DNDEBUG
|
2010-06-03 15:12:29 +00:00
|
|
|
)
|
2010-05-13 11:03:39 +00:00
|
|
|
|
2010-05-12 09:51:46 +00:00
|
|
|
# Debug - Build
|
|
|
|
if(CMAKE_BUILD_TYPE STREQUAL Debug)
|
|
|
|
# add defines
|
2010-05-13 11:03:39 +00:00
|
|
|
add_definitions(${CommonFlags} -g -Wall -D_DEBUG)
|
2010-05-12 09:51:46 +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} -g -W -DZEROGS_DEVBUILD)
|
2010-05-12 09:51:46 +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} -W)
|
2010-05-12 09:51:46 +00:00
|
|
|
endif(CMAKE_BUILD_TYPE STREQUAL Release)
|
|
|
|
|
|
|
|
# zzogl sources
|
|
|
|
set(zzoglSources
|
|
|
|
GifTransfer.cpp
|
|
|
|
GLWin32.cpp
|
|
|
|
GLWinX11.cpp
|
|
|
|
GSmain.cpp
|
2010-07-10 08:08:36 +00:00
|
|
|
HostMemory.cpp
|
2010-05-12 09:51:46 +00:00
|
|
|
Mem.cpp
|
2010-10-15 09:32:41 +00:00
|
|
|
# memcpy_amd.cpp
|
2010-05-12 09:51:46 +00:00
|
|
|
Mem_Swizzle.cpp
|
|
|
|
Mem_Tables.cpp
|
|
|
|
Profile.cpp
|
|
|
|
rasterfont.cpp
|
2010-07-05 13:22:02 +00:00
|
|
|
NewRegs.cpp
|
2010-05-12 09:51:46 +00:00
|
|
|
Regs.cpp
|
|
|
|
targets.cpp
|
|
|
|
x86.cpp
|
|
|
|
zerogs.cpp
|
|
|
|
zpipe.cpp
|
2010-10-20 09:09:31 +00:00
|
|
|
ZZClut.cpp
|
|
|
|
ZZKeyboard.cpp
|
|
|
|
ZZKick.cpp
|
|
|
|
ZZLog.cpp
|
2010-05-12 09:51:46 +00:00
|
|
|
ZZoglCreate.cpp
|
|
|
|
ZZoglCRTC.cpp
|
|
|
|
ZZoglFlush.cpp
|
2010-08-17 13:38:57 +00:00
|
|
|
ZZoglFlushHack.cpp
|
2010-05-12 09:51:46 +00:00
|
|
|
ZZoglSave.cpp
|
|
|
|
ZZoglShaders.cpp
|
|
|
|
ZZoglShoots.cpp
|
2010-07-02 09:32:04 +00:00
|
|
|
ZZoglVB.cpp
|
2010-10-20 09:09:31 +00:00
|
|
|
)
|
2010-05-12 09:51:46 +00:00
|
|
|
|
|
|
|
# zzogl headers
|
|
|
|
set(zzoglHeaders
|
|
|
|
common.h
|
2010-06-11 11:48:07 +00:00
|
|
|
CRC.h
|
2010-05-12 09:51:46 +00:00
|
|
|
GifTransfer.h
|
2010-10-15 09:32:41 +00:00
|
|
|
# glprocs.h
|
2010-05-12 09:51:46 +00:00
|
|
|
GS.h
|
2010-10-17 10:03:12 +00:00
|
|
|
HostMemory.h
|
2010-05-12 09:51:46 +00:00
|
|
|
Mem.h
|
|
|
|
Mem_Swizzle.h
|
|
|
|
Mem_Transmit.h
|
|
|
|
Profile.h
|
|
|
|
rasterfont.h
|
2010-07-05 13:22:02 +00:00
|
|
|
NewRegs.h
|
2010-05-12 09:51:46 +00:00
|
|
|
Regs.h
|
|
|
|
targets.h
|
|
|
|
Util.h
|
|
|
|
x86.h
|
|
|
|
zerogs.h
|
2010-06-28 19:46:54 +00:00
|
|
|
zpipe.h
|
2010-10-20 09:09:31 +00:00
|
|
|
ZZClut.h
|
|
|
|
ZZGl.h
|
2010-10-17 09:42:49 +00:00
|
|
|
ZZKick.h
|
2010-10-20 09:09:31 +00:00
|
|
|
ZZLog.h
|
|
|
|
ZZoglCRTC.h
|
2010-09-19 08:01:48 +00:00
|
|
|
ZZoglMath.h
|
2010-09-15 16:54:19 +00:00
|
|
|
ZZoglShaders.h
|
2010-10-17 09:07:16 +00:00
|
|
|
ZZoglShoots.h
|
2010-10-23 08:15:39 +00:00
|
|
|
ZZoglVB.h
|
2010-10-20 09:09:31 +00:00
|
|
|
)
|
2010-05-12 09:51:46 +00:00
|
|
|
|
|
|
|
# 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
|
2010-07-25 13:54:26 +00:00
|
|
|
add_library(${Output} SHARED
|
2010-05-12 09:51:46 +00:00
|
|
|
${zzoglSources}
|
|
|
|
${zzoglHeaders}
|
|
|
|
${zzoglSSources}
|
|
|
|
${zzoglShaderSources}
|
|
|
|
${zzoglLinuxSources}
|
|
|
|
${zzoglLinuxHeaders})
|
|
|
|
|
|
|
|
# set output directory
|
2010-07-25 13:54:26 +00:00
|
|
|
set_target_properties(${Output} PROPERTIES
|
2010-05-12 09:51:46 +00:00
|
|
|
LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin/plugins)
|
|
|
|
|
|
|
|
# WARNING can conflict with zerogs plugin
|
|
|
|
# copy ps2hw.dat to plugins folder
|
2010-07-25 13:54:26 +00:00
|
|
|
add_custom_command(TARGET ${Output} POST_BUILD
|
2010-05-12 09:51:46 +00:00
|
|
|
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
|
2010-07-25 13:54:26 +00:00
|
|
|
target_link_libraries(${Output} Utilities)
|
2010-05-12 09:51:46 +00:00
|
|
|
|
|
|
|
# link target with Cg
|
2010-07-25 13:54:26 +00:00
|
|
|
target_link_libraries(${Output} ${CG_LIBRARIES})
|
2010-05-12 09:51:46 +00:00
|
|
|
|
|
|
|
# link target with glew
|
2010-07-25 13:54:26 +00:00
|
|
|
target_link_libraries(${Output} ${GLEW_LIBRARY})
|
2010-05-12 09:51:46 +00:00
|
|
|
|
|
|
|
# link target with opengl
|
2010-07-25 13:54:26 +00:00
|
|
|
target_link_libraries(${Output} ${OPENGL_LIBRARIES})
|
2010-05-12 09:51:46 +00:00
|
|
|
|
|
|
|
# link target with X11
|
2010-07-25 13:54:26 +00:00
|
|
|
target_link_libraries(${Output} ${X11_LIBRARIES})
|
2010-05-12 09:51:46 +00:00
|
|
|
|
2010-09-15 16:54:19 +00:00
|
|
|
# link target with jpeg
|
|
|
|
target_link_libraries(${Output} ${JPEG_LIBRARIES})
|
|
|
|
|
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 "")
|