ifeq ($(WM_PROJECT), foam)
    VERSION_SPECIFIC_LIBS = \
        -lincompressibleTurbulenceModel -lincompressibleRASModels \
        -lincompressibleLESModels -llduSolvers -linterfaceProperties
    VER := $(shell expr `echo $(WM_PROJECT_VERSION)` \>= 4.1)
    ifeq ($(VER), 1)
        VERSION_SPECIFIC_LIBS += -loversetMesh -loversetDynamicFvMesh
    endif
else
    ifneq (,$(findstring v,$(WM_PROJECT_VERSION)))
        VERSION_SPECIFIC_LIBS = \
            -lturbulenceModels -lincompressibleTurbulenceModels -ltwoPhaseMixture \
            -limmiscibleIncompressibleTwoPhaseMixture -lmeshTools -lfvMotionSolvers \
            -lradiationModels -lfvOptions -lcompressibleTransportModels -lspecie \
            -lfluidThermophysicalModels
    else
        ifneq (,$(findstring 9,$(WM_PROJECT_VERSION)))
            VERSION_SPECIFIC_LIBS = \
                -ltwoPhaseMixture \
                -limmiscibleIncompressibleTwoPhaseMixture -lmeshTools -lfvMotionSolvers \
                -lradiationModels -lspecie \
                -lfluidThermophysicalModels
        else
            VERSION_SPECIFIC_LIBS = \
                -lturbulenceModels -lincompressibleTurbulenceModels -ltwoPhaseMixture \
                -limmiscibleIncompressibleTwoPhaseMixture -lmeshTools -lfvMotionSolvers \
                -lradiationModels -lfvOptions -lcompressibleTransportModels -lspecie \
                -lfluidThermophysicalModels -lturbulenceModels -lcompressibleTurbulenceModels
        endif
    endif
endif

ifeq (Gcc,$(findstring Gcc,$(WM_COMPILER)))
    DISABLE_WARNING_FLAGS = -Wno-old-style-cast -Wno-deprecated-declarations
else
    DISABLE_WARNING_FLAGS =
endif

ifeq ($(WM_PROJECT), foam)
    c++WARN = \
        -Wno-deprecated -Wall -Wextra -Wno-unused-parameter -Wnon-virtual-dtor \
        -Wno-error -Wredundant-decls -Wcast-align \
        -Wmissing-declarations  -Wswitch-enum -Winvalid-pch -Wredundant-decls \
        -Wformat=2 -Wmissing-format-attribute -Wformat-nonliteral
    VER := $(shell expr `echo $(WM_PROJECT_VERSION)` \>= 4.1)
    ifeq ($(VER), 1)
        VERSION_SPECIFIC_INC = -DFOAMEXTEND=41
    else
        VERSION_SPECIFIC_INC = -DFOAMEXTEND=40
    endif
else
    VERSION_SPECIFIC_INC = \
        -DOPENFOAMESIORFOUNDATION -I$(LIB_SRC)/dynamicFvMesh/lnInclude/
    ifneq (,$(findstring v,$(WM_PROJECT_VERSION)))
        VERSION_SPECIFIC_INC += -DOPENFOAMESI
    else
        VERSION_SPECIFIC_INC += -DOPENFOAMFOUNDATION
    endif
endif

EXE_INC = \
    -std=c++11 \
    $(DISABLE_WARNING_FLAGS) \
    $(VERSION_SPECIFIC_INC) \
    -I$(SOLIDS4FOAM_INST_DIR)/src/solids4FoamModels/lnInclude \
    -I$(LIB_SRC)/finiteVolume/lnInclude \
    -I$(LIB_SRC)/meshTools/lnInclude \
    -I$(LIB_SRC)/finiteArea/lnInclude \
    -I$(LIB_SRC)/lagrangian/lnInclude \
    -I$(LIB_SRC)/dynamicMesh/lnInclude \
    -I$(LIB_SRC)/dynamicMesh/dynamicMesh/lnInclude \
    -I$(LIB_SRC)/dynamicMesh/dynamicFvMesh/lnInclude \
    -I$(LIB_SRC)/dynamicMesh/topoChangerFvMesh/lnInclude \
    -I$(LIB_SRC)/sampling/lnInclude \
    -I$(LIB_SRC)/surfMesh/lnInclude \
    -I$(LIB_SRC)/postProcessing/foamCalcFunctions/lnInclude \
    -I$(LIB_SRC)/postProcessing/functionObjects/forces/lnInclude \
    -I$(LIB_SRC)/errorEstimation/lnInclude \
    -I$(LIB_SRC)/mesh/cfMesh/lnInclude \
    -I$(LIB_SRC)/turbulenceModels \
    -I$(LIB_SRC)/turbulenceModels/incompressible/RAS/RASModel \
    -I$(LIB_SRC)/turbulenceModels/incompressible/turbulenceModel \
    -I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \
    -I$(LIB_SRC)/transportModels \
    -I$(LIB_SRC)/transportModels/incompressible/lnInclude \
    -I$(LIB_SRC)/tetFiniteElement/lnInclude \
    -I$(LIB_SRC)/dynamicMesh/meshMotion/fvMotionSolver/lnInclude \
    -I$(LIB_SRC)/dynamicMesh/meshMotion/tetMotionSolver/lnInclude  \
    -I$(LIB_SRC)/overset/oversetMesh/lnInclude

EXE_LIBS = \
    -L$(FOAM_USER_LIBBIN) \
    $(VERSION_SPECIFIC_LIBS) \
    -lblockCoupledSolids4FoamTools \
    -lsolids4FoamModels \
    -lfiniteVolume \
    -ldynamicFvMesh \
    -ldynamicMesh \
    -lmeshTools \
    -ltopoChangerFvMesh
