Debugging / running executable files in cmake / Visual Studio project

We are moving from managed Visual Studio projects to the cmake platform.

We opened the solution file, select the project as "Startup Target" and press Ctrl + F5 or F5 debug or run.

Cmake now has this installation concept. This requires me to start the installation. But there are no installed executable files in the installation project, so it cannot be used to start debugging.

If I install my executable project as a launch target, then the installation will not start, so I cannot debug it.

I am sure there is a better way to do this.

Any ideas?

+3
source share
1 answer

INSTALL, . , ( ADD_EXECUTABLE CMakeLists.txt), F5 Ctrl + F5.

, , . CMake CMakeLists.txt.

   SET(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/Bin/${CMAKE_BUILD_TYPE} CACHE PATH "Library output path")
   SET(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/Bin/${CMAKE_BUILD_TYPE} CACHE PATH "Executable output path")

, , : , CMake Visual Studio

+5

Source: https://habr.com/ru/post/1740930/


All Articles