summaryrefslogtreecommitdiff
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
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.
-rw-r--r--cmake/helpers/EflMacros.cmake84
-rw-r--r--src/lib/eet/CMakeLists.txt2
-rw-r--r--src/lib/emile/CMakeLists.txt3
3 files changed, 86 insertions, 3 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}"
diff --git a/src/lib/eet/CMakeLists.txt b/src/lib/eet/CMakeLists.txt
index 76b71a47b5..fb2c02d297 100644
--- a/src/lib/eet/CMakeLists.txt
+++ b/src/lib/eet/CMakeLists.txt
@@ -2,7 +2,6 @@ set(DESCRIPTION "Library for speedy data storage, retrieval, and compression")
2 2
3set(PKG_CONFIG_REQUIRES_PRIVATE 3set(PKG_CONFIG_REQUIRES_PRIVATE
4 zlib>=1.2.3 4 zlib>=1.2.3
5 #libjpeg is hard to find. there is a cmake module that does find it. and thats checked in common.cmake
6) 5)
7 6
8set(PUBLIC_LIBRARIES 7set(PUBLIC_LIBRARIES
@@ -13,6 +12,7 @@ set(PUBLIC_LIBRARIES
13set(LIBRARIES 12set(LIBRARIES
14 m 13 m
15 support-rg_etc 14 support-rg_etc
15 find-JPEG
16) 16)
17 17
18set(PUBLIC_HEADERS 18set(PUBLIC_HEADERS
diff --git a/src/lib/emile/CMakeLists.txt b/src/lib/emile/CMakeLists.txt
index 544a50d925..5ea77fdbc1 100644
--- a/src/lib/emile/CMakeLists.txt
+++ b/src/lib/emile/CMakeLists.txt
@@ -2,8 +2,6 @@ set(DESCRIPTION "Library for simplified serialization, compression and ciphering
2 2
3set(PKG_CONFIG_REQUIRES_PRIVATE 3set(PKG_CONFIG_REQUIRES_PRIVATE
4 zlib>=1.2.3 4 zlib>=1.2.3
5 #libjpeg is hard to find. there is a cmake module that does find it. and thats checked in common.cmake
6 #libjpeg
7) 5)
8 6
9set(LIBRARIES 7set(LIBRARIES
@@ -11,6 +9,7 @@ set(LIBRARIES
11 efl 9 efl
12 m 10 m
13 support-rg_etc 11 support-rg_etc
12 find-JPEG
14) 13)
15 14
16set(PUBLIC_HEADERS 15set(PUBLIC_HEADERS