CMake generate .lib and .exp for an executable

Started by
1 comment, last by Alundra 9 years, 4 months ago

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

Advertisement

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.

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.

This topic is closed to new replies.

Advertisement