cmake: Use previous macros in CMakeLists.txt files

Gregory: add a c lib for zzogl-pg-cg replayer
This commit is contained in:
uyjulian 2014-08-04 11:42:40 -05:00 committed by Gregory Hainaut
parent 1290d0b1a3
commit f3a50a01a7
22 changed files with 572 additions and 676 deletions

View File

@ -136,4 +136,3 @@ macro(add_pcsx2_executable exe srcs libs flags)
install(TARGETS ${exe} DESTINATION ${CMAKE_SOURCE_DIR}/bin) install(TARGETS ${exe} DESTINATION ${CMAKE_SOURCE_DIR}/bin)
endif(PACKAGE_MODE) endif(PACKAGE_MODE)
endmacro(add_pcsx2_executable) endmacro(add_pcsx2_executable)

View File

@ -57,28 +57,40 @@ set(OptimizationFlags
#Clang doesn't support a few common flags that GCC does. #Clang doesn't support a few common flags that GCC does.
if(NOT USE_CLANG) if(NOT USE_CLANG)
add_definitions(${CommonFlags} -fno-guess-branch-probability -fno-dse -fno-tree-dse) set(UtilitiesFinalFlags
${UtilitiesFinalFlags}
${CommonFlags} -fno-guess-branch-probability -fno-dse -fno-tree-dse
)
endif(NOT USE_CLANG) endif(NOT USE_CLANG)
# Debug - Build # Debug - Build
if(CMAKE_BUILD_TYPE STREQUAL Debug) if(CMAKE_BUILD_TYPE STREQUAL Debug)
# add defines # add defines
add_definitions(${CommonFlags} -DPCSX2_DEBUG -DPCSX2_DEVBUILD) set(UtilitiesFinalFlags
${UtilitiesFinalFlags}
${CommonFlags} -DPCSX2_DEBUG -DPCSX2_DEVBUILD
)
endif(CMAKE_BUILD_TYPE STREQUAL Debug) endif(CMAKE_BUILD_TYPE STREQUAL Debug)
# Devel - Build # Devel - Build
if(CMAKE_BUILD_TYPE STREQUAL Devel) if(CMAKE_BUILD_TYPE STREQUAL Devel)
# add defines # add defines
add_definitions(${CommonFlags} ${OptimizationFlags} -DPCSX2_DEVBUILD) set(UtilitiesFinalFlags
${UtilitiesFinalFlags}
${CommonFlags} ${OptimizationFlags} -DPCSX2_DEVBUILD
)
endif(CMAKE_BUILD_TYPE STREQUAL Devel) endif(CMAKE_BUILD_TYPE STREQUAL Devel)
# Release - Build # Release - Build
if(CMAKE_BUILD_TYPE STREQUAL Release) if(CMAKE_BUILD_TYPE STREQUAL Release)
# add defines # add defines
add_definitions(${CommonFlags} ${OptimizationFlags}) set(UtilitiesFinalFlags
${UtilitiesFinalFlags}
${CommonFlags} ${OptimizationFlags}
)
endif(CMAKE_BUILD_TYPE STREQUAL Release) endif(CMAKE_BUILD_TYPE STREQUAL Release)
# variable with all sources of this library # variable with all sources of this library
@ -159,22 +171,17 @@ set(UtilitiesHeaders
../../include/Utilities/wxGuiTools.h ../../include/Utilities/wxGuiTools.h
PrecompiledHeader.h) PrecompiledHeader.h)
include_directories(.)
# change language of .S-files to c++ # change language of .S-files to c++
set_source_files_properties(${UtilitiesSSources} PROPERTIES LANGUAGE CXX) set_source_files_properties(${UtilitiesSSources} PROPERTIES LANGUAGE CXX)
# add library set(UtilitiesFinalSources
add_library(${Output} STATIC ${UtilitiesSources} ${UtilitiesHeaders} ${UtilitiesSSources}) ${UtilitiesSources}
${UtilitiesHeaders}
${UtilitiesSSources}
)
# link target with wx set(UtilitiesFinalLibs
target_link_libraries(${Output} ${wxWidgets_LIBRARIES}) ${wxWidgets_LIBRARIES}
)
# Gold (new linux linker) does not get automatically dependency of dependency so you must add add_pcsx2_lib(${Output} "${UtilitiesFinalSources}" "${UtilitiesFinalLibs}" "${UtilitiesFinalFlags}")
# them manually.
target_link_libraries(${Output} ${LIBC_LIBRARIES})
# 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 "")

View File

@ -57,28 +57,38 @@ set(OptimizationFlags
#Clang doesn't support a few common flags that GCC does. #Clang doesn't support a few common flags that GCC does.
if(NOT USE_CLANG) if(NOT USE_CLANG)
add_definitions(${CommonFlags} -fno-guess-branch-probability -fno-dse -fno-tree-dse) set(x86emitterFinalFlags
${x86emitterFinalFlags}
${CommonFlags} -fno-guess-branch-probability -fno-dse -fno-tree-dse
)
endif(NOT USE_CLANG) endif(NOT USE_CLANG)
# Debug - Build # Debug - Build
if(CMAKE_BUILD_TYPE STREQUAL Debug) if(CMAKE_BUILD_TYPE STREQUAL Debug)
# add defines # add defines
add_definitions(${CommonFlags} -DPCSX2_DEVBUILD -DPCSX2_DEBUG) set(x86emitterFinalFlags
${x86emitterFinalFlags}
${CommonFlags} -DPCSX2_DEBUG -DPCSX2_DEVBUILD
)
endif(CMAKE_BUILD_TYPE STREQUAL Debug) endif(CMAKE_BUILD_TYPE STREQUAL Debug)
# Devel - Build # Devel - Build
if(CMAKE_BUILD_TYPE STREQUAL Devel) if(CMAKE_BUILD_TYPE STREQUAL Devel)
# add defines # add defines
add_definitions(${CommonFlags} ${OptimizationFlags} -DPCSX2_DEVBUILD) set(x86emitterFinalFlags
${x86emitterFinalFlags}
${CommonFlags} ${OptimizationFlags} -DPCSX2_DEVBUILD
)
endif(CMAKE_BUILD_TYPE STREQUAL Devel) endif(CMAKE_BUILD_TYPE STREQUAL Devel)
# Release - Build # Release - Build
if(CMAKE_BUILD_TYPE STREQUAL Release) if(CMAKE_BUILD_TYPE STREQUAL Release)
# add defines # add defines
add_definitions(${CommonFlags} ${OptimizationFlags}) set(x86emitterFinalFlags
${x86emitterFinalFlags}
${CommonFlags} ${OptimizationFlags}
)
endif(CMAKE_BUILD_TYPE STREQUAL Release) endif(CMAKE_BUILD_TYPE STREQUAL Release)
# variable with all sources of this library # variable with all sources of this library
@ -127,13 +137,13 @@ set(x86emitterHeaders
../../include/x86emitter/x86types.h ../../include/x86emitter/x86types.h
PrecompiledHeader.h) PrecompiledHeader.h)
# add library set(x86emitterFinalSources
add_library(${Output} STATIC ${x86emitterSources} ${x86emitterHeaders}) ${x86emitterSources}
${x86emitterHeaders}
)
# link target with wx set(x86emitterFinalLibs
target_link_libraries(${Output} ${wxWidgets_LIBRARIES}) ${wxWidgets_LIBRARIES}
)
# User flags options add_pcsx2_lib(${Output} "${x86emitterFinalSources}" "${x86emitterFinalLibs}" "${x86emitterFinalFlags}")
if(NOT USER_CMAKE_LD_FLAGS STREQUAL "")
target_link_libraries(${Output} "${USER_CMAKE_LD_FLAGS}")
endif(NOT USER_CMAKE_LD_FLAGS STREQUAL "")

View File

@ -63,32 +63,46 @@ set(OptimizationFlags
#Clang doesn't support a few common flags that GCC does. #Clang doesn't support a few common flags that GCC does.
if(NOT USE_CLANG) if(NOT USE_CLANG)
add_definitions(${CommonFlags} -fno-guess-branch-probability -fno-dse -fno-tree-dse) set(pcsx2FinalFlags
${CommonFlags} -fno-guess-branch-probability -fno-dse -fno-tree-dse
)
endif(NOT USE_CLANG) endif(NOT USE_CLANG)
# Debug - Build # Debug - Build
if(CMAKE_BUILD_TYPE STREQUAL Debug) if(CMAKE_BUILD_TYPE STREQUAL Debug)
set(Output pcsx2-dbg) set(Output pcsx2-dbg)
add_definitions(${CommonFlags} -DPCSX2_DEVBUILD -DPCSX2_DEBUG -DWX_PRECOMP) set(pcsx2FinalFlags
${pcsx2FinalFlags}
${CommonFlags} -DPCSX2_DEVBUILD -DPCSX2_DEBUG -DWX_PRECOMP
)
endif(CMAKE_BUILD_TYPE STREQUAL Debug) endif(CMAKE_BUILD_TYPE STREQUAL Debug)
# Devel - Build # Devel - Build
if(CMAKE_BUILD_TYPE STREQUAL Devel) if(CMAKE_BUILD_TYPE STREQUAL Devel)
set(Output pcsx2-dev) set(Output pcsx2-dev)
add_definitions(${CommonFlags} ${OptimizationFlags} -DPCSX2_DEVBUILD -DWX_PRECOMP -DNDEBUG) set(pcsx2FinalFlags
${pcsx2FinalFlags}
${CommonFlags} ${OptimizationFlags} -DPCSX2_DEVBUILD -DWX_PRECOMP -DNDEBUG
)
endif(CMAKE_BUILD_TYPE STREQUAL Devel) endif(CMAKE_BUILD_TYPE STREQUAL Devel)
# Release - Build # Release - Build
if(CMAKE_BUILD_TYPE STREQUAL Release) if(CMAKE_BUILD_TYPE STREQUAL Release)
set(Output pcsx2) set(Output pcsx2)
add_definitions(${CommonFlags} ${OptimizationFlags} -DWX_PRECOMP -DNDEBUG) set(pcsx2FinalFlags
${pcsx2FinalFlags}
${CommonFlags} ${OptimizationFlags} -DWX_PRECOMP -DNDEBUG
)
endif(CMAKE_BUILD_TYPE STREQUAL Release) endif(CMAKE_BUILD_TYPE STREQUAL Release)
if(XDG_STD) if(XDG_STD)
add_definitions(-DXDG_STD) set(pcsx2FinalFlags
${pcsx2FinalFlags}
-DXDG_STD
)
endif(XDG_STD) endif(XDG_STD)
# In package mode always use pcsx2 # In package mode always use pcsx2
@ -655,21 +669,30 @@ endif(Windows)
# MacOSX # MacOSX
if(MacOSX) if(MacOSX)
set(PlatformSources set(Platform
) )
endif(MacOSX) endif(MacOSX)
set(pcsx2FinalSources
${Common}
${Platform}
)
set(pcsx2FinalLibs
Utilities
x86emitter
${wxWidgets_LIBRARIES}
${GTK2_LIBRARIES}
${ZLIB_LIBRARIES}
aio
)
# additonal include directories # additonal include directories
include_directories(. include_directories(
gui gui
x86 x86
${CMAKE_BINARY_DIR}/pcsx2/gui ${CMAKE_BINARY_DIR}/pcsx2/gui
) )
# add executable
add_executable(${Output}
${Common}
${Platform})
### Generate the resources files ### Generate the resources files
file(MAKE_DIRECTORY ${res_bin}) file(MAKE_DIRECTORY ${res_bin})
@ -690,29 +713,4 @@ if(PACKAGE_MODE)
SET_SOURCE_FILES_PROPERTIES(gui/AppConfig.cpp PROPERTIES COMPILE_FLAGS "-Wp,-ansi,-U__STRICT_ANSI__") SET_SOURCE_FILES_PROPERTIES(gui/AppConfig.cpp PROPERTIES COMPILE_FLAGS "-Wp,-ansi,-U__STRICT_ANSI__")
endif(PACKAGE_MODE) endif(PACKAGE_MODE)
# link target with project internal libraries add_pcsx2_executable(${Output} "${pcsx2FinalSources}" "${pcsx2FinalLibs}" "${pcsx2FinalFlags}")
target_link_libraries(${Output} Utilities x86emitter)
# link target with wx
target_link_libraries(${Output} ${wxWidgets_LIBRARIES})
if(Linux)
# link target with gtk2
target_link_libraries(${Output} ${GTK2_LIBRARIES})
endif(Linux)
# link target with zlib
target_link_libraries(${Output} ${ZLIB_LIBRARIES})
target_link_libraries(${Output} ${AIO_LIBRARIES})
# 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 "")
if(PACKAGE_MODE)
install(TARGETS ${Output} DESTINATION bin)
else(PACKAGE_MODE)
install(TARGETS ${Output} DESTINATION ${CMAKE_SOURCE_DIR}/bin)
endif(PACKAGE_MODE)

View File

@ -22,19 +22,25 @@ set(OptimizationFlags
# Debug - Build # Debug - Build
if(CMAKE_BUILD_TYPE STREQUAL Debug) if(CMAKE_BUILD_TYPE STREQUAL Debug)
# add defines # add defines
add_definitions(${CommonFlags} -g) set(CDVDisoFinalFlags
${CommonFlags} -g
)
endif(CMAKE_BUILD_TYPE STREQUAL Debug) endif(CMAKE_BUILD_TYPE STREQUAL Debug)
# Devel - Build # Devel - Build
if(CMAKE_BUILD_TYPE STREQUAL Devel) if(CMAKE_BUILD_TYPE STREQUAL Devel)
# add defines # add defines
add_definitions(${CommonFlags} ${OptimizationFlags}) set(CDVDisoFinalFlags
${CommonFlags} ${OptimizationFlags}
)
endif(CMAKE_BUILD_TYPE STREQUAL Devel) endif(CMAKE_BUILD_TYPE STREQUAL Devel)
# Release - Build # Release - Build
if(CMAKE_BUILD_TYPE STREQUAL Release) if(CMAKE_BUILD_TYPE STREQUAL Release)
# add defines # add defines
add_definitions(${CommonFlags} ${OptimizationFlags}) set(CDVDisoFinalFlags
${CommonFlags} ${OptimizationFlags}
)
endif(CMAKE_BUILD_TYPE STREQUAL Release) endif(CMAKE_BUILD_TYPE STREQUAL Release)
# CDVDiso sources # CDVDiso sources
@ -61,28 +67,18 @@ set(CDVDisoLinuxHeaders
Linux/interface.h Linux/interface.h
Linux/support.h) Linux/support.h)
set(CDVDisoFinalSources
${CDVDisoSources}
${CDVDisoHeaders}
${CDVDisoLinuxSources}
${CDVDisoLinuxHeaders}
)
set(CDVDisoFinalLibs
${BZIP2_LIBRARIES}
)
# add additional include directories # add additional include directories
include_directories(. include_directories(Linux)
Linux)
# add library add_pcsx2_plugin(${Output} "${CDVDisoFinalSources}" "${CDVDisoFinalLibs}" "${CDVDisoFinalFlags}")
add_library(${Output} SHARED
${CDVDisoSources}
${CDVDisoHeaders}
${CDVDisoLinuxSources}
${CDVDisoLinuxHeaders})
# Link with bz2
target_link_libraries(${Output} ${BZIP2_LIBRARIES})
# 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 "")
if(PACKAGE_MODE)
install(TARGETS ${Output} DESTINATION ${PLUGIN_DIR})
else(PACKAGE_MODE)
install(TARGETS ${Output} DESTINATION ${CMAKE_SOURCE_DIR}/bin/plugins)
endif(PACKAGE_MODE)

View File

@ -17,19 +17,25 @@ set(OptimizationFlags
# Debug - Build # Debug - Build
if(CMAKE_BUILD_TYPE STREQUAL Debug) if(CMAKE_BUILD_TYPE STREQUAL Debug)
# add defines # add defines
add_definitions(${CommonFlags} -g) set(CDVDlinuzFinalFlags
${CommonFlags} -g
)
endif(CMAKE_BUILD_TYPE STREQUAL Debug) endif(CMAKE_BUILD_TYPE STREQUAL Debug)
# Devel - Build # Devel - Build
if(CMAKE_BUILD_TYPE STREQUAL Devel) if(CMAKE_BUILD_TYPE STREQUAL Devel)
# add defines # add defines
add_definitions(${CommonFlags} ${OptimizationFlags}) set(CDVDlinuzFinalFlags
${CommonFlags} ${OptimizationFlags}
)
endif(CMAKE_BUILD_TYPE STREQUAL Devel) endif(CMAKE_BUILD_TYPE STREQUAL Devel)
# Release - Build # Release - Build
if(CMAKE_BUILD_TYPE STREQUAL Release) if(CMAKE_BUILD_TYPE STREQUAL Release)
# add defines # add defines
add_definitions(${CommonFlags} ${OptimizationFlags}) set(CDVDlinuzFinalFlags
${CommonFlags} ${OptimizationFlags}
)
endif(CMAKE_BUILD_TYPE STREQUAL Release) endif(CMAKE_BUILD_TYPE STREQUAL Release)
# CDVDlinuz sources # CDVDlinuz sources
@ -76,24 +82,17 @@ set(CDVDlinuzLinuxHeaders
Linux/logfile.h Linux/logfile.h
Linux/mainbox.h) Linux/mainbox.h)
# add additional include directories set(CDVDlinuzFinalSources
include_directories(.
Linux)
# add library
add_library(${Output} SHARED
${CDVDlinuzSources} ${CDVDlinuzSources}
${CDVDlinuzHeaders} ${CDVDlinuzHeaders}
${CDVDlinuzLinuxSources} ${CDVDlinuzLinuxSources}
${CDVDlinuzLinuxHeaders}) ${CDVDlinuzLinuxHeaders}
)
# User flags options set(CDVDlinuzFinalLibs
if(NOT USER_CMAKE_LD_FLAGS STREQUAL "") )
target_link_libraries(${Output} "${USER_CMAKE_LD_FLAGS}")
endif(NOT USER_CMAKE_LD_FLAGS STREQUAL "")
if(PACKAGE_MODE) # add additional include directories
install(TARGETS ${Output} DESTINATION ${PLUGIN_DIR}) include_directories(Linux)
else(PACKAGE_MODE)
install(TARGETS ${Output} DESTINATION ${CMAKE_SOURCE_DIR}/bin/plugins) add_pcsx2_plugin(${Output} "${CDVDlinuzFinalSources}" "${CDVDlinuzFinalLibs}" "${CDVDlinuzFinalFlags}")
endif(PACKAGE_MODE)

View File

@ -22,19 +22,25 @@ set(OptimizationFlags
# Debug - Build # Debug - Build
if(CMAKE_BUILD_TYPE STREQUAL Debug) if(CMAKE_BUILD_TYPE STREQUAL Debug)
# add defines # add defines
add_definitions(${CommonFlags} -g) set(CDVDnullFinalFlags
${CommonFlags} -g
)
endif(CMAKE_BUILD_TYPE STREQUAL Debug) endif(CMAKE_BUILD_TYPE STREQUAL Debug)
# Devel - Build # Devel - Build
if(CMAKE_BUILD_TYPE STREQUAL Devel) if(CMAKE_BUILD_TYPE STREQUAL Devel)
# add defines # add defines
add_definitions(${CommonFlags} ${OptimizationFlags}) set(CDVDnullFinalFlags
${CommonFlags} ${OptimizationFlags}
)
endif(CMAKE_BUILD_TYPE STREQUAL Devel) endif(CMAKE_BUILD_TYPE STREQUAL Devel)
# Release - Build # Release - Build
if(CMAKE_BUILD_TYPE STREQUAL Release) if(CMAKE_BUILD_TYPE STREQUAL Release)
# add defines # add defines
add_definitions(${CommonFlags} ${OptimizationFlags}) set(CDVDnullFinalFlags
${CommonFlags} ${OptimizationFlags}
)
endif(CMAKE_BUILD_TYPE STREQUAL Release) endif(CMAKE_BUILD_TYPE STREQUAL Release)
# CDVDnull sources # CDVDnull sources
@ -54,27 +60,13 @@ set(CDVDnullWindowsSources
set(CDVDnullWindowsHeaders set(CDVDnullWindowsHeaders
) )
# add additional include directories set(CDVDnullFinalSources
include_directories(.) ${CDVDnullSources}
${CDVDnullHeaders}
)
# add library set(CDVDnullFinalLibs
add_library(${Output} SHARED ${GTK2_LIBRARIES}
${CDVDnullSources} )
${CDVDnullHeaders}
)
if(Linux) add_pcsx2_plugin(${Output} "${CDVDnullFinalSources}" "${CDVDnullFinalLibs}" "${CDVDnullFinalFlags}")
# link target with gtk2
target_link_libraries(${Output} ${GTK2_LIBRARIES})
endif(Linux)
# 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 "")
if(PACKAGE_MODE)
install(TARGETS ${Output} DESTINATION ${PLUGIN_DIR})
else(PACKAGE_MODE)
install(TARGETS ${Output} DESTINATION ${CMAKE_SOURCE_DIR}/bin/plugins)
endif(PACKAGE_MODE)

View File

@ -21,19 +21,25 @@ set(OptimizationFlags
# Debug - Build # Debug - Build
if(CMAKE_BUILD_TYPE STREQUAL Debug) if(CMAKE_BUILD_TYPE STREQUAL Debug)
# add defines # add defines
add_definitions(${CommonFlags} -g) set(FWnullFinalFlags
${CommonFlags} -g
)
endif(CMAKE_BUILD_TYPE STREQUAL Debug) endif(CMAKE_BUILD_TYPE STREQUAL Debug)
# Devel - Build # Devel - Build
if(CMAKE_BUILD_TYPE STREQUAL Devel) if(CMAKE_BUILD_TYPE STREQUAL Devel)
# add defines # add defines
add_definitions(${CommonFlags} ${OptimizationFlags}) set(FWnullFinalFlags
${CommonFlags} ${OptimizationFlags}
)
endif(CMAKE_BUILD_TYPE STREQUAL Devel) endif(CMAKE_BUILD_TYPE STREQUAL Devel)
# Release - Build # Release - Build
if(CMAKE_BUILD_TYPE STREQUAL Release) if(CMAKE_BUILD_TYPE STREQUAL Release)
# add defines # add defines
add_definitions(${CommonFlags} ${OptimizationFlags}) set(FWnullFinalFlags
${CommonFlags} ${OptimizationFlags}
)
endif(CMAKE_BUILD_TYPE STREQUAL Release) endif(CMAKE_BUILD_TYPE STREQUAL Release)
# FWnull sources # FWnull sources
@ -65,28 +71,15 @@ set(FWnullWindowsSources
set(FWnullWindowsHeaders set(FWnullWindowsHeaders
Windows/resource.h) Windows/resource.h)
# add additional include directories set(FWnullFinalSources
include_directories(.) ${FWnullSources}
${FWnullHeaders}
${FWnullLinuxSources}
${FWnullLinuxHeaders}
)
# add library set(FWnullFinalLibs
add_library(${Output} SHARED ${GTK2_LIBRARIES}
${FWnullSources} )
${FWnullHeaders}
${FWnullLinuxSources}
${FWnullLinuxHeaders})
if(Linux) add_pcsx2_plugin(${Output} "${FWnullFinalSources}" "${FWnullFinalLibs}" "${FWnullFinalFlags}")
# link target with gtk2
target_link_libraries(${Output} ${GTK2_LIBRARIES})
endif(Linux)
# 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 "")
if(PACKAGE_MODE)
install(TARGETS ${Output} DESTINATION ${PLUGIN_DIR})
else(PACKAGE_MODE)
install(TARGETS ${Output} DESTINATION ${CMAKE_SOURCE_DIR}/bin/plugins)
endif(PACKAGE_MODE)

View File

@ -28,30 +28,42 @@ set(OptimizationFlags
#Clang doesn't support a few common flags that GCC does. #Clang doesn't support a few common flags that GCC does.
if(NOT USE_CLANG AND _M_X86_32) if(NOT USE_CLANG AND _M_X86_32)
add_definitions(${CommonFlags} -mpreferred-stack-boundary=2) set(GSdxFinalFlags
${GSdxFinalFlags} ${CommonFlags} -mpreferred-stack-boundary=2
)
endif() endif()
# Debug - Build # Debug - Build
if(CMAKE_BUILD_TYPE STREQUAL Debug) if(CMAKE_BUILD_TYPE STREQUAL Debug)
add_definitions(${CommonFlags} -D_DEBUG -g -Wall) set(GSdxFinalFlags
${GSdxFinalFlags} ${CommonFlags} -D_DEBUG -g -Wall
)
endif() endif()
# Devel - Build # Devel - Build
if(CMAKE_BUILD_TYPE STREQUAL Devel) if(CMAKE_BUILD_TYPE STREQUAL Devel)
add_definitions(${CommonFlags} ${OptimizationFlags} -D_DEVEL -g) set(GSdxFinalFlags
${GSdxFinalFlags} ${CommonFlags} ${OptimizationFlags} -D_DEVEL -g
)
endif() endif()
# Release - Build # Release - Build
if(CMAKE_BUILD_TYPE STREQUAL Release) if(CMAKE_BUILD_TYPE STREQUAL Release)
add_definitions(${CommonFlags} ${OptimizationFlags} -W) set(GSdxFinalFlags
${GSdxFinalFlags} ${CommonFlags} ${OptimizationFlags} -W
)
endif() endif()
if(XDG_STD) if(XDG_STD)
add_definitions(-DXDG_STD) set(GSdxFinalFlags
${GSdxFinalFlags} -DXDG_STD
)
endif() endif()
if(GLES_API AND GLESV2_FOUND) if(GLES_API AND GLESV2_FOUND)
add_definitions(-DENABLE_GLES) set(GSdxFinalFlags
${GSdxFinalFlags} -DENABLE_GLES
)
endif() endif()
set(GSdxSources set(GSdxSources
@ -190,54 +202,47 @@ set(GSdxHeaders
xbyak/xbyak_util.h xbyak/xbyak_util.h
) )
include_directories(.) set(GSdxFinalSources
${GSdxSources}
${GSdxHeaders}
)
set(GSdxFinalLibs
${X11_LIBRARIES}
)
if(GLES_API AND GLESV2_FOUND)
set(GSdxFinalLibs
${GSdxFinalLibs}
${GLESV2_LIBRARIES}
)
else()
set(GSdxFinalLibs
${GSdxFinalLibs}
${OPENGL_LIBRARIES}
)
endif()
set(GSdxFinalLibs
${GSdxFinalLibs}
${EGL_LIBRARIES}
${GTK2_LIBRARIES}
${LIBC_LIBRARIES}
)
# Generate Glsl header file. Protect with REBUILD_SHADER to avoid build-dependency on PERL # Generate Glsl header file. Protect with REBUILD_SHADER to avoid build-dependency on PERL
if (REBUILD_SHADER) if (REBUILD_SHADER)
add_custom_command(OUTPUT res/glsl_source.h COMMAND perl ${CMAKE_SOURCE_DIR}/linux_various/glsl2h.pl) add_custom_command(OUTPUT res/glsl_source.h COMMAND perl ${CMAKE_SOURCE_DIR}/linux_various/glsl2h.pl)
endif() endif()
add_library(${Output} SHARED ${GSdxSources} ${GSdxHeaders}) add_pcsx2_plugin(${Output} "${GSdxFinalSources}" "${GSdxFinalLibs}" "${GSdxFinalFlags}")
target_link_libraries(${Output} ${X11_LIBRARIES})
if(GLES_API AND GLESV2_FOUND)
target_link_libraries(${Output} ${GLESV2_LIBRARIES})
else()
target_link_libraries(${Output} ${OPENGL_LIBRARIES})
endif()
target_link_libraries(${Output} ${EGL_LIBRARIES})
if(Linux)
target_link_libraries(${Output} ${GTK2_LIBRARIES})
endif(Linux)
if(NOT USER_CMAKE_LD_FLAGS STREQUAL "")
target_link_libraries(${Output} "${USER_CMAKE_LD_FLAGS}")
endif(NOT USER_CMAKE_LD_FLAGS STREQUAL "")
if(PACKAGE_MODE)
install(TARGETS ${Output} DESTINATION ${PLUGIN_DIR})
else(PACKAGE_MODE)
install(TARGETS ${Output} DESTINATION ${CMAKE_SOURCE_DIR}/bin/plugins)
endif(PACKAGE_MODE)
################################### Replay Loader ################################### Replay Loader
if(BUILD_REPLAY_LOADERS) if(BUILD_REPLAY_LOADERS)
set(Replay pcsx2_GSReplayLoader) set(Replay pcsx2_GSReplayLoader)
set(GSdxReplayLoaderFinalSources
add_executable(${Replay} linux_replay.cpp) ${GSdxFinalSources}
linux_replay.cpp
target_link_libraries(${Replay} ${LIBC_LIBRARIES}) )
add_pcsx2_executable(${Replay} "${GSdxReplayLoaderFinalSources}" "${GSdxFinalLibs}" "${GSdxFinalFlags}")
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) endif(BUILD_REPLAY_LOADERS)

View File

@ -22,19 +22,25 @@ set(OptimizationFlags
# Debug - Build # Debug - Build
if(CMAKE_BUILD_TYPE STREQUAL Debug) if(CMAKE_BUILD_TYPE STREQUAL Debug)
# add defines # add defines
add_definitions(${CommonFlags} -g) set(GSnullFinalFlags
${CommonFlags} -g
)
endif(CMAKE_BUILD_TYPE STREQUAL Debug) endif(CMAKE_BUILD_TYPE STREQUAL Debug)
# Devel - Build # Devel - Build
if(CMAKE_BUILD_TYPE STREQUAL Devel) if(CMAKE_BUILD_TYPE STREQUAL Devel)
# add defines # add defines
add_definitions(${CommonFlags} ${OptimizationFlags}) set(GSnullFinalFlags
${CommonFlags} ${OptimizationFlags}
)
endif(CMAKE_BUILD_TYPE STREQUAL Devel) endif(CMAKE_BUILD_TYPE STREQUAL Devel)
# Release - Build # Release - Build
if(CMAKE_BUILD_TYPE STREQUAL Release) if(CMAKE_BUILD_TYPE STREQUAL Release)
# add defines # add defines
add_definitions(${CommonFlags} ${OptimizationFlags}) set(GSnullFinalFlags
${CommonFlags} ${OptimizationFlags}
)
endif(CMAKE_BUILD_TYPE STREQUAL Release) endif(CMAKE_BUILD_TYPE STREQUAL Release)
# GSnull sources # GSnull sources
@ -82,33 +88,18 @@ set(GSnullWindowsSources
set(GSnullWindowsHeaders set(GSnullWindowsHeaders
) )
# add additional include directories set(GSnullFinalSources
include_directories(.) ${GSnullSources}
${GSnullHeaders}
${GSnullnullSources}
${GSnullnullHeaders}
${GSnullLinuxSources}
${GSnullLinuxHeaders}
)
# add library set(GSnullFinalLibs
add_library(${Output} SHARED ${GTK2_LIBRARIES}
${GSnullSources} ${X11_LIBRARIES}
${GSnullHeaders} )
${GSnullnullSources}
${GSnullnullHeaders}
${GSnullLinuxSources}
${GSnullLinuxHeaders})
if(Linux) add_pcsx2_plugin(${Output} "${GSnullFinalSources}" "${GSnullFinalLibs}" "${GSnullFinalFlags}")
# link target with gtk2
target_link_libraries(${Output} ${GTK2_LIBRARIES})
endif(Linux)
# link target with X11
target_link_libraries(${Output} ${X11_LIBRARIES})
# 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 "")
if(PACKAGE_MODE)
install(TARGETS ${Output} DESTINATION ${PLUGIN_DIR})
else(PACKAGE_MODE)
install(TARGETS ${Output} DESTINATION ${CMAKE_SOURCE_DIR}/bin/plugins)
endif(PACKAGE_MODE)

View File

@ -21,19 +21,25 @@ set(OptimizationFlags
# Debug - Build # Debug - Build
if(CMAKE_BUILD_TYPE STREQUAL Debug) if(CMAKE_BUILD_TYPE STREQUAL Debug)
# add defines # add defines
add_definitions(${CommonFlags} -g) set(PadNullFinalFlags
${CommonFlags} -g
)
endif(CMAKE_BUILD_TYPE STREQUAL Debug) endif(CMAKE_BUILD_TYPE STREQUAL Debug)
# Devel - Build # Devel - Build
if(CMAKE_BUILD_TYPE STREQUAL Devel) if(CMAKE_BUILD_TYPE STREQUAL Devel)
# add defines # add defines
add_definitions(${CommonFlags} ${OptimizationFlags}) set(PadNullFinalFlags
${CommonFlags} ${OptimizationFlags}
)
endif(CMAKE_BUILD_TYPE STREQUAL Devel) endif(CMAKE_BUILD_TYPE STREQUAL Devel)
# Release - Build # Release - Build
if(CMAKE_BUILD_TYPE STREQUAL Release) if(CMAKE_BUILD_TYPE STREQUAL Release)
# add defines # add defines
add_definitions(${CommonFlags} ${OptimizationFlags}) set(PadNullFinalFlags
${CommonFlags} ${OptimizationFlags}
)
endif(CMAKE_BUILD_TYPE STREQUAL Release) endif(CMAKE_BUILD_TYPE STREQUAL Release)
# PadNull sources # PadNull sources
@ -67,31 +73,18 @@ set(PadNullWindowsHeaders
Windows/resource.h) Windows/resource.h)
# add additional include directories # add additional include directories
include_directories(. include_directories(Linux)
Linux)
# add library set(PadNullFinalSources
add_library(${Output} SHARED ${PadNullSources}
${PadNullSources} ${PadNullHeaders}
${PadNullHeaders} ${PadNullLinuxSources}
${PadNullLinuxSources} ${PadNullLinuxHeaders}
${PadNullLinuxHeaders}) )
if(Linux) set(PadNullFinalLibs
# link target with gtk2 ${GTK2_LIBRARIES}
target_link_libraries(${Output} ${GTK2_LIBRARIES}) ${X11_LIBRARIES}
endif(Linux) )
# link target with X11 add_pcsx2_plugin(${Output} "${PadNullFinalSources}" "${PadNullFinalLibs}" "${PadNullFinalFlags}")
target_link_libraries(${Output} ${X11_LIBRARIES})
# 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 "")
if(PACKAGE_MODE)
install(TARGETS ${Output} DESTINATION ${PLUGIN_DIR})
else(PACKAGE_MODE)
install(TARGETS ${Output} DESTINATION ${CMAKE_SOURCE_DIR}/bin/plugins)
endif(PACKAGE_MODE)

View File

@ -22,19 +22,25 @@ set(OptimizationFlags
# Debug - Build # Debug - Build
if(CMAKE_BUILD_TYPE STREQUAL Debug) if(CMAKE_BUILD_TYPE STREQUAL Debug)
# add defines # add defines
add_definitions(${CommonFlags} -g) set(SPU2nullFinalFlags
${CommonFlags} -g
)
endif(CMAKE_BUILD_TYPE STREQUAL Debug) endif(CMAKE_BUILD_TYPE STREQUAL Debug)
# Devel - Build # Devel - Build
if(CMAKE_BUILD_TYPE STREQUAL Devel) if(CMAKE_BUILD_TYPE STREQUAL Devel)
# add defines # add defines
add_definitions(${CommonFlags} ${OptimizationFlags}) set(SPU2nullFinalFlags
${CommonFlags} ${OptimizationFlags}
)
endif(CMAKE_BUILD_TYPE STREQUAL Devel) endif(CMAKE_BUILD_TYPE STREQUAL Devel)
# Release - Build # Release - Build
if(CMAKE_BUILD_TYPE STREQUAL Release) if(CMAKE_BUILD_TYPE STREQUAL Release)
# add defines # add defines
add_definitions(${CommonFlags} ${OptimizationFlags}) set(SPU2nullFinalFlags
${CommonFlags} ${OptimizationFlags}
)
endif(CMAKE_BUILD_TYPE STREQUAL Release) endif(CMAKE_BUILD_TYPE STREQUAL Release)
# SPU2null sources # SPU2null sources
@ -64,28 +70,15 @@ set(SPU2nullWindowsSources
set(SPU2nullWindowsHeaders set(SPU2nullWindowsHeaders
Windows/resource.h) Windows/resource.h)
# add additional include directories set(SPU2nullFinalSources
include_directories(.) ${SPU2nullSources}
${SPU2nullHeaders}
${SPU2nullLinuxSources}
${SPU2nullLinuxHeaders}
)
# add library set(SPU2nullFinalLibs
add_library(${Output} SHARED ${GTK2_LIBRARIES}
${SPU2nullSources} )
${SPU2nullHeaders}
${SPU2nullLinuxSources}
${SPU2nullLinuxHeaders})
if(Linux) add_pcsx2_plugin(${Output} "${SPU2nullFinalSources}" "${SPU2nullFinalLibs}" "${SPU2nullFinalFlags}")
# link target with gtk2
target_link_libraries(${Output} ${GTK2_LIBRARIES})
endif(Linux)
# 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 "")
if(PACKAGE_MODE)
install(TARGETS ${Output} DESTINATION ${PLUGIN_DIR})
else(PACKAGE_MODE)
install(TARGETS ${Output} DESTINATION ${CMAKE_SOURCE_DIR}/bin/plugins)
endif(PACKAGE_MODE)

View File

