Commit 2ed294f2 authored by Chris Cantwell's avatar Chris Cantwell

Switched to using the cmake OPTION and CMAKE_DEPENDENT_OPTION commands

for setting up dependencies between CMake settings.
parent ba1b721f
......@@ -14,6 +14,7 @@ SET(NEKTAR_VERSION_PATCH 0)
SET(NEKTAR_VERSION ${NEKTAR_VERSION_MAJOR}.${NEKTAR_VERSION_MINOR}.${NEKTAR_VERSION_PATCH})
INCLUDE(CMakeExportBuildSettings)
INCLUDE(CMakeDependentOption)
ENABLE_TESTING()
# Use the CMake 2.4 policy for CMake 2.6
......@@ -53,66 +54,58 @@ ENDIF("${isSystemDir}" STREQUAL "-1")
# Components of the Nektar++ package to build
SET(NEKTAR_BUILD_LIBRARY ON CACHE BOOL
"Build main Nektar++ libraries.")
SET(NEKTAR_BUILD_DEMOS ON CACHE BOOL
"Build demonstration codes.")
SET(NEKTAR_BUILD_SOLVERS ON CACHE BOOL
"Build example solvers distributed with Nektar++.")
SET(NEKTAR_BUILD_UTILITIES ON CACHE BOOL
"Build utilities for pre-processing and post-processing Nektar++ files.")
SET(NEKTAR_BUILD_UNIT_TESTS ON CACHE BOOL
"Build unit tests.")
SET(NEKTAR_BUILD_TESTS ON CACHE BOOL
"Build tests for checking the correctness of the code.")
SET(NEKTAR_BUILD_TIMINGS OFF CACHE BOOL
"Build benchmark timing codes.")
OPTION(NEKTAR_BUILD_LIBRARY "Build main Nektar++ libraries." ON)
OPTION(NEKTAR_BUILD_DEMOS "Build demonstration codes." ON)
OPTION(NEKTAR_BUILD_SOLVERS "Build example solvers." ON)
OPTION(NEKTAR_BUILD_UTILITIES "Build utilities." ON)
OPTION(NEKTAR_BUILD_UNIT_TESTS "Build unit tests." ON)
OPTION(NEKTAR_BUILD_TESTS "Build regression tests." ON)
OPTION(NEKTAR_BUILD_TIMINGS "Build benchmark timing codes." OFF)
# Build options
SET(NEKTAR_USE_DIRECT_BLAS_CALLS OFF CACHE BOOL
"Use direct BLAS calls rather than NekMatrix calls in the StdRegions and LocalRegions sublibrary")
MARK_AS_ADVANCED(NEKTAR_USE_DIRECT_BLAS_CALLS)
SET(NEKTAR_FULL_DEBUG OFF CACHE BOOL
"Enable Full Debugging.")
OPTION(NEKTAR_FULL_DEBUG "Enable Full Debugging." OFF)
MARK_AS_ADVANCED(NEKTAR_FULL_DEBUG)
#SET(NEKTAR_USE_PRECOMPILED_HEADERS OFF CACHE BOOL
# "Enable the use of precompiled headers.")
#MARK_AS_ADVANCED(NEKTAR_USE_PRECOMPILED_HEADERS)
IF (${CMAKE_COMPILER_IS_GNUCXX})
SET(NEKTAR_ENABLE_PROFILE OFF CACHE BOOL
"Compiles Nektar++ with the -pg compiler flag")
OPTION(NEKTAR_ENABLE_PROFILE "Uses -pg compiler flag" ON)
MARK_AS_ADVANCED(NEKTAR_ENABLE_PROFILE)
ENDIF (${CMAKE_COMPILER_IS_GNUCXX})
SET(ExpressionTemplateDefault OFF)
SET(NEKTAR_USE_EXPRESSION_TEMPLATES ${ExpressionTemplateDefault} CACHE BOOL "")
OPTION(NEKTAR_USE_EXPRESSION_TEMPLATES
"Use Expression templates." ${ExpressionTemplateDefault})
MARK_AS_ADVANCED(NEKTAR_USE_EXPRESSION_TEMPLATES)
SET(NEKTAR_USE_OPENBLAS OFF CACHE BOOL
"Use OpenBLAS library as a substitute to native BLAS." )
SET(NEKTAR_USE_ACML OFF CACHE BOOL
"Use the AMD Core Math Library (ACML) for BLAS and Lapack support." )
SET(NEKTAR_USE_MEMORY_POOLS ON CACHE BOOL
"Use memory pools to accelerate memory allocation.")
# BLAS Support
OPTION(NEKTAR_USE_BLAS_LAPACK "Use Blas and lapack routines." ON)
CMAKE_DEPENDENT_OPTION(NEKTAR_USE_OPENBLAS
"Use OpenBLAS library as a substitute to native BLAS." OFF
"NEKTAR_USE_BLAS_LAPACK" OFF)
CMAKE_DEPENDENT_OPTION(NEKTAR_USE_ACML
"Use the AMD Core Math Library (ACML) for BLAS and Lapack support." OFF
"NEKTAR_USE_BLAS_LAPACK" OFF)
CMAKE_DEPENDENT_OPTION(NEKTAR_USE_MKL
"Use the Intel Math Kernel Library (MKL) for BLAS and Lapack support." OFF
"NEKTAR_USE_BLAS_LAPACK" OFF)
CMAKE_DEPENDENT_OPTION(NEKTAR_USE_SYSTEM_BLAS_LAPACK
"Use the system provided blas and lapack libraries" ON
"NEKTAR_USE_BLAS_LAPACK; UNIX; NOT APPLE" OFF)
CMAKE_DEPENDENT_OPTION(NEKTAR_USE_ACCELERATE_FRAMEWORK
"Use the Mac Accelerate Framework for BLAS and Lapack support." ON
"NEKTAR_USE_BLAS_LAPACK; APPLE" OFF)
CMAKE_DEPENDENT_OPTION(NEKTAR_USE_CHUD_FRAMEWORK
"Use the Mac CHUD Framework (for Shark support)." OFF
"APPLE" OFF)
MARK_AS_ADVANCED(NEKTAR_USE_CHUD_FRAMEWORK)
CMAKE_DEPENDENT_OPTION(NEKTAR_USE_DIRECT_BLAS_CALLS
"Use direct BLAS calls rather than NekMatrix calls in the StdRegions and
LocalRegions sublibrary" ON
"NEKTAR_USE_BLAS_LAPACK" OFF)
MARK_AS_ADVANCED(NEKTAR_USE_DIRECT_BLAS_CALLS)
OPTION(NEKTAR_USE_MEMORY_POOLS
"Use memory pools to accelerate memory allocation." ON)
MARK_AS_ADVANCED(NEKTAR_USE_MEMORY_POOLS)
SET(NEKTAR_USE_BLAS_LAPACK ON CACHE BOOL
"Use Blas and lapack routines.")
SET(NEKTAR_USE_MKL OFF CACHE BOOL
"Use the Intel Math Kernel Library (MKL) for BLAS and Lapack support." )
IF( APPLE )
SET(NEKTAR_USE_ACCELERATE_FRAMEWORK ON CACHE BOOL
"Use the Mac Accelerate Framework for BLAS and Lapack support." )
SET(NEKTAR_USE_CHUD_FRAMEWORK OFF CACHE BOOL
"Use the Mac CHUD Framework (for Shark support)." )
MARK_AS_ADVANCED(NEKTAR_USE_CHUD_FRAMEWORK)
ELSE(APPLE)
IF( UNIX )
SET(NEKTAR_USE_SYSTEM_BLAS_LAPACK ON CACHE BOOL
"Use the system provided blas and lapack libraries")
ENDIF(UNIX)
ENDIF(APPLE)
# Turn on NEKTAR_USE_WIN32_LAPACK if we are in Windows and the libraries exist.
IF( WIN32 )
......@@ -143,11 +136,9 @@ IF( MSVC )
ENDIF( )
SET(NEKTAR_USE_WIN32_LAPACK ${Win32LapackDefault} CACHE BOOL
"Use Win32 Lapack provided with the Third Party Distribution.")
IF( NOT WIN32 )
MARK_AS_ADVANCED(NEKTAR_USE_WIN32_LAPACK)
ENDIF( NOT WIN32 )
CMAKE_DEPENDENT_OPTION(NEKTAR_USE_WIN32_LAPACK
"Use Win32 Lapack provided with the Third Party Distribution."
${Win32LapackDefault} "NEKTAR_USE_BLAS_LAPACK; WIN32" OFF)
# Include Nektar++ common macros
INCLUDE (NektarCommon)
......@@ -234,9 +225,11 @@ ENDIF( NEKTAR_USE_MEMORY_POOLS )
SET(Boost_USE_STATIC_LIBS OFF)
IF( WIN32 )
# The auto-linking feature has problems with USE_STATIC_LIBS off, so we use BOOST_ALL_NO_LIB to turn it off.
# Several boost libraries headers aren't configured correctly if USE_STATIC_LIBS is off, so we explicitly
# say they are dynamic with the remaining definitions.
# The auto-linking feature has problems with USE_STATIC_LIBS off, so we use
# BOOST_ALL_NO_LIB to turn it off.
# Several boost libraries headers aren't configured correctly if
# USE_STATIC_LIBS is off, so we explicitly say they are dynamic with the
# remaining definitions.
ADD_DEFINITIONS(-DBOOST_ALL_NO_LIB -DBOOST_PROGRAM_OPTIONS_DYN_LINK -DBOOST_IOSTREAMS_DYN_LINK -DBOOST_THREAD_DYN_LINK)
ENDIF( )
......@@ -244,12 +237,6 @@ ENDIF( )
# Set up include directories
INCLUDE_DIRECTORIES( ${CMAKE_SOURCE_DIR} ${Boost_INCLUDE_DIRS} ${LOKI_INCLUDE_DIR} ${TINYXML_BASE})
#IF( NEKTAR_USE_PRECOMPILED_HEADERS )
# ADD_DEFINITIONS(-DNEKTAR_USE_PRECOMPILED_HEADERS)
#ELSE( NEKTAR_USE_PRECOMPILED_HEADERS )
# REMOVE_DEFINITIONS(-DNEKTAR_USE_PRECOMPILED_HEADERS)
#ENDIF( NEKTAR_USE_PRECOMPILED_HEADERS )
# Build active components
IF (NEKTAR_BUILD_LIBRARY)
SET(NEKTAR++_LIBRARIES SolverUtils LibUtilities StdRegions SpatialDomains LocalRegions
......@@ -258,10 +245,8 @@ IF (NEKTAR_BUILD_LIBRARY)
ADD_SUBDIRECTORY(library)
ENDIF (NEKTAR_BUILD_LIBRARY)
IF (NEKTAR_BUILD_SOLVERS)
INCLUDE_DIRECTORIES(solvers)
ADD_SUBDIRECTORY(solvers)
ENDIF (NEKTAR_BUILD_SOLVERS)
INCLUDE_DIRECTORIES(solvers)
ADD_SUBDIRECTORY(solvers)
IF (NEKTAR_BUILD_UTILITIES)
INCLUDE_DIRECTORIES(utilities)
......
# Arpack
SET(NEKTAR_USE_ARPACK OFF CACHE BOOL
"Use Arpack routines for evaluating the eigenvalues and eigenvectors")
OPTION(NEKTAR_USE_ARPACK
"Use Arpack routines for evaluating the eigenvalues and eigenvectors" OFF)
IF( NEKTAR_USE_ARPACK )
INCLUDE (FindArpack)
INCLUDE_DIRECTORIES(${ARPACK_INCLUDE_DIR})
ADD_DEFINITIONS(-DNEKTAR_USING_ARPACK)
INCLUDE (FindArpack)
INCLUDE_DIRECTORIES(${ARPACK_INCLUDE_DIR})
ADD_DEFINITIONS(-DNEKTAR_USING_ARPACK)
ENDIF( NEKTAR_USE_ARPACK)
SET(THIRDPARTY_BUILD_BOOST OFF CACHE BOOL
"Build Boost libraries")
OPTION(THIRDPARTY_BUILD_BOOST "Build Boost libraries" OFF)
IF (THIRDPARTY_BUILD_BOOST)
INCLUDE(ExternalProject)
......
# FFTW
SET(NEKTAR_USE_FFTW OFF CACHE BOOL
"Use FFTW routines for performing the Fast Fourier Transform.")
SET(THIRDPARTY_BUILD_FFTW OFF CACHE BOOL
"Build FFTW from ThirdParty")
OPTION(NEKTAR_USE_FFTW
"Use FFTW routines for performing the Fast Fourier Transform." OFF)
CMAKE_DEPENDENT_OPTION(THIRDPARTY_BUILD_FFTW
"Build FFTW from ThirdParty" OFF
"NEKTAR_USE_FFTW" OFF)
IF( NEKTAR_USE_FFTW )
IF (THIRDPARTY_BUILD_FFTW)
......@@ -17,6 +19,7 @@ IF( NEKTAR_USE_FFTW )
CONFIGURE_COMMAND ${TPSRC}/src/fftw-3.2.2/configure --prefix=${TPSRC}/dist --quiet --enable-shared --disable-dependency-tracking
)
SET(FFTW_LIB fftw3)
MARK_AS_ADVANCED(FFTW_LIB)
INCLUDE_DIRECTORIES(${TPSRC}/dist/include)
ELSE ()
INCLUDE (FindFFTW)
......
# Loki
SET(THIRDPARTY_BUILD_LOKI ON CACHE BOOL
"Build TinyXML library from ThirdParty.")
OPTION(THIRDPARTY_BUILD_LOKI
"Build TinyXML library from ThirdParty." ON)
IF (THIRDPARTY_BUILD_LOKI)
IF (NOT EXISTS ${TPSRC}/loki-0.1.3.tar.bz2)
......
SET(NEKTAR_USE_MPI OFF CACHE BOOL
"Use MPICH2 for parallelisation.")
SET(THIRDPARTY_BUILD_GSMPI ON CACHE BOOL
"Build GSMPI if needed")
OPTION(NEKTAR_USE_MPI "Use MPICH2 for parallelisation." OFF)
CMAKE_DEPENDENT_OPTION(THIRDPARTY_BUILD_GSMPI
"Build GSMPI if needed" ON
"NEKTAR_USE_MPI" OFF)
IF( NEKTAR_USE_MPI )
INCLUDE (FindMPI)
......@@ -26,8 +27,10 @@ IF( NEKTAR_USE_MPI )
)
SET(GSMPI_LIBRARY gsmpi CACHE FILEPATH
"GSMPI path" FORCE)
MARK_AS_ADVANCED(GSMPI_LIBRARY)
SET(XXT_LIBRARY xxt CACHE FILEPATH
"XXT path" FORCE)
MARK_AS_ADVANCED(XXT_LIBRARY)
ELSE (THIRDPARTY_BUILD_GSMPI)
INCLUDE (FindGSMPI)
INCLUDE (FindXXT)
......
......@@ -13,6 +13,7 @@ IF (THIRDPARTY_BUILD_METIS)
)
SET(METIS_LIB modmetis CACHE FILEPATH
"METIS library" FORCE)
MARK_AS_ADVANCED(METIS_LIB)
LINK_DIRECTORIES(${TPSRC}/dist/lib)
ELSE (THIRDPARTY_BUILD_METIS)
INCLUDE (FindMetis)
......
SET(THIRDPARTY_BUILD_NIST_SPBLASTK ON CACHE BOOL
"Build NIST Sparse BLAS")
OPTION(THIRDPARTY_BUILD_NIST_SPBLASTK
"Build NIST Sparse BLAS" ON)
IF (THIRDPARTY_BUILD_NIST_SPBLASTK)
INCLUDE(ExternalProject)
......@@ -13,6 +13,7 @@ IF (THIRDPARTY_BUILD_NIST_SPBLASTK)
)
SET(NIST_SPARSE_BLAS sbtk CACHE FILEPATH
"Path to NIST Sparse BLAS." FORCE)
MARK_AS_ADVANCED(NIST_SPARSE_BLAS)
LINK_DIRECTORIES(${TPSRC}/dist/lib)
ELSE (THIRDPARTY_BUILD_NIST_SPBLASTK)
INCLUDE(FindNistSparseBlas)
......
# TinyXML
SET(NEKTAR_USE_TINYXML_STL ON CACHE BOOL
"Use STL with TinyXML library.")
OPTION(NEKTAR_USE_TINYXML_STL "Use STL with TinyXML library." ON)
MARK_AS_ADVANCED(NEKTAR_USE_TINYXML_STL)
SET(THIRDPARTY_BUILD_TINYXML ON CACHE BOOL
"Build TinyXML library from ThirdParty.")
OPTION(THIRDPARTY_BUILD_TINYXML
"Build TinyXML library from ThirdParty." ON)
IF (THIRDPARTY_BUILD_TINYXML)
#SET(TINYXML_DIR ${TPSRC}/tinyxml)
......
SET(THIRDPARTY_BUILD_VTK OFF CACHE BOOL
"Build VTK library from ThirdParty")
OPTION(NEKTAR_USE_VTK "Use VTK library for utilities." OFF)
SET(NEKTAR_USE_VTK OFF CACHE BOOL
"Use VTK library for utilities.")
CMAKE_DEPENDENT_OPTION(THIRDPARTY_BUILD_VTK
"Build VTK library from ThirdParty" OFF
"NEKTAR_USE_VTK; FALSE" OFF)
IF( NEKTAR_USE_VTK )
IF( THIRDPARTY_BUILD_VTK )
......
SET(THIRDPARTY_BUILD_ZLIB OFF CACHE BOOL
"Build ZLib library")
OPTION(THIRDPARTY_BUILD_ZLIB "Build ZLib library" OFF)
IF (THIRDPARTY_BUILD_ZLIB)
# Build the Zlib library separately
......
SET(NEKTAR_SOLVER_ADR2DMANIFOLD ON CACHE BOOL
"Build the ADR 2D manifold solver.")
CMAKE_DEPENDENT_OPTION(NEKTAR_SOLVER_ADR2DMANIFOLD
"Build the ADR 2D manifold solver." ON
"NEKTAR_BUILD_SOLVERS" OFF)
IF( NEKTAR_SOLVER_ADR2DMANIFOLD )
SET(ADR2DManifoldSolverSource
......
SET(NEKTAR_SOLVER_ADR ON CACHE BOOL
"Build the ADR Solver.")
CMAKE_DEPENDENT_OPTION(NEKTAR_SOLVER_ADR
"Build the ADR Solver." ON
"NEKTAR_BUILD_SOLVERS" OFF)
IF( NEKTAR_SOLVER_ADR )
SET(ADRSolverSource
......
SET(NEKTAR_SOLVER_APE ON CACHE BOOL
"Build the APE solver.")
CMAKE_DEPENDENT_OPTION(NEKTAR_SOLVER_APE
"Build the APE solver." ON
"NEKTAR_BUILD_SOLVERS" OFF)
IF( NEKTAR_SOLVER_APE )
SET(APESolverSource
......
SET(NEKTAR_SOLVER_CARDIAC_EP ON CACHE BOOL
"Build the Cardiac electrophysiology solver.")
CMAKE_DEPENDENT_OPTION(NEKTAR_SOLVER_CARDIAC_EP
"Build the Cardiac electrophysiology solver." ON
"NEKTAR_BUILD_SOLVERS" OFF)
IF( NEKTAR_SOLVER_CARDIAC_EP )
SET(CardiacEPSolverSource
......
SET(NEKTAR_SOLVER_COMPRESSIBLE_FLOW ON CACHE BOOL
"Build the Compressible Flow Solver.")
CMAKE_DEPENDENT_OPTION(NEKTAR_SOLVER_COMPRESSIBLE_FLOW
"Build the Compressible Flow Solver." ON
"NEKTAR_BUILD_SOLVERS" OFF)
IF( NEKTAR_SOLVER_COMPRESSIBLE_FLOW )
SET(CompressibleFlowSolverSource
......
SET(NEKTAR_SOLVER_FITZHUGH_NAGUMO ON CACHE BOOL
"Build the Fitzhugh-Nagumo solver.")
CMAKE_DEPENDENT_OPTION(NEKTAR_SOLVER_FITZHUGH_NAGUMO
"Build the Fitzhugh-Nagumo solver." ON
"NEKTAR_BUILD_SOLVERS" OFF)
IF( NEKTAR_SOLVER_FITZHUGH_NAGUMO )
SET(FitzHughNagumoSolverSource
......
SET(NEKTAR_SOLVER_IMAGE_WARPING ON CACHE BOOL
"Build the Image Warping solver.")
CMAKE_DEPENDENT_OPTION(NEKTAR_SOLVER_IMAGE_WARPING
"Build the Image Warping solver." ON
"NEKTAR_BUILD_SOLVERS" OFF)
IF( NEKTAR_SOLVER_IMAGE_WARPING )
SET(ImageWarpingSolverSource
......
SET(NEKTAR_SOLVER_INCNAVIERSTOKES ON CACHE BOOL
"Build the Incompressible Navier-Stokes solver.")
CMAKE_DEPENDENT_OPTION(NEKTAR_SOLVER_INCNAVIERSTOKES
"Build the Incompressible Navier-Stokes solver." ON
"NEKTAR_BUILD_SOLVERS" OFF)
IF( NEKTAR_SOLVER_INCNAVIERSTOKES )
SET(IncNavierStokesSolverSource
......
SET(NEKTAR_SOLVER_PULSEWAVE ON CACHE BOOL
"Build the Pulse-wave solver.")
CMAKE_DEPENDENT_OPTION(NEKTAR_SOLVER_PULSEWAVE
"Build the Pulse-wave solver." ON
"NEKTAR_BUILD_SOLVERS" OFF)
IF( NEKTAR_SOLVER_PULSEWAVE )
SET(PulseWaveSolverSource
......
SET(NEKTAR_SOLVER_SHALLOW_WATER ON CACHE BOOL
"Build the Shallow Water solver.")
CMAKE_DEPENDENT_OPTION(NEKTAR_SOLVER_SHALLOW_WATER
"Build the Shallow Water solver." ON
"NEKTAR_BUILD_SOLVERS" OFF)
IF( NEKTAR_SOLVER_SHALLOW_WATER )
SET(ShallowWaterSolverSource
......
SET(NEKTAR_SOLVER_VORTEXWAVE ON CACHE BOOL
"Build the Vortex-Wave interaction solver.")
CMAKE_DEPENDENT_OPTION(NEKTAR_SOLVER_VORTEXWAVE
"Build the Vortex-Wave interaction solver." ON
"NEKTAR_BUILD_SOLVERS" OFF)
IF( NEKTAR_SOLVER_VORTEXWAVE )
SET(VortexWaveInteractionSolverSource
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment