forked from enlightenment/efl
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.
This commit is contained in:
parent
b6ded79240
commit
364c5c4cd8
|
@ -870,6 +870,30 @@ function(EFL_SUPPORT_LIB _target)
|
||||||
set(_compile_flags "${_compile_flags} ${_c}")
|
set(_compile_flags "${_compile_flags} ${_c}")
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
|
set(_libraries)
|
||||||
|
foreach(_l ${LIBRARIES})
|
||||||
|
if(${_l} MATCHES "^find-")
|
||||||
|
string(REGEX REPLACE "^find-" "" _v "${_l}")
|
||||||
|
list(APPEND _libraries ${${_v}_LIBRARIES})
|
||||||
|
list(APPEND SYSTEM_INCLUDE_DIRECTORIES ${${_v}_INCLUDE_DIR})
|
||||||
|
else()
|
||||||
|
list(APPEND _libraries ${_l})
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
set(LIBRARIES ${_libraries})
|
||||||
|
|
||||||
|
set(_public_libraries)
|
||||||
|
foreach(_l ${PUBLIC_LIBRARIES})
|
||||||
|
if(${_l} MATCHES "^find-")
|
||||||
|
string(REGEX REPLACE "^find-" "" _v "${_l}")
|
||||||
|
list(APPEND _public_libraries ${${_v}_LIBRARIES})
|
||||||
|
list(APPEND SYSTEM_INCLUDE_DIRECTORIES ${${_v}_INCLUDE_DIR})
|
||||||
|
else()
|
||||||
|
list(APPEND _public_libraries ${_l})
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
set(PUBLIC_LIBRARIES ${_public_libraries})
|
||||||
|
|
||||||
add_library(support-${_target} ${LIBRARY_TYPE} ${_sources} ${_headers})
|
add_library(support-${_target} ${LIBRARY_TYPE} ${_sources} ${_headers})
|
||||||
set_target_properties(support-${_target} PROPERTIES
|
set_target_properties(support-${_target} PROPERTIES
|
||||||
OBJECT_DEPENDS "${_obj_deps}"
|
OBJECT_DEPENDS "${_obj_deps}"
|
||||||
|
@ -1080,6 +1104,30 @@ function(EFL_LIB _target)
|
||||||
set(_compile_flags "${_compile_flags} ${_c}")
|
set(_compile_flags "${_compile_flags} ${_c}")
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
|
set(_libraries)
|
||||||
|
foreach(_l ${LIBRARIES})
|
||||||
|
if(${_l} MATCHES "^find-")
|
||||||
|
string(REGEX REPLACE "^find-" "" _v "${_l}")
|
||||||
|
list(APPEND _libraries ${${_v}_LIBRARIES})
|
||||||
|
list(APPEND SYSTEM_INCLUDE_DIRECTORIES ${${_v}_INCLUDE_DIR})
|
||||||
|
else()
|
||||||
|
list(APPEND _libraries ${_l})
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
set(LIBRARIES ${_libraries})
|
||||||
|
|
||||||
|
set(_public_libraries)
|
||||||
|
foreach(_l ${PUBLIC_LIBRARIES})
|
||||||
|
if(${_l} MATCHES "^find-")
|
||||||
|
string(REGEX REPLACE "^find-" "" _v "${_l}")
|
||||||
|
list(APPEND _public_libraries ${${_v}_LIBRARIES})
|
||||||
|
list(APPEND SYSTEM_INCLUDE_DIRECTORIES ${${_v}_INCLUDE_DIR})
|
||||||
|
else()
|
||||||
|
list(APPEND _public_libraries ${_l})
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
set(PUBLIC_LIBRARIES ${_public_libraries})
|
||||||
|
|
||||||
add_library(${_target} ${LIBRARY_TYPE} ${_sources} ${_headers})
|
add_library(${_target} ${LIBRARY_TYPE} ${_sources} ${_headers})
|
||||||
set_target_properties(${_target} PROPERTIES
|
set_target_properties(${_target} PROPERTIES
|
||||||
FRAMEWORK TRUE
|
FRAMEWORK TRUE
|
||||||
|
@ -1253,6 +1301,18 @@ function(EFL_BIN _binname)
|
||||||
|
|
||||||
EFL_PKG_CONFIG_EVAL(${_bintarget} "${PKG_CONFIG_REQUIRES_PRIVATE}" "")
|
EFL_PKG_CONFIG_EVAL(${_bintarget} "${PKG_CONFIG_REQUIRES_PRIVATE}" "")
|
||||||
|
|
||||||
|
set(_libraries)
|
||||||
|
foreach(_l ${LIBRARIES})
|
||||||
|
if(${_l} MATCHES "^find-")
|
||||||
|
string(REGEX REPLACE "^find-" "" _v "${_l}")
|
||||||
|
list(APPEND _libraries ${${_v}_LIBRARIES})
|
||||||
|
list(APPEND SYSTEM_INCLUDE_DIRECTORIES ${${_v}_INCLUDE_DIR})
|
||||||
|
else()
|
||||||
|
list(APPEND _libraries ${_l})
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
set(LIBRARIES ${_libraries})
|
||||||
|
|
||||||
add_executable(${_bintarget} ${_sources})
|
add_executable(${_bintarget} ${_sources})
|
||||||
|
|
||||||
if(_obj_deps)
|
if(_obj_deps)
|
||||||
|
@ -1383,6 +1443,18 @@ function(EFL_TEST _testname)
|
||||||
|
|
||||||
EFL_PKG_CONFIG_EVAL(${_testtarget} "${PKG_CONFIG_REQUIRES_PRIVATE}" "")
|
EFL_PKG_CONFIG_EVAL(${_testtarget} "${PKG_CONFIG_REQUIRES_PRIVATE}" "")
|
||||||
|
|
||||||
|
set(_libraries)
|
||||||
|
foreach(_l ${LIBRARIES})
|
||||||
|
if(${_l} MATCHES "^find-")
|
||||||
|
string(REGEX REPLACE "^find-" "" _v "${_l}")
|
||||||
|
list(APPEND _libraries ${${_v}_LIBRARIES})
|
||||||
|
list(APPEND SYSTEM_INCLUDE_DIRECTORIES ${${_v}_INCLUDE_DIR})
|
||||||
|
else()
|
||||||
|
list(APPEND _libraries ${_l})
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
set(LIBRARIES ${_libraries})
|
||||||
|
|
||||||
add_executable(${_testtarget} EXCLUDE_FROM_ALL ${_sources})
|
add_executable(${_testtarget} EXCLUDE_FROM_ALL ${_sources})
|
||||||
|
|
||||||
if(_obj_deps)
|
if(_obj_deps)
|
||||||
|
@ -1530,6 +1602,18 @@ function(EFL_MODULE _modname)
|
||||||
|
|
||||||
EFL_PKG_CONFIG_EVAL(${_modtarget} "${PKG_CONFIG_REQUIRES_PRIVATE}" "")
|
EFL_PKG_CONFIG_EVAL(${_modtarget} "${PKG_CONFIG_REQUIRES_PRIVATE}" "")
|
||||||
|
|
||||||
|
set(_libraries)
|
||||||
|
foreach(_l ${LIBRARIES})
|
||||||
|
if(${_l} MATCHES "^find-")
|
||||||
|
string(REGEX REPLACE "^find-" "" _v "${_l}")
|
||||||
|
list(APPEND _libraries ${${_v}_LIBRARIES})
|
||||||
|
list(APPEND SYSTEM_INCLUDE_DIRECTORIES ${${_v}_INCLUDE_DIR})
|
||||||
|
else()
|
||||||
|
list(APPEND _libraries ${_l})
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
set(LIBRARIES ${_libraries})
|
||||||
|
|
||||||
add_library(${_modtarget} ${_modtype} ${_sources})
|
add_library(${_modtarget} ${_modtype} ${_sources})
|
||||||
set_target_properties(${_modtarget} PROPERTIES
|
set_target_properties(${_modtarget} PROPERTIES
|
||||||
OBJECT_DEPENDS "${_obj_deps}"
|
OBJECT_DEPENDS "${_obj_deps}"
|
||||||
|
|
|
@ -2,7 +2,6 @@ set(DESCRIPTION "Library for speedy data storage, retrieval, and compression")
|
||||||
|
|
||||||
set(PKG_CONFIG_REQUIRES_PRIVATE
|
set(PKG_CONFIG_REQUIRES_PRIVATE
|
||||||
zlib>=1.2.3
|
zlib>=1.2.3
|
||||||
#libjpeg is hard to find. there is a cmake module that does find it. and thats checked in common.cmake
|
|
||||||
)
|
)
|
||||||
|
|
||||||
set(PUBLIC_LIBRARIES
|
set(PUBLIC_LIBRARIES
|
||||||
|
@ -13,6 +12,7 @@ set(PUBLIC_LIBRARIES
|
||||||
set(LIBRARIES
|
set(LIBRARIES
|
||||||
m
|
m
|
||||||
support-rg_etc
|
support-rg_etc
|
||||||
|
find-JPEG
|
||||||
)
|
)
|
||||||
|
|
||||||
set(PUBLIC_HEADERS
|
set(PUBLIC_HEADERS
|
||||||
|
|
|
@ -2,8 +2,6 @@ set(DESCRIPTION "Library for simplified serialization, compression and ciphering
|
||||||
|
|
||||||
set(PKG_CONFIG_REQUIRES_PRIVATE
|
set(PKG_CONFIG_REQUIRES_PRIVATE
|
||||||
zlib>=1.2.3
|
zlib>=1.2.3
|
||||||
#libjpeg is hard to find. there is a cmake module that does find it. and thats checked in common.cmake
|
|
||||||
#libjpeg
|
|
||||||
)
|
)
|
||||||
|
|
||||||
set(LIBRARIES
|
set(LIBRARIES
|
||||||
|
@ -11,6 +9,7 @@ set(LIBRARIES
|
||||||
efl
|
efl
|
||||||
m
|
m
|
||||||
support-rg_etc
|
support-rg_etc
|
||||||
|
find-JPEG
|
||||||
)
|
)
|
||||||
|
|
||||||
set(PUBLIC_HEADERS
|
set(PUBLIC_HEADERS
|
||||||
|
|
Loading…
Reference in New Issue