Skip to content

Commit

Permalink
Change the link of carlabase to SHARED and explicitly link carlarack …
Browse files Browse the repository at this point in the history
…and carlapatchbay to carlabase.
  • Loading branch information
ycollet committed Feb 17, 2016
1 parent 1c0d329 commit 9983f1b
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 6 deletions.
11 changes: 8 additions & 3 deletions cmake/modules/BuildPlugin.cmake
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# 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> )
# 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>)

MACRO(BUILD_PLUGIN PLUGIN_NAME)
CMAKE_PARSE_ARGUMENTS(PLUGIN "" "" "MOCFILES;EMBEDDED_RESOURCES;UICFILES" ${ARGN})
CMAKE_PARSE_ARGUMENTS(PLUGIN "" "" "MOCFILES;EMBEDDED_RESOURCES;UICFILES;LINK" ${ARGN})
SET(PLUGIN_SOURCES ${PLUGIN_UNPARSED_ARGUMENTS})

INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/src/gui)
Expand Down Expand Up @@ -45,7 +45,12 @@ MACRO(BUILD_PLUGIN PLUGIN_NAME)
SET(QT_LIBRARIES "${QT_OVERRIDE_LIBRARIES}")
ENDIF()

ADD_LIBRARY(${PLUGIN_NAME} MODULE ${PLUGIN_SOURCES} ${plugin_MOC_out})
IF ("${PLUGIN_LINK}" STREQUAL "SHARED")
ADD_LIBRARY(${PLUGIN_NAME} SHARED ${PLUGIN_SOURCES} ${plugin_MOC_out})
ELSE ()
ADD_LIBRARY(${PLUGIN_NAME} MODULE ${PLUGIN_SOURCES} ${plugin_MOC_out})
ENDIF ()

IF(QT5)
TARGET_LINK_LIBRARIES(${PLUGIN_NAME} Qt5::Widgets Qt5::Xml)
ENDIF()
Expand Down
2 changes: 1 addition & 1 deletion plugins/carlabase/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ if(LMMS_HAVE_CARLA)
INCLUDE_DIRECTORIES(${CARLA_INCLUDE_DIRS})
LINK_DIRECTORIES(${CARLA_LIBRARY_DIRS})
LINK_LIBRARIES(${CARLA_LIBRARIES})
BUILD_PLUGIN(carlabase carla.cpp carla.h MOCFILES carla.h EMBEDDED_RESOURCES "${CMAKE_CURRENT_SOURCE_DIR}/*.png")
BUILD_PLUGIN(carlabase carla.cpp carla.h MOCFILES carla.h EMBEDDED_RESOURCES "${CMAKE_CURRENT_SOURCE_DIR}/*.png" LINK SHARED)
SET_TARGET_PROPERTIES(carlabase
PROPERTIES SKIP_BUILD_RPATH TRUE
BUILD_WITH_INSTALL_RPATH TRUE
Expand Down
3 changes: 2 additions & 1 deletion plugins/carlapatchbay/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ if(LMMS_HAVE_CARLA)
ADD_DEFINITIONS(-DCARLA_PLUGIN_PATCHBAY -DCARLA_PLUGIN_SYNTH)
INCLUDE(BuildPlugin)
INCLUDE_DIRECTORIES(${CARLA_INCLUDE_DIRS} "${CMAKE_CURRENT_SOURCE_DIR}/../carlabase")
LINK_DIRECTORIES("${CMAKE_CURRENT_BINARY_DIR}/../carlabase")
LINK_DIRECTORIES("${CMAKE_CURRENT_BINARY_DIR}/../carlabase"
${CARLA_LIBRARY_DIRS})
LINK_LIBRARIES(carlabase)
BUILD_PLUGIN(carlapatchbay carlapatchbay.cpp EMBEDDED_RESOURCES "${CMAKE_CURRENT_SOURCE_DIR}/*.png")
endif(LMMS_HAVE_CARLA)
3 changes: 2 additions & 1 deletion plugins/carlarack/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ if(LMMS_HAVE_CARLA)
ADD_DEFINITIONS(-DCARLA_PLUGIN_RACK -DCARLA_PLUGIN_SYNTH)
INCLUDE(BuildPlugin)
INCLUDE_DIRECTORIES(${CARLA_INCLUDE_DIRS} "${CMAKE_CURRENT_SOURCE_DIR}/../carlabase")
LINK_DIRECTORIES("${CMAKE_CURRENT_BINARY_DIR}/../carlabase")
LINK_DIRECTORIES("${CMAKE_CURRENT_BINARY_DIR}/../carlabase"
${CARLA_LIBRARY_DIRS})
LINK_LIBRARIES(carlabase)
BUILD_PLUGIN(carlarack carlarack.cpp EMBEDDED_RESOURCES "${CMAKE_CURRENT_SOURCE_DIR}/*.png")
endif(LMMS_HAVE_CARLA)

0 comments on commit 9983f1b

Please sign in to comment.