You should use the target in the main build as well. Using the path will just embed the build-time path into your package. Note that ExternalProject_add doesn’t mix well with add_library in the same project. Generally, you would want each project to build “on its own” and have a “superbuild” that does ExternalProject_add to coordinate building each component in order and passing the relevant information between them.