~zorba-coders/zorba/image-module-head

« back to all changes in this revision

Viewing changes to cmake_modules/ZorbaModule.cmake

  • Committer: Zorba Build Bot
  • Author(s): davidagraf at gmail
  • Date: 2012-10-30 10:37:19 UTC
  • mfrom: (11102.1.4 module-depends)
  • Revision ID: chillery+buildbot@lambda.nu-20121030103719-1q2wq3eykjbw3sv2
Additional optional parameter for DECLARE_ZORBA_MODULE macro to pass targets the declared module depends on. Approved: Chris Hillery, Till Westmann, David Graf

Show diffs side-by-side

added added

removed removed

Lines of Context:
118
118
#              information; see below
119
119
#       TEST_ONLY - (optional) Module is for testcases only and should not
120
120
#              be installed
 
121
#       LIBRARY_DEPENDS - (optional) List of targets that the external
 
122
#              function library will depend on (only works if the module
 
123
#              contains C++ external functions)
121
124
#
122
125
# CONFIG_FILES - any files specific here will be copied to
123
126
# CMAKE_CURRENT_BINARY_DIR using CONFIGURE_FILE(). They may contain
136
139
# file enough to deduce the URI and version?
137
140
MACRO (DECLARE_ZORBA_MODULE)
138
141
  # Parse and validate arguments
139
 
  PARSE_ARGUMENTS(MODULE "LINK_LIBRARIES;EXTRA_SOURCES;CONFIG_FILES"
 
142
  PARSE_ARGUMENTS(MODULE "LINK_LIBRARIES;EXTRA_SOURCES;CONFIG_FILES;LIBRARY_DEPENDS"
140
143
    "URI;FILE;VERSION" "TEST_ONLY" ${ARGN})
141
144
  IF (NOT MODULE_FILE)
142
145
    MESSAGE (FATAL_ERROR "'FILE' argument is required for ZORBA_DECLARE_MODULE()")
268
271
    # the module *URI*'s final component.
269
272
    SET(module_lib_target "modlib${num_zorba_modules}_${module_name}")
270
273
    ADD_LIBRARY(${module_lib_target} SHARED ${SRC_FILES})
 
274
    IF (MODULE_LIBRARY_DEPENDS)
 
275
      ADD_DEPENDENCIES(${module_lib_target} ${MODULE_LIBRARY_DEPENDS})
 
276
    ENDIF()
271
277
    GET_FILENAME_COMPONENT(module_filewe "${module_filename}" NAME_WE)
272
278
    IF (MODULE_VERSION)
273
279
      # If there's a version, insert it into the module library name