Added support for pkgconfig

This commit is contained in:
Jesse Beder 2009-07-15 20:37:11 +00:00
parent a84c1af98a
commit ff6e6bdfd5
2 changed files with 21 additions and 3 deletions

View File

@ -18,15 +18,17 @@ if(WIN32)
else(WIN32)
set(_library_dir lib)
endif(WIN32)
set(INCLUDE_INSTALL_DIR include/yaml-cpp)
set(LIB_INSTALL_DIR ${_library_dir}${LIB_SUFFIX})
#
set(_INSTALL_DESTINATIONS
RUNTIME DESTINATION bin
LIBRARY DESTINATION ${_library_dir}${LIB_SUFFIX}
LIBRARY DESTINATION ${LIB_INSTALL_DIR}
ARCHIVE DESTINATION lib${LIB_SUFFIX}
)
#
set(INCLUDE_INSTALL_DIR include/yaml-cpp)
file(GLOB public_headers include/*.h)
file(GLOB private_headers src/*.h)
file(GLOB sources src/*.cpp)
@ -48,5 +50,10 @@ install(
DESTINATION ${INCLUDE_INSTALL_DIR}
)
if(UNIX)
configure_file("yaml-cpp.pc.cmake" yaml-cpp.pc @ONLY)
install(FILES yaml-cpp.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)
endif(UNIX)
add_subdirectory (yaml-reader)
add_subdirectory (util)

11
yaml-cpp.pc.cmake Normal file
View File

@ -0,0 +1,11 @@
prefix=@CMAKE_INSTALL_PREFIX@
exec_prefix=@CMAKE_INSTALL_PREFIX@
libdir=@LIB_INSTALL_DIR@
includedir=@INCLUDE_INSTALL_DIR@
Name: Yaml-cpp
Description: A YAML parser for C++
Version: @YAML_CPP_VERSION@
Requires:
Libs: -L${libdir} -lyaml-cpp
Cflags: -I${includedir}