From f3a50a01a7616ce8dd350a39b7b0f71a1ebe536a Mon Sep 17 00:00:00 2001 From: uyjulian Date: Mon, 4 Aug 2014 11:42:40 -0500 Subject: [PATCH] cmake: Use previous macros in CMakeLists.txt files Gregory: add a c lib for zzogl-pg-cg replayer --- cmake/Pcsx2Utils.cmake | 1 - common/src/Utilities/CMakeLists.txt | 43 +++-- common/src/x86emitter/CMakeLists.txt | 38 ++-- pcsx2/CMakeLists.txt | 76 ++++---- plugins/CDVDiso/src/CMakeLists.txt | 46 +++-- plugins/CDVDlinuz/Src/CMakeLists.txt | 37 ++-- plugins/CDVDnull/CMakeLists.txt | 42 ++--- plugins/FWnull/CMakeLists.txt | 45 ++--- plugins/GSdx/CMakeLists.txt | 97 +++++----- plugins/GSnull/CMakeLists.txt | 53 +++--- plugins/PadNull/CMakeLists.txt | 49 +++-- plugins/SPU2null/CMakeLists.txt | 45 ++--- plugins/USBnull/CMakeLists.txt | 45 ++--- plugins/dev9null/CMakeLists.txt | 45 ++--- plugins/onepad/CMakeLists.txt | 63 ++++--- plugins/spu2-x/src/CMakeLists.txt | 83 +++++---- plugins/zerospu2/CMakeLists.txt | 49 +++-- plugins/zzogl-pg-cg/opengl/CMakeLists.txt | 126 ++++--------- .../opengl/ZeroGSShaders/CMakeLists.txt | 38 ++-- plugins/zzogl-pg/opengl/CMakeLists.txt | 170 ++++++++---------- .../opengl/ZeroGSShaders/CMakeLists.txt | 38 ++-- tools/bin2cpp/CMakeLists.txt | 19 +- 22 files changed, 572 insertions(+), 676 deletions(-) diff --git a/cmake/Pcsx2Utils.cmake b/cmake/Pcsx2Utils.cmake index ffd5ec6558..3785bf8ab9 100644 --- a/cmake/Pcsx2Utils.cmake +++ b/cmake/Pcsx2Utils.cmake @@ -136,4 +136,3 @@ macro(add_pcsx2_executable exe srcs libs flags) install(TARGETS ${exe} DESTINATION ${CMAKE_SOURCE_DIR}/bin) endif(PACKAGE_MODE) endmacro(add_pcsx2_executable) - diff --git a/common/src/Utilities/CMakeLists.txt b/common/src/Utilities/CMakeLists.txt index 4bc3b7d0b4..89ad223ab6 100644 --- a/common/src/Utilities/CMakeLists.txt +++ b/common/src/Utilities/CMakeLists.txt @@ -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}") \ No newline at end of file diff --git a/common/src/x86emitter/CMakeLists.txt b/common/src/x86emitter/CMakeLists.txt index cc7c6ae472..4743bf81fd 100644 --- a/common/src/x86emitter/CMakeLists.txt +++ b/common/src/x86emitter/CMakeLists.txt @@ -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}") diff --git a/pcsx2/CMakeLists.txt b/pcsx2/CMakeLists.txt index 88b197efbd..fa5bd9199f 100644 --- a/pcsx2/CMakeLists.txt +++ b/pcsx2/CMakeLists.txt @@ -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}") diff --git a/plugins/CDVDiso/src/CMakeLists.txt b/plugins/CDVDiso/src/CMakeLists.txt index edb6f1ca5c..714b63440e 100644 --- a/plugins/CDVDiso/src/CMakeLists.txt +++ b/plugins/CDVDiso/src/CMakeLists.txt @@ -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}") diff --git a/plugins/CDVDlinuz/Src/CMakeLists.txt b/plugins/CDVDlinuz/Src/CMakeLists.txt index cdb7ab603a..254aeb7191 100644 --- a/plugins/CDVDlinuz/Src/CMakeLists.txt +++ b/plugins/CDVDlinuz/Src/CMakeLists.txt @@ -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}") \ No newline at end of file diff --git a/plugins/CDVDnull/CMakeLists.txt b/plugins/CDVDnull/CMakeLists.txt index 27a72d14fb..8dbac89a16 100644 --- a/plugins/CDVDnull/CMakeLists.txt +++ b/plugins/CDVDnull/CMakeLists.txt @@ -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}") diff --git a/plugins/FWnull/CMakeLists.txt b/plugins/FWnull/CMakeLists.txt index 0d8a7ba36c..d786c271b1 100644 --- a/plugins/FWnull/CMakeLists.txt +++ b/plugins/FWnull/CMakeLists.txt @@ -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}") \ No newline at end of file diff --git a/plugins/GSdx/CMakeLists.txt b/plugins/GSdx/CMakeLists.txt index c7e4618be1..f87270b227 100644 --- a/plugins/GSdx/CMakeLists.txt +++ b/plugins/GSdx/CMakeLists.txt @@ -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) diff --git a/plugins/GSnull/CMakeLists.txt b/plugins/GSnull/CMakeLists.txt index 15bfa9a875..b16914bbbe 100644 --- a/plugins/GSnull/CMakeLists.txt +++ b/plugins/GSnull/CMakeLists.txt @@ -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}") diff --git a/plugins/PadNull/CMakeLists.txt b/plugins/PadNull/CMakeLists.txt index 2cba99fd5d..9e729c8247 100644 --- a/plugins/PadNull/CMakeLists.txt +++ b/plugins/PadNull/CMakeLists.txt @@ -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}") diff --git a/plugins/SPU2null/CMakeLists.txt b/plugins/SPU2null/CMakeLists.txt index 08271ef5f7..f7eb8d2c47 100644 --- a/plugins/SPU2null/CMakeLists.txt +++ b/plugins/SPU2null/CMakeLists.txt @@ -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}") diff --git a/plugins/USBnull/CMakeLists.txt b/plugins/USBnull/CMakeLists.txt index 55cfa8aefe..9ef8b9a53e 100644 --- a/plugins/USBnull/CMakeLists.txt +++ b/plugins/USBnull/CMakeLists.txt @@ -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}") diff --git a/plugins/dev9null/CMakeLists.txt b/plugins/dev9null/CMakeLists.txt index 3d53e81212..4a58bde2af 100644 --- a/plugins/dev9null/CMakeLists.txt +++ b/plugins/dev9null/CMakeLists.txt @@ -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}") diff --git a/plugins/onepad/CMakeLists.txt b/plugins/onepad/CMakeLists.txt index b0626bbe89..1dba75d852 100644 --- a/plugins/onepad/CMakeLists.txt +++ b/plugins/onepad/CMakeLists.txt @@ -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}") diff --git a/plugins/spu2-x/src/CMakeLists.txt b/plugins/spu2-x/src/CMakeLists.txt index a8399ddfd1..9a6088ddf4 100644 --- a/plugins/spu2-x/src/CMakeLists.txt +++ b/plugins/spu2-x/src/CMakeLists.txt @@ -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}") diff --git a/plugins/zerospu2/CMakeLists.txt b/plugins/zerospu2/CMakeLists.txt index 3bc60c0e82..6421bbce89 100644 --- a/plugins/zerospu2/CMakeLists.txt +++ b/plugins/zerospu2/CMakeLists.txt @@ -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}") diff --git a/plugins/zzogl-pg-cg/opengl/CMakeLists.txt b/plugins/zzogl-pg-cg/opengl/CMakeLists.txt index 2630cf1bb2..462186897c 100644 --- a/plugins/zzogl-pg-cg/opengl/CMakeLists.txt +++ b/plugins/zzogl-pg-cg/opengl/CMakeLists.txt @@ -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) diff --git a/plugins/zzogl-pg-cg/opengl/ZeroGSShaders/CMakeLists.txt b/plugins/zzogl-pg-cg/opengl/ZeroGSShaders/CMakeLists.txt index 370468e02c..4093c51444 100644 --- a/plugins/zzogl-pg-cg/opengl/ZeroGSShaders/CMakeLists.txt +++ b/plugins/zzogl-pg-cg/opengl/ZeroGSShaders/CMakeLists.txt @@ -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}") diff --git a/plugins/zzogl-pg/opengl/CMakeLists.txt b/plugins/zzogl-pg/opengl/CMakeLists.txt index bfbd3e881e..4a2aea095b 100644 --- a/plugins/zzogl-pg/opengl/CMakeLists.txt +++ b/plugins/zzogl-pg/opengl/CMakeLists.txt @@ -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) diff --git a/plugins/zzogl-pg/opengl/ZeroGSShaders/CMakeLists.txt b/plugins/zzogl-pg/opengl/ZeroGSShaders/CMakeLists.txt index 143a487c94..4b428bd9f8 100644 --- a/plugins/zzogl-pg/opengl/ZeroGSShaders/CMakeLists.txt +++ b/plugins/zzogl-pg/opengl/ZeroGSShaders/CMakeLists.txt @@ -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 diff --git a/tools/bin2cpp/CMakeLists.txt b/tools/bin2cpp/CMakeLists.txt index db42d98f59..16896200d9 100644 --- a/tools/bin2cpp/CMakeLists.txt +++ b/tools/bin2cpp/CMakeLists.txt @@ -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)