Hi Roman,
we've sometimes run into similar problems and our solution is to use the
FIND_LIBRARY CMake command. In your case this would be something like:
FIND_LIBRARY(CLAPACK_LIBRARY clapack PATHS ${CLAPACK_DIR})
FIND_LIBRARY(BLAS_LIBRARY blas PATHS ${CLAPACK_DIR}/blas)
We usually "hide" these variables since they're set automatically after
setting CLAPACK_DIR:
MARK_AS_ADVANCED(CLAPACK_LIBRARY BLAS_LIBRARY)
TARGET_LINK_LIBRARIES(FooBar ${CLAPACK_LIBRARY} ${BLAS_LIBRARY})
or even better:
LINK_LIB_TO_FUNCTIONALITY(FooBar ${CLAPACK_LIBRARY} ${BLAS_LIBRARY})
The second version is a MITK macro which links the lib only if the
functionality is turned on.
Regards
Marco
Roman Tulchiner wrote:
> Hi,
>
> does no one knows, how the problem below is to be solved, or are my way
> of posing this problem to vague?
>
> I'll be thankful for any advise.
>
> With kind regards,
> Roman
>
> Roman Tulchiner wrote:
>> Hallo MITK-Users,
>>
>> in my functionality I need some additional libraries to be linked (by
>> the way, it's about Clapack). In order to use this libraries, I have to
>> specify the additional include directories, library directories and
>> finally the libraries themself in the properties of my functionality
>> (I'm working with visual studio). If I do it all manually, it works.
>> In order to avoid editing properties after each CMake call, I have
>> edited CMakeLists.txt of my functionality. Though the include
>> directories, library directories and libraries entries are then set
>> through CMake correctly, I get a LINK error massage - "clapack.lib can
>> not be load". But then if I comment the TARGET_LINK_LIBRARIES line out
>> and add the libraries settings manually, it works. Does anybody knows,
>> what am I doing wrong?
>>
>> #######################The contents of the CMakeLists.txt file:
>>
>> # The CLAPACK install directory.
>> SET(CLAPACK_DIR "" CACHE PATH "Path to the Clapack directory. You will
>> need Clapack in order to compile FooBar")
>> # The CLAPACK include file directories.
>> SET(CLAPACK_INCLUDE_DIRS "${CLAPACK_DIR}")
>> # The CLAPACK library directories.
>> SET(CLAPACK_LIBRARY_DIRS "${CLAPACK_DIR}" "${CLAPACK_DIR}/blas"
>> "${CLAPACK_DIR}/f2clib")
>> # The CLAPACK library directories.
>> SET(CLAPACK_LIBRARIES clapack blas libI77 libF77 )
>>
>> INCLUDE_DIRECTORIES(${CLAPACK_INCLUDE_DIRS})
>> LINK_DIRECTORIES(${CLAPACK_LIBRARY_DIRS})
>>
>> CREATE_QFUNCTIONALITY(FooBar)
>>
>> TARGET_LINK_LIBRARIES(FooBar ${CLAPACK_LIBRARIES})
>>
>>
>>
>> -------------------------------------------------------------------------
>> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
>> Build the coolest Linux based applications with Moblin SDK & win great prizes
>> Grand prize is a trip for two to an Open Source event anywhere in the world
>> http://moblin-contest.org/redirect.php?banner_id=100&url=/
>> _______________________________________________
>> mitk-users mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/mitk-users
>>
>
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> mitk-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/mitk-users
--
----------------------------------------------------------------------
Dipl.-Inform. Med. Marco Nolden
Deutsches Krebsforschungszentrum (German Cancer Research Center)
Div. Medical & Biological Informatics Tel: (+49) 6221-42 2325
Im Neuenheimer Feld 280 Fax: (+49) 6221-42 2345
D-69120 Heidelberg eMail: [EMAIL PROTECTED]
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
mitk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mitk-users