CMakeLists.txt 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. project(BundleSubDir)
  2. add_custom_command(
  3. OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/randomResourceFile.plist"
  4. COMMAND /bin/cp
  5. ARGS "${BundleTest_SOURCE_DIR}/randomResourceFile.plist.in"
  6. "${CMAKE_CURRENT_BINARY_DIR}/randomResourceFile.plist")
  7. set_source_files_properties(
  8. "${CMAKE_CURRENT_BINARY_DIR}/randomResourceFile.plist"
  9. PROPERTIES
  10. MACOSX_PACKAGE_LOCATION Resources
  11. )
  12. set_source_files_properties(
  13. "${BundleTest_SOURCE_DIR}/SomeRandomFile.txt"
  14. "${BundleTest_SOURCE_DIR}/../../README.rst"
  15. PROPERTIES
  16. MACOSX_PACKAGE_LOCATION MacOS
  17. )
  18. add_executable(SecondBundle
  19. MACOSX_BUNDLE
  20. "${BundleTest_SOURCE_DIR}/BundleTest.cxx"
  21. "${BundleTest_SOURCE_DIR}/SomeRandomFile.txt"
  22. "${BundleTest_SOURCE_DIR}/../../README.rst"
  23. "${CMAKE_CURRENT_BINARY_DIR}/randomResourceFile.plist"
  24. )
  25. target_link_libraries(SecondBundle BundleTestLib)
  26. # Test bundle installation.
  27. install(TARGETS SecondBundle DESTINATION Applications)
  28. # Test whether bundles respect the output name. Since the library is
  29. # installed into a location that uses this output name this will fail if the
  30. # bundle does not respect the name. Also the executable will not be found by
  31. # the test driver if this does not work.
  32. set_target_properties(SecondBundle PROPERTIES
  33. OUTPUT_NAME SecondBundleExe
  34. XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY ""
  35. XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED "NO"
  36. )
  37. # Express one app bundle in terms of another's SOURCES to verify that
  38. # the generators do not expose the Info.plist of one to the other.
  39. add_executable(SubdirBundle1 MACOSX_BUNDLE EXCLUDE_FROM_ALL ../BundleTest.cxx)
  40. add_executable(SubdirBundle2 MACOSX_BUNDLE EXCLUDE_FROM_ALL $<TARGET_PROPERTY:SubdirBundle1,SOURCES>)