I am trying to cross compile a library with CMake. The target platform is non-standard. The library several try_compile
commands. In particular, the ones inside CheckTypeSize.cmake are failing. To have the compilation succeed, I need to change the flags and link libraries that those try_compile
command uses (and I do not want to modify the CMake installation). It seems as though the (undocumented) CMAKE_REQUIRED_LIBRARIES
and CMAKE_REQUIRED_FLAGS
are used within that module. In the toolchain file, I do:
set(CMAKE_REQUIRED_FLAGS "/DLL")
Unfortunately, I want to set a flag that starts with /D
(in this case /DLL
). When I do this, the variable gets translated into /D LL
. Is there any way to indicate to CMake that the string shouldn't be parsed into a compile define?