cmake: be smart on internal libraries in the generated .pc files.

For internal libraries (those we have a target), generate a pkg-config
one instead of going with the -lNAME route.
This commit is contained in:
Gustavo Sverzut Barbieri 2017-01-23 17:28:48 -02:00
parent f27323395a
commit 8ae1e02f05
1 changed files with 10 additions and 2 deletions

View File

@ -362,11 +362,19 @@ function(EFL_PKG_CONFIG_LIB_WRITE)
endforeach()
foreach(_e ${LIBRARIES})
set(_libraries "${_libraries} -l${_e}")
if(TARGET ${_e})
set(_pkg_config_requires_private "${_pkg_config_requires_private} ${_e}>=${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}")
else()
set(_libraries "${_libraries} -l${_e}")
endif()
endforeach()
foreach(_e ${PUBLIC_LIBRARIES})
set(_public_libraries "${_public_libraries} -l${_e}")
if(TARGET ${_e})
set(_pkg_config_requires "${_pkg_config_requires} ${_e}>=${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}")
else()
set(_public_libraries "${_public_libraries} -l${_e}")
endif()
endforeach()
if(NOT ${EFL_LIB_CURRENT} STREQUAL "efl")