Building with visual studio

I’d like to create a vcpkg (vcpkg - Open source C/C++ dependency manager from Microsoft) port for CODA, and therefore want to build the library using CMake and MSVC. I run into one issue: the CODA CMakeLists uses “find_package(BISON)/find_package(FLEX)”. Do you know of a good way to make that work on windows? (I found “Win flex-bison”, but that won’t satisfy the find_package() macros).

We have two Windows builds for CODA and both use a conda environment for most of the dependencies. Especially the bison/flex tools come via conda-forge.

The details for the conda-forge build of CODA for Windows can be found at coda-feedstock/recipe at main · conda-forge/coda-feedstock · GitHub.

For the CODA msi installer package (as available from Releases · stcorp/coda · GitHub) we are doing more or less the same, but then use a local version of HDF5 (that does not have dependencies on network libraries such as libcurl, libcrypto, etc., which the conda-forge version of HDF5 does), and include java, matlab, and idl bindings.

Thanks! That was easier than I thought, though I did have to apply a patch to the coda CMakeLists.txt: the expected path to coda.exp included a ‘Release’ subdirectory that was not present in my build tree:

install(FILES ${CMAKE_CURRENT_BINARY_DIR}/Release/coda.exp DESTINATION ${LIB_PREFIX})

to

install(FILES ${CMAKE_CURRENT_BINARY_DIR}/coda.exp DESTINATION ${LIB_PREFIX})

Unfortunately, there is no clean way to inject the path to the conda environment into the vcpkg build, but I think the only clean solution there is to create a vcpkg port for bison and flex, too…