From 0e662a060e3deb1066e4306dfb606f08ee937e8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Moreau?= Date: Sat, 9 Nov 2013 17:51:09 -0500 Subject: [PATCH] freerdp: improve pkgconfig .pc file generation --- CMakeLists.txt | 6 ------ libfreerdp/CMakeLists.txt | 4 ++++ freerdp.pc.in => libfreerdp/freerdp.pc.in | 6 +++--- winpr/libwinpr/CMakeLists.txt | 3 +++ winpr/libwinpr/winpr.pc | 12 ++++++++++++ winpr/libwinpr/winpr.pc.in | 12 ++++++++++++ 6 files changed, 34 insertions(+), 9 deletions(-) rename freerdp.pc.in => libfreerdp/freerdp.pc.in (51%) create mode 100644 winpr/libwinpr/winpr.pc create mode 100644 winpr/libwinpr/winpr.pc.in diff --git a/CMakeLists.txt b/CMakeLists.txt index 1e05052be..887435cf1 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -508,12 +508,6 @@ include_directories("${CMAKE_BINARY_DIR}/winpr/include") add_subdirectory(winpr) -# Generate pkg-config -if(NOT MSVC) - configure_file(${CMAKE_CURRENT_SOURCE_DIR}/freerdp.pc.in ${CMAKE_CURRENT_BINARY_DIR}/freerdp.pc @ONLY) - install(FILES ${CMAKE_CURRENT_BINARY_DIR}/freerdp.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) -endif() - if(WITH_CUNIT) message(FATAL_ERROR "cunit (WITH_CUNIT) is deprecated please use BUILD_TESTING to build ctest tests. The cunit directory contains the old tests and is kept until all tests are converted.") diff --git a/libfreerdp/CMakeLists.txt b/libfreerdp/CMakeLists.txt index f2063e8ea..cea42c1c5 100644 --- a/libfreerdp/CMakeLists.txt +++ b/libfreerdp/CMakeLists.txt @@ -65,3 +65,7 @@ if(MONOLITHIC_BUILD) set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "FreeRDP/libfreerdp") endif() +set(FREERDP_PC_LIBS "-lfreerdp -lwinpr") + +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/freerdp.pc.in ${CMAKE_CURRENT_BINARY_DIR}/freerdp.pc @ONLY) +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/freerdp.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) diff --git a/freerdp.pc.in b/libfreerdp/freerdp.pc.in similarity index 51% rename from freerdp.pc.in rename to libfreerdp/freerdp.pc.in index 59e2b446c..3561100d8 100644 --- a/freerdp.pc.in +++ b/libfreerdp/freerdp.pc.in @@ -2,12 +2,12 @@ prefix=@CMAKE_INSTALL_PREFIX@ exec_prefix=@CMAKE_INSTALL_PREFIX@ libdir=@CMAKE_INSTALL_FULL_LIBDIR@ includedir=@CMAKE_INSTALL_PREFIX@/include +libs=@FREERDP_PC_LIBS@ Name: FreeRDP -Description: A free remote desktop protocol client +Description: FreeRDP: A Remote Desktop Protocol Implementation URL: http://www.freerdp.com/ Version: @FREERDP_VERSION_FULL@ Requires: -Libs: -L${libdir} -lfreerdp-cache -lfreerdp-codec -lfreerdp-core -lfreerdp-crypto -lfreerdp-gdi -lfreerdp-locale -lfreerdp-rail -lfreerdp-utils -lwinpr-sspi -lwinpr-rpc -lwinpr-utils +Libs: -L${libdir} ${libs} Cflags: -I${includedir} - diff --git a/winpr/libwinpr/CMakeLists.txt b/winpr/libwinpr/CMakeLists.txt index 5915ad00a..f35bcb1ec 100644 --- a/winpr/libwinpr/CMakeLists.txt +++ b/winpr/libwinpr/CMakeLists.txt @@ -56,6 +56,9 @@ if(MONOLITHIC_BUILD) target_link_libraries(${MODULE_NAME} ${WINPR_LIBS}) install(TARGETS ${MODULE_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT libraries EXPORT WinPRTargets) + + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/winpr.pc.in ${CMAKE_CURRENT_BINARY_DIR}/winpr.pc @ONLY) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/winpr.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "WinPR/libwinpr") endif() diff --git a/winpr/libwinpr/winpr.pc b/winpr/libwinpr/winpr.pc new file mode 100644 index 000000000..5950cce30 --- /dev/null +++ b/winpr/libwinpr/winpr.pc @@ -0,0 +1,12 @@ +prefix=/opt/freerds +exec_prefix=/opt/freerds +libdir=/opt/freerds/lib64 +includedir=/opt/freerds/include + +Name: WinPR +Description: WinPR: Windows Portable Runtime +URL: http://www.freerdp.com/ +Version: 1.1.0 +Requires: +Libs: -L${libdir} -lwinpr +Cflags: -I${includedir} diff --git a/winpr/libwinpr/winpr.pc.in b/winpr/libwinpr/winpr.pc.in new file mode 100644 index 000000000..a593ede7b --- /dev/null +++ b/winpr/libwinpr/winpr.pc.in @@ -0,0 +1,12 @@ +prefix=@CMAKE_INSTALL_PREFIX@ +exec_prefix=@CMAKE_INSTALL_PREFIX@ +libdir=@CMAKE_INSTALL_FULL_LIBDIR@ +includedir=@CMAKE_INSTALL_PREFIX@/include + +Name: WinPR +Description: WinPR: Windows Portable Runtime +URL: http://www.freerdp.com/ +Version: @WINPR_VERSION_FULL@ +Requires: +Libs: -L${libdir} -lwinpr +Cflags: -I${includedir}