Skip to content

Commit

Permalink
MAINT: Merge branch 'new_try'
Browse files Browse the repository at this point in the history
  • Loading branch information
updega2 committed Jan 9, 2017
2 parents c47138f + d5f3223 commit 533f81b
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 6 deletions.
73 changes: 73 additions & 0 deletions Code/FlowSolvers/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,79 @@
#
#=========================================================================#
set(INDENTS "${INDENTS} ")
set(SV_FLOWSOLVERS_DIR ${CMAKE_CURRENT_SOURCE_DIR})

macro(svsolver_third_party _pkg)
string(TOLOWER "${_pkg}" _lower)
string(TOUPPER "${_pkg}" _upper)

set(options OPTIONAL VERSION_EXACT
DOWNLOADABLE SYSTEM_DEFAULT
SVEXTERN_CONFIG ADD_INSTALL
)
set(oneValueArgs VERSION)
set(multiValueArgs PATHS HINTS COMPONENTS)

CMAKE_PARSE_ARGUMENTS("svsolver_third_party"
"${options}"
"${oneValueArgs}" "${multiValueArgs}" ${ARGN} )
set(${_upper}_SUBDIR ThirdParty/${_pkg})
if(svsolver_third_party_SYSTEM_DEFAULT)
option(SV_USE_SYSTEM_${_upper} "Use system ${_pkg}" ON)
else()
option(SV_USE_SYSTEM_${_upper} "Use system ${_pkg}" OFF)
endif()

mark_as_advanced(SV_USE_SYSTEM_${_upper})

configure_file(${SV_FLOWSOLVERS_DIR}/../${${_upper}_SUBDIR}/simvascular_${_lower}.h.in
${SV_BINARY_DIR}/${${_upper}_SUBDIR}/simvascular_${_lower}.h)
include_directories(BEFORE ${SV_BINARY_DIR}/${${_upper}_SUBDIR} ${SV_FLOWSOLVERS_DIR}/../${${_upper}_SUBDIR})
if(SV_USE_SYSTEM_${_upper})
set(${_upper}_LIBRARIES)
set(${_upper}_LIBRARY)
else()
set(${_upper}_LIBRARY_NAME _simvascular_thirdparty_${_lower})
add_subdirectory(${SV_FLOWSOLVERS_DIR}/../${${_upper}_SUBDIR}/simvascular_${_lower} ${SV_BINARY_DIR}/${${_upper}_SUBDIR}/simvascular_${lower})
endif()
endmacro()

option(SV_USE_SPARSE "Use sparse Library" ON)
option(SV_USE_METIS "Use metis Library" ON)
option(SV_USE_NSPCG "Use nspcg Library" ON)
#-----------------------------------------------------------------------------
# Add libraries for flowsolver
if(SV_USE_SPARSE)
SET(USE_SPARSE ON)
svsolver_third_party(sparse)
if(NOT SV_USE_SYSTEM_SPARSE)
set(SPARSE_LIBRARY ${SV_LIB_THIRDPARTY_SPARSE_NAME})
else()
find_package(SPARSE)
endif()
endif()

if(SV_USE_METIS)
SET(USE_METIS ON)
svsolver_third_party(metis)
if(NOT SV_USE_SYSTEM_METIS)
set(METIS_LIBRARY ${SV_LIB_THIRDPARTY_METIS_NAME})
else()
find_package(METIS)
endif()
endif()

if(SV_USE_NSPCG)
SET(USE_NSPCG ON)
svsolver_third_party(nspcg)
if(NOT SV_USE_SYSTEM_NSPCG)
set(NSPCG_LIBRARY ${SV_LIB_THIRDPARTY_NSPCG_NAME})
else()
find_package(NSPCG)
endif()
endif()


if(SV_SUPERBUILD)
RETURN()
###### RETURN_SUPERBUILD ######
Expand Down
6 changes: 0 additions & 6 deletions Code/FlowSolvers/ThreeDSolver/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
#=========================================================================#

# Include Flowsolver Configuration File
include(flowsolverConfig)
set(INDENTS "${INDENTS} ")
# Include svLS Folder
#include_directories(${SVLS_INCLUDE_DIR})
Expand All @@ -44,11 +43,6 @@ if(SV_THREEDSOLVER_USE_SVPOST)
set(SV_THREEDSOLVER_USE_SOLVERIO ON)
endif()

#-----------------------------------------------------------------------------
# SolverIO
#if(SV_THREEDSOLVER_USE_SOLVERIO)
# set(FLOWSOLVER_SUBDIRS ${FLOWSOLVER_SUBDIRS} SolverIO)
#endif()
#-----------------------------------------------------------------------------
# Presolver
if(SV_THREEDSOLVER_USE_SVPRE)
Expand Down

0 comments on commit 533f81b

Please sign in to comment.