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 svnrev.h
build build
.DS_Store
Thumbs.db
Debug Debug
Release Release
Devel 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 # check if we are on MacOSX
if(APPLE) if(APPLE)
message(WARNING "Mac OS X isn't supported, build will most likely fail")
set(MacOSX TRUE PARENT_SCOPE) set(MacOSX TRUE PARENT_SCOPE)
endif(APPLE) endif(APPLE)
@ -38,23 +39,18 @@ function(detectOperatingSystem)
endfunction(detectOperatingSystem) endfunction(detectOperatingSystem)
function(write_svnrev_h) function(write_svnrev_h)
find_package(Git)
if (GIT_FOUND) if (GIT_FOUND)
execute_process(COMMAND git -C ${CMAKE_SOURCE_DIR} show -s --format=%ci HEAD EXECUTE_PROCESS(WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} COMMAND ${GIT_EXECUTABLE} show -s --format=%ci HEAD
OUTPUT_VARIABLE tmpvar_WC_INFO OUTPUT_VARIABLE PCSX2_WC_TIME
OUTPUT_STRIP_TRAILING_WHITESPACE) OUTPUT_STRIP_TRAILING_WHITESPACE)
# %2014-03-25 16:36:29 +0100 # Output: "YYYY-MM-DD HH:MM:SS +HHMM" (last part is time zone, offset from UTC)
string(REGEX REPLACE "[%:\\-]" "" tmpvar_WC_INFO "${tmpvar_WC_INFO}") string(REGEX REPLACE "[%:\\-]" "" PCSX2_WC_TIME "${PCSX2_WC_TIME}")
string(REGEX REPLACE "([0-9]+) ([0-9]+).*" "\\1\\2" tmpvar_WC_INFO "${tmpvar_WC_INFO}") string(REGEX REPLACE "([0-9]+) ([0-9]+).*" "\\1\\2" PCSX2_WC_TIME "${PCSX2_WC_TIME}")
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()
else() 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() endif()
file(WRITE ${CMAKE_BINARY_DIR}/common/include/svnrev.h "#define SVN_REV ${PCSX2_WC_TIME}ll \n#define SVN_MODS 0")
endfunction() endfunction()
function(check_compiler_version version_warn version_err) 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") 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() endif()
endfunction() 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) find_package(ZLIB)
## Use pcsx2 package to find module ## Use pcsx2 package to find module
include(FindAio) include(FindCg)
## Include cg because of zzogl-cg and zerogs
#if(NOT GLSL_API)
include(FindCg)
#endif()
include(FindEGL)
include(FindGLES2)
include(FindGlew) include(FindGlew)
include(FindLibc) 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 # 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... # If you include first 3rdparty, all 3rdpary include will have a higer priority...
@ -69,10 +69,6 @@ if(Linux)
endif() endif()
endif() endif()
if(AIO_FOUND)
include_directories(${AIO_INCLUDE_DIR})
endif()
if(ALSA_FOUND) if(ALSA_FOUND)
include_directories(${ALSA_INCLUDE_DIRS}) include_directories(${ALSA_INCLUDE_DIRS})
endif() endif()
@ -85,10 +81,6 @@ if(CG_FOUND)
include_directories(${CG_INCLUDE_DIRS}) include_directories(${CG_INCLUDE_DIRS})
endif() endif()
if (EGL_FOUND)
include_directories(${EGL_INCLUDE_DIR})
endif()
if(JPEG_FOUND) if(JPEG_FOUND)
include_directories(${JPEG_INCLUDE_DIR}) include_directories(${JPEG_INCLUDE_DIR})
endif() endif()
@ -97,26 +89,14 @@ if(GLEW_FOUND)
include_directories(${GLEW_INCLUDE_DIR}) include_directories(${GLEW_INCLUDE_DIR})
endif() endif()
if(GLESV2_FOUND)
include_directories(${GLESV2_INCLUDE_DIR})
endif()
if(OPENGL_FOUND) if(OPENGL_FOUND)
include_directories(${OPENGL_INCLUDE_DIR}) include_directories(${OPENGL_INCLUDE_DIR})
endif() endif()
if(PORTAUDIO_FOUND)
include_directories(${PORTAUDIO_INCLUDE_DIR})
endif()
if(SDL_FOUND) if(SDL_FOUND)
include_directories(${SDL_INCLUDE_DIR}) include_directories(${SDL_INCLUDE_DIR})
endif() endif()
if(SOUNDTOUCH_FOUND)
include_directories(${SOUNDTOUCH_INCLUDE_DIR})
endif()
if(wxWidgets_FOUND) if(wxWidgets_FOUND)
if(Linux) if(Linux)
# Force the use of 32 bit library configuration on # 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. #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)