Fix use of the cmake package (#146) Fix use of the cmake package Fix use of the cmake package and its imported targets. Make sure that the include dir comes with the cmake targets Put everything under md4cConfig so that the md4c-html can see md4c. Use md4c namespace so that the targets become md4c::md4c and md4c::md4c-html following cmake standards for imported targets. Fixes #145.
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 4af21f9..66f2f50 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -17,7 +17,6 @@ set_target_properties(md4c PROPERTIES
PUBLIC_HEADER md4c.h
)
-
# Build rules for HTML renderer library
configure_file(md4c-html.pc.in md4c-html.pc @ONLY)
@@ -39,18 +38,19 @@ install(
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
+ INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)
install(FILES ${CMAKE_BINARY_DIR}/src/md4c.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
-install(EXPORT md4cConfig DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/md4c/)
install(
TARGETS md4c-html
- EXPORT md4cHtmlConfig
+ EXPORT md4cConfig
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)
install(FILES ${CMAKE_BINARY_DIR}/src/md4c-html.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
-install(EXPORT md4cHtmlConfig DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/md4c-html/)
+
+install(EXPORT md4cConfig DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/md4c/ NAMESPACE md4c::)