Skip to content

Commit

Permalink
Fix Issue #53, #54 and #55
Browse files Browse the repository at this point in the history
  • Loading branch information
thelfer committed Aug 5, 2024
1 parent 6310201 commit f6ed4ac
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 15 deletions.
8 changes: 4 additions & 4 deletions cmake/modules/materialproperties-excel.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ function(mfront_properties_excel_library mat)
endif(EXISTS ${CMAKE_SOURCE_DIR}/materials/${mat})
list(APPEND mfront_search_paths
"--search-path=${CMAKE_CURRENT_SOURCE_DIR}")
foreach(source ${mfront_sources})
add_mfront_property_sources(${lib} ${mat} "excel" ${mfront_search_paths} ${source})
endforeach(source ${mfront_sources})
foreach(mfront_source ${mfront_sources})
add_mfront_property_sources(${lib} ${mat} "excel" "${mfront_search_paths}" ${mfront_source})
endforeach(mfront_source ${mfront_sources})
_get_mfront_command_line_arguments()
set(mfront_args )
list(APPEND mfront_args ${mfront_command_line_arguments})
Expand All @@ -34,7 +34,7 @@ function(mfront_properties_excel_library mat)
DEPENDS ${${lib}_MFRONT_SOURCES}
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/excel"
COMMENT "mfront source ${mfront_file}")
add_custom_target(${lib}
add_custom_target(${lib} ALL
DEPENDS "${vba_file}")
install(FILES ${vba_file} DESTINATION "share/mfm/excel")
endfunction(mfront_properties_excel_library mat)
4 changes: 1 addition & 3 deletions cmake/modules/materialproperties-java.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ function(mfront_properties_java_library mat)
endif(${lib}_SOURCES)
set(all_generated_files ${${lib}_SOURCES})
list(APPEND all_generated_files
${CMAKE_CURRENT_BINARY_DIR}/java/java/${java_file}
${CMAKE_CURRENT_BINARY_DIR}/java/java/${java_class_file})
${CMAKE_CURRENT_BINARY_DIR}/java/java/${java_file})
list(REMOVE_DUPLICATES all_generated_files)
_get_mfront_command_line_arguments()
set(mfront_args )
Expand All @@ -37,7 +36,6 @@ function(mfront_properties_java_library mat)
endif(mfront_dsl_options)
list(APPEND mfront_args "--interface=java")
list(APPEND mfront_args ${${lib}_MFRONT_IMPLEMENTATION_PATHS})
message(STATUS "mfront_args: ${${lib}_MFRONT_IMPLEMENTATION_PATHS}")
if(MFM_PACKAGE)
add_custom_command(
OUTPUT ${all_generated_files}
Expand Down
2 changes: 1 addition & 1 deletion cmake/modules/materialproperties-octave.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ function(mfront_properties_octave_library mat)
DEPENDS "${mfront_file}"
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${interface}"
COMMENT "mfront source ${mfront_file} for interface ${interface}")
set(oct_file "octave/${_mfront_law_name}.oct")
set(oct_file "octave/${mat}_${_mfront_law_name}.oct")
set(_lib ${mat}_${_mfront_law_name}-octave)
list(APPEND octave_targets ${_lib})
add_library(${_lib} SHARED ${mfront_generated_sources})
Expand Down
2 changes: 1 addition & 1 deletion cmake/modules/materialproperties.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function(add_mfront_property_sources lib mat interface search_paths file)
${${lib}_OTHER_SOURCES} PARENT_SCOPE)
else()
if (madnex_file)
if(TFEL_MADNEX_SUPPORT)
if(TFEL_MADNEX_SUPPORT)
mfront_query(_impls ${mat} "${search_paths}" ${mfront_path}
"--all-material-properties" "--list-implementation-paths=unsorted")
if(_impls)
Expand Down
19 changes: 13 additions & 6 deletions cmake/modules/octave.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -50,21 +50,28 @@ execute_process ( COMMAND ${MKOCTFILE_EXECUTABLE} -p INCFLAGS
execute_process ( COMMAND ${MKOCTFILE_EXECUTABLE} -p LIBDIR
OUTPUT_VARIABLE OCTAVE_LIBRARY_PATH
OUTPUT_STRIP_TRAILING_WHITESPACE )
execute_process ( COMMAND ${MKOCTFILE_EXECUTABLE} -p OCTAVE_VERSION
OUTPUT_VARIABLE OCTAVE_VERSION
OUTPUT_STRIP_TRAILING_WHITESPACE )

# octave libraries
macro(find_octave_library name)
find_library(${name}
NAMES ${name}
HINTS ${OCTAVE_LIBRARY_PATH})
if(NOT ${name})
MESSAGE(FATAL_ERROR "${name} library not found")
endif(NOT ${name})
HINTS ${OCTAVE_LIBRARY_PATH}
${OCTAVE_LIBRARY_PATH}/octave/${OCTAVE_VERSION})
endmacro(find_octave_library name)

find_octave_library(octave)
find_octave_library(octinterp)

set(OCTAVE_LIBRARIES ${octave} ${octinterp})
if(NOT octave)
MESSAGE(FATAL_ERROR "octave library not found")
endif(NOT octave)
if(octinterp)
set(OCTAVE_LIBRARIES ${octave} ${octinterp})
else(octinterp)
set(OCTAVE_LIBRARIES ${octave})
endif(octinterp)

# summary
if((NOT OCTAVE_CONFIG_EXECUTABLE) OR
Expand Down

0 comments on commit f6ed4ac

Please sign in to comment.