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?

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

-Brad
-- 

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