All: Fix CMake install path handling some
Jeffrey Pfau jeffrey@endrift.com
Sun, 17 Jul 2016 19:05:32 -0700
3 files changed,
14 insertions(+),
12 deletions(-)
M
CMakeLists.txt
→
CMakeLists.txt
@@ -61,13 +61,13 @@ if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release CACHE STRING "Build type (e.g. Release or Debug)" FORCE) endif() -set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${LIBDIR}") - include(GNUInstallDirs) if (NOT DEFINED LIBDIR) - set(LIBDIR "lib") + set(LIBDIR "${CMAKE_INSTALL_LIBDIR}") endif() + +set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_LIBDIR}") if (NOT DEFINED MANDIR) set(MANDIR ${CMAKE_INSTALL_MANDIR})
M
src/platform/qt/CMakeLists.txt
→
src/platform/qt/CMakeLists.txt
@@ -167,15 +167,17 @@ if(QT_STATIC)
list(APPEND QT_LIBRARIES qwindows imm32) endif() endif() -if(APPLE) - set(DATA_DIR Applications/${PROJECT_NAME}.app/Contents/Resources) -else() - set(DATA_DIR ${CMAKE_INSTALL_DATADIR}/${BINARY_NAME}) +if(NOT DEFINED DATADIR) + if(APPLE) + set(DATADIR Applications/${PROJECT_NAME}.app/Contents/Resources) + else() + set(DATADIR ${CMAKE_INSTALL_DATADIR}/${BINARY_NAME}) + endif() endif() -install(DIRECTORY ${CMAKE_SOURCE_DIR}/res/shaders DESTINATION ${DATA_DIR} COMPONENT ${BINARY_NAME}-qt) -install(FILES ${CMAKE_SOURCE_DIR}/res/nointro.dat DESTINATION ${DATA_DIR} COMPONENT ${BINARY_NAME}-qt) +install(DIRECTORY ${CMAKE_SOURCE_DIR}/res/shaders DESTINATION ${DATADIR} COMPONENT ${BINARY_NAME}-qt) +install(FILES ${CMAKE_SOURCE_DIR}/res/nointro.dat DESTINATION ${DATADIR} COMPONENT ${BINARY_NAME}-qt) if(NOT WIN32 AND NOT APPLE) - list(APPEND QT_DEFINES DATA_DIR="${DATA_DIR}") + list(APPEND QT_DEFINES DATADIR="${DATADIR}") endif() add_executable(${BINARY_NAME}-qt WIN32 MACOSX_BUNDLE main.cpp ${CMAKE_SOURCE_DIR}/res/mgba.icns ${SOURCE_FILES} ${PLATFORM_SRC} ${UI_FILES} ${AUDIO_SRC} ${RESOURCES})
M
src/platform/qt/GBAApp.cpp
→
src/platform/qt/GBAApp.cpp
@@ -188,8 +188,8 @@ return dialog;
} QString GBAApp::dataDir() { -#ifdef DATA_DIR - QString path = QString::fromUtf8(DATA_DIR); +#ifdef DATADIR + QString path = QString::fromUtf8(DATADIR); #else QString path = QCoreApplication::applicationDirPath(); #ifdef Q_OS_MAC