@ -22,19 +22,25 @@ set(OptimizationFlags
# Debug - Build # Debug - Build
if(CMAKE_BUILD_TYPE STREQUAL Debug) if(CMAKE_BUILD_TYPE STREQUAL Debug)
# add defines # add defines
add_definitions(${CommonFlags} -g) set(USBnullFinalFlags
${CommonFlags} -g
)
endif(CMAKE_BUILD_TYPE STREQUAL Debug) endif(CMAKE_BUILD_TYPE STREQUAL Debug)
# Devel - Build # Devel - Build
if(CMAKE_BUILD_TYPE STREQUAL Devel) if(CMAKE_BUILD_TYPE STREQUAL Devel)
# add defines # add defines
add_definitions(${CommonFlags} ${OptimizationFlags}) set(USBnullFinalFlags
${CommonFlags} ${OptimizationFlags}
)
endif(CMAKE_BUILD_TYPE STREQUAL Devel) endif(CMAKE_BUILD_TYPE STREQUAL Devel)
# Release - Build # Release - Build
if(CMAKE_BUILD_TYPE STREQUAL Release) if(CMAKE_BUILD_TYPE STREQUAL Release)
# add defines # add defines
add_definitions(${CommonFlags} ${OptimizationFlags}) set(USBnullFinalFlags
${CommonFlags} ${OptimizationFlags}
)
endif(CMAKE_BUILD_TYPE STREQUAL Release) endif(CMAKE_BUILD_TYPE STREQUAL Release)
# USBnull sources # USBnull sources
@ -66,28 +72,15 @@ set(USBnullWindowsSources
set(USBnullWindowsHeaders set(USBnullWindowsHeaders
Windows/resource.h) Windows/resource.h)
# additonal include directories set(USBnullFinalSources
include_directories(.) ${USBnullSources}
${USBnullHeaders}
${USBnullLinuxSources}
${USBnullLinuxHeaders}
)
# add library set(USBnullFinalLibs
add_library(${Output} SHARED ${GTK2_LIBRARIES}
${USBnullSources} )
${USBnullHeaders}
${USBnullLinuxSources}
${USBnullLinuxHeaders})
if(Linux) add_pcsx2_plugin(${Output} "${USBnullFinalSources}" "${USBnullFinalLibs}" "${USBnullFinalFlags}")
# link target with gtk2
target_link_libraries(${Output} ${GTK2_LIBRARIES})
endif(Linux)
# 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 "")
if(PACKAGE_MODE)
install(TARGETS ${Output} DESTINATION ${PLUGIN_DIR})
else(PACKAGE_MODE)
install(TARGETS ${Output} DESTINATION ${CMAKE_SOURCE_DIR}/bin/plugins)
endif(PACKAGE_MODE)

View File

@ -22,19 +22,25 @@ set(OptimizationFlags
# Debug - Build # Debug - Build
if(CMAKE_BUILD_TYPE STREQUAL Debug) if(CMAKE_BUILD_TYPE STREQUAL Debug)
# add defines # add defines
add_definitions(${CommonFlags} -g) set(dev9nullFinalFlags
${CommonFlags} -g
)
endif(CMAKE_BUILD_TYPE STREQUAL Debug) endif(CMAKE_BUILD_TYPE STREQUAL Debug)
# Devel - Build # Devel - Build
if(CMAKE_BUILD_TYPE STREQUAL Devel) if(CMAKE_BUILD_TYPE STREQUAL Devel)
# add defines # add defines
add_definitions(${CommonFlags} ${OptimizationFlags}) set(dev9nullFinalFlags
${CommonFlags} ${OptimizationFlags}
)
endif(CMAKE_BUILD_TYPE STREQUAL Devel) endif(CMAKE_BUILD_TYPE STREQUAL Devel)
# Release - Build # Release - Build
if(CMAKE_BUILD_TYPE STREQUAL Release) if(CMAKE_BUILD_TYPE STREQUAL Release)
# add defines # add defines
add_definitions(${CommonFlags} ${OptimizationFlags}) set(dev9nullFinalFlags
${CommonFlags} ${OptimizationFlags}
)
endif(CMAKE_BUILD_TYPE STREQUAL Release) endif(CMAKE_BUILD_TYPE STREQUAL Release)
# dev9null sources # dev9null sources
@ -63,28 +69,15 @@ set(dev9nullWindowsSources
set(dev9nullWindowsHeaders set(dev9nullWindowsHeaders
) )
# additional include directories set(dev9nullFinalSources
include_directories(.) ${dev9nullSources}
${dev9nullHeaders}
${dev9nullLinuxSources}
${dev9nullLinuxHeaders}
)
# add library set(dev9nullFinalLibs
add_library(${Output} SHARED ${GTK2_LIBRARIES}
${dev9nullSources} )
${dev9nullHeaders}
${dev9nullLinuxSources}
${dev9nullLinuxHeaders})
if(Linux) add_pcsx2_plugin(${Output} "${dev9nullFinalSources}" "${dev9nullFinalLibs}" "${dev9nullFinalFlags}")
# link target with gtk2
target_link_libraries(${Output} ${GTK2_LIBRARIES})
endif(Linux)
# 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 "")
if(PACKAGE_MODE)
install(TARGETS ${Output} DESTINATION ${PLUGIN_DIR})
else(PACKAGE_MODE)
install(TARGETS ${Output} DESTINATION ${CMAKE_SOURCE_DIR}/bin/plugins)
endif(PACKAGE_MODE)

View File

@ -21,19 +21,28 @@ set(OptimizationFlags
) )
if(CMAKE_BUILD_TYPE STREQUAL Debug) if(CMAKE_BUILD_TYPE STREQUAL Debug)
add_definitions(${CommonFlags} -g) set(onepadFinalFlags
${CommonFlags} -g
)
endif(CMAKE_BUILD_TYPE STREQUAL Debug) endif(CMAKE_BUILD_TYPE STREQUAL Debug)
if(CMAKE_BUILD_TYPE STREQUAL Devel) if(CMAKE_BUILD_TYPE STREQUAL Devel)
add_definitions(${CommonFlags} ${OptimizationFlags}) set(onepadFinalFlags
${CommonFlags} ${OptimizationFlags}
)
endif(CMAKE_BUILD_TYPE STREQUAL Devel) endif(CMAKE_BUILD_TYPE STREQUAL Devel)
if(CMAKE_BUILD_TYPE STREQUAL Release) if(CMAKE_BUILD_TYPE STREQUAL Release)
add_definitions(${CommonFlags} ${OptimizationFlags}) set(onepadFinalFlags
${CommonFlags} ${OptimizationFlags}
)
endif(CMAKE_BUILD_TYPE STREQUAL Release) endif(CMAKE_BUILD_TYPE STREQUAL Release)
if (SDL2_API) if (SDL2_API)
add_definitions(-DONEPAD_SDL2) set(onepadFinalFlags
${onepadFinalFlags}
-DONEPAD_SDL2
)
endif() endif()
# onepad sources # onepad sources
@ -71,37 +80,27 @@ set(onepadWindowsSources
set(onepadWindowsHeaders set(onepadWindowsHeaders
) )
# add additional include directories
include_directories(.)
# add library
add_library(${Output} SHARED
${onepadSources}
${onepadHeaders}
${onepadLinuxSources}
${onepadLinuxHeaders})
if (SDL2_API) if (SDL2_API)
target_link_libraries(${Output} ${SDL2_LIBRARY}) set(onepadFinalLibs
${SDL2_LIBRARY}
)
else() else()
target_link_libraries(${Output} ${SDL_LIBRARY}) set(onepadFinalLibs
${SDL_LIBRARY}
)
endif() endif()
if(Linux) set(onepadFinalLibs
# link target with gtk2 ${onepadFinalLibs}
target_link_libraries(${Output} ${GTK2_LIBRARIES}) ${GTK2_LIBRARIES}
endif(Linux) ${X11_LIBRARIES}
)
# link target with X11 set(onepadFinalSources
target_link_libraries(${Output} ${X11_LIBRARIES}) ${onepadSources}
${onepadHeaders}
${onepadLinuxSources}
${onepadLinuxHeaders}
)
# User flags options add_pcsx2_plugin(${Output} "${onepadFinalSources}" "${onepadFinalLibs}" "${onepadFinalFlags}")
if(NOT USER_CMAKE_LD_FLAGS STREQUAL "")
target_link_libraries(${Output} "${USER_CMAKE_LD_FLAGS}")
endif(NOT USER_CMAKE_LD_FLAGS STREQUAL "")
if(PACKAGE_MODE)
install(TARGETS ${Output} DESTINATION ${PLUGIN_DIR})
else(PACKAGE_MODE)
install(TARGETS ${Output} DESTINATION ${CMAKE_SOURCE_DIR}/bin/plugins)
endif(PACKAGE_MODE)

View File

@ -22,19 +22,25 @@ set(OptimizationFlags
# Debug - Build # Debug - Build
if(CMAKE_BUILD_TYPE STREQUAL Debug) if(CMAKE_BUILD_TYPE STREQUAL Debug)
# add defines # add defines
add_definitions(${CommonFlags} -g) set(spu2xFinalFlags
${CommonFlags} -g
)
endif(CMAKE_BUILD_TYPE STREQUAL Debug) endif(CMAKE_BUILD_TYPE STREQUAL Debug)
# Devel - Build # Devel - Build
if(CMAKE_BUILD_TYPE STREQUAL Devel) if(CMAKE_BUILD_TYPE STREQUAL Devel)
# add defines # add defines
add_definitions(${CommonFlags} ${OptimizationFlags}) set(spu2xFinalFlags
${CommonFlags} ${OptimizationFlags}
)
endif(CMAKE_BUILD_TYPE STREQUAL Devel) endif(CMAKE_BUILD_TYPE STREQUAL Devel)
# Release - Build # Release - Build
if(CMAKE_BUILD_TYPE STREQUAL Release) if(CMAKE_BUILD_TYPE STREQUAL Release)
# add defines # add defines
add_definitions(${CommonFlags} ${OptimizationFlags}) set(spu2xFinalFlags
${CommonFlags} ${OptimizationFlags}
)
endif(CMAKE_BUILD_TYPE STREQUAL Release) endif(CMAKE_BUILD_TYPE STREQUAL Release)
# spu2x sources # spu2x sources
@ -97,7 +103,7 @@ set(spu2xLinuxHeaders
Linux/Dialogs.h) Linux/Dialogs.h)
# add additional include directories # add additional include directories
include_directories(. Linux) include_directories(Linux)
### Don't use yet c11 feature. I will bump gcc requirement to 4.7 when 4.9 is out. ### Don't use yet c11 feature. I will bump gcc requirement to 4.7 when 4.9 is out.
### Note: actually it might work on 4.6 too ### Note: actually it might work on 4.6 too
@ -112,49 +118,48 @@ include_directories(. Linux)
if(SDL_FOUND) if(SDL_FOUND)
list(APPEND spu2xSources SndOut_SDL.cpp) list(APPEND spu2xSources SndOut_SDL.cpp)
if(SDL2_API) if (SDL2_API)
add_definitions(-DSPU2X_SDL2) set(spu2xFinalFlags
${spu2xFinalFlags}
-DSPU2X_SDL2
)
else() else()
add_definitions(-DSPU2X_SDL) set(spu2xFinalFlags
${spu2xFinalFlags}
-DSPU2X_SDL
)
endif() endif()
#elseif(SDL2_FOUND)
# add_definitions(-DSPU2X_SDL2)
endif() endif()
# add library set(spu2xFinalSources
add_library(${Output} SHARED ${spu2xSources}
${spu2xSources} ${spu2xHeaders}
${spu2xHeaders} ${spu2xLinuxSources}
${spu2xLinuxSources} ${spu2xLinuxHeaders}
${spu2xLinuxHeaders}) )
# link target with project internal libraries set(spu2xFinalLibs
target_link_libraries(${Output} Utilities) Utilities
${ALSA_LIBRARIES}
portaudio
)
# link target with various backend
target_link_libraries(${Output} ${ALSA_LIBRARIES})
target_link_libraries(${Output} ${PORTAUDIO_LIBRARIES})
if (SDL2_API) if (SDL2_API)
target_link_libraries(${Output} ${SDL2_LIBRARY}) set(spu2xFinalLibs
${spu2xFinalLibs}
${SDL2_LIBRARY}
)
else() else()
target_link_libraries(${Output} ${SDL_LIBRARY}) set(spu2xFinalLibs
${spu2xFinalLibs}
${SDL_LIBRARY}
)
endif() endif()
# link target with SoundTouch set(spu2xFinalLibs
target_link_libraries(${Output} ${SOUNDTOUCH_LIBRARIES}) ${spu2xFinalLibs}
SoundTouch
${GTK2_LIBRARIES}
)
if(Linux) add_pcsx2_plugin(${Output} "${spu2xFinalSources}" "${spu2xFinalLibs}" "${spu2xFinalFlags}")
# link target with gtk2
target_link_libraries(${Output} ${GTK2_LIBRARIES})
endif(Linux)
# 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 "")
if(PACKAGE_MODE)
install(TARGETS ${Output} DESTINATION ${PLUGIN_DIR})
else(PACKAGE_MODE)
install(TARGETS ${Output} DESTINATION ${CMAKE_SOURCE_DIR}/bin/plugins)
endif(PACKAGE_MODE)

View File

@ -21,19 +21,25 @@ set(OptimizationFlags
# Debug - Build # Debug - Build
if(CMAKE_BUILD_TYPE STREQUAL Debug) if(CMAKE_BUILD_TYPE STREQUAL Debug)
# add defines # add defines
add_definitions(${CommonFlags} -g) set(zerospu2FinalFlags
${CommonFlags} -g
)
endif(CMAKE_BUILD_TYPE STREQUAL Debug) endif(CMAKE_BUILD_TYPE STREQUAL Debug)
# Devel - Build # Devel - Build
if(CMAKE_BUILD_TYPE STREQUAL Devel) if(CMAKE_BUILD_TYPE STREQUAL Devel)
# add defines # add defines
add_definitions(${CommonFlags} ${OptimizationFlags}) set(zerospu2FinalFlags
${CommonFlags} ${OptimizationFlags}
)
endif(CMAKE_BUILD_TYPE STREQUAL Devel) endif(CMAKE_BUILD_TYPE STREQUAL Devel)
# Release - Build # Release - Build
if(CMAKE_BUILD_TYPE STREQUAL Release) if(CMAKE_BUILD_TYPE STREQUAL Release)
# add defines # add defines
add_definitions(${CommonFlags} ${OptimizationFlags}) set(zerospu2FinalFlags
${CommonFlags} ${OptimizationFlags}
)
endif(CMAKE_BUILD_TYPE STREQUAL Release) endif(CMAKE_BUILD_TYPE STREQUAL Release)
# zerospu2 sources # zerospu2 sources
@ -82,35 +88,24 @@ set(zerospu2WindowsHeaders
Targets/dsound51.h) Targets/dsound51.h)
# add additional include directories # add additional include directories
include_directories(. include_directories(Linux Targets)
Linux
Targets)
# add library set(zerospu2FinalSources
add_library(${Output} SHARED ${zerospu2Sources}
${zerospu2Sources} ${zerospu2Headers}
${zerospu2Headers} ${zerospu2LinuxSources}
${zerospu2LinuxSources} ${zerospu2LinuxHeaders}
${zerospu2LinuxHeaders}) )
# link target with ALSA set(zerospu2FinalLibs
target_link_libraries(${Output} ${ALSA_LIBRARIES}) ${ALSA_LIBRARIES}
# PortAudio would go here.
${SOUNDTOUCH_LIBRARIES}
)
if(PORTAUDIO_FOUND) if(PORTAUDIO_FOUND)
# link target with PortAudio # link target with PortAudio
#target_link_libraries(${Output} ${PORTAUDIO_LIBRARIES}) #target_link_libraries(${Output} ${PORTAUDIO_LIBRARIES})
endif(PORTAUDIO_FOUND) endif(PORTAUDIO_FOUND)
# link target with SoundTouch add_pcsx2_plugin(${Output} "${zerospu2FinalSources}" "${zerospu2FinalLibs}" "${zerospu2FinalFlags}")
target_link_libraries(${Output} ${SOUNDTOUCH_LIBRARIES})
# 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 "")
if(PACKAGE_MODE)
install(TARGETS ${Output} DESTINATION ${PLUGIN_DIR})
else(PACKAGE_MODE)
install(TARGETS ${Output} DESTINATION ${CMAKE_SOURCE_DIR}/bin/plugins)
endif(PACKAGE_MODE)

View File

@ -25,19 +25,25 @@ set(OptimizationFlags
# Debug - Build # Debug - Build
if(CMAKE_BUILD_TYPE STREQUAL Debug) if(CMAKE_BUILD_TYPE STREQUAL Debug)
# add defines # add defines
add_definitions(${CommonFlags} -g -Wall -D_DEBUG) set(zzoglFinalFlags
${CommonFlags} -g -Wall -D_DEBUG
)
endif(CMAKE_BUILD_TYPE STREQUAL Debug) endif(CMAKE_BUILD_TYPE STREQUAL Debug)
# Devel - Build # Devel - Build
if(CMAKE_BUILD_TYPE STREQUAL Devel) if(CMAKE_BUILD_TYPE STREQUAL Devel)
# add defines # add defines
add_definitions(${CommonFlags} ${OptimizationFlags} -g -W -DZEROGS_DEVBUILD) set(zzoglFinalFlags
${CommonFlags} ${OptimizationFlags} -g -W -DZEROGS_DEVBUILD
)
endif(CMAKE_BUILD_TYPE STREQUAL Devel) endif(CMAKE_BUILD_TYPE STREQUAL Devel)
# Release - Build # Release - Build
if(CMAKE_BUILD_TYPE STREQUAL Release) if(CMAKE_BUILD_TYPE STREQUAL Release)
# add defines # add defines
add_definitions(${CommonFlags} ${OptimizationFlags} -W) set(zzoglFinalFlags
${CommonFlags} ${OptimizationFlags} -W
)
endif(CMAKE_BUILD_TYPE STREQUAL Release) endif(CMAKE_BUILD_TYPE STREQUAL Release)
# zzogl sources # zzogl sources
@ -126,102 +132,44 @@ set(zzoglLinuxSources
set(zzoglLinuxHeaders set(zzoglLinuxHeaders
Linux/Linux.h) Linux/Linux.h)
# change language of .S-files to c++ set(zzoglFinalSources
set_source_files_properties(${zzoglSSources} PROPERTIES LANGUAGE CXX)
# add additional include directories
include_directories(.
Linux)
# add library
add_library(${Output} SHARED
${zzoglSources} ${zzoglSources}
${zzoglHeaders} ${zzoglHeaders}
${zzoglSSources} ${zzoglSSources}
${zzoglShaderSources} ${zzoglShaderSources}
${zzoglLinuxSources} ${zzoglLinuxSources}
${zzoglLinuxHeaders}) ${zzoglLinuxHeaders}
)
set(zzoglFinalLibs
Utilities
${CG_LIBRARIES}
${GLEW_LIBRARY}
${OPENGL_LIBRARIES}
${X11_LIBRARIES}
${JPEG_LIBRARIES}
${GTK2_LIBRARIES}
${ZLIB_LIBRARIES}
${LIBC_LIBRARIES}
)
# change language of .S-files to c++
set_source_files_properties(${zzoglSSources} PROPERTIES LANGUAGE CXX)
# add additional include directories
include_directories(Linux)
add_pcsx2_plugin(${Output} "${zzoglFinalSources}" "${zzoglFinalLibs}" "${zzoglFinalFlags}")
# Trick that allow to compile zzogl with GSOPEN2 and the replayer with GSOPEN # Trick that allow to compile zzogl with GSOPEN2 and the replayer with GSOPEN
set_target_properties(${Output} PROPERTIES COMPILE_DEFINITIONS USE_GSOPEN2) set_target_properties(${Output} PROPERTIES COMPILE_DEFINITIONS USE_GSOPEN2)
# link target with project internal libraries
target_link_libraries(${Output} Utilities)
# link target with Cg
target_link_libraries(${Output} ${CG_LIBRARIES})
# link target with glew
target_link_libraries(${Output} ${GLEW_LIBRARY})
# link target with opengl
target_link_libraries(${Output} ${OPENGL_LIBRARIES})
# link target with X11
target_link_libraries(${Output} ${X11_LIBRARIES})
# link target with jpeg
target_link_libraries(${Output} ${JPEG_LIBRARIES})
if(Linux)
# link target with gtk2
target_link_libraries(${Output} ${GTK2_LIBRARIES})
endif(Linux)
# link target with zlib
target_link_libraries(${Output} ${ZLIB_LIBRARIES})
# 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 "")
if(PACKAGE_MODE)
install(TARGETS ${Output} DESTINATION ${PLUGIN_DIR})
else(PACKAGE_MODE)
install(TARGETS ${Output} DESTINATION ${CMAKE_SOURCE_DIR}/bin/plugins)
endif(PACKAGE_MODE)
################################### Replay Loader ################################### Replay Loader
if(BUILD_REPLAY_LOADERS) if(BUILD_REPLAY_LOADERS)
set(Replay pcsx2_ZZCGReplayLoader) set(Replay pcsx2_ZZCGReplayLoader)
set(Static zzogl-cg-static) set(zzoglReplayLoaderFinalSources
${zzoglFinalSources}
add_library(${Static} STATIC linux_replay.cpp
${zzoglSources} )
${zzoglHeaders} add_pcsx2_executable(${Replay} "${zzoglReplayLoaderFinalSources}" "${zzoglFinalLibs}" "${zzoglFinalFlags}")
${zzoglSSources}
${zzoglShaderSources}
${zzoglLinuxSources}
${zzoglLinuxHeaders})
target_link_libraries(${Static} Utilities)
target_link_libraries(${Static} ${CG_LIBRARIES})
target_link_libraries(${Static} ${GLEW_LIBRARY})
target_link_libraries(${Static} ${OPENGL_LIBRARIES})
target_link_libraries(${Static} ${X11_LIBRARIES})
target_link_libraries(${Static} ${JPEG_LIBRARIES})
add_executable(${Replay} linux_replay.cpp)
target_link_libraries(${Replay} ${Static})
target_link_libraries(${Replay} Utilities)
target_link_libraries(${Replay} ${CG_LIBRARIES})
target_link_libraries(${Replay} ${GLEW_LIBRARY})
target_link_libraries(${Replay} ${OPENGL_LIBRARIES})
target_link_libraries(${Replay} ${X11_LIBRARIES})
target_link_libraries(${Replay} ${JPEG_LIBRARIES})
target_link_libraries(${Replay} ${GTK2_LIBRARIES})
target_link_libraries(${Replay} ${ZLIB_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) endif(BUILD_REPLAY_LOADERS)

View File

@ -26,36 +26,36 @@ set(OptimizationFlags
# Debug - Build # Debug - Build
if(CMAKE_BUILD_TYPE STREQUAL Debug) if(CMAKE_BUILD_TYPE STREQUAL Debug)
# add defines # add defines
add_definitions(${CommonFlags} -g -Wall -D_DEBUG) set(zerogsshadersFinalFlags
${CommonFlags} -g -Wall -D_DEBUG
)
endif(CMAKE_BUILD_TYPE STREQUAL Debug) endif(CMAKE_BUILD_TYPE STREQUAL Debug)
# Devel - Build # Devel - Build
if(CMAKE_BUILD_TYPE STREQUAL Devel) if(CMAKE_BUILD_TYPE STREQUAL Devel)
# add defines # add defines
add_definitions(${CommonFlags} ${OptimizationFlags} -g -W -DZEROGS_DEVBUILD) set(zerogsshadersFinalFlags
${CommonFlags} ${OptimizationFlags} -g -W -DZEROGS_DEVBUILD
)
endif(CMAKE_BUILD_TYPE STREQUAL Devel) endif(CMAKE_BUILD_TYPE STREQUAL Devel)
# Release - Build # Release - Build
if(CMAKE_BUILD_TYPE STREQUAL Release) if(CMAKE_BUILD_TYPE STREQUAL Release)
# add defines # add defines
add_definitions(${CommonFlags} ${OptimizationFlags} -W) set(zerogsshadersFinalFlags
${CommonFlags} ${OptimizationFlags} -W
)
endif(CMAKE_BUILD_TYPE STREQUAL Release) endif(CMAKE_BUILD_TYPE STREQUAL Release)
include_directories(.) set(zerogsshadersFinalSources
zerogsshaders.cpp
zpipe.cpp
)
# add library set(zerogsshadersFinalLibs
add_executable(${Output} zerogsshaders.cpp zpipe.cpp) ${ZLIB_LIBRARIES}
${CG_LIBRARIES}
${OPENGL_LIBRARIES}
)
# link target with zlib add_pcsx2_executable(${Output} "${zerogsshadersFinalSources}" "${zerogsshadersFinalLibs}" "${zerogsshadersFinalFlags}")
target_link_libraries(${Output} ${ZLIB_LIBRARIES})
# link target with Cg
target_link_libraries(${Output} ${CG_LIBRARIES})
# link target with opengl
target_link_libraries(${Output} ${OPENGL_LIBRARIES})
# 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 "")

View File

@ -28,39 +28,60 @@ set(OptimizationFlags
#Clang doesn't support a few common flags that GCC does. #Clang doesn't support a few common flags that GCC does.
if(NOT USE_CLANG) if(NOT USE_CLANG)
add_definitions(${CommonFlags} -fno-regmove) set(zzoglFinalFlags
${zzoglFinalFlags}
${CommonFlags} -fno-regmove
)
endif(NOT USE_CLANG) endif(NOT USE_CLANG)
# Debug - Build # Debug - Build
if(CMAKE_BUILD_TYPE STREQUAL Debug) if(CMAKE_BUILD_TYPE STREQUAL Debug)
# add defines # add defines
add_definitions(${CommonFlags} -g -Wall -D_DEBUG) set(zzoglFinalFlags
${zzoglFinalFlags}
${CommonFlags} -g -Wall -D_DEBUG
)
endif(CMAKE_BUILD_TYPE STREQUAL Debug) endif(CMAKE_BUILD_TYPE STREQUAL Debug)
# Devel - Build # Devel - Build
if(CMAKE_BUILD_TYPE STREQUAL Devel) if(CMAKE_BUILD_TYPE STREQUAL Devel)
# add defines # add defines
add_definitions(${CommonFlags} ${OptimizationFlags} -g -W -DZEROGS_DEVBUILD) set(zzoglFinalFlags
${zzoglFinalFlags}
${CommonFlags} ${OptimizationFlags} -g -W -DZEROGS_DEVBUILD
)
endif(CMAKE_BUILD_TYPE STREQUAL Devel) endif(CMAKE_BUILD_TYPE STREQUAL Devel)
# Release - Build # Release - Build
if(CMAKE_BUILD_TYPE STREQUAL Release) if(CMAKE_BUILD_TYPE STREQUAL Release)
# add defines # add defines
add_definitions(${CommonFlags} ${OptimizationFlags} -W) set(zzoglFinalFlags
${zzoglFinalFlags}
${CommonFlags} ${OptimizationFlags} -W
)
endif(CMAKE_BUILD_TYPE STREQUAL Release) endif(CMAKE_BUILD_TYPE STREQUAL Release)
# Select the shader API # Select the shader API
if(GLSL_API) if(GLSL_API)
add_definitions(-DGLSL4_API -DOGL4_LOG) set(zzoglFinalFlags
#add_definitions(-DGLSL_API) ${zzoglFinalFlags}
-DGLSL4_API -DOGL4_LOG
)
#-DGLSL_API
else(GLSL_API) else(GLSL_API)
add_definitions(-DNVIDIA_CG_API) set(zzoglFinalFlags
${zzoglFinalFlags}
-DNVIDIA_CG_API
)
endif(GLSL_API) endif(GLSL_API)
# Select the EGL API # Select the EGL API
if(EGL_API AND EGL_FOUND) if(EGL_API AND EGL_FOUND)
if (EGL_GL_CONTEXT_SUPPORT) if (EGL_GL_CONTEXT_SUPPORT)
add_definitions(-DEGL_API) set(zzoglFinalFlags
${zzoglFinalFlags}
-DEGL_API
)
else() else()
message(WARNING "Current EGL implementation doesn't support openGL context. Fallback to standard GLX.") message(WARNING "Current EGL implementation doesn't support openGL context. Fallback to standard GLX.")
endif() endif()
@ -154,60 +175,56 @@ set(zzoglLinuxSources
set(zzoglLinuxHeaders set(zzoglLinuxHeaders
Linux/Linux.h) Linux/Linux.h)
set(zzoglFinalSources
${zzoglSources}
${zzoglHeaders}
${zzoglShaderSources}
${zzoglLinuxSources}
${zzoglLinuxHeaders}
)
set(zzoglFinalLibs
Utilities
${OPENGL_LIBRARIES}
)
# add additional include directories # add additional include directories
include_directories(. include_directories(Linux)
Linux)
# Generate Glsl header file. Protect with REBUILD_SHADER to avoid build-dependency on PERL # Generate Glsl header file. Protect with REBUILD_SHADER to avoid build-dependency on PERL
if (REBUILD_SHADER) if (REBUILD_SHADER)
add_custom_command(OUTPUT ps2hw_gl4.h COMMAND perl ${CMAKE_SOURCE_DIR}/linux_various/glsl2h.pl) add_custom_command(OUTPUT ps2hw_gl4.h COMMAND perl ${CMAKE_SOURCE_DIR}/linux_various/glsl2h.pl)
endif() endif()
# add library if(EGL_API AND EGL_FOUND AND EGL_GL_CONTEXT_SUPPORT)
add_library(${Output} SHARED set(zzoglFinalLibs
${zzoglSources} ${zzoglFinalLibs}
${zzoglHeaders} ${EGL_LIBRARIES}
${zzoglShaderSources} )
${zzoglLinuxSources} endif()
${zzoglLinuxHeaders})
if(NOT GLSL_API)
set(zzoglFinalLibs
${zzoglFinalLibs}
${CG_LIBRARIES}
)
endif(NOT GLSL_API)
set(zzoglFinalLibs
${zzoglFinalLibs}
${GLEW_LIBRARY}
${X11_LIBRARIES}
${JPEG_LIBRARIES}
${GTK2_LIBRARIES}
${ZLIB_LIBRARIES}
${LIBC_LIBRARIES}
)
add_pcsx2_plugin(${Output} "${zzoglFinalSources}" "${zzoglFinalLibs}" "${zzoglFinalFlags}")
# Trick that allow to compile zzogl with GSOPEN2 and the replayer with GSOPEN # Trick that allow to compile zzogl with GSOPEN2 and the replayer with GSOPEN
set_target_properties(${Output} PROPERTIES COMPILE_DEFINITIONS USE_GSOPEN2) set_target_properties(${Output} PROPERTIES COMPILE_DEFINITIONS USE_GSOPEN2)
# link target with project internal libraries
target_link_libraries(${Output} Utilities)
# link target with the various opengl flavor
target_link_libraries(${Output} ${OPENGL_LIBRARIES})
if(EGL_API AND EGL_FOUND AND EGL_GL_CONTEXT_SUPPORT)
target_link_libraries(${Output} ${EGL_LIBRARIES})
endif()
if(NOT GLSL_API)
target_link_libraries(${Output} ${CG_LIBRARIES})
endif(NOT GLSL_API)
target_link_libraries(${Output} ${GLEW_LIBRARY})
target_link_libraries(${Output} ${X11_LIBRARIES})
target_link_libraries(${Output} ${JPEG_LIBRARIES})
if(Linux)
target_link_libraries(${Output} ${GTK2_LIBRARIES})
endif(Linux)
target_link_libraries(${Output} ${ZLIB_LIBRARIES})
# 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 "")
if(PACKAGE_MODE)
install(TARGETS ${Output} DESTINATION ${PLUGIN_DIR})
else()
install(TARGETS ${Output} DESTINATION ${CMAKE_SOURCE_DIR}/bin/plugins)
endif()
if(NOT GLSL_API AND NOT REBUILD_SHADER) if(NOT GLSL_API AND NOT REBUILD_SHADER)
if(PACKAGE_MODE) if(PACKAGE_MODE)
install(FILES ${CMAKE_SOURCE_DIR}/plugins/zzogl-pg/opengl/ps2hw.dat DESTINATION ${PLUGIN_DIR}) install(FILES ${CMAKE_SOURCE_DIR}/plugins/zzogl-pg/opengl/ps2hw.dat DESTINATION ${PLUGIN_DIR})
@ -219,50 +236,9 @@ endif()
################################### Replay Loader ################################### Replay Loader
if(BUILD_REPLAY_LOADERS) if(BUILD_REPLAY_LOADERS)
set(Replay pcsx2_ZZReplayLoader) set(Replay pcsx2_ZZReplayLoader)
set(Static zzogl-static) set(zzoglReplayLoaderFinalSources
${zzoglFinalSources}
add_library(${Static} STATIC linux_replay.cpp
${zzoglSources} )
${zzoglHeaders} add_pcsx2_executable(${Replay} "${zzoglReplayLoaderFinalSources}" "${zzoglFinalLibs}" "${zzoglFinalFlags}")
${zzoglSSources}
${zzoglShaderSources}
${zzoglLinuxSources}
${zzoglLinuxHeaders})
target_link_libraries(${Static} Utilities)
if(NOT GLSL_API)
target_link_libraries(${Static} ${CG_LIBRARIES})
endif(NOT GLSL_API)
target_link_libraries(${Static} ${GLEW_LIBRARY})
target_link_libraries(${Static} ${OPENGL_LIBRARIES})
if(EGL_API AND EGL_FOUND AND EGL_GL_CONTEXT_SUPPORT)
target_link_libraries(${Static} ${EGL_LIBRARIES})
endif()
target_link_libraries(${Static} ${X11_LIBRARIES})
target_link_libraries(${Static} ${JPEG_LIBRARIES})
add_executable(${Replay} linux_replay.cpp)
target_link_libraries(${Replay} ${Static})
target_link_libraries(${Replay} Utilities)
if(NOT GLSL_API)
target_link_libraries(${Replay} ${CG_LIBRARIES})
endif(NOT GLSL_API)
target_link_libraries(${Replay} ${GLEW_LIBRARY})
target_link_libraries(${Replay} ${OPENGL_LIBRARIES})
target_link_libraries(${Replay} ${X11_LIBRARIES})
target_link_libraries(${Replay} ${JPEG_LIBRARIES})
target_link_libraries(${Replay} ${GTK2_LIBRARIES})
target_link_libraries(${Replay} ${ZLIB_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) endif(BUILD_REPLAY_LOADERS)

View File

@ -26,39 +26,39 @@ set(OptimizationFlags
# Debug - Build # Debug - Build
if(CMAKE_BUILD_TYPE STREQUAL Debug) if(CMAKE_BUILD_TYPE STREQUAL Debug)
# add defines # add defines
add_definitions(${CommonFlags} -g -Wall -D_DEBUG) set(zerogsshadersFinalFlags
${CommonFlags} -g -Wall -D_DEBUG
)
endif(CMAKE_BUILD_TYPE STREQUAL Debug) endif(CMAKE_BUILD_TYPE STREQUAL Debug)
# Devel - Build # Devel - Build
if(CMAKE_BUILD_TYPE STREQUAL Devel) if(CMAKE_BUILD_TYPE STREQUAL Devel)
# add defines # add defines
add_definitions(${CommonFlags} ${OptimizationFlags} -g -W -DZEROGS_DEVBUILD) set(zerogsshadersFinalFlags
${CommonFlags} ${OptimizationFlags} -g -W -DZEROGS_DEVBUILD
)
endif(CMAKE_BUILD_TYPE STREQUAL Devel) endif(CMAKE_BUILD_TYPE STREQUAL Devel)
# Release - Build # Release - Build
if(CMAKE_BUILD_TYPE STREQUAL Release) if(CMAKE_BUILD_TYPE STREQUAL Release)
# add defines # add defines
add_definitions(${CommonFlags} ${OptimizationFlags} -W) set(zerogsshadersFinalFlags
${CommonFlags} ${OptimizationFlags} -W
)
endif(CMAKE_BUILD_TYPE STREQUAL Release) endif(CMAKE_BUILD_TYPE STREQUAL Release)
include_directories(.) set(zerogsshadersFinalSources
zerogsshaders.cpp
zpipe.cpp
)
# add library set(zerogsshadersFinalLibs
add_executable(${Output} zerogsshaders.cpp zpipe.cpp) ${ZLIB_LIBRARIES}
${CG_LIBRARIES}
${OPENGL_LIBRARIES}
)
# link target with zlib add_pcsx2_executable(${Output} "${zerogsshadersFinalSources}" "${zerogsshadersFinalLibs}" "${zerogsshadersFinalFlags}")
target_link_libraries(${Output} ${ZLIB_LIBRARIES})
# link target with Cg
target_link_libraries(${Output} ${CG_LIBRARIES})
# link target with opengl
target_link_libraries(${Output} ${OPENGL_LIBRARIES})
# 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 "")
# Now build the shader # Now build the shader
add_custom_command(TARGET ${Output} POST_BUILD add_custom_command(TARGET ${Output} POST_BUILD

View File

@ -6,19 +6,25 @@ set(bin2cppName bin2cpp)
# Debug - Build # Debug - Build
if(CMAKE_BUILD_TYPE STREQUAL Debug) if(CMAKE_BUILD_TYPE STREQUAL Debug)
# add defines # add defines
add_definitions(-O2 -s -Wall -fexceptions) set(bin2cppFinalFlags
-O2 -s -Wall -fexceptions
)
endif(CMAKE_BUILD_TYPE STREQUAL Debug) endif(CMAKE_BUILD_TYPE STREQUAL Debug)
# Devel - Build # Devel - Build
if(CMAKE_BUILD_TYPE STREQUAL Devel) if(CMAKE_BUILD_TYPE STREQUAL Devel)
# add defines # add defines
add_definitions(-O2 -s -Wall -fexceptions) set(bin2cppFinalFlags
-O2 -s -Wall -fexceptions
)
endif(CMAKE_BUILD_TYPE STREQUAL Devel) endif(CMAKE_BUILD_TYPE STREQUAL Devel)
# Release - Build # Release - Build
if(CMAKE_BUILD_TYPE STREQUAL Release) if(CMAKE_BUILD_TYPE STREQUAL Release)
# add defines # add defines
add_definitions(-O2 -s -Wall -fexceptions) set(bin2cppFinalFlags
-O2 -s -Wall -fexceptions
)
endif(CMAKE_BUILD_TYPE STREQUAL Release) endif(CMAKE_BUILD_TYPE STREQUAL Release)
# variable with all sources of this executable # variable with all sources of this executable
@ -29,7 +35,12 @@ set(bin2cppHeaders
) )
# add executable # add executable
add_executable(${bin2cppName} ${bin2cppSources} ${bin2cppHeaders}) set(bin2cppFinalSources
${bin2cppSources}
${bin2cppHeaders}
)
add_pcsx2_executable(${bin2cppName} "${bin2cppFinalSources}" "" "${bin2cppFinalFlags}")
# set output directory # set output directory
# set_target_properties(${bin2cppName} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/tools/bin) # set_target_properties(${bin2cppName} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/tools/bin)