Issue
I have a C++ project source code with several dependencies (C++ packages, compiled libs and source). I need to create a CMake file which will generate the Visual Studio solution and projects files in such a way that if I put a break point in one of the dependencies source code, the execution of the main project in debug mode would break and debug at that break point in the dependency. Any suggestion is highly appreciated.
[EDIT]
If I use the packages, with the provided ...config.cmake files, the source files are not included in the generated project.
If I generate the MS projects individually and use include_external_msproject
to put them together in a solution, I have the source code, but it is executed from somewhere else (binaries), so my breakpoints are ignored.
On the other hand, there is overlap from duplicated targets, like DOCUMENTATION
for example, which come from each dependency, if I want to use add_subdirectory
to add the deps to the main project
Solution
I ended up modifying the dependencies so that they implement unique target names for documentation, but if built individually to create the original named target: DOCUMENTATION.
doxygen_add_docs(DOCUMENTATION_${PROJECT_NAME}
doc
src/component
)
if (NOT (TARGET DOCUMENTATION))
add_custom_target(DOCUMENTATION COMMENT "workaround for multi-dependencies project")
add_dependencies(DOCUMENTATION DOCUMENTATION_${PROJECT_NAME})
endif()
Answered By - Dan Ionescu Answer Checked By - Pedro (WPSolving Volunteer)