How to use FIND_PACKAGE(xxx) ?

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

How to use FIND_PACKAGE(xxx) ?

mort.motes
I am building an application with cmake that depends on the Elastix  library:

http://elastix.isi.uu.nl/about.php

I have already build Elastix. I am trying to do the following in a CMakeLists.txt file:

------------------------------------------------------------------------------------------------------------------------------------
# Find Elastix
FIND_PACKAGE(ELASTIX REQUIRED)
IF( ELASTIX_FOUND )
  INCLUDE( ${ELASTIX_USE_FILE} )
ELSE( ELASTIX_FOUND )
  MESSAGE( FATAL_ERROR "Cannot build without ELASTIX.  Please set ELASTIX_DIR." )
ENDIF( ELASTIX_FOUND )


# I need to use the following:
INCLUDE_DIRECTORIES(${ELASTIX_SRC}/Core/Kernel)
INCLUDE_DIRECTORIES(${ELASTIX_SRC}/Core/Configuration)
INCLUDE_DIRECTORIES(${ELASTIX_SRC}/Core/ComponentBaseClasses)

LINK_DIRECTORIES(G:/diku/speciale/local/lib/GnuWin32/src/zlib/1.2.3/zlib-1.2.3)
LINK_DIRECTORIES(${ELASTIX_BUILD})
LINK_DIRECTORIES(${ELASTIX_BUILD}/Components/Optimizers/StandardGradientDescent)
------------------------------------------------------------------------------------------------------------------------------------

But this does not work since ELASTIX_SRC and  ELASTIX_BUILD are not defined. I defined those manually earlier but is there no way to include the Elastix library in a more generic way?

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: How to use FIND_PACKAGE(xxx) ?

alexis lameire



Date: Sun, 2 Aug 2009 00:07:02 +0200
From: [hidden email]
To: [hidden email]
Subject: [CMake] How to use FIND_PACKAGE(xxx) ?

I am building an application with cmake that depends on the Elastix  library:

http://elastix.isi.uu.nl/about.php

I have already build Elastix. I am trying to do the following in a CMakeLists.txt file:

------------------------------------------------------------------------------------------------------------------------------------
# Find Elastix
FIND_PACKAGE(ELASTIX REQUIRED)
IF( ELASTIX_FOUND )
  INCLUDE( ${ELASTIX_USE_FILE} )
ELSE( ELASTIX_FOUND )
  MESSAGE( FATAL_ERROR "Cannot build without ELASTIX.  Please set ELASTIX_DIR." )
ENDIF( ELASTIX_FOUND )


# I need to use the following:
INCLUDE_DIRECTORIES(${ELASTIX_SRC}/Core/Kernel)
INCLUDE_DIRECTORIES(${ELASTIX_SRC}/Core/Configuration)
INCLUDE_DIRECTORIES(${ELASTIX_SRC}/Core/ComponentBaseClasses)

LINK_DIRECTORIES(G:/diku/speciale/local/lib/GnuWin32/src/zlib/1.2.3/zlib-1.2.3)
LINK_DIRECTORIES(${ELASTIX_BUILD})
LINK_DIRECTORIES(${ELASTIX_BUILD}/Components/Optimizers/StandardGradientDescent)
------------------------------------------------------------------------------------------------------------------------------------

But this does not work since ELASTIX_SRC and  ELASTIX_BUILD are not defined. I defined those manually earlier but is there no way to include the Elastix library in a more generic way?

to use find package an another developper must have creat findxxx.cmake macro !
this library is not yet implemented and you must creat manualy the findxxx.cmake script and distribut it with your program !


Vous voulez savoir ce que vous pouvez faire avec le nouveau Windows Live ? Lancez-vous !
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: How to use FIND_PACKAGE(xxx) ?

mort.motes
Yeah I realized that it does not exists for Elastix, but it exists for ITK though. Maybe the Elastix developer will include it in a future release.

On Sun, Aug 2, 2009 at 12:29 AM, alexis lameire <[hidden email]> wrote:



Date: Sun, 2 Aug 2009 00:07:02 +0200
From: [hidden email]
To: [hidden email]
Subject: [CMake] How to use FIND_PACKAGE(xxx) ?


I am building an application with cmake that depends on the Elastix  library:

http://elastix.isi.uu.nl/about.php

I have already build Elastix. I am trying to do the following in a CMakeLists.txt file:

------------------------------------------------------------------------------------------------------------------------------------
# Find Elastix
FIND_PACKAGE(ELASTIX REQUIRED)
IF( ELASTIX_FOUND )
  INCLUDE( ${ELASTIX_USE_FILE} )
ELSE( ELASTIX_FOUND )
  MESSAGE( FATAL_ERROR "Cannot build without ELASTIX.  Please set ELASTIX_DIR." )
ENDIF( ELASTIX_FOUND )


# I need to use the following:
INCLUDE_DIRECTORIES(${ELASTIX_SRC}/Core/Kernel)
INCLUDE_DIRECTORIES(${ELASTIX_SRC}/Core/Configuration)
INCLUDE_DIRECTORIES(${ELASTIX_SRC}/Core/ComponentBaseClasses)

LINK_DIRECTORIES(G:/diku/speciale/local/lib/GnuWin32/src/zlib/1.2.3/zlib-1.2.3)
LINK_DIRECTORIES(${ELASTIX_BUILD})
LINK_DIRECTORIES(${ELASTIX_BUILD}/Components/Optimizers/StandardGradientDescent)
------------------------------------------------------------------------------------------------------------------------------------

But this does not work since ELASTIX_SRC and  ELASTIX_BUILD are not defined. I defined those manually earlier but is there no way to include the Elastix library in a more generic way?

to use find package an another developper must have creat findxxx.cmake macro !
this library is not yet implemented and you must creat manualy the findxxx.cmake script and distribut it with your program !


Vous voulez savoir ce que vous pouvez faire avec le nouveau Windows Live ? Lancez-vous !

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: How to use FIND_PACKAGE(xxx) ?

alexis lameire



Date: Sun, 2 Aug 2009 00:31:31 +0200
Subject: Re: [CMake] How to use FIND_PACKAGE(xxx) ?
From: [hidden email]
To: [hidden email]
CC: [hidden email]

Yeah I realized that it does not exists for Elastix, but it exists for ITK though. Maybe the Elastix developer will include it in a future release.

On Sun, Aug 2, 2009 at 12:29 AM, alexis lameire <[hidden email]> wrote:



Date: Sun, 2 Aug 2009 00:07:02 +0200
From: [hidden email]
To: [hidden email]
Subject: [CMake] How to use FIND_PACKAGE(xxx) ?


I am building an application with cmake that depends on the Elastix  library:

http://elastix.isi.uu.nl/about.php

I have already build Elastix. I am trying to do the following in a CMakeLists.txt file:

------------------------------------------------------------------------------------------------------------------------------------
# Find Elastix
FIND_PACKAGE(ELASTIX REQUIRED)
IF( ELASTIX_FOUND )
  INCLUDE( ${ELASTIX_USE_FILE} )
ELSE( ELASTIX_FOUND )
  MESSAGE( FATAL_ERROR "Cannot build without ELASTIX.  Please set ELASTIX_DIR." )
ENDIF( ELASTIX_FOUND )


# I need to use the following:
INCLUDE_DIRECTORIES(${ELASTIX_SRC}/Core/Kernel)
INCLUDE_DIRECTORIES(${ELASTIX_SRC}/Core/Configuration)
INCLUDE_DIRECTORIES(${ELASTIX_SRC}/Core/ComponentBaseClasses)

LINK_DIRECTORIES(G:/diku/speciale/local/lib/GnuWin32/src/zlib/1.2.3/zlib-1.2.3)
LINK_DIRECTORIES(${ELASTIX_BUILD})
LINK_DIRECTORIES(${ELASTIX_BUILD}/Components/Optimizers/StandardGradientDescent)
------------------------------------------------------------------------------------------------------------------------------------

But this does not work since ELASTIX_SRC and  ELASTIX_BUILD are not defined. I defined those manually earlier but is there no way to include the Elastix library in a more generic way?

to use find package an another developper must have creat findxxx.cmake macro !
this library is not yet implemented and you must creat manualy the findxxx.cmake script and distribut it with your program !


Vous voulez savoir ce que vous pouvez faire avec le nouveau Windows Live ? Lancez-vous !

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

don't top quote when you replay :)
ans if possible quotting all text it's easyest for the another people reading :)


Votre correspondant a choisi Hotmail et profite d'un stockage quasiment illimité. Créez un compte Hotmail gratuitement !
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: How to use FIND_PACKAGE(xxx) ?

Alexander Neundorf-3
On Sunday 02 August 2009, alexis lameire wrote:
> Date: Sun, 2 Aug 2009 00:31:31 +0200
> Subject: Re: [CMake] How to use FIND_PACKAGE(xxx) ?
> From: [hidden email]
> To: [hidden email]
> CC: [hidden email]
>
> Yeah I realized that it does not exists for Elastix, but it exists for ITK
> though. Maybe the Elastix developer will include it in a future release.

No, not really. It doesn't make sense for a package Foo to include and install
a FindFoo.cmake file, since this would then only be available if Foo is
installed, but FindFoo.cmake has to be available also if Foo is not
installed.

I guess he'll have to write a FindElastix.cmake.
FindJPEG.cmake could be used e.g. as simple example to start with.

Alex
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake