Re: [cmake-developers] FindLua.cmake module does not find a locally built lua library

2018-09-24 Thread Alan W. Irwin

On 2018-09-24 11:07-0400 Brad King wrote:


On 09/22/2018 07:09 PM, Alan W. Irwin wrote:

2. Use the NAMES_PER_DIR option in the find_library command.


This is the correct fix.

The versioned names need to go first to try to match the headers.


I agree.  I have additional code in PLplot to find the Lua executable,
and the versioned name (e.g., lua3.2 or Lua3.3 on Debian Buster) needs to go 
first to be
consistent with with whatever header and library are found.  So I
solved the issue of finding the local build of lua in that case using
the NAMES_PER_DIR option on find_program.

Here is my code for doing this.

  string(SUBSTRING ${LUA_VERSION_STRING} 0 3 SHORT_LUA_VERSION_STRING)
  # Look for consistently versioned LUA_EXECUTABLE and only use the
  # "lua" name for that executable as a last resort because the
  # generic system version may not correspond to the library that is
  # found. But in order to find a locally built version (if higher
  # than the system version on the search PATHs) must also use
  # NAMES_PER_DIR.

  find_program(LUA_EXECUTABLE NAMES lua${SHORT_LUA_VERSION_STRING} lua 
NAMES_PER_DIR)

The current FindLua.cmake does not determine the location for a
a consistent lua executable so I suggest similar code to the
above is adopted in that module to add that functionality.

Alan
__
Alan W. Irwin

Programming affiliations with the FreeEOS equation-of-state
implementation for stellar interiors (freeeos.sf.net); the Time
Ephemerides project (timeephem.sf.net); PLplot scientific plotting
software package (plplot.sf.net); the libLASi project
(unifont.org/lasi); the Loads of Linux Links project (loll.sf.net);
and the Linux Brochure Project (lbproject.sf.net).
__

Linux-powered Science
__
--

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:
https://cmake.org/mailman/listinfo/cmake-developers


Re: [cmake-developers] FindLua.cmake module does not find a locally built lua library

2018-09-24 Thread Brad King
On 09/22/2018 07:09 PM, Alan W. Irwin wrote:
> 2. Use the NAMES_PER_DIR option in the find_library command.

This is the correct fix.

The versioned names need to go first to try to match the headers.

-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:
https://cmake.org/mailman/listinfo/cmake-developers