Following CMakeLists.txt produces "wrong-target" in Projects Tool View: # ===== BEGIN ===== cmake_minimum_required(VERSION 2.8) project(bug_demo) function(Executable name) set_property(DIRECTORY APPEND PROPERTY ${name}_EXE_SOURCES ${ARGN}) get_property(sources DIRECTORY PROPERTY ${name}_EXE_SOURCES) # Using of ADD_LIBRARY() instead of ADD_EXECUTABLE() adds a valid target (but without source files attached to it): #add_library(${name} ${sources}) add_executable(${name} ${sources}) endfunction(Executable) Executable(wrong_target_bug main.cpp) # ===== END ===== main.cpp may be any hello-world sample: #include <iostream> int main(int argc, char **argv) { std::cout << "Hello, world!" << std::endl; return 0; } Reproducible: Always Steps to Reproduce: 1. Create project with specified CMakeLists.txt and main.cpp 2. Look at Project Tool View Actual Results: "|wrong-target" displayed Expected Results: target named "bug_demo" Looks similiar to bug 293750, but is more general and different/simple way to reproduce. As written in comments, using of ADD_LIBRARY() instead of ADD_EXECUTABLE() adds a valid target (but without source files attached to it)
"wrong_target_bug" in "Executable(wrong_target_bug main.cpp)" should be replaced by "bug_demo", of course
Git commit 866d099e05ec5c4d0c9c02a715fd9e351260d753 by Aleix Pol. Committed on 12/09/2012 at 03:24. Pushed by apol into branch '4.4'. Improve properties fetching In case it's a directory property and the directory is not specified, use the cmake_current_source_dir value as the directory. M +33 -19 projectmanagers/cmake/parser/cmakeprojectvisitor.cpp http://commits.kde.org/kdevelop/866d099e05ec5c4d0c9c02a715fd9e351260d753
Git commit 74825d9cc9baaccf60ba366750971c0d13278fcf by Aleix Pol. Committed on 12/09/2012 at 03:24. Pushed by apol into branch 'master'. Improve properties fetching In case it's a directory property and the directory is not specified, use the cmake_current_source_dir value as the directory. M +33 -19 projectmanagers/cmake/parser/cmakeprojectvisitor.cpp http://commits.kde.org/kdevelop/74825d9cc9baaccf60ba366750971c0d13278fcf