> On 19 Feb 2015, at 16:48, Brad King <brad.k...@kitware.com> wrote:
> 
> On 02/19/2015 10:20 AM, Raffi Enficiaud wrote:
>>> If find_program doesn't find it, "which" won't have better luck.
>> 
>> I tested that yesterday on a regular LTS14.04 server. find_program
>> fails while "which matlab" does not.
> 
> Please figure out why find_program fails so we can fix it rather
> than working around it with "which".  The find_program command
> searches the PATH just like "which" does.  Is "matlab" one of
> those executables with "x" permission but not "r" permission?

On the system I am working, matlab in the PATH is a symlink with r & x 
permissions

renficiaud@madeira3:~/Code/CMake$ which matlab
/usr/bin/matlab
renficiaud@madeira3:~/Code/CMake$ ls -al /usr/bin/matlab
lrwxrwxrwx 1 root root 24 May 15  2013 /usr/bin/matlab -> 
/etc/alternatives/matlab
renficiaud@madeira3:~/Code/CMake$ ls -al /etc/alternatives/matlab
lrwxrwxrwx 1 root root 43 Oct 20 15:32 /etc/alternatives/matlab -> 
/is/software/matlab/linux/R2014a/bin/matlab
renficiaud@madeira3:~/Code/CMake$ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games

Is there any internal in the find_program to check what conditions are not met?

> 
>> Finding the matlab program from time to time is for me an
>> implementation detail
> 
> Okay, I just wanted an explanation for why there are so many
> find_program calls for the same thing.  If the design is better
> that way then so be it.  However:
> 
>> Also the main functionality is not performance oriented.
>> If I start trying to optimize all those calls, I would have
>> complicated execution paths.
> 
> Caching is not about performance.  It is about giving the user
> the opportunity to set the result explicitly when the automatic
> determination gets an undesired result.
> 
> There needs to be at least (and ideally exactly) one cache
> entry that stores the location of matlab.  If the user sets it
> up front then great.  If not then we should search and store the
> result there for the user to accept or edit later.  Currently
> MATLAB_USER_ROOT allows the user to specify up front, but does
> not serve the second role.
> 

If I understand correctly, you propose to merge the variables MATLAB_USER_ROOT 
and Matlab_ROOT_DIR, is that correct?
Or just drop Matlab_ROOT_DIR from the user view?

Best,
Raffi


-- 

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-developers

Reply via email to