Imported targets fail to be added to the FOLDER property.

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Imported targets fail to be added to the FOLDER property.

Albrecht Fritzsche



is there a way to add an imported target to the IDE similar to the way eg executable targets are added?


In the following code the last line seems to have no effect, ie when opening the generated Visual Studio solution neither the helloWorld.cpp nor the folder “tests” is shown



set(target_name Hello)

add_executable(${target_name} IMPORTED)

set_property(TARGET ${target_name} PROPERTY IMPORTED_LOCATION "${CMAKE_SOURCE_DIR}/helloWorld.cpp")

set_property(TARGET ${target_name} PROPERTY FOLDER "tests")


Any idea how I can add this imported target to some folder of the IDE?




This email message is for the sole use of the intended recipient(s) and may contain confidential information.  Any unauthorized review, use, disclosure or distribution is prohibited.  If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message.


Powered by

Please keep messages on-topic and check the CMake FAQ at:

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support:
CMake Consulting:
CMake Training Courses:

Visit other Kitware open-source projects at

Follow this link to subscribe/unsubscribe: