Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ target_include_directories(cpptoml INTERFACE
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While at it, we might want to use GNUInstallDirs for this so that CMAKE_INSTALL_INCLUDEDIR is respected, see https://github.com/jtojnar/cmake-snips#hardcoding-the-installation-paths.


configure_file(
"${PROJECT_SOURCE_DIR}/cpptoml.pc.in"
"${PROJECT_SOURCE_DIR}/cpptoml.pc"
@ONLY)

if (LIBDL_LIBRARY)
target_link_libraries(cpptoml INTERFACE ${LIBDL_LIBRARY})
endif()
Expand Down Expand Up @@ -87,6 +92,8 @@ install(FILES
${CMAKE_CURRENT_BINARY_DIR}/cpptoml/cpptomlConfig.cmake
DESTINATION
lib/cmake/cpptoml)
install(FILES "${PROJECT_SOURCE_DIR}/cpptoml.pc"
DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig")

export(EXPORT cpptoml-exports
FILE ${CMAKE_CURRENT_BINARY_DIR}/cpptoml/cpptomlTargets.cmake)
Expand Down
7 changes: 7 additions & 0 deletions cpptoml.pc.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
prefix=@CMAKE_INSTALL_PREFIX@
includedir=${prefix}/include

Name: cpptoml
Description: A header-only library for parsing TOML
Version: @cpptoml_VERSION@
Cflags: -I${includedir}