diff --git a/actions/CMakeLists.txt b/actions/CMakeLists.txt index d5666f1d615d35ea96ca2bfd9602f59fb2451fb1..90f98aa6c1a51439f859649a864205f60ce0b5aa 100644 --- a/actions/CMakeLists.txt +++ b/actions/CMakeLists.txt @@ -1,6 +1,6 @@ add_custom_target(actions ALL) +add_subdirectory(tests) + pm_action_init() pm_action(pm-build-rawmodel actions) pm_action(pm-help actions) - -add_subdirectory(tests) diff --git a/cmake_support/doc/index.rst b/cmake_support/doc/index.rst index cc3b70234db4bb62681ae41aad44b85074548a42..368f4b1c8656de76896f27a6ff0e509add08ae03 100644 --- a/cmake_support/doc/index.rst +++ b/cmake_support/doc/index.rst @@ -26,7 +26,7 @@ into three categories of varying relevance for you: Best practices for using our home-brew |cmake| functions are found in the various :file:`CMakeLists.txt` files in the project's directory tree. -Functions For Module Maintenance +Functions For Module/ Action Maintenance -------------------------------------------------------------------------------- Unit Tests @@ -54,7 +54,8 @@ Unit Tests ``MODULE`` Specify the name of the module these tests are made for. Needs to be set, - needs to be a single word. + needs to be a single word. Ends up in ``make help`` as a prefix, nothing + will break if it does not match the name of any existing module. ``Sources`` Describe a set of files hosting unit test code here. If its a wild mix of @@ -80,10 +81,36 @@ Unit Tests ``TARGET`` This defines an additional dependency for the unit test. +Actions +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +.. cmake:command:: pm_action + + .. code-block:: cmake + + pm_action(ACTION action-script + TARGET target) + + Add an action to |project|. Actions are scripts called by the ``pm`` launcher + and should all live in the :file:`actions` directory as executable files. + Adding an action means connecting its file with the given target to be copied + to the :file:`libexec` directory. No dedicated ``make`` target will be + created. + + The parameters are: + + ``ACTION`` + Name of the action to be added. Should start with ``pm-``. Needs to be an + existing file in the same directory as the invoking :file:`CMakeLists.txt`. + + ``TARGET`` + Provide a ``make`` target to trigger copying the action's script file. The + target has to be created **before** any action may be attached to it. + .. Finding packages .. ----------------- .. Extending |cmake| .. ----------------- -.. LocalWords: cmake PROMOD +.. LocalWords: cmake PROMOD CMakeLists txt promod unittest codetest xml py +.. LocalWords: libexec