Merge branch 'uyjulian-CleanCMake'

This commit is contained in:
Gregory Hainaut 2014-09-05 20:17:07 +02:00
commit b875f81be3
30 changed files with 692 additions and 852 deletions

4
.gitignore vendored
View File

@ -20,6 +20,10 @@ postBuild.cmd
svnrev.h
build
.DS_Store
Thumbs.db
Debug
Release
Devel

36
cmake/CheckLib.cmake Normal file
View File

@ -0,0 +1,36 @@
include(FindPkgConfig OPTIONAL)
macro(_internal_message msg)
message("${msg}")
endmacro()
macro(check_lib var lib)
set(_arg_list ${ARGN})
if(PKG_CONFIG_FOUND AND NOT ${var}_FOUND)
string(TOLOWER ${lib} lower_lib)
pkg_search_module(${var} QUIET ${lower_lib})
endif()
if(${var}_FOUND)
include_directories(${${var}_INCLUDE_DIRS})
# Make sure include directories for headers found using find_path below
# are re-added when reconfiguring
include_directories(${${var}_INCLUDE})
_internal_message("${lib} found")
else()
find_library(${var} ${lib})
if(_arg_list)
find_path(${var}_INCLUDE ${_arg_list})
else()
set(${var}_INCLUDE FALSE)
endif()
if(${var} AND ${var}_INCLUDE)
include_directories(${${var}_INCLUDE})
_internal_message("${lib} found")
set(${var}_FOUND 1 CACHE INTERNAL "")
else()
_internal_message("${lib} not found")
endif()
endif()
endmacro()

View File

@ -1,25 +0,0 @@
# Try to find AIO
# Once done, this will define
#
# AIO_FOUND - system has AIO
# AIO_INCLUDE_DIR - the AIO include directories
# AIO_LIBRARIES - link these to use AIO
if(AIO_INCLUDE_DIR AND AIO_LIBRARIES)
set(AIO_FIND_QUIETLY TRUE)
endif(AIO_INCLUDE_DIR AND AIO_LIBRARIES)
# include dir
find_path(AIO_INCLUDE_DIR libaio.h)
# finally the library itself
find_library(LIBAIO NAMES aio)
set(AIO_LIBRARIES ${LIBAIO})
# handle the QUIETLY and REQUIRED arguments and set AIO_FOUND to TRUE if
# all listed variables are TRUE
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(AIO DEFAULT_MSG AIO_LIBRARIES AIO_INCLUDE_DIR)
mark_as_advanced(AIO_LIBRARIES AIO_INCLUDE_DIR)

View File

@ -1,27 +0,0 @@
# Try to find EGL
# Once done, this will define
#
# EGL_FOUND - system has EGL
# EGL_INCLUDE_DIR - the EGL include directories
# EGL_LIBRARIES - link these to use EGL
if(EGL_INCLUDE_DIR AND EGL_LIBRARIES)
set(EGL_FIND_QUIETLY TRUE)
endif(EGL_INCLUDE_DIR AND EGL_LIBRARIES)
INCLUDE(CheckCXXSymbolExists)
# include dir
find_path(EGL_INCLUDE_DIR EGL/eglext.h)
# finally the library itself
find_library(libEGL NAMES EGL)
set(EGL_LIBRARIES ${libEGL})
# handle the QUIETLY and REQUIRED arguments and set EGL_FOUND to TRUE if
# all listed variables are TRUE
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(EGL DEFAULT_MSG EGL_LIBRARIES EGL_INCLUDE_DIR)
mark_as_advanced(EGL_LIBRARIES EGL_INCLUDE_DIR)

View File

@ -1,27 +0,0 @@
# Try to find GLESV2
# Once done, this will define
#
# GLESV2_FOUND - system has GLESV2
# GLESV2_INCLUDE_DIR - the GLESV2 include directories
# GLESV2_LIBRARIES - link these to use GLESV2
if(GLESV2_INCLUDE_DIR AND GLESV2_LIBRARIES)
set(GLESV2_FIND_QUIETLY TRUE)
endif(GLESV2_INCLUDE_DIR AND GLESV2_LIBRARIES)
INCLUDE(CheckCXXSymbolExists)
# include dir
find_path(GLESV2_INCLUDE_DIR GLES3/gl3ext.h)
# finally the library itself
find_library(libGLESV2 NAMES GLESv2)
set(GLESV2_LIBRARIES ${libGLESV2})
# handle the QUIETLY and REQUIRED arguments and set GLESV2_FOUND to TRUE if
# all listed variables are TRUE
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(GLESV2 DEFAULT_MSG GLESV2_LIBRARIES GLESV2_INCLUDE_DIR)
mark_as_advanced(GLESV2_LIBRARIES GLESV2_INCLUDE_DIR)

View File

@ -1,27 +0,0 @@
# Try to find PortAudio
# Once done, this will define
#
# PORTAUDIO_FOUND - system has PortAudio
# PORTAUDIO_INCLUDE_DIR - the PortAudio include directories
# PORTAUDIO_LIBRARIES - link these to use PortAudio
if(PORTAUDIO_INCLUDE_DIR AND PORTAUDIO_LIBRARIES)
set(PORTAUDIO_FIND_QUIETLY TRUE)
endif(PORTAUDIO_INCLUDE_DIR AND PORTAUDIO_LIBRARIES)
# Search both portaudio.h and pa_linux_alsa.h to ensure the user gets
# the include of the V2 API (V1 have only portaudio.h)
find_path(PORTAUDIO_INCLUDE_DIR NAMES portaudio.h pa_linux_alsa.h)
# finally the library itself
find_library(libPortAudio NAMES portaudio)
# Run OK without libportaudiocpp so do not pull additional dependency
set(PORTAUDIO_LIBRARIES ${libPortAudio})
# handle the QUIETLY and REQUIRED arguments and set PORTAUDIO_FOUND to TRUE if
# all listed variables are TRUE
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(PortAudio DEFAULT_MSG PORTAUDIO_LIBRARIES PORTAUDIO_INCLUDE_DIR)
mark_as_advanced(PORTAUDIO_LIBRARIES PORTAUDIO_INCLUDE_DIR)

View File

@ -1,29 +0,0 @@
# Try to find SoundTouch
# Once done, this will define
#
# SOUNDTOUCH_FOUND - system has SoundTouch
# SOUNDTOUCH_INCLUDE_DIR - the SoundTouch include directories
# SOUNDTOUCH_LIBRARIES - link these to use SoundTouch
if(SOUNDTOUCH_INCLUDE_DIR AND SOUNDTOUCH_LIBRARIES)
set(SOUNDTOUCH_FIND_QUIETLY TRUE)
endif(SOUNDTOUCH_INCLUDE_DIR AND SOUNDTOUCH_LIBRARIES)
# include dir
#find_path(SOUNDTOUCH_INCLUDE_DIR SoundTouch.h
# /usr/include/soundtouch
# /usr/local/include/soundtouch
# )
find_path(SOUNDTOUCH_INCLUDE_DIR soundtouch/SoundTouch.h)
# finally the library itself
find_library(libSoundTouch NAMES SoundTouch)
set(SOUNDTOUCH_LIBRARIES ${libSoundTouch})
# handle the QUIETLY and REQUIRED arguments and set SOUNDTOUCH_FOUND to TRUE if
# all listed variables are TRUE
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(SoundTouch DEFAULT_MSG SOUNDTOUCH_LIBRARIES SOUNDTOUCH_INCLUDE_DIR)
mark_as_advanced(SOUNDTOUCH_LIBRARIES SOUNDTOUCH_INCLUDE_DIR)

View File

@ -28,6 +28,7 @@ function(detectOperatingSystem)
# check if we are on MacOSX
if(APPLE)
message(WARNING "Mac OS X isn't supported, build will most likely fail")
set(MacOSX TRUE PARENT_SCOPE)
endif(APPLE)
@ -38,23 +39,18 @@ function(detectOperatingSystem)
endfunction(detectOperatingSystem)
function(write_svnrev_h)
find_package(Git)
if (GIT_FOUND)
execute_process(COMMAND git -C ${CMAKE_SOURCE_DIR} show -s --format=%ci HEAD
OUTPUT_VARIABLE tmpvar_WC_INFO
EXECUTE_PROCESS(WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} COMMAND ${GIT_EXECUTABLE} show -s --format=%ci HEAD
OUTPUT_VARIABLE PCSX2_WC_TIME
OUTPUT_STRIP_TRAILING_WHITESPACE)
# %2014-03-25 16:36:29 +0100
string(REGEX REPLACE "[%:\\-]" "" tmpvar_WC_INFO "${tmpvar_WC_INFO}")
string(REGEX REPLACE "([0-9]+) ([0-9]+).*" "\\1\\2" tmpvar_WC_INFO "${tmpvar_WC_INFO}")
if ("${tmpvar_WC_INFO}" STREQUAL "")
# For people with an older GIT version that migth not support '-C'
file(WRITE ${CMAKE_BINARY_DIR}/common/include/svnrev.h "#define SVN_REV 0ll \n#define SVN_MODS 0")
else()
file(WRITE ${CMAKE_BINARY_DIR}/common/include/svnrev.h "#define SVN_REV ${tmpvar_WC_INFO}ll \n#define SVN_MODS 0")
endif()
# Output: "YYYY-MM-DD HH:MM:SS +HHMM" (last part is time zone, offset from UTC)
string(REGEX REPLACE "[%:\\-]" "" PCSX2_WC_TIME "${PCSX2_WC_TIME}")
string(REGEX REPLACE "([0-9]+) ([0-9]+).*" "\\1\\2" PCSX2_WC_TIME "${PCSX2_WC_TIME}")
else()
file(WRITE ${CMAKE_BINARY_DIR}/common/include/svnrev.h "#define SVN_REV_UNKNOWN\n#define SVN_REV 0ll \n#define SVN_MODS 0")
set(PCSX2_WC_TIME 0)
endif()
file(WRITE ${CMAKE_BINARY_DIR}/common/include/svnrev.h "#define SVN_REV ${PCSX2_WC_TIME}ll \n#define SVN_MODS 0")
endfunction()
function(check_compiler_version version_warn version_err)
@ -78,3 +74,65 @@ function(check_no_parenthesis_in_path)
message(FATAL_ERROR "Your path contains some parenthesis. Unfortunately Cmake doesn't support them correctly.\nPlease rename your directory to avoid '(' and ')' characters\n")
endif()
endfunction()
#NOTE: this macro is used to get rid of whitespace and newlines.
macro(append_flags target flags)
if(flags STREQUAL "")
set(flags " ") # set to space to avoid error
endif()
get_target_property(TEMP ${target} COMPILE_FLAGS)
if(TEMP STREQUAL "TEMP-NOTFOUND")
set(TEMP "") # set to empty string
else()
set(TEMP "${TEMP} ") # a space to cleanly separate from existing content
endif()
# append our values
set(TEMP "${TEMP}${flags}")
# fix arg list
set(TEMP2 "")
foreach(_arg ${TEMP})
set(TEMP2 "${TEMP2} ${_arg}")
endforeach()
set_target_properties(${target} PROPERTIES COMPILE_FLAGS "${TEMP2}")
endmacro(append_flags)
macro(add_pcsx2_plugin lib srcs libs flags)
include_directories(.)
add_library(${lib} MODULE ${srcs})
target_link_libraries(${lib} ${libs})
append_flags(${lib} "${flags}")
if(NOT USER_CMAKE_LD_FLAGS STREQUAL "")
target_link_libraries(${lib} "${USER_CMAKE_LD_FLAGS}")
endif(NOT USER_CMAKE_LD_FLAGS STREQUAL "")
if(PACKAGE_MODE)
install(TARGETS ${lib} DESTINATION ${PLUGIN_DIR})
else(PACKAGE_MODE)
install(TARGETS ${lib} DESTINATION ${CMAKE_SOURCE_DIR}/bin/plugins)
endif(PACKAGE_MODE)
endmacro(add_pcsx2_plugin)
macro(add_pcsx2_lib lib srcs libs flags)
include_directories(.)
add_library(${lib} STATIC ${srcs})
target_link_libraries(${lib} ${libs})
append_flags(${lib} "${flags}")
if(NOT USER_CMAKE_LD_FLAGS STREQUAL "")
target_link_libraries(${lib} "${USER_CMAKE_LD_FLAGS}")
endif(NOT USER_CMAKE_LD_FLAGS STREQUAL "")
endmacro(add_pcsx2_lib)
macro(add_pcsx2_executable exe srcs libs flags)
add_definitions(${flags})
include_directories(.)
add_executable(${exe} ${srcs})
target_link_libraries(${exe} ${libs})
append_flags(${exe} "${flags}")
if(NOT USER_CMAKE_LD_FLAGS STREQUAL "")
target_link_libraries(${lib} "${USER_CMAKE_LD_FLAGS}")
endif(NOT USER_CMAKE_LD_FLAGS STREQUAL "")
if(PACKAGE_MODE)
install(TARGETS ${exe} DESTINATION bin)
else(PACKAGE_MODE)
install(TARGETS ${exe} DESTINATION ${CMAKE_SOURCE_DIR}/bin)
endif(PACKAGE_MODE)
endmacro(add_pcsx2_executable)

View File

@ -33,17 +33,17 @@ find_package(wxWidgets COMPONENTS base core adv)
find_package(ZLIB)
## Use pcsx2 package to find module
include(FindAio)
## Include cg because of zzogl-cg and zerogs
#if(NOT GLSL_API)
include(FindCg)
#endif()
include(FindEGL)
include(FindGLES2)
include(FindCg)
include(FindGlew)
include(FindLibc)
include(FindPortAudio)
include(FindSoundTouch)
## Use CheckLib package to find module
include(CheckLib)
check_lib(AIO aio aio.h)
check_lib(EGL egl EGL/egl.h)
check_lib(GLESV2 GLESv2 GLES3/gl3ext.h) # NOTE: looking for GLESv3, not GLESv2
check_lib(PORTAUDIO portaudio portaudio.h pa_linux_alsa.h)
check_lib(SOUNDTOUCH SoundTouch soundtouch/SoundTouch.h)
# Note for include_directory: The order is important to avoid a mess between include file from your system and the one of pcsx2
# If you include first 3rdparty, all 3rdpary include will have a higer priority...
@ -69,10 +69,6 @@ if(Linux)
endif()
endif()
if(AIO_FOUND)
include_directories(${AIO_INCLUDE_DIR})
endif()
if(ALSA_FOUND)
include_directories(${ALSA_INCLUDE_DIRS})
endif()
@ -85,10 +81,6 @@ if(CG_FOUND)
include_directories(${CG_INCLUDE_DIRS})
endif()
if (EGL_FOUND)
include_directories(${EGL_INCLUDE_DIR})
endif()
if(JPEG_FOUND)
include_directories(${JPEG_INCLUDE_DIR})
endif()
@ -97,26 +89,14 @@ if(GLEW_FOUND)
include_directories(${GLEW_INCLUDE_DIR})
endif()
if(GLESV2_FOUND)
include_directories(${GLESV2_INCLUDE_DIR})
endif()
if(OPENGL_FOUND)
include_directories(${OPENGL_INCLUDE_DIR})
endif()
if(PORTAUDIO_FOUND)
include_directories(${PORTAUDIO_INCLUDE_DIR})
endif()
if(SDL_FOUND)
include_directories(${SDL_INCLUDE_DIR})
endif()
if(SOUNDTOUCH_FOUND)
include_directories(${SOUNDTOUCH_INCLUDE_DIR})
endif()
if(wxWidgets_FOUND)
if(Linux)
# Force the use of 32 bit library configuration on

View File

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

View File

@ -57,28 +57,38 @@ set(OptimizationFlags
#Clang doesn't support a few common flags that GCC does.
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)
# Debug - Build
if(CMAKE_BUILD_TYPE STREQUAL Debug)
# add defines
add_definitions(${CommonFlags} -DPCSX2_DEVBUILD -DPCSX2_DEBUG)
set(x86emitterFinalFlags
${x86emitterFinalFlags}
${CommonFlags} -DPCSX2_DEBUG -DPCSX2_DEVBUILD
)
endif(CMAKE_BUILD_TYPE STREQUAL Debug)
# Devel - Build
if(CMAKE_BUILD_TYPE STREQUAL Devel)
# add defines
add_definitions(${CommonFlags} ${OptimizationFlags} -DPCSX2_DEVBUILD)
set(x86emitterFinalFlags
${x86emitterFinalFlags}
${CommonFlags} ${OptimizationFlags} -DPCSX2_DEVBUILD
)
endif(CMAKE_BUILD_TYPE STREQUAL Devel)
# Release - Build
if(CMAKE_BUILD_TYPE STREQUAL Release)
# add defines
add_definitions(${CommonFlags} ${OptimizationFlags})
set(x86emitterFinalFlags
${x86emitterFinalFlags}
${CommonFlags} ${OptimizationFlags}
)
endif(CMAKE_BUILD_TYPE STREQUAL Release)
# variable with all sources of this library
@ -127,13 +137,13 @@ set(x86emitterHeaders
../../include/x86emitter/x86types.h
PrecompiledHeader.h)
# add library
add_library(${Output} STATIC ${x86emitterSources} ${x86emitterHeaders})
set(x86emitterFinalSources
${x86emitterSources}
${x86emitterHeaders}
)
# link target with wx
target_link_libraries(${Output} ${wxWidgets_LIBRARIES})
set(x86emitterFinalLibs
${wxWidgets_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 "")
add_pcsx2_lib(${Output} "${x86emitterFinalSources}" "${x86emitterFinalLibs}" "${x86emitterFinalFlags}")

View File

@ -63,32 +63,46 @@ set(OptimizationFlags
#Clang doesn't support a few common flags that GCC does.
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)
# Debug - Build
if(CMAKE_BUILD_TYPE STREQUAL Debug)
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)
# Devel - Build
if(CMAKE_BUILD_TYPE STREQUAL Devel)
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)
# Release - Build
if(CMAKE_BUILD_TYPE STREQUAL Release)
set(Output pcsx2)
add_definitions(${CommonFlags} ${OptimizationFlags} -DWX_PRECOMP -DNDEBUG)
set(pcsx2FinalFlags
${pcsx2FinalFlags}
${CommonFlags} ${OptimizationFlags} -DWX_PRECOMP -DNDEBUG
)
endif(CMAKE_BUILD_TYPE STREQUAL Release)
if(XDG_STD)
add_definitions(-DXDG_STD)
set(pcsx2FinalFlags
${pcsx2FinalFlags}
-DXDG_STD
)
endif(XDG_STD)
# In package mode always use pcsx2
@ -655,21 +669,30 @@ endif(Windows)
# MacOSX
if(MacOSX)
set(PlatformSources
set(Platform
)
endif(MacOSX)
set(pcsx2FinalSources
${Common}
${Platform}
)
set(pcsx2FinalLibs
Utilities
x86emitter
${wxWidgets_LIBRARIES}
${GTK2_LIBRARIES}
${ZLIB_LIBRARIES}
aio
)
# additonal include directories
include_directories(.
include_directories(
gui
x86
${CMAKE_BINARY_DIR}/pcsx2/gui
)
# add executable
add_executable(${Output}
${Common}
${Platform})
)
### Generate the resources files
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__")
endif(PACKAGE_MODE)
# link target with project internal libraries
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)
add_pcsx2_executable(${Output} "${pcsx2FinalSources}" "${pcsx2FinalLibs}" "${pcsx2FinalFlags}")

View File

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

View File

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

View File

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

View File

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

View File

@ -28,30 +28,42 @@ set(OptimizationFlags
#Clang doesn't support a few common flags that GCC does.
if(NOT USE_CLANG AND _M_X86_32)
add_definitions(${CommonFlags} -mpreferred-stack-boundary=2)
set(GSdxFinalFlags
${GSdxFinalFlags} ${CommonFlags} -mpreferred-stack-boundary=2
)
endif()
# Debug - Build
if(CMAKE_BUILD_TYPE STREQUAL Debug)
add_definitions(${CommonFlags} -D_DEBUG -g -Wall)
set(GSdxFinalFlags
${GSdxFinalFlags} ${CommonFlags} -D_DEBUG -g -Wall
)
endif()
# Devel - Build
if(CMAKE_BUILD_TYPE STREQUAL Devel)
add_definitions(${CommonFlags} ${OptimizationFlags} -D_DEVEL -g)
set(GSdxFinalFlags
${GSdxFinalFlags} ${CommonFlags} ${OptimizationFlags} -D_DEVEL -g
)
endif()
# Release - Build
if(CMAKE_BUILD_TYPE STREQUAL Release)
add_definitions(${CommonFlags} ${OptimizationFlags} -W)
set(GSdxFinalFlags
${GSdxFinalFlags} ${CommonFlags} ${OptimizationFlags} -W
)
endif()
if(XDG_STD)
add_definitions(-DXDG_STD)
set(GSdxFinalFlags
${GSdxFinalFlags} -DXDG_STD
)
endif()
if(GLES_API AND GLESV2_FOUND)
add_definitions(-DENABLE_GLES)
set(GSdxFinalFlags
${GSdxFinalFlags} -DENABLE_GLES
)
endif()
set(GSdxSources
@ -190,54 +202,47 @@ set(GSdxHeaders
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
if (REBUILD_SHADER)
add_custom_command(OUTPUT res/glsl_source.h COMMAND perl ${CMAKE_SOURCE_DIR}/linux_various/glsl2h.pl)
endif()
add_library(${Output} SHARED ${GSdxSources} ${GSdxHeaders})
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)
add_pcsx2_plugin(${Output} "${GSdxFinalSources}" "${GSdxFinalLibs}" "${GSdxFinalFlags}")
################################### Replay Loader
if(BUILD_REPLAY_LOADERS)
set(Replay pcsx2_GSReplayLoader)
add_executable(${Replay} linux_replay.cpp)
target_link_libraries(${Replay} ${LIBC_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)
set(GSdxReplayLoaderFinalSources
${GSdxFinalSources}
linux_replay.cpp
)
add_pcsx2_executable(${Replay} "${GSdxReplayLoaderFinalSources}" "${GSdxFinalLibs}" "${GSdxFinalFlags}")
endif(BUILD_REPLAY_LOADERS)

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -21,19 +21,28 @@ set(OptimizationFlags
)
if(CMAKE_BUILD_TYPE STREQUAL Debug)
add_definitions(${CommonFlags} -g)
set(onepadFinalFlags
${CommonFlags} -g
)
endif(CMAKE_BUILD_TYPE STREQUAL Debug)
if(CMAKE_BUILD_TYPE STREQUAL Devel)
add_definitions(${CommonFlags} ${OptimizationFlags})
set(onepadFinalFlags
${CommonFlags} ${OptimizationFlags}
)
endif(CMAKE_BUILD_TYPE STREQUAL Devel)
if(CMAKE_BUILD_TYPE STREQUAL Release)
add_definitions(${CommonFlags} ${OptimizationFlags})
set(onepadFinalFlags
${CommonFlags} ${OptimizationFlags}
)
endif(CMAKE_BUILD_TYPE STREQUAL Release)
if (SDL2_API)
add_definitions(-DONEPAD_SDL2)
set(onepadFinalFlags
${onepadFinalFlags}
-DONEPAD_SDL2
)
endif()
# onepad sources
@ -71,37 +80,27 @@ set(onepadWindowsSources
set(onepadWindowsHeaders
)
# add additional include directories
include_directories(.)
# add library
add_library(${Output} SHARED
${onepadSources}
${onepadHeaders}
${onepadLinuxSources}
${onepadLinuxHeaders})
if (SDL2_API)
target_link_libraries(${Output} ${SDL2_LIBRARY})
set(onepadFinalLibs
${SDL2_LIBRARY}
)
else()
target_link_libraries(${Output} ${SDL_LIBRARY})
set(onepadFinalLibs
${SDL_LIBRARY}
)
endif()
if(Linux)
# link target with gtk2
target_link_libraries(${Output} ${GTK2_LIBRARIES})
endif(Linux)
set(onepadFinalLibs
${onepadFinalLibs}
${GTK2_LIBRARIES}
${X11_LIBRARIES}
)
# link target with X11
target_link_libraries(${Output} ${X11_LIBRARIES})
set(onepadFinalSources
${onepadSources}
${onepadHeaders}
${onepadLinuxSources}
${onepadLinuxHeaders}
)
# 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)
add_pcsx2_plugin(${Output} "${onepadFinalSources}" "${onepadFinalLibs}" "${onepadFinalFlags}")

View File

@ -22,19 +22,25 @@ set(OptimizationFlags
# Debug - Build
if(CMAKE_BUILD_TYPE STREQUAL Debug)
# add defines
add_definitions(${CommonFlags} -g)
set(spu2xFinalFlags
${CommonFlags} -g
)
endif(CMAKE_BUILD_TYPE STREQUAL Debug)
# Devel - Build
if(CMAKE_BUILD_TYPE STREQUAL Devel)
# add defines
add_definitions(${CommonFlags} ${OptimizationFlags})
set(spu2xFinalFlags
${CommonFlags} ${OptimizationFlags}
)
endif(CMAKE_BUILD_TYPE STREQUAL Devel)
# Release - Build
if(CMAKE_BUILD_TYPE STREQUAL Release)
# add defines
add_definitions(${CommonFlags} ${OptimizationFlags})
set(spu2xFinalFlags
${CommonFlags} ${OptimizationFlags}
)
endif(CMAKE_BUILD_TYPE STREQUAL Release)
# spu2x sources
@ -97,7 +103,7 @@ set(spu2xLinuxHeaders
Linux/Dialogs.h)
# 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.
### Note: actually it might work on 4.6 too
@ -112,49 +118,48 @@ include_directories(. Linux)
if(SDL_FOUND)
list(APPEND spu2xSources SndOut_SDL.cpp)
if(SDL2_API)
add_definitions(-DSPU2X_SDL2)
if (SDL2_API)
set(spu2xFinalFlags
${spu2xFinalFlags}
-DSPU2X_SDL2
)
else()
add_definitions(-DSPU2X_SDL)
set(spu2xFinalFlags
${spu2xFinalFlags}
-DSPU2X_SDL
)
endif()
#elseif(SDL2_FOUND)
# add_definitions(-DSPU2X_SDL2)
endif()
# add library
add_library(${Output} SHARED
${spu2xSources}
${spu2xHeaders}
${spu2xLinuxSources}
${spu2xLinuxHeaders})
set(spu2xFinalSources
${spu2xSources}
${spu2xHeaders}
${spu2xLinuxSources}
${spu2xLinuxHeaders}
)
# link target with project internal libraries
target_link_libraries(${Output} Utilities)
set(spu2xFinalLibs
Utilities
${ALSA_LIBRARIES}
portaudio
)
# link target with various backend
target_link_libraries(${Output} ${ALSA_LIBRARIES})
target_link_libraries(${Output} ${PORTAUDIO_LIBRARIES})
if (SDL2_API)
target_link_libraries(${Output} ${SDL2_LIBRARY})
set(spu2xFinalLibs
${spu2xFinalLibs}
${SDL2_LIBRARY}
)
else()
target_link_libraries(${Output} ${SDL_LIBRARY})
set(spu2xFinalLibs
${spu2xFinalLibs}
${SDL_LIBRARY}
)
endif()
# link target with SoundTouch
target_link_libraries(${Output} ${SOUNDTOUCH_LIBRARIES})
set(spu2xFinalLibs
${spu2xFinalLibs}
SoundTouch
${GTK2_LIBRARIES}
)
if(Linux)
# 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)
add_pcsx2_plugin(${Output} "${spu2xFinalSources}" "${spu2xFinalLibs}" "${spu2xFinalFlags}")

View File

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

View File

@ -25,19 +25,25 @@ set(OptimizationFlags
# Debug - Build
if(CMAKE_BUILD_TYPE STREQUAL Debug)
# add defines
add_definitions(${CommonFlags} -g -Wall -D_DEBUG)
set(zzoglFinalFlags
${CommonFlags} -g -Wall -D_DEBUG
)
endif(CMAKE_BUILD_TYPE STREQUAL Debug)
# Devel - Build
if(CMAKE_BUILD_TYPE STREQUAL Devel)
# add defines
add_definitions(${CommonFlags} ${OptimizationFlags} -g -W -DZEROGS_DEVBUILD)
set(zzoglFinalFlags
${CommonFlags} ${OptimizationFlags} -g -W -DZEROGS_DEVBUILD
)
endif(CMAKE_BUILD_TYPE STREQUAL Devel)
# Release - Build
if(CMAKE_BUILD_TYPE STREQUAL Release)
# add defines
add_definitions(${CommonFlags} ${OptimizationFlags} -W)
set(zzoglFinalFlags
${CommonFlags} ${OptimizationFlags} -W
)
endif(CMAKE_BUILD_TYPE STREQUAL Release)
# zzogl sources
@ -126,102 +132,44 @@ set(zzoglLinuxSources
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(${Output} SHARED
set(zzoglFinalSources
${zzoglSources}
${zzoglHeaders}
${zzoglSSources}
${zzoglShaderSources}
${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
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
if(BUILD_REPLAY_LOADERS)
set(Replay pcsx2_ZZCGReplayLoader)
set(Static zzogl-cg-static)
add_library(${Static} STATIC
${zzoglSources}
${zzoglHeaders}
${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)
set(zzoglReplayLoaderFinalSources
${zzoglFinalSources}
linux_replay.cpp
)
add_pcsx2_executable(${Replay} "${zzoglReplayLoaderFinalSources}" "${zzoglFinalLibs}" "${zzoglFinalFlags}")
endif(BUILD_REPLAY_LOADERS)

View File

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

View File

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

View File

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

View File

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