2011-02-20 13:31:49 +00:00
|
|
|
# The project's name is VBA-M it uses C and C++ code
|
|
|
|
PROJECT(VBA-M C CXX)
|
2010-03-15 03:36:45 +00:00
|
|
|
|
2017-01-29 18:14:34 +00:00
|
|
|
cmake_minimum_required( VERSION 2.8.12 )
|
2016-11-20 19:11:52 +00:00
|
|
|
|
|
|
|
IF(CMAKE_BUILD_TYPE STREQUAL "")
|
|
|
|
SET(CMAKE_BUILD_TYPE "Release" CACHE STRING "Build Type" FORCE)
|
|
|
|
ENDIF()
|
|
|
|
|
2016-12-21 02:26:11 +00:00
|
|
|
SET(ALL_TARGETS fex visualboyadvance-m vbamcore vbam)
|
2016-11-21 20:37:21 +00:00
|
|
|
|
2008-06-06 18:56:41 +00:00
|
|
|
if( COMMAND cmake_policy )
|
|
|
|
cmake_policy( SET CMP0003 NEW )
|
2008-06-08 20:46:25 +00:00
|
|
|
cmake_policy( SET CMP0005 OLD )
|
2008-06-06 18:56:41 +00:00
|
|
|
endif( COMMAND cmake_policy )
|
|
|
|
SET( CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/CMakeScripts )
|
2015-03-27 17:48:42 +00:00
|
|
|
#Output all binaries at top level
|
|
|
|
SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR})
|
2008-06-06 10:17:20 +00:00
|
|
|
|
2016-11-20 13:46:24 +00:00
|
|
|
option( ENABLE_SDL "Build the SDL port" OFF )
|
2015-05-18 03:04:34 +00:00
|
|
|
option( ENABLE_WX "Build the wxWidgets port" ON )
|
2011-02-24 11:14:59 +00:00
|
|
|
option( ENABLE_DEBUGGER "Enable the debugger" ON )
|
2011-02-24 13:06:17 +00:00
|
|
|
option( ENABLE_NLS "Enable translations" ON )
|
2016-11-18 16:59:27 +00:00
|
|
|
|
2017-03-06 09:40:55 +00:00
|
|
|
SET(ASM_DEFAULT OFF)
|
2016-11-18 16:59:27 +00:00
|
|
|
|
2017-03-08 23:49:00 +00:00
|
|
|
IF(NOT CMAKE_SYSTEM_PROCESSOR)
|
|
|
|
IF(NOT CMAKE_TOOLCHAIN_FILE AND CMAKE_HOST_SYSTEM_PROCESSOR)
|
|
|
|
SET(CMAKE_SYSTEM_PROCESSOR ${CMAKE_HOST_SYSTEM_PROCESSOR})
|
|
|
|
ELSEIF(CMAKE_TOOLCHAIN_FILE MATCHES mxe)
|
|
|
|
IF(CMAKE_TOOLCHAIN_FILE MATCHES "i[3-9]86")
|
|
|
|
SET(CMAKE_SYSTEM_PROCESSOR i686)
|
|
|
|
ELSE()
|
|
|
|
SET(CMAKE_SYSTEM_PROCESSOR x86_64)
|
|
|
|
ENDIF()
|
|
|
|
ENDIF()
|
|
|
|
ENDIF()
|
|
|
|
|
2016-11-18 16:59:27 +00:00
|
|
|
# turn asm on by default on 32bit x86
|
2017-03-08 23:49:00 +00:00
|
|
|
IF(CMAKE_SYSTEM_PROCESSOR MATCHES "[xX]86|i[3-9]86|[aA][mM][dD]64")
|
2016-11-27 23:37:24 +00:00
|
|
|
IF(CMAKE_C_SIZEOF_DATA_PTR EQUAL 4) # 32 bit
|
2017-03-06 09:40:55 +00:00
|
|
|
SET(ASM_DEFAULT ON)
|
2016-11-27 23:37:24 +00:00
|
|
|
SET(X86_32 ON)
|
|
|
|
ELSE()
|
|
|
|
SET(AMD64 ON)
|
|
|
|
ENDIF()
|
2016-11-18 16:59:27 +00:00
|
|
|
ENDIF()
|
|
|
|
|
2017-03-06 09:40:55 +00:00
|
|
|
OPTION(ENABLE_ASM "Enable x86 ASM related options" ${ASM_DEFAULT})
|
|
|
|
|
2017-03-19 02:04:39 +00:00
|
|
|
# The ARM ASM core seems to be very buggy, see #98 and #54. Default to it being
|
|
|
|
# OFF for the time being, until it is either fixed or replaced.
|
|
|
|
option( ENABLE_ASM_CORE "Enable x86 ASM CPU cores" OFF)
|
|
|
|
|
|
|
|
IF(ENABLE_ASM_CORE)
|
|
|
|
MESSAGE(WARNING "!!!!!! The x86 ASM cores are considered buggy and dangerous, use at your own risk. !!!!!!")
|
|
|
|
ENDIF()
|
|
|
|
|
2017-03-06 09:40:55 +00:00
|
|
|
SET(ASM_SCALERS_DEFAULT ${ENABLE_ASM})
|
|
|
|
SET(MMX_DEFAULT ${ENABLE_ASM})
|
|
|
|
|
2016-11-18 16:59:27 +00:00
|
|
|
option( ENABLE_ASM_SCALERS "Enable x86 ASM graphic filters" ${ASM_SCALERS_DEFAULT})
|
|
|
|
|
|
|
|
if(ENABLE_ASM_SCALERS)
|
|
|
|
option( ENABLE_MMX "Enable MMX" ${MMX_DEFAULT})
|
|
|
|
endif(ENABLE_ASM_SCALERS)
|
|
|
|
|
2016-11-08 12:51:26 +00:00
|
|
|
option( ENABLE_LINK "Enable GBA linking functionality" ON )
|
2011-02-24 11:14:59 +00:00
|
|
|
option( ENABLE_LIRC "Enable LIRC support" OFF )
|
2016-11-14 18:56:50 +00:00
|
|
|
|
|
|
|
SET(FFMPEG_DEFAULT ON)
|
|
|
|
|
2017-02-24 14:44:26 +00:00
|
|
|
IF(WIN32 AND NOT (MINGW AND MSYS))
|
2016-11-14 18:56:50 +00:00
|
|
|
SET(FFMPEG_DEFAULT OFF)
|
|
|
|
ENDIF()
|
|
|
|
|
|
|
|
option(ENABLE_FFMPEG "Enable ffmpeg A/V recording" ${FFMPEG_DEFAULT})
|
|
|
|
|
2016-11-27 23:37:24 +00:00
|
|
|
SET(LTO_DEFAULT ON)
|
|
|
|
|
2016-12-31 12:48:51 +00:00
|
|
|
IF(WIN32)
|
2016-11-27 23:37:24 +00:00
|
|
|
SET(LTO_DEFAULT OFF)
|
|
|
|
ENDIF()
|
|
|
|
|
|
|
|
OPTION(ENABLE_LTO "Compile with Link Time Optimization (gcc and clang only)" ${LTO_DEFAULT})
|
|
|
|
|
2017-02-11 02:57:35 +00:00
|
|
|
if(MSVC)
|
|
|
|
ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS)
|
|
|
|
endif(MSVC)
|
|
|
|
|
2011-05-24 07:39:29 +00:00
|
|
|
option( ENABLE_GBA_LOGGING "Enable extended GBA logging" ON )
|
|
|
|
if( ENABLE_GBA_LOGGING )
|
|
|
|
ADD_DEFINITIONS (-DGBA_LOGGING )
|
|
|
|
endif( ENABLE_GBA_LOGGING )
|
|
|
|
if(ENABLE_MMX)
|
|
|
|
ADD_DEFINITIONS (-DMMX)
|
|
|
|
endif(ENABLE_MMX)
|
2011-02-24 11:14:59 +00:00
|
|
|
|
|
|
|
# The SDL port can't be built without debugging support
|
|
|
|
if( NOT ENABLE_DEBUGGER AND ENABLE_SDL )
|
|
|
|
message( SEND_ERROR "The SDL port can't be built without debugging support" )
|
|
|
|
endif( NOT ENABLE_DEBUGGER AND ENABLE_SDL )
|
2008-06-06 10:17:20 +00:00
|
|
|
|
2011-02-24 11:14:59 +00:00
|
|
|
# Set the version number with -DVERSION=X.X.X-uber
|
2008-06-06 10:17:20 +00:00
|
|
|
IF( NOT VERSION )
|
2015-06-12 11:51:15 +00:00
|
|
|
#Will need to change this over to git
|
2015-06-12 12:04:26 +00:00
|
|
|
SET( VERSION "https://github.com/visualboyadvance-m/visualboyadvance-m" )
|
2015-05-18 02:41:21 +00:00
|
|
|
|
2015-06-12 12:04:26 +00:00
|
|
|
#openmw does this
|
|
|
|
if(EXISTS ${PROJECT_SOURCE_DIR}/.git)
|
|
|
|
if(NOT EXISTS ${PROJECT_SOURCE_DIR}/.git/shallow)
|
|
|
|
find_package(Git)
|
|
|
|
if(GIT_FOUND)
|
|
|
|
include(GetGitRevisionDescription)
|
|
|
|
get_git_head_revision(REFSPEC COMMITHASH)
|
|
|
|
SET( VERSION "GIT Commit: " ${COMMITHASH} )
|
|
|
|
else(GIT_FOUND)
|
|
|
|
message(WARNING "Git executable not found")
|
|
|
|
endif(GIT_FOUND)
|
|
|
|
else(NOT EXISTS ${PROJECT_SOURCE_DIR}/.git/shallow)
|
|
|
|
message(STATUS "Shallow Git clone detected, not attempting to retrieve version info")
|
|
|
|
endif(NOT EXISTS ${PROJECT_SOURCE_DIR}/.git/shallow)
|
|
|
|
endif(EXISTS ${PROJECT_SOURCE_DIR}/.git)
|
2008-06-06 10:17:20 +00:00
|
|
|
ENDIF( NOT VERSION )
|
|
|
|
|
Mac OS X HiDPI fixes + other misc
Use a high-res surface on HiDPI (e.g. retina) Macs for the OpenGL
renderer, and scale window accordingly. Also fix fullscreen toggle not
working in HiDPI mode. And some other stuff.
Aside from the .app not being linked statically, the app is now fully
functional on Mac and ready to ship.
Full change details:
* add -DDEBUG or -DNDEBUG based on CMAKE_BUILD_TYPE (-DNDEBUG for
Release and -DDEBUG for Debug)
* properly search for homebrew/macports/fink directories, and only add
them if they exist
* fix building with wx debug support, when available
* use explicit OpenGL context on Mac too for new versions of wx
* add main_frame pointer in GameArea back to MainFrame, and a
SetMainFrame(MainFrame* parent) public method to set it in guinit
* add full support for reading and writing double value config options
(the GUI still needs to be updated for options that can take doubles,
such as video_scale)
* change video_scale option (Display/Scale) to a double, putting a
double value such as 3.6 in the config file works correctly
* add a HiDPIAware mixin class for GameArea and DrawingPanel, with the
method HiDPIScaleFactor which returns the current window's
backingScaleFactor
* change the GameArea sizing methods (DelBorder(), AdjustMinSize() and
AdjustSize()) to divide the window size by the
HiDPIAware::HiDPIScaleFactor so that the window is scaled properly
* change GameArea::ShowFullScreen to ignore fullscreen events for a
maximized window on Mac, because maximized windows on OS X are
actually native fullscreen windows
* change scale variables to double from int, and use std::ceil() to
round scaled pixel or memory size values
* make a default base class DrawingPane::DrawingPanelInit() virtual
method, call by all concrete class constructors based on the did_init
flag
* call setWantsBestResolutionOpenGLSurface:YES on the view backing the
wxGLCanvas for the OpenGL renderer (GLDrawingPanel) to get a high res
OpenGL surface in HiDPI mode
* remove GLDrawingPanel::OnSize event, the OpenGL viewport resizes
automatically without the need to call glViewport()
* do not hide the mouse pointer if the main frame has menus or dialogs
open
* add variadic vbamDebug(const char* format, ...) function, active only
#ifdef DEBUG, which sets the wx log target to STDERR and logs a
message to it
* use full name of app "visualboyadvance-m" instead of "vbam" when
getting configuration paths, this way the config is saved to
~/Library/Application Support/visualboyadvance-m rather than
~/Library/Application Support/vbam
* listen to the MENU_HIGHLIGHT_ALL event as well, as an extra way to
check when the menus are open
* add public MainFrame::SetMenusOpened(bool state) method to force the
main frame to change the internal menus_opened state, this is
necessary because in HiDPI mode on Mac the keyboard accelerator for
toggle fullscreen sends a menu open event, but not a menu close event,
so on switch to fullscreen the state is changed to menus closed and
the emu is unpaused
TODO:
* GUI option to change toggle fullscreen behavior between native and
non-native fullscreen on Mac
* GUI support for double config values like Display/Scale
* add HiDPI support to simple renderer
* fix SDL sound, or disable the option
* fix Cairo suport on Mac, or disable the option
* use dynamic_cast<> to implement GetWindow() for DrawingPanel instead
of pure virtual method, likewise for Delete()
* link .app statically by default so it can be shipped
* add Homebrew formula
2016-10-22 12:20:46 +00:00
|
|
|
IF(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
2016-11-20 14:15:27 +00:00
|
|
|
ADD_DEFINITIONS(-DDEBUG)
|
Mac OS X HiDPI fixes + other misc
Use a high-res surface on HiDPI (e.g. retina) Macs for the OpenGL
renderer, and scale window accordingly. Also fix fullscreen toggle not
working in HiDPI mode. And some other stuff.
Aside from the .app not being linked statically, the app is now fully
functional on Mac and ready to ship.
Full change details:
* add -DDEBUG or -DNDEBUG based on CMAKE_BUILD_TYPE (-DNDEBUG for
Release and -DDEBUG for Debug)
* properly search for homebrew/macports/fink directories, and only add
them if they exist
* fix building with wx debug support, when available
* use explicit OpenGL context on Mac too for new versions of wx
* add main_frame pointer in GameArea back to MainFrame, and a
SetMainFrame(MainFrame* parent) public method to set it in guinit
* add full support for reading and writing double value config options
(the GUI still needs to be updated for options that can take doubles,
such as video_scale)
* change video_scale option (Display/Scale) to a double, putting a
double value such as 3.6 in the config file works correctly
* add a HiDPIAware mixin class for GameArea and DrawingPanel, with the
method HiDPIScaleFactor which returns the current window's
backingScaleFactor
* change the GameArea sizing methods (DelBorder(), AdjustMinSize() and
AdjustSize()) to divide the window size by the
HiDPIAware::HiDPIScaleFactor so that the window is scaled properly
* change GameArea::ShowFullScreen to ignore fullscreen events for a
maximized window on Mac, because maximized windows on OS X are
actually native fullscreen windows
* change scale variables to double from int, and use std::ceil() to
round scaled pixel or memory size values
* make a default base class DrawingPane::DrawingPanelInit() virtual
method, call by all concrete class constructors based on the did_init
flag
* call setWantsBestResolutionOpenGLSurface:YES on the view backing the
wxGLCanvas for the OpenGL renderer (GLDrawingPanel) to get a high res
OpenGL surface in HiDPI mode
* remove GLDrawingPanel::OnSize event, the OpenGL viewport resizes
automatically without the need to call glViewport()
* do not hide the mouse pointer if the main frame has menus or dialogs
open
* add variadic vbamDebug(const char* format, ...) function, active only
#ifdef DEBUG, which sets the wx log target to STDERR and logs a
message to it
* use full name of app "visualboyadvance-m" instead of "vbam" when
getting configuration paths, this way the config is saved to
~/Library/Application Support/visualboyadvance-m rather than
~/Library/Application Support/vbam
* listen to the MENU_HIGHLIGHT_ALL event as well, as an extra way to
check when the menus are open
* add public MainFrame::SetMenusOpened(bool state) method to force the
main frame to change the internal menus_opened state, this is
necessary because in HiDPI mode on Mac the keyboard accelerator for
toggle fullscreen sends a menu open event, but not a menu close event,
so on switch to fullscreen the state is changed to menus closed and
the emu is unpaused
TODO:
* GUI option to change toggle fullscreen behavior between native and
non-native fullscreen on Mac
* GUI support for double config values like Display/Scale
* add HiDPI support to simple renderer
* fix SDL sound, or disable the option
* fix Cairo suport on Mac, or disable the option
* use dynamic_cast<> to implement GetWindow() for DrawingPanel instead
of pure virtual method, likewise for Delete()
* link .app statically by default so it can be shipped
* add Homebrew formula
2016-10-22 12:20:46 +00:00
|
|
|
ELSE()
|
2016-11-20 14:15:27 +00:00
|
|
|
ADD_DEFINITIONS(-DNDEBUG)
|
|
|
|
ENDIF()
|
|
|
|
|
2017-02-11 22:18:38 +00:00
|
|
|
# hack for ninja in msys2
|
|
|
|
IF(WIN32 AND CMAKE_GENERATOR STREQUAL Ninja AND (NOT $ENV{MSYSTEM} STREQUAL ""))
|
|
|
|
SET(MSYS ON)
|
|
|
|
ENDIF()
|
|
|
|
|
Mac OS X HiDPI fixes + other misc
Use a high-res surface on HiDPI (e.g. retina) Macs for the OpenGL
renderer, and scale window accordingly. Also fix fullscreen toggle not
working in HiDPI mode. And some other stuff.
Aside from the .app not being linked statically, the app is now fully
functional on Mac and ready to ship.
Full change details:
* add -DDEBUG or -DNDEBUG based on CMAKE_BUILD_TYPE (-DNDEBUG for
Release and -DDEBUG for Debug)
* properly search for homebrew/macports/fink directories, and only add
them if they exist
* fix building with wx debug support, when available
* use explicit OpenGL context on Mac too for new versions of wx
* add main_frame pointer in GameArea back to MainFrame, and a
SetMainFrame(MainFrame* parent) public method to set it in guinit
* add full support for reading and writing double value config options
(the GUI still needs to be updated for options that can take doubles,
such as video_scale)
* change video_scale option (Display/Scale) to a double, putting a
double value such as 3.6 in the config file works correctly
* add a HiDPIAware mixin class for GameArea and DrawingPanel, with the
method HiDPIScaleFactor which returns the current window's
backingScaleFactor
* change the GameArea sizing methods (DelBorder(), AdjustMinSize() and
AdjustSize()) to divide the window size by the
HiDPIAware::HiDPIScaleFactor so that the window is scaled properly
* change GameArea::ShowFullScreen to ignore fullscreen events for a
maximized window on Mac, because maximized windows on OS X are
actually native fullscreen windows
* change scale variables to double from int, and use std::ceil() to
round scaled pixel or memory size values
* make a default base class DrawingPane::DrawingPanelInit() virtual
method, call by all concrete class constructors based on the did_init
flag
* call setWantsBestResolutionOpenGLSurface:YES on the view backing the
wxGLCanvas for the OpenGL renderer (GLDrawingPanel) to get a high res
OpenGL surface in HiDPI mode
* remove GLDrawingPanel::OnSize event, the OpenGL viewport resizes
automatically without the need to call glViewport()
* do not hide the mouse pointer if the main frame has menus or dialogs
open
* add variadic vbamDebug(const char* format, ...) function, active only
#ifdef DEBUG, which sets the wx log target to STDERR and logs a
message to it
* use full name of app "visualboyadvance-m" instead of "vbam" when
getting configuration paths, this way the config is saved to
~/Library/Application Support/visualboyadvance-m rather than
~/Library/Application Support/vbam
* listen to the MENU_HIGHLIGHT_ALL event as well, as an extra way to
check when the menus are open
* add public MainFrame::SetMenusOpened(bool state) method to force the
main frame to change the internal menus_opened state, this is
necessary because in HiDPI mode on Mac the keyboard accelerator for
toggle fullscreen sends a menu open event, but not a menu close event,
so on switch to fullscreen the state is changed to menus closed and
the emu is unpaused
TODO:
* GUI option to change toggle fullscreen behavior between native and
non-native fullscreen on Mac
* GUI support for double config values like Display/Scale
* add HiDPI support to simple renderer
* fix SDL sound, or disable the option
* fix Cairo suport on Mac, or disable the option
* use dynamic_cast<> to implement GetWindow() for DrawingPanel instead
of pure virtual method, likewise for Delete()
* link .app statically by default so it can be shipped
* add Homebrew formula
2016-10-22 12:20:46 +00:00
|
|
|
# Add support for Homebrew, MacPorts and Fink on OS X
|
more minor improvements for OS X build
Add Homebrew and MacPorts paths for findings headers and libraries.
Add -x objective-c++ to the C++ compile command so that conditionally
compiled ObjectiveC code for OS X can be supported.
Throw a fatal error if the user tries to enable ENABLE_ASM_CORE,
ENABLE_ASM_SCALERS or ENABLE_MMX on AMD64, as this is not supported yet.
If ENABLE_ASM_SCALERS is enabled, try to find a Homebrew or MacPorts
nasm before using the outdated XCode nasm.
For the future, if the user has only the old XCode nasm which does not
support 64 bit objects and the build is 64 bit, throw a fatal error.
For 32 bit builds with the old XCode nasm, use -f macho instead of -f
macho32, which is used if the version of nasm is > 2.0 .
Pass -DMACHO instead of -DELF and, on AMD64 (for the future) -D__AMD64__
for nasm on OS X.
Pass -D__AMD64__ to C++ compilation as well on AMD64, this will help
when we support AMD64 inline assembly.
Add support for automatically linking Homebrew keg-only gettext from
/usr/local/opt/gettext for ENABLE_NLS.
Fix copying Info.plist and vbam.icns to the .app bundle.
Add a key to the Info.plist to support sharp text on retina displays, as
per:
https://wiki.wxwidgets.org/WxMac-specific_topics#Retina_display_support
Set wxWidgets_USE_DEBUG to ON if CMAKE_BUILD_TYPE is "Debug". I'm not
sure this does anything or if I'm doing this correctly though.
Also set wxWidgets_USE_UNICODE to ON. Again, I'm not sure this does
anything or is in the right place.
Fix a bug in the config dir finding code in
wxvbamApp::GetConfigurationPath() updated in 8b8f2f7 to only use the
more top level dirs if there is a vbam.ini in them, not if they are
writable as well, and use the reverse order (starting with user local
dirs) to check for writable dirs and their writable parents. This fixes
a problem with the vbam.ini being written to the Plugins directory of
the .app bundle if it's writable instead of ~/Library/Application
Support/vbam as was intended.
2015-11-17 02:56:23 +00:00
|
|
|
IF(APPLE)
|
2016-12-11 07:28:28 +00:00
|
|
|
INCLUDE(MacPackageManagers)
|
2016-10-26 23:58:21 +00:00
|
|
|
ENDIF(APPLE)
|
more minor improvements for OS X build
Add Homebrew and MacPorts paths for findings headers and libraries.
Add -x objective-c++ to the C++ compile command so that conditionally
compiled ObjectiveC code for OS X can be supported.
Throw a fatal error if the user tries to enable ENABLE_ASM_CORE,
ENABLE_ASM_SCALERS or ENABLE_MMX on AMD64, as this is not supported yet.
If ENABLE_ASM_SCALERS is enabled, try to find a Homebrew or MacPorts
nasm before using the outdated XCode nasm.
For the future, if the user has only the old XCode nasm which does not
support 64 bit objects and the build is 64 bit, throw a fatal error.
For 32 bit builds with the old XCode nasm, use -f macho instead of -f
macho32, which is used if the version of nasm is > 2.0 .
Pass -DMACHO instead of -DELF and, on AMD64 (for the future) -D__AMD64__
for nasm on OS X.
Pass -D__AMD64__ to C++ compilation as well on AMD64, this will help
when we support AMD64 inline assembly.
Add support for automatically linking Homebrew keg-only gettext from
/usr/local/opt/gettext for ENABLE_NLS.
Fix copying Info.plist and vbam.icns to the .app bundle.
Add a key to the Info.plist to support sharp text on retina displays, as
per:
https://wiki.wxwidgets.org/WxMac-specific_topics#Retina_display_support
Set wxWidgets_USE_DEBUG to ON if CMAKE_BUILD_TYPE is "Debug". I'm not
sure this does anything or if I'm doing this correctly though.
Also set wxWidgets_USE_UNICODE to ON. Again, I'm not sure this does
anything or is in the right place.
Fix a bug in the config dir finding code in
wxvbamApp::GetConfigurationPath() updated in 8b8f2f7 to only use the
more top level dirs if there is a vbam.ini in them, not if they are
writable as well, and use the reverse order (starting with user local
dirs) to check for writable dirs and their writable parents. This fixes
a problem with the vbam.ini being written to the Plugins directory of
the .app bundle if it's writable instead of ~/Library/Application
Support/vbam as was intended.
2015-11-17 02:56:23 +00:00
|
|
|
|
|
|
|
# We do not support amd64 asm yet
|
2016-11-27 23:37:24 +00:00
|
|
|
IF(AMD64 AND (ENABLE_ASM_CORE OR ENABLE_ASM_SCALERS OR ENABLE_MMX))
|
more minor improvements for OS X build
Add Homebrew and MacPorts paths for findings headers and libraries.
Add -x objective-c++ to the C++ compile command so that conditionally
compiled ObjectiveC code for OS X can be supported.
Throw a fatal error if the user tries to enable ENABLE_ASM_CORE,
ENABLE_ASM_SCALERS or ENABLE_MMX on AMD64, as this is not supported yet.
If ENABLE_ASM_SCALERS is enabled, try to find a Homebrew or MacPorts
nasm before using the outdated XCode nasm.
For the future, if the user has only the old XCode nasm which does not
support 64 bit objects and the build is 64 bit, throw a fatal error.
For 32 bit builds with the old XCode nasm, use -f macho instead of -f
macho32, which is used if the version of nasm is > 2.0 .
Pass -DMACHO instead of -DELF and, on AMD64 (for the future) -D__AMD64__
for nasm on OS X.
Pass -D__AMD64__ to C++ compilation as well on AMD64, this will help
when we support AMD64 inline assembly.
Add support for automatically linking Homebrew keg-only gettext from
/usr/local/opt/gettext for ENABLE_NLS.
Fix copying Info.plist and vbam.icns to the .app bundle.
Add a key to the Info.plist to support sharp text on retina displays, as
per:
https://wiki.wxwidgets.org/WxMac-specific_topics#Retina_display_support
Set wxWidgets_USE_DEBUG to ON if CMAKE_BUILD_TYPE is "Debug". I'm not
sure this does anything or if I'm doing this correctly though.
Also set wxWidgets_USE_UNICODE to ON. Again, I'm not sure this does
anything or is in the right place.
Fix a bug in the config dir finding code in
wxvbamApp::GetConfigurationPath() updated in 8b8f2f7 to only use the
more top level dirs if there is a vbam.ini in them, not if they are
writable as well, and use the reverse order (starting with user local
dirs) to check for writable dirs and their writable parents. This fixes
a problem with the vbam.ini being written to the Plugins directory of
the .app bundle if it's writable instead of ~/Library/Application
Support/vbam as was intended.
2015-11-17 02:56:23 +00:00
|
|
|
MESSAGE(FATAL_ERROR "The options ASM_CORE, ASM_SCALERS and MMX are not supported on AMD64 yet.")
|
|
|
|
ENDIF()
|
|
|
|
|
2016-11-20 19:11:52 +00:00
|
|
|
IF(ENABLE_ASM_CORE OR ENABLE_ASM_SCALERS)
|
more minor improvements for OS X build
Add Homebrew and MacPorts paths for findings headers and libraries.
Add -x objective-c++ to the C++ compile command so that conditionally
compiled ObjectiveC code for OS X can be supported.
Throw a fatal error if the user tries to enable ENABLE_ASM_CORE,
ENABLE_ASM_SCALERS or ENABLE_MMX on AMD64, as this is not supported yet.
If ENABLE_ASM_SCALERS is enabled, try to find a Homebrew or MacPorts
nasm before using the outdated XCode nasm.
For the future, if the user has only the old XCode nasm which does not
support 64 bit objects and the build is 64 bit, throw a fatal error.
For 32 bit builds with the old XCode nasm, use -f macho instead of -f
macho32, which is used if the version of nasm is > 2.0 .
Pass -DMACHO instead of -DELF and, on AMD64 (for the future) -D__AMD64__
for nasm on OS X.
Pass -D__AMD64__ to C++ compilation as well on AMD64, this will help
when we support AMD64 inline assembly.
Add support for automatically linking Homebrew keg-only gettext from
/usr/local/opt/gettext for ENABLE_NLS.
Fix copying Info.plist and vbam.icns to the .app bundle.
Add a key to the Info.plist to support sharp text on retina displays, as
per:
https://wiki.wxwidgets.org/WxMac-specific_topics#Retina_display_support
Set wxWidgets_USE_DEBUG to ON if CMAKE_BUILD_TYPE is "Debug". I'm not
sure this does anything or if I'm doing this correctly though.
Also set wxWidgets_USE_UNICODE to ON. Again, I'm not sure this does
anything or is in the right place.
Fix a bug in the config dir finding code in
wxvbamApp::GetConfigurationPath() updated in 8b8f2f7 to only use the
more top level dirs if there is a vbam.ini in them, not if they are
writable as well, and use the reverse order (starting with user local
dirs) to check for writable dirs and their writable parents. This fixes
a problem with the vbam.ini being written to the Plugins directory of
the .app bundle if it's writable instead of ~/Library/Application
Support/vbam as was intended.
2015-11-17 02:56:23 +00:00
|
|
|
ENABLE_LANGUAGE(ASM_NASM)
|
2016-11-20 19:11:52 +00:00
|
|
|
SET(ASM_ENABLED ON)
|
|
|
|
ENDIF()
|
2011-02-24 11:14:59 +00:00
|
|
|
|
2010-03-15 03:36:45 +00:00
|
|
|
# Look for some dependencies using CMake scripts
|
2016-10-26 23:58:21 +00:00
|
|
|
FIND_PACKAGE(ZLIB REQUIRED)
|
|
|
|
FIND_PACKAGE(OpenGL REQUIRED)
|
|
|
|
|
2017-01-25 18:53:05 +00:00
|
|
|
# TODO: make static on mac and fedora cross-compiles
|
2016-10-26 23:58:21 +00:00
|
|
|
FIND_PACKAGE(PNG REQUIRED)
|
|
|
|
|
2016-12-11 07:28:28 +00:00
|
|
|
IF(APPLE AND NOT MACPORTS)
|
2016-10-26 23:58:21 +00:00
|
|
|
SET(SDL2_STATIC ON)
|
2016-12-11 07:28:28 +00:00
|
|
|
ENDIF()
|
2016-10-26 23:58:21 +00:00
|
|
|
|
2017-01-25 18:53:05 +00:00
|
|
|
IF(EXISTS /etc/redhat-release)
|
|
|
|
SET(FEDORA_HOST ON)
|
|
|
|
ENDIF()
|
|
|
|
|
|
|
|
IF(WINDOWS AND FEDORA_HOST)
|
|
|
|
SET(SDL2_STATIC ON)
|
|
|
|
ENDIF()
|
|
|
|
|
2016-10-26 23:58:21 +00:00
|
|
|
FIND_PACKAGE(SDL2 REQUIRED)
|
|
|
|
ADD_DEFINITIONS(${SDL2_DEFINITIONS})
|
2011-02-24 11:14:59 +00:00
|
|
|
|
|
|
|
if( ENABLE_LINK )
|
2016-11-14 18:56:50 +00:00
|
|
|
# msys2 does not have static sfml libs atm
|
2016-12-21 21:02:55 +00:00
|
|
|
# while on mxe we use static libs
|
|
|
|
if(WIN32 AND ((NOT (MINGW AND MSYS)) OR CMAKE_TOOLCHAIN_FILE MATCHES mxe))
|
2015-05-21 18:42:02 +00:00
|
|
|
set(SFML_STATIC_LIBRARIES TRUE)
|
2016-11-14 18:56:50 +00:00
|
|
|
endif()
|
2016-11-10 11:39:45 +00:00
|
|
|
FIND_PACKAGE ( SFML 2 COMPONENTS network system REQUIRED )
|
2011-02-24 11:14:59 +00:00
|
|
|
endif( ENABLE_LINK )
|
2016-10-26 23:58:21 +00:00
|
|
|
|
2011-05-25 11:55:46 +00:00
|
|
|
# set the standard libraries all ports use
|
|
|
|
SET(VBAMCORE_LIBS
|
|
|
|
vbamcore
|
|
|
|
fex
|
2015-11-19 02:34:38 +00:00
|
|
|
${SDL2_LIBRARY}
|
2015-05-06 01:27:09 +00:00
|
|
|
${SFML_LIBRARIES}
|
2011-05-25 11:55:46 +00:00
|
|
|
${OPENGL_LIBRARIES}
|
|
|
|
${ZLIB_LIBRARY}
|
2015-03-27 17:48:42 +00:00
|
|
|
${PNG_LIBRARY}
|
|
|
|
)
|
2011-02-24 11:14:59 +00:00
|
|
|
|
2011-05-24 07:39:29 +00:00
|
|
|
if(ENABLE_FFMPEG)
|
|
|
|
FIND_PACKAGE ( PkgConfig REQUIRED )
|
|
|
|
|
|
|
|
PKG_CHECK_MODULES(FFMPEG REQUIRED libavcodec libavformat libswscale libavutil)
|
|
|
|
endif(ENABLE_FFMPEG)
|
|
|
|
|
|
|
|
if(NOT ENABLE_FFMPEG)
|
|
|
|
ADD_DEFINITIONS(-DNO_FFMPEG)
|
|
|
|
endif(NOT ENABLE_FFMPEG)
|
|
|
|
|
2011-02-24 11:14:59 +00:00
|
|
|
IF( ENABLE_LIRC )
|
2008-07-10 23:41:29 +00:00
|
|
|
SET( WITHLIRC 1 )
|
2011-02-24 11:14:59 +00:00
|
|
|
ELSE( ENABLE_LIRC )
|
2008-08-03 21:02:37 +00:00
|
|
|
SET( WITHLIRC 0 )
|
2011-02-24 11:14:59 +00:00
|
|
|
ENDIF( ENABLE_LIRC )
|
2008-06-06 10:17:20 +00:00
|
|
|
|
2017-05-24 11:25:45 +00:00
|
|
|
INCLUDE(GNUInstallDirs)
|
2008-06-06 10:17:20 +00:00
|
|
|
|
|
|
|
# C defines
|
2017-05-24 11:25:45 +00:00
|
|
|
ADD_DEFINITIONS (-DHAVE_NETINET_IN_H -DHAVE_ARPA_INET_H -DHAVE_ZLIB_H -DFINAL_VERSION -DSDL -DUSE_OPENGL -DSYSCONF_INSTALL_DIR=\\\""${CMAKE_INSTALL_FULL_SYSCONFDIR}"\\\" -DWITH_LIRC=${WITHLIRC})
|
|
|
|
ADD_DEFINITIONS (-DVERSION=\\\""${VERSION}"\\\" -DPKGDATADIR=\\\""${CMAKE_INSTALL_FULL_DATADIR}/vbam"\\\" -DPACKAGE=)
|
2008-06-06 10:17:20 +00:00
|
|
|
|
2011-05-25 11:55:46 +00:00
|
|
|
if( ENABLE_LINK )
|
2012-09-07 19:09:16 +00:00
|
|
|
# IPC linking code needs sem_timedwait which can be either in librt or pthreads
|
2011-05-25 11:55:46 +00:00
|
|
|
FIND_LIBRARY(RT_LIB rt)
|
|
|
|
IF(RT_LIB)
|
2012-09-07 19:09:16 +00:00
|
|
|
SET(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${RT_LIB})
|
2011-05-25 11:55:46 +00:00
|
|
|
SET(VBAMCORE_LIBS ${VBAMCORE_LIBS} ${RT_LIB})
|
|
|
|
ENDIF(RT_LIB)
|
2015-05-18 02:41:21 +00:00
|
|
|
|
2012-09-07 19:09:16 +00:00
|
|
|
FIND_LIBRARY(PTHREAD_LIB pthread)
|
|
|
|
IF(PTHREAD_LIB)
|
|
|
|
SET(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${PTHREAD_LIB})
|
|
|
|
SET(VBAMCORE_LIBS ${VBAMCORE_LIBS} ${PTHREAD_LIB})
|
|
|
|
ENDIF(PTHREAD_LIB)
|
2015-05-18 02:41:21 +00:00
|
|
|
|
2011-05-25 11:55:46 +00:00
|
|
|
INCLUDE(CheckFunctionExists)
|
|
|
|
CHECK_FUNCTION_EXISTS(sem_timedwait SEM_TIMEDWAIT)
|
|
|
|
IF( SEM_TIMEDWAIT)
|
|
|
|
ADD_DEFINITIONS (-DHAVE_SEM_TIMEDWAIT)
|
|
|
|
ENDIF( SEM_TIMEDWAIT)
|
|
|
|
else( ENABLE_LINK )
|
2011-02-20 19:03:38 +00:00
|
|
|
ADD_DEFINITIONS (-DNO_LINK)
|
2011-05-25 11:55:46 +00:00
|
|
|
endif( ENABLE_LINK )
|
2011-02-20 12:22:58 +00:00
|
|
|
|
2008-06-16 20:18:49 +00:00
|
|
|
# The debugger is enabled by default
|
2011-02-24 11:14:59 +00:00
|
|
|
if( NOT ENABLE_DEBUGGER )
|
2008-06-16 20:18:49 +00:00
|
|
|
ADD_DEFINITIONS (-DNO_DEBUGGER)
|
2011-02-24 11:14:59 +00:00
|
|
|
else( NOT ENABLE_DEBUGGER )
|
2008-06-16 20:18:49 +00:00
|
|
|
ADD_DEFINITIONS (-DBKPT_SUPPORT)
|
2011-02-24 11:14:59 +00:00
|
|
|
endif( NOT ENABLE_DEBUGGER )
|
2008-06-16 20:18:49 +00:00
|
|
|
|
2008-06-06 10:17:20 +00:00
|
|
|
# The ASM core is disabled by default because we don't know on which platform we are
|
2011-02-24 11:14:59 +00:00
|
|
|
IF( NOT ENABLE_ASM_CORE )
|
2008-06-06 10:17:20 +00:00
|
|
|
ADD_DEFINITIONS (-DC_CORE)
|
2011-02-24 11:14:59 +00:00
|
|
|
ENDIF( NOT ENABLE_ASM_CORE )
|
2008-06-06 10:17:20 +00:00
|
|
|
|
2011-02-24 13:06:17 +00:00
|
|
|
# Enable internationalization
|
|
|
|
if( ENABLE_NLS )
|
2011-02-24 17:01:10 +00:00
|
|
|
SET( LOCALEDIR ${CMAKE_INSTALL_PREFIX}/share/locale )
|
|
|
|
ADD_DEFINITIONS ( -DENABLE_NLS )
|
2017-02-11 13:52:42 +00:00
|
|
|
ADD_DEFINITIONS ( -DLOCALEDIR=\\\""${LOCALEDIR}"\\\" )
|
2011-05-25 11:55:46 +00:00
|
|
|
# for now, only GBALink.cpp uses gettext() directly
|
more minor improvements for OS X build
Add Homebrew and MacPorts paths for findings headers and libraries.
Add -x objective-c++ to the C++ compile command so that conditionally
compiled ObjectiveC code for OS X can be supported.
Throw a fatal error if the user tries to enable ENABLE_ASM_CORE,
ENABLE_ASM_SCALERS or ENABLE_MMX on AMD64, as this is not supported yet.
If ENABLE_ASM_SCALERS is enabled, try to find a Homebrew or MacPorts
nasm before using the outdated XCode nasm.
For the future, if the user has only the old XCode nasm which does not
support 64 bit objects and the build is 64 bit, throw a fatal error.
For 32 bit builds with the old XCode nasm, use -f macho instead of -f
macho32, which is used if the version of nasm is > 2.0 .
Pass -DMACHO instead of -DELF and, on AMD64 (for the future) -D__AMD64__
for nasm on OS X.
Pass -D__AMD64__ to C++ compilation as well on AMD64, this will help
when we support AMD64 inline assembly.
Add support for automatically linking Homebrew keg-only gettext from
/usr/local/opt/gettext for ENABLE_NLS.
Fix copying Info.plist and vbam.icns to the .app bundle.
Add a key to the Info.plist to support sharp text on retina displays, as
per:
https://wiki.wxwidgets.org/WxMac-specific_topics#Retina_display_support
Set wxWidgets_USE_DEBUG to ON if CMAKE_BUILD_TYPE is "Debug". I'm not
sure this does anything or if I'm doing this correctly though.
Also set wxWidgets_USE_UNICODE to ON. Again, I'm not sure this does
anything or is in the right place.
Fix a bug in the config dir finding code in
wxvbamApp::GetConfigurationPath() updated in 8b8f2f7 to only use the
more top level dirs if there is a vbam.ini in them, not if they are
writable as well, and use the reverse order (starting with user local
dirs) to check for writable dirs and their writable parents. This fixes
a problem with the vbam.ini being written to the Plugins directory of
the .app bundle if it's writable instead of ~/Library/Application
Support/vbam as was intended.
2015-11-17 02:56:23 +00:00
|
|
|
IF(APPLE)
|
|
|
|
# use Homebrew gettext if available
|
|
|
|
IF(EXISTS "/usr/local/opt/gettext")
|
|
|
|
SET(CMAKE_INCLUDE_PATH "${CMAKE_INCLUDE_PATH};/usr/local/opt/gettext/include")
|
|
|
|
SET(CMAKE_LIBRARY_PATH "${CMAKE_LIBRARY_PATH};/usr/local/opt/gettext/lib")
|
|
|
|
SET(CMAKE_PROGRAM_PATH "${CMAKE_PROGRAM_PATH};/usr/local/opt/gettext/bin")
|
|
|
|
ENDIF()
|
|
|
|
ENDIF()
|
2011-05-25 11:55:46 +00:00
|
|
|
IF(ENABLE_LINK)
|
2016-12-21 21:02:55 +00:00
|
|
|
FIND_PATH(LIBINTL_INC libintl.h)
|
|
|
|
FIND_LIBRARY(LIBINTL_LIB intl)
|
2016-12-31 03:48:23 +00:00
|
|
|
FIND_LIBRARY(LIBICONV_LIB iconv)
|
2016-12-21 21:02:55 +00:00
|
|
|
IF(LIBINTL_LIB)
|
2011-05-25 11:55:46 +00:00
|
|
|
SET(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${LIBINTL_LIB})
|
|
|
|
SET(VBAMCORE_LIBS ${VBAMCORE_LIBS} ${LIBINTL_LIB})
|
2016-12-21 21:02:55 +00:00
|
|
|
ENDIF(LIBINTL_LIB)
|
2016-12-31 03:48:23 +00:00
|
|
|
IF(LIBICONV_LIB)
|
|
|
|
SET(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${LIBICONV_LIB})
|
|
|
|
SET(VBAMCORE_LIBS ${VBAMCORE_LIBS} ${LIBICONV_LIB})
|
|
|
|
ENDIF(LIBICONV_LIB)
|
2011-05-25 11:55:46 +00:00
|
|
|
INCLUDE(CheckFunctionExists)
|
|
|
|
CHECK_FUNCTION_EXISTS(gettext GETTEXT_FN)
|
2016-12-21 21:02:55 +00:00
|
|
|
IF(NOT (LIBINTL_INC OR GETTEXT_FN))
|
more minor improvements for OS X build
Add Homebrew and MacPorts paths for findings headers and libraries.
Add -x objective-c++ to the C++ compile command so that conditionally
compiled ObjectiveC code for OS X can be supported.
Throw a fatal error if the user tries to enable ENABLE_ASM_CORE,
ENABLE_ASM_SCALERS or ENABLE_MMX on AMD64, as this is not supported yet.
If ENABLE_ASM_SCALERS is enabled, try to find a Homebrew or MacPorts
nasm before using the outdated XCode nasm.
For the future, if the user has only the old XCode nasm which does not
support 64 bit objects and the build is 64 bit, throw a fatal error.
For 32 bit builds with the old XCode nasm, use -f macho instead of -f
macho32, which is used if the version of nasm is > 2.0 .
Pass -DMACHO instead of -DELF and, on AMD64 (for the future) -D__AMD64__
for nasm on OS X.
Pass -D__AMD64__ to C++ compilation as well on AMD64, this will help
when we support AMD64 inline assembly.
Add support for automatically linking Homebrew keg-only gettext from
/usr/local/opt/gettext for ENABLE_NLS.
Fix copying Info.plist and vbam.icns to the .app bundle.
Add a key to the Info.plist to support sharp text on retina displays, as
per:
https://wiki.wxwidgets.org/WxMac-specific_topics#Retina_display_support
Set wxWidgets_USE_DEBUG to ON if CMAKE_BUILD_TYPE is "Debug". I'm not
sure this does anything or if I'm doing this correctly though.
Also set wxWidgets_USE_UNICODE to ON. Again, I'm not sure this does
anything or is in the right place.
Fix a bug in the config dir finding code in
wxvbamApp::GetConfigurationPath() updated in 8b8f2f7 to only use the
more top level dirs if there is a vbam.ini in them, not if they are
writable as well, and use the reverse order (starting with user local
dirs) to check for writable dirs and their writable parents. This fixes
a problem with the vbam.ini being written to the Plugins directory of
the .app bundle if it's writable instead of ~/Library/Application
Support/vbam as was intended.
2015-11-17 02:56:23 +00:00
|
|
|
MESSAGE(FATAL_ERROR "NLS requires libintl/gettext")
|
2016-12-21 21:02:55 +00:00
|
|
|
ENDIF()
|
2011-05-25 11:55:46 +00:00
|
|
|
INCLUDE_DIRECTORIES(${LIBINTL_INC})
|
|
|
|
ENDIF(ENABLE_LINK)
|
2011-02-24 13:06:17 +00:00
|
|
|
endif( ENABLE_NLS )
|
|
|
|
|
2016-11-20 19:11:52 +00:00
|
|
|
# Win32 deps submodule
|
more minor improvements for OS X build
Add Homebrew and MacPorts paths for findings headers and libraries.
Add -x objective-c++ to the C++ compile command so that conditionally
compiled ObjectiveC code for OS X can be supported.
Throw a fatal error if the user tries to enable ENABLE_ASM_CORE,
ENABLE_ASM_SCALERS or ENABLE_MMX on AMD64, as this is not supported yet.
If ENABLE_ASM_SCALERS is enabled, try to find a Homebrew or MacPorts
nasm before using the outdated XCode nasm.
For the future, if the user has only the old XCode nasm which does not
support 64 bit objects and the build is 64 bit, throw a fatal error.
For 32 bit builds with the old XCode nasm, use -f macho instead of -f
macho32, which is used if the version of nasm is > 2.0 .
Pass -DMACHO instead of -DELF and, on AMD64 (for the future) -D__AMD64__
for nasm on OS X.
Pass -D__AMD64__ to C++ compilation as well on AMD64, this will help
when we support AMD64 inline assembly.
Add support for automatically linking Homebrew keg-only gettext from
/usr/local/opt/gettext for ENABLE_NLS.
Fix copying Info.plist and vbam.icns to the .app bundle.
Add a key to the Info.plist to support sharp text on retina displays, as
per:
https://wiki.wxwidgets.org/WxMac-specific_topics#Retina_display_support
Set wxWidgets_USE_DEBUG to ON if CMAKE_BUILD_TYPE is "Debug". I'm not
sure this does anything or if I'm doing this correctly though.
Also set wxWidgets_USE_UNICODE to ON. Again, I'm not sure this does
anything or is in the right place.
Fix a bug in the config dir finding code in
wxvbamApp::GetConfigurationPath() updated in 8b8f2f7 to only use the
more top level dirs if there is a vbam.ini in them, not if they are
writable as well, and use the reverse order (starting with user local
dirs) to check for writable dirs and their writable parents. This fixes
a problem with the vbam.ini being written to the Plugins directory of
the .app bundle if it's writable instead of ~/Library/Application
Support/vbam as was intended.
2015-11-17 02:56:23 +00:00
|
|
|
IF(WIN32)
|
2016-12-21 21:02:55 +00:00
|
|
|
IF(NOT EXISTS "${CMAKE_SOURCE_DIR}/dependencies/mingw-xaudio/include" AND EXISTS "${CMAKE_SOURCE_DIR}/.git")
|
|
|
|
MESSAGE(FATAL_ERROR "Please pull in git submodules, e.g.\nrun: git submodule update --init --recursive")
|
2016-11-20 19:11:52 +00:00
|
|
|
ENDIF()
|
|
|
|
|
2016-12-21 21:02:55 +00:00
|
|
|
INCLUDE_DIRECTORIES("${CMAKE_SOURCE_DIR}/dependencies/mingw-xaudio/include")
|
more minor improvements for OS X build
Add Homebrew and MacPorts paths for findings headers and libraries.
Add -x objective-c++ to the C++ compile command so that conditionally
compiled ObjectiveC code for OS X can be supported.
Throw a fatal error if the user tries to enable ENABLE_ASM_CORE,
ENABLE_ASM_SCALERS or ENABLE_MMX on AMD64, as this is not supported yet.
If ENABLE_ASM_SCALERS is enabled, try to find a Homebrew or MacPorts
nasm before using the outdated XCode nasm.
For the future, if the user has only the old XCode nasm which does not
support 64 bit objects and the build is 64 bit, throw a fatal error.
For 32 bit builds with the old XCode nasm, use -f macho instead of -f
macho32, which is used if the version of nasm is > 2.0 .
Pass -DMACHO instead of -DELF and, on AMD64 (for the future) -D__AMD64__
for nasm on OS X.
Pass -D__AMD64__ to C++ compilation as well on AMD64, this will help
when we support AMD64 inline assembly.
Add support for automatically linking Homebrew keg-only gettext from
/usr/local/opt/gettext for ENABLE_NLS.
Fix copying Info.plist and vbam.icns to the .app bundle.
Add a key to the Info.plist to support sharp text on retina displays, as
per:
https://wiki.wxwidgets.org/WxMac-specific_topics#Retina_display_support
Set wxWidgets_USE_DEBUG to ON if CMAKE_BUILD_TYPE is "Debug". I'm not
sure this does anything or if I'm doing this correctly though.
Also set wxWidgets_USE_UNICODE to ON. Again, I'm not sure this does
anything or is in the right place.
Fix a bug in the config dir finding code in
wxvbamApp::GetConfigurationPath() updated in 8b8f2f7 to only use the
more top level dirs if there is a vbam.ini in them, not if they are
writable as well, and use the reverse order (starting with user local
dirs) to check for writable dirs and their writable parents. This fixes
a problem with the vbam.ini being written to the Plugins directory of
the .app bundle if it's writable instead of ~/Library/Application
Support/vbam as was intended.
2015-11-17 02:56:23 +00:00
|
|
|
|
2017-02-11 14:33:08 +00:00
|
|
|
IF(MSVC)
|
|
|
|
SET(DEPS_MSVC "${CMAKE_SOURCE_DIR}/dependencies/msvc")
|
|
|
|
INCLUDE_DIRECTORIES("${DEPS_MSVC}") # for GL/glext.h and getopt.h
|
2017-02-11 05:39:50 +00:00
|
|
|
ENDIF()
|
2017-02-11 14:33:08 +00:00
|
|
|
ENDIF()
|
2017-02-11 05:39:50 +00:00
|
|
|
|
2016-11-20 19:11:52 +00:00
|
|
|
# Compiler flags
|
|
|
|
|
2017-02-03 20:39:10 +00:00
|
|
|
IF(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID STREQUAL Clang)
|
2016-11-27 23:37:24 +00:00
|
|
|
SET(LTO_FLAG "")
|
|
|
|
IF(ENABLE_LTO)
|
|
|
|
IF(CMAKE_COMPILER_IS_GNUCXX)
|
|
|
|
SET(LTO_FLAG -flto=10)
|
|
|
|
ELSE()
|
|
|
|
SET(LTO_FLAG -flto)
|
|
|
|
ENDIF()
|
|
|
|
ENDIF(ENABLE_LTO)
|
2016-11-23 11:13:33 +00:00
|
|
|
|
2016-11-21 20:37:21 +00:00
|
|
|
# common optimization flags
|
2017-02-03 20:39:10 +00:00
|
|
|
IF(NOT (APPLE AND CMAKE_CXX_COMPILER_ID STREQUAL Clang AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.3))
|
|
|
|
SET(MY_C_OPT_FLAGS -O2 -mtune=generic -fomit-frame-pointer ${LTO_FLAG})
|
|
|
|
ELSE()
|
|
|
|
# LTO and -fomit-frame-pointer generate broken binaries on Lion with XCode 4.2 tools
|
|
|
|
SET(MY_C_OPT_FLAGS -O2 -mtune=generic)
|
|
|
|
ENDIF()
|
2016-11-21 20:37:21 +00:00
|
|
|
|
|
|
|
# common debug flags
|
|
|
|
IF(CMAKE_COMPILER_IS_GNUCXX)
|
2017-01-29 18:14:34 +00:00
|
|
|
SET(MY_C_DBG_FLAGS -ggdb3 -Og)
|
2016-11-21 20:37:21 +00:00
|
|
|
ELSE()
|
2017-01-29 18:14:34 +00:00
|
|
|
SET(MY_C_DBG_FLAGS -g)
|
2016-11-21 20:37:21 +00:00
|
|
|
ENDIF()
|
|
|
|
|
2016-11-20 19:11:52 +00:00
|
|
|
# common flags
|
2017-03-08 00:15:02 +00:00
|
|
|
SET(MY_C_FLAGS -pipe -Wformat -Wformat-security -D_FORTIFY_SOURCE=2 -feliminate-unused-debug-types)
|
|
|
|
|
|
|
|
IF(NOT WIN32)
|
|
|
|
SET(MY_C_FLAGS ${MY_C_FLAGS} -fPIC)
|
|
|
|
ENDIF()
|
2016-11-20 19:11:52 +00:00
|
|
|
|
2017-01-29 18:14:34 +00:00
|
|
|
INCLUDE(CheckCXXCompilerFlag)
|
|
|
|
|
2017-03-12 03:19:47 +00:00
|
|
|
# check if ssp flags are supported for this version of gcc
|
|
|
|
IF(CMAKE_COMPILER_IS_GNUCXX)
|
|
|
|
CHECK_CXX_COMPILER_FLAG(-fstack-protector-strong F_STACK_PROTECTOR_STRONG_FLAG)
|
|
|
|
|
|
|
|
IF(F_STACK_PROTECTOR_STRONG_FLAG)
|
|
|
|
SET(MY_C_FLAGS ${MY_C_FLAGS} -fstack-protector-strong)
|
2017-01-29 18:14:34 +00:00
|
|
|
|
2017-03-12 03:19:47 +00:00
|
|
|
CHECK_CXX_COMPILER_FLAG("--param ssp-buffer-size=4" SSP_BUFFER_SIZE_FLAG)
|
2017-01-29 18:14:34 +00:00
|
|
|
|
2017-03-12 03:19:47 +00:00
|
|
|
IF(SSP_BUFFER_SIZE_FLAG)
|
2017-03-14 17:33:24 +00:00
|
|
|
# we do not add it to MY_C_FLAGS because this breaks things like CMAKE_REQUIRED_LIBRARIES
|
|
|
|
# which misinterpret compiler flags without leading dashes
|
|
|
|
ADD_COMPILE_OPTIONS(--param ssp-buffer-size=4)
|
2017-03-12 03:19:47 +00:00
|
|
|
ENDIF()
|
2017-01-29 18:14:34 +00:00
|
|
|
ENDIF()
|
|
|
|
ENDIF()
|
|
|
|
|
2016-11-20 19:11:52 +00:00
|
|
|
IF(MINGW)
|
2017-01-29 18:14:34 +00:00
|
|
|
SET(MY_C_FLAGS ${MY_C_FLAGS} -static-libgcc -static-libstdc++)
|
2016-11-20 19:11:52 +00:00
|
|
|
ENDIF(MINGW)
|
|
|
|
|
2016-11-21 20:37:21 +00:00
|
|
|
IF(CMAKE_BUILD_TYPE STREQUAL Debug)
|
2017-01-29 18:14:34 +00:00
|
|
|
SET(MY_C_FLAGS ${MY_C_FLAGS} ${MY_C_DBG_FLAGS} -Wall -Wextra)
|
2016-11-20 19:11:52 +00:00
|
|
|
ELSE()
|
2017-01-29 18:14:34 +00:00
|
|
|
SET(MY_C_FLAGS ${MY_C_FLAGS} ${MY_C_OPT_FLAGS} -Wno-error)
|
2016-11-20 19:11:52 +00:00
|
|
|
ENDIF()
|
|
|
|
|
|
|
|
FOREACH(C_COMPILE_FLAG ${MY_C_FLAGS})
|
2017-01-29 18:14:34 +00:00
|
|
|
ADD_COMPILE_OPTIONS(${C_COMPILE_FLAG})
|
2016-11-20 19:11:52 +00:00
|
|
|
ENDFOREACH()
|
|
|
|
|
2017-03-08 00:15:02 +00:00
|
|
|
SET(MY_CXX_FLAGS -std=gnu++11 -fpermissive -fexceptions)
|
|
|
|
|
|
|
|
FOREACH(ARG ${MY_CXX_FLAGS})
|
|
|
|
SET(MY_CXX_FLAGS_STR "${MY_CXX_FLAGS_STR} ${ARG}")
|
|
|
|
ENDFOREACH()
|
|
|
|
|
2017-02-12 12:41:57 +00:00
|
|
|
# These must be set for C++ only, and we can't use generator expressions in
|
|
|
|
# ADD_COMPILE_OPTIONS because that's a cmake 3.3 feature and we need 2.8.12
|
|
|
|
# compat for Ubuntu 14.
|
2017-03-08 00:15:02 +00:00
|
|
|
STRING(REGEX REPLACE "<FLAGS>" "<FLAGS> ${MY_CXX_FLAGS_STR} " CMAKE_CXX_COMPILE_OBJECT ${CMAKE_CXX_COMPILE_OBJECT})
|
2016-11-21 21:53:16 +00:00
|
|
|
|
|
|
|
FOREACH(ARG ${MY_C_FLAGS})
|
2017-03-08 00:15:02 +00:00
|
|
|
SET(MY_C_FLAGS_STR "${MY_C_FLAGS_STR} ${ARG}")
|
2016-11-21 21:53:16 +00:00
|
|
|
ENDFOREACH()
|
|
|
|
|
|
|
|
# need all flags for linking, because of -flto etc.
|
2017-03-08 00:15:02 +00:00
|
|
|
SET(CMAKE_C_LINK_EXECUTABLE "${CMAKE_C_LINK_EXECUTABLE} ${MY_C_FLAGS_STR}")
|
|
|
|
SET(CMAKE_CXX_LINK_EXECUTABLE "${CMAKE_CXX_LINK_EXECUTABLE} ${MY_C_FLAGS_STR}")
|
2016-11-21 20:37:21 +00:00
|
|
|
|
2016-11-20 19:11:52 +00:00
|
|
|
# for the gcc -fstack-protector* flags we need libssp
|
2016-11-21 20:37:21 +00:00
|
|
|
# we also have to use the gcc- binutils for LTO to work
|
2016-11-20 19:11:52 +00:00
|
|
|
IF(CMAKE_COMPILER_IS_GNUCXX)
|
2016-12-14 13:48:37 +00:00
|
|
|
IF(ENABLE_LTO)
|
|
|
|
INCLUDE(UseGCCBinUtilsWrappers)
|
|
|
|
ENDIF(ENABLE_LTO)
|
2016-11-21 20:37:21 +00:00
|
|
|
|
|
|
|
IF(WIN32)
|
|
|
|
SET(SSP_STATIC ON)
|
|
|
|
ENDIF(WIN32)
|
|
|
|
|
|
|
|
FIND_PACKAGE(SSP)
|
|
|
|
|
|
|
|
IF(SSP_LIBRARY)
|
2017-03-08 00:15:02 +00:00
|
|
|
SET(MY_C_LINKER_FLAGS ${MY_C_LINKER_FLAGS} ${SSP_LIBRARY})
|
2016-11-21 20:37:21 +00:00
|
|
|
ENDIF(SSP_LIBRARY)
|
|
|
|
|
2017-03-08 00:15:02 +00:00
|
|
|
SET(MY_C_LINKER_FLAGS ${MY_C_LINKER_FLAGS} -Wl,-allow-multiple-definition)
|
2016-11-20 19:11:52 +00:00
|
|
|
ENDIF()
|
2017-03-08 00:15:02 +00:00
|
|
|
|
|
|
|
# set linker flags
|
|
|
|
FOREACH(ARG ${MY_C_LINKER_FLAGS})
|
|
|
|
SET(MY_C_LINKER_FLAGS_STR "${MY_C_LINKER_FLAGS_STR} ${ARG}")
|
|
|
|
ENDFOREACH()
|
|
|
|
|
|
|
|
SET(CMAKE_C_LINK_EXECUTABLE "${CMAKE_C_LINK_EXECUTABLE} ${MY_C_LINKER_FLAGS_STR}")
|
|
|
|
SET(CMAKE_CXX_LINK_EXECUTABLE "${CMAKE_CXX_LINK_EXECUTABLE} ${MY_C_LINKER_FLAGS_STR}")
|
more minor improvements for OS X build
Add Homebrew and MacPorts paths for findings headers and libraries.
Add -x objective-c++ to the C++ compile command so that conditionally
compiled ObjectiveC code for OS X can be supported.
Throw a fatal error if the user tries to enable ENABLE_ASM_CORE,
ENABLE_ASM_SCALERS or ENABLE_MMX on AMD64, as this is not supported yet.
If ENABLE_ASM_SCALERS is enabled, try to find a Homebrew or MacPorts
nasm before using the outdated XCode nasm.
For the future, if the user has only the old XCode nasm which does not
support 64 bit objects and the build is 64 bit, throw a fatal error.
For 32 bit builds with the old XCode nasm, use -f macho instead of -f
macho32, which is used if the version of nasm is > 2.0 .
Pass -DMACHO instead of -DELF and, on AMD64 (for the future) -D__AMD64__
for nasm on OS X.
Pass -D__AMD64__ to C++ compilation as well on AMD64, this will help
when we support AMD64 inline assembly.
Add support for automatically linking Homebrew keg-only gettext from
/usr/local/opt/gettext for ENABLE_NLS.
Fix copying Info.plist and vbam.icns to the .app bundle.
Add a key to the Info.plist to support sharp text on retina displays, as
per:
https://wiki.wxwidgets.org/WxMac-specific_topics#Retina_display_support
Set wxWidgets_USE_DEBUG to ON if CMAKE_BUILD_TYPE is "Debug". I'm not
sure this does anything or if I'm doing this correctly though.
Also set wxWidgets_USE_UNICODE to ON. Again, I'm not sure this does
anything or is in the right place.
Fix a bug in the config dir finding code in
wxvbamApp::GetConfigurationPath() updated in 8b8f2f7 to only use the
more top level dirs if there is a vbam.ini in them, not if they are
writable as well, and use the reverse order (starting with user local
dirs) to check for writable dirs and their writable parents. This fixes
a problem with the vbam.ini being written to the Plugins directory of
the .app bundle if it's writable instead of ~/Library/Application
Support/vbam as was intended.
2015-11-17 02:56:23 +00:00
|
|
|
ENDIF()
|
2011-02-26 12:11:06 +00:00
|
|
|
|
2016-11-20 19:11:52 +00:00
|
|
|
# Assembler flags
|
2008-06-06 10:17:20 +00:00
|
|
|
|
2016-11-20 19:11:52 +00:00
|
|
|
IF(ASM_ENABLED)
|
2017-01-31 02:14:33 +00:00
|
|
|
STRING(REGEX REPLACE "<FLAGS>" "-I${CMAKE_SOURCE_DIR}/src/filters/hq/asm/ -O1 -w-orphan-labels" CMAKE_ASM_NASM_COMPILE_OBJECT ${CMAKE_ASM_NASM_COMPILE_OBJECT})
|
2016-11-20 19:11:52 +00:00
|
|
|
ENDIF(ASM_ENABLED)
|
|
|
|
|
|
|
|
IF(APPLE)
|
|
|
|
ADD_DEFINITIONS(-DMACHO)
|
|
|
|
ELSEIF("${CMAKE_SYSTEM}" MATCHES "Linux")
|
|
|
|
ADD_DEFINITIONS(-DELF)
|
|
|
|
ENDIF()
|
2015-05-18 03:04:34 +00:00
|
|
|
|
2016-11-27 23:37:24 +00:00
|
|
|
IF(AMD64)
|
2016-11-20 19:11:52 +00:00
|
|
|
ADD_DEFINITIONS(-D__AMD64__)
|
|
|
|
ENDIF()
|
2015-05-18 03:04:34 +00:00
|
|
|
|
2015-03-27 17:48:42 +00:00
|
|
|
add_subdirectory (fex)
|
2010-03-15 03:36:45 +00:00
|
|
|
|
2008-06-06 10:17:20 +00:00
|
|
|
SET(SRC_MAIN
|
|
|
|
src/Util.cpp
|
2015-04-18 06:53:55 +00:00
|
|
|
src/common/ConfigManager.cpp
|
|
|
|
src/common/dictionary.c
|
|
|
|
src/common/iniparser.c
|
2009-01-01 14:21:18 +00:00
|
|
|
src/common/Patch.cpp
|
|
|
|
src/common/memgzio.c
|
2011-05-24 07:49:00 +00:00
|
|
|
src/common/SoundSDL.cpp
|
2008-06-06 10:17:20 +00:00
|
|
|
)
|
|
|
|
|
2017-02-11 02:57:35 +00:00
|
|
|
if(MSVC)
|
|
|
|
SET(SRC_MAIN ${SRC_MAIN} "dependencies/msvc/getopt.c")
|
|
|
|
endif(MSVC)
|
|
|
|
|
2016-06-07 20:26:53 +00:00
|
|
|
SET(HDR_MAIN
|
|
|
|
src/AutoBuild.h
|
|
|
|
src/System.h
|
|
|
|
src/Util.h
|
|
|
|
src/version.h
|
|
|
|
src/common/array.h
|
|
|
|
src/common/ConfigManager.h
|
|
|
|
src/common/dictionary.h
|
|
|
|
src/common/iniparser.h
|
|
|
|
src/common/memgzio.h
|
|
|
|
src/common/Port.h
|
|
|
|
src/common/SoundDriver.h
|
|
|
|
src/common/SoundSDL.h
|
|
|
|
)
|
|
|
|
|
2017-02-11 02:57:35 +00:00
|
|
|
if(MSVC)
|
|
|
|
SET(HDR_MAIN ${HDR_MAIN} "dependencies/msvc/getopt.h")
|
|
|
|
endif(MSVC)
|
|
|
|
|
2011-05-24 07:39:29 +00:00
|
|
|
if(ENABLE_FFMPEG)
|
|
|
|
SET(SRC_MAIN ${SRC_MAIN} src/common/ffmpeg.cpp)
|
2016-06-07 20:26:53 +00:00
|
|
|
SET(HDR_MAIN ${HDR_MAIN} src/common/ffmpeg.h)
|
2011-05-24 07:39:29 +00:00
|
|
|
endif(ENABLE_FFMPEG)
|
|
|
|
|
2016-06-07 20:26:53 +00:00
|
|
|
if(ENABLE_NLS)
|
|
|
|
SET(HDR_MAIN ${HDR_MAIN} src/NLS.h)
|
|
|
|
endif(ENABLE_NLS)
|
|
|
|
|
2009-01-01 15:20:03 +00:00
|
|
|
SET(SRC_GBA
|
|
|
|
src/gba/agbprint.cpp
|
2009-01-01 16:11:02 +00:00
|
|
|
src/gba/bios.cpp
|
2015-04-02 05:53:57 +00:00
|
|
|
src/gba/BreakpointStructures.cpp
|
2009-01-01 16:11:02 +00:00
|
|
|
src/gba/Cheats.cpp
|
2011-05-24 07:49:00 +00:00
|
|
|
src/gba/CheatSearch.cpp
|
2015-04-02 05:53:57 +00:00
|
|
|
src/gba/debugger-expr-lex.cpp
|
|
|
|
src/gba/debugger-expr-yacc.cpp
|
2009-01-01 16:11:02 +00:00
|
|
|
src/gba/EEprom.cpp
|
2015-03-27 22:50:11 +00:00
|
|
|
src/gba/ereader.cpp
|
2009-01-01 16:11:02 +00:00
|
|
|
src/gba/Flash.cpp
|
2009-01-01 15:20:03 +00:00
|
|
|
src/gba/GBA.cpp
|
|
|
|
src/gba/GBAGfx.cpp
|
2010-03-15 03:36:45 +00:00
|
|
|
src/gba/GBALink.cpp
|
|
|
|
src/gba/GBASockClient.cpp
|
2009-01-01 15:20:03 +00:00
|
|
|
src/gba/GBA-thumb.cpp
|
|
|
|
src/gba/GBA-arm.cpp
|
2009-10-09 14:47:41 +00:00
|
|
|
src/gba/gbafilter.cpp
|
2009-01-01 16:11:02 +00:00
|
|
|
src/gba/Globals.cpp
|
|
|
|
src/gba/Mode0.cpp
|
|
|
|
src/gba/Mode1.cpp
|
|
|
|
src/gba/Mode2.cpp
|
|
|
|
src/gba/Mode3.cpp
|
|
|
|
src/gba/Mode4.cpp
|
|
|
|
src/gba/Mode5.cpp
|
|
|
|
src/gba/RTC.cpp
|
|
|
|
src/gba/Sound.cpp
|
|
|
|
src/gba/Sram.cpp
|
2008-06-06 10:17:20 +00:00
|
|
|
)
|
|
|
|
|
2016-06-07 20:26:53 +00:00
|
|
|
SET(HDR_GBA
|
|
|
|
src/gba/agbprint.h
|
|
|
|
src/gba/bios.h
|
|
|
|
src/gba/BreakpointStructures.h
|
|
|
|
src/gba/Cheats.h
|
|
|
|
src/gba/CheatSearch.h
|
|
|
|
src/gba/debugger-expr-yacc.hpp
|
|
|
|
src/gba/EEprom.h
|
|
|
|
src/gba/ereader.h
|
|
|
|
src/gba/Flash.h
|
|
|
|
src/gba/GBA.h
|
|
|
|
src/gba/GBAcpu.h
|
|
|
|
src/gba/gbafilter.h
|
|
|
|
src/gba/GBAGfx.h
|
|
|
|
src/gba/GBAinline.h
|
|
|
|
src/gba/GBALink.h
|
|
|
|
src/gba/GBASockClient.h
|
|
|
|
src/gba/Globals.h
|
|
|
|
src/gba/RTC.h
|
|
|
|
src/gba/Sound.h
|
|
|
|
src/gba/Sram.h
|
|
|
|
)
|
|
|
|
|
2009-01-01 14:52:03 +00:00
|
|
|
SET(SRC_GB
|
|
|
|
src/gb/GB.cpp
|
|
|
|
src/gb/gbCheats.cpp
|
|
|
|
src/gb/gbDis.cpp
|
|
|
|
src/gb/gbGfx.cpp
|
|
|
|
src/gb/gbGlobals.cpp
|
|
|
|
src/gb/gbMemory.cpp
|
|
|
|
src/gb/gbPrinter.cpp
|
|
|
|
src/gb/gbSGB.cpp
|
|
|
|
src/gb/gbSound.cpp
|
2009-01-01 14:43:18 +00:00
|
|
|
)
|
|
|
|
|
2016-06-07 20:26:53 +00:00
|
|
|
SET(HDR_GB
|
|
|
|
src/gb/gb.h
|
|
|
|
src/gb/gbCheats.h
|
|
|
|
src/gb/gbCodes.h
|
|
|
|
src/gb/gbCodesCB.h
|
|
|
|
src/gb/gbGlobals.h
|
|
|
|
src/gb/gbMemory.h
|
|
|
|
src/gb/gbPrinter.h
|
|
|
|
src/gb/gbSGB.h
|
|
|
|
src/gb/gbSound.h
|
|
|
|
)
|
|
|
|
|
2009-01-01 14:43:18 +00:00
|
|
|
SET(SRC_APU
|
|
|
|
src/apu/Blip_Buffer.cpp
|
|
|
|
src/apu/Effects_Buffer.cpp
|
|
|
|
src/apu/Gb_Apu.cpp
|
|
|
|
src/apu/Gb_Apu_State.cpp
|
|
|
|
src/apu/Gb_Oscs.cpp
|
|
|
|
src/apu/Multi_Buffer.cpp
|
2008-06-06 10:17:20 +00:00
|
|
|
)
|
|
|
|
|
2016-06-07 20:26:53 +00:00
|
|
|
SET(HDR_APU
|
|
|
|
src/apu/blargg_common.h #Unused(?) but in the VS projects
|
|
|
|
src/apu/blargg_config.h #Unused(?) but in the VS projects
|
|
|
|
src/apu/blargg_source.h
|
|
|
|
src/apu/Blip_Buffer.h
|
|
|
|
src/apu/Effects_Buffer.h
|
|
|
|
src/apu/Gb_Apu.h
|
|
|
|
src/apu/Gb_Oscs.h
|
|
|
|
src/apu/Multi_Buffer.h
|
|
|
|
)
|
|
|
|
|
2008-06-06 10:17:20 +00:00
|
|
|
SET(SRC_SDL
|
|
|
|
src/sdl/SDL.cpp
|
|
|
|
src/sdl/filters.cpp
|
|
|
|
src/sdl/text.cpp
|
2008-08-30 17:50:51 +00:00
|
|
|
src/sdl/inputSDL.cpp
|
2008-08-29 10:23:51 +00:00
|
|
|
src/sdl/expr.cpp
|
|
|
|
src/sdl/exprNode.cpp
|
|
|
|
src/sdl/expr-lex.cpp
|
2008-06-06 10:17:20 +00:00
|
|
|
)
|
|
|
|
|
2016-06-07 20:26:53 +00:00
|
|
|
SET(HDR_SDL
|
|
|
|
src/sdl/filters.h
|
|
|
|
src/sdl/text.h
|
|
|
|
src/sdl/inputSDL.h
|
|
|
|
src/sdl/expr.cpp.h
|
|
|
|
src/sdl/exprNode.h
|
|
|
|
)
|
|
|
|
|
2009-01-01 13:02:35 +00:00
|
|
|
SET(SRC_FILTERS
|
|
|
|
src/filters/2xSaI.cpp
|
|
|
|
src/filters/admame.cpp
|
|
|
|
src/filters/bilinear.cpp
|
|
|
|
src/filters/hq2x.cpp
|
|
|
|
src/filters/interframe.cpp
|
|
|
|
src/filters/pixel.cpp
|
|
|
|
src/filters/scanline.cpp
|
2011-05-25 11:55:46 +00:00
|
|
|
src/filters/simpleFilter.cpp
|
2015-03-19 01:44:47 +00:00
|
|
|
src/filters/xbrzfilter.cpp
|
|
|
|
src/filters/xBRZ/xbrz.cpp
|
2009-01-01 13:02:35 +00:00
|
|
|
)
|
|
|
|
|
2016-06-07 20:26:53 +00:00
|
|
|
SET(HDR_FILTERS
|
|
|
|
src/filters/hq2x.h
|
|
|
|
src/filters/interp.h
|
|
|
|
src/filters/lq2x.h
|
|
|
|
src/filters/xBRZ/config.h
|
|
|
|
src/filters/xBRZ/xbrz.h
|
|
|
|
)
|
|
|
|
|
2008-06-06 10:17:20 +00:00
|
|
|
SET(SRC_HQ_C
|
2009-01-01 13:02:35 +00:00
|
|
|
src/filters/hq/c/hq_implementation.cpp
|
2008-06-06 10:17:20 +00:00
|
|
|
)
|
|
|
|
|
2016-06-07 20:26:53 +00:00
|
|
|
SET(HDR_HQ_C
|
|
|
|
src/filters/hq/c/hq3x_pattern.h
|
|
|
|
src/filters/hq/c/hq4x_pattern.h
|
|
|
|
src/filters/hq/c/hq_base.h
|
|
|
|
src/filters/hq/c/hq_shared.h
|
|
|
|
)
|
|
|
|
|
2008-06-06 10:17:20 +00:00
|
|
|
SET(SRC_HQ_ASM
|
2009-01-01 13:02:35 +00:00
|
|
|
src/filters/hq/asm/hq3x_16.asm
|
|
|
|
src/filters/hq/asm/hq3x_32.asm
|
|
|
|
src/filters/hq/asm/hq4x_16.asm
|
|
|
|
src/filters/hq/asm/hq4x_32.asm
|
|
|
|
src/filters/hq/asm/hq3x32.cpp
|
2008-06-06 10:17:20 +00:00
|
|
|
)
|
|
|
|
|
2011-05-25 11:55:46 +00:00
|
|
|
if( ENABLE_ASM_SCALERS )
|
|
|
|
SET(SRC_FILTERS ${SRC_FILTERS} ${SRC_HQ_ASM})
|
2016-11-18 16:59:27 +00:00
|
|
|
IF(ENABLE_MMX)
|
|
|
|
SET(SRC_FILTERS ${SRC_FILTERS} src/filters/2xSaImmx.asm)
|
|
|
|
ENDIF(ENABLE_MMX)
|
2011-05-25 11:55:46 +00:00
|
|
|
else( ENABLE_ASM_SCALERS )
|
|
|
|
SET(SRC_FILTERS ${SRC_FILTERS} ${SRC_HQ_C})
|
2016-06-07 20:26:53 +00:00
|
|
|
SET(HDR_FILTERS ${HDR_FILTERS} ${HDR_HQ_C})
|
2011-05-25 11:55:46 +00:00
|
|
|
ADD_DEFINITIONS ( -DNO_ASM )
|
|
|
|
endif( ENABLE_ASM_SCALERS )
|
|
|
|
|
2011-02-24 11:14:59 +00:00
|
|
|
if( ENABLE_DEBUGGER )
|
2008-06-16 20:18:49 +00:00
|
|
|
SET(SRC_DEBUGGER
|
2009-01-01 16:11:02 +00:00
|
|
|
src/gba/armdis.cpp
|
|
|
|
src/gba/elf.cpp
|
|
|
|
src/gba/remote.cpp
|
2008-06-16 20:18:49 +00:00
|
|
|
)
|
2016-06-07 20:26:53 +00:00
|
|
|
SET(HDR_DEBUGGER
|
|
|
|
src/gba/armdis.h
|
|
|
|
src/gba/elf.h
|
|
|
|
src/gba/remote.h
|
|
|
|
)
|
2011-02-24 11:14:59 +00:00
|
|
|
endif( ENABLE_DEBUGGER )
|
2008-06-16 20:18:49 +00:00
|
|
|
|
2008-08-03 21:02:37 +00:00
|
|
|
INCLUDE_DIRECTORIES(
|
2008-06-06 16:42:31 +00:00
|
|
|
${ZLIB_INCLUDE_DIR}
|
2010-03-15 03:36:45 +00:00
|
|
|
fex
|
2008-10-20 16:30:07 +00:00
|
|
|
${PNG_INCLUDE_DIR}
|
2015-11-19 02:34:38 +00:00
|
|
|
${SDL2_INCLUDE_DIR}
|
2008-06-06 10:17:20 +00:00
|
|
|
)
|
|
|
|
|
2012-05-23 06:19:44 +00:00
|
|
|
IF( ENABLE_FFMPEG )
|
|
|
|
INCLUDE_DIRECTORIES(
|
|
|
|
${FFMPEG_INCLUDE_DIRS}
|
|
|
|
)
|
|
|
|
ENDIF( ENABLE_FFMPEG )
|
|
|
|
|
2008-06-06 10:17:20 +00:00
|
|
|
ADD_LIBRARY (
|
|
|
|
vbamcore
|
2015-05-10 22:54:19 +00:00
|
|
|
STATIC
|
2008-06-06 10:17:20 +00:00
|
|
|
${PROJECT_SRCS}
|
|
|
|
${SRC_MAIN}
|
2016-06-07 20:26:53 +00:00
|
|
|
${HDR_MAIN}
|
2009-01-01 15:20:03 +00:00
|
|
|
${SRC_GBA}
|
2016-06-07 20:26:53 +00:00
|
|
|
${HDR_GBA}
|
2009-01-01 14:52:03 +00:00
|
|
|
${SRC_GB}
|
2016-06-07 20:26:53 +00:00
|
|
|
${HDR_GB}
|
2009-01-01 14:43:18 +00:00
|
|
|
${SRC_APU}
|
2016-06-07 20:26:53 +00:00
|
|
|
${HDR_APU}
|
2009-01-01 13:02:35 +00:00
|
|
|
${SRC_FILTERS}
|
2016-06-07 20:26:53 +00:00
|
|
|
${HDR_FILTERS}
|
2008-06-16 20:18:49 +00:00
|
|
|
${SRC_DEBUGGER}
|
2016-06-07 20:26:53 +00:00
|
|
|
${HDR_DEBUGGER}
|
2008-06-06 10:17:20 +00:00
|
|
|
)
|
2016-07-30 23:00:38 +00:00
|
|
|
set_property(TARGET vbamcore PROPERTY CXX_STANDARD 11)
|
|
|
|
set_property(TARGET vbamcore PROPERTY CXX_STANDARD_REQUIRED ON)
|
2008-06-06 10:17:20 +00:00
|
|
|
|
2011-02-24 11:14:59 +00:00
|
|
|
IF( ENABLE_SDL )
|
2008-06-06 10:17:20 +00:00
|
|
|
ADD_EXECUTABLE (
|
|
|
|
vbam
|
|
|
|
WIN32
|
|
|
|
${SRC_SDL}
|
2016-06-07 20:26:53 +00:00
|
|
|
${HDR_SDL}
|
2008-06-06 10:17:20 +00:00
|
|
|
)
|
2016-07-30 23:00:38 +00:00
|
|
|
set_property(TARGET vbam PROPERTY CXX_STANDARD 11)
|
|
|
|
set_property(TARGET vbam PROPERTY CXX_STANDARD_REQUIRED ON)
|
2008-06-06 10:17:20 +00:00
|
|
|
|
2008-06-06 16:42:31 +00:00
|
|
|
IF( WIN32 )
|
2017-03-06 01:06:22 +00:00
|
|
|
SET( WIN32_LIBRARIES wsock32 ws2_32 )
|
2008-06-06 16:42:31 +00:00
|
|
|
ENDIF( WIN32 )
|
|
|
|
|
2011-02-24 11:14:59 +00:00
|
|
|
IF( ENABLE_LIRC )
|
2008-08-03 21:02:37 +00:00
|
|
|
SET( LIRC_CLIENT_LIBRARY lirc_client )
|
2011-02-24 11:14:59 +00:00
|
|
|
ENDIF( ENABLE_LIRC )
|
2008-08-03 21:02:37 +00:00
|
|
|
|
2008-06-06 10:17:20 +00:00
|
|
|
TARGET_LINK_LIBRARIES (
|
|
|
|
vbam
|
2011-05-25 11:55:46 +00:00
|
|
|
${VBAMCORE_LIBS}
|
2008-06-06 16:42:31 +00:00
|
|
|
${WIN32_LIBRARIES}
|
2008-08-03 21:02:37 +00:00
|
|
|
${LIRC_CLIENT_LIBRARY}
|
2008-06-06 10:17:20 +00:00
|
|
|
)
|
2017-05-24 11:25:45 +00:00
|
|
|
INSTALL(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/vbam DESTINATION ${CMAKE_INSTALL_FULL_BINDIR})
|
2016-12-10 23:27:18 +00:00
|
|
|
|
|
|
|
IF( WIN32 )
|
|
|
|
INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/src/sdl/vbam.cfg-example
|
2017-05-24 11:25:45 +00:00
|
|
|
DESTINATION ${CMAKE_INSTALL_FULL_SYSCONFDIR}
|
2016-12-10 23:27:18 +00:00
|
|
|
RENAME vbam.cfg)
|
|
|
|
ELSE( WIN32 )
|
|
|
|
INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/src/sdl/vbam.cfg-example
|
2017-05-24 11:25:45 +00:00
|
|
|
DESTINATION ${CMAKE_INSTALL_FULL_SYSCONFDIR}
|
2016-12-10 23:27:18 +00:00
|
|
|
RENAME vbam.cfg)
|
|
|
|
ENDIF( WIN32 )
|
2011-02-24 11:14:59 +00:00
|
|
|
ENDIF( ENABLE_SDL )
|
2008-06-06 10:17:20 +00:00
|
|
|
|
2011-05-25 11:55:46 +00:00
|
|
|
IF( ENABLE_WX )
|
|
|
|
add_subdirectory(src/wx)
|
2017-05-24 11:25:45 +00:00
|
|
|
INSTALL(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/visualboyadvance-m${CMAKE_EXECUTABLE_SUFFIX} DESTINATION ${CMAKE_INSTALL_FULL_BINDIR})
|
2011-05-25 11:55:46 +00:00
|
|
|
ENDIF( ENABLE_WX )
|
|
|
|
|
2016-12-20 22:34:34 +00:00
|
|
|
if( ENABLE_WX )
|
2011-02-24 17:46:59 +00:00
|
|
|
# Native Language Support
|
|
|
|
if( ENABLE_NLS )
|
|
|
|
add_subdirectory(po)
|
|
|
|
endif( ENABLE_NLS )
|
2016-12-20 22:34:34 +00:00
|
|
|
endif( ENABLE_WX )
|
2017-05-24 11:25:45 +00:00
|
|
|
INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/src/vba-over.ini DESTINATION ${CMAKE_INSTALL_FULL_DATADIR}/vbam)
|
2015-05-18 00:28:34 +00:00
|
|
|
|
|
|
|
# manual pages
|
|
|
|
IF( UNIX )
|
2016-12-10 23:27:18 +00:00
|
|
|
IF( ENABLE_SDL )
|
2017-05-24 11:25:45 +00:00
|
|
|
INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/src/debian/vbam.6 DESTINATION ${CMAKE_INSTALL_FULL_MANDIR}/man6)
|
2016-12-10 23:27:18 +00:00
|
|
|
ENDIF( ENABLE_SDL )
|
2015-05-18 00:28:34 +00:00
|
|
|
IF( ENABLE_WX )
|
2017-05-24 11:25:45 +00:00
|
|
|
INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/src/debian/visualboyadvance-m.6 DESTINATION ${CMAKE_INSTALL_FULL_MANDIR}/man6)
|
2015-05-18 00:28:34 +00:00
|
|
|
ENDIF( ENABLE_WX )
|
|
|
|
ENDIF( UNIX )
|
|
|
|
|
2017-02-12 03:55:01 +00:00
|
|
|
# linux data and icon files
|
2016-12-10 23:33:01 +00:00
|
|
|
IF( NOT WIN32 AND NOT APPLE )
|
|
|
|
IF( ENABLE_WX )
|
|
|
|
INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/src/wx/wxvbam.desktop DESTINATION ${CMAKE_INSTALL_PREFIX}/share/applications)
|
|
|
|
INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/src/wx/wxvbam.appdata.xml DESTINATION ${CMAKE_INSTALL_PREFIX}/share/appdata)
|
2017-05-24 11:25:45 +00:00
|
|
|
INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/src/wx/icons/sizes/ DESTINATION ${CMAKE_INSTALL_PREFIX}/share/icons/hicolor)
|
2016-12-10 23:33:01 +00:00
|
|
|
ENDIF( ENABLE_WX )
|
|
|
|
ENDIF( NOT WIN32 AND NOT APPLE )
|
|
|
|
|
2015-04-05 04:28:40 +00:00
|
|
|
SET(CPACK_GENERATOR "ZIP")
|
2015-06-15 13:00:47 +00:00
|
|
|
set(CPACK_SOURCE_GENERATOR "TGZ")
|
2015-05-18 02:41:21 +00:00
|
|
|
SET(CPACK_PACKAGE_VERSION_MAJOR "2")
|
|
|
|
SET(CPACK_PACKAGE_VERSION_MINOR "0")
|
2015-06-15 13:00:47 +00:00
|
|
|
SET(CPACK_PACKAGE_VERSION_PATCH "0-Git-" ${COMMITHASH})
|
2015-06-15 13:20:20 +00:00
|
|
|
list(APPEND CPACK_SOURCE_IGNORE_FILES "${CMAKE_CURRENT_SOURCE_DIR}/dependencies")
|
2015-05-18 00:28:34 +00:00
|
|
|
INCLUDE(CPack)
|