Bug 281565 - Can not compile single file from subdirectory
Summary: Can not compile single file from subdirectory
Status: RESOLVED FIXED
Alias: None
Product: kdevelop
Classification: Applications
Component: Build tools: CMake (show other bugs)
Version: git master
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: 4.2.3
Assignee: kdevelop-bugs-null
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-07 16:54 UTC by Sergey Vidyuk
Modified: 2011-11-02 22:23 UTC (History)
1 user (show)

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


Attachments
Example project (786 bytes, application/x-compressed-tar)
2011-09-07 16:54 UTC, Sergey Vidyuk
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sergey Vidyuk 2011-09-07 16:54:40 UTC
Created attachment 63487 [details]
Example project

Version:           git master (using KDE 4.7.0) 
OS:                Linux

Attempt to compile single file fails if file is located in a subdirectory added to a main project using cmake add_subdirectory() function. Make is executed in wrong folder.

Reproducible: Always

Steps to Reproduce:
1 Open a project attached
2 Modify timestamp on foo/bar2.cpp
3 Remove everything from "Project selection"
4 Add foo/bar2.cpp to Project selection
5 Pres F8 or "Build selection" button

Actual Results:  
Got the following output in build toolview:
/home/vestnik/Development/test/kdev4bug/build> make bar2.o
make: *** No rule to make target `bar2.o'.  Stop.
*** Failed ***

Expected Results:  
"make bar.o" command should be executed from the "foo" subdirectory of the build tree instead of root of the build tree and should compile bar2.cpp successfully.
Comment 1 Aleix Pol 2011-09-12 02:43:09 UTC
Git commit 5ff08ca46fea2c9e9b263f155dda68aeb3eb4412 by Aleix Pol.
Committed on 12/09/2011 at 04:40.
Pushed by apol into branch 'master'.

Make it possible again to compile just one file, use CMakeFolderItem
instead of ProjectFolderItem to pass the relative path.

BUG: 281565

M  +8    -6    projectbuilders/cmakebuilder/cmakebuilder.cpp

http://commits.kde.org/kdevelop/5ff08ca46fea2c9e9b263f155dda68aeb3eb4412
Comment 2 Mateusz Loskot 2011-11-02 22:23:41 UTC
Follow-up mine and Aleix discussion on #kdevelop,
I can reproduce the same problem wiht version 4.2.2 (installed from Linux Mint 11 packages)