Merge branch 'cmake-osx2'

This commit is contained in:
Maarten ter Huurne 2011-12-17 16:30:02 +01:00
commit ed1bfdf293
12 changed files with 1602 additions and 82 deletions

View File

@ -7,11 +7,17 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/CMakeTests)
set(DOLPHIN_IS_STABLE FALSE) set(DOLPHIN_IS_STABLE FALSE)
# Set up paths # Set up paths
set(bindir ${CMAKE_INSTALL_PREFIX}/bin CACHE PATH "bindir") if((${CMAKE_SYSTEM_NAME} MATCHES "Darwin"))
set(datadir ${CMAKE_INSTALL_PREFIX}/share/dolphin-emu CACHE PATH "datadir") # The gettext module will install the translations unconditionally.
# Redirect the installation to a build directory where it does no harm.
set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/install-dummy)
else()
set(bindir ${CMAKE_INSTALL_PREFIX}/bin CACHE PATH "bindir")
set(datadir ${CMAKE_INSTALL_PREFIX}/share/dolphin-emu CACHE PATH "datadir")
add_definitions(-DDATA_DIR="${datadir}/")
endif()
set(userdir ".dolphin-emu" CACHE STRING "User directory") set(userdir ".dolphin-emu" CACHE STRING "User directory")
add_definitions(-DUSER_DIR="${userdir}") add_definitions(-DUSER_DIR="${userdir}")
add_definitions(-DDATA_DIR="${datadir}/")
# Set where the binary files will be built. The program will not execute from # Set where the binary files will be built. The program will not execute from
# here. You must run "make install" to install these to the proper location # here. You must run "make install" to install these to the proper location
@ -67,6 +73,15 @@ if(GIT_FOUND AND NOT DOLPHIN_WC_REVISION)
OUTPUT_STRIP_TRAILING_WHITESPACE) OUTPUT_STRIP_TRAILING_WHITESPACE)
endif() endif()
# version number
set(DOLPHIN_VERSION_MAJOR "3")
set(DOLPHIN_VERSION_MINOR "0")
if(DOLPHIN_IS_STABLE)
set(DOLPHIN_VERSION_PATCH "0")
else()
set(DOLPHIN_VERSION_PATCH ${DOLPHIN_WC_REVISION})
endif()
# Various compile flags # Various compile flags
add_definitions(-msse2) add_definitions(-msse2)
@ -100,25 +115,63 @@ if(UNIX AND NOT APPLE)
endif() endif()
if (APPLE) if (APPLE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -x objective-c++") # Ignore MacPorts and Fink and any other locally installed packages that
# might prevent building a distributable binary.
set(CMAKE_SYSTEM_PREFIX_PATH /usr)
# Some of our code contains Objective C constructs.
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -x objective-c") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -x objective-c")
FIND_LIBRARY(ATB_LIBRARY AudioToolbox) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -x objective-c++")
FIND_LIBRARY(AU_LIBRARY AudioUnit) # Avoid mistaking an object file for a source file on the link command line.
FIND_LIBRARY(CARBON_LIBRARY Carbon) set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -x none")
FIND_LIBRARY(COCOA_LIBRARY Cocoa)
FIND_LIBRARY(COREAUDIO_LIBRARY CoreAudio) # Identify the target system:
FIND_LIBRARY(COREFUND_LIBRARY CoreFoundation) # Ask for 32/64-bit fat binary.
FIND_LIBRARY(CORESERV_LIBRARY CoreServices) set(TARGET_FLAGS "-arch x86_64 -arch i386")
FIND_LIBRARY(IOB_LIBRARY IOBluetooth) # Minimum OS X version.
FIND_LIBRARY(IOK_LIBRARY IOKit) # This is inserted into the Info.plist as well.
FIND_LIBRARY(OGL_LIBRARY OpenGL) # Note that the SDK determines the maximum version of which optional
FIND_LIBRARY(WEBKIT_LIBRARY WebKit) # features can be used, not the minimum required version to run.
SET(EXTRA_LIBS ${ATB_LIBRARY} ${AU_LIBRARY} ${CARBON_LIBRARY} set(OSX_MIN_VERSION "10.5.4")
${COCOA_LIBRARY} ${COREAUDIO_LIBRARY} ${COREFUND_LIBRARY} set(TARGET_FLAGS "${TARGET_FLAGS} -mmacosx-version-min=${OSX_MIN_VERSION}")
${CORESERV_LIBRARY} ${IOB_LIBRARY} ${IOK_LIBRARY} ${OGL_LIBRARY} set(TARGET_FLAGS "${TARGET_FLAGS} -isysroot /Developer/SDKs/MacOSX10.6.sdk")
${WEBKIT_LIBRARY}) set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-syslibroot,/Developer/SDKs/MacOSX10.6.sdk")
# Do not warn about frameworks that are not available on all architectures.
# This avoids a warning when linking with QuickTime.
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-no_arch_warnings")
# Specify target CPUs.
set(TARGET_FLAGS "${TARGET_FLAGS} -Xarch_i386 -msse3")
set(TARGET_FLAGS "${TARGET_FLAGS} -Xarch_i386 -march=prescott")
set(TARGET_FLAGS "${TARGET_FLAGS} -Xarch_x86_64 -mssse3")
set(TARGET_FLAGS "${TARGET_FLAGS} -Xarch_x86_64 -march=core2")
# Target flags apply to both C and C++ compilation.
# CMake passes these to the compiler on the link command line as well.
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${TARGET_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TARGET_FLAGS}")
# Linker flags.
# Drop unreachable code and data.
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-dead_strip,-dead_strip_dylibs")
# Reserve the minimum size for the zero page.
# Our JIT requires virtual memory space below 2GB, while the default zero
# page on x86_64 is 4GB in size.
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-pagezero_size,0x1000")
find_library(APPKIT_LIBRARY AppKit)
find_library(APPSERV_LIBRARY ApplicationServices)
find_library(ATB_LIBRARY AudioToolbox)
find_library(AU_LIBRARY AudioUnit)
find_library(CARBON_LIBRARY Carbon)
find_library(COCOA_LIBRARY Cocoa)
find_library(COREAUDIO_LIBRARY CoreAudio)
find_library(COREFUND_LIBRARY CoreFoundation)
find_library(CORESERV_LIBRARY CoreServices)
find_library(IOB_LIBRARY IOBluetooth)
find_library(IOK_LIBRARY IOKit)
find_library(QUICKTIME_LIBRARY QuickTime)
find_library(WEBKIT_LIBRARY WebKit)
endif() endif()
if(WIN32) if(WIN32)
add_definitions(-D_SECURE_SCL=0) add_definitions(-D_SECURE_SCL=0)
add_definitions(-D_CRT_SECURE_NO_WARNINGS) add_definitions(-D_CRT_SECURE_NO_WARNINGS)
@ -310,6 +363,7 @@ else()
message("Shared lzo not found, falling back to the static library") message("Shared lzo not found, falling back to the static library")
add_subdirectory(Externals/LZO) add_subdirectory(Externals/LZO)
include_directories(Externals/LZO) include_directories(Externals/LZO)
set(LZO lzo2)
endif() endif()
include(FindSDL OPTIONAL) include(FindSDL OPTIONAL)
@ -371,10 +425,17 @@ else()
endif(NOT GLEW_FOUND) endif(NOT GLEW_FOUND)
check_lib(CG Cg Cg/cg.h) check_lib(CG Cg Cg/cg.h)
if(NOT CG_FOUND)
message("Shared Cg not found, falling back to the static library")
include_directories(Externals)
endif(NOT CG_FOUND)
check_lib(CGGL CgGL Cg/cgGL.h) check_lib(CGGL CgGL Cg/cgGL.h)
endif() endif()
if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin") if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
find_library(CL OpenCL)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-weak_framework,OpenCL")
else()
include_directories(Externals/CLRun/include) include_directories(Externals/CLRun/include)
add_subdirectory(Externals/CLRun) add_subdirectory(Externals/CLRun)
endif() endif()
@ -384,6 +445,21 @@ if(NOT DISABLE_WX)
include(FindwxWidgets OPTIONAL) include(FindwxWidgets OPTIONAL)
FIND_PACKAGE(wxWidgets COMPONENTS core aui adv) FIND_PACKAGE(wxWidgets COMPONENTS core aui adv)
if(wxWidgets_FOUND)
EXECUTE_PROCESS(
COMMAND sh "${wxWidgets_CONFIG_EXECUTABLE}"
${wxWidgets_CONFIG_OPTIONS} --version
OUTPUT_VARIABLE wxWidgets_VERSION
OUTPUT_STRIP_TRAILING_WHITESPACE
ERROR_QUIET
)
message("Found wxWidgets version ${wxWidgets_VERSION}")
if(${wxWidgets_VERSION} VERSION_LESS "2.8.9")
message("At least 2.8.9 is required; ignoring found version")
unset(wxWidgets_FOUND)
endif()
endif(wxWidgets_FOUND)
if(wxWidgets_FOUND) if(wxWidgets_FOUND)
include(${wxWidgets_USE_FILE}) include(${wxWidgets_USE_FILE})
@ -414,8 +490,17 @@ if(NOT DISABLE_WX)
message(FATAL_ERROR "wxWidgets not found. It is required to build the GUI") message(FATAL_ERROR "wxWidgets not found. It is required to build the GUI")
endif() endif()
message("Shared wxWidgets not found, falling back to the static library") message("Shared wxWidgets not found, falling back to the static library")
include_directories(Externals/wxWidgets/include) if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
add_subdirectory(Externals/wxWidgets) add_definitions(-D__WXOSX_COCOA__)
include_directories(Externals/wxWidgets3)
include_directories(Externals/wxWidgets3/include)
add_subdirectory(Externals/wxWidgets3)
set(wxWidgets_LIBRARIES "wx")
else()
include_directories(Externals/wxWidgets/include)
add_subdirectory(Externals/wxWidgets)
endif()
set(wxWidgets_FOUND TRUE)
endif(wxWidgets_FOUND) endif(wxWidgets_FOUND)
add_definitions(-DHAVE_WX=1) add_definitions(-DHAVE_WX=1)
endif(NOT DISABLE_WX) endif(NOT DISABLE_WX)
@ -456,28 +541,25 @@ add_subdirectory(Source)
######################################## ########################################
# Install shared data files # Install shared data files
# #
install(DIRECTORY Data/User/ DESTINATION ${datadir}/user PATTERN .svn EXCLUDE) if((NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin"))
install(DIRECTORY Data/Sys/ DESTINATION ${datadir}/sys PATTERN .svn EXCLUDE) install(DIRECTORY Data/User/ DESTINATION ${datadir}/user PATTERN)
install(DIRECTORY Data/Sys/ DESTINATION ${datadir}/sys PATTERN)
endif()
include(FindGettext) include(FindGettext)
if(GETTEXT_FOUND AND NOT DISABLE_WX) if(GETTEXT_FOUND AND NOT DISABLE_WX)
file(GLOB LINGUAS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} Languages/po/*.po) file(GLOB LINGUAS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} Languages/po/*.po)
GETTEXT_CREATE_TRANSLATIONS(Languages/po/dolphin-emu.pot ALL ${LINGUAS}) GETTEXT_CREATE_TRANSLATIONS(Languages/po/dolphin-emu.pot ALL ${LINGUAS})
endif() endif()
if((NOT ${CMAKE_SYSTEM_NAME} MATCHES "Linux") AND (NOT ${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")) if((NOT ${CMAKE_SYSTEM_NAME} MATCHES "Linux|FreeBSD|Darwin"))
install(FILES Data/license.txt DESTINATION ${datadir}) install(FILES Data/license.txt DESTINATION ${datadir})
endif() endif()
# packaging information # packaging information
set(CPACK_PACKAGE_NAME "dolphin-emu") set(CPACK_PACKAGE_NAME "dolphin-emu")
set(CPACK_PACKAGE_VENDOR "Dolphin Team") set(CPACK_PACKAGE_VENDOR "Dolphin Team")
set(CPACK_PACKAGE_VERSION_MAJOR "3") set(CPACK_PACKAGE_VERSION_MAJOR ${DOLPHIN_VERSION_MAJOR})
set(CPACK_PACKAGE_VERSION_MINOR "0") set(CPACK_PACKAGE_VERSION_MINOR ${DOLPHIN_VERSION_MINOR})
set(CPACK_PACKAGE_VERSION_PATCH ${DOLPHIN_VERSION_PATCH})
if(DOLPHIN_IS_STABLE)
set(CPACK_PACKAGE_VERSION_PATCH "0")
else()
set(CPACK_PACKAGE_VERSION_PATCH ${DOLPHIN_WC_REVISION})
endif()
# TODO: CPACK_PACKAGE_DESCRIPTION_FILE # TODO: CPACK_PACKAGE_DESCRIPTION_FILE
# TODO: CPACK_PACKAGE_DESCRIPTION_SUMMARY # TODO: CPACK_PACKAGE_DESCRIPTION_SUMMARY

19
Externals/libpng/CMakeLists.txt vendored Normal file
View File

@ -0,0 +1,19 @@
set(SRCS
"png.c"
"pngerror.c"
"pngget.c"
"pngmem.c"
"pngpread.c"
"pngread.c"
"pngrio.c"
"pngrtran.c"
"pngrutil.c"
"pngset.c"
"pngtrans.c"
"pngwio.c"
"pngwrite.c"
"pngwtran.c"
"pngwutil.c"
)
add_library(png STATIC ${SRCS})

1260
Externals/wxWidgets3/CMakeLists.txt vendored Normal file

File diff suppressed because it is too large Load Diff

View File

@ -6,33 +6,33 @@ set(SRCS Src/AudioCommon.cpp
set(LIBS "") set(LIBS "")
if(ALSA_FOUND)
set(SRCS ${SRCS} Src/AlsaSoundStream.cpp)
set(LIBS ${LIBS} ${ALSA_LIBRARIES})
endif(ALSA_FOUND)
if(AO_FOUND)
set(SRCS ${SRCS} Src/AOSoundStream.cpp)
set(LIBS ${LIBS} ${AO_LIBRARIES})
endif(AO_FOUND)
if(OPENAL_FOUND)
set(SRCS ${SRCS} Src/OpenALStream.cpp Src/aldlist.cpp)
set(LIBS ${LIBS} ${OPENAL_LIBRARY})
endif(OPENAL_FOUND)
if(PULSEAUDIO_FOUND)
set(SRCS ${SRCS} Src/PulseAudioStream.cpp)
set(LIBS ${LIBS} ${PULSEAUDIO_LIBRARIES})
endif(PULSEAUDIO_FOUND)
if(WIN32)
set(SRCS ${SRCS} Src/DSoundStream.cpp)
set(SRCS ${SRCS} Src/XAudio2Stream.cpp)
endif(WIN32)
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set(SRCS ${SRCS} Src/CoreAudioSoundStream.cpp) set(SRCS ${SRCS} Src/CoreAudioSoundStream.cpp)
else()
if(ALSA_FOUND)
set(SRCS ${SRCS} Src/AlsaSoundStream.cpp)
set(LIBS ${LIBS} ${ALSA_LIBRARIES})
endif(ALSA_FOUND)
if(AO_FOUND)
set(SRCS ${SRCS} Src/AOSoundStream.cpp)
set(LIBS ${LIBS} ${AO_LIBRARIES})
endif(AO_FOUND)
if(OPENAL_FOUND)
set(SRCS ${SRCS} Src/OpenALStream.cpp Src/aldlist.cpp)
set(LIBS ${LIBS} openal)
endif(OPENAL_FOUND)
if(PULSEAUDIO_FOUND)
set(SRCS ${SRCS} Src/PulseAudioStream.cpp)
set(LIBS ${LIBS} ${PULSEAUDIO_LIBRARIES})
endif(PULSEAUDIO_FOUND)
if(WIN32)
set(SRCS ${SRCS} Src/DSoundStream.cpp)
set(SRCS ${SRCS} Src/XAudio2Stream.cpp)
endif(WIN32)
endif() endif()
add_library(audiocommon STATIC ${SRCS}) add_library(audiocommon STATIC ${SRCS})

View File

@ -27,6 +27,9 @@
#ifdef _WIN32 #ifdef _WIN32
#include "../../../../Externals/OpenAL/include/al.h" #include "../../../../Externals/OpenAL/include/al.h"
#include "../../../../Externals/OpenAL/include/alc.h" #include "../../../../Externals/OpenAL/include/alc.h"
#elif defined(__APPLE__)
#include <al.h>
#include <alc.h>
#else #else
#include <AL/al.h> #include <AL/al.h>
#include <AL/alc.h> #include <AL/alc.h>

View File

@ -43,29 +43,27 @@ static inline void do_cpuid(unsigned int *eax, unsigned int *ebx,
// Note: EBX is reserved on Mac OS X and in PIC on Linux, so it has to // Note: EBX is reserved on Mac OS X and in PIC on Linux, so it has to
// restored at the end of the asm block. // restored at the end of the asm block.
__asm__ ( __asm__ (
"mov %%rbx,%%rdi;" "pushq %%rbx;"
"cpuid;" "cpuid;"
"movl %%ebx,%1;" "movl %%ebx,%1;"
"mov %%rdi,%%rbx;" "popq %%rbx;"
: "=a" (*eax), : "=a" (*eax),
"=g" (*ebx), "=S" (*ebx),
"=c" (*ecx), "=c" (*ecx),
"=d" (*edx) "=d" (*edx)
: "a" (*eax) : "a" (*eax)
: "rdi", "rbx"
); );
#else #else
__asm__( __asm__ (
"movl %%ebx,%%edi;" "pushl %%ebx;"
"cpuid;" "cpuid;"
"movl %%ebx,%1;" "movl %%ebx,%1;"
"movl %%edi,%%ebx;" "popl %%ebx;"
: "=a" (*eax), : "=a" (*eax),
"=g" (*ebx), "=S" (*ebx),
"=c" (*ecx), "=c" (*ecx),
"=d" (*edx) "=d" (*edx)
: "a" (*eax) : "a" (*eax)
: "edi", "ebx"
); );
#endif #endif
} }

View File

@ -1,5 +1,5 @@
set(LIBS core set(LIBS core
lzo2 ${LZO}
discio discio
bdisasm bdisasm
inputcommon inputcommon
@ -8,7 +8,7 @@ set(LIBS core
z z
sfml-network sfml-network
SDL SDL
GL ${OPENGL_LIBRARIES}
${XRANDR_LIBRARIES} ${XRANDR_LIBRARIES}
${X11_LIBRARIES}) ${X11_LIBRARIES})
@ -71,10 +71,28 @@ endif()
if(WIN32) if(WIN32)
set(SRCS ${SRCS} Src/stdafx.cpp) set(SRCS ${SRCS} Src/stdafx.cpp)
elseif((${CMAKE_SYSTEM_NAME} MATCHES "Darwin") AND NOT wxWidgets_FOUND) elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
# TODO # Link against OS X system frameworks.
elseif((${CMAKE_SYSTEM_NAME} MATCHES "Darwin") AND wxWidgets_FOUND) list(APPEND LIBS
# TODO ${APPKIT_LIBRARY}
${AU_LIBRARY}
${COREAUDIO_LIBRARY}
${COREFUND_LIBRARY}
${CORESERV_LIBRARY}
${IOB_LIBRARY}
${IOK_LIBRARY}
)
if(wxWidgets_FOUND)
list(APPEND LIBS
${APPSERV_LIBRARY}
${COCOA_LIBRARY}
)
endif()
# Add resource files to application bundle.
set(RESOURCES resources/Dolphin.icns)
list(APPEND SRCS ${RESOURCES})
set_source_files_properties(${RESOURCES} PROPERTIES
MACOSX_PACKAGE_LOCATION Resources)
else() else()
set(SRCS ${SRCS} Src/X11Utils.cpp) set(SRCS ${SRCS} Src/X11Utils.cpp)
endif() endif()
@ -84,13 +102,83 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD" OR
set(LIBS ${LIBS} usbhid) set(LIBS ${LIBS} usbhid)
endif() endif()
if(wxWidgets_FOUND) if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set(DOLPHIN_EXE dolphin-emu) set(DOLPHIN_EXE_BASE Dolphin)
else() else()
set(DOLPHIN_EXE dolphin-emu-nogui) set(DOLPHIN_EXE_BASE dolphin-emu)
endif()
if(wxWidgets_FOUND)
set(DOLPHIN_EXE ${DOLPHIN_EXE_BASE})
else()
set(DOLPHIN_EXE ${DOLPHIN_EXE_BASE}-nogui)
endif() endif()
add_executable(${DOLPHIN_EXE} ${SRCS}) add_executable(${DOLPHIN_EXE} ${SRCS})
target_link_libraries(${DOLPHIN_EXE} ${LIBS} ${WXLIBS}) target_link_libraries(${DOLPHIN_EXE} ${LIBS} ${WXLIBS})
install(TARGETS ${DOLPHIN_EXE} RUNTIME DESTINATION ${bindir})
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
include(BundleUtilities)
set(BUNDLE_PATH ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${DOLPHIN_EXE}.app)
# Ask for an application bundle.
set_target_properties(${DOLPHIN_EXE} PROPERTIES
MACOSX_BUNDLE true
MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist.in
)
# Install Cg framework into application bundle.
copy_resolved_framework_into_bundle(
# Our framework in "Externals" does not have "Versions/Current/" in
# its path; work around the missing directory levels using "././".
"${CMAKE_SOURCE_DIR}/Externals/Cg/Cg.framework/././Cg"
"${BUNDLE_PATH}/Contents/Frameworks/Cg.framework/././Cg"
)
# Fix up the bundle after it is finished.
# There does not seem to be an easy way to run CMake commands post-build,
# so we invoke CMake again on a generated script.
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/postprocess_bundle.cmake "
include(BundleUtilities)
message(\"Fixing up application bundle: ${BUNDLE_PATH}\")
fixup_bundle(\"${BUNDLE_PATH}\" \"\" \"\")
")
add_custom_command(TARGET ${DOLPHIN_EXE} POST_BUILD
COMMAND ${CMAKE_COMMAND} -P postprocess_bundle.cmake
)
# Copy data files into application bundle.
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/copy_data_into_bundle.cmake "
file(INSTALL ${CMAKE_SOURCE_DIR}/Data/Sys ${CMAKE_SOURCE_DIR}/Data/User
DESTINATION ${BUNDLE_PATH}/Contents/Resources
)
file(GLOB TRANSLATION_FILES RELATIVE ${CMAKE_BINARY_DIR}
${CMAKE_BINARY_DIR}/*.gmo
)
foreach(TRANSLATION_FILE \${TRANSLATION_FILES})
string(REPLACE \".gmo\" \".lproj\" TRANSLATION_DIR
\${TRANSLATION_FILE}
)
# It would be better to copy to the new name as a single action,
# but I can't figure out a way to let CMake do that.
file(COPY ${CMAKE_BINARY_DIR}/\${TRANSLATION_FILE}
DESTINATION ${BUNDLE_PATH}/Contents/Resources/\${TRANSLATION_DIR}
NO_SOURCE_PERMISSIONS
)
file(RENAME
${BUNDLE_PATH}/Contents/Resources/\${TRANSLATION_DIR}/\${TRANSLATION_FILE}
${BUNDLE_PATH}/Contents/Resources/\${TRANSLATION_DIR}/dolphin-emu.mo
)
endforeach(TRANSLATION_FILE)
")
add_custom_target(CopyDataIntoBundle ALL
COMMAND ${CMAKE_COMMAND} -P copy_data_into_bundle.cmake
VERBATIM
)
# Install bundle into systemwide /Applications directory.
install(DIRECTORY ${BUNDLE_PATH} DESTINATION /Applications
USE_SOURCE_PERMISSIONS
)
else()
install(TARGETS ${DOLPHIN_EXE} RUNTIME DESTINATION ${bindir})
endif()

View File

@ -0,0 +1,63 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>ciso</string>
<string>dol</string>
<string>elf</string>
<string>gcm</string>
<string>gcz</string>
<string>iso</string>
<string>wad</string>
</array>
<key>CFBundleTypeIconFile</key>
<string>Dolphin.icns</string>
<key>CFBundleTypeName</key>
<string>Nintendo GC/Wii file</string>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
</dict>
</array>
<key>CFBundleExecutable</key>
<string>Dolphin</string>
<key>CFBundleIconFile</key>
<string>Dolphin.icns</string>
<key>CFBundleIdentifier</key>
<string>com.dolphin-emulator.dolphin</string>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleLocalizations</key>
<array>
<string>ar</string>
<string>el</string>
<string>en</string>
<string>es</string>
<string>fr</string>
<string>hu</string>
<string>pt</string>
<string>pt_BR</string>
<string>tr</string>
</array>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>${DOLPHIN_WC_DESCRIBE}</string>
<key>CFBundleLongVersionString</key>
<string>${DOLPHIN_WC_REVISION}</string>
<key>CFBundleVersion</key>
<string>${DOLPHIN_VERSION_MAJOR}.${DOLPHIN_VERSION_MINOR}</string>
<key>NSHumanReadableCopyright</key>
<string>Licensed under GPL version 2</string>
<key>LSMinimumSystemVersion</key>
<string>${OSX_MIN_VERSION}</string>
<key>LSRequiresCarbon</key>
<true/>
<key>CSResourcesFileMapped</key>
<true/>
</dict>
</plist>

View File

@ -40,6 +40,10 @@ set(SRCS Src/BPFunctions.cpp
Src/memcpy_amd.cpp) Src/memcpy_amd.cpp)
set(LIBS core) set(LIBS core)
if(NOT ${CL} STREQUAL CL-NOTFOUND)
list(APPEND LIBS ${CL})
endif()
if(wxWidgets_FOUND AND WIN32) if(wxWidgets_FOUND AND WIN32)
set(SRCS ${SRCS} Src/EmuWindow.cpp) set(SRCS ${SRCS} Src/EmuWindow.cpp)
endif() endif()

View File

@ -1,3 +1,5 @@
add_executable(dsptool Src/DSPTool.cpp) add_executable(dsptool Src/DSPTool.cpp)
target_link_libraries(dsptool core) target_link_libraries(dsptool core)
install(TARGETS dsptool RUNTIME DESTINATION ${bindir}) if((NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin"))
install(TARGETS dsptool RUNTIME DESTINATION ${bindir})
endif()

View File

@ -22,8 +22,10 @@ if(wxWidgets_FOUND)
set(LIBS ${LIBS} ${wxWidgets_LIBRARIES}) set(LIBS ${LIBS} ${wxWidgets_LIBRARIES})
endif(wxWidgets_FOUND) endif(wxWidgets_FOUND)
if(APPLE OR WIN32 OR ${CMAKE_SYSTEM_NAME} MATCHES "Linux") if(WIN32 OR ${CMAKE_SYSTEM_NAME} MATCHES "Linux")
set(LIBS ${LIBS} Cg CgGL) set(LIBS ${LIBS} Cg CgGL)
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
list(APPEND LIBS "${CMAKE_SOURCE_DIR}/Externals/Cg/Cg.framework")
endif() endif()
if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin") if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin")

View File

@ -4,4 +4,3 @@ set(SRCS AudioJitTests.cpp
add_executable(tester ${SRCS}) add_executable(tester ${SRCS})
target_link_libraries(tester core) target_link_libraries(tester core)
install(TARGETS tester RUNTIME DESTINATION ${bindir})