visp icon indicating copy to clipboard operation
visp copied to clipboard

Update Find<package>.cmake files to set <package> location from command line

Open fspindle opened this issue 5 years ago • 0 comments

Follows #543.

In all cmake/Find<package>.cmake files non standard header and library location could be detected using $ENV{package_DIR} where package_DIR is an environment var. Setting package_DIR from command line doesn't work.

We should modify some of these cmake/Find<package>.cmake files to be able to set the package location from command line:

$ cmake -D<package>_DIR=<path> visp

To this end, just introduce ${<package>_DIR} var.

For example in FindAtlas.cmake we should have:

set(Atlas_INCLUDE_SEARCH_PATHS
  /usr/include/atlas
  /usr/include/atlas-base
  $ENV{Atlas_ROOT_DIR}
  $ENV{Atlas_ROOT_DIR}/include
  ${Atlas_ROOT_DIR}
  ${Atlas_ROOT_DIR}/include
)

set(Atlas_LIB_SEARCH_PATHS
  /usr/lib/atlas
  /usr/lib/atlas-base
  $ENV{Atlas_ROOT_DIR}
  $ENV{Atlas_ROOT_DIR}/lib
  ${Atlas_ROOT_DIR}
  ${Atlas_ROOT_DIR}/lib
)

This enhancement should be introduced in FindARIA.cmake, FindAtlas.cmake, FindBICLOPS.cmake, FindCALINUX.cmake, FindComedi.cmake, FindDC1394.cmake, FindDL.cmake, FindDMTX.cmake, FindFlyCapture.cmake, FindGSL.cmake, FindIRISA.cmake, FindLAPACK_C.cmake, FindLIBFREENECT.cmake, FindLIBUSB_1.cmake, FindMyCoin3D.cmake, FindMyGTK2.cmake...

If there is a var named <package>_HOME we should also introduce the corresponding <package>_DIR var.

fspindle avatar Mar 08 '19 06:03 fspindle