From 226cad3e0368085d25b5fae59ffdcb4abc71dd08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Moreau?= Date: Sun, 10 Nov 2013 17:54:41 -0500 Subject: [PATCH] winpr: improve winpr.pc generation --- .gitignore | 2 +- winpr/libwinpr/CMakeLists.txt | 13 +++++++++++++ winpr/libwinpr/winpr.pc | 12 ------------ winpr/libwinpr/winpr.pc.in | 3 ++- 4 files changed, 16 insertions(+), 14 deletions(-) delete mode 100644 winpr/libwinpr/winpr.pc diff --git a/.gitignore b/.gitignore index 904fbefbd..5e3941bc4 100755 --- a/.gitignore +++ b/.gitignore @@ -5,7 +5,7 @@ CMakeCache.txt config.h install_manifest*.txt CTestTestfile.cmake -freerdp.pc +*.pc Makefile Testing cmake_install.cmake diff --git a/winpr/libwinpr/CMakeLists.txt b/winpr/libwinpr/CMakeLists.txt index f35bcb1ec..5b210c2ad 100644 --- a/winpr/libwinpr/CMakeLists.txt +++ b/winpr/libwinpr/CMakeLists.txt @@ -53,10 +53,23 @@ if(MONOLITHIC_BUILD) set_target_properties(${MODULE_NAME} PROPERTIES LINKER_LANGUAGE C) set_target_properties(${MODULE_NAME} PROPERTIES VERSION ${WINPR_VERSION_FULL} SOVERSION ${WINPR_VERSION} PREFIX "lib") + list(REMOVE_DUPLICATES WINPR_LIBS) target_link_libraries(${MODULE_NAME} ${WINPR_LIBS}) install(TARGETS ${MODULE_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT libraries EXPORT WinPRTargets) + set(WINPR_PC_LIBS "-lwinpr") + + foreach(WINPR_LIB ${WINPR_LIBS}) + if(${WINPR_LIB} MATCHES "^-l.*") + set(WINPR_PC_LIBS "${WINPR_PC_LIBS} ${WINPR_LIB}") + elseif(${WINPR_LIB} MATCHES "^/.*") + + else() + set(WINPR_PC_LIBS "${WINPR_PC_LIBS} -l${WINPR_LIB}") + endif() + endforeach() + 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) diff --git a/winpr/libwinpr/winpr.pc b/winpr/libwinpr/winpr.pc deleted file mode 100644 index 5950cce30..000000000 --- a/winpr/libwinpr/winpr.pc +++ /dev/null @@ -1,12 +0,0 @@ -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 index a593ede7b..538cbf0ed 100644 --- a/winpr/libwinpr/winpr.pc.in +++ b/winpr/libwinpr/winpr.pc.in @@ -2,11 +2,12 @@ prefix=@CMAKE_INSTALL_PREFIX@ exec_prefix=@CMAKE_INSTALL_PREFIX@ libdir=@CMAKE_INSTALL_FULL_LIBDIR@ includedir=@CMAKE_INSTALL_PREFIX@/include +libs=@WINPR_PC_LIBS@ Name: WinPR Description: WinPR: Windows Portable Runtime URL: http://www.freerdp.com/ Version: @WINPR_VERSION_FULL@ Requires: -Libs: -L${libdir} -lwinpr +Libs: -L${libdir} ${libs} Cflags: -I${includedir}