CMake fails on generate_dll_export_file
Sometimes running CMake inside CLion fails because the command generate_dll_export_file fails:
---snip---
CMake Error at C:/Users/philippe.payant/AppData/Local/JetBrains/Toolbox/apps/CLion/ch-0/193.6015.37/bin/cmake/win/share/cmake-3.15/Modules/GenerateExportHeader.cmake:394 (configure_file):
configure_file Problem configuring file
Call Stack (most recent call first):
C:/Users/philippe.payant/AppData/Local/JetBrains/Toolbox/apps/CLion/ch-0/193.6015.37/bin/cmake/win/share/cmake-3.15/Modules/GenerateExportHeader.cmake:410 (_do_generate_export_header)
cmake/dll-export-helper.cmake:4 (generate_export_header)
domain/Lidar/CMakeLists.txt:58 (generate_dll_export_file)
---snip---
I believe the reason is that CLion runs CMake for debug and release at the same time and then generate_dll_export_file fails (sometimes) because both generations are trying to write to the same output file (our DLL export header files are placed inside the source tree).
Anybody else has this issue?
Is there a good technique for placing the export header files in the generated project directory instead of the source tree?
Is there a way to get CLion to regen debug or release separately?
Any suggestion would be appreciated.
Please sign in to leave a comment.
Hello!
EXPORT_FILE_NAMEargument of theGENERATE_EXPORT_HEADERcommand. For example,EXPORT_FILE_NAME ${CMAKE_BINARY_DIR}/some_header.h.