[cmake-developers] [BUG] HINTS not correctly handled in find_program

CHEVRIER, Marc marc.chevrier at sap.com
Thu Sep 3 03:51:10 EDT 2015


Hi,

Attached is a minimal example.
To use it:
1. Build phase. Under find_program.BUG/build, use CMakeLists.txt to prepare runtime part
2. Test phase. Under find_program.BUG/runtime, use CMakeLists.txt to show the bug.

Here is the result on my SuSE Linux with CMake 3.3.1 (binaries retrieved from CMake web site):

-- The C compiler identification is GNU 4.3.4
-- The CXX compiler identification is GNU 4.3.4
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
Test1: Fail to found correct exe: /home/marc/tests/find_program.BUG/runtime/dir2/exe
Test2: Found correct exe: /home/marc/tests/find_program.BUG/runtime/dir1/exe
-- Configuring done
-- Generating done
-- Build files have been written to: /home/marc/tests/find_program.BUG/runtime/gen

Marc





On 02/09/15 17:44, "Brad King" <brad.king at kitware.com> wrote:

>On 09/02/2015 09:09 AM, CHEVRIER, Marc wrote:
>> On 02/09/15 14:58, "Brad King" wrote:
>>> On 09/02/2015 05:31 AM, CHEVRIER, Marc wrote:
>>>> find_program (MY_EXE my_exe HINTS PATH1 PATH2 PATH3)
>>>
>>> find_program (MY_EXE
>>>   NAMES my_exe
>>>   HINTS PATH1 PATH2 PATH3
>>>   )
>> Same problem. HINTS which are also defined in the environment
>> variable PATH are ignored.
>
>I'm having trouble reproducing this.  Please provide a tarball
>with a full CMakeLists.txt and supporting files that demonstrate
>this.  You can "set(ENV{PATH} ...)" if needed.
>
>Thanks,
>-Brad
-------------- next part --------------
A non-text attachment was scrubbed...
Name: find_program.BUG.tar.gz
Type: application/x-gzip
Size: 703 bytes
Desc: find_program.BUG.tar.gz
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20150903/b343e699/attachment.bin>


More information about the cmake-developers mailing list