[petsc-users] CMake error in PETSc
Jed Brown
jed at jedbrown.org
Wed Dec 4 09:31:00 CST 2019
Yingjie Wu <yjwu16 at gmail.com> writes:
> Dear Petsc developers
> Hi,
> Because I use some external library files, I want to compile the PETSc
> program with CMake. I follow the library search program
> https://github.com/CoolProp/CoolProp/blob/b493de51a44078e4f5bbb8712e89305fd91f8b85/CMakeLists.txt
> recommended
> on GitHub. And wrote a cmakelist.txt:
>
> cmake_minimum_required(VERSION 2.8.11)
> project(example01cmke)
> add_executable(example01cmke ex1.cpp)
> set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/modules)
> find_package(PETSc)
> include_directories(${PETSC_INCLUDE_DIR})
This needs to be spelled PETSC_INCLUDES, as stated in FindPETSc.cmake.
These days, I usually recommend that people use
https://cmake.org/cmake/help/latest/module/FindPkgConfig.html
instead of my FindPETSc.cmake because its simpler and doesn't require
the script (which was developed before we added pkg-config support to
PETSc).
More information about the petsc-users
mailing list