1CMP0098 2------- 3 4.. versionadded:: 3.17 5 6:module:`FindFLEX` runs ``flex`` in directory 7:variable:`CMAKE_CURRENT_BINARY_DIR` when executing. 8 9The module provides a ``FLEX_TARGET`` macro which generates FLEX output. 10In CMake 3.16 and below the macro would generate a custom command that runs 11``flex`` in the current source directory. CMake 3.17 and later prefer to 12run it in the build directory and use :variable:`CMAKE_CURRENT_BINARY_DIR` 13as the ``WORKING_DIRECTORY`` of its :command:`add_custom_command` invocation. 14This ensures that any implicitly generated file is written relative to the 15build tree rather than the source tree, unless the generated file is 16provided as absolute path. 17 18This policy provides compatibility for projects that have not been updated 19to expect the new behavior. 20 21The ``OLD`` behavior for this policy is for ``FLEX_TARGET`` to use 22the current source directory for the ``WORKING_DIRECTORY`` and where 23to generate implicit files. The ``NEW`` behavior of this policy is to 24use the current binary directory for the ``WORKING_DIRECTORY`` relative to 25which implicit files are generated unless provided as absolute path. 26 27This policy was introduced in CMake version 3.17. Use the 28:command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly. 29Unlike many policies, CMake version |release| does *not* warn 30when this policy is not set and simply uses ``OLD`` behavior. 31 32.. include:: DEPRECATED.txt 33