forked from enlightenment/efl
cmake: auto-detect binaries in src/bin/libname if no CMakeLists.txt
similar to tests, binaries should also follow the same rule and allow single-binaries with single-source.
This commit is contained in:
parent
f4744e1d2a
commit
18af6422a0
|
@ -700,6 +700,8 @@ endfunction()
|
||||||
#
|
#
|
||||||
# Internal function to process bins of current EFL_LIB()
|
# Internal function to process bins of current EFL_LIB()
|
||||||
function(_EFL_LIB_PROCESS_BINS_INTERNAL)
|
function(_EFL_LIB_PROCESS_BINS_INTERNAL)
|
||||||
|
unset(${EFL_LIB_CURRENT}_BINS CACHE)
|
||||||
|
|
||||||
if(EXISTS ${EFL_BIN_SOURCE_DIR}/CMakeLists.txt)
|
if(EXISTS ${EFL_BIN_SOURCE_DIR}/CMakeLists.txt)
|
||||||
EFL_BIN(${EFL_LIB_CURRENT})
|
EFL_BIN(${EFL_LIB_CURRENT})
|
||||||
else()
|
else()
|
||||||
|
@ -711,6 +713,10 @@ function(_EFL_LIB_PROCESS_BINS_INTERNAL)
|
||||||
endforeach()
|
endforeach()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(NOT ${EFL_LIB_CURRENT}_BINS AND EXISTS ${EFL_BIN_SOURCE_DIR} AND NOT EXISTS ${EFL_BIN_SOURCE_DIR}/CMakeLists.txt)
|
||||||
|
EFL_BIN(${EFL_LIB_CURRENT})
|
||||||
|
endif()
|
||||||
|
|
||||||
if(${EFL_LIB_CURRENT}_BINS)
|
if(${EFL_LIB_CURRENT}_BINS)
|
||||||
add_custom_target(${EFL_LIB_CURRENT}-bins DEPENDS ${${EFL_LIB_CURRENT}_BINS})
|
add_custom_target(${EFL_LIB_CURRENT}-bins DEPENDS ${${EFL_LIB_CURRENT}_BINS})
|
||||||
endif()
|
endif()
|
||||||
|
@ -1091,6 +1097,8 @@ function(EFL_BIN _binname)
|
||||||
if(INSTALL_DIR)
|
if(INSTALL_DIR)
|
||||||
install(TARGETS ${_bintarget} RUNTIME DESTINATION ${INSTALL_DIR})
|
install(TARGETS ${_bintarget} RUNTIME DESTINATION ${INSTALL_DIR})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
LIST_APPEND_GLOBAL(${EFL_LIB_CURRENT}_BINS ${_bintarget})
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
# EFL_TEST(Name)
|
# EFL_TEST(Name)
|
||||||
|
|
Loading…
Reference in New Issue