Let's assume you have 3 sub-projects under project A.
- Subproject A1
- Subproject A2
- Subproject A3
As per your question my understanding is, if code changes are done under A2 folder then build only sub-project A2 but not A1 and A3.
You can set up 3 Jenkins jobs for Sub-projects A1, A2 and A3. Then, set up the parent job which compromises of these 3 jobs as child jobs with Multi-job configuration.
Another option:
You can set up a single job with project A and you need to evaluate folders by using the execute commands shell. But, this is complex and not a preferred option.