From 7415a410e11452e72c3cbbde42cb2a45c3178a1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sat, 4 Jun 2016 23:04:25 +0200 Subject: [PATCH] modules: updated FindCorrade.cmake. --- modules/FindCorrade.cmake | 71 +++++++++++++++++++++++++++++++-------- 1 file changed, 57 insertions(+), 14 deletions(-) diff --git a/modules/FindCorrade.cmake b/modules/FindCorrade.cmake index c4af7f726..03285cb4f 100644 --- a/modules/FindCorrade.cmake +++ b/modules/FindCorrade.cmake @@ -73,7 +73,9 @@ # CORRADE_TARGET_UNIX - Defined if compiled for some Unix flavor # (Linux, BSD, OS X) # CORRADE_TARGET_APPLE - Defined if compiled for Apple platforms -# CORRADE_TARGET_IOS - Defined if compiled for iOS +# CORRADE_TARGET_IOS - Defined if compiled for iOS (device or +# simulator) +# CORRADE_TARGET_IOS_SIMULATOR - Defined if compiled for iOS Simulator # CORRADE_TARGET_WINDOWS - Defined if compiled for Windows # CORRADE_TARGET_WINDOWS_RT - Defined if compiled for Windows RT # CORRADE_TARGET_NACL - Defined if compiled for Google Chrome Native @@ -97,6 +99,7 @@ # CORRADE_USE_MODULE - Path to UseCorrade.cmake module (included # automatically) # CORRADE_TESTSUITE_XCTEST_RUNNER - Path to XCTestRunner.mm.in file +# CORRADE_TESTSUITE_ADB_RUNNER - Path to AdbRunner.sh file # CORRADE_PEDANTIC_COMPILER_OPTIONS - List of pedantic compiler options used # for targets with :prop_tgt:`CORRADE_USE_PEDANTIC_FLAGS` enabled # CORRADE_PEDANTIC_COMPILER_DEFINITIONS - List of pedantic compiler @@ -120,13 +123,21 @@ # # corrade_add_test( # ... -# [LIBRARIES ...]) +# [LIBRARIES ...] +# [FILES ...]) # # Test name is also executable name. You can also specify libraries to link # with instead of using :command:`target_link_libraries()`. # ``Corrade::TestSuite`` target is linked automatically to each test. Note # that the :command:`enable_testing()` function must be called explicitly. # +# You can list files needed by the test in the `FILES` section. The filenames +# are treated relatively to `CMAKE_CURRENT_SOURCE_DIR`. On desktop platforms +# the files are added to the :prop_test:`REQUIRED_FILES` target property. On +# Emscripten they are bundled to the executable and available in the virtual +# filesystem root. On Android they are copied along the executable to the +# target. +# # Unless :variable:`CORRADE_TESTSUITE_TARGET_XCTEST` is set, test cases on iOS # targets are created as bundles with bundle identifier set to CMake project # name by default. Use the cache variable :variable:`CORRADE_TESTSUITE_BUNDLE_IDENTIFIER_PREFIX` @@ -152,37 +163,60 @@ # Add dynamic plugin:: # # corrade_add_plugin( -# +# ";" +# ";" # # ...) # # The macro adds preprocessor directive ``CORRADE_DYNAMIC_PLUGIN``. Additional # libraries can be linked in via :command:`target_link_libraries(plugin_name ...) `. -# If ```` is set to :variable:`CMAKE_CURRENT_BINARY_DIR` -# (e.g. for testing purposes), the files are copied directly, without the need -# to perform install step. Note that the files are actually put into -# configuration-based subdirectory, i.e. ``${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}``. -# See documentation of :variable:`CMAKE_CFG_INTDIR` variable for more -# information. +# On DLL platforms, the plugin DLLs and metadata files are put into +# ````/```` and the +# ``*.lib`` files into ````/````. +# On non-DLL platforms everything is put into ````/ +# ````. +# +# corrade_add_plugin( +# +# +# +# ...) +# +# Unline the above version this puts everything into ```` on +# both DLL and non-DLL platforms. If ```` is set to +# :variable:`CMAKE_CURRENT_BINARY_DIR` (e.g. for testing purposes), the files +# are copied directly, without the need to perform install step. Note that the +# files are actually put into configuration-based subdirectory, i.e. +# ``${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}``. See documentation of +# :variable:`CMAKE_CFG_INTDIR` variable for more information. # # .. command:: corrade_add_static_plugin # # Add static plugin:: # # corrade_add_static_plugin( -# +# ";" # # ...) # # The macro adds preprocessor directive ``CORRADE_STATIC_PLUGIN``. Additional # libraries can be linked in via :command:`target_link_libraries(plugin_name ...) `. +# The ```` is ignored and included just for compatibility +# with the :command:`corrade_add_plugin` command, everything is installed into +# ````. Note that plugins built in debug configuration +# (e.g. with :variable:`CMAKE_BUILD_TYPE` set to ``Debug``) have ``"-d"`` +# suffix to make it possible to have both debug and release plugins installed +# alongside each other. +# +# corrade_add_static_plugin( +# +# +# ...) +# +# Equivalent to the above with ```` set to ````. # If ```` is set to :variable:`CMAKE_CURRENT_BINARY_DIR` (e.g. for # testing purposes), no installation rules are added. # -# Note that plugins built in debug configuration (e.g. with :variable:`CMAKE_BUILD_TYPE` -# set to ``Debug``) have ``"-d"`` suffix to make it possible to have both debug -# and release plugins installed alongside each other. -# # .. command:: corrade_find_dlls_for_libs # # Find corresponding DLLs for library files:: @@ -248,6 +282,7 @@ set(_corradeFlags TARGET_UNIX TARGET_APPLE TARGET_IOS + TARGET_IOS_SIMULATOR TARGET_WINDOWS TARGET_WINDOWS_RT TARGET_NACL @@ -271,6 +306,13 @@ if(CORRADE_TESTSUITE_TARGET_XCTEST) set(CORRADE_TESTSUITE_XCTEST_RUNNER_NEEDED CORRADE_TESTSUITE_XCTEST_RUNNER) endif() +# ADB runner file +if(CORRADE_TARGET_ANDROID) + find_file(CORRADE_TESTSUITE_ADB_RUNNER AdbRunner.sh + PATH_SUFFIXES share/corrade/TestSuite) + set(CORRADE_TESTSUITE_ADB_RUNNER_NEEDED CORRADE_TESTSUITE_ADB_RUNNER) +endif() + # CMake module dir find_path(_CORRADE_MODULE_DIR NAMES UseCorrade.cmake CorradeLibSuffix.cmake @@ -459,6 +501,7 @@ find_package_handle_standard_args(Corrade REQUIRED_VARS _CORRADE_MODULE_DIR _CORRADE_CONFIGURE_FILE ${CORRADE_TESTSUITE_XCTEST_RUNNER_NEEDED} + ${CORRADE_TESTSUITE_ADB_RUNNER_NEEDED} HANDLE_COMPONENTS) # Finalize the finding process