Thank you; prepending C:/cygwin64/bin To CMAKE_PROGRAM_PATH was all I needed to 
do to fix the problem.

-----Original Message-----
Date: Thu, 5 Mar 2020 14:28:27 +0100
From: Eric Doenges <doen...@mvtec.com>

You can prepend C:\cygwin64\bin to the CMAKE_PROGRAM_PATH variable so that it 
looks there first.? While the find_package documentation does not mention 
CMAKE_PROGRAM_PATH, I know this works for bison and flex because that is what 
we do in our project (presumably, find_program is used internally within the 
find_package, explaining why CMAKE_PROGRAM_PATH is considered).

You could also try setting the FLEX_ROOT and BISON_ROOT variables to 
C:\cygwin64\bin or perhaps C:\cygwin64. According to the find_package 
documentation, this should allow you to set the search location on a 
per-package basis. However, I have not had this work for me, so your mileage 
may vary.

Am 05.03.20 um 12:12 schrieb Stephen Morris:
> To compile my application I need to use the Flex and Bison 
> applications. To compile under Linux, all I need to do in my 
> CMakeLists.txt file to find them is
>
>      find_package(FLEX REQUIRED)
>      find_package(BISON REQUIRED)
>
> ...and everything works as expected.
>
> In Windows, however, I'm using the Cygwin versions of Flex and Bison which 
> are installed in C:\cygwin64\bin. This doesn't seem to be on the path that 
> find_package searches in Module Mode, so the search returns unsuccessfully.
>
> However, if I try to tell find_package where to look, viz.
>
>      find_package(FLEX REQUIRED PATHS C:/cygwin64/bin NO_DEFAULT_PATH)
>      find_package(BISON REQUIRED PATHS C:/cygwin64/bin 
> NO_DEFAULT_PATH)
>
> ...then by adding the PATHS keyword I've invoked Config mode and I get an 
> error message saying:
>
>      Could not find a package configuration file provided by "FLEX" with any 
> of
>      the following names
>
>          FLEXConfig.cmake
>          flex-config.cmake
>
> ...because sure enough Cygwin does not provide these files.
>
> So what can I do? Ideally I'd like to use Module Mode but provide a path 
> hint; but there seems no way to do that.
>
> At the moment I can only think of:
> (a) Hard-coding add_custom_target commands to invoke flex and bison 
> entirely manually when they're needed, or
> (b) Writing my own FLEXConfig.cmake and BISONConfig.cmake files for use in 
> Config Mode.
>
> Both of these seem disproportionately difficult for what seems to me like it 
> ought to be a common and simple problem. So is there a better solution that 
> I'm missing?
>
*Dr. Eric D?nges*
Senior Software Engineer

MVTec Software GmbH | Arnulfstr. 205 | 80634 Munich | Germany doen...@mvtec.com 
<mailto:doen...@mvtec.com> | Tel: +49 89 457 695-0 | www.mvtec.com 
<http://www.mvtec.com>

Find our privacy policy here <https://www.mvtec.com/imprint>.

Sign up <https://www.mvtec.com/newsletter> for our MVTec Newsletter!
-- 

Powered by kitware.com/cmake

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit https://cmake.org/services

Visit other Kitware open-source projects at https://www.kitware.com/platforms

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake

This mailing list is deprecated in favor of https://discourse.cmake.org

Reply via email to