Merge pull request #4830 from Orphis/cmake_cleanup

Fixes for resource installation in CMake
This commit is contained in:
Mat M
2017-02-05 14:30:57 -05:00
committed by GitHub

View File

@ -88,16 +88,10 @@ set_property(GLOBAL PROPERTY USE_FOLDERS ON)
set(LIBS) set(LIBS)
# Set up paths # Set up paths
if(APPLE) set(bindir ${CMAKE_INSTALL_PREFIX}/bin CACHE PATH "bindir")
# The gettext module will install the translations unconditionally. set(datadir ${CMAKE_INSTALL_PREFIX}/share/dolphin-emu CACHE PATH "datadir")
# Redirect the installation to a build directory where it does no harm. set(mandir ${CMAKE_INSTALL_PREFIX}/share/man CACHE PATH "mandir")
set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/install-dummy) add_definitions(-DDATA_DIR="${datadir}/")
else()
set(bindir ${CMAKE_INSTALL_PREFIX}/bin CACHE PATH "bindir")
set(datadir ${CMAKE_INSTALL_PREFIX}/share/dolphin-emu CACHE PATH "datadir")
set(mandir ${CMAKE_INSTALL_PREFIX}/share/man CACHE PATH "mandir")
add_definitions(-DDATA_DIR="${datadir}/")
endif()
if(CMAKE_SYSROOT) if(CMAKE_SYSROOT)
# If we should use a sysroot, tell pkg-config to search for packages in there, not on the host # If we should use a sysroot, tell pkg-config to search for packages in there, not on the host
@ -973,7 +967,7 @@ if(GTEST_FOUND AND USE_SHARED_GTEST)
else() else()
message(STATUS "Using static gtest from Externals") message(STATUS "Using static gtest from Externals")
include_directories(Externals/gtest/include) include_directories(Externals/gtest/include)
add_subdirectory(Externals/gtest) add_subdirectory(Externals/gtest EXCLUDE_FROM_ALL)
endif() endif()
enable_testing() enable_testing()
@ -986,10 +980,13 @@ add_subdirectory(Source)
######################################## ########################################
# Install shared data files # Install shared data files
# #
if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Linux|FreeBSD|OpenBSD|Darwin") if(NOT CMAKE_SYSTEM_NAME MATCHES "Darwin|Windows")
install(DIRECTORY Data/Sys/ DESTINATION ${datadir}/sys PATTERN)
endif()
if(NOT CMAKE_SYSTEM_NAME MATCHES "Linux|FreeBSD|OpenBSD|Darwin")
install(FILES Data/license.txt DESTINATION ${datadir}) install(FILES Data/license.txt DESTINATION ${datadir})
endif() endif()
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux|FreeBSD|OpenBSD") if(CMAKE_SYSTEM_NAME MATCHES "Linux|FreeBSD|OpenBSD")
# Install the application icon and menu item # Install the application icon and menu item
install(FILES Data/dolphin-emu.svg install(FILES Data/dolphin-emu.svg
DESTINATION ${CMAKE_INSTALL_PREFIX}/share/icons/hicolor/scalable/apps) DESTINATION ${CMAKE_INSTALL_PREFIX}/share/icons/hicolor/scalable/apps)