Project

General

Profile

Revision 17db36ed share/FindLustre.cmake

View differences:

share/FindLustre.cmake
82 82
  endif()
83 83

  
84 84
  file(MAKE_DIRECTORY ${LUSTRE_OUTPUT_DIR})
85
  set(LUSTRE_GENERATED_FILES)
85
  set(GLOBAL_LUSTRE_GENERATED_FILES)
86 86
  foreach(LFILE IN LISTS LUS_LUS_FILES)
87 87
    get_filename_component(L ${LFILE} NAME_WE)
88
    list(APPEND LUSTRE_GENERATED_FILES ${LUSTRE_OUTPUT_DIR}/${L}.h ${LUSTRE_OUTPUT_DIR}/${L}.c)
88
    set(LUSTRE_GENERATED_FILES ${LUSTRE_OUTPUT_DIR}/${L}.h ${LUSTRE_OUTPUT_DIR}/${L}.c)
89
    list(APPEND GLOBAL_LUSTRE_GENERATED_FILES ${LUSTRE_GENERATED_FILES})
89 90
    add_custom_command(
90 91
      OUTPUT ${LUSTRE_GENERATED_FILES}
91
      COMMAND ${LUSTRE_COMPILER} ${LUSTRE_REAL_OPT} -d ${LUSTRE_OUTPUT_DIR} ${LUS_LUS_FILES}
92
      DEPENDS ${LUS_LUS_FILES}
92
      COMMAND ${LUSTRE_COMPILER} ${LUSTRE_NODE_OPT} -d ${LUSTRE_OUTPUT_DIR} ${LFILE}
93
      DEPENDS ${LFILE}
93 94
      WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
94
      COMMENT "Compile Lustre source(s): ${LUS_LUS_FILES}."
95
      COMMENT "Compile Lustre source(s): ${LFILE}."
95 96
      )
97
    set_source_files_properties(${LUSTRE_GENERATED_FILES} PROPERTIES GENERATED TRUE)
96 98
  endforeach()
97 99

  
98
  set_source_files_properties(${LUSTRE_GENERATED_FILES} PROPERTIES GENERATED TRUE)
99 100
  include_directories(${LUSTRE_INCLUDE_DIR} ${CMAKE_CURRENT_SOURCE_DIR} ${LUSTRE_OUTPUT_DIR})
100 101
  add_library(${LUS_LIBNAME} SHARED
101
              ${LUSTRE_GENERATED_FILES} ${LUS_USER_C_FILES}
102
              ${GLOBAL_LUSTRE_GENERATED_FILES} ${LUS_USER_C_FILES}
102 103
             )
103 104
  message(STATUS "Lustre: Added rule for building lustre library: ${LUS_LIBNAME}")
104 105
endfunction(Lustre_Compile)

Also available in: Unified diff