[CMake] Imported targets fail to be added to the FOLDER property.

Albrecht Fritzsche afritzsche at nvidia.com
Wed Dec 5 12:16:06 EST 2018


Hi,

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_property(GLOBAL PROPERTY USE_FOLDERS ON)
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?

Thanks,
Ali

-----------------------------------------------------------------------------------
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.
-----------------------------------------------------------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://cmake.org/pipermail/cmake/attachments/20181205/39da32a8/attachment.html>


More information about the CMake mailing list