Skip to content

Commit

Permalink
Track separation of conf/base into rules and variables
Browse files Browse the repository at this point in the history
  • Loading branch information
jedbrown committed Dec 12, 2009
1 parent 390241f commit c6300b2
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions FindPETSc.cmake
Expand Up @@ -57,16 +57,19 @@ find_package_multipass (PETSc petsc_config_current
# Determine whether the PETSc layout is old-style (through 2.3.3) or
# new-style (3.0.0)
if (EXISTS ${PETSC_DIR}/${PETSC_ARCH}/include/petscconf.h) # > 2.3.3
set (petsc_conf_base ${PETSC_DIR}/conf/base)
set (petsc_conf_rules ${PETSC_DIR}/conf/rules)
set (petsc_conf_variables ${PETSC_DIR}/conf/variables)
set (PETSC_VERSION "3.0.0")
elseif (EXISTS ${PETSC_DIR}/bmake/${PETSC_ARCH}/petscconf.h) # <= 2.3.3
set (petsc_conf_base ${PETSC_DIR}/bmake/common/base)
set (petsc_conf_rules ${PETSC_DIR}/bmake/common/rules)
set (petsc_conf_variables ${PETSC_DIR}/bmake/common/variables)
set (PETSC_VERSION "2.3.3")
else (EXISTS ${PETSC_DIR}/bmake/${PETSC_ARCH}/petscconf.h)
set (petsc_conf_base "NOTFOUND")
set (petsc_conf_rules "NOTFOUND")
set (petsc_conf_variables "NOTFOUND")
endif (EXISTS ${PETSC_DIR}/${PETSC_ARCH}/include/petscconf.h)

if (petsc_conf_base AND NOT petsc_config_current)
if (petsc_conf_rules AND petsc_conf_variables AND NOT petsc_config_current)
# Put variables into environment since they are needed to get
# configuration (petscvariables) in the PETSc makefile
set (ENV{PETSC_DIR} ${PETSC_DIR})
Expand All @@ -78,7 +81,8 @@ if (petsc_conf_base AND NOT petsc_config_current)
"## This file was autogenerated by FindPETSc.cmake
# PETSC_DIR = ${PETSC_DIR}
# PETSC_ARCH = ${PETSC_ARCH}
include ${petsc_conf_base}
include ${petsc_conf_rules}
include ${petsc_conf_variables}
show :
-@echo -n \${\${VARIABLE}}
")
Expand Down Expand Up @@ -199,7 +203,7 @@ int main(int argc,char *argv[]) {
# change these, you are telling the system to trust you that they
# work. It is likely that you will end up with a broken build.
mark_as_advanced (PETSC_INCLUDES PETSC_LIBRARIES PETSC_COMPILER PETSC_DEFINITIONS PETSC_MPIEXEC PETSC_EXECUTABLE_RUNS)
endif (petsc_conf_base AND NOT petsc_config_current)
endif ()

include (FindPackageHandleStandardArgs)
find_package_handle_standard_args (PETSc
Expand Down

0 comments on commit c6300b2

Please sign in to comment.