[x265] [PATCH] Do not install pkg-config file only if shared library is built
Rafaël Carré
funman at videolan.org
Wed Dec 18 11:43:41 CET 2013
.pc file is useful as well when using static libs
---
source/CMakeLists.txt | 20 +++++++++++---------
1 file changed, 11 insertions(+), 9 deletions(-)
diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt
index 0d1684f..9b6ffac 100644
--- a/source/CMakeLists.txt
+++ b/source/CMakeLists.txt
@@ -221,18 +221,20 @@ if(ENABLE_SHARED)
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib)
-
- # convert lists of link libraries into -lstdc++ -lm etc..
- foreach(LIB ${CMAKE_CXX_IMPLICIT_LINK_LIBRARIES} ${PLATFORM_LIBS})
- set(PRIVATE_LIBS "${PRIVATE_LIBS} -l${LIB}")
- endforeach()
- # Produce a pkg-config file for linking against the shared lib
- configure_file("x265.pc.in" "x265.pc" @ONLY)
- install(FILES "${CMAKE_CURRENT_BINARY_DIR}/x265.pc"
- DESTINATION "${CMAKE_INSTALL_PREFIX}/lib/pkgconfig")
endif()
endif()
+if(X265_LATEST_TAG)
+ # convert lists of link libraries into -lstdc++ -lm etc..
+ foreach(LIB ${CMAKE_CXX_IMPLICIT_LINK_LIBRARIES} ${PLATFORM_LIBS})
+ set(PRIVATE_LIBS "${PRIVATE_LIBS} -l${LIB}")
+ endforeach()
+ # Produce a pkg-config file
+ configure_file("x265.pc.in" "x265.pc" @ONLY)
+ install(FILES "${CMAKE_CURRENT_BINARY_DIR}/x265.pc"
+ DESTINATION "${CMAKE_INSTALL_PREFIX}/lib/pkgconfig")
+endif()
+
if(NOT WIN32)
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/cmake/cmake_uninstall.cmake"
--
1.8.5.2
More information about the x265-devel
mailing list