Skip to content

Commit

Permalink
CMake changes
Browse files Browse the repository at this point in the history
  • Loading branch information
PhysSong committed Aug 28, 2018
1 parent 61d8d16 commit c57a607
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 14 deletions.
10 changes: 2 additions & 8 deletions cmake/modules/BuildPlugin.cmake
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# BuildPlugin.cmake - Copyright (c) 2008 Tobias Doerffel
#
# description: build LMMS-plugin
# usage: BUILD_PLUGIN(<PLUGIN_NAME> <PLUGIN_SOURCES> MOCFILES <HEADERS_FOR_MOC> EMBEDDED_RESOURCES <LIST_OF_FILES_TO_EMBED> UICFILES <UI_FILES_TO_COMPILE> LINK <SHARED|MODULE|DYNAMIC>)
# usage: BUILD_PLUGIN(<PLUGIN_NAME> <PLUGIN_SOURCES> MOCFILES <HEADERS_FOR_MOC> EMBEDDED_RESOURCES <LIST_OF_FILES_TO_EMBED> UICFILES <UI_FILES_TO_COMPILE> LINK <SHARED|MODULE>)

INCLUDE(GenQrc)

Expand Down Expand Up @@ -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)
Expand All @@ -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\"")
Expand Down
13 changes: 7 additions & 6 deletions plugins/carlabase/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit c57a607

Please sign in to comment.