link error

Jed Brown jed at 59A2.org
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,
> 
> FIND_PACKAGE (PETSC)
> 
> 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)

  list (APPEND CMAKE_MODULE_PATH "${MyProject_SOURCE_DIR}/CMake")

  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.


Jed
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20090213/a0a80734/attachment.pgp>


More information about the petsc-users mailing list