summaryrefslogtreecommitdiff
path: root/cmake/helpers/EflMacros.cmake
diff options
context:
space:
mode:
authorGustavo Sverzut Barbieri <barbieri@profusion.mobi>2017-01-23 19:35:51 -0200
committerGustavo Sverzut Barbieri <barbieri@profusion.mobi>2017-01-23 19:35:51 -0200
commitd30059bd661829cfc66c75ca0a7fa98ed3cea706 (patch)
treecec45c624b052b0f29352cd54b261186cfd135fd /cmake/helpers/EflMacros.cmake
parent3813044ef6f6aabdf8ea4583ea4b70aa0e381623 (diff)
cmake/eo: simplifies eo handling and generate eolian info in .pc.
added 2 cmake target properties to collect private and public eo files, then that is used by EFL_CREATE_EO_RULES() instead of filtering SOURCES and also EFL_PKG_CONFIG_LIB_WRITE() to know if eolian entries should be generated.
Diffstat (limited to 'cmake/helpers/EflMacros.cmake')
-rw-r--r--cmake/helpers/EflMacros.cmake34
1 files changed, 30 insertions, 4 deletions
diff --git a/cmake/helpers/EflMacros.cmake b/cmake/helpers/EflMacros.cmake
index 2ba901b2cc..e320fb5f82 100644
--- a/cmake/helpers/EflMacros.cmake
+++ b/cmake/helpers/EflMacros.cmake
@@ -353,6 +353,14 @@ function(EFL_PKG_CONFIG_LIB_WRITE)
353 set(_libraries) 353 set(_libraries)
354 set(_public_libraries) 354 set(_public_libraries)
355 355
356 get_target_property(eo_files_public ${EFL_LIB_CURRENT} EFL_EO_PUBLIC)
357 if(eo_files_public)
358 set(_eoinfo "eoincludedir=\${datarootdir}/eolian/include
359eolian_flags=-I\${pc_sysrootdir}\${eoincludedir}/${EFL_LIB_CURRENT}-${PROJECT_VERSION_MAJOR}")
360 else()
361 set(_eoinfo "")
362 endif()
363
356 foreach(_e ${${EFL_LIB_CURRENT}_PKG_CONFIG_REQUIRES}) 364 foreach(_e ${${EFL_LIB_CURRENT}_PKG_CONFIG_REQUIRES})
357 set(_pkg_config_requires "${_pkg_config_requires} ${_e}") 365 set(_pkg_config_requires "${_pkg_config_requires} ${_e}")
358 endforeach() 366 endforeach()
@@ -392,6 +400,7 @@ datarootdir=\${prefix}/share
392datadir=\${datarootdir} 400datadir=\${datarootdir}
393pkgdatadir=\${datadir}/${EFL_LIB_CURRENT} 401pkgdatadir=\${datadir}/${EFL_LIB_CURRENT}
394modules=\${libdir}/${EFL_LIB_CURRENT}/modules 402modules=\${libdir}/${EFL_LIB_CURRENT}/modules
403${_eoinfo}
395 404
396Name: ${EFL_LIB_CURRENT} 405Name: ${EFL_LIB_CURRENT}
397Description: ${DESCRIPTION} 406Description: ${DESCRIPTION}
@@ -529,6 +538,14 @@ function(_EFL_LIB_PROCESS_TESTS_INTERNAL)
529 endif() 538 endif()
530endfunction() 539endfunction()
531 540
541define_property(TARGET PROPERTY EFL_EO_PRIVATE
542 BRIEF_DOCS "EFL's .eo/.eot files associated with this target and not installed"
543 FULL_DOCS "The list of all .eo or .eot files this target uses but doesn't install")
544
545define_property(TARGET PROPERTY EFL_EO_PUBLIC
546 BRIEF_DOCS "EFL's .eo/.eot files associated with this target and installed"
547 FULL_DOCS "The list of all .eo or .eot files this target uses and installs")
548
532# EFL_LIB(Name) 549# EFL_LIB(Name)
533# 550#
534# adds a library ${Name} automatically setting object/target 551# adds a library ${Name} automatically setting object/target
@@ -642,6 +659,8 @@ function(EFL_LIB _target)
642 ${OBJECT_DEPENDS}) 659 ${OBJECT_DEPENDS})
643 EFL_FILES_TO_ABSOLUTE(_public_eo_files ${EFL_LIB_SOURCE_DIR} ${EFL_LIB_BINARY_DIR} 660 EFL_FILES_TO_ABSOLUTE(_public_eo_files ${EFL_LIB_SOURCE_DIR} ${EFL_LIB_BINARY_DIR}
644 ${PUBLIC_EO_FILES}) 661 ${PUBLIC_EO_FILES})
662 EFL_FILES_TO_ABSOLUTE(_eo_files ${EFL_LIB_SOURCE_DIR} ${EFL_LIB_BINARY_DIR}
663 ${EO_FILES})
645 664
646 foreach(public_eo_file ${PUBLIC_EO_FILES}) 665 foreach(public_eo_file ${PUBLIC_EO_FILES})
647 list(APPEND _headers ${EFL_LIB_BINARY_DIR}/${public_eo_file}.h) 666 list(APPEND _headers ${EFL_LIB_BINARY_DIR}/${public_eo_file}.h)
@@ -656,6 +675,8 @@ function(EFL_LIB _target)
656 FRAMEWORK TRUE 675 FRAMEWORK TRUE
657 PUBLIC_HEADER "${_headers}" 676 PUBLIC_HEADER "${_headers}"
658 OBJECT_DEPENDS "${_obj_deps}" 677 OBJECT_DEPENDS "${_obj_deps}"
678 EFL_EO_PRIVATE "${_eo_files}"
679 EFL_EO_PUBLIC "${_public_eo_files}"
659 COMPILE_FLAGS -DPACKAGE_DATA_DIR=\\"${CMAKE_INSTALL_FULL_DATADIR}/${_target}/\\") 680 COMPILE_FLAGS -DPACKAGE_DATA_DIR=\\"${CMAKE_INSTALL_FULL_DATADIR}/${_target}/\\")
660 681
661 if(DEPENDENCIES) 682 if(DEPENDENCIES)
@@ -709,6 +730,7 @@ function(EFL_LIB _target)
709 unset(_headers) 730 unset(_headers)
710 unset(_obj_deps) 731 unset(_obj_deps)
711 unset(_public_eo_files) 732 unset(_public_eo_files)
733 unset(_eo_files)
712 unset(INCLUDE_DIRECTORIES) 734 unset(INCLUDE_DIRECTORIES)
713 unset(SYSTEM_INCLUDE_DIRECTORIES) 735 unset(SYSTEM_INCLUDE_DIRECTORIES)
714 unset(OUTPUT_NAME) 736 unset(OUTPUT_NAME)
@@ -1070,9 +1092,13 @@ endmacro()
1070# Will use the source of the given target to create rules for creating 1092# Will use the source of the given target to create rules for creating
1071# the .eo.c and .eo.h files. The INCLUDE_DIRECTORIES of the target will be used 1093# the .eo.c and .eo.h files. The INCLUDE_DIRECTORIES of the target will be used
1072function(EFL_CREATE_EO_RULES target generation_dir) 1094function(EFL_CREATE_EO_RULES target generation_dir)
1073 get_target_property(source_files ${target} SOURCES) 1095 get_target_property(eo_files_private ${target} EFL_EO_PRIVATE)
1074 get_target_property(link_libraries ${target} LINK_LIBRARIES) 1096 get_target_property(eo_files_public ${target} EFL_EO_PUBLIC)
1097 if(NOT eo_files_private AND NOT eo_files_public)
1098 return()
1099 endif()
1075 1100
1101 get_target_property(link_libraries ${target} LINK_LIBRARIES)
1076 set(all_libraries ${target} ${link_libraries}) 1102 set(all_libraries ${target} ${link_libraries})
1077 set(include_cmd "") 1103 set(include_cmd "")
1078 foreach(link_target ${all_libraries}) 1104 foreach(link_target ${all_libraries})
@@ -1080,7 +1106,7 @@ function(EFL_CREATE_EO_RULES target generation_dir)
1080 endforeach() 1106 endforeach()
1081 1107
1082 set(all_eo_gen_files "") 1108 set(all_eo_gen_files "")
1083 foreach(file ${source_files}) 1109 foreach(file ${eo_files_private} ${eo_files_public})
1084 get_filename_component(ext ${file} EXT) 1110 get_filename_component(ext ${file} EXT)
1085 get_filename_component(filename ${file} NAME) 1111 get_filename_component(filename ${file} NAME)
1086 1112
@@ -1089,7 +1115,7 @@ function(EFL_CREATE_EO_RULES target generation_dir)
1089 elseif(${ext} STREQUAL ".eot") 1115 elseif(${ext} STREQUAL ".eot")
1090 set(file_eo_gen_files ${generation_dir}/${filename}.h) 1116 set(file_eo_gen_files ${generation_dir}/${filename}.h)
1091 else() 1117 else()
1092 set(file_eo_gen_files "") 1118 message(FATAL_ERROR "Unsupported eo file type: ${file}")
1093 endif() 1119 endif()
1094 1120
1095 #add the custom rule 1121 #add the custom rule