- #Format Build require package
- foreach (PKG_CONFIG ${PKG_REQUIRED_LIST})
- #Unset TMP variable
- unset(XPREFIX)
- unset(XRULE)
- unset(RPM_EXTRA_DEP)
- unset(DEB_EXTRA_DEP)
- #For deb package,add EOL format only for a new line
- if(DEB_PKG_DEPS)
- set(DEB_PKG_DEPS "${DEB_PKG_DEPS},\n")
- endif()
- #Get pkg-config rule on version
- string(REGEX REPLACE "[<>]?=.*$" "" XPREFIX ${PKG_CONFIG})
- string(REGEX MATCH "[<>]?=" XRULE ${PKG_CONFIG})
- #Only if pkg-config has rule on version
- if(XRULE)
- string(REGEX REPLACE ".*[<>]?=" "" XVERS ${PKG_CONFIG})
- set(RPM_EXTRA_DEP " ${XRULE} ${XVERS}")
- set(DEB_EXTRA_DEP " (${XRULE} ${XVERS})")
- endif()
- #Format for rpm package
- set(RPM_PKG_DEPS "${RPM_PKG_DEPS}BuildRequires: pkgconfig(${XPREFIX})${RPM_EXTRA_DEP}\n")
- #Format for deb package
- #Because the tool "dpkg" is used on the packages db to find the
- #package providing the pkg-cong file ${XPREFIX}.pc, we need
- #to test the OS release package type
- if( OSRELEASE MATCHES "debian" )
- execute_process(
- COMMAND dpkg -S *${XPREFIX}.pc
- OUTPUT_VARIABLE TMP_PKG_BIN
- )
- #Need to be harden check
- string(REGEX REPLACE ":.*$" "" PKG_BIN ${TMP_PKG_BIN})
- set(DEB_PKG_DEPS "${DEB_PKG_DEPS} ${PKG_BIN} ${DEB_EXTRA_DEP}")
- endif()
- endforeach()
+# ----------------------------------------------------------------------------
+# Packaging target
+# ----------------------------------------------------------------------------
+#Format Build require package
+foreach (PKG_CONFIG ${PKG_REQUIRED_LIST})
+ #Unset TMP variable
+ unset(XPREFIX)
+ unset(XRULE)
+ unset(RPM_EXTRA_DEP)
+ unset(DEB_EXTRA_DEP)
+ #For deb package,add EOL format only for a new line
+ if(DEB_PKG_DEPS)
+ set(DEB_PKG_DEPS "${DEB_PKG_DEPS},\n")
+ endif()
+ #Get pkg-config rule on version
+ string(REGEX REPLACE "[<>]?=.*$" "" XPREFIX ${PKG_CONFIG})
+ string(REGEX MATCH "[<>]?=" XRULE ${PKG_CONFIG})
+ #Only if pkg-config has rule on version
+ if(XRULE)
+ string(REGEX REPLACE ".*[<>]?=" "" XVERS ${PKG_CONFIG})
+ set(RPM_EXTRA_DEP " ${XRULE} ${XVERS}")
+ set(DEB_EXTRA_DEP " (${XRULE} ${XVERS})")
+ endif()
+ # Format for rpm package
+ set(RPM_PKG_DEPS "${RPM_PKG_DEPS}BuildRequires: pkgconfig(${XPREFIX})${RPM_EXTRA_DEP}\n")