2012-04-17 17:06:58 +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")
|
2014-12-14 13:00:20 +00:00
|
|
|
endif()
|
2012-04-17 17:06:58 +00:00
|
|
|
|
|
|
|
|
|
|
|
# plugin name
|
|
|
|
set(Output zzogl-shader)
|
|
|
|
|
|
|
|
set(CommonFlags
|
|
|
|
-DZEROGS_SSE2
|
|
|
|
-fno-strict-aliasing
|
|
|
|
-Wstrict-aliasing # Allow to track strict aliasing issue.
|
|
|
|
-Wunused-variable
|
|
|
|
-DNVIDIA_CG_API
|
|
|
|
)
|
|
|
|
|
|
|
|
set(OptimizationFlags
|
|
|
|
-O2
|
|
|
|
)
|
|
|
|
|
|
|
|
if(CMAKE_BUILD_TYPE STREQUAL Debug)
|
2014-08-04 16:42:40 +00:00
|
|
|
set(zerogsshadersFinalFlags
|
2014-12-14 13:00:20 +00:00
|
|
|
${CommonFlags} -D_DEBUG
|
2014-08-04 16:42:40 +00:00
|
|
|
)
|
2014-12-14 13:00:20 +00:00
|
|
|
elseif(CMAKE_BUILD_TYPE STREQUAL Devel)
|
2014-08-04 16:42:40 +00:00
|
|
|
set(zerogsshadersFinalFlags
|
|
|
|
${CommonFlags} ${OptimizationFlags} -g -W -DZEROGS_DEVBUILD
|
|
|
|
)
|
2014-12-14 13:00:20 +00:00
|
|
|
elseif(CMAKE_BUILD_TYPE STREQUAL Release)
|
2014-08-04 16:42:40 +00:00
|
|
|
set(zerogsshadersFinalFlags
|
|
|
|
${CommonFlags} ${OptimizationFlags} -W
|
|
|
|
)
|
2012-04-17 17:06:58 +00:00
|
|
|
endif(CMAKE_BUILD_TYPE STREQUAL Release)
|
|
|
|
|
2014-08-04 16:42:40 +00:00
|
|
|
set(zerogsshadersFinalSources
|
|
|
|
zerogsshaders.cpp
|
|
|
|
zpipe.cpp
|
|
|
|
)
|
2012-04-17 17:06:58 +00:00
|
|
|
|
2014-08-04 16:42:40 +00:00
|
|
|
set(zerogsshadersFinalLibs
|
|
|
|
${ZLIB_LIBRARIES}
|
|
|
|
${CG_LIBRARIES}
|
|
|
|
${OPENGL_LIBRARIES}
|
|
|
|
)
|
2012-04-17 17:06:58 +00:00
|
|
|
|
2014-08-04 16:42:40 +00:00
|
|
|
add_pcsx2_executable(${Output} "${zerogsshadersFinalSources}" "${zerogsshadersFinalLibs}" "${zerogsshadersFinalFlags}")
|
2012-04-17 17:06:58 +00:00
|
|
|
|
|
|
|
# Now build the shader
|
|
|
|
add_custom_command(TARGET ${Output} POST_BUILD
|
|
|
|
COMMAND ${Output} ps2hw.fx ${CMAKE_CURRENT_BINARY_DIR}/ps2hw_cmake.dat
|
2014-03-30 14:28:59 +00:00
|
|
|
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/plugins/zzogl-pg/opengl
|
2012-04-17 17:06:58 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
if(PACKAGE_MODE)
|
2012-05-01 10:54:52 +00:00
|
|
|
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/ps2hw_cmake.dat DESTINATION ${PLUGIN_DIR} RENAME ps2hw.dat)
|
2012-04-17 17:06:58 +00:00
|
|
|
else(PACKAGE_MODE)
|
2012-05-01 10:54:52 +00:00
|
|
|
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/ps2hw_cmake.dat DESTINATION ${CMAKE_SOURCE_DIR}/bin/plugins RENAME ps2hw.dat)
|
2012-04-17 17:06:58 +00:00
|
|
|
endif(PACKAGE_MODE)
|