Project

General

Profile

Revision ecba3795

View differences:

share/FindLustre.cmake
17 17
#                  LUS_FILES <Lustre files>
18 18
#                  [USER_C_FILES <C files>]
19 19
#                  [VERBOSE <level>]
20
#		   [LUSI]
20 21
#                  LIBNAME <libraryName>)
21 22
#
22 23
# When used the Lustre_Compile macro define the variable
......
72 73
# Macros used to compile a lustre library
73 74
include(CMakeParseArguments)
74 75
function(Lustre_Compile)
75
  set(options "")
76
  set(options LUSI)
76 77
  set(oneValueArgs NODE LIBNAME VERBOSE)
77 78
  set(multiValueArgs LUS_FILES USER_C_FILES)
78 79
  cmake_parse_arguments(LUS "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
79 80

  
81
  if(LUS_LUSI)
82
    set(LUSTRE_LUSI_OPT "-lusi")
83
  endif()    
84

  
80 85
  if (NOT LUS_LIBNAME)
81 86
    message(FATAL_ERROR "You should specify LIBNAME for each Lustre_Compile call.")
82 87
  endif()
......
110 115
    endif()
111 116
    list(APPEND GLOBAL_LUSTRE_GENERATED_C_FILES ${LUSTRE_GENERATED_FILES})
112 117
    set(LUSTRE_GENERATED_FILES ${LUSTRE_GENERATED_FILES} ${LUSTRE_OUTPUT_DIR}/${L}.lusic)
118
    if (LUS_LUSI)
119
      add_custom_command(
120
         OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/${LFILE}i
121
         #OUTPUT ${LUSTRE_OUTPUT_DIR}/${L}.lusi
122
      	 COMMAND ${LUSTRE_COMPILER} ${LUSTRE_LUSI_OPT} ${LFILE}
123
	 #COMMAND ${CMAKE_COMMAND} -E rename ${L}.lusi ${LUSTRE_OUTPUT_DIR}/${L}.lusi
124
         DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${LFILE}
125
         WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
126
         COMMENT "Compile Lustre source(s): ${LFILE} with option -lusi."
127
         )
128
      message(STATUS "lustrec will produce lusi file: ${LFILE}i")
129
    endif()
113 130
    add_custom_command(
114 131
      OUTPUT ${LUSTRE_GENERATED_FILES}
115 132
      COMMAND ${LUSTRE_COMPILER} ${LUSTRE_VERBOSE_OPT} ${LUSTRE_NODE_OPT} -d ${LUSTRE_OUTPUT_DIR} ${LFILE}

Also available in: Unified diff