From 7ae3640bb54302527bd7e1726a588f020ae455c6 Mon Sep 17 00:00:00 2001 From: Jeffrey Pfau Date: Tue, 27 Sep 2016 04:03:41 -0700 Subject: [PATCH] All: Split out install locations for Libretro and OpenEmu --- CHANGES | 1 + CMakeLists.txt | 20 +++++++++++++++----- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/CHANGES b/CHANGES index 6cb450ab0..6d328eb92 100644 --- a/CHANGES +++ b/CHANGES @@ -28,6 +28,7 @@ Misc: - GB Memory: Initialize RAM pattern for GBC - SDL: Remove scancode key input - GB Video: Improved video timings + - All: Split out install locations for Libretro and OpenEmu 0.5.0: (2016-09-19) Features: diff --git a/CMakeLists.txt b/CMakeLists.txt index c181d9dd8..11b0b1d2f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -63,11 +63,21 @@ endif() include(GNUInstallDirs) -if (NOT DEFINED LIBDIR) - set(LIBDIR "${CMAKE_INSTALL_LIBDIR}") +set(LIBDIR "${CMAKE_INSTALL_LIBDIR}" CACHE PATH "Installed library directory") +mark_as_advanced(LIBDIR) + +if (BUILD_LIBRETRO) + set(LIBRETRO_LIBDIR "${LIBDIR}" CACHE PATH "Installed library directory (Libretro)") + mark_as_advanced(LIBRETRO_LIBDIR) endif() -set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_LIBDIR}") +if (BUILD_OPENEMU) + set(OE_LIBDIR "${LIBDIR}" CACHE PATH "Installed library directory (OpenEmu)") + mark_as_advanced(OE_LIBDIR) +endif() + + +set(CMAKE_INSTALL_RPATH "${LIBDIR}") if (NOT DEFINED MANDIR) set(MANDIR ${CMAKE_INSTALL_MANDIR}) @@ -644,7 +654,7 @@ if(BUILD_LIBRETRO) add_library(${BINARY_NAME}_libretro SHARED ${CORE_SRC} ${RETRO_SRC}) set_target_properties(${BINARY_NAME}_libretro PROPERTIES PREFIX "" COMPILE_DEFINITIONS "COLOR_16_BIT;COLOR_5_6_5;DISABLE_THREADING;${OS_DEFINES};${FUNCTION_DEFINES};MINIMAL_CORE=2") target_link_libraries(${BINARY_NAME}_libretro ${OS_LIB}) - install(TARGETS ${BINARY_NAME}_libretro LIBRARY DESTINATION ${LIBDIR} COMPONENT ${BINARY_NAME}_libretro NAMELINK_SKIP) + install(TARGETS ${BINARY_NAME}_libretro LIBRARY DESTINATION ${LIBRETRO_LIBDIR} COMPONENT ${BINARY_NAME}_libretro NAMELINK_SKIP) endif() if(BUILD_OPENEMU) @@ -659,7 +669,7 @@ if(BUILD_OPENEMU) OUTPUT_NAME ${PROJECT_NAME} COMPILE_DEFINITIONS "DISABLE_THREADING;${OS_DEFINES};${FUNCTION_DEFINES};MINIMAL_CORE=1") target_link_libraries(${BINARY_NAME}-openemu ${OS_LIB} ${FOUNDATION} ${OPENEMUBASE}) - install(TARGETS ${BINARY_NAME}-openemu LIBRARY DESTINATION ${LIBDIR} COMPONENT ${BINARY_NAME}.oecoreplugin NAMELINK_SKIP) + install(TARGETS ${BINARY_NAME}-openemu LIBRARY DESTINATION ${OE_LIBDIR} COMPONENT ${BINARY_NAME}.oecoreplugin NAMELINK_SKIP) endif() if(BUILD_SDL)