Hacker News new | ask | show | jobs
by fetbaffe 2101 days ago
If I remember correctly I never figured out how to get the target in a subfolder, you need the target to your dependencies.
1 comments

I don't understand. To do that you just need to pass the subdir with your CMakeLists.txt to add_subdirectory(). Exactly which problems did you experienced?
Looking at it now, I wanted to copy files into the build folder after build step was done with add_custom_command() with copy_if_different and with target TARGET <project> POST_BUILD, but when I would put that in a subdirectory it wouldn't work because there was no target.

   add_custom_command(TARGET project POST_BUILD
        COMMAND ${CMAKE_COMMAND} -E copy_if_different
        some.dll
        $<TARGET_FILE_DIR:project>)