On Wed, Mar 06, 2019 at 12:08:46PM +0200, Leon Romanovsky wrote: > From: Leon Romanovsky <leonro@xxxxxxxxxxxx> > > Add special function to generate and install in proper place UDEV > binaries. Those files are expected to be in one level above already > declared general rules.d location, in default case it will be or > in /usr/lib/udev or in /lib/udev for old distributions. > > Such location is not needed to be configured by users because they > already provide -DCMAKE_INSTALL_UDEV_RULESDIR if they want. > > Signed-off-by: Leon Romanovsky <leonro@xxxxxxxxxxxx> > buildlib/rdma_functions.cmake | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/buildlib/rdma_functions.cmake b/buildlib/rdma_functions.cmake > index fa3fed33..f795d6ac 100644 > +++ b/buildlib/rdma_functions.cmake > @@ -229,6 +229,14 @@ function(rdma_sbin_executable EXEC) > install(TARGETS ${EXEC} DESTINATION "${CMAKE_INSTALL_SBINDIR}") > endfunction() > > +# Create an installed executable (under /usr/lib/udev) > +function(rdma_udev_executable EXEC) > + add_executable(${EXEC} ${ARGN}) > + target_link_libraries(${EXEC} LINK_PRIVATE ${COMMON_LIBS}) > + set_target_properties(${EXEC} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${BUILD_BIN}") > + install(TARGETS ${EXEC} DESTINATION "${CMAKE_INSTALL_UDEV_RULESDIR}/../") > +endfunction() Generally single use things should be in the one cmake file that needs it Jason