Project

General

Profile

Revision 76bed200 share/FindLustre.cmake

View differences:

share/FindLustre.cmake
26 26
# The VERBOSE level is a numeric value passed directly to the -verbose
27 27
# command line option of the lustre compiler
28 28
#
29
include("/home/ploc/Local/share/helpful_functions.cmake")
29 30

  
30 31
if(LUSTRE_PATH_HINT)
31 32
  message(STATUS "FindLustre: using PATH HINT: ${LUSTRE_PATH_HINT}")
......
103 104

  
104 105
  file(MAKE_DIRECTORY ${LUSTRE_OUTPUT_DIR})
105 106
  set(GLOBAL_LUSTRE_GENERATED_C_FILES "")
107
  set(GLOBAL_LUSTRE_DEP_C_FILES "")
106 108
  # create list of generated C files in parent scope
107 109
  set(LUSTRE_GENERATED_C_FILES_${LUS_LIBNAME} "" PARENT_SCOPE)
108 110
  foreach(LFILE IN LISTS LUS_LUS_FILES)
109
    get_filename_component(L ${LFILE} NAME_WE)
110
    get_filename_component(E ${LFILE} EXT)
111
    if ("${E}" STREQUAL ".lus")
111
    get_lustre_name_ext(${LFILE} L E)
112
    
113
    if ("${E}" STREQUAL "lus")
112 114
      set(LUSTRE_GENERATED_FILES ${LUSTRE_OUTPUT_DIR}/${L}.h ${LUSTRE_OUTPUT_DIR}/${L}.c ${LUSTRE_OUTPUT_DIR}/${L}_alloc.h)
115
      set(LUSTRE_DEP_FILES "")
113 116
      if(LUS_NODE)
114 117
         list(APPEND LUSTRE_GENERATED_FILES ${LUSTRE_OUTPUT_DIR}/${L}_main.c)
115
         list(APPEND LUSTRE_GENERATED_FILES ${LUSTRE_INCLUDE_DIR}/io_frontend.c)
118
         list(APPEND LUSTRE_DEP_FILES ${LUSTRE_INCLUDE_DIR}/io_frontend.c)
116 119
      endif()
117
    elseif("${E}" STREQUAL ".lusi")
120
    elseif("${E}" STREQUAL "lusi")
118 121
      set(LUSTRE_GENERATED_FILES ${LUSTRE_OUTPUT_DIR}/${L}.h)
119 122
    endif()
120 123
    list(APPEND GLOBAL_LUSTRE_GENERATED_C_FILES ${LUSTRE_GENERATED_FILES})
124
    list(APPEND GLOBAL_LUSTRE_DEP_FILES ${LUSTRE_DEP_FILES}) # todo: add if not already in the list
121 125
    set(LUSTRE_GENERATED_FILES ${LUSTRE_GENERATED_FILES} ${LUSTRE_OUTPUT_DIR}/${L}.lusic)
122 126
    if (LUS_LUSI)
123 127
      add_custom_command(
......
142 146
  include_directories(${LUSTRE_INCLUDE_DIR} ${CMAKE_CURRENT_SOURCE_DIR} ${LUSTRE_OUTPUT_DIR})
143 147
  if(LUS_NODE)
144 148
  add_executable(${LUS_LIBNAME}
145
              ${GLOBAL_LUSTRE_GENERATED_C_FILES} ${LUS_USER_C_FILES}
149
              ${GLOBAL_LUSTRE_GENERATED_C_FILES} ${GLOBAL_LUSTRE_DEP_FILES} ${LUS_USER_C_FILES}
146 150
              )
147 151
  else()
148 152
  add_library(${LUS_LIBNAME} SHARED
149
              ${GLOBAL_LUSTRE_GENERATED_C_FILES} ${LUS_USER_C_FILES}
153
              ${GLOBAL_LUSTRE_GENERATED_C_FILES} ${GLOBAL_LUSTRE_DEP_FILES} ${LUS_USER_C_FILES}
150 154
              )
151 155
  endif()
152 156
  set_target_properties(${LUS_LIBNAME} PROPERTIES COMPILE_FLAGS "-std=c99")

Also available in: Unified diff