Bug 203975 - KDevelop doesn't honor CMAKE_RUNTIME_OUTPUT_DIRECTORY when launching executables
Summary: KDevelop doesn't honor CMAKE_RUNTIME_OUTPUT_DIRECTORY when launching executables
Status: REOPENED
Alias: None
Product: kdevelop
Classification: Applications
Component: Build tools: CMake (show other bugs)
Version: git master
Platform: openSUSE Linux
: VHI normal
Target Milestone: 4.0.0
Assignee: kdevelop-bugs-null
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-08-15 19:19 UTC by Alexander
Modified: 2023-08-16 08:19 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
A test project (42.90 KB, application/bzip2)
2009-09-15 21:47 UTC, Alexander
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander 2009-08-15 19:19:47 UTC
Version:           SVN (using KDE 4.3.0)
Compiler:          gcc 4.3.2 
OS:                Linux
Installed from:    SuSE RPMs

I'm using the following in my CMakeLists.txt

# output binaries to <builddir>/bin
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin)

I have set the Project Target in "Run -> Configure Launches". However, when I press "Execute current launch", I get:
Could not start program ''. Make sure that the path is specified correctly.

Note that if I remove the CMAKE_RUNTIME_OUTPUT_DIRECTORY stuff, the program launches correctly.
Comment 1 Aleix Pol 2009-09-11 18:05:42 UTC
SVN commit 1022366 by apol:

Let the cmake scripts set where the binaries are located.

BUG: 203975


 M  +19 -3     cmakemanager.cpp  
 M  +8 -2      cmakemodelitems.cpp  
 M  +10 -3     cmakemodelitems.h  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1022366
Comment 2 Alexander 2009-09-15 21:16:08 UTC
Sorry, but it's still not fixed for me with yesterday's SVN.

Trying to debug an application says:
--------------------------------------------------------------------------
Application does not exist
The application you are trying to debug,
qclient 
does not exist. Check that you have specified the right application in the debugger configuration.
--------------------------------------------------------------------------

Trying to execute it says:
--------------------------------------------------------------------------
Could not start program ''. Make sure that the path is specified correctly.
--------------------------------------------------------------------------


Maybe I should note that I have the following project layout:

<project_dir>/CMakeLists.txt:
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin)
add_subdirectory(qclient)
... # (other subdirectories, flags, etc...)

<project_dir>/qclient/CMakeLists.txt:
add_executable(qclient ...


I have specified the "Project target" in Launch Configurations as "qclient/qclient".
Comment 3 Aleix Pol 2009-09-15 21:31:11 UTC
Can you send me an example so that I can verify?

Thanks,
Aleix
Comment 4 Alexander 2009-09-15 21:47:47 UTC
Created attachment 36974 [details]
A test project
Comment 5 Alexander 2009-09-15 21:49:43 UTC
I attached a complete tree (including a build directory) of a (stripped-down) project that inhibits the problematic behavior.
Thanks
Comment 6 Aleix Pol 2009-11-16 00:18:34 UTC
The symptom is correct, the bug is incorrect.

We're lacking the PROJECT_BINARY_DIR variable right now. I'll look into it right now.
Comment 7 Aleix Pol 2009-11-16 01:03:23 UTC
SVN commit 1049852 by apol:

Added PROJECT_ variables relative to the binary dir.
Resolve the possible output directories.

BUG: 203975


 M  +10 -6     cmakemanager.cpp  
 M  +3 -1      parser/cmakeprojectvisitor.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1049852
Comment 8 Jeremy W. Murphy 2018-03-22 22:58:09 UTC
I am hitting this problem in the git master of KDevelop 5. We have the same project layout to the original report and are seeing the same symptom.

We're running the AppImage on CentOS 6.8 with CMake 3.6.