Fix cmake config module

This commit is contained in:
Bjarne von Horn 2022-01-01 23:41:23 +01:00
parent d599f79832
commit 9d484de82a
2 changed files with 8 additions and 8 deletions

View File

@ -75,11 +75,11 @@ libethercat_la_LDFLAGS = -version-info 2:0:1
pkgconfig_DATA = libethercat.pc pkgconfig_DATA = libethercat.pc
cmakedir = $(libdir)/cmake cmakedir = $(libdir)/cmake/ethercat
cmake_DATA = EtherCATConfig.cmake cmake_DATA = ethercat-config.cmake
EXTRA_DIST = EtherCATConfig.cmake.in EXTRA_DIST = ethercat-config.cmake.in
CLEANFILES = $(cmake_DATA) CLEANFILES = $(cmake_DATA)
@ -110,5 +110,5 @@ endif
# we need to replace the variables manually, because autotools does not expand them. # we need to replace the variables manually, because autotools does not expand them.
EtherCATConfig.cmake: $(srcdir)/EtherCATConfig.cmake.in Makefile ethercat-config.cmake: $(srcdir)/ethercat-config.cmake.in Makefile
$(SED) -e 's,%libdir%,$(libdir),' -e 's,%includedir%,$(includedir),' $< > $@ $(SED) -e 's,%libdir%,$(libdir),' -e 's,%includedir%,$(includedir),' $< > $@

View File

@ -29,7 +29,7 @@
find_library(EtherCAT_LIBRARY find_library(EtherCAT_LIBRARY
NAMES EtherCAT NAMES ethercat
PATHS %libdir% PATHS %libdir%
) )
@ -40,9 +40,9 @@ find_path(EtherCAT_INCLUDE_DIR
mark_as_advanced(EtherCAT_LIBRARY EtherCAT_INCLUDE_DIR) mark_as_advanced(EtherCAT_LIBRARY EtherCAT_INCLUDE_DIR)
if(NOT TARGET EtherLab::EtherCAT) if(NOT TARGET EtherLab::ethercat)
add_library(EtherLab::EtherCAT SHARED IMPORTED) add_library(EtherLab::ethercat SHARED IMPORTED)
set_target_properties(EtherLab::EtherCAT PROPERTIES set_target_properties(EtherLab::ethercat PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${EtherCAT_INCLUDE_DIR}" INTERFACE_INCLUDE_DIRECTORIES "${EtherCAT_INCLUDE_DIR}"
IMPORTED_LOCATION "${EtherCAT_LIBRARY}" IMPORTED_LOCATION "${EtherCAT_LIBRARY}"
) )