lloyd / yajl

A fast streaming JSON parsing library in C.
http://lloyd.github.com/yajl
ISC License
2.15k stars 435 forks source link

"no BUNDLE DESTINATION for MACOSX_BUNDLE " when building for iOS #201

Open amosjoshua opened 6 years ago

amosjoshua commented 6 years ago

When building for iOS using polly and the toolchain that comes with xcode 9.1 I see the following error:

CMake Error at verify/CMakeLists.txt:37 (INSTALL):
  INSTALL TARGETS given no BUNDLE DESTINATION for MACOSX_BUNDLE executable
  target "json_verify".

This is caused by INSTALL(TARGETS json_reformat RUNTIME DESTINATION bin) in reformatter/CMakeLists.txt, which is relying on CMP0006's OLD behavior to get around the missing BUNDLE DESTINATION bin.

It can be fixed either by modifying the line to read INSTALL(TARGETS json_reformat RUNTIME DESTINATION bin) BUNDLE DESTINATION bin or by explicitly setting CMAKE_POLICY(SET CMP0006 OLD) in yajl/CMakeLists.txt.

The most correct solution is probably the former. Verify/CMakeLists.txt suffers from the same problem and must be corrected as well if the first solution is used.

amosjoshua commented 6 years ago

For reference: CMP0006

iradization commented 2 years ago

Hi, I wonder how did you overcome this problem. Perhaps you can share the cmake line where you define BUNDLE DESTINATION, I've tried to specify explicitly in install command but it didn't work.

install(
    TARGETS ${target}
    BUNDLE DESTINATION blabla)
melroy89 commented 2 years ago

Something like this maybe?

install(TARGETS ${target} RUNTIME DESTINATION . BUNDLE DESTINATION ${CMAKE_SOURCE_DIR})