Right now, in our CMakeLists, we have a simple call to find flex and bison:
find_package(BISON QUIET) find_package(FLEX QUIET)
The issue here, is, that if CMake is building for MSVC, I want it to use a specific (provided) version of flex-bison.
I tried a variety of permutations to find_package, but I keep coming up empty.
The files are:
./winflex/win-flex.exe
and
./winflex/win-bison.exe
Do I need to make modules to load these? Hoe exactly can I sub out those calls to load these specific files if(MSVC) ?
The CMake docs absolutely suck, with no true examples and whatnot.
if I need a module, would someone please carefully explain WTF I need to do to ad it?
Source CMakeLists file is here:
https://github.com/ArmageddonGames/ZeldaClassic/blob/2.55/CMakeLists.txt
CMake Modules, here:
https://github.com/ArmageddonGames/ZeldaClassic/tree/2.55/modules
the reason that I am doing this, is that if a user has both MSVC and MinGW32 installed, then CMake finds the *nix flex and the *nix Bison first, and of course, if using MSVC to compile, those do not work.
I know only a bit about CMake and I could use some help on this one.
Many thanks. .
Don't use the cmake docs, they do suck. Use the manual instead.
Basically what you have to do is set a build time variable that controls the call to flex and bison.
Here's a CHM version of the cmake manual. You'll wonder why you never used it before....
https://bitbucket.org/bugsquasher/unofficial-allegro-5-binaries/downloads/CMake314rc4.chm
https://cmake.org/cmake/help/latest/variable/CMAKE_LANG_COMPILER_ID.html