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

2018-09-25 Thread Brad King
On 09/24/2018 01:05 PM, Alan W. Irwin 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.
>>
> I agree.

Please see

  https://gitlab.kitware.com/cmake/cmake/merge_requests/2412

-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


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


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

2018-09-22 Thread Alan W. Irwin

This issue is due to the following NAMES logic (that is in all
versions from CMake 3.7.2 to the latest git version) of the
find_library command within FindLua.cmake.

find_library(LUA_LIBRARY
  NAMES ${_lua_library_names} lua
  HINTS
ENV LUA_DIR
  PATH_SUFFIXES lib
)

_lua_library_names contains a bunch of different versioned names such
as lua5.3.  As a result the system version of the lua libraries (which
for Debian Buster lua5.3.3 contains a nasty bug that is fixed in
upstream lua5.3.5 which I have built locally) is always found no
matter how I set CMAKE_PREFIX_PATH (or LUA_DIR) because the local
build installs the lua library with the generic name liblua.a.  I can
work around that by installing an extra symlink liblua5.3.a ->
liblua.a in my locally built version of lua-5.3.5, but that
workaround should not be necessary.

There are at least two possible fixes for this issue in FindLua.cmake.

1. Use

   NAMES lua ${_lua_library_names}

   which follows the advice at 

   to place the generic name first for exactly this reason (finding a local 
version).

2. Use the NAMES_PER_DIR option in the find_library command.

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