I have projects structured like this:
Libs/
Apps1/
Apps2/
In each folder is located CMakeLists.txt. I would like to generate a project file for each of the folders, and each one AppsNrefers to Libs. My way to do this is by invoking CMake add_subdirectory(../Libs/Source/LibN), etc.
Now that I do this, CMake says that it add_subdirectoryshould specify a unique absolute path for the binary output folder.
See this post:
Xcode dependencies on different build directories?
Xcode cannot handle dependencies when the assembly output folder is unique to each target. He needs one folder. And CMake does this by default, it simply refuses when the folder is not subdir.
I tried changing and changing the output path after creating the target. This will create objects in the output folder, Xcode will see them, but all links to this target in the CMake script will use a unique path.
Suggested solutions:
- include project files in
App1/Projects/Subdirand duplicate projects in an irrelevant place - reorganize my folders to a shared parent folder to avoid this CMake madness, which presents some security issues for me (as some drives are not public)
- never refer to a target with your CMake name, use a common path name instead. Not sure how to do it right.
- try to make it fixed on the CMake side somehow
- go to the wise
source
share