CMake generate .lib and .exp for an executable

This topic is 1181 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

Recommended Posts

Hi,

I use cmake and all works fine but when I compile my visual studio project generated by cmake using add_executable I got a folder "Release/" with inside a .lib and a .exp file.

How set CMake to not generate them and only have the .exe ?

Thanks for the help

Edited by Alundra

Share on other sites

As far as I know you can't. But also, why would you want to? Remember: The build output directory is not an install/package directory.

Share on other sites

Finally I found a good solution :

set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_CURRENT_SOURCE_DIR}/bin) set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG${CMAKE_CURRENT_SOURCE_DIR}/bin)
set(CMAKE_DEBUG_POSTFIX "_Debug")

Like that, the .exe is compiled in "bin" folder and in "build" folder I have the visual studio project + the generated .lib + .exp.