[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kdevelop-bugs
Subject:    [Bug 309257] New: "wrong-target" for a add_executable() constructed with foreach()
From:       Vasiliy Yeremeyev <vayerx () gmail ! com>
Date:       2012-10-30 15:04:53
Message-ID: bug-309257-40295 () http ! bugs ! kde ! org/
[Download RAW message or body]

https://bugs.kde.org/show_bug.cgi?id=309257

            Bug ID: 309257
          Severity: normal
           Version: 4.4.0
          Priority: NOR
          Assignee: kdevelop-bugs@kdevelop.org
           Summary: "wrong-target" for a add_executable() constructed with
                    foreach()
    Classification: Unclassified
                OS: Linux
          Reporter: vayerx@gmail.com
          Hardware: Other
            Status: UNCONFIRMED
         Component: Build tools: CMake
           Product: kdevelop

Following CMakeLists.txt produces "wrong-target" in Projects Tool View:

# ===== BEGIN =====
cmake_minimum_required(VERSION 2.8)
project(bug_demo)

function(Executable name)
    foreach (arg IN ITEMS "${ARGN}")
        set_property(DIRECTORY APPEND PROPERTY ${name}_EXE_SOURCES "${arg}")
    endforeach()
    # set_property(DIRECTORY APPEND PROPERTY ${name}_EXE_SOURCES "${ARGN}")

    get_property(sources DIRECTORY PROPERTY ${name}_EXE_SOURCES)
    add_executable(${name} ${sources})
endfunction(Executable)

Executable(bug_demo 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"

Valid target is displayed if property is initialized with explicit list
(commented line) without/after foreach(). But this approach dramatically
reduces abilities of per-file customizations of cmake script.
This bug is a sequel of bug 306600.

-- 
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
KDevelop-bugs mailing list
KDevelop-bugs@kdevelop.org
https://barney.cs.uni-potsdam.de/mailman/listinfo/kdevelop-bugs

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic