File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -65,6 +65,8 @@ endfunction()
6565
6666# installLSLApp: adds the specified target to the install list and
6767# add some quality-of-life improvements for Qt executables
68+ # After the target, additional libraries to install alongside the target can be
69+ # specified, e.g. installLSLApp(FooApp libXY libZ)
6870function (installLSLApp target )
6971 get_target_property (TARGET_LIBRARIES ${target} LINK_LIBRARIES )
7072 string (REGEX MATCH ";Qt5::" qtapp ";${TARGET_LIBRARIES} " )
@@ -88,6 +90,15 @@ function(installLSLApp target)
8890 set (CMAKE_INSTALL_LIBDIR ${PROJECT_NAME} )
8991 set (lsldir "\$ {CMAKE_INSTALL_PREFIX}/LSL" )
9092 endif ()
93+
94+ # install additional library dependencies supplied after the target argument
95+ foreach (libdependency ${ARGN} )
96+ if (NOT TARGET ${libdependency} )
97+ message (FATAL_ERROR "Additional arguments to installLSLApp must be library targets, ${libdependency} isn't." )
98+ endif ()
99+ install (CODE "file(INSTALL $<TARGET_FILE:${libdependency} > DESTINATION \$ {CMAKE_INSTALL_PREFIX}/$<IF:$<PLATFORM_ID:Windows>,${CMAKE_INSTALL_BINDIR} ,${CMAKE_INSTALL_LIBDIR} >)" )
100+ endforeach ()
101+
91102 set_property (GLOBAL APPEND PROPERTY
92103 "LSLDEPENDS_${PROJECT_NAME} " liblsl)
93104 install (TARGETS ${target} COMPONENT ${PROJECT_NAME}
You can’t perform that action at this time.
0 commit comments