Re: [CMake] ExternalProject: how to avoid reinstalling after 'make clean'?

2015-04-28 Thread Johannes Zarl
Hi Cedric,

This is something that ExternalProject cannot really do for you in an 
automatic/safe way. When you do a make clean, you wipe out all knowledge about 
the installed package.

However, you can implement this yourself: Before you do the 
ExternalProject_Add(eigen ...) call, you can call find_package(eigen) and if 
you find the package, you just skip the ExternalProject_Add.

Cheers,
  Johannes



On Tuesday 28 April 2015 12:04:50 Cedric Doucet wrote:
 Hello!
 
 No one knows how to avoid spurious installations with external projects?
 
 Thank you,
 
 Cédric
 
 - Mail original -
 
  De: Cedric Doucet cedric.dou...@inria.fr
  À: cmake@cmake.org
  Envoyé: Vendredi 24 Avril 2015 11:35:54
  Objet: ExternalProject: how to avoid reinstalling after 'make clean'?
  
  Hello,
  
  I use the ExternalProjet_Add function to download and install third-party
  libraries.
  Here is an example of a CMakeLists file containing such a call:
  
  =
  cmake_minimum_required (VERSION 2.6)
  
  project (example CXX)
  
  set(CMAKE_VERBOSE_MAKEFILE ON)
  
  include(ProcessorCount)
  ProcessorCount(N)
  if(NOT N EQUAL 0)
  set(CMAKE_BUILD_FLAGS -j${N})
  endif()
  
  include(ExternalProject)
  set(EXTERNAL_DIR ${CMAKE_CURRENT_BINARY_DIR})
  ExternalProject_Add(eigen
  PREFIX ${EXTERNAL_DIR}/eigen
  DOWNLOAD_DIR ${EXTERNAL_DIR}/eigen/download
  SOURCE_DIR ${EXTERNAL_DIR}/eigen/src
  BINARY_DIR ${EXTERNAL_DIR}/eigen/build
  STAMP_DIR ${EXTERNAL_DIR}/eigen/stamp
  INSTALL_DIR ${EXTERNAL_DIR}/eigen/install
  URL http://bitbucket.org/eigen/eigen/get/3.2.4.tar.gz
  URL_MD5 4d0d77e06fef87b4fcd2c9b72cc8dc55
  CMAKE_ARGS -D CMAKE_INSTALL_PREFIX=INSTALL_DIR
  )
  
  =
  
  Everything works fine, except after calling make clean.
  Thanks to URL_MD5, the third-party library is not downloaded again.
  However, configuration, build and install steps are performed again
  whereas
  the library has not been uninstalled during cleaning.
  
  How could I tell to ExternalProject_Add not to configure/build/install my
  library unless this library has been removed from my computer?
  
  Thank you very much for your help!
  
  Cédric

-- 

Powered by www.kitware.com

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

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake


Re: [CMake] ExternalProject: how to avoid reinstalling after 'make clean'?

2015-04-28 Thread Cedric Doucet
Hello! 

No one knows how to avoid spurious installations with external projects? 

Thank you, 

Cédric 

- Mail original -

 De: Cedric Doucet cedric.dou...@inria.fr
 À: cmake@cmake.org
 Envoyé: Vendredi 24 Avril 2015 11:35:54
 Objet: ExternalProject: how to avoid reinstalling after 'make clean'?

 Hello,

 I use the ExternalProjet_Add function to download and install third-party
 libraries.
 Here is an example of a CMakeLists file containing such a call:

 =
 cmake_minimum_required (VERSION 2.6)

 project (example CXX)

 set(CMAKE_VERBOSE_MAKEFILE ON)

 include(ProcessorCount)
 ProcessorCount(N)
 if(NOT N EQUAL 0)
 set(CMAKE_BUILD_FLAGS -j${N})
 endif()

 include(ExternalProject)
 set(EXTERNAL_DIR ${CMAKE_CURRENT_BINARY_DIR})
 ExternalProject_Add(eigen
 PREFIX ${EXTERNAL_DIR}/eigen
 DOWNLOAD_DIR ${EXTERNAL_DIR}/eigen/download
 SOURCE_DIR ${EXTERNAL_DIR}/eigen/src
 BINARY_DIR ${EXTERNAL_DIR}/eigen/build
 STAMP_DIR ${EXTERNAL_DIR}/eigen/stamp
 INSTALL_DIR ${EXTERNAL_DIR}/eigen/install
 URL http://bitbucket.org/eigen/eigen/get/3.2.4.tar.gz
 URL_MD5 4d0d77e06fef87b4fcd2c9b72cc8dc55
 CMAKE_ARGS -D CMAKE_INSTALL_PREFIX=INSTALL_DIR
 )

 =

 Everything works fine, except after calling make clean.
 Thanks to URL_MD5, the third-party library is not downloaded again.
 However, configuration, build and install steps are performed again whereas
 the library has not been uninstalled during cleaning.

 How could I tell to ExternalProject_Add not to configure/build/install my
 library unless this library has been removed from my computer?

 Thank you very much for your help!

 Cédric
-- 

Powered by www.kitware.com

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

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake

[CMake] ExternalProject: how to avoid reinstalling after 'make clean'?

2015-04-24 Thread Cedric Doucet

Hello, 

I use the ExternalProjet_Add function to download and install third-party 
libraries. 
Here is an example of a CMakeLists file containing such a call: 

= 
cmake_minimum_required (VERSION 2.6) 

project (example CXX) 

set(CMAKE_VERBOSE_MAKEFILE ON) 

include(ProcessorCount) 
ProcessorCount(N) 
if(NOT N EQUAL 0) 
set(CMAKE_BUILD_FLAGS -j${N}) 
endif() 

include(ExternalProject) 
set(EXTERNAL_DIR ${CMAKE_CURRENT_BINARY_DIR}) 
ExternalProject_Add(eigen 
PREFIX ${EXTERNAL_DIR}/eigen 
DOWNLOAD_DIR ${EXTERNAL_DIR}/eigen/download 
SOURCE_DIR ${EXTERNAL_DIR}/eigen/src 
BINARY_DIR ${EXTERNAL_DIR}/eigen/build 
STAMP_DIR ${EXTERNAL_DIR}/eigen/stamp 
INSTALL_DIR ${EXTERNAL_DIR}/eigen/install 
URL http://bitbucket.org/eigen/eigen/get/3.2.4.tar.gz 
URL_MD5 4d0d77e06fef87b4fcd2c9b72cc8dc55 
CMAKE_ARGS -D CMAKE_INSTALL_PREFIX=INSTALL_DIR 
) 

= 

Everything works fine, except after calling make clean. 
Thanks to URL_MD5, the third-party library is not downloaded again. 
However, configuration, build and install steps are performed again whereas the 
library has not been uninstalled during cleaning. 

How could I tell to ExternalProject_Add not to configure/build/install my 
library unless this library has been removed from my computer? 

Thank you very much for your help! 

Cédric 





-- 

Powered by www.kitware.com

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

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake