jrl-umi3218 / jrl-cmakemodules

CMake utility toolbox
https://jrl-cmakemodules.readthedocs.io/en/master/
Other
61 stars 47 forks source link

No error message when find visp fails #4

Closed francois-keith closed 14 years ago

francois-keith commented 14 years ago

In the file cmake/image/visp.cmake, there is no test of the existence of the file visp-config. As a result, if the executable does not exist, there is no error message, and the compilation fails at the compilation of the code as soon as the headers of visp are needed (namely in llvc), instead of during the compilation of the cmake project.

I suggest to add a preliminary test such as EXEC_PROGRAM(${VISP_CONFIG} RETURN_VALUE visp-config-found) and display an error message requiring to add the path to VISP_CONFIG to the PATH if not found.

IMOE, I tried to compile llvc, didn't find Visp, and supposed first that it was because VISP_ROOT or VISP_ROOT_DIR was not found (which was the case for open_cv). It took me some time so see that the findVisp process used was the one of jrl-cmakemodules, not the one in the package CMakeModules.

thomas-moulard commented 14 years ago
FIND_PROGRAM(VISP_CONFIG visp-config)

VISP_CONFIG should be set to *-NOTFOUND if the program is not found.

Hence, the following patch should be enough:

IF(NOT VISP_CONFIG)
MESSAGE(FATAL_ERROR "visp-config has not been found.")
ENDIF()
francois-keith commented 14 years ago

commit afe5471 corrects this issue with the solution proposed by Thomas.