[CMake] install guidelines (for multiple versions of the same library)

Biddiscombe, John A. biddisco at cscs.ch
Thu Nov 25 09:07:14 EST 2010


If I install using this kind of stuff

  INSTALL (
      FILES ${PROJECT_BINARY_DIR}/H5pubconf.h
      DESTINATION ${HDF5_INSTALL_INCLUDE_DIR}
      COMPONENT headers
  )

and

  INSTALL (
      EXPORT ${HDF5_EXPORTED_TARGETS}
      DESTINATION ${HDF5_INSTALL_LIB_DIR}/cmake/hdf5-${HDF5_PACKAGE_VERSION}
      FILE hdf5-targets.cmake
  )

Then the hdf5-1.8.5 directory gets created with a version file inside and everything is lovely. The trouble is that the main headers go into a standard include place and when I install 1.8.7 over 1.8.5 I have multiple version files for cmake, but only one set of headers/libs and so everything is munged.

When installing many versions of the same libraries, what is the normal procedure, seems as though if I add a version postfix to the install location, I have to change all the find_package stuff too ...

are there any guidelines?
do I use 

/usr/lib/hdf5-1.8.5 and
$ENV{ProgramFiles}/HDF5/${version}

etc. 

And when I do  FIND_PACKAGE(HDF5 "1.8.5" REQUIRED NO_MODULE PATHS "$ENV{ProgramFiles}/HDF5")
will it search all sub dirs of the provided path for the right version file stuff?

thanks

JB

-- 
John Biddiscombe,                            email:biddisco @ cscs.ch
http://www.cscs.ch/
CSCS, Swiss National Supercomputing Centre  | Tel:  +41 (91) 610.82.07
Via Cantonale, 6928 Manno, Switzerland      | Fax:  +41 (91) 610.82.82




More information about the CMake mailing list