On Fri, Aug 3, 2018 at 11:31 AM Louis-Paul CORDIER <[email protected]> wrote:
> How can I detect using generator expression if a file exists? > Since there is no first class CMake feature controlling if PDB files are generated and since CMake does not try to interpret custom compiler flags projects or users might be setting it doesn't necessarily know which configurations may or may not generate PDBs. I.e. a project might add the required compiler flags to generate PDBs in Release configurations as well. If you know for your use case that PDBs are generated for all configurations except Release you could guard expansion of $<TARGET_PDB_FILE> with something like $<$<NOT:$<CONFIG:Release>>:$<TARGET_PDB_FILE:...>> (untested) or alternatively and perhaps cleaner and more flexible you could replace your direct command invocation with a cmake script wrapper that checks for existence of files before invoking the actual tool. That way it would also work when users directly manipulated PDB specific compiler flags. Nils
-- 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: https://cmake.org/mailman/listinfo/cmake
