link error

Jed Brown jed at
Fri Feb 13 01:07:56 CST 2009

On Thu 2009-02-12 09:00, Yixun Liu wrote:
> Thanks. Satish's method works. I add X11 to CMakeList.txt and it is ok. 
> I also want to try  Jed's method to simplify the configuration. I
> download FindPetsc.cmake and I think I need add something like,
> into CMakeList. Right?

You normally distribute any nonstandard Find* modules with your
software, for instance $MYPROJECT/CMake/FindPETSc.cmake.  The start of
$MYPROJECT/CMakeLists.txt should look something like:

  project (MyProject)
  cmake_minimum_required (VERSION 2.6.2)


  find_package (PETSc REQUIRED)

  include_directories (${PETSC_INCLUDES})
  add_definitions (${PETSC_DEFINITIONS})

and link with

  target_link_libraries (myexecutable ${PETSC_LIBRARIES})

This is all the same as with other Find* modules.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <>

More information about the petsc-users mailing list