From c57a6071045c60075aa511d8745a447f82d188a3 Mon Sep 17 00:00:00 2001 From: Hyunjin Song Date: Tue, 28 Aug 2018 09:42:51 +0900 Subject: [PATCH] CMake changes --- cmake/modules/BuildPlugin.cmake | 10 ++-------- plugins/carlabase/CMakeLists.txt | 13 +++++++------ 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/cmake/modules/BuildPlugin.cmake b/cmake/modules/BuildPlugin.cmake index 3d194deeb90..efa3e5b468e 100644 --- a/cmake/modules/BuildPlugin.cmake +++ b/cmake/modules/BuildPlugin.cmake @@ -1,7 +1,7 @@ # BuildPlugin.cmake - Copyright (c) 2008 Tobias Doerffel # # description: build LMMS-plugin -# usage: BUILD_PLUGIN( MOCFILES EMBEDDED_RESOURCES UICFILES LINK ) +# usage: BUILD_PLUGIN( MOCFILES EMBEDDED_RESOURCES UICFILES LINK ) INCLUDE(GenQrc) @@ -54,12 +54,6 @@ MACRO(BUILD_PLUGIN PLUGIN_NAME) SET(PLUGIN_LINK "MODULE") ENDIF() - IF ("${PLUGIN_LINK}" STREQUAL "SHARED" OR "${PLUGIN_LINK}" STREQUAL "DYNAMIC") - ADD_LIBRARY(${PLUGIN_NAME} SHARED ${PLUGIN_SOURCES} ${plugin_MOC_out}) - ELSE () - ADD_LIBRARY(${PLUGIN_NAME} MODULE ${PLUGIN_SOURCES} ${plugin_MOC_out}) - ENDIF () - ADD_LIBRARY(${PLUGIN_NAME} ${PLUGIN_LINK} ${PLUGIN_SOURCES} ${plugin_MOC_out} ${RCC_OUT}) TARGET_LINK_LIBRARIES(${PLUGIN_NAME} Qt5::Widgets Qt5::Xml) @@ -71,7 +65,7 @@ MACRO(BUILD_PLUGIN PLUGIN_NAME) INSTALL(TARGETS ${PLUGIN_NAME} DESTINATION "${PLUGIN_DIR}") IF(LMMS_BUILD_APPLE) - IF ("${PLUGIN_LINK}" STREQUAL "DYNAMIC") + IF ("${PLUGIN_LINK}" STREQUAL "SHARED") SET_TARGET_PROPERTIES(${PLUGIN_NAME} PROPERTIES LINK_FLAGS "-undefined dynamic_lookup") ELSE() SET_TARGET_PROPERTIES(${PLUGIN_NAME} PROPERTIES LINK_FLAGS "-bundle_loader \"${CMAKE_BINARY_DIR}/lmms\"") diff --git a/plugins/carlabase/CMakeLists.txt b/plugins/carlabase/CMakeLists.txt index 35c907fc54a..2927503b2c3 100644 --- a/plugins/carlabase/CMakeLists.txt +++ b/plugins/carlabase/CMakeLists.txt @@ -1,14 +1,15 @@ if(LMMS_HAVE_CARLA) INCLUDE(BuildPlugin) INCLUDE_DIRECTORIES(${CARLA_INCLUDE_DIRS}) - IF(LMMS_BUILD_APPLE) - SET(CARLA_LINK_TYPE DYNAMIC) - ELSE() - SET(CARLA_LINK_TYPE SHARED) - ENDIF() LINK_DIRECTORIES(${CARLA_LIBRARY_DIRS}) LINK_LIBRARIES(${CARLA_LIBRARIES}) - BUILD_PLUGIN(carlabase carla.cpp carla.h MOCFILES carla.h EMBEDDED_RESOURCES artwork-patchbay.png artwork-rack.png LINK ${CARLA_LINK_TYPE}) + BUILD_PLUGIN(carlabase carla.cpp carla.h MOCFILES carla.h EMBEDDED_RESOURCES artwork-patchbay.png artwork-rack.png LINK SHARED) + IF(LMMS_BUILD_APPLE AND ${CMAKE_VERSION} VERSION_GREATER_EQUAL 3.9.0) + CMAKE_POLICY(SET CMP0068 NEW) + SET_TARGET_PROPERTIES(carlabase + PROPERTIES BUILD_WITH_INSTALL_NAME_DIR TRUE + INSTALL_NAME_DIR "") + ENDIF() SET_TARGET_PROPERTIES(carlabase PROPERTIES SKIP_BUILD_RPATH TRUE BUILD_WITH_INSTALL_RPATH TRUE