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