summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorGustavo Sverzut Barbieri <barbieri@profusion.mobi>2017-01-27 15:27:51 -0200
committerGustavo Sverzut Barbieri <barbieri@profusion.mobi>2017-01-27 17:26:05 -0200
commit0ba52770bdadb7cb090c8b1533c83afb193cc8b6 (patch)
tree80d41831c6f8a7c0271a38e62cb066d2cda7a728 /cmake
parentf5e6b0629802222b79a564aa9ca2afee30bea8d7 (diff)
cmake: EFL_BIN() now checks for EFL_UTILITY and installs to proper location.
utility binaries shouldn't be in bin ($PATH), but in a library-specific directory (lib/${libname}/utils/v-${maj}.${min})
Diffstat (limited to 'cmake')
-rw-r--r--cmake/helpers/EflMacros.cmake11
1 files changed, 11 insertions, 0 deletions
diff --git a/cmake/helpers/EflMacros.cmake b/cmake/helpers/EflMacros.cmake
index 47205f5878..fb783b086d 100644
--- a/cmake/helpers/EflMacros.cmake
+++ b/cmake/helpers/EflMacros.cmake
@@ -943,6 +943,8 @@ endfunction()
943# - EFL_MODULES_BINARY_DIR to binary dir of ${Name} modules 943# - EFL_MODULES_BINARY_DIR to binary dir of ${Name} modules
944# - EFL_TESTS_SOURCE_DIR to source dir of ${Name} tests 944# - EFL_TESTS_SOURCE_DIR to source dir of ${Name} tests
945# - EFL_TESTS_BINARY_DIR to binary dir of ${Name} tests 945# - EFL_TESTS_BINARY_DIR to binary dir of ${Name} tests
946# - EFL_UTILS_DIR to the binary dir of ${Name} utility binaries
947# (those that should exist in runtime but not visible from $PATH)
946# 948#
947# Modules are processed like: 949# Modules are processed like:
948# - loop for directories in src/modules/${EFL_LIB_CURRENT}: 950# - loop for directories in src/modules/${EFL_LIB_CURRENT}:
@@ -982,6 +984,7 @@ function(EFL_LIB _target)
982 set(EFL_MODULES_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/src/modules/${_target}) 984 set(EFL_MODULES_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/src/modules/${_target})
983 set(EFL_TESTS_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src/tests/${_target}) 985 set(EFL_TESTS_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src/tests/${_target})
984 set(EFL_TESTS_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/src/tests/${_target}) 986 set(EFL_TESTS_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/src/tests/${_target})
987 set(EFL_UTILS_DIR lib/${_target}/utils/v-${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR})
985 988
986 unset(EFL_ALL_OPTIONS_${EFL_LIB_CURRENT} CACHE) 989 unset(EFL_ALL_OPTIONS_${EFL_LIB_CURRENT} CACHE)
987 990
@@ -1157,6 +1160,8 @@ endfunction()
1157# - INSTALL_DIR: defaults to bin. If empty, won't install. 1160# - INSTALL_DIR: defaults to bin. If empty, won't install.
1158# - COMPILE_FLAGS: extra CFLAGS to append. 1161# - COMPILE_FLAGS: extra CFLAGS to append.
1159# - LINK_FLAGS: extra LDFLAGS to append. 1162# - LINK_FLAGS: extra LDFLAGS to append.
1163# - EFL_UTILITY: if ON, will be installed to EFL_UTILS_DIR instead of
1164# bin, not being exposed to $PATH.
1160# 1165#
1161# NOTE: it's meant to be called by files included by EFL_LIB() or similar, 1166# NOTE: it's meant to be called by files included by EFL_LIB() or similar,
1162# otherwise you need to prepare the environment yourself. 1167# otherwise you need to prepare the environment yourself.
@@ -1179,6 +1184,7 @@ function(EFL_BIN _binname)
1179 set(PKG_CONFIG_REQUIRES_PRIVATE) 1184 set(PKG_CONFIG_REQUIRES_PRIVATE)
1180 set(COMPILE_FLAGS) 1185 set(COMPILE_FLAGS)
1181 set(LINK_FLAGS) 1186 set(LINK_FLAGS)
1187 set(EFL_UTILITY OFF)
1182 1188
1183 if(_binname STREQUAL ${EFL_LIB_CURRENT}) 1189 if(_binname STREQUAL ${EFL_LIB_CURRENT})
1184 set(_binsrcdir "${EFL_BIN_SOURCE_DIR}") 1190 set(_binsrcdir "${EFL_BIN_SOURCE_DIR}")
@@ -1203,6 +1209,10 @@ function(EFL_BIN _binname)
1203 message(WARNING "${_binsrcdir}/CMakeLists.txt should not define PKG_CONFIG_REQUIRES. Use PKG_CONFIG_REQUIRES_PRIVATE instead") 1209 message(WARNING "${_binsrcdir}/CMakeLists.txt should not define PKG_CONFIG_REQUIRES. Use PKG_CONFIG_REQUIRES_PRIVATE instead")
1204 endif() 1210 endif()
1205 1211
1212 if(EFL_UTILITY AND INSTALL_DIR STREQUAL "bin")
1213 set(INSTALL_DIR ${EFL_UTILS_DIR})
1214 endif()
1215
1206 EFL_FILES_TO_ABSOLUTE(_sources ${_binsrcdir} ${_binbindir} ${SOURCES}) 1216 EFL_FILES_TO_ABSOLUTE(_sources ${_binsrcdir} ${_binbindir} ${SOURCES})
1207 EFL_FILES_TO_ABSOLUTE(_obj_deps ${_binsrcdir} ${_binbindir} ${OBJECT_DEPENDS}) 1217 EFL_FILES_TO_ABSOLUTE(_obj_deps ${_binsrcdir} ${_binbindir} ${OBJECT_DEPENDS})
1208 1218
@@ -1255,6 +1265,7 @@ function(EFL_BIN _binname)
1255 1265
1256 if(INSTALL_DIR) 1266 if(INSTALL_DIR)
1257 install(TARGETS ${_bintarget} RUNTIME DESTINATION ${INSTALL_DIR}) 1267 install(TARGETS ${_bintarget} RUNTIME DESTINATION ${INSTALL_DIR})
1268 set_target_properties(${_bintarget} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${INSTALL_DIR})
1258 endif() 1269 endif()
1259 1270
1260 LIST_APPEND_GLOBAL(${EFL_LIB_CURRENT}_BINS ${_bintarget}) 1271 LIST_APPEND_GLOBAL(${EFL_LIB_CURRENT}_BINS ${_bintarget})