link error
Yixun Liu
enjoywm at cs.wm.edu
Fri Feb 13 07:39:49 CST 2009
Jed Brown wrote:
> 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
>
Do I need to add link_directories(${PETSC_LIB_DIR})?
More information about the petsc-users
mailing list