Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use FindPETSc.cmake? #19

Open
ghost opened this issue Feb 1, 2017 · 2 comments
Open

How to use FindPETSc.cmake? #19

ghost opened this issue Feb 1, 2017 · 2 comments

Comments

@ghost
Copy link

ghost commented Feb 1, 2017

Hello, I have copied the FindPETSc.cmake to /usr/share/cmake-3.7/Modules (where all the other .cmake files are). However, when I run cmake the following message is shown:

" By not providing "FindPETSC.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "PETSC", but
CMake did not find one. "

This is how FindPETSc.cmake is called in my top level CMakeLists:
find_package(PETSC)
if(PETSC_FOUND)
include_directories(${PETSC_INCLUDE_DIR})
add_definitions( "-DHAS_PETSC" )
endif()

Could you please provide more information?

Thank you.

@jedbrown
Copy link
Owner

jedbrown commented Feb 1, 2017

CMake is case-sensitive so there is a difference between PETSc and PETSC.

Also note that it's unreasonable to ask your users to copy FindPETSc.cmake to the system module path. One would normally include the file (and its dependencies) in your source repository (you can use a git submodule, git subtree, or just copy the files in), then have

project (MyProject)
list (APPEND CMAKE_MODULE_PATH "${MyProject_SOURCE_DIR}/cmake-modules")

@ghost
Copy link
Author

ghost commented Feb 6, 2017

Issue solved, thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant