I'm using CMake 3.6.1 and Xcode 8. I'm attempting to build cryptopp 5.6.5.
When attempting to build the static or shared library using cmake with the Xcode generator, the library itself is never created. The shared target fails due to the missing output file at some point while the static target claims to succeed despite the same lack of output.
It appears to be caused by (at least for CMake >= 2.8.8) the shared and static library targets having only object files as input. According to the documentation for cmake's add_library:
Some native build systems may not like targets that have only object files, so consider adding at least one real source file to any target that references $<TARGET_OBJECTS:objlib>.
It would seem this is the case for Xcode. I see several options:
- You tell me you don't care about Xcode (or any other affected generators), in which case I'll maintain a patch locally.
- Applying the workaround suggested in the documentation. This could be done by creating an empty source file in the build directory and adding it to the target. A small and fairly local fix but hacky and perhaps even fragile.
- The use of an intermediate objects target is made optional (rather than defined purely by the CMake version used) so it can be disabled manually in case of issues. This is my personal favorite. I would attach a patch for it but I'm having too much fun with the line endings. I'll try again tomorrow.
I'm using CMake 3.6.1 and Xcode 8. I'm attempting to build cryptopp 5.6.5.
When attempting to build the static or shared library using cmake with the Xcode generator, the library itself is never created. The shared target fails due to the missing output file at some point while the static target claims to succeed despite the same lack of output.
It appears to be caused by (at least for CMake >= 2.8.8) the shared and static library targets having only object files as input. According to the documentation for cmake's add_library:
It would seem this is the case for Xcode. I see several options: