Skip to content
Snippets Groups Projects
Commit 2f07a237 authored by Pierre Loic Garoche's avatar Pierre Loic Garoche
Browse files

Tiny modif on cmake target

parent dc893173
No related branches found
No related tags found
No related merge requests found
...@@ -82,7 +82,7 @@ function(Lustre_Compile) ...@@ -82,7 +82,7 @@ function(Lustre_Compile)
endif() endif()
if(LUS_NODE) if(LUS_NODE)
set(LUSTRE_NODE_OPT "-node ${LUS_NODE}") set(LUSTRE_NODE_OPT "-node;${LUS_NODE}")
set(LUSTRE_OUTPUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/lus_${LUS_LIBNAME}/${LUS_NODE}") set(LUSTRE_OUTPUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/lus_${LUS_LIBNAME}/${LUS_NODE}")
else() else()
set(LUSTRE_NODE_OPT "") set(LUSTRE_NODE_OPT "")
...@@ -90,7 +90,7 @@ function(Lustre_Compile) ...@@ -90,7 +90,7 @@ function(Lustre_Compile)
endif() endif()
if (LUS_VERBOSE) if (LUS_VERBOSE)
set(LUSTRE_VERBOSE_OPT "-verbose ${LUS_VERBOSE}") set(LUSTRE_VERBOSE_OPT "-verbose;${LUS_VERBOSE}")
else() else()
# the default is to be quiet. # the default is to be quiet.
set(LUSTRE_VERBOSE_OPT "-verbose;0") set(LUSTRE_VERBOSE_OPT "-verbose;0")
...@@ -105,6 +105,10 @@ function(Lustre_Compile) ...@@ -105,6 +105,10 @@ function(Lustre_Compile)
get_filename_component(E ${LFILE} EXT) get_filename_component(E ${LFILE} EXT)
if ("${E}" STREQUAL ".lus") if ("${E}" STREQUAL ".lus")
set(LUSTRE_GENERATED_FILES ${LUSTRE_OUTPUT_DIR}/${L}.h ${LUSTRE_OUTPUT_DIR}/${L}.c ${LUSTRE_OUTPUT_DIR}/${L}_alloc.h) set(LUSTRE_GENERATED_FILES ${LUSTRE_OUTPUT_DIR}/${L}.h ${LUSTRE_OUTPUT_DIR}/${L}.c ${LUSTRE_OUTPUT_DIR}/${L}_alloc.h)
if(LUS_NODE)
list(APPEND LUSTRE_GENERATED_FILES ${LUSTRE_OUTPUT_DIR}/${L}_main.c)
list(APPEND LUSTRE_GENERATED_FILES ${LUSTRE_INCLUDE_DIR}/io_frontend.c)
endif()
elseif("${E}" STREQUAL ".lusi") elseif("${E}" STREQUAL ".lusi")
set(LUSTRE_GENERATED_FILES ${LUSTRE_OUTPUT_DIR}/${L}.h) set(LUSTRE_GENERATED_FILES ${LUSTRE_OUTPUT_DIR}/${L}.h)
endif() endif()
...@@ -121,9 +125,15 @@ function(Lustre_Compile) ...@@ -121,9 +125,15 @@ function(Lustre_Compile)
endforeach() endforeach()
include_directories(${LUSTRE_INCLUDE_DIR} ${CMAKE_CURRENT_SOURCE_DIR} ${LUSTRE_OUTPUT_DIR}) include_directories(${LUSTRE_INCLUDE_DIR} ${CMAKE_CURRENT_SOURCE_DIR} ${LUSTRE_OUTPUT_DIR})
if(LUS_NODE)
add_executable(${LUS_LIBNAME}
${GLOBAL_LUSTRE_GENERATED_C_FILES} ${LUS_USER_C_FILES}
)
else()
add_library(${LUS_LIBNAME} SHARED add_library(${LUS_LIBNAME} SHARED
${GLOBAL_LUSTRE_GENERATED_C_FILES} ${LUS_USER_C_FILES} ${GLOBAL_LUSTRE_GENERATED_C_FILES} ${LUS_USER_C_FILES}
) )
endif()
set_target_properties(${LUS_LIBNAME} PROPERTIES COMPILE_FLAGS "-std=c99") set_target_properties(${LUS_LIBNAME} PROPERTIES COMPILE_FLAGS "-std=c99")
set(LUSTRE_GENERATED_C_FILES_${LUS_LIBNAME} "${GLOBAL_LUSTRE_GENERATED_C_FILES}" PARENT_SCOPE) set(LUSTRE_GENERATED_C_FILES_${LUS_LIBNAME} "${GLOBAL_LUSTRE_GENERATED_C_FILES}" PARENT_SCOPE)
message(STATUS "Lustre: Added rule for building lustre library: ${LUS_LIBNAME}") message(STATUS "Lustre: Added rule for building lustre library: ${LUS_LIBNAME}")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment