From cbb20004005d78c2dde8700071130d542567be57 Mon Sep 17 00:00:00 2001 From: arcum42 Date: Thu, 21 Jan 2010 15:12:50 +0000 Subject: [PATCH] Commit a modified copy of the CMake files from issue 513. (Note: work in progress. Not currently for general use. Builds made using cmake are currently not supported, and unlikely to work properly.) git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2464 96395faa-99c1-11dd-bbfe-3dabce05a288 --- 3rdparty/CMakeLists.txt | 18 + 3rdparty/SoundTouch/CMakeLists.txt | 53 +++ 3rdparty/bzip2/CMakeLists.txt | 42 ++ 3rdparty/zlib/CMakeLists.txt | 54 +++ CMakeLists.txt | 64 +++ cmake/FindCg.cmake | 72 ++++ cmake/FindGlew.cmake | 47 +++ cmake/FindSoundTouch.cmake | 26 ++ cmake/Pcsx2Utils.cmake | 56 +++ cmake/SearchForStuff.cmake | 249 +++++++++++ common/CMakeLists.txt | 5 + common/src/CMakeLists.txt | 7 + common/src/Utilities/CMakeLists.txt | 105 +++++ common/src/x86emitter/CMakeLists.txt | 93 +++++ pcsx2/CMakeLists.txt | 597 +++++++++++++++++++++++++++ plugins/CDVDnull/CMakeLists.txt | 81 ++++ plugins/CMakeLists.txt | 117 ++++++ plugins/FWnull/CMakeLists.txt | 79 ++++ plugins/GSnull/CMakeLists.txt | 101 +++++ plugins/PadNull/CMakeLists.txt | 87 ++++ plugins/SPU2null/CMakeLists.txt | 83 ++++ plugins/USBnull/CMakeLists.txt | 79 ++++ plugins/dev9null/CMakeLists.txt | 69 ++++ plugins/onepad/CMakeLists.txt | 90 ++++ plugins/spu2-x/CMakeLists.txt | 2 + plugins/zerogs/CMakeLists.txt | 7 + plugins/zerogs/dx/CMakeLists.txt | 81 ++++ plugins/zerogs/opengl/CMakeLists.txt | 131 ++++++ plugins/zerogs/opengl/zerogs.cpp | 2 +- plugins/zerospu2/CMakeLists.txt | 95 +++++ tools/CMakeLists.txt | 4 + tools/bin2cpp/CMakeLists.txt | 46 +++ 32 files changed, 2641 insertions(+), 1 deletion(-) create mode 100644 3rdparty/CMakeLists.txt create mode 100644 3rdparty/SoundTouch/CMakeLists.txt create mode 100644 3rdparty/bzip2/CMakeLists.txt create mode 100644 3rdparty/zlib/CMakeLists.txt create mode 100644 CMakeLists.txt create mode 100644 cmake/FindCg.cmake create mode 100644 cmake/FindGlew.cmake create mode 100644 cmake/FindSoundTouch.cmake create mode 100644 cmake/Pcsx2Utils.cmake create mode 100644 cmake/SearchForStuff.cmake create mode 100644 common/CMakeLists.txt create mode 100644 common/src/CMakeLists.txt create mode 100644 common/src/Utilities/CMakeLists.txt create mode 100644 common/src/x86emitter/CMakeLists.txt create mode 100644 pcsx2/CMakeLists.txt create mode 100644 plugins/CDVDnull/CMakeLists.txt create mode 100644 plugins/CMakeLists.txt create mode 100644 plugins/FWnull/CMakeLists.txt create mode 100644 plugins/GSnull/CMakeLists.txt create mode 100644 plugins/PadNull/CMakeLists.txt create mode 100644 plugins/SPU2null/CMakeLists.txt create mode 100644 plugins/USBnull/CMakeLists.txt create mode 100644 plugins/dev9null/CMakeLists.txt create mode 100644 plugins/onepad/CMakeLists.txt create mode 100644 plugins/spu2-x/CMakeLists.txt create mode 100644 plugins/zerogs/CMakeLists.txt create mode 100644 plugins/zerogs/dx/CMakeLists.txt create mode 100644 plugins/zerogs/opengl/CMakeLists.txt create mode 100644 plugins/zerospu2/CMakeLists.txt create mode 100644 tools/CMakeLists.txt create mode 100644 tools/bin2cpp/CMakeLists.txt diff --git a/3rdparty/CMakeLists.txt b/3rdparty/CMakeLists.txt new file mode 100644 index 0000000000..b84b58fba4 --- /dev/null +++ b/3rdparty/CMakeLists.txt @@ -0,0 +1,18 @@ + +# make bzip2 +# build local bzip2 +if(localBZip2) + add_subdirectory(bzip2) +endif(localBZip2) + +# make zlib +# build local zlib +if(localZLIB) + add_subdirectory(zlib) +endif(localZLIB) + +# make SoundTouch +if(localSoundTouch) + add_subdirectory(SoundTouch) +endif(localSoundTouch) + diff --git a/3rdparty/SoundTouch/CMakeLists.txt b/3rdparty/SoundTouch/CMakeLists.txt new file mode 100644 index 0000000000..fbe0401d2d --- /dev/null +++ b/3rdparty/SoundTouch/CMakeLists.txt @@ -0,0 +1,53 @@ +# SoundTouch library + +# library name +set(SoundTouchName SoundTouch) + +# variable with all sources of this library +set(SoundTouchSources + AAFilter.cpp + FIFOSampleBuffer.cpp + FIRFilter.cpp + RateTransposer.cpp + SoundTouch.cpp + TDStretch.cpp + WavFile.cpp + cpu_detect_x86_gcc.cpp + mmx_optimized.cpp + sse_optimized.cpp) + +# variable with all headers of this library +set(SoundTouchHeaders + AAFilter.h + BPMDetect.h + FIFOSampleBuffer.h + FIFOSamplePipe.h + FIRFilter.h + RateTransposer.h + SITypes.h + SoundTouch.h + TDStretch.h + WavFile.h + cpu_detect.h) + +# add library +add_library(${SoundTouchName} STATIC ${SoundTouchSources}) + +# Debug - Build +if(CMAKE_BUILD_TYPE STREQUAL Debug) + set(CMAKE_C_FLAGS_DEBUG "-g -O0 -march=athlon-xp -march=prescott") + set(CMAKE_CXX_FLAGS_DEBUG "-g -O0 -march=athlon-xp -march=prescott") +endif(CMAKE_BUILD_TYPE STREQUAL Debug) + +# Devel - Build +if(CMAKE_BUILD_TYPE STREQUAL Devel) + set(CMAKE_C_FLAGS_DEVEL "-O1 -g -W -march=athlon-xp -march=prescott") + set(CMAKE_CXX_FLAGS_DEVEL "-O1 -g -W -march=athlon-xp -march=prescott") +endif(CMAKE_BUILD_TYPE STREQUAL Devel) + +# Release - Build +if(CMAKE_BUILD_TYPE STREQUAL Release) + set(CMAKE_C_FLAGS_RELEASE "-fexpensive-optimizations -O3 -Os -W -march=athlon-xp -march=prescott") + set(CMAKE_CXX_FLAGS_RELEASE "-fexpensive-optimizations -O3 -Os -W -march=athlon-xp -march=prescott") +endif(CMAKE_BUILD_TYPE STREQUAL Release) + diff --git a/3rdparty/bzip2/CMakeLists.txt b/3rdparty/bzip2/CMakeLists.txt new file mode 100644 index 0000000000..9f28638e41 --- /dev/null +++ b/3rdparty/bzip2/CMakeLists.txt @@ -0,0 +1,42 @@ +# bzip2 library + +# library name +set(bzip2Name bzip2) + +# variable with all sources of this library +set(bzip2Sources + blocksort.c + bzlib.c + compress.c + crctable.c + decompress.c + huffman.c + randtable.c) + +# variable with all headers of this library +set(bzip2Headers + bzlib.h + bzlib_private.h) + +# add library +add_library(${bzip2Name} STATIC ${bzip2Sources} ${bzip2Headers}) + +# Debug - Build +if(CMAKE_BUILD_TYPE STREQUAL Debug) + set(CMAKE_C_FLAGS_DEBUG "-g -O0 -march=athlon-xp -march=prescott") + set(CMAKE_CXX_FLAGS_DEBUG "-g -O0 -march=athlon-xp -march=prescott") +endif(CMAKE_BUILD_TYPE STREQUAL Debug) + +# Devel - Build +if(CMAKE_BUILD_TYPE STREQUAL Devel) + set(CMAKE_C_FLAGS_DEVEL "-O1 -g -W -march=athlon-xp -march=prescott") + set(CMAKE_CXX_FLAGS_DEVEL "-O1 -g -W -march=athlon-xp -march=prescott") +endif(CMAKE_BUILD_TYPE STREQUAL Devel) + +# Release - Build +if(CMAKE_BUILD_TYPE STREQUAL Release) + set(CMAKE_C_FLAGS_RELEASE "-fexpensive-optimizations -O3 -Os -W -march=athlon-xp -march=prescott") + set(CMAKE_CXX_FLAGS_RELEASE "-fexpensive-optimizations -O3 -Os -W -march=athlon-xp -march=prescott") +endif(CMAKE_BUILD_TYPE STREQUAL Release) + + diff --git a/3rdparty/zlib/CMakeLists.txt b/3rdparty/zlib/CMakeLists.txt new file mode 100644 index 0000000000..759de55360 --- /dev/null +++ b/3rdparty/zlib/CMakeLists.txt @@ -0,0 +1,54 @@ +# zlib library + +# library name +set(zlibName zlib) + +# variable with all sources of this library +set(zlibSources + adler32.c + compress.c + crc32.c + deflate.c + gzio.c + infback.c + inffast.c + inflate.c + inftrees.c + trees.c + uncompr.c + zutil.c) + +# variable with all headers of this library +set(zlibHeaders + crc32.h + deflate.h + inffast.h + inffixed.h + inflate.h + inftrees.h + trees.h + zconf.h + zlib.h + zutil.h) + +# add library +add_library(${zlibName} STATIC ${zlibSources} ${zlibHeaders}) + +# Debug - Build +if(CMAKE_BUILD_TYPE STREQUAL Debug) + set(CMAKE_C_FLAGS_DEBUG "-W -g -O0") + set(CMAKE_CXX_FLAGS_DEBUG "-W -g -O0") +endif(CMAKE_BUILD_TYPE STREQUAL Debug) + +# Devel - Build +if(CMAKE_BUILD_TYPE STREQUAL Devel) + set(CMAKE_C_FLAGS_DEVEL "-O2 -W") + set(CMAKE_CXX_FLAGS_DEVEL "-O2 -W") +endif(CMAKE_BUILD_TYPE STREQUAL Devel) + +# Release - Build +if(CMAKE_BUILD_TYPE STREQUAL Release) + set(CMAKE_C_FLAGS_RELEASE "-fexpensive-optimizations -O3 -W") + set(CMAKE_CXX_FLAGS_RELEASE "-fexpensive-optimizations -O3 -W") +endif(CMAKE_BUILD_TYPE STREQUAL Release) + diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000000..988459412a --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,64 @@ + +# Project Name +project(Pcsx2) + +# need cmake version >=2.6 +cmake_minimum_required(VERSION 2.6) + +# include modules +include(${PROJECT_SOURCE_DIR}/cmake/Pcsx2Utils.cmake) +include(${PROJECT_SOURCE_DIR}/cmake/SearchForStuff.cmake) + +#------------------------------------------------------------------------------- +# if no build type is set, use Debug as default +#------------------------------------------------------------------------------- +if(CMAKE_BUILD_TYPE STREQUAL "") + set(CMAKE_BUILD_TYPE Debug) + message(STATUS "BuildType set to Debug!!! by default") +endif(CMAKE_BUILD_TYPE STREQUAL "") +#------------------------------------------------------------------------------- + +# add additional project-wide include directories +include_directories(${PROJECT_SOURCE_DIR}/3rdparty + ${PROJECT_SOURCE_DIR}/common/include + ${PROJECT_SOURCE_DIR}/common/include/Utilities + ${PROJECT_SOURCE_DIR}/common/include/x86emitter) + +# make 3rdParty +add_subdirectory(3rdparty) + +# make common +add_subdirectory(common) + +# make tools +add_subdirectory(tools) + +# make pcsx2 +add_subdirectory(pcsx2) + +# make plugins +add_subdirectory(plugins) + +#------------------------------------------------------------------------------- +# Resources +#------------------------------------------------------------------------------- +# This target is used to convert all binary Resources to c/c++-Header files. +# It is always considered as out-of-date, so it is build every time. +#------------------------------------------------------------------------------- +# add resources here +set(resourceList AppIcon16.png + AppIcon32.png + AppIcon64.png + BackgroundLogo.png + ButtonIcon_Camera.png + ConfigIcon_Cpu.png + ConfigIcon_Gamefixes.png + ConfigIcon_Paths.png + ConfigIcon_Plugins.png + ConfigIcon_Speedhacks.png + ConfigIcon_Video.png + Dualshock.jpg) + +createResourceTarget(${resourceList}) +#------------------------------------------------------------------------------- + diff --git a/cmake/FindCg.cmake b/cmake/FindCg.cmake new file mode 100644 index 0000000000..d08f517a02 --- /dev/null +++ b/cmake/FindCg.cmake @@ -0,0 +1,72 @@ +# Find a NVidia Cg Toolkit installation +# This module finds a NVidia Cg Toolkit installation. + +# CG_FOUND found Cg +# CG_INCLUDE_DIRS include path to cg.h +# CG_LIBRARIES path to Cg libs +# CG_COMPILER path to Cg compiler + +# find Cg on Windows +if(WIN32) + # find Cg compiler + find_program(CG_COMPILER cgc PATHS + "C:/Program Files/NVIDIA Corporation/cg/bin" + DOC "Path to the Cg compiler.") + + # find Cg include + find_path(CG_INCLUDE_DIRS NAMES Cg/cg.h GL/glext.h PATHS + "C:/Program Files/NVIDIA Corporation/cg/include" + DOC "Path to the Cg/GL includes.") + + # find Cg libraries + # Cg library + find_library(CG_LIBRARY NAMES Cg PATHS + "C:/Program Files/NVIDIA Corporation/cg/lib" + DOC "Path to the Cg library.") + + # Cg GL library + find_library(CG_GL_LIBRARY NAMES CgGL PATHS + "C:/Program Files/NVIDIA Corporation/cg/lib" + DOC "Path to the CgGL library.") + + set(CG_LIBRARIES ${CG_LIBRARY} ${CG_GL_LIBRARY}) + +else(WIN32) # Unix based OS + # find Cg compiler + find_program(CG_COMPILER cgc PATHS + /usr/bin + /usr/local/bin + DOC "Path to the Cg compiler.") + + # find Cg include + find_path(CG_INCLUDE_DIRS NAMES Cg/cg.h GL/glext.h PATHS + /usr/include + /usr/local/include + /opt/nvidia-cg-toolkit/include + DOC "Path to the Cg/GL includes.") + + # find Cg libraries + # Cg library + find_library(CG_LIBRARY NAMES Cg PATHS + /usr/include + /usr/local/include + /opt/nvidia-cg-toolkit/include + DOC "Path to the Cg library.") + + # Cg GL library + find_library(CG_GL_LIBRARY NAMES CgGL PATHS + /usr/include + /usr/local/include + /opt/nvidia-cg-toolkit/include + DOC "Path to the CgGL library.") + + set(CG_LIBRARIES ${CG_LIBRARY} ${CG_GL_LIBRARY}) +endif(WIN32) + +# handle the QUIETLY and REQUIRED arguments and set CG_FOUND to TRUE if +# all listed variables are TRUE +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(Cg DEFAULT_MSG CG_LIBRARIES CG_INCLUDE_DIRS) + +mark_as_advanced(CG_FOUND CG_INCLUDE_DIRS CG_LIBRARIES CG_COMPILER) + diff --git a/cmake/FindGlew.cmake b/cmake/FindGlew.cmake new file mode 100644 index 0000000000..4850512af2 --- /dev/null +++ b/cmake/FindGlew.cmake @@ -0,0 +1,47 @@ +# +# Try to find GLEW library and include path. +# Once done this will define +# +# GLEW_FOUND +# GLEW_INCLUDE_PATH +# GLEW_LIBRARY +# + +IF (WIN32) + FIND_PATH( GLEW_INCLUDE_PATH GL/glew.h + $ENV{PROGRAMFILES}/GLEW/include + ${PROJECT_SOURCE_DIR}/src/nvgl/glew/include + DOC "The directory where GL/glew.h resides") + FIND_LIBRARY( GLEW_LIBRARY + NAMES glew GLEW glew32 glew32s + PATHS + $ENV{PROGRAMFILES}/GLEW/lib + ${PROJECT_SOURCE_DIR}/src/nvgl/glew/bin + ${PROJECT_SOURCE_DIR}/src/nvgl/glew/lib + DOC "The GLEW library") +ELSE (WIN32) + FIND_PATH( GLEW_INCLUDE_PATH GL/glew.h + /usr/include + /usr/local/include + /sw/include + /opt/local/include + DOC "The directory where GL/glew.h resides") + FIND_LIBRARY( GLEW_LIBRARY + NAMES GLEW glew + PATHS + /usr/lib64 + /usr/lib + /usr/local/lib64 + /usr/local/lib + /sw/lib + /opt/local/lib + DOC "The GLEW library") +ENDIF (WIN32) + +IF (GLEW_INCLUDE_PATH) + SET( GLEW_FOUND 1 CACHE STRING "Set to 1 if GLEW is found, 0 otherwise") +ELSE (GLEW_INCLUDE_PATH) + SET( GLEW_FOUND 0 CACHE STRING "Set to 1 if GLEW is found, 0 otherwise") +ENDIF (GLEW_INCLUDE_PATH) + +MARK_AS_ADVANCED( GLEW_FOUND ) \ No newline at end of file diff --git a/cmake/FindSoundTouch.cmake b/cmake/FindSoundTouch.cmake new file mode 100644 index 0000000000..82578f9c74 --- /dev/null +++ b/cmake/FindSoundTouch.cmake @@ -0,0 +1,26 @@ +# 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/SoundTouch.h) + +# finally the library itself +find_library(tmpLibBPM NAMES BPM SoundTouch) +find_library(tmpLibST NAMES SoundTouch) +set(SoundTouch_LIBRARIES ${tmpLibBPM} ${tmpLibST}) + +# 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) + diff --git a/cmake/Pcsx2Utils.cmake b/cmake/Pcsx2Utils.cmake new file mode 100644 index 0000000000..38097cea46 --- /dev/null +++ b/cmake/Pcsx2Utils.cmake @@ -0,0 +1,56 @@ +# additonal cmake macros and functions + +#------------------------------------------------------------------------------- +# createResourceTarget +#------------------------------------------------------------------------------- +# This function is used to generate header files, used as resources. +# A list of Resources taken as input parameter. +#------------------------------------------------------------------------------- +function(createResourceTarget) + # working directory + set(workdir ${PROJECT_SOURCE_DIR}/pcsx2/gui/Resources) + + # create dummy target depending on bin2cpp + add_custom_target(Resources + DEPENDS bin2cpp) + + # create a custom command for every resource file + foreach(entry IN LISTS ARGV) + # create custom command and assign to target Resources + add_custom_command(TARGET Resources POST_BUILD + COMMAND bin2cpp ${entry} + WORKING_DIRECTORY ${workdir}) + endforeach(entry) +endfunction(createResourceTarget) +#------------------------------------------------------------------------------- + + +#------------------------------------------------------------------------------- +# detectOperatingSystem +#------------------------------------------------------------------------------- +# This function detects on which OS cmake is run and set a flag to control the +# build process. Supported OS: Linux, MacOSX, Windows +#------------------------------------------------------------------------------- +function(detectOperatingSystem) + # nothing detected yet + set(Linux FALSE PARENT_SCOPE) + set(MacOSX FALSE PARENT_SCOPE) + set(Windows FALSE PARENT_SCOPE) + + # check if we are on Linux + if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux") + set(Linux TRUE PARENT_SCOPE) + endif(${CMAKE_SYSTEM_NAME} STREQUAL "Linux") + + # check if we are on MacOSX + if(APPLE) + set(MacOSX TRUE PARENT_SCOPE) + endif(APPLE) + + # check if we are on Windows + if(${CMAKE_SYSTEM_NAME} STREQUAL "Windows") + set(Windows TRUE PARENT_SCOPE) + endif(${CMAKE_SYSTEM_NAME} STREQUAL "Windows") +endfunction(detectOperatingSystem) +#------------------------------------------------------------------------------- + diff --git a/cmake/SearchForStuff.cmake b/cmake/SearchForStuff.cmake new file mode 100644 index 0000000000..4482059900 --- /dev/null +++ b/cmake/SearchForStuff.cmake @@ -0,0 +1,249 @@ +# Search for additional software. + +#------------------------------------------------------------------------------- +# Minmal required version of libraries +#------------------------------------------------------------------------------- +set(minimal_wxWidgets_version 2.8.0) +set(minimal_GTK2_version 2.10) +set(minimal_SDL_version 1.2) + +# to set the proper dependencies and decide which plugins should be build we +# need to know on which OS we are currenty working/running +detectOperatingSystem() + +#------------------------------------------------------------------------------- +# FindStuff +#------------------------------------------------------------------------------- +if(Linux) + # gtk required + find_package(GTK2 REQUIRED gtk) + + # gtk found + if(GTK2_FOUND) + # add gtk include directories + include_directories(${GTK2_INCLUDE_DIRS}) + #else(GTK2_FOUND) + # message(FATAL_ERROR "GTK2 libraries and include files not found. + # Please install GTK2 version ${minimal_GTK2_version} or higher.") + endif(GTK2_FOUND) +endif(Linux) + +#------------------------------------------------------------ + +# wx required +find_package(wxWidgets REQUIRED base core adv) + +# wx found +if(wxWidgets_FOUND) + include(${wxWidgets_USE_FILE}) +#else(wxWidgets_FOUND) +# message(FATAL_ERROR "wxWidgets libraries and include files not found.\ +# Please install wxWidgets version ${minimal_wxWidgets_version} \ +# or higher.") +endif(wxWidgets_FOUND) + +#------------------------------------------------------------ + +# zlib required +find_package(ZLIB) + +# if we found zlib on the system, use it else use local one +if(ZLIB_FOUND) + # add zlib include directories + include_directories(${ZLIB_INCLUDE_DIRS}) +else(ZLIB_FOUND) + # use locale one + set(localZLIB TRUE) +endif(ZLIB_FOUND) + +#------------------------------------------------------------ + +# bzip2 optional +find_package(BZip2) + +# if we found bzip2 on the system, +# use it else use local one +if(BZIP2_FOUND) + # add zlib include directories + include_directories(${BZIP2_INCLUDE_DIR}) +else(BZIP2_FOUND) + # use locale one + set(localBZip2 TRUE) +endif(BZIP2_FOUND) + +#------------------------------------------------------------ + +# OpenGL optional +find_package(OpenGL) + +# opengl found +if(OPENGL_FOUND) + # add OpenGL include directories + include_directories(${OPENGL_INCLUDE_DIR}) +endif(OPENGL_FOUND) + +#------------------------------------------------------------ + +# SDL optional +find_package(SDL) + +# SDL found +if(SDL_FOUND) + # add SDL include directories + include_directories(${SDL_INCLUDE_DIR}) +endif(SDL_FOUND) + +#------------------------------------------------------------ + +include(${PROJECT_SOURCE_DIR}/cmake/FindSoundTouch.cmake) + +# found SoundTouch +if(SOUNDTOUCH_FOUND) + # add SoundTouch include directories + include_directories(${SoundTouch_INCLUDE_DIR}) +else(SOUNDTOUCH_FOUND) + # use local one + set(localSoundTouch TRUE) + + # found + set(SOUNDTOUCH_FOUND TRUE) +endif(SOUNDTOUCH_FOUND) + +#------------------------------------------------------------ + +include(${PROJECT_SOURCE_DIR}/cmake/FindCg.cmake) + +# found Cg +if(CG_FOUND) + # add Cg include directories + include_directories(${CG_INCLUDE_DIR}) +endif(CG_FOUND) + +#------------------------------------------------------------ + +# ALSA optional +find_package(ALSA) + +# ALSA found +if(ALSA_FOUND) + # add ALSA include directories + include_directories(${ALSA_INCLUDE_DIRS}) +endif(ALSA_FOUND) + +#------------------------------------------------------------ + +#------------------------------------------------------------------------------- +# Plugins +#------------------------------------------------------------------------------- +# Check all plugins for additional dependencies. +# If all dependencies of a plugin are available, including OS, the plugin will +# be build. +#------------------------------------------------------------------------------- +# null plugins should work on every platform, enable them all +#--------------------------------------- +# CDVDnull +#--------------------------------------- +set(CDVDnull TRUE) +#--------------------------------------- + +#--------------------------------------- +# dev9null +#--------------------------------------- +set(dev9null TRUE) +#--------------------------------------- + +#--------------------------------------- +# FWnull +#--------------------------------------- +set(FWnull TRUE) +#--------------------------------------- + +#--------------------------------------- +# GSnull +#--------------------------------------- +set(GSnull TRUE) +#--------------------------------------- + +#--------------------------------------- +# PadNull +#--------------------------------------- +set(PadNull TRUE) +#--------------------------------------- + +#--------------------------------------- +# SPU2null +#--------------------------------------- +set(SPU2null TRUE) +#--------------------------------------- + +#--------------------------------------- +# USBnull +#--------------------------------------- +set(USBnull TRUE) +#--------------------------------------- + +#--------------------------------------- +# onepad +#--------------------------------------- +# requires: SDL +#--------------------------------------- +if(SDL_FOUND) + set(onepad TRUE) +else(SDL_FOUND) + set(onepad FALSE) +endif(SDL_FOUND) +#--------------------------------------- + +#--------------------------------------- +# spu2-x +#--------------------------------------- +# requires: SoundTouch +#--------------------------------------- +if(SOUNDTOUCH_FOUND) + set(spu2-x TRUE) +else(SOUNDTOUCH_FOUND) + set(spu2-x FALSE) +endif(SOUNDTOUCH_FOUND) +#--------------------------------------- + +#--------------------------------------- +# zerogs +#--------------------------------------- +# requires:OpenGL +#--------------------------------------- +if(OPENGL_FOUND) + set(zerogs TRUE) +else(OPENGL_FOUND) + set(zerogs FALSE) +endif(OPENGL_FOUND) +#--------------------------------------- + +#--------------------------------------- +# zerospu2 +#--------------------------------------- +# requires: SoundTouch +# ALSA +#--------------------------------------- +if(SOUNDTOUCH_FOUND AND ALSA_FOUND) + set(zerospu2 TRUE) +else(SOUNDTOUCH_FOUND AND ALSA_FOUND) + set(zerospu2 FALSE) +endif(SOUNDTOUCH_FOUND AND ALSA_FOUND) +#--------------------------------------- + +#------------------------------------------------------------------------------- +# [TODO] Write CMakeLists.txt for these plugins. +set(cdvdGigaherz FALSE) +set(CDVDiso FALSE) +set(CDVDisoEFP FALSE) +set(CDVDlinuz FALSE) +set(CDVDolio FALSE) +set(CDVDpeops FALSE) +set(GSdx FALSE) +set(LilyPad FALSE) +set(PeopsSPU2 FALSE) +set(SSSPSXPAD FALSE) +set(xpad FALSE) +set(zeropad FALSE) +#------------------------------------------------------------------------------- + diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt new file mode 100644 index 0000000000..84e33ce195 --- /dev/null +++ b/common/CMakeLists.txt @@ -0,0 +1,5 @@ + +# src +add_subdirectory(src) + + diff --git a/common/src/CMakeLists.txt b/common/src/CMakeLists.txt new file mode 100644 index 0000000000..b0f99539c1 --- /dev/null +++ b/common/src/CMakeLists.txt @@ -0,0 +1,7 @@ + +# make Utilities +add_subdirectory(Utilities) + +# make x86emitter +add_subdirectory(x86emitter) + diff --git a/common/src/Utilities/CMakeLists.txt b/common/src/Utilities/CMakeLists.txt new file mode 100644 index 0000000000..f83e6131f2 --- /dev/null +++ b/common/src/Utilities/CMakeLists.txt @@ -0,0 +1,105 @@ +# Utilities library + +# library name +set(UtilitiesName Utilities) + +# variable with all sources of this library +set(UtilitiesSources + ../../include/Utilities/EventSource.inl + ../../include/Utilities/TlsVariable.inl + AlignedMalloc.cpp + CheckedStaticBox.cpp + Console.cpp + EventSource.cpp + Exceptions.cpp + HashTools.cpp + Linux/LnxHostSys.cpp + Linux/LnxMisc.cpp + Linux/LnxThreads.cpp + Mutex.cpp + PathUtils.cpp + PrecompiledHeader.cpp + pxCheckBox.cpp + pxRadioPanel.cpp + pxStaticText.cpp + Semaphore.cpp + StringHelpers.cpp + ThreadTools.cpp + vssprintf.cpp + wxGuiTools.cpp + wxHelpers.cpp +# x86/MemcpyFast.cpp + ) + +# collect .S files +set(UtilitiesSSources + x86/MemcpyFast.S) + +# variable with all headers of this library +set(UtilitiesHeaders + ../../include/Utilities/Assertions.h + ../../include/Utilities/CheckedStaticBox.h + ../../include/Utilities/Console.h + ../../include/Utilities/Dependencies.h + ../../include/Utilities/EventSource.h + ../../include/Utilities/Exceptions.h + ../../include/Utilities/FixedPointTypes.h + ../../include/Utilities/General.h + ../../include/Utilities/HashMap.h + ../../include/Utilities/lnx_memzero.h + ../../include/Utilities/MemcpyFast.h + ../../include/Utilities/Path.h + ../../include/Utilities/pxCheckBox.h + ../../include/Utilities/pxRadioPanel.h + ../../include/Utilities/pxStaticText.h + ../../include/Utilities/RedtapeWindows.h + ../../include/Utilities/SafeArray.h + ../../include/Utilities/ScopedPtr.h + ../../include/Utilities/StringHelpers.h + ../../include/Utilities/Threading.h + ../../include/Utilities/wxBaseTools.h + ../../include/Utilities/wxGuiTools.h + PrecompiledHeader.h) + +# change language of .S-files to c++ +set_source_files_properties(${UtilitiesSSources} PROPERTIES LANGUAGE CXX) + +# add library +add_library(${UtilitiesName} STATIC ${UtilitiesSources} ${UtilitiesHeaders} ${UtilitiesSSources}) + +# Debug - Build +if(CMAKE_BUILD_TYPE STREQUAL Debug) + set(CMAKE_C_FLAGS_DEBUG "-W -g -march=i486 -Wno-format -Wno-unused-parameter -Wno-unused-value -Wunused-variable -fno-guess-branch-probability -fno-dse -fno-tree-dse -fno-strict-aliasing -pipe -msse -msse2 -m32") + + set(CMAKE_CXX_FLAGS_DEBUG "-W -g -march=i486 -Wno-format -Wno-unused-parameter -Wno-unused-value -Wunused-variable -fno-guess-branch-probability -fno-dse -fno-tree-dse -fno-strict-aliasing -pipe -msse -msse2 -m32") + + # add defines + add_definitions(-DPCSX2_DEVBUILD -DPCSX2_DEBUG) +endif(CMAKE_BUILD_TYPE STREQUAL Debug) + +# Devel - Build +if(CMAKE_BUILD_TYPE STREQUAL Devel) + set(CMAKE_C_FLAGS_DEVEL "-fdefer-pop -fcprop-registers -fif-conversion -fif-conversion2 -ftree-ccp -ftree-dce -ftree-dominator-opts -ftree-ter -ftree-lrs -ftree-sra -ftree-copyrename -ftree-fre -ftree-ch -funit-at-a-time -fmerge-constants -fthread-jumps -fcrossjumping -foptimize-sibling-calls -fcse-follow-jumps -fcse-skip-blocks -fgcse -fgcse-lm -frerun-cse-after-loop -fcaller-saves -fpeephole2 -fsched-interblock -fsched-spec -fregmove -fstrict-overflow -fdelete-null-pointer-checks -freorder-blocks -freorder-functions -falign-functions -falign-jumps -falign-loops -falign-labels -ftree-vrp -ftree-pre -march=i486 -Wno-format -Wno-unused-parameter -Wno-unused-value -Wunused-variable -fno-guess-branch-probability -fno-dse -fno-tree-dse -fno-strict-aliasing -pipe -msse -msse2 -m32") + + set(CMAKE_CXX_FLAGS_DEVEL "-fdefer-pop -fcprop-registers -fif-conversion -fif-conversion2 -ftree-ccp -ftree-dce -ftree-dominator-opts -ftree-ter -ftree-lrs -ftree-sra -ftree-copyrename -ftree-fre -ftree-ch -funit-at-a-time -fmerge-constants -fthread-jumps -fcrossjumping -foptimize-sibling-calls -fcse-follow-jumps -fcse-skip-blocks -fgcse -fgcse-lm -frerun-cse-after-loop -fcaller-saves -fpeephole2 -fsched-interblock -fsched-spec -fregmove -fstrict-overflow -fdelete-null-pointer-checks -freorder-blocks -freorder-functions -falign-functions -falign-jumps -falign-loops -falign-labels -ftree-vrp -ftree-pre -march=i486 -Wno-format -Wno-unused-parameter -Wno-unused-value -Wunused-variable -fno-guess-branch-probability -fno-dse -fno-tree-dse -fno-strict-aliasing -pipe -msse -msse2 -m32") + + # add defines + add_definitions(-DPCSX2_DEVBUILD -DPCSX2_DEBUG) +endif(CMAKE_BUILD_TYPE STREQUAL Devel) + +# Release - Build +if(CMAKE_BUILD_TYPE STREQUAL Release) + set(CMAKE_C_FLAGS_RELEASE "-fdefer-pop -fcprop-registers -fif-conversion -fif-conversion2 -ftree-ccp -ftree-dce -ftree-dominator-opts -ftree-ter -ftree-lrs -ftree-sra -ftree-copyrename -ftree-fre -ftree-ch -funit-at-a-time -fmerge-constants -fthread-jumps -fcrossjumping -foptimize-sibling-calls -fcse-follow-jumps -fcse-skip-blocks -fgcse -fgcse-lm -frerun-cse-after-loop -fcaller-saves -fpeephole2 -fsched-interblock -fsched-spec -fregmove -fstrict-overflow -fdelete-null-pointer-checks -freorder-blocks -freorder-functions -falign-functions -falign-jumps -falign-loops -falign-labels -ftree-vrp -ftree-pre -march=i486 -Wno-format -Wno-unused-parameter -Wno-unused-value -Wunused-variable -fno-guess-branch-probability -fno-dse -fno-tree-dse -fno-strict-aliasing -pipe -msse -msse2 -m32 -s") + + set(CMAKE_CXX_FLAGS_RELEASE "-fdefer-pop -fcprop-registers -fif-conversion -fif-conversion2 -ftree-ccp -ftree-dce -ftree-dominator-opts -ftree-ter -ftree-lrs -ftree-sra -ftree-copyrename -ftree-fre -ftree-ch -funit-at-a-time -fmerge-constants -fthread-jumps -fcrossjumping -foptimize-sibling-calls -fcse-follow-jumps -fcse-skip-blocks -fgcse -fgcse-lm -frerun-cse-after-loop -fcaller-saves -fpeephole2 -fsched-interblock -fsched-spec -fregmove -fstrict-overflow -fdelete-null-pointer-checks -freorder-blocks -freorder-functions -falign-functions -falign-jumps -falign-loops -falign-labels -ftree-vrp -ftree-pre -march=i486 -Wno-format -Wno-unused-parameter -Wno-unused-value -Wunused-variable -fno-guess-branch-probability -fno-dse -fno-tree-dse -fno-strict-aliasing -pipe -msse -msse2 -m32 -s") + + # add defines + add_definitions() +endif(CMAKE_BUILD_TYPE STREQUAL Release) + +# link target with wx +target_link_libraries(${UtilitiesName} ${wxWidgets_LIBRARIES}) + +# add additional include directories +include_directories(.) + diff --git a/common/src/x86emitter/CMakeLists.txt b/common/src/x86emitter/CMakeLists.txt new file mode 100644 index 0000000000..d516163451 --- /dev/null +++ b/common/src/x86emitter/CMakeLists.txt @@ -0,0 +1,93 @@ +# x86emitter library + +# library name +set(x86emitterName x86emitter) + +# variable with all sources of this library +set(x86emitterSources + ../../include/x86emitter/inlines.inl + 3dnow.cpp + cpudetect.cpp + fpu.cpp + groups.cpp + jmp.cpp + legacy.cpp + legacy_sse.cpp + LnxCpuDetect.cpp + movs.cpp + PrecompiledHeader.cpp + simd.cpp + tools.cpp + x86emitter.cpp) + +# variable with all headers of this library +set(x86emitterHeaders + ../../include/x86emitter/implement/dwshift.h + ../../include/x86emitter/implement/group1.h + ../../include/x86emitter/implement/group2.h + ../../include/x86emitter/implement/group3.h + ../../include/x86emitter/implement/helpers.h + ../../include/x86emitter/implement/incdec.h + ../../include/x86emitter/implement/jmpcall.h + ../../include/x86emitter/implement/movs.h + ../../include/x86emitter/implement/simd_arithmetic.h + ../../include/x86emitter/implement/simd_comparisons.h + ../../include/x86emitter/implement/simd_helpers.h + ../../include/x86emitter/implement/simd_moremovs.h + ../../include/x86emitter/implement/simd_shufflepack.h + ../../include/x86emitter/implement/simd_templated_helpers + ../../include/x86emitter/implement/test.h + ../../include/x86emitter/implement/xchg.h +# ../../include/x86emitter/implement/xmm/ + ../../include/x86emitter/instructions.h + ../../include/x86emitter/internal.h + ../../include/x86emitter/legacy_instructions.h + ../../include/x86emitter/legacy_internal.h + ../../include/x86emitter/legacy_types.h + ../../include/x86emitter/macros.h + ../../include/x86emitter/sse_helpers.h + ../../include/x86emitter/tools.h + ../../include/x86emitter/x86emitter.h + ../../include/x86emitter/x86types.h + PrecompiledHeader.h) + +# add library +add_library(${x86emitterName} STATIC ${x86emitterSources} ${x86emitterHeaders}) + +# Debug - Build +if(CMAKE_BUILD_TYPE STREQUAL Debug) + set(CMAKE_C_FLAGS_DEBUG "-march=i486 -Wno-format -Wno-unused-parameter -Wno-unused-value -Wunused-variable -fno-guess-branch-probability -fno-dse -fno-tree-dse -fno-strict-aliasing -pipe -msse -msse2 -m32 -W -g") + + set(CMAKE_CXX_FLAGS_DEBUG "-march=i486 -Wno-format -Wno-unused-parameter -Wno-unused-value -Wunused-variable -fno-guess-branch-probability -fno-dse -fno-tree-dse -fno-strict-aliasing -pipe -msse -msse2 -m32 -W -g") + + # add defines + add_definitions(-DPCSX2_DEVBUILD -DPCSX2_DEBUG) +endif(CMAKE_BUILD_TYPE STREQUAL Debug) + +# Devel - Build +if(CMAKE_BUILD_TYPE STREQUAL Devel) + set(CMAKE_C_FLAGS_DEVEL "-march=i486 -Wno-format -Wno-unused-parameter -Wno-unused-value -Wunused-variable -fno-guess-branch-probability -fno-dse -fno-tree-dse -fno-strict-aliasing -pipe -msse -msse2 -m32 -fdefer-pop -fcprop-registers -fif-conversion -fif-conversion2 -ftree-ccp -ftree-dce -ftree-dominator-opts -ftree-ter -ftree-lrs -ftree-sra -ftree-copyrename -ftree-fre -ftree-ch -funit-at-a-time -fmerge-constants -fthread-jumps -fcrossjumping -foptimize-sibling-calls -fcse-follow-jumps -fcse-skip-blocks -fgcse -fgcse-lm -frerun-cse-after-loop -fcaller-saves -fpeephole2 -fsched-interblock -fsched-spec -fregmove -fstrict-overflow -fdelete-null-pointer-checks -freorder-blocks -freorder-functions -falign-functions -falign-jumps -falign-loops -falign-labels -ftree-vrp -ftree-pre") + + set(CMAKE_CXX_FLAGS_DEVEL "-march=i486 -Wno-format -Wno-unused-parameter -Wno-unused-value -Wunused-variable -fno-guess-branch-probability -fno-dse -fno-tree-dse -fno-strict-aliasing -pipe -msse -msse2 -m32 -fdefer-pop -fcprop-registers -fif-conversion -fif-conversion2 -ftree-ccp -ftree-dce -ftree-dominator-opts -ftree-ter -ftree-lrs -ftree-sra -ftree-copyrename -ftree-fre -ftree-ch -funit-at-a-time -fmerge-constants -fthread-jumps -fcrossjumping -foptimize-sibling-calls -fcse-follow-jumps -fcse-skip-blocks -fgcse -fgcse-lm -frerun-cse-after-loop -fcaller-saves -fpeephole2 -fsched-interblock -fsched-spec -fregmove -fstrict-overflow -fdelete-null-pointer-checks -freorder-blocks -freorder-functions -falign-functions -falign-jumps -falign-loops -falign-labels -ftree-vrp -ftree-pre") + + # add defines + add_definitions(-DPCSX2_DEVBUILD -DPCSX2_DEBUG) +endif(CMAKE_BUILD_TYPE STREQUAL Devel) + +# Release - Build +if(CMAKE_BUILD_TYPE STREQUAL Release) + set(CMAKE_C_FLAGS_RELEASE "-march=i486 -Wno-format -Wno-unused-parameter -Wno-unused-value -Wunused-variable -fno-guess-branch-probability -fno-dse -fno-tree-dse -fno-strict-aliasing -pipe -msse -msse2 -m32 -fdefer-pop -fcprop-registers -fif-conversion -fif-conversion2 -ftree-ccp -ftree-dce -ftree-dominator-opts -ftree-ter -ftree-lrs -ftree-sra -ftree-copyrename -ftree-fre -ftree-ch -funit-at-a-time -fmerge-constants -fthread-jumps -fcrossjumping -foptimize-sibling-calls -fcse-follow-jumps -fcse-skip-blocks -fgcse -fgcse-lm -frerun-cse-after-loop -fcaller-saves -fpeephole2 -fsched-interblock -fsched-spec -fregmove -fstrict-overflow -fdelete-null-pointer-checks -freorder-blocks -freorder-functions -falign-functions -falign-jumps -falign-loops -falign-labels -ftree-vrp -ftree-pre -s") + + set(CMAKE_CXX_FLAGS_RELEASE "-march=i486 -Wno-format -Wno-unused-parameter -Wno-unused-value -Wunused-variable -fno-guess-branch-probability -fno-dse -fno-tree-dse -fno-strict-aliasing -pipe -msse -msse2 -m32 -fdefer-pop -fcprop-registers -fif-conversion -fif-conversion2 -ftree-ccp -ftree-dce -ftree-dominator-opts -ftree-ter -ftree-lrs -ftree-sra -ftree-copyrename -ftree-fre -ftree-ch -funit-at-a-time -fmerge-constants -fthread-jumps -fcrossjumping -foptimize-sibling-calls -fcse-follow-jumps -fcse-skip-blocks -fgcse -fgcse-lm -frerun-cse-after-loop -fcaller-saves -fpeephole2 -fsched-interblock -fsched-spec -fregmove -fstrict-overflow -fdelete-null-pointer-checks -freorder-blocks -freorder-functions -falign-functions -falign-jumps -falign-loops -falign-labels -ftree-vrp -ftree-pre -s") + + # add defines + add_definitions() +endif(CMAKE_BUILD_TYPE STREQUAL Release) + +# link target with wx +target_link_libraries(${x86emitterName} ${wxWidgets_LIBRARIES}) + +# add additional include directories +include_directories(../../include + ../../include/x86emitter) + diff --git a/pcsx2/CMakeLists.txt b/pcsx2/CMakeLists.txt new file mode 100644 index 0000000000..67f08801a0 --- /dev/null +++ b/pcsx2/CMakeLists.txt @@ -0,0 +1,597 @@ +# pcsx2 + +# set common flags +set(CommonFlags + -fno-guess-branch-probability + -fno-dse + -fno-tree-dse + -fno-strict-aliasing + -m32 + -march=i486 + -msse + -msse2 + -pipe + -Wno-format + -Wno-unused-parameter + -Wno-unused-value + -Wunused-variable) + +# set warning flags +set(DebugFlags + -W + -g) + +# set linker flags +set(LinkerFlags + -s) + +# set optimization flags +set(OptimizationFlags + -falign-functions + -falign-jumps + -falign-labels + -falign-loops + -fcaller-saves + -fcprop-registers + -fcrossjumping + -fcse-follow-jumps + -fcse-skip-blocks + -fdefer-pop + -fdelete-null-pointer-checks + -fgcse + -fgcse-lm + -fif-conversion + -fif-conversion2 + -fmerge-constants + -foptimize-sibling-calls + -fpeephole2 + -fregmove + -freorder-blocks + -freorder-functions + -frerun-cse-after-loop + -fsched-interblock + -fsched-spec + -fstrict-overflow + -fthread-jumps + -ftree-ccp + -ftree-ch + -ftree-copyrename + -ftree-dce + -ftree-dominator-opts + -ftree-fre + -ftree-lrs + -ftree-pre + -ftree-sra + -ftree-ter + -ftree-vrp + -funit-at-a-time) + +# Debug - Build +if(CMAKE_BUILD_TYPE STREQUAL Debug) + # clear flags + set(CMAKE_C_FLAGS_DEBUG) + set(CMAKE_CXX_FLAGS_DEBUG) + + # executable name + set(pcsx2Name pcsx2-dbg) + + # add defines + add_definitions(${CommonFlags} ${DebugFlags} -DPCSX2_DEVBUILD -DPCSX2_DEBUG -DWX_PRECOMP) +endif(CMAKE_BUILD_TYPE STREQUAL Debug) + +# Devel - Build +if(CMAKE_BUILD_TYPE STREQUAL Devel) + # clear flags + set(CMAKE_C_FLAGS_DEVEL) + set(CMAKE_CXX_FLAGS_DEVEL) + + # executable name + set(pcsx2Name pcsx2-dev) + + # add defines + add_definitions(${CommonFlags} ${OptimizationFlags} -DPCSX2_DEVBUILD -DPCSX2_DEBUG -DWX_PRECOMP) +endif(CMAKE_BUILD_TYPE STREQUAL Devel) + +# Release - Build +if(CMAKE_BUILD_TYPE STREQUAL Release) + # clear flags + set(CMAKE_C_FLAGS_RELEASE) + set(CMAKE_CXX_FLAGS_RELEASE) + + # executable name + set(pcsx2Name pcsx2) + + # add defines + add_definitions(${CommonFlags} ${OptimizationFlags} ${LinkerFlags} -DWX_PRECOMP) +endif(CMAKE_BUILD_TYPE STREQUAL Release) + +# variable with sources of this executable +set(pcsx2Sources + Cache.cpp + COP0.cpp + COP2.cpp + Counters.cpp + Dump.cpp + Elfheader.cpp + FiFo.cpp + FPU.cpp + Gif.cpp + GS.cpp + GSState.cpp + Hw.cpp + HwRead.cpp + HwWrite.cpp + Interpreter.cpp + IopBios.cpp + IopCounters.cpp + IopDma.cpp + IopHw.cpp + IopMem.cpp + IopSio2.cpp +# Mdec.cpp + Memory.cpp + MMI.cpp + MTGS.cpp + Patch.cpp + Pcsx2Config.cpp + pcsx2hostfs.cpp + PluginManager.cpp + PrecompiledHeader.cpp + R3000A.cpp + R3000AInterpreter.cpp + R3000AOpcodeTables.cpp + R5900.cpp + R5900OpcodeImpl.cpp + R5900OpcodeTables.cpp + RecoverySystem.cpp + SaveState.cpp + ShiftJisToUnicode.cpp + Sif.cpp + Sio.cpp + SourceLog.cpp + SPR.cpp + Stats.cpp + System.cpp + Vif0Dma.cpp + Vif1Dma.cpp + Vif.cpp + VifDma.cpp + VIFunpack.cpp + vtlb.cpp + VU0.cpp + VU0micro.cpp + VU0microInterp.cpp + VU1micro.cpp + VU1microInterp.cpp + VUflags.cpp + VUmicroMem.cpp + VUops.cpp) + +# variable with sources of this executable +set(pcsx2Headers + Cache.h + cheatscpp.h + Common.h + Config.h + COP0.h + Counters.h + Dmac.h + Dump.h + Elfheader.h + Gif.h + GS.h + Hardware.h + HostGui.h + Hw.h + IopBios.h + IopCommon.h + IopCounters.h + IopDma.h + IopHw.h + IopMem.h + IopSio2.h +# Mdec.h + Memory.h + MemoryTypes.h + NakedAsm.h + Patch.h + PathDefs.h + Plugins.h + PrecompiledHeader.h + R3000A.h + R5900Exceptions.h + R5900.h + R5900OpcodeTables.h + SamplProf.h + SaveState.h + Sifcmd.h + Sif.h + Sio.h + sio_internal.h + SPR.h + Stats.h + StringUtils.h + System.h + VifDma.h + VifDma_internal.h + Vif.h + vtlb.h + VUflags.h + VUmicro.h + VUops.h) + +# CDVD sources +set(pcsx2CDVDSources + CDVD/CdRom.cpp + CDVD/CDVDaccess.cpp + CDVD/CDVD.cpp + CDVD/CDVDisoReader.cpp + CDVD/IsoFileFormats.cpp + CDVD/IsoFileTools.cpp + CDVD/IsoFS/IsoFile.cpp + CDVD/IsoFS/IsoFSCDVD.cpp + CDVD/IsoFS/IsoFS.cpp) + +# CDVD headers +set(pcsx2CDVDHeaders + CDVD/CdRom.h + CDVD/CDVDaccess.h + CDVD/CDVD.h + CDVD/CDVD_internal.h + CDVD/CDVDisoReader.h + CDVD/IsoFileFormats.h + CDVD/IsoFileTools.h + CDVD/IsoFS/IsoDirectory.h + CDVD/IsoFS/IsoFileDescriptor.h + CDVD/IsoFS/IsoFile.h + CDVD/IsoFS/IsoFSCDVD.h + CDVD/IsoFS/IsoFS.h + CDVD/IsoFS/SectorSource.h) + +# DebugTools sources +set(pcsx2DebugToolsSources + DebugTools/DisR3000A.cpp + DebugTools/DisR5900asm.cpp + DebugTools/DisR5900.cpp + DebugTools/DisVU0Micro.cpp + DebugTools/DisVU1Micro.cpp) + +# DebugTools headers +set(pcsx2DebugToolsHeaders + DebugTools/Debug.h + DebugTools/DisASm.h + DebugTools/DisVUmicro.h + DebugTools/DisVUops.h) + +# gui sources +set(pcsx2GuiSources + gui/AdvancedDialog.cpp + gui/AppAssert.cpp + gui/AppConfig.cpp + gui/AppCoreThread.cpp + gui/AppInit.cpp + gui/AppMain.cpp + gui/AppRes.cpp + gui/ConsoleLogger.cpp + gui/Dialogs/AboutBoxDialog.cpp + gui/Dialogs/AppConfigDialog.cpp + gui/Dialogs/AssertionDialog.cpp + gui/Dialogs/BaseConfigurationDialog.cpp + gui/Dialogs/BaseConfigurationDialog.inl + gui/Dialogs/BiosSelectorDialog.cpp + gui/Dialogs/ConfirmationDialogs.cpp + gui/Dialogs/FirstTimeWizard.cpp + gui/Dialogs/ImportSettingsDialog.cpp + gui/Dialogs/LogOptionsDialog.cpp + gui/Dialogs/SysConfigDialog.cpp + gui/Dialogs/PickUserModeDialog.cpp + gui/FrameForGS.cpp + gui/GlobalCommands.cpp + gui/i18n.cpp + gui/IniInterface.cpp + gui/IsoDropTarget.cpp + gui/MainFrame.cpp + gui/MainMenuClicks.cpp + gui/MemoryCardFile.cpp + gui/MessageBoxes.cpp + gui/MSWstuff.cpp + gui/Panels/AudioPanel.cpp + gui/Panels/BiosSelectorPanel.cpp + gui/Panels/CpuPanel.cpp + gui/Panels/DirPickerPanel.cpp + gui/Panels/GameFixesPanel.cpp + gui/Panels/GSWindowPanel.cpp + gui/Panels/LogOptionsPanels.cpp + gui/Panels/MiscPanelStuff.cpp + gui/Panels/PathsPanel.cpp + gui/Panels/PluginSelectorPanel.cpp + gui/Panels/SpeedhacksPanel.cpp + gui/Panels/VideoPanel.cpp + gui/Plugins.cpp + gui/pxLogTextCtrl.cpp + gui/RecentIsoList.cpp + gui/Saveslots.cpp + gui/wxAppWithHelpers.cpp) + +# gui headers +set(pcsx2GuiHeaders + gui/AdvancedDialog.h + gui/App.h + gui/ApplyState.h + gui/AppCommon.h + gui/AppConfig.h + gui/ConsoleLogger.h + gui/Dialogs/ConfigurationDialog.h + gui/Dialogs/LogOptionsDialog.h + gui/Dialogs/ModalPopups.h + gui/i18n.h + gui/IniInterface.h + gui/IsoDropTarget.h + gui/MainFrame.h + gui/MSWstuff.h + gui/Panels/ConfigurationPanels.h + gui/Panels/LogOptionsPanels.h + gui/RecentIsoList.h + gui/wxAppWithHelpers.h) + +# IPU sources +set(pcsx2IPUSources + IPU/coroutine.cpp + IPU/IPU.cpp + IPU/mpeg2lib/Idct.cpp + IPU/mpeg2lib/Mpeg.cpp + IPU/yuv2rgb.cpp) + +# IPU headers +set(pcsx2IPUHeaders + IPU/coroutine.h + IPU/IPU.h + IPU/yuv2rgb.h) + +# Linux sources +set(pcsx2LinuxSources + Linux/LnxHostSys.cpp + Linux/LnxKeyCodes.cpp) + +# Linux headers +set(pcsx2LinuxHeaders + ) + +# ps2 sources +set(pcsx2ps2Sources + ps2/BiosTools.cpp + ps2/GIFpath.cpp + ps2/Iop/IopHwRead.cpp + ps2/Iop/IopHwWrite.cpp) + +# ps2 headers +set(pcsx2ps2Headers + ps2/BiosTools.h + ps2/Iop/IopHw_Internal.h) + +# RDebug sources +set(pcsx2RDebugSources + RDebug/deci2.cpp + RDebug/deci2_dbgp.cpp + RDebug/deci2_dcmp.cpp + RDebug/deci2_drfp.cpp + RDebug/deci2_iloadp.cpp + RDebug/deci2_netmp.cpp + RDebug/deci2_ttyp.cpp) + +# RDebug headers +set(pcsx2RDebugHeaders + RDebug/deci2_dbgp.h + RDebug/deci2_dcmp.h + RDebug/deci2_drfp.h + RDebug/deci2.h + RDebug/deci2_iloadp.h + RDebug/deci2_netmp.h + RDebug/deci2_ttyp.h) + +# System sources +set(pcsx2SystemSources + System/SysCoreThread.cpp + System/SysThreadBase.cpp) + +# System headers +set(pcsx2SystemHeaders + System/PageFaultSource.h + System/SysThreads.h) + +# Utilities sources +set(pcsx2UtilitiesSources + Utilities/FileUtils.cpp) + +# Utilities headers +set(pcsx2UtilitiesHeaders + Utilities/AsciiFile.h) + +# Windows sources +set(pcsx2WindowsSources + windows/cheats/browser.cpp + windows/cheats/cheats.cpp + windows/DwmSetup.cpp + windows/ini.cpp + windows/PatchBrowser.cpp + windows/SampleProf.cp + windows/WinCompressNTFS.cpp + windows/WinConsolePipe.cpp + windows/WinSysExec.cpp) + +# Windows headers +set(pcsx2WindowsHeaders + windows/cheats/cheats.h + windows/resource.h + windows/Win32.h) + +# x86 sources +set(pcsx2x86Sources + x86/BaseblockEx.cpp + x86/iCOP0.cpp + x86/iCOP2.cpp + x86/iCore.cpp + x86/iFPU.cpp + x86/iFPUd.cpp + x86/iMisc.cpp + x86/iMMI.cpp + x86/iPsxMem.cpp + x86/iR3000A.cpp + x86/iR3000Atables.cpp + x86/iR5900Misc.cpp + x86/ir5900tables.cpp + x86/iVU1micro.cpp + x86/ix86-32/iCore-32.cpp + x86/ix86-32/iR5900-32.cpp + x86/ix86-32/iR5900Arit.cpp + x86/ix86-32/iR5900AritImm.cpp + x86/ix86-32/iR5900Branch.cpp + x86/ix86-32/iR5900Jump.cpp + x86/ix86-32/iR5900LoadStore.cpp + x86/ix86-32/iR5900Move.cpp + x86/ix86-32/iR5900MultDiv.cpp + x86/ix86-32/iR5900Shift.cpp + x86/ix86-32/iR5900Templates.cpp + x86/ix86-32/recVTLB.cpp + x86/microVU_Alloc.inl + x86/microVU_Analyze.inl + x86/microVU_Branch.inl + x86/microVU_Clamp.inl + x86/microVU_Compile.inl + x86/microVU.cpp + x86/microVU_Execute.inl + x86/microVU_Flags.inl + x86/microVU_Log.inl + x86/microVU_Lower.inl + x86/microVU_Macro.inl + x86/microVU_Misc.inl + x86/microVU_Tables.inl + x86/microVU_Upper.inl + x86/newVif_OldUnpack.inl + x86/newVif_Unpack.cpp + x86/sVU_Lower.cpp + x86/sVU_Micro.cpp + x86/sVU_Upper.cpp + x86/sVU_zerorec.cpp + x86/VifUnpackSSE.cpp + x86/VifUnpackSSE_Dynarec.cpp) + +# x86 headers +set(pcsx2x86Headers + x86/BaseblockEx.h + x86/iCOP0.h + x86/iCore.h + x86/iFPU.h + x86/iMMI.h + x86/iR3000A.h + x86/iR5900Arit.h + x86/iR5900AritImm.h + x86/iR5900Branch.h + x86/iR5900.h + x86/iR5900Jump.h + x86/iR5900LoadStore.h + x86/iR5900Move.h + x86/iR5900MultDiv.h + x86/iR5900Shift.h + x86/microVU.h + x86/microVU_IR.h + x86/microVU_Misc.h + x86/newVif_BlockBuffer.h + x86/newVif.h + x86/newVif_HashBucket.h + x86/sVU_Debug.h + x86/sVU_Micro.h + x86/sVU_zerorec.h + x86/VifUnpackSSE.h) + +# colect .asm files +set(pcsx2AsmFiles + IPU/acoroutine.asm + IPU/yuv2rgb.asm + x86/ix86-32/aVif_proc-32.asm) + +# collect .S files +set(pcsx2SSources + IPU/acoroutine.S + x86/aVUzerorec.S) + +# set runtime output directory +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin) + +# change language of .S-files to c++ +set_source_files_properties(${pcsx2SSources} PROPERTIES LANGUAGE CXX) + +# common Sources +set(Common + ${pcsx2Sources} + ${pcsx2Headers} + ${pcsx2CDVDSources} + ${pcsx2CDVDHeaders} + ${pcsx2DebugToolsSources} + ${pcsx2DebugToolsSources} + ${pcsx2GuiSources} + ${pcsx2GuiHeaders} + ${pcsx2IPUSources} + ${pcsx2IPUHeaders} + ${pcsx2ps2Sources} + ${pcsx2ps2Headers} + ${pcsx2SystemSources} + ${pcsx2SystemHeaders} + ${pcsx2UtilitiesSources} + ${pcsx2UtilitiesHeaders} + ${pcsx2x86Sources} + ${pcsx2x86Headers} + ${pcsx2SSources}) + +# platform sources +# Linux +if(Linux) + set(Platform + ${pcsx2LinuxSources} + ${pcsx2LinuxHeaders}) +endif(Linux) + +# Windows +if(Windows) + set(Platform + ${pcsx2WindowsSources} + ${pcsx2WindowsHeaders}) +endif(Windows) + +# MacOSX +if(MacOSX) + set(PlatformSources + ) +endif(MacOSX) + +# add executable +add_executable(${pcsx2Name} + ${Common} + ${Platform}) + +# additonal include directories +include_directories(. + gui + x86) + +# add dependencies +add_dependencies(${pcsx2Name} Resources) + +# link target with project internal libraries +target_link_libraries(${pcsx2Name} Utilities x86emitter) + +# link target with wx +target_link_libraries(${pcsx2Name} ${wxWidgets_LIBRARIES}) + +if(Linux) + # link target with gtk2 + target_link_libraries(${pcsx2Name} ${GTK2_LIBRARIES}) +endif(Linux) + +# link target with zlib +if(localZLIB) + target_link_libraries(${pcsx2Name} zlib) +else(localZLIB) + target_link_libraries(${pcsx2Name} ${ZLIB_LIBRARIES}) +endif(localZLIB) + diff --git a/plugins/CDVDnull/CMakeLists.txt b/plugins/CDVDnull/CMakeLists.txt new file mode 100644 index 0000000000..6a833d9615 --- /dev/null +++ b/plugins/CDVDnull/CMakeLists.txt @@ -0,0 +1,81 @@ +# CDVDnull Plugin + +# plugin name +set(CDVDnullName CDVDnull) + +# CDVDnull sources +set(CDVDnullSources + CDVD.cpp) + +# CDVDnull headers +set(CDVDnullHeaders + CDVD.h) + +# CDVDnull Linux sources +set(CDVDnullLinuxSources + Linux/callbacks.c + Linux/Config.cpp + Linux/interface.c + Linux/support.c) + +# CDVDnull Linux headers +set(CDVDnullLinuxHeaders + Linux/callbacks.h + Linux/Config.h + Linux/interface.h + Linux/support.h) + +# CDVDnull Windows sources +set(CDVDnullWindowsSources + Windows/CDVDnull.def + Windows/plugin.def) + +# CDVDnull Windows headers +set(CDVDnullWindowsHeaders + ) + +# add library +add_library(${CDVDnullName} SHARED + ${CDVDnullSources} + ${CDVDnullHeaders} + ${CDVDnullLinuxSources} + ${CDVDnullLinuxHeaders} + ) + +# set output directory +set_target_properties(${CDVDnullName} PROPERTIES + LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin/plugins) + +# Debug - Build +if(CMAKE_BUILD_TYPE STREQUAL Debug) + set(CMAKE_C_FLAGS_DEBUG "-Wall -fPIC -m32 -g") + set(CMAKE_CXX_FLAGS_DEBUG "-Wall -fPIC -m32 -g") + + # add defines + add_definitions() +endif(CMAKE_BUILD_TYPE STREQUAL Debug) + +# Devel - Build +if(CMAKE_BUILD_TYPE STREQUAL Devel) + set(CMAKE_C_FLAGS_DEVEL "-Wall -fPIC -m32 -O2") + set(CMAKE_CXX_FLAGS_DEVEL "-Wall -fPIC -m32 -O2") + + # add defines + add_definitions() +endif(CMAKE_BUILD_TYPE STREQUAL Devel) + +# Release - Build +if(CMAKE_BUILD_TYPE STREQUAL Release) + set(CMAKE_C_FLAGS_RELEASE "-Wall -fPIC -m32 -O2 -s") + set(CMAKE_CXX_FLAGS_RELEASE "-Wall -fPIC -m32 -O2 -s") + + # add defines + add_definitions() +endif(CMAKE_BUILD_TYPE STREQUAL Release) + +# link target with wx +target_link_libraries(${CDVDnullName}) + +# add additional include directories +include_directories(. + ../../common/include) diff --git a/plugins/CMakeLists.txt b/plugins/CMakeLists.txt new file mode 100644 index 0000000000..04fddaaa08 --- /dev/null +++ b/plugins/CMakeLists.txt @@ -0,0 +1,117 @@ +# Plugins + +# make cdvdGigaherz +#if(cdvdGigaherz) +# add_subdirectory(cdvdGigaherz) +#endif(cdvdGigaherz) + +# make CDVDiso +if(CDVDiso) + add_subdirectory(CDVDiso) +endif(CDVDiso) + +# make CDVDisoEFP +if(CDVDisoEFP) + add_subdirectory(CDVDisoEFP) +endif(CDVDisoEFP) + +# make CDVDlinuz +if(CDVDlinuz) + add_subdirectory(CDVDlinuz) +endif(CDVDlinuz) + +# make CDVDnull +if(CDVDnull) + add_subdirectory(CDVDnull) +endif(CDVDnull) + +# make CDVDolio +if(CDVDolio) + add_subdirectory(CDVDolio) +endif(CDVDolio) + +# make CDVDpeops +#if(CDVDpeops) +# add_subdirectory(CDVDpeops) +#endif(CDVDpeops) + +# make dev9null +if(dev9null) + add_subdirectory(dev9null) +endif(dev9null) + +# make FWnull +if(FWnull) + add_subdirectory(FWnull) +endif(FWnull) + +# make GSdx +#if(GSdx) +# add_subdirectory(GSdx) +#endif(GSdx) + +# make GSnull +if(GSnull) + add_subdirectory(GSnull) +endif(GSnull) + +# make LilyPad +#if(LilyPad) +# add_subdirectory(LilyPad) +#endif(LilyPad) + +# make onepad +if(onepad) + add_subdirectory(onepad) +endif(onepad) + +# make PadNull +if(PadNull) + add_subdirectory(PadNull) +endif(PadNull) + +# make PeopsSPU2 +if(PeopsSPU2) + add_subdirectory(PeopsSPU2) +endif(PeopsSPU2) + +# make SPU2null +if(SPU2null) + add_subdirectory(SPU2null) +endif(SPU2null) + +# make spu2-x +#if(spu2-x) +# add_subdirectory(spu2-x) +#endif(spu2-x) + +# make SSSPSXPAD +#if(SSSPSXPAD) +# add_subdirectory(SSSPSXPAD) +#endif(SSSPSXPAD) + +# make USBnull +if(USBnull) + add_subdirectory(USBnull) +endif(USBnull) + +# make xpad +#if(xpad) +# add_subdirectory(xpad) +#endif(xpad) + +# make zerogs +if(zerogs) + add_subdirectory(zerogs) +endif(zerogs) + +# make zeropad +if(zeropad) + add_subdirectory(zeropad) +endif(zeropad) + +# make zerospu2 +if(zerospu2) + add_subdirectory(zerospu2) +endif(zerospu2) + diff --git a/plugins/FWnull/CMakeLists.txt b/plugins/FWnull/CMakeLists.txt new file mode 100644 index 0000000000..0b1da8c470 --- /dev/null +++ b/plugins/FWnull/CMakeLists.txt @@ -0,0 +1,79 @@ +# FWnull Plugin + +# plugin name +set(FWnullName FWnull) + +# FWnull sources +set(FWnullSources + Config.cpp + FW.cpp) + +# FWnull headers +set(FWnullHeaders + Config.h + FW.h) + +# FWnull Linux sources +set(FWnullLinuxSources +) + +# FWnull Linux headers +set(FWnullLinuxHeaders +) + +# FWnull Windows sources +set(FWnullWindowsSources + Windows/Config.cpp + Windows/FireWireNull.def + Windows/FireWireNul.rc + Windows/Win32.cpp) + +# FWnull Windows headers +set(FWnullWindowsHeaders + Windows/resource.h) + +# add library +add_library(${FWnullName} SHARED + ${FWnullSources} + ${FWnullHeaders} + ${FWnullLinuxSources} + ${FWnullLinuxHeaders}) + +# set output directory +set_target_properties(${FWnullName} PROPERTIES + LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin/plugins) + +# Debug - Build +if(CMAKE_BUILD_TYPE STREQUAL Debug) + set(CMAKE_C_FLAGS_DEBUG "-Wall -fPIC -m32 -g") + set(CMAKE_CXX_FLAGS_DEBUG "-Wall -fPIC -m32 -g") + + # add defines + add_definitions() +endif(CMAKE_BUILD_TYPE STREQUAL Debug) + +# Devel - Build +if(CMAKE_BUILD_TYPE STREQUAL Devel) + set(CMAKE_C_FLAGS_DEVEL "-Wall -fPIC -m32 -O2") + set(CMAKE_CXX_FLAGS_DEVEL "-Wall -fPIC -m32 -O2") + + # add defines + add_definitions() +endif(CMAKE_BUILD_TYPE STREQUAL Devel) + +# Release - Build +if(CMAKE_BUILD_TYPE STREQUAL Release) + set(CMAKE_C_FLAGS_RELEASE "-Wall -fPIC -m32 -O2 -s") + set(CMAKE_CXX_FLAGS_RELEASE "-Wall -fPIC -m32 -O2 -s") + + # add defines + add_definitions() +endif(CMAKE_BUILD_TYPE STREQUAL Release) + +# link target with wx +target_link_libraries(${FWnullName}) + +# add additional include directories +include_directories(. + ../../common/include) + diff --git a/plugins/GSnull/CMakeLists.txt b/plugins/GSnull/CMakeLists.txt new file mode 100644 index 0000000000..060d3e791c --- /dev/null +++ b/plugins/GSnull/CMakeLists.txt @@ -0,0 +1,101 @@ +# GSnull Plugin + +# plugin name +set(GSnullName GSnull) + +# GSnull sources +set(GSnullSources + GifTransfer.cpp + GS.cpp) + +# GSnull headers +set(GSnullHeaders + GifTransfer.h + GS.h + Registers.h) + +# GSnull Linux sources +set(GSnullLinuxSources +# Linux/callbacks.c + Linux/Config.cpp + Linux/GSLinux.cpp + Linux/interface.c + Linux/Linux.cpp + Linux/support.c) + +# GSnull Linux headers +set(GSnullLinuxHeaders + Linux/callbacks.h + Linux/Config.h + Linux/GSLinux.h + Linux/interface.h + Linux/Linux.h + Linux/support.h) + +# GSnull null sources +set(GSnullnullSources + null/GSnull.cpp) + +# GSnull null headers +set(GSnullnullHeaders + null/GSnull.h) + +# GSnull Windows sources +set(GSnullWindowsSources + Windows/Config.cpp + Windows/GS.def + Windows/GS.rc + Windows/GSwin.cpp + Windows/Win32.cpp) + +# GSnull Windows headers +set(GSnullWindowsHeaders + ) + +# add library +add_library(${GSnullName} SHARED + ${GSnullSources} + ${GSnullHeaders} + ${GSnullnullSources} + ${GSnullnullHeaders} + ${GSnullLinuxSources} + ${GSnullLinuxHeaders}) + +# set output directory +set_target_properties(${GSnullName} PROPERTIES + LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin/plugins) + +# Debug - Build +if(CMAKE_BUILD_TYPE STREQUAL Debug) + set(CMAKE_C_FLAGS_DEBUG "-Wall -fPIC -m32 -msse2 -g") + set(CMAKE_CXX_FLAGS_DEBUG "-Wall -fPIC -m32 -msse2 -g") + + # add defines + add_definitions() +endif(CMAKE_BUILD_TYPE STREQUAL Debug) + +# Devel - Build +if(CMAKE_BUILD_TYPE STREQUAL Devel) + set(CMAKE_C_FLAGS_DEVEL "-Wall -fPIC -m32 -msse2 -O2") + set(CMAKE_CXX_FLAGS_DEVEL "-Wall -fPIC -m32 -msse2 -O2") + + # add defines + add_definitions() +endif(CMAKE_BUILD_TYPE STREQUAL Devel) + +# Release - Build +if(CMAKE_BUILD_TYPE STREQUAL Release) + set(CMAKE_C_FLAGS_RELEASE "-Wall -fPIC -m32 -O2 -msse2 -s") + set(CMAKE_CXX_FLAGS_RELEASE "-Wall -fPIC -m32 -O2 -msse2 -s") + + # add defines + add_definitions() +endif(CMAKE_BUILD_TYPE STREQUAL Release) + +# link target with wx +target_link_libraries(${GSnullName}) + +# add additional include directories +include_directories(. + ../../common/include) + diff --git a/plugins/PadNull/CMakeLists.txt b/plugins/PadNull/CMakeLists.txt new file mode 100644 index 0000000000..ef206fda55 --- /dev/null +++ b/plugins/PadNull/CMakeLists.txt @@ -0,0 +1,87 @@ +# PadNull Plugin + +# plugin name +set(PadNullName PadNull) + +# PadNull sources +set(PadNullSources + Pad.cpp) + +# PadNull headers +set(PadNullHeaders + Pad.h) + +# PadNull Linux sources +set(PadNullLinuxSources +# Linllux/callbacks.c + Linux/Config.cpp + Linux/interface.c + Linux/PadLinux.cpp + Linux/support.c) + +# PadNull Linux headers +set(PadNullLinuxHeaders + Linux/callbacks.h + Linux/Config.h + Linux/interface.h + Linux/PadLinux.h + Linux/support.h) + +# PadNull Windows sources +set(PadNullWindowsSources + Windows/Config.cpp + Windows/PadNull.rc + Windows/PadWin.cpp + Windows/Win32.cpp) + +# PadNull Windows headers +set(PadNullWindowsHeaders + Windows/PadWin.h + Windows/resource.h) + +# add library +add_library(${PadNullName} SHARED + ${PadNullSources} + ${PadNullHeaders} + ${PadNullLinuxSources} + ${PadNullLinuxHeaders}) + +# set output directory +set_target_properties(${PadNullName} PROPERTIES + LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin/plugins) + +# Debug - Build +if(CMAKE_BUILD_TYPE STREQUAL Debug) + set(CMAKE_C_FLAGS_DEBUG "-Wall -fPIC -m32 -g") + set(CMAKE_CXX_FLAGS_DEBUG "-Wall -fPIC -m32 -g") + + # add defines + add_definitions() +endif(CMAKE_BUILD_TYPE STREQUAL Debug) + +# Devel - Build +if(CMAKE_BUILD_TYPE STREQUAL Devel) + set(CMAKE_C_FLAGS_DEVEL "-Wall -fPIC -m32 -O2") + set(CMAKE_CXX_FLAGS_DEVEL "-Wall -fPIC -m32 -O2") + + # add defines + add_definitions() +endif(CMAKE_BUILD_TYPE STREQUAL Devel) + +# Release - Build +if(CMAKE_BUILD_TYPE STREQUAL Release) + set(CMAKE_C_FLAGS_RELEASE "-Wall -fPIC -m32 -O2 -s") + set(CMAKE_CXX_FLAGS_RELEASE "-Wall -fPIC -m32 -O2 -s") + + # add defines + add_definitions() +endif(CMAKE_BUILD_TYPE STREQUAL Release) + +# link target with wx +target_link_libraries(${PadNullName}) + +# add additional include directories +include_directories(. + ../../common/include + Linux) + diff --git a/plugins/SPU2null/CMakeLists.txt b/plugins/SPU2null/CMakeLists.txt new file mode 100644 index 0000000000..15c873ad1a --- /dev/null +++ b/plugins/SPU2null/CMakeLists.txt @@ -0,0 +1,83 @@ +# SPU2null Plugin + +# plugin name +set(SPU2nullName SPU2null) + +# SPU2null sources +set(SPU2nullSources + SPU2.cpp) + +# SPU2null headers +set(SPU2nullHeaders + SPU2.h) + +# SPU2null Linux sources +set(SPU2nullLinuxSources +# Linux/callbacks.c + Linux/Config.cpp + Linux/interface.c + Linux/support.c) + +# SPU2null Linux headers +set(SPU2nullLinuxHeaders + Linux/callbacks.h + Linux/Config.h + Linux/interface.h + Linux/support.h) + +# SPU2null Windows sources +set(SPU2nullWindowsSources + Windows/Config.cpp + Windows/SPU2null.def + Windows/SPU2null.rc + Windows/Win32.cpp) + +# SPU2null Windows headers +set(SPU2nullWindowsHeaders + Windows/resource.h) + +# add library +add_library(${SPU2nullName} SHARED + ${SPU2nullSources} + ${SPU2nullHeaders} + ${SPU2nullLinuxSources} + ${SPU2nullLinuxHeaders}) + +# set output directory +set_target_properties(${SPU2nullName} PROPERTIES + LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin/plugins) + +# Debug - Build +if(CMAKE_BUILD_TYPE STREQUAL Debug) + set(CMAKE_C_FLAGS_DEBUG "-Wall -fPIC -m32 -g") + set(CMAKE_CXX_FLAGS_DEBUG "-Wall -fPIC -m32 -g") + + # add defines + add_definitions() +endif(CMAKE_BUILD_TYPE STREQUAL Debug) + +# Devel - Build +if(CMAKE_BUILD_TYPE STREQUAL Devel) + set(CMAKE_C_FLAGS_DEVEL "-Wall -fPIC -m32 -O2") + set(CMAKE_CXX_FLAGS_DEVEL "-Wall -fPIC -m32 -O2") + + # add defines + add_definitions() +endif(CMAKE_BUILD_TYPE STREQUAL Devel) + +# Release - Build +if(CMAKE_BUILD_TYPE STREQUAL Release) + set(CMAKE_C_FLAGS_RELEASE "-Wall -fPIC -m32 -O2 -s") + set(CMAKE_CXX_FLAGS_RELEASE "-Wall -fPIC -m32 -O2 -s") + + # add defines + add_definitions() +endif(CMAKE_BUILD_TYPE STREQUAL Release) + +# link target with wx +target_link_libraries(${SPU2nullName}) + +# add additional include directories +include_directories(. + ../../common/include) + diff --git a/plugins/USBnull/CMakeLists.txt b/plugins/USBnull/CMakeLists.txt new file mode 100644 index 0000000000..c31c145ad3 --- /dev/null +++ b/plugins/USBnull/CMakeLists.txt @@ -0,0 +1,79 @@ +# USBnull Plugin + +# plugin name +set(USBnullName USBnull) + +# USBnull sources +set(USBnullSources + Config.cpp + USB.cpp) + +# USBnull headers +set(USBnullHeaders + Config.h + USB.h) + +# USBnull Linux sources +set(USBnullLinuxSources +) + +# USBnull Linux headers +set(USBnullLinuxHeaders +) + +# USBnull Windows sources +set(USBnullWindowsSources + Windows/Config.cpp + Windows/USBnull.def + Windows/USBnull.rc + Windows/Win32.cpp) + +# USBnull Windows headers +set(USBnullWindowsHeaders + Windows/resource.h) + +# add library +add_library(${USBnullName} SHARED + ${USBnullSources} + ${USBnullHeaders} + ${USBnullLinuxSources} + ${USBnullLinuxHeaders}) + +# set output directory +set_target_properties(${USBnullName} PROPERTIES + LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin/plugins) + +# Debug - Build +if(CMAKE_BUILD_TYPE STREQUAL Debug) + set(CMAKE_C_FLAGS_DEBUG "-Wall -fPIC -m32 -g") + set(CMAKE_CXX_FLAGS_DEBUG "-Wall -fPIC -m32 -g") + + # add defines + add_definitions() +endif(CMAKE_BUILD_TYPE STREQUAL Debug) + +# Devel - Build +if(CMAKE_BUILD_TYPE STREQUAL Devel) + set(CMAKE_C_FLAGS_DEVEL "-Wall -fPIC -m32 -O2") + set(CMAKE_CXX_FLAGS_DEVEL "-Wall -fPIC -m32 -O2") + + # add defines + add_definitions() +endif(CMAKE_BUILD_TYPE STREQUAL Devel) + +# Release - Build +if(CMAKE_BUILD_TYPE STREQUAL Release) + set(CMAKE_C_FLAGS_RELEASE "-Wall -fPIC -m32 -O2 -s") + set(CMAKE_CXX_FLAGS_RELEASE "-Wall -fPIC -m32 -O2 -s") + + # add defines + add_definitions() +endif(CMAKE_BUILD_TYPE STREQUAL Release) + +# link target with wx +target_link_libraries(${USBnullName}) + +# add additional include directories +include_directories(. + ../../common/include) + diff --git a/plugins/dev9null/CMakeLists.txt b/plugins/dev9null/CMakeLists.txt new file mode 100644 index 0000000000..1b01044a25 --- /dev/null +++ b/plugins/dev9null/CMakeLists.txt @@ -0,0 +1,69 @@ +# dev9null Plugin + +# plugin name +set(dev9nullName dev9null) + +# dev9null sources +set(dev9nullSources + Config.cpp + DEV9.cpp) + +# dev9null headers +set(dev9nullHeaders + Config.h + DEV9.h) + +# dev9null Linux sources +set(dev9nullLinuxSources +) + +# dev9null Linux headers +set(dev9nullLinuxHeaders +) + +# dev9null Windows sources +set(dev9nullWindowsSources + Windows/dev9null.def) + +# dev9null Windows headers +set(dev9nullWindowsHeaders + ) + +# add library +add_library(${dev9nullName} SHARED + ${dev9nullSources} + ${dev9nullHeaders} + ${dev9nullLinuxSources} + ${dev9nullLinuxHeaders}) + +# set output directory +set_target_properties(${dev9nullName} PROPERTIES + LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin/plugins) + +# Debug - Build +if(CMAKE_BUILD_TYPE STREQUAL Debug) + set(CMAKE_C_FLAGS_DEBUG "-Wall -fPIC -m32 -g") + set(CMAKE_CXX_FLAGS_DEBUG "-Wall -fPIC -m32 -g") + + # add defines + add_definitions() +endif(CMAKE_BUILD_TYPE STREQUAL Debug) + +# Devel - Build +if(CMAKE_BUILD_TYPE STREQUAL Devel) + set(CMAKE_C_FLAGS_DEVEL "-Wall -fPIC -m32 -O2") + set(CMAKE_CXX_FLAGS_DEVEL "-Wall -fPIC -m32 -O2") + + # add defines + add_definitions() +endif(CMAKE_BUILD_TYPE STREQUAL Devel) + +# Release - Build +if(CMAKE_BUILD_TYPE STREQUAL Release) + set(CMAKE_C_FLAGS_RELEASE "-Wall -fPIC -m32 -O2 -s") + set(CMAKE_CXX_FLAGS_RELEASE "-Wall -fPIC -m32 -O2 -s") + + # add defines + add_definitions() +endif(CMAKE_BUILD_TYPE STREQUAL Release) + diff --git a/plugins/onepad/CMakeLists.txt b/plugins/onepad/CMakeLists.txt new file mode 100644 index 0000000000..e505711a49 --- /dev/null +++ b/plugins/onepad/CMakeLists.txt @@ -0,0 +1,90 @@ +# onepad Plugin + +# plugin name +set(onepadName onepad) + +# onepad sources +set(onepadSources + analog.cpp + controller.cpp + joystick.cpp + keyboard.cpp + onepad.cpp) + +# onepad headers +set(onepadHeaders + analog.h + bitwise.h + controller.h + joystick.h + keyboard.h + onepad.h) + +# onepad Linux sources +set(onepadLinuxSources +# Linux/callbacks.c + Linux/gui.cpp + Linux/ini.cpp + Linux/interface.c + Linux/linux.cpp + Linux/support.c) + +# onepad Linux headers +set(onepadLinuxHeaders + Linux/callbacks.h + Linux/interface.h + Linux/support.h) + +# onepad Windows sources +set(onepadWindowsSources + ) + +# onepad Windows headers +set(onepadWindowsHeaders + ) + +# add library +add_library(${onepadName} SHARED + ${onepadSources} + ${onepadHeaders} + ${onepadLinuxSources} + ${onepadLinuxHeaders}) + +# set output directory +set_target_properties(${onepadName} PROPERTIES + LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin/plugins) + +# Debug - Build +if(CMAKE_BUILD_TYPE STREQUAL Debug) + set(CMAKE_C_FLAGS_DEBUG "-Wall -fPIC -m32 -g") + set(CMAKE_CXX_FLAGS_DEBUG "-Wall -fPIC -m32 -g") + + # add defines + add_definitions() +endif(CMAKE_BUILD_TYPE STREQUAL Debug) + +# Devel - Build +if(CMAKE_BUILD_TYPE STREQUAL Devel) + set(CMAKE_C_FLAGS_DEVEL "-Wall -fPIC -m32 -O2") + set(CMAKE_CXX_FLAGS_DEVEL "-Wall -fPIC -m32 -O2") + + # add defines + add_definitions() +endif(CMAKE_BUILD_TYPE STREQUAL Devel) + +# Release - Build +if(CMAKE_BUILD_TYPE STREQUAL Release) + set(CMAKE_C_FLAGS_RELEASE "-Wall -fPIC -m32 -O2 -s") + set(CMAKE_CXX_FLAGS_RELEASE "-Wall -fPIC -m32 -O2 -s") + + # add defines + add_definitions() +endif(CMAKE_BUILD_TYPE STREQUAL Release) + +# link target with wx +target_link_libraries(${onepadName} ${SDL_LIBRARY}) + +# add additional include directories +include_directories(. + ../../common/include) + diff --git a/plugins/spu2-x/CMakeLists.txt b/plugins/spu2-x/CMakeLists.txt new file mode 100644 index 0000000000..bd6542ebef --- /dev/null +++ b/plugins/spu2-x/CMakeLists.txt @@ -0,0 +1,2 @@ +# make spu-x +add_subdirectory(src) diff --git a/plugins/zerogs/CMakeLists.txt b/plugins/zerogs/CMakeLists.txt new file mode 100644 index 0000000000..1afb1cfa8e --- /dev/null +++ b/plugins/zerogs/CMakeLists.txt @@ -0,0 +1,7 @@ +# zerogs plugin dx +# put Windows stuff here [TODO] + +# zerogs plugin opengl +if(UNIX) + add_subdirectory(opengl) +endif(UNIX) diff --git a/plugins/zerogs/dx/CMakeLists.txt b/plugins/zerogs/dx/CMakeLists.txt new file mode 100644 index 0000000000..988918f080 --- /dev/null +++ b/plugins/zerogs/dx/CMakeLists.txt @@ -0,0 +1,81 @@ +# zerogs Plugin + +# plugin name +set(zerogsName zerogs) + +# zerogs sources +set(zerogsSources + CDVD.cpp) + +# zerogs headers +set(zerogsHeaders + CDVD.h) + +# zerogs Linux sources +set(zerogsLinuxSources + Linux/callbacks.c + Linux/Config.cpp + Linux/interface.c + Linux/support.c) + +# zerogs Linux headers +set(zerogsLinuxHeaders + Linux/callbacks.h + Linux/Config.h + Linux/interface.h + Linux/support.h) + +# zerogs Windows sources +set(zerogsWindowsSources + Windows/zerogs.def + Windows/plugin.def) + +# zerogs Windows headers +set(zerogsWindowsHeaders + ) + +# add library +add_library(${zerogsName} SHARED + ${zerogsSources} + ${zerogsHeaders} + ${zerogsLinuxSources} + ${zerogsLinuxHeaders}) + +# set output directory +set_target_properties(${zerogsName} PROPERTIES + LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin/plugins) + +# Debug - Build +if(CMAKE_BUILD_TYPE STREQUAL Debug) + set(CMAKE_C_FLAGS_DEBUG "-Wall -fPIC -m32 -g") + set(CMAKE_CXX_FLAGS_DEBUG "-Wall -fPIC -m32 -g") + + # add defines + add_definitions() +endif(CMAKE_BUILD_TYPE STREQUAL Debug) + +# Devel - Build +if(CMAKE_BUILD_TYPE STREQUAL Devel) + set(CMAKE_C_FLAGS_DEVEL "-Wall -fPIC -m32 -O2") + set(CMAKE_CXX_FLAGS_DEVEL "-Wall -fPIC -m32 -O2") + + # add defines + add_definitions() +endif(CMAKE_BUILD_TYPE STREQUAL Devel) + +# Release - Build +if(CMAKE_BUILD_TYPE STREQUAL Release) + set(CMAKE_C_FLAGS_RELEASE "-Wall -fPIC -m32 -O2 -s") + set(CMAKE_CXX_FLAGS_RELEASE "-Wall -fPIC -m32 -O2 -s") + + # add defines + add_definitions() +endif(CMAKE_BUILD_TYPE STREQUAL Release) + +# link target with wx +target_link_libraries(${zerogsName}) + +# add additional include directories +include_directories(. + ../../common/include) + diff --git a/plugins/zerogs/opengl/CMakeLists.txt b/plugins/zerogs/opengl/CMakeLists.txt new file mode 100644 index 0000000000..6fb3bf5f27 --- /dev/null +++ b/plugins/zerogs/opengl/CMakeLists.txt @@ -0,0 +1,131 @@ +# zerogs Plugin + +# plugin name +set(zerogsName zerogs) + +include(${PROJECT_SOURCE_DIR}/cmake/FindGlew.cmake) +include(${PROJECT_SOURCE_DIR}/cmake/FindCg.cmake) + +# zerogs sources +set(zerogsSources + GifTransfer.cpp + glprocs.c + GSmain.cpp + GLWinX11.cpp + Mem.cpp + memcpy_amd.cpp + rasterfont.cpp + Regs.cpp + targets.cpp + x86.cpp + zerogs.cpp + zpipe.cpp) + +# zerogs headers +set(zerogsHeaders + common.h + GifTransfer.h + glprocs.h + GS.h + Mem.h + rasterfont.h + Regs.h + targets.h + x86.h + zerogs.h + zerogsmath.h + zpipe.h) + +# zerogs S sources +set(zerogsSSources + x86-32.S) + +# zerogs shader sources +set(zerogsShaderSources + ctx0/ps2hw_ctx.fx + ctx1/ps2hw_ctx.fx) + +# zerogs Linux sources +set(zerogsLinuxSources +# Linux/callbacks.c + Linux/Conf.cpp + Linux/interface.c + Linux/Linux.cpp + Linux/support.c) + +# zerogs Linux headers +set(zerogsLinuxHeaders + Linux/callbacks.h + Linux/interface.h + Linux/Linux.h + Linux/support.h) + +# zerogs Windows sources +set(zerogsWindowsSources + Win32/Conf.cpp + Win32/Win32.cpp + Win32/zerogs.def + Win32/zerogs.rc) + +# zerogs Windows headers +set(zerogsWindowsHeaders + aviUtil.h + jcofig.h + jmorecfg.h + jpeglib.h + resource.h + resrc1.h + Win32.h) + +# change language of .S-files to c++ +set_source_files_properties(${zerogsSSources} PROPERTIES LANGUAGE CXX) + +# add library +add_library(${zerogsName} SHARED + ${zerogsSources} + ${zerogsHeaders} + ${zerogsSSources} + ${zerogsShaderSources} + ${zerogsLinuxSources} + ${zerogsLinuxHeaders}) + +# set output directory +set_target_properties(${zerogsName} PROPERTIES + LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin/plugins) + +# Debug - Build +if(CMAKE_BUILD_TYPE STREQUAL Debug) + set(CMAKE_C_FLAGS_DEBUG "-Wall -m32 -g") + set(CMAKE_CXX_FLAGS_DEBUG "-Wall -m32 -g") + + # add defines + add_definitions() +endif(CMAKE_BUILD_TYPE STREQUAL Debug) + +# Devel - Build +if(CMAKE_BUILD_TYPE STREQUAL Devel) + set(CMAKE_C_FLAGS_DEVEL "-Wall -m32 -O2") + set(CMAKE_CXX_FLAGS_DEVEL "-Wall -m32 -O2") + + # add defines + add_definitions() +endif(CMAKE_BUILD_TYPE STREQUAL Devel) + +# Release - Build +if(CMAKE_BUILD_TYPE STREQUAL Release) + set(CMAKE_C_FLAGS_RELEASE "-Wall -m32 -O2 -s") + set(CMAKE_CXX_FLAGS_RELEASE "-Wall -m32 -O2 -s") + + # add defines + add_definitions() +endif(CMAKE_BUILD_TYPE STREQUAL Release) + +# link target with +target_link_libraries(${zerogsName} ${GLEW_LIBRARY} ${CG_LIBRARIES}) + +# add additional include directories +include_directories(. + ${GLEW_INCLUDE_PATH} + ${CG_INCLUDE_DIRS} + ../../../common/include) + diff --git a/plugins/zerogs/opengl/zerogs.cpp b/plugins/zerogs/opengl/zerogs.cpp index ae3cca5c57..e6252755f7 100644 --- a/plugins/zerogs/opengl/zerogs.cpp +++ b/plugins/zerogs/opengl/zerogs.cpp @@ -5263,7 +5263,7 @@ Return: "jmp Start\n" "Return:\n" "emms\n" - ".att_syntax\n" : "=m"(bRet) : "c"(dst), "d"(src), "b"(entries) : "eax", "memory"); // Breaks -fPIC + ".att_syntax\n" : "=m"(bRet) : "c"(dst), "d"(src), "S"(entries) : "eax", "memory"); // Breaks -fPIC #endif // _WIN32 diff --git a/plugins/zerospu2/CMakeLists.txt b/plugins/zerospu2/CMakeLists.txt new file mode 100644 index 0000000000..b46683fe79 --- /dev/null +++ b/plugins/zerospu2/CMakeLists.txt @@ -0,0 +1,95 @@ +# zerospu2 Plugin + +# plugin name +set(zerospu2Name zerospu2) + +# zerospu2 sources +set(zerospu2Sources + voices.cpp + zerodma.cpp + zerospu2.cpp) + +# zerospu2 headers +set(zerospu2Headers + misc.h + reg.h + zerospu2.h) + +# zerospu2 Linux sources +set(zerospu2LinuxSources +# Linux/callbacks.c + Linux/interface.c + Linux/Linux.cpp + Linux/support.c + Targets/Alsa.cpp + Targets/OSS.cpp +# Targets/PortAudio.cpp + Targets/SoundTargets.cpp) + +# zerospu2 Linux headers +set(zerospu2LinuxHeaders + Linux/callbacks.h + Linux/interface.h + Linux/Linux.h + Linux/support.h + Targets/Alsa.h + Targets/OSS.h +# Targets/PortAudio.h + Targets/SoundTargets.h) + +# zerospu2 Windows sources +set(zerospu2WindowsSources + Targets/dsound51.cpp + Windows/Win32.cpp + Windows/ZeroSPU2.def + Windows/ZeroSPU2.rc) + +# zerospu2 Windows headers +set(zerospu2WindowsHeaders + resources.h + Targets/dsound51.h) + +# add library +add_library(${zerospu2Name} SHARED + ${zerospu2Sources} + ${zerospu2Headers} + ${zerospu2LinuxSources} + ${zerospu2LinuxHeaders}) + +# set output directory +set_target_properties(${zerospu2Name} PROPERTIES + LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin/plugins) + +# Debug - Build +if(CMAKE_BUILD_TYPE STREQUAL Debug) + # add defines + add_definitions(-Wall -fPIC -m32 -msse2 -g) +endif(CMAKE_BUILD_TYPE STREQUAL Debug) + +# Devel - Build +if(CMAKE_BUILD_TYPE STREQUAL Devel) + # add defines + add_definitions(-Wall -fPIC -m32 -msse2 -O2) +endif(CMAKE_BUILD_TYPE STREQUAL Devel) + +# Release - Build +if(CMAKE_BUILD_TYPE STREQUAL Release) + # add defines + add_definitions(-Wall -fPIC -m32 -msse2 -O2 -s) +endif(CMAKE_BUILD_TYPE STREQUAL Release) + +# link target with ALSA +target_link_libraries(${zerospu2Name} ${ALSA_LIBRARIES}) + +# link target with SoundTouch +if(localSoundTouch) + target_link_libraries(${zerospu2Name} SoundTouch) +else(localSoundTouch) + target_link_libraries(${zerospu2Name} ${SOUNDTOUCH_LIBRARIES}) +endif(localSoundTouch) + +# add additional include directories +include_directories(. + ./Target + ./Linux + ../../../common/include) diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt new file mode 100644 index 0000000000..edfca472e7 --- /dev/null +++ b/tools/CMakeLists.txt @@ -0,0 +1,4 @@ + +# make bin2cpp +add_subdirectory(bin2cpp) + diff --git a/tools/bin2cpp/CMakeLists.txt b/tools/bin2cpp/CMakeLists.txt new file mode 100644 index 0000000000..c6bfdcb90f --- /dev/null +++ b/tools/bin2cpp/CMakeLists.txt @@ -0,0 +1,46 @@ +# bin2cpp tool + +# executable name +set(bin2cppName bin2cpp) + +# variable with all sources of this executable +set(bin2cppSources + bin2cpp.cpp) + +set(bin2cppHeaders + ) + +# add executable +add_executable(${bin2cppName} ${bin2cppSources} ${bin2cppHeaders}) + +# Debug - Build +if(CMAKE_BUILD_TYPE STREQUAL Debug) + set(CMAKE_C_FLAGS_DEBUG "-O2 -s -Wall -fexceptions") + set(CMAKE_CXX_FLAGS_DEBUG "-O2 -s -Wall -fexceptions") + + # add defines + add_definitions() +endif(CMAKE_BUILD_TYPE STREQUAL Debug) + +# Devel - Build +if(CMAKE_BUILD_TYPE STREQUAL Devel) + set(CMAKE_C_FLAGS_DEVEL "-O2 -s -Wall -fexceptions") + set(CMAKE_CXX_FLAGS_DEVEL "-O2 -s -Wall -fexceptions") + + # add defines + add_definitions() +endif(CMAKE_BUILD_TYPE STREQUAL Devel) + +# Release - Build +if(CMAKE_BUILD_TYPE STREQUAL Release) + set(CMAKE_C_FLAGS_RELEASE "-O2 -s -Wall -fexceptions") + set(CMAKE_CXX_FLAGS_RELEASE "-O2 -s -Wall -fexceptions") + + # add defines + add_definitions() +endif(CMAKE_BUILD_TYPE STREQUAL Release) + +# set output directory +set_target_properties(${bin2cppName} PROPERTIES + RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/tools/bin) +