cmake output dir different to

已完成

Hi all. I'm currently trialing CLion as an alternative to VS Code on Windows and have hit a bit of a stumbling block. Currently running cmake from the command line yeilds Debug and Release output folders + the Visual Studio project files. When running cmake via CLion the Debug and Release folders are not created nor are the Visual Studio project files.

 

The project in question is a submodule for a larger project and the sudden change in output directory is breaking the outer build. Plus losing the generation of the Visual Studio project files is unfortunate since it has excellent code profiling tools.

 

When we perform the submodule build we set a variable containing the output directory so that the outer build can find the debug and release libs to link against, however as far as I am aware CMAKE provides no way to know if the build directory was in a Debug / Release subfolder or not so currently in the outer project we use this variable set by the submodule and slap either Debug or Release onto the end in order to link against the submodule libs.

 

Is there any way to make CLion give the stock cmake experience? Or is there an alternative strategy that we could employ? I don't want to break my ability to run via the command line so removing the expected Debug / Release subfolders in the outer project won't work.

0
Avatar
Permanently deleted user

Solved the issue by using the sub projects target name in the parent projects cmake call to target_link_libraries().

0

Just in case: you can change build directory in File | Settings | Build, Execution, Deployment | CMake (https://www.jetbrains.com/help/clion/configuring-cmake.html#Advanced).

0

请先登录再写评论。