Skip to content

Commit

Permalink
- improved cmake error handling if umfpack was not found
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@25216 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
Marcus Walther committed Mar 23, 2015
1 parent f62345f commit b3ed891
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
3 changes: 2 additions & 1 deletion SimulationRuntime/cpp/CMake/FindSuiteSparse.cmake
Expand Up @@ -7,11 +7,12 @@
# SUITESPARSE_UMFPACK_INCLUDE_DIR_OMC - This variable contains either the absolute path to the include dir, if the system version is used or the relative path to $(OMHOME) of the OMC-Version is used
# SUITESPARSE_UMFPACK_LIBRARIES - The umfpack libraries including the amd library
# SUITESPARSE_UMFPACK_LIBRARIES_OMC - This variable contains either the absolute path to umfpack libraries, if the system version is used or the relative path to $(OMHOME) of the OMC-Version is used
# SUITESPARSE_UMFPACK_LIBS
# SUITESPARSE_UMFPACK_LIBS - The directory containing the umfpack libraries

SET(SUITESPARSE_UMFPACK_FOUND false)
SET(SUITESPARSE_UMFPACK_USE_OMC false)

SET(SUITESPARSE_UMFPACK_INCLUDE_DIR_OMC "")

MESSAGE(STATUS "Searching for umfpack.h of OpenModelica")
FIND_FILE(UMFPACK_H_OMC umfpack.h HINTS "${CMAKE_SOURCE_DIR}/../../build/include/omc/c/suitesparse/Include" NO_DEFAULT_PATH)
Expand Down
10 changes: 8 additions & 2 deletions SimulationRuntime/cpp/Core/Modelica/CMakeLists.txt
Expand Up @@ -160,6 +160,12 @@ ELSE()
SET(PUGIXML_INCLUDE_DIR_ ${PUGIXML_INCLUDE_DIR})
ENDIF()

IF("${SUITESPARSE_UMFPACK_INCLUDE_DIR_OMC}" STREQUAL "")
SET(UMFPACK_INCLUDE_ ".")
ELSE()
SET(UMFPACK_INCLUDE_ "${SUITESPARSE_UMFPACK_INCLUDE_DIR_OMC}")
ENDIF()

SET(Boost_LIBRARIES_NEW)
FOREACH(lib ${Boost_LIBRARIES})
GET_FILENAME_COMPONENT(libNew "${lib}" NAME_WE)
Expand Down Expand Up @@ -206,8 +212,8 @@ MESSAGE(STATUS "--SUNDIALS_LIBRARIES = ${SUNDIALS_LIBRARIES_}")
MESSAGE(STATUS "--LAPACK_LIBS = ${LAPACK_LIBS_}")
MESSAGE(STATUS "--LAPACK_LIBRARIES = ${LAPACK_LIBRARIES_}")
MESSAGE(STATUS "--UMFPACK_LIBS = ${SUITESPARSE_UMFPACK_LIBS}")
MESSAGE(STATUS "--UMFPACK_INCLUDE = ${SUITESPARSE_UMFPACK_INCLUDE_DIR_OMC}")
MESSAGE(STATUS "--UMFPACK_LIBS = ${UMFPACK_LIBRARIES_}")
MESSAGE(STATUS "--UMFPACK_INCLUDE = ${UMFPACK_INCLUDE_}")
MESSAGE(STATUS "--UMFPACK_LIBRARIES = ${UMFPACK_LIBRARIES_}")
MESSAGE(STATUS " ")

add_precompiled_header(${ModelicaName} Include/Core/Modelica.h )
Expand Down
4 changes: 2 additions & 2 deletions SimulationRuntime/cpp/Core/Modelica/ModelicaConfig.inc.in
Expand Up @@ -10,8 +10,8 @@ LAPACK_LIBS = @LAPACK_LIBS_@
LAPACK_LIBRARIES = @LAPACK_LIBRARIES_@

UMFPACK_LIBS = @SUITESPARSE_UMFPACK_LIBS@
UMFPACK_INCLUDE = @SUITESPARSE_UMFPACK_INCLUDE_DIR_OMC@
UMFPACK_LIBS = @UMFPACK_LIBRARIES_@
UMFPACK_INCLUDE = @UMFPACK_INCLUDE_@
UMFPACK_LIBRARIES = @UMFPACK_LIBRARIES_@

INTEL_TBB_INCLUDE = @TBB_INCLUDE_DIR_@
INTEL_TBB_LIBRARIES = @INTEL_TBB_LIBS@
Expand Down

0 comments on commit b3ed891

Please sign in to comment.