summaryrefslogtreecommitdiff
path: root/cmake/helpers/EflMacros.cmake
diff options
context:
space:
mode:
authorGustavo Sverzut Barbieri <barbieri@profusion.mobi>2017-02-01 12:25:43 -0200
committerGustavo Sverzut Barbieri <barbieri@profusion.mobi>2017-02-01 12:25:43 -0200
commit364c5c4cd8508121e98e640fead39abf724d93a1 (patch)
treeb7ea8bc0da1a72720dffeeb147ebfdfdcd05a194 /cmake/helpers/EflMacros.cmake
parentb6ded792400c098dbd0c17d39a3a8fee67bedf08 (diff)
cmake: handle 'FindXXX.cmake' standard with 'find-XXX' libraries.
One can use virtual 'find-XXX' entries in LIBRARIES or PUBLIC_LIBRARIES to use XXX_LIBRARIES and XXX_INCLUDE_DIR.
Diffstat (limited to '')
-rw-r--r--cmake/helpers/EflMacros.cmake84
1 files changed, 84 insertions, 0 deletions
diff --git a/cmake/helpers/EflMacros.cmake b/cmake/helpers/EflMacros.cmake
index c48270e1f2..98ac3f7392 100644
--- a/cmake/helpers/EflMacros.cmake
+++ b/cmake/helpers/EflMacros.cmake
@@ -870,6 +870,30 @@ function(EFL_SUPPORT_LIB _target)
870 set(_compile_flags "${_compile_flags} ${_c}") 870 set(_compile_flags "${_compile_flags} ${_c}")
871 endforeach() 871 endforeach()
872 872
873 set(_libraries)
874 foreach(_l ${LIBRARIES})
875 if(${_l} MATCHES "^find-")
876 string(REGEX REPLACE "^find-" "" _v "${_l}")
877 list(APPEND _libraries ${${_v}_LIBRARIES})
878 list(APPEND SYSTEM_INCLUDE_DIRECTORIES ${${_v}_INCLUDE_DIR})
879 else()
880 list(APPEND _libraries ${_l})
881 endif()
882 endforeach()
883 set(LIBRARIES ${_libraries})
884
885 set(_public_libraries)
886 foreach(_l ${PUBLIC_LIBRARIES})
887 if(${_l} MATCHES "^find-")
888 string(REGEX REPLACE "^find-" "" _v "${_l}")
889 list(APPEND _public_libraries ${${_v}_LIBRARIES})
890 list(APPEND SYSTEM_INCLUDE_DIRECTORIES ${${_v}_INCLUDE_DIR})
891 else()
892 list(APPEND _public_libraries ${_l})
893 endif()
894 endforeach()
895 set(PUBLIC_LIBRARIES ${_public_libraries})
896
873 add_library(support-${_target} ${LIBRARY_TYPE} ${_sources} ${_headers}) 897 add_library(support-${_target} ${LIBRARY_TYPE} ${_sources} ${_headers})
874 set_target_properties(support-${_target} PROPERTIES 898 set_target_properties(support-${_target} PROPERTIES
875 OBJECT_DEPENDS "${_obj_deps}" 899 OBJECT_DEPENDS "${_obj_deps}"
@@ -1080,6 +1104,30 @@ function(EFL_LIB _target)
1080 set(_compile_flags "${_compile_flags} ${_c}") 1104 set(_compile_flags "${_compile_flags} ${_c}")
1081 endforeach() 1105 endforeach()
1082 1106
1107 set(_libraries)
1108 foreach(_l ${LIBRARIES})
1109 if(${_l} MATCHES "^find-")
1110 string(REGEX REPLACE "^find-" "" _v "${_l}")
1111 list(APPEND _libraries ${${_v}_LIBRARIES})
1112 list(APPEND SYSTEM_INCLUDE_DIRECTORIES ${${_v}_INCLUDE_DIR})
1113 else()
1114 list(APPEND _libraries ${_l})
1115 endif()
1116 endforeach()
1117 set(LIBRARIES ${_libraries})
1118
1119 set(_public_libraries)
1120 foreach(_l ${PUBLIC_LIBRARIES})
1121 if(${_l} MATCHES "^find-")
1122 string(REGEX REPLACE "^find-" "" _v "${_l}")
1123 list(APPEND _public_libraries ${${_v}_LIBRARIES})
1124 list(APPEND SYSTEM_INCLUDE_DIRECTORIES ${${_v}_INCLUDE_DIR})
1125 else()
1126 list(APPEND _public_libraries ${_l})
1127 endif()
1128 endforeach()
1129 set(PUBLIC_LIBRARIES ${_public_libraries})
1130
1083 add_library(${_target} ${LIBRARY_TYPE} ${_sources} ${_headers}) 1131 add_library(${_target} ${LIBRARY_TYPE} ${_sources} ${_headers})
1084 set_target_properties(${_target} PROPERTIES 1132 set_target_properties(${_target} PROPERTIES
1085 FRAMEWORK TRUE 1133 FRAMEWORK TRUE
@@ -1253,6 +1301,18 @@ function(EFL_BIN _binname)
1253 1301
1254 EFL_PKG_CONFIG_EVAL(${_bintarget} "${PKG_CONFIG_REQUIRES_PRIVATE}" "") 1302 EFL_PKG_CONFIG_EVAL(${_bintarget} "${PKG_CONFIG_REQUIRES_PRIVATE}" "")
1255 1303
1304 set(_libraries)
1305 foreach(_l ${LIBRARIES})
1306 if(${_l} MATCHES "^find-")
1307 string(REGEX REPLACE "^find-" "" _v "${_l}")
1308 list(APPEND _libraries ${${_v}_LIBRARIES})
1309 list(APPEND SYSTEM_INCLUDE_DIRECTORIES ${${_v}_INCLUDE_DIR})
1310 else()
1311 list(APPEND _libraries ${_l})
1312 endif()
1313 endforeach()
1314 set(LIBRARIES ${_libraries})
1315
1256 add_executable(${_bintarget} ${_sources}) 1316 add_executable(${_bintarget} ${_sources})
1257 1317
1258 if(_obj_deps) 1318 if(_obj_deps)
@@ -1383,6 +1443,18 @@ function(EFL_TEST _testname)
1383 1443
1384 EFL_PKG_CONFIG_EVAL(${_testtarget} "${PKG_CONFIG_REQUIRES_PRIVATE}" "") 1444 EFL_PKG_CONFIG_EVAL(${_testtarget} "${PKG_CONFIG_REQUIRES_PRIVATE}" "")
1385 1445
1446 set(_libraries)
1447 foreach(_l ${LIBRARIES})
1448 if(${_l} MATCHES "^find-")
1449 string(REGEX REPLACE "^find-" "" _v "${_l}")
1450 list(APPEND _libraries ${${_v}_LIBRARIES})
1451 list(APPEND SYSTEM_INCLUDE_DIRECTORIES ${${_v}_INCLUDE_DIR})
1452 else()
1453 list(APPEND _libraries ${_l})
1454 endif()
1455 endforeach()
1456 set(LIBRARIES ${_libraries})
1457
1386 add_executable(${_testtarget} EXCLUDE_FROM_ALL ${_sources}) 1458 add_executable(${_testtarget} EXCLUDE_FROM_ALL ${_sources})
1387 1459
1388 if(_obj_deps) 1460 if(_obj_deps)
@@ -1530,6 +1602,18 @@ function(EFL_MODULE _modname)
1530 1602
1531 EFL_PKG_CONFIG_EVAL(${_modtarget} "${PKG_CONFIG_REQUIRES_PRIVATE}" "") 1603 EFL_PKG_CONFIG_EVAL(${_modtarget} "${PKG_CONFIG_REQUIRES_PRIVATE}" "")
1532 1604
1605 set(_libraries)
1606 foreach(_l ${LIBRARIES})
1607 if(${_l} MATCHES "^find-")
1608 string(REGEX REPLACE "^find-" "" _v "${_l}")
1609 list(APPEND _libraries ${${_v}_LIBRARIES})
1610 list(APPEND SYSTEM_INCLUDE_DIRECTORIES ${${_v}_INCLUDE_DIR})
1611 else()
1612 list(APPEND _libraries ${_l})
1613 endif()
1614 endforeach()
1615 set(LIBRARIES ${_libraries})
1616
1533 add_library(${_modtarget} ${_modtype} ${_sources}) 1617 add_library(${_modtarget} ${_modtype} ${_sources})
1534 set_target_properties(${_modtarget} PROPERTIES 1618 set_target_properties(${_modtarget} PROPERTIES
1535 OBJECT_DEPENDS "${_obj_deps}" 1619 OBJECT_DEPENDS "${_obj_deps}"