summaryrefslogtreecommitdiff
path: root/cmake/helpers/EflMacros.cmake
diff options
context:
space:
mode:
authorGustavo Sverzut Barbieri <barbieri@profusion.mobi>2017-01-27 17:22:24 -0200
committerGustavo Sverzut Barbieri <barbieri@profusion.mobi>2017-01-27 17:26:05 -0200
commitde67f772bbdbb16daa7879f7bdac97e8ff400235 (patch)
treed0748fba89acb351d2c6b7d9934d51958b3acef3 /cmake/helpers/EflMacros.cmake
parent0f4a50c4ba3fa1392d45bccf13e9de6b24c1cf14 (diff)
cmake: pkg-config names uses dashes and are not uniform.
ecore_con provides ecore-con, but ethumb_client provides ethumb_client. That means we need replace '_' with '-' and allow to override that, so ethumb_client will work.
Diffstat (limited to 'cmake/helpers/EflMacros.cmake')
-rw-r--r--cmake/helpers/EflMacros.cmake30
1 files changed, 24 insertions, 6 deletions
diff --git a/cmake/helpers/EflMacros.cmake b/cmake/helpers/EflMacros.cmake
index 9d44f412f6..3c0d7d308b 100644
--- a/cmake/helpers/EflMacros.cmake
+++ b/cmake/helpers/EflMacros.cmake
@@ -575,6 +575,9 @@ function(EFL_PKG_CONFIG_LIB_WRITE)
575 set(_libraries) 575 set(_libraries)
576 set(_public_libraries) 576 set(_public_libraries)
577 577
578 get_target_property(_pkg_config_name ${EFL_LIB_CURRENT} PKG_CONFIG_NAME)
579 get_target_property(_version ${EFL_LIB_CURRENT} VERSION)
580
578 get_target_property(eo_files_public ${EFL_LIB_CURRENT} EFL_EO_PUBLIC) 581 get_target_property(eo_files_public ${EFL_LIB_CURRENT} EFL_EO_PUBLIC)
579 if(eo_files_public) 582 if(eo_files_public)
580 set(_eoinfo "eoincludedir=\${datarootdir}/eolian/include 583 set(_eoinfo "eoincludedir=\${datarootdir}/eolian/include
@@ -593,7 +596,9 @@ eolian_flags=-I\${pc_sysrootdir}\${eoincludedir}/${EFL_LIB_CURRENT}-${PROJECT_VE
593 596
594 foreach(_e ${LIBRARIES}) 597 foreach(_e ${LIBRARIES})
595 if(TARGET ${_e}) 598 if(TARGET ${_e})
596 set(_pkg_config_requires_private "${_pkg_config_requires_private} ${_e}>=${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}") 599 get_target_property(_sub_pc_name ${_e} PKG_CONFIG_NAME)
600 get_target_property(_sub_version ${_e} VERSION)
601 set(_pkg_config_requires_private "${_pkg_config_requires_private} ${_sub_pc_name}>=${_sub_version}")
597 else() 602 else()
598 set(_libraries "${_libraries} -l${_e}") 603 set(_libraries "${_libraries} -l${_e}")
599 endif() 604 endif()
@@ -601,7 +606,9 @@ eolian_flags=-I\${pc_sysrootdir}\${eoincludedir}/${EFL_LIB_CURRENT}-${PROJECT_VE
601 606
602 foreach(_e ${PUBLIC_LIBRARIES}) 607 foreach(_e ${PUBLIC_LIBRARIES})
603 if(TARGET ${_e}) 608 if(TARGET ${_e})
604 set(_pkg_config_requires "${_pkg_config_requires} ${_e}>=${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}") 609 get_target_property(_sub_pc_name ${_e} PKG_CONFIG_NAME)
610 get_target_property(_sub_version ${_e} VERSION)
611 set(_pkg_config_requires "${_pkg_config_requires} ${_sub_pc_name}>=${_sub_version}")
605 else() 612 else()
606 set(_public_libraries "${_public_libraries} -l${_e}") 613 set(_public_libraries "${_public_libraries} -l${_e}")
607 endif() 614 endif()
@@ -624,17 +631,17 @@ pkgdatadir=\${datadir}/${EFL_LIB_CURRENT}
624modules=\${libdir}/${EFL_LIB_CURRENT}/modules 631modules=\${libdir}/${EFL_LIB_CURRENT}/modules
625${_eoinfo} 632${_eoinfo}
626 633
627Name: ${EFL_LIB_CURRENT} 634Name: ${_pkg_config_name}
628Description: ${DESCRIPTION} 635Description: ${DESCRIPTION}
629Version: ${VERSION} 636Version: ${_version}
630Requires:${_pkg_config_requires} 637Requires:${_pkg_config_requires}
631Requires.private:${_pkg_config_requires_private} 638Requires.private:${_pkg_config_requires_private}
632Libs: -L\${libdir} -l${EFL_LIB_CURRENT}${_public_libraries} 639Libs: -L\${libdir} -l${EFL_LIB_CURRENT}${_public_libraries}
633Libs.private:${_libraries} 640Libs.private:${_libraries}
634Cflags: -I\${includedir}/efl-${PROJECT_VERSION_MAJOR}${_cflags} 641Cflags: -I\${includedir}/efl-${PROJECT_VERSION_MAJOR}${_cflags}
635") 642")
636 file(WRITE "${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}/pkgconfig/${EFL_LIB_CURRENT}.pc" "${_contents}") 643 file(WRITE "${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}/pkgconfig/${_pkg_config_name}.pc" "${_contents}")
637 install(FILES "${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}/pkgconfig/${EFL_LIB_CURRENT}.pc" 644 install(FILES "${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}/pkgconfig/${_pkg_config_name}.pc"
638 DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig") 645 DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig")
639endfunction() 646endfunction()
640 647
@@ -783,6 +790,10 @@ define_property(TARGET PROPERTY EFL_EO_PUBLIC
783 BRIEF_DOCS "EFL's .eo/.eot files associated with this target and installed" 790 BRIEF_DOCS "EFL's .eo/.eot files associated with this target and installed"
784 FULL_DOCS "The list of all .eo or .eot files this target uses and installs") 791 FULL_DOCS "The list of all .eo or .eot files this target uses and installs")
785 792
793define_property(TARGET PROPERTY PKG_CONFIG_NAME
794 BRIEF_DOCS "The name to use with pkg-config (.pc) files"
795 FULL_DOCS "This is usually the target name unless some backward compatibility or translations are needed")
796
786# EFL_SUPPORT_LIB(Name) 797# EFL_SUPPORT_LIB(Name)
787# 798#
788# adds a support library as src/static_libs/${Name}, this will 799# adds a support library as src/static_libs/${Name}, this will
@@ -995,6 +1006,7 @@ function(EFL_LIB _target)
995 set(DESCRIPTION) 1006 set(DESCRIPTION)
996 set(PKG_CONFIG_REQUIRES) 1007 set(PKG_CONFIG_REQUIRES)
997 set(PKG_CONFIG_REQUIRES_PRIVATE) 1008 set(PKG_CONFIG_REQUIRES_PRIVATE)
1009 set(PKG_CONFIG_NAME)
998 set(INCLUDE_DIRECTORIES) 1010 set(INCLUDE_DIRECTORIES)
999 set(SYSTEM_INCLUDE_DIRECTORIES) 1011 set(SYSTEM_INCLUDE_DIRECTORIES)
1000 set(OUTPUT_NAME) 1012 set(OUTPUT_NAME)
@@ -1021,6 +1033,10 @@ function(EFL_LIB _target)
1021 message(FATAL_ERROR "Shared libraries must install public headers!") 1033 message(FATAL_ERROR "Shared libraries must install public headers!")
1022 endif() 1034 endif()
1023 1035
1036 if(NOT PKG_CONFIG_NAME)
1037 string(REPLACE "_" "-" PKG_CONFIG_NAME ${EFL_LIB_CURRENT})
1038 endif()
1039
1024 #merge public eo files into sources 1040 #merge public eo files into sources
1025 set(SOURCES ${SOURCES} ${PUBLIC_EO_FILES} ${EO_FILES}) 1041 set(SOURCES ${SOURCES} ${PUBLIC_EO_FILES} ${EO_FILES})
1026 1042
@@ -1063,6 +1079,7 @@ function(EFL_LIB _target)
1063 OBJECT_DEPENDS "${_obj_deps}" 1079 OBJECT_DEPENDS "${_obj_deps}"
1064 EFL_EO_PRIVATE "${_eo_files}" 1080 EFL_EO_PRIVATE "${_eo_files}"
1065 EFL_EO_PUBLIC "${_public_eo_files}" 1081 EFL_EO_PUBLIC "${_public_eo_files}"
1082 PKG_CONFIG_NAME "${PKG_CONFIG_NAME}"
1066 LINK_FLAGS "${_link_flags}" 1083 LINK_FLAGS "${_link_flags}"
1067 COMPILE_FLAGS "${_compile_flags} -DDLL_EXPORT") 1084 COMPILE_FLAGS "${_compile_flags} -DDLL_EXPORT")
1068 1085
@@ -1140,6 +1157,7 @@ function(EFL_LIB _target)
1140 unset(EO_FILES) 1157 unset(EO_FILES)
1141 unset(PKG_CONFIG_REQUIRES) 1158 unset(PKG_CONFIG_REQUIRES)
1142 unset(PKG_CONFIG_REQUIRES_PRIVATE) 1159 unset(PKG_CONFIG_REQUIRES_PRIVATE)
1160 unset(PKG_CONFIG_NAME)
1143 1161
1144 _EFL_LIB_PROCESS_BINS_INTERNAL() 1162 _EFL_LIB_PROCESS_BINS_INTERNAL()
1145 _EFL_LIB_PROCESS_MODULES_INTERNAL() 1163 _EFL_LIB_PROCESS_MODULES_INTERNAL()