diff --git a/CMakeLists.txt b/CMakeLists.txt index 6139ba4080..a30fbcdd9f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,11 +7,17 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/CMakeTests) set(DOLPHIN_IS_STABLE FALSE) # Set up paths -set(bindir ${CMAKE_INSTALL_PREFIX}/bin CACHE PATH "bindir") -set(datadir ${CMAKE_INSTALL_PREFIX}/share/dolphin-emu CACHE PATH "datadir") +if((${CMAKE_SYSTEM_NAME} MATCHES "Darwin")) + # 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") add_definitions(-DUSER_DIR="${userdir}") -add_definitions(-DDATA_DIR="${datadir}/") # 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 @@ -534,14 +540,16 @@ add_subdirectory(Source) ######################################## # Install shared data files # -install(DIRECTORY Data/User/ DESTINATION ${datadir}/user PATTERN .svn EXCLUDE) -install(DIRECTORY Data/Sys/ DESTINATION ${datadir}/sys PATTERN .svn EXCLUDE) +if((NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin")) + install(DIRECTORY Data/User/ DESTINATION ${datadir}/user PATTERN) + install(DIRECTORY Data/Sys/ DESTINATION ${datadir}/sys PATTERN) +endif() include(FindGettext) if(GETTEXT_FOUND AND NOT DISABLE_WX) file(GLOB LINGUAS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} Languages/po/*.po) GETTEXT_CREATE_TRANSLATIONS(Languages/po/dolphin-emu.pot ALL ${LINGUAS}) 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}) endif() diff --git a/Source/Core/DolphinWX/CMakeLists.txt b/Source/Core/DolphinWX/CMakeLists.txt index fe8b90ed80..07df3a096d 100644 --- a/Source/Core/DolphinWX/CMakeLists.txt +++ b/Source/Core/DolphinWX/CMakeLists.txt @@ -115,7 +115,6 @@ endif() add_executable(${DOLPHIN_EXE} ${SRCS}) target_link_libraries(${DOLPHIN_EXE} ${LIBS} ${WXLIBS}) -install(TARGETS ${DOLPHIN_EXE} RUNTIME DESTINATION ${bindir}) if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") include(BundleUtilities) @@ -157,4 +156,11 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") 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() diff --git a/Source/DSPTool/CMakeLists.txt b/Source/DSPTool/CMakeLists.txt index 2e26125fbc..b7415ff703 100644 --- a/Source/DSPTool/CMakeLists.txt +++ b/Source/DSPTool/CMakeLists.txt @@ -1,3 +1,5 @@ add_executable(dsptool Src/DSPTool.cpp) 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() diff --git a/Source/UnitTests/CMakeLists.txt b/Source/UnitTests/CMakeLists.txt index 323c4f65c7..f86742555e 100644 --- a/Source/UnitTests/CMakeLists.txt +++ b/Source/UnitTests/CMakeLists.txt @@ -4,4 +4,3 @@ set(SRCS AudioJitTests.cpp add_executable(tester ${SRCS}) target_link_libraries(tester core) -install(TARGETS tester RUNTIME DESTINATION ${bindir})