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

2015-09-03 Thread CHEVRIER, Marc

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


find_program.BUG.tar.gz
Description: find_program.BUG.tar.gz
-- 

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

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

2015-09-02 Thread Brad King
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
-- 

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


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

2015-09-02 Thread CHEVRIER, Marc
Hi,

I discovered a curious problem regarding handling of argument HINTS.
If I use the following command:

find_program (MY_EXE my_exe HINTS PATH1 PATH2 PATH3)

And my_exe is available in various paths. In this case, paths specified in 
HINTS AND also defined in environment variable PATH are ignored !
For example, with environment variable PATH=PATH1:PATH2, find_program will 
gives PATH3/my_exe as result.

This problem occurs on Windows and Linux (at least) in versions 3.2.1 and 
3.3.1. The behavior is correct with version 3.1.3.

Marc
-- 

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

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

2015-09-02 Thread Brad King
On 09/02/2015 05:31 AM, CHEVRIER, Marc wrote:
> find_program (MY_EXE my_exe HINTS PATH1 PATH2 PATH3)

Try it with

 find_program (MY_EXE
   NAMES my_exe
   HINTS PATH1 PATH2 PATH3
   )

-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


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

2015-09-02 Thread CHEVRIER, Marc

Same problem. HINTS which are also defined in the environment variable PATH are 
ignored.



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)
>
>Try it with
>
> find_program (MY_EXE
>   NAMES my_exe
>   HINTS PATH1 PATH2 PATH3
>   )
>
>-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