CMakeLists.txt 1.2 KB

123456789101112131415161718192021222324252627282930313233343536
  1. add_custom_command(
  2. OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/randomResourceFile.plist"
  3. COMMAND /bin/cp
  4. ARGS "${BundleTest_SOURCE_DIR}/randomResourceFile.plist.in"
  5. "${CMAKE_CURRENT_BINARY_DIR}/randomResourceFile.plist")
  6. set_source_files_properties(
  7. "${CMAKE_CURRENT_BINARY_DIR}/randomResourceFile.plist"
  8. PROPERTIES
  9. MACOSX_PACKAGE_LOCATION Resources
  10. )
  11. set_source_files_properties(
  12. "${BundleTest_SOURCE_DIR}/SomeRandomFile.txt"
  13. "${BundleTest_SOURCE_DIR}/../../README.rst"
  14. PROPERTIES
  15. MACOSX_PACKAGE_LOCATION MacOS
  16. )
  17. add_executable(SecondBundle
  18. MACOSX_BUNDLE
  19. "${BundleTest_SOURCE_DIR}/BundleTest.cxx"
  20. "${BundleTest_SOURCE_DIR}/SomeRandomFile.txt"
  21. "${BundleTest_SOURCE_DIR}/../../README.rst"
  22. "${CMAKE_CURRENT_BINARY_DIR}/randomResourceFile.plist"
  23. )
  24. target_link_libraries(SecondBundle BundleTestLib)
  25. # Test bundle installation.
  26. install(TARGETS SecondBundle DESTINATION Applications)
  27. # Test whether bundles respect the output name. Since the library is
  28. # installed into a location that uses this output name this will fail if the
  29. # bundle does not respect the name. Also the executable will not be found by
  30. # the test driver if this does not work.
  31. set_target_properties(SecondBundle PROPERTIES OUTPUT_NAME SecondBundleExe)