diff options
152 files changed, 812 insertions, 298 deletions
diff --git a/Auxiliary/vim/syntax/cmake.vim b/Auxiliary/vim/syntax/cmake.vim index 0676f7e..2d63eb0 100644 --- a/Auxiliary/vim/syntax/cmake.vim +++ b/Auxiliary/vim/syntax/cmake.vim @@ -170,6 +170,7 @@ syn keyword cmakeProperty contained \ FRAMEWORK_VERSION \ Fortran_FORMAT \ Fortran_MODULE_DIRECTORY + \ Fortran_PREPROCESS \ GENERATED \ GENERATOR_FILE_NAME \ GENERATOR_IS_MULTI_CONFIG @@ -1019,6 +1020,7 @@ syn keyword cmakeVariable contained \ CMAKE_Fortran_MODULE_DIRECTORY \ CMAKE_Fortran_OUTPUT_EXTENSION \ CMAKE_Fortran_PLATFORM_ID + \ CMAKE_Fortran_PREPROCESS \ CMAKE_Fortran_SIMULATE_ID \ CMAKE_Fortran_SIMULATE_VERSION \ CMAKE_Fortran_SIZEOF_DATA_PTR diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index 7983be1..3006214 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -11,11 +11,11 @@ Community CMake is maintained and supported by `Kitware`_ and developed in collaboration with a productive community of contributors. -Please subscribe and post to the `CMake Developers List`_ to raise +Please post to the ``Development`` category of the `CMake Forum`_ to raise discussion of development topics. .. _`Kitware`: http://www.kitware.com/cmake -.. _`CMake Developers List`: https://cmake.org/mailman/listinfo/cmake-developers +.. _`CMake Forum`: https://discourse.cmake.org Patches ======= diff --git a/Help/command/cmake_command.rst b/Help/command/cmake_language.rst index 08b7832..21f51a0 100644 --- a/Help/command/cmake_command.rst +++ b/Help/command/cmake_language.rst @@ -1,5 +1,5 @@ -cmake_command -------------- +cmake_language +-------------- Call meta-operations on CMake commands. @@ -8,8 +8,8 @@ Synopsis .. parsed-literal:: - cmake_command(`INVOKE`_ <command> [<args>...]) - cmake_command(`EVAL`_ CODE <code>...) + cmake_language(`CALL`_ <command> [<args>...]) + cmake_language(`EVAL`_ CODE <code>...) Introduction ^^^^^^^^^^^^ @@ -17,24 +17,24 @@ Introduction This command will call meta-operations on built-in CMake commands or those created via the :command:`macro` or :command:`function` commands. -``cmake_command`` does not introduce a new variable or policy scope. +``cmake_language`` does not introduce a new variable or policy scope. -Invoking Commands -^^^^^^^^^^^^^^^^^ +Calling Commands +^^^^^^^^^^^^^^^^ -.. _INVOKE: +.. _CALL: .. code-block:: cmake - cmake_command(INVOKE <command> [<args>...]) + cmake_language(CALL <command> [<args>...]) -Invokes the named ``<command>`` with the given arguments (if any). +Calls the named ``<command>`` with the given arguments (if any). For example, the code: .. code-block:: cmake set(message_command "message") - cmake_command(INVOKE ${message_command} STATUS "Hello World!") + cmake_language(CALL ${message_command} STATUS "Hello World!") is equivalent to @@ -49,7 +49,7 @@ Evaluating Code .. code-block:: cmake - cmake_command(EVAL CODE <code>...) + cmake_language(EVAL CODE <code>...) Evaluates the ``<code>...`` as CMake code. @@ -62,7 +62,7 @@ For example, the code: set(C TRUE) set(condition "(A AND B) OR C") - cmake_command(EVAL CODE " + cmake_language(EVAL CODE " if (${condition}) message(STATUS TRUE) else() diff --git a/Help/command/function.rst b/Help/command/function.rst index 30938b3..7a9b907 100644 --- a/Help/command/function.rst +++ b/Help/command/function.rst @@ -44,14 +44,14 @@ can be invoked through any of foo() Foo() FOO() - cmake_command(INVOKE foo) + cmake_language(CALL foo) and so on. However, it is strongly recommended to stay with the case chosen in the function definition. Typically functions use all-lowercase names. -The :command:`cmake_command(INVOKE ...)` command can also be used to invoke the -function. +The :command:`cmake_language(CALL ...)` command can also be used to +invoke the function. Arguments ^^^^^^^^^ diff --git a/Help/command/macro.rst b/Help/command/macro.rst index 65159f4..797a90d 100644 --- a/Help/command/macro.rst +++ b/Help/command/macro.rst @@ -42,14 +42,14 @@ can be invoked through any of foo() Foo() FOO() - cmake_command(INVOKE foo) + cmake_language(CALL foo) and so on. However, it is strongly recommended to stay with the case chosen in the macro definition. Typically macros use all-lowercase names. -The :command:`cmake_command(INVOKE ...)` command can also be used to invoke the -macro. +The :command:`cmake_language(CALL ...)` command can also be used to +invoke the macro. Arguments ^^^^^^^^^ diff --git a/Help/envvar/ASM_DIALECTFLAGS.rst b/Help/envvar/ASM_DIALECTFLAGS.rst index 3c3b02a..2e1c6d2 100644 --- a/Help/envvar/ASM_DIALECTFLAGS.rst +++ b/Help/envvar/ASM_DIALECTFLAGS.rst @@ -11,3 +11,5 @@ flags, after which the value for ``ASM<DIALECT>FLAGS`` is stored in the cache as ``CMAKE_ASM<DIALECT>_FLAGS <CMAKE_<LANG>_FLAGS>``. For any configuration run (including the first), the environment variable will be ignored, if the ``CMAKE_ASM<DIALECT>_FLAGS <CMAKE_<LANG>_FLAGS>`` variable is defined. + +See also :variable:`CMAKE_ASM<DIALECT>_FLAGS_INIT <CMAKE_<LANG>_FLAGS_INIT>`. diff --git a/Help/envvar/CFLAGS.rst b/Help/envvar/CFLAGS.rst index fda9ccc..190b4f4 100644 --- a/Help/envvar/CFLAGS.rst +++ b/Help/envvar/CFLAGS.rst @@ -9,3 +9,5 @@ flags, after which the value for ``CFLAGS`` is stored in the cache as :variable:`CMAKE_C_FLAGS <CMAKE_<LANG>_FLAGS>`. For any configuration run (including the first), the environment variable will be ignored if the :variable:`CMAKE_C_FLAGS <CMAKE_<LANG>_FLAGS>` variable is defined. + +See also :variable:`CMAKE_C_FLAGS_INIT <CMAKE_<LANG>_FLAGS_INIT>`. diff --git a/Help/envvar/CSFLAGS.rst b/Help/envvar/CSFLAGS.rst index 404bb59..8762982 100644 --- a/Help/envvar/CSFLAGS.rst +++ b/Help/envvar/CSFLAGS.rst @@ -9,3 +9,5 @@ compilation flags, after which the value for ``CSFLAGS`` is stored in the cache as :variable:`CMAKE_CSharp_FLAGS <CMAKE_<LANG>_FLAGS>`. For any configuration run (including the first), the environment variable will be ignored if the :variable:`CMAKE_CSharp_FLAGS <CMAKE_<LANG>_FLAGS>` variable is defined. + +See also :variable:`CMAKE_CSharp_FLAGS_INIT <CMAKE_<LANG>_FLAGS_INIT>`. diff --git a/Help/envvar/CUDAFLAGS.rst b/Help/envvar/CUDAFLAGS.rst index 4456d6b..14c5d84 100644 --- a/Help/envvar/CUDAFLAGS.rst +++ b/Help/envvar/CUDAFLAGS.rst @@ -9,3 +9,5 @@ compilation flags, after which the value for ``CUDAFLAGS`` is stored in the cache as :variable:`CMAKE_CUDA_FLAGS <CMAKE_<LANG>_FLAGS>`. For any configuration run (including the first), the environment variable will be ignored if the :variable:`CMAKE_CUDA_FLAGS <CMAKE_<LANG>_FLAGS>` variable is defined. + +See also :variable:`CMAKE_CUDA_FLAGS_INIT <CMAKE_<LANG>_FLAGS_INIT>`. diff --git a/Help/envvar/CXXFLAGS.rst b/Help/envvar/CXXFLAGS.rst index d7296dc..460a347 100644 --- a/Help/envvar/CXXFLAGS.rst +++ b/Help/envvar/CXXFLAGS.rst @@ -9,3 +9,5 @@ compilation flags, after which the value for ``CXXFLAGS`` is stored in the cache as :variable:`CMAKE_CXX_FLAGS <CMAKE_<LANG>_FLAGS>`. For any configuration run ( including the first), the environment variable will be ignored if the :variable:`CMAKE_CXX_FLAGS <CMAKE_<LANG>_FLAGS>` variable is defined. + +See also :variable:`CMAKE_CXX_FLAGS_INIT <CMAKE_<LANG>_FLAGS_INIT>`. diff --git a/Help/envvar/FFLAGS.rst b/Help/envvar/FFLAGS.rst index 02d3c34..53bffb6 100644 --- a/Help/envvar/FFLAGS.rst +++ b/Help/envvar/FFLAGS.rst @@ -9,3 +9,5 @@ compilation flags, after which the value for ``FFLAGS`` is stored in the cache as :variable:`CMAKE_Fortran_FLAGS <CMAKE_<LANG>_FLAGS>`. For any configuration run (including the first), the environment variable will be ignored if the :variable:`CMAKE_Fortran_FLAGS <CMAKE_<LANG>_FLAGS>` variable is defined. + +See also :variable:`CMAKE_Fortran_FLAGS_INIT <CMAKE_<LANG>_FLAGS_INIT>`. diff --git a/Help/envvar/RCFLAGS.rst b/Help/envvar/RCFLAGS.rst index 45419fe..bc43cb2 100644 --- a/Help/envvar/RCFLAGS.rst +++ b/Help/envvar/RCFLAGS.rst @@ -9,3 +9,5 @@ default compilation flags, after which the value for ``RCFLAGS`` is stored in the cache as :variable:`CMAKE_RC_FLAGS <CMAKE_<LANG>_FLAGS>`. For any configuration run (including the first), the environment variable will be ignored if the :variable:`CMAKE_RC_FLAGS <CMAKE_<LANG>_FLAGS>` variable is defined. + +See also :variable:`CMAKE_RC_FLAGS_INIT <CMAKE_<LANG>_FLAGS_INIT>`. diff --git a/Help/manual/cmake-commands.7.rst b/Help/manual/cmake-commands.7.rst index 87743b4..0aa4f75 100644 --- a/Help/manual/cmake-commands.7.rst +++ b/Help/manual/cmake-commands.7.rst @@ -16,8 +16,8 @@ These commands are always available. :maxdepth: 1 /command/break - /command/cmake_command /command/cmake_host_system_information + /command/cmake_language /command/cmake_minimum_required /command/cmake_parse_arguments /command/cmake_policy diff --git a/Help/manual/cmake-properties.7.rst b/Help/manual/cmake-properties.7.rst index 4103806..a68170a 100644 --- a/Help/manual/cmake-properties.7.rst +++ b/Help/manual/cmake-properties.7.rst @@ -201,6 +201,7 @@ Properties on Targets /prop_tgt/FOLDER /prop_tgt/Fortran_FORMAT /prop_tgt/Fortran_MODULE_DIRECTORY + /prop_tgt/Fortran_PREPROCESS /prop_tgt/FRAMEWORK /prop_tgt/FRAMEWORK_MULTI_CONFIG_POSTFIX_CONFIG /prop_tgt/FRAMEWORK_VERSION @@ -466,6 +467,7 @@ Properties on Source Files /prop_sf/COMPILE_OPTIONS /prop_sf/EXTERNAL_OBJECT /prop_sf/Fortran_FORMAT + /prop_sf/Fortran_PREPROCESS /prop_sf/GENERATED /prop_sf/HEADER_FILE_ONLY /prop_sf/INCLUDE_DIRECTORIES diff --git a/Help/manual/cmake-variables.7.rst b/Help/manual/cmake-variables.7.rst index 7d802e1..4ce8365 100644 --- a/Help/manual/cmake-variables.7.rst +++ b/Help/manual/cmake-variables.7.rst @@ -391,6 +391,7 @@ Variables that Control the Build /variable/CMAKE_FRAMEWORK_MULTI_CONFIG_POSTFIX_CONFIG /variable/CMAKE_Fortran_FORMAT /variable/CMAKE_Fortran_MODULE_DIRECTORY + /variable/CMAKE_Fortran_PREPROCESS /variable/CMAKE_GHS_NO_SOURCE_GROUP_FILE /variable/CMAKE_GLOBAL_AUTOGEN_TARGET /variable/CMAKE_GLOBAL_AUTOGEN_TARGET_NAME diff --git a/Help/prop_sf/Fortran_FORMAT.rst b/Help/prop_sf/Fortran_FORMAT.rst index 1cbbf48..ef33926 100644 --- a/Help/prop_sf/Fortran_FORMAT.rst +++ b/Help/prop_sf/Fortran_FORMAT.rst @@ -4,7 +4,9 @@ Fortran_FORMAT Set to ``FIXED`` or ``FREE`` to indicate the Fortran source layout. This property tells CMake whether a given Fortran source file uses -fixed-format or free-format. CMake will pass the corresponding format -flag to the compiler. Consider using the target-wide -:prop_tgt:`Fortran_FORMAT` property if all source files in a target -share the same format. +fixed-format or free-format. CMake will pass the corresponding format flag +to the compiler. Consider using the target-wide :prop_tgt:`Fortran_FORMAT` +property if all source files in a target share the same format. + +.. note:: For some compilers, ``NAG``, ``PGI`` and ``Solaris Studio``, + setting this to ``OFF`` will have no effect. diff --git a/Help/prop_sf/Fortran_PREPROCESS.rst b/Help/prop_sf/Fortran_PREPROCESS.rst new file mode 100644 index 0000000..25ea827 --- /dev/null +++ b/Help/prop_sf/Fortran_PREPROCESS.rst @@ -0,0 +1,17 @@ +Fortran_PREPROCESS +------------------ + +Control whether the Fortran source file should be unconditionally preprocessed. + +If unset or empty, rely on the compiler to determine whether the file +should be preprocessed. If explicitly set to ``OFF`` then the file +does not need to be preprocessed. If explicitly set to ``ON``, then +the file does need to be preprocessed as part of the compilation step. + +When using the :generator:`Ninja` generator, all source files are +first preprocessed in order to generate module dependency +information. Setting this property to ``OFF`` will make ``Ninja`` +skip this step. + +Consider using the target-wide :prop_tgt:`Fortran_PREPROCESS` property +if all source files in a target need to be preprocessed. diff --git a/Help/prop_tgt/Fortran_PREPROCESS.rst b/Help/prop_tgt/Fortran_PREPROCESS.rst new file mode 100644 index 0000000..47a15c0 --- /dev/null +++ b/Help/prop_tgt/Fortran_PREPROCESS.rst @@ -0,0 +1,23 @@ +Fortran_PREPROCESS +------------------ + +Control whether the Fortran source file should be unconditionally +preprocessed. + +If unset or empty, rely on the compiler to determine whether the file +should be preprocessed. If explicitly set to ``OFF`` then the file does not +need to be preprocessed. If explicitly set to ``ON``, then the file does +need to be preprocessed as part of the compilation step. + +When using the :generator:`Ninja` generator, all source files are +first preprocessed in order to generate module dependency +information. Setting this property to ``OFF`` will make ``Ninja`` +skip this step. + +Use the source-specific :prop_sf:`Fortran_PREPROCESS` property if a single +file needs to be preprocessed. If the variable +:variable:`CMAKE_Fortran_PREPROCESS` is set when a target is created its +value is used to initialize this property. + +.. note:: For some compilers, ``NAG``, ``PGI`` and ``Solaris Studio``, + setting this to ``OFF`` will have no effect. diff --git a/Help/release/dev/cmake_command-command.rst b/Help/release/dev/cmake_command-command.rst deleted file mode 100644 index 6200ae2..0000000 --- a/Help/release/dev/cmake_command-command.rst +++ /dev/null @@ -1,6 +0,0 @@ -cmake_command -------------- - -* The :command:`cmake_command()` command was added for meta-operations on - scripted or built-in commands, starting with a mode to ``INVOKE`` other - commands, and ``EVAL CODE`` to inplace evaluate a CMake script. diff --git a/Help/release/dev/cmake_language-command.rst b/Help/release/dev/cmake_language-command.rst new file mode 100644 index 0000000..5c00cea --- /dev/null +++ b/Help/release/dev/cmake_language-command.rst @@ -0,0 +1,6 @@ +cmake_language-command +---------------------- + +* The :command:`cmake_language()` command was added for meta-operations on + scripted or built-in commands, starting with a mode to ``CALL`` other + commands, and ``EVAL CODE`` to inplace evaluate a CMake script. diff --git a/Help/release/dev/fortran-preprocess-property.rst b/Help/release/dev/fortran-preprocess-property.rst new file mode 100644 index 0000000..d18e7b8 --- /dev/null +++ b/Help/release/dev/fortran-preprocess-property.rst @@ -0,0 +1,6 @@ +fortran-preprocess-property +--------------------------- + +* The :prop_tgt:`Fortran_PREPROCESS` target property and + :prop_sf:`Fortran_PREPROCESS` source-file property were added to + control preprocessing of Fortran source files. diff --git a/Help/variable/CMAKE_Fortran_PREPROCESS.rst b/Help/variable/CMAKE_Fortran_PREPROCESS.rst new file mode 100644 index 0000000..74b2d8b --- /dev/null +++ b/Help/variable/CMAKE_Fortran_PREPROCESS.rst @@ -0,0 +1,8 @@ +CMAKE_Fortran_PREPROCESS +------------------------ + +Default value for :prop_tgt:`Fortran_PREPROCESS` of targets. + +This variable is used to initialize the :prop_tgt:`Fortran_PREPROCESS` +property on all the targets. See that target property for additional +information. diff --git a/Help/variable/CMAKE_LANG_FLAGS_INIT.rst b/Help/variable/CMAKE_LANG_FLAGS_INIT.rst index a88d122..4a034e8 100644 --- a/Help/variable/CMAKE_LANG_FLAGS_INIT.rst +++ b/Help/variable/CMAKE_LANG_FLAGS_INIT.rst @@ -5,7 +5,11 @@ Value used to initialize the :variable:`CMAKE_<LANG>_FLAGS` cache entry the first time a build tree is configured for language ``<LANG>``. This variable is meant to be set by a :variable:`toolchain file <CMAKE_TOOLCHAIN_FILE>`. CMake may prepend or append content to -the value based on the environment and target platform. +the value based on the environment and target platform. For example, +the contents of a ``xxxFLAGS`` environment variable will be prepended, +where ``xxx`` will be language-specific but not necessarily the same as +``<LANG>`` (e.g. :envvar:`CXXFLAGS` for ``CXX``, :envvar:`FFLAGS` for +``Fortran``, and so on). See also the configuration-specific :variable:`CMAKE_<LANG>_FLAGS_<CONFIG>_INIT` variable. diff --git a/Help/variable/CMAKE_SYSTEM_PREFIX_PATH.rst b/Help/variable/CMAKE_SYSTEM_PREFIX_PATH.rst index e0ee979..81a7a0b 100644 --- a/Help/variable/CMAKE_SYSTEM_PREFIX_PATH.rst +++ b/Help/variable/CMAKE_SYSTEM_PREFIX_PATH.rst @@ -34,6 +34,9 @@ Darwin: OpenBSD: * ``ENV{LOCALBASE}`` +Unix: + * ``ENV{CONDA_PREFIX}`` when using a conda compiler + Windows: * ``ENV{ProgramW6432}`` * ``ENV{ProgramFiles}`` diff --git a/Modules/Compiler/Absoft-Fortran.cmake b/Modules/Compiler/Absoft-Fortran.cmake index 76502dc..8724f85 100644 --- a/Modules/Compiler/Absoft-Fortran.cmake +++ b/Modules/Compiler/Absoft-Fortran.cmake @@ -9,3 +9,5 @@ set(CMAKE_Fortran_VERBOSE_FLAG "-v") set(CMAKE_Fortran_FORMAT_FIXED_FLAG "-ffixed") set(CMAKE_Fortran_FORMAT_FREE_FLAG "-ffree") set(CMAKE_Fortran_LINKER_WRAPPER_FLAG "-X") +set(CMAKE_Fortran_COMPILE_OPTIONS_PREPROCESS_ON "-cpp") +set(CMAKE_Fortran_COMPILE_OPTIONS_PREPROCESS_OFF "-no-cpp") diff --git a/Modules/Compiler/Cray-Fortran.cmake b/Modules/Compiler/Cray-Fortran.cmake index ccb7c2e..696ae76 100644 --- a/Modules/Compiler/Cray-Fortran.cmake +++ b/Modules/Compiler/Cray-Fortran.cmake @@ -11,3 +11,11 @@ set(CMAKE_Fortran_MODDIR_FLAG -J) set(CMAKE_Fortran_MODDIR_DEFAULT .) set(CMAKE_Fortran_FORMAT_FIXED_FLAG "-f fixed") set(CMAKE_Fortran_FORMAT_FREE_FLAG "-f free") + +if (NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 8.5) + set(CMAKE_Fortran_COMPILE_OPTIONS_PREPROCESS_ON "-eT") + set(CMAKE_Fortran_COMPILE_OPTIONS_PREPROCESS_OFF "-dT") +else() + set(CMAKE_Fortran_COMPILE_OPTIONS_PREPROCESS_ON "-eZ") + set(CMAKE_Fortran_COMPILE_OPTIONS_PREPROCESS_OFF "-dZ") +endif() diff --git a/Modules/Compiler/Flang-Fortran.cmake b/Modules/Compiler/Flang-Fortran.cmake index f0e61d8..de0484e 100644 --- a/Modules/Compiler/Flang-Fortran.cmake +++ b/Modules/Compiler/Flang-Fortran.cmake @@ -11,3 +11,6 @@ set(CMAKE_Fortran_FORMAT_FIXED_FLAG "-ffixed-form") set(CMAKE_Fortran_FORMAT_FREE_FLAG "-ffree-form") set(CMAKE_Fortran_MODDIR_FLAG "-J") + +set(CMAKE_Fortran_COMPILE_OPTIONS_PREPROCESS_ON "-cpp") +set(CMAKE_Fortran_COMPILE_OPTIONS_PREPROCESS_OFF "-nocpp") diff --git a/Modules/Compiler/G95-Fortran.cmake b/Modules/Compiler/G95-Fortran.cmake index 03b7e08..5dba04e 100644 --- a/Modules/Compiler/G95-Fortran.cmake +++ b/Modules/Compiler/G95-Fortran.cmake @@ -9,3 +9,5 @@ set(CMAKE_Fortran_FORMAT_FIXED_FLAG "-ffixed-form") set(CMAKE_Fortran_FORMAT_FREE_FLAG "-ffree-form") set(CMAKE_Fortran_LINKER_WRAPPER_FLAG "-Wl,") set(CMAKE_Fortran_LINKER_WRAPPER_FLAG_SEP ",") +set(CMAKE_Fortran_COMPILE_OPTIONS_PREPROCESS_ON "-cpp") +set(CMAKE_Fortran_COMPILE_OPTIONS_PREPROCESS_OFF "-no-cpp") diff --git a/Modules/Compiler/GNU-Fortran.cmake b/Modules/Compiler/GNU-Fortran.cmake index 6413769..5dfb03e 100644 --- a/Modules/Compiler/GNU-Fortran.cmake +++ b/Modules/Compiler/GNU-Fortran.cmake @@ -10,6 +10,11 @@ set(CMAKE_Fortran_PREPROCESS_SOURCE set(CMAKE_Fortran_FORMAT_FIXED_FLAG "-ffixed-form") set(CMAKE_Fortran_FORMAT_FREE_FLAG "-ffree-form") +if (NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 4.4) + set(CMAKE_Fortran_COMPILE_OPTIONS_PREPROCESS_ON "-cpp") + set(CMAKE_Fortran_COMPILE_OPTIONS_PREPROCESS_OFF "-nocpp") +endif() + set(CMAKE_Fortran_POSTPROCESS_FLAG "-fpreprocessed") # No -DNDEBUG for Fortran. diff --git a/Modules/Compiler/HP-Fortran.cmake b/Modules/Compiler/HP-Fortran.cmake index 63a0331..d3e2a30 100644 --- a/Modules/Compiler/HP-Fortran.cmake +++ b/Modules/Compiler/HP-Fortran.cmake @@ -7,3 +7,6 @@ set(CMAKE_Fortran_CREATE_PREPROCESSED_SOURCE "<CMAKE_Fortran_COMPILER> <DEFINES> set(CMAKE_Fortran_LINKER_WRAPPER_FLAG "-Wl,") set(CMAKE_Fortran_LINKER_WRAPPER_FLAG ",") + +set(CMAKE_Fortran_COMPILE_OPTIONS_PREPROCESS_ON "+cpp=yes") +set(CMAKE_Fortran_COMPILE_OPTIONS_PREPROCESS_OFF "+cpp=no") diff --git a/Modules/Compiler/Intel-Fortran.cmake b/Modules/Compiler/Intel-Fortran.cmake index 156b533..71f25f4 100644 --- a/Modules/Compiler/Intel-Fortran.cmake +++ b/Modules/Compiler/Intel-Fortran.cmake @@ -15,3 +15,5 @@ set(CMAKE_Fortran_CREATE_ASSEMBLY_SOURCE "<CMAKE_Fortran_COMPILER> <DEFINES> <IN set(CMAKE_Fortran_PREPROCESS_SOURCE "<CMAKE_Fortran_COMPILER> -fpp <DEFINES> <INCLUDES> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>") +set(CMAKE_Fortran_COMPILE_OPTIONS_PREPROCESS_ON "-fpp") +set(CMAKE_Fortran_COMPILE_OPTIONS_PREPROCESS_OFF "-nofpp") diff --git a/Modules/Compiler/NAG-Fortran.cmake b/Modules/Compiler/NAG-Fortran.cmake index 2111c65..ffce97e 100644 --- a/Modules/Compiler/NAG-Fortran.cmake +++ b/Modules/Compiler/NAG-Fortran.cmake @@ -37,3 +37,4 @@ set(CMAKE_Fortran_FORMAT_FREE_FLAG "-free") set(CMAKE_Fortran_COMPILE_OPTIONS_PIC "-PIC") set(CMAKE_Fortran_COMPILE_OPTIONS_PIE "-PIC") set(CMAKE_Fortran_RESPONSE_FILE_LINK_FLAG "-Wl,@") +set(CMAKE_Fortran_COMPILE_OPTIONS_PREPROCESS_ON "-fpp") diff --git a/Modules/Compiler/PGI-Fortran.cmake b/Modules/Compiler/PGI-Fortran.cmake index 3daf798..ff87577 100644 --- a/Modules/Compiler/PGI-Fortran.cmake +++ b/Modules/Compiler/PGI-Fortran.cmake @@ -6,6 +6,7 @@ set(CMAKE_Fortran_SUBMODULE_EXT ".mod") set(CMAKE_Fortran_PREPROCESS_SOURCE "<CMAKE_Fortran_COMPILER> -Mpreprocess <DEFINES> <INCLUDES> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>") +set(CMAKE_Fortran_COMPILE_OPTIONS_PREPROCESS_ON "-Mpreprocess") set(CMAKE_Fortran_FORMAT_FIXED_FLAG "-Mnofreeform") set(CMAKE_Fortran_FORMAT_FREE_FLAG "-Mfreeform") diff --git a/Modules/Compiler/PathScale-Fortran.cmake b/Modules/Compiler/PathScale-Fortran.cmake index d903621..891d93e 100644 --- a/Modules/Compiler/PathScale-Fortran.cmake +++ b/Modules/Compiler/PathScale-Fortran.cmake @@ -4,3 +4,6 @@ __compiler_pathscale(Fortran) set(CMAKE_Fortran_MODDIR_FLAG "-module ") set(CMAKE_Fortran_FORMAT_FIXED_FLAG "-fixedform") set(CMAKE_Fortran_FORMAT_FREE_FLAG "-freeform") + +set(CMAKE_Fortran_COMPILE_OPTIONS_PREPROCESS_ON "-cpp") +set(CMAKE_Fortran_COMPILE_OPTIONS_PREPROCESS_OFF "-nocpp") diff --git a/Modules/Compiler/SunPro-Fortran.cmake b/Modules/Compiler/SunPro-Fortran.cmake index 0c93c94..0ba5015 100644 --- a/Modules/Compiler/SunPro-Fortran.cmake +++ b/Modules/Compiler/SunPro-Fortran.cmake @@ -30,3 +30,5 @@ set(CMAKE_Fortran_PREPROCESS_SOURCE set(CMAKE_Fortran_CREATE_PREPROCESSED_SOURCE "<CMAKE_Fortran_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -F -fpp <SOURCE> -o <PREPROCESSED_SOURCE>") set(CMAKE_Fortran_CREATE_ASSEMBLY_SOURCE "<CMAKE_Fortran_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -S <SOURCE> -o <ASSEMBLY_SOURCE>") + +set(CMAKE_Fortran_COMPILE_OPTIONS_PREPROCESS_ON "-fpp") diff --git a/Modules/Compiler/XL-Fortran.cmake b/Modules/Compiler/XL-Fortran.cmake index e01ec8e..cc15e65 100644 --- a/Modules/Compiler/XL-Fortran.cmake +++ b/Modules/Compiler/XL-Fortran.cmake @@ -23,3 +23,8 @@ set(CMAKE_Fortran_CREATE_ASSEMBLY_SOURCE) set(CMAKE_Fortran_PREPROCESS_SOURCE "<CMAKE_Fortran_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -qpreprocess -qnoobject -qsuppress=1517-020 -tF -B \"${CMAKE_CURRENT_LIST_DIR}/XL-Fortran/\" -WF,--cpp,\"${CMAKE_Fortran_XL_CPP}\",--out,<PREPROCESSED_SOURCE> <SOURCE>" ) + +if (NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 15.1.6) + set(CMAKE_Fortran_COMPILE_OPTIONS_PREPROCESS_ON "-qpreprocess") + set(CMAKE_Fortran_COMPILE_OPTIONS_PREPROCESS_OFF "-qnopreprocess") +endif() diff --git a/Modules/Platform/UnixPaths.cmake b/Modules/Platform/UnixPaths.cmake index 7fe64cb..b9381c3 100644 --- a/Modules/Platform/UnixPaths.cmake +++ b/Modules/Platform/UnixPaths.cmake @@ -95,6 +95,10 @@ unset(_cmake_sysroot_compile) # synchronized if(CMAKE_COMPILER_SYSROOT) list(PREPEND CMAKE_SYSTEM_PREFIX_PATH "${CMAKE_COMPILER_SYSROOT}") + + if(DEFINED ENV{CONDA_PREFIX} AND EXISTS "$ENV{CONDA_PREFIX}") + list(APPEND CMAKE_SYSTEM_PREFIX_PATH "$ENV{CONDA_PREFIX}") + endif() endif() # Enable use of lib32 and lib64 search path variants by default. diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt index 6d585ee..22d8032 100644 --- a/Source/CMakeLists.txt +++ b/Source/CMakeLists.txt @@ -488,10 +488,10 @@ set(SRCS cmBuildCommand.h cmBuildNameCommand.cxx cmBuildNameCommand.h - cmCMakeCommand.cxx - cmCMakeCommand.h cmCMakeHostSystemInformationCommand.cxx cmCMakeHostSystemInformationCommand.h + cmCMakeLanguageCommand.cxx + cmCMakeLanguageCommand.h cmCMakeMinimumRequired.cxx cmCMakeMinimumRequired.h cmCMakePolicyCommand.cxx diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index fda9848..feb55e8 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,7 +1,7 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 17) -set(CMake_VERSION_PATCH 20200522) +set(CMake_VERSION_PATCH 20200525) #set(CMake_VERSION_RC 0) set(CMake_VERSION_IS_DIRTY 0) diff --git a/Source/cmCMakeCommand.cxx b/Source/cmCMakeLanguageCommand.cxx index 23bc0ea..66857be 100644 --- a/Source/cmCMakeCommand.cxx +++ b/Source/cmCMakeLanguageCommand.cxx @@ -1,6 +1,6 @@ /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying file Copyright.txt or https://cmake.org/licensing for details. */ -#include "cmCMakeCommand.h" +#include "cmCMakeLanguageCommand.h" #include <algorithm> #include <cstddef> @@ -13,8 +13,8 @@ #include "cmRange.h" #include "cmStringAlgorithms.h" -bool cmCMakeCommand(std::vector<cmListFileArgument> const& args, - cmExecutionStatus& status) +bool cmCMakeLanguageCommand(std::vector<cmListFileArgument> const& args, + cmExecutionStatus& status) { if (args.empty()) { status.SetError("called with incorrect number of arguments"); @@ -36,7 +36,7 @@ bool cmCMakeCommand(std::vector<cmListFileArgument> const& args, return false; } - if (dispatchExpandedArgs[0] == "INVOKE") { + if (dispatchExpandedArgs[0] == "CALL") { if ((args.size() == 1 && dispatchExpandedArgs.size() != 2) || dispatchExpandedArgs.size() > 2) { status.SetError("called with incorrect number of arguments"); @@ -44,7 +44,7 @@ bool cmCMakeCommand(std::vector<cmListFileArgument> const& args, } // First argument is the name of the function to call - std::string invokeCommand; + std::string callCommand; size_t startArg; if (dispatchExpandedArgs.size() == 1) { std::vector<std::string> functionExpandedArg; @@ -57,15 +57,15 @@ bool cmCMakeCommand(std::vector<cmListFileArgument> const& args, return false; } - invokeCommand = functionExpandedArg[0]; + callCommand = functionExpandedArg[0]; startArg = 2; } else { - invokeCommand = dispatchExpandedArgs[1]; + callCommand = dispatchExpandedArgs[1]; startArg = 1; } cmListFileFunction func; - func.Name = invokeCommand; + func.Name = callCommand; func.Line = context.Line; // The rest of the arguments are passed to the function call above diff --git a/Source/cmCMakeCommand.h b/Source/cmCMakeLanguageCommand.h index 7dbecff..7306515 100644 --- a/Source/cmCMakeCommand.h +++ b/Source/cmCMakeLanguageCommand.h @@ -1,7 +1,7 @@ /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying file Copyright.txt or https://cmake.org/licensing for details. */ -#ifndef cmCMakeCommand_h -#define cmCMakeCommand_h +#ifndef cmCMakeLanguageCommand_h +#define cmCMakeLanguageCommand_h #include "cmConfigure.h" // IWYU pragma: keep @@ -14,7 +14,7 @@ struct cmListFileArgument; * \brief Calls a scripted or build-in command * */ -bool cmCMakeCommand(std::vector<cmListFileArgument> const& args, - cmExecutionStatus& status); +bool cmCMakeLanguageCommand(std::vector<cmListFileArgument> const& args, + cmExecutionStatus& status); #endif diff --git a/Source/cmCommands.cxx b/Source/cmCommands.cxx index 28b4267..c94f128 100644 --- a/Source/cmCommands.cxx +++ b/Source/cmCommands.cxx @@ -91,8 +91,8 @@ # include "cmAddLinkOptionsCommand.h" # include "cmAuxSourceDirectoryCommand.h" # include "cmBuildNameCommand.h" -# include "cmCMakeCommand.h" # include "cmCMakeHostSystemInformationCommand.h" +# include "cmCMakeLanguageCommand.h" # include "cmExportCommand.h" # include "cmExportLibraryDependenciesCommand.h" # include "cmFLTKWrapUICommand.h" @@ -197,9 +197,9 @@ void GetScriptingCommands(cmState* state) "match the opening WHILE command."); #if !defined(CMAKE_BOOTSTRAP) - state->AddBuiltinCommand("cmake_command", cmCMakeCommand); state->AddBuiltinCommand("cmake_host_system_information", cmCMakeHostSystemInformationCommand); + state->AddBuiltinCommand("cmake_language", cmCMakeLanguageCommand); state->AddBuiltinCommand("load_cache", cmLoadCacheCommand); state->AddBuiltinCommand("remove", cmRemoveCommand); state->AddBuiltinCommand("variable_watch", cmVariableWatchCommand); diff --git a/Source/cmCommonTargetGenerator.cxx b/Source/cmCommonTargetGenerator.cxx index 5414409..32a33ee 100644 --- a/Source/cmCommonTargetGenerator.cxx +++ b/Source/cmCommonTargetGenerator.cxx @@ -98,6 +98,34 @@ void cmCommonTargetGenerator::AppendFortranFormatFlags( } } +void cmCommonTargetGenerator::AppendFortranPreprocessFlags( + std::string& flags, cmSourceFile const& source) +{ + const std::string srcpp = source.GetSafeProperty("Fortran_PREPROCESS"); + cmOutputConverter::FortranPreprocess preprocess = + cmOutputConverter::GetFortranPreprocess(srcpp); + if (preprocess == cmOutputConverter::FortranPreprocess::Unset) { + std::string const& tgtpp = + this->GeneratorTarget->GetSafeProperty("Fortran_PREPROCESS"); + preprocess = cmOutputConverter::GetFortranPreprocess(tgtpp); + } + const char* var = nullptr; + switch (preprocess) { + case cmOutputConverter::FortranPreprocess::Needed: + var = "CMAKE_Fortran_COMPILE_OPTIONS_PREPROCESS_ON"; + break; + case cmOutputConverter::FortranPreprocess::NotNeeded: + var = "CMAKE_Fortran_COMPILE_OPTIONS_PREPROCESS_OFF"; + break; + default: + break; + } + if (var) { + this->LocalCommonGenerator->AppendCompileOptions( + flags, this->Makefile->GetSafeDefinition(var)); + } +} + std::string cmCommonTargetGenerator::GetFlags(const std::string& l, const std::string& config, const std::string& arch) diff --git a/Source/cmCommonTargetGenerator.h b/Source/cmCommonTargetGenerator.h index 78cedf5..c3c3a3a 100644 --- a/Source/cmCommonTargetGenerator.h +++ b/Source/cmCommonTargetGenerator.h @@ -45,6 +45,9 @@ protected: void AppendFortranFormatFlags(std::string& flags, cmSourceFile const& source); + void AppendFortranPreprocessFlags(std::string& flags, + cmSourceFile const& source); + virtual void AddIncludeFlags(std::string& flags, std::string const& lang, const std::string& config) = 0; diff --git a/Source/cmGlobalNinjaGenerator.h b/Source/cmGlobalNinjaGenerator.h index b89fb8f..44e632f 100644 --- a/Source/cmGlobalNinjaGenerator.h +++ b/Source/cmGlobalNinjaGenerator.h @@ -415,6 +415,11 @@ public: std::set<std::string> GetCrossConfigs(const std::string& config) const; + const std::set<std::string>& GetDefaultConfigs() const + { + return this->DefaultConfigs; + } + protected: void Generate() override; diff --git a/Source/cmLocalNinjaGenerator.cxx b/Source/cmLocalNinjaGenerator.cxx index d1944a4..e52e0d3 100644 --- a/Source/cmLocalNinjaGenerator.cxx +++ b/Source/cmLocalNinjaGenerator.cxx @@ -97,6 +97,43 @@ void cmLocalNinjaGenerator::Generate() if (target->Target->IsPerConfig()) { for (auto const& config : this->GetConfigNames()) { tg->Generate(config); + if (target->GetType() == cmStateEnums::GLOBAL_TARGET && + this->GetGlobalGenerator()->IsMultiConfig()) { + cmNinjaBuild phonyAlias("phony"); + this->GetGlobalNinjaGenerator()->AppendTargetOutputs( + target.get(), phonyAlias.Outputs, ""); + this->GetGlobalNinjaGenerator()->AppendTargetOutputs( + target.get(), phonyAlias.ExplicitDeps, config); + this->GetGlobalNinjaGenerator()->WriteBuild( + *this->GetGlobalNinjaGenerator()->GetConfigFileStream(config), + phonyAlias); + } + } + if (target->GetType() == cmStateEnums::GLOBAL_TARGET && + this->GetGlobalGenerator()->IsMultiConfig()) { + if (!this->GetGlobalNinjaGenerator()->GetDefaultConfigs().empty()) { + cmNinjaBuild phonyAlias("phony"); + this->GetGlobalNinjaGenerator()->AppendTargetOutputs( + target.get(), phonyAlias.Outputs, ""); + for (auto const& config : + this->GetGlobalNinjaGenerator()->GetDefaultConfigs()) { + this->GetGlobalNinjaGenerator()->AppendTargetOutputs( + target.get(), phonyAlias.ExplicitDeps, config); + } + this->GetGlobalNinjaGenerator()->WriteBuild( + *this->GetGlobalNinjaGenerator()->GetDefaultFileStream(), + phonyAlias); + } + cmNinjaBuild phonyAlias("phony"); + this->GetGlobalNinjaGenerator()->AppendTargetOutputs( + target.get(), phonyAlias.Outputs, "all"); + for (auto const& config : this->GetConfigNames()) { + this->GetGlobalNinjaGenerator()->AppendTargetOutputs( + target.get(), phonyAlias.ExplicitDeps, config); + } + this->GetGlobalNinjaGenerator()->WriteBuild( + *this->GetGlobalNinjaGenerator()->GetDefaultFileStream(), + phonyAlias); } } else { tg->Generate(""); diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx index 0b02724..5d50e2d 100644 --- a/Source/cmLocalVisualStudio7Generator.cxx +++ b/Source/cmLocalVisualStudio7Generator.cxx @@ -283,6 +283,7 @@ void cmLocalVisualStudio7Generator::WriteConfigurations( } cmVS7FlagTable cmLocalVisualStudio7GeneratorFortranFlagTable[] = { { "Preprocess", "fpp", "Run Preprocessor on files", "preprocessYes", 0 }, + { "Preprocess", "nofpp", "Run Preprocessor on files", "preprocessNo", 0 }, { "SuppressStartupBanner", "nologo", "SuppressStartupBanner", "true", 0 }, { "SourceFileFormat", "fixed", "Use Fixed Format", "fileFormatFixed", 0 }, { "SourceFileFormat", "free", "Use Free Format", "fileFormatFree", 0 }, @@ -681,6 +682,18 @@ void cmLocalVisualStudio7Generator::WriteConfiguration( default: break; } + + switch (cmOutputConverter::GetFortranPreprocess( + target->GetSafeProperty("Fortran_PREPROCESS"))) { + case cmOutputConverter::FortranPreprocess::Needed: + flags += " -fpp"; + break; + case cmOutputConverter::FortranPreprocess::NotNeeded: + flags += " -nofpp"; + break; + default: + break; + } } // Get preprocessor definitions for this directory. @@ -1473,6 +1486,20 @@ cmLocalVisualStudio7GeneratorFCInfo::cmLocalVisualStudio7GeneratorFCInfo( } if (lg->FortranProject) { + switch (cmOutputConverter::GetFortranPreprocess( + sf.GetSafeProperty("Fortran_PREPROCESS"))) { + case cmOutputConverter::FortranPreprocess::Needed: + fc.CompileFlags = cmStrCat("-fpp ", fc.CompileFlags); + needfc = true; + break; + case cmOutputConverter::FortranPreprocess::NotNeeded: + fc.CompileFlags = cmStrCat("-nofpp ", fc.CompileFlags); + needfc = true; + break; + default: + break; + } + switch (cmOutputConverter::GetFortranFormat( sf.GetSafeProperty("Fortran_FORMAT"))) { case cmOutputConverter::FortranFormatFixed: diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx index 04d4db7..c98e3a9 100644 --- a/Source/cmMakefileTargetGenerator.cxx +++ b/Source/cmMakefileTargetGenerator.cxx @@ -541,6 +541,7 @@ void cmMakefileTargetGenerator::WriteObjectRuleFiles( // Add Fortran format flags. if (lang == "Fortran") { this->AppendFortranFormatFlags(flags, source); + this->AppendFortranPreprocessFlags(flags, source); } // Add flags from source file properties. diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx index f4ff51b..c77a85b 100644 --- a/Source/cmNinjaTargetGenerator.cxx +++ b/Source/cmNinjaTargetGenerator.cxx @@ -106,7 +106,16 @@ std::string cmNinjaTargetGenerator::LanguagePreprocessRule( std::string const& lang, const std::string& config) const { return cmStrCat( - lang, "_PREPROCESS__", + lang, "_PREPROCESS_SCAN__", + cmGlobalNinjaGenerator::EncodeRuleName(this->GeneratorTarget->GetName()), + '_', config); +} + +std::string cmNinjaTargetGenerator::LanguageDependencyRule( + std::string const& lang, const std::string& config) const +{ + return cmStrCat( + lang, "_SCAN__", cmGlobalNinjaGenerator::EncodeRuleName(this->GeneratorTarget->GetName()), '_', config); } @@ -183,6 +192,7 @@ std::string cmNinjaTargetGenerator::ComputeFlagsForObject( // Add Fortran format flags. if (language == "Fortran") { this->AppendFortranFormatFlags(flags, *source); + this->AppendFortranPreprocessFlags(flags, *source); } // Add source file specific flags. @@ -508,6 +518,91 @@ void cmNinjaTargetGenerator::WriteLanguageRules(const std::string& language, this->WriteCompileRule(language, config); } +namespace { +// Create the command to run the dependency scanner +std::string GetScanCommand(const std::string& cmakeCmd, const std::string& tdi, + const std::string& lang, const std::string& ppFile, + bool needDyndep, const std::string& ddiFile) +{ + std::string ccmd = + cmStrCat(cmakeCmd, " -E cmake_ninja_depends --tdi=", tdi, " --lang=", lang, + " --pp=", ppFile, " --dep=$DEP_FILE"); + if (needDyndep) { + ccmd = cmStrCat(ccmd, " --obj=$OBJ_FILE --ddi=", ddiFile); + } + return ccmd; +} + +// Helper function to create dependency scanning rule, with optional +// explicit preprocessing step if preprocessCommand is non-empty +cmNinjaRule GetPreprocessScanRule( + const std::string& ruleName, cmRulePlaceholderExpander::RuleVariables& vars, + const std::string& responseFlag, const std::string& flags, + const std::string& launcher, + cmRulePlaceholderExpander* const rulePlaceholderExpander, + std::string scanCommand, cmLocalNinjaGenerator* generator, + const std::string& preprocessCommand = "") +{ + cmNinjaRule rule(ruleName); + // Explicit preprocessing always uses a depfile. + rule.DepType = ""; // no deps= for multiple outputs + rule.DepFile = "$DEP_FILE"; + + cmRulePlaceholderExpander::RuleVariables ppVars; + ppVars.CMTargetName = vars.CMTargetName; + ppVars.CMTargetType = vars.CMTargetType; + ppVars.Language = vars.Language; + ppVars.Object = "$out"; // for RULE_LAUNCH_COMPILE + ppVars.PreprocessedSource = "$out"; + ppVars.DependencyFile = rule.DepFile.c_str(); + + // Preprocessing uses the original source, compilation uses + // preprocessed output or original source + ppVars.Source = vars.Source; + vars.Source = "$in"; + + // Copy preprocessor definitions to the preprocessor rule. + ppVars.Defines = vars.Defines; + + // Copy include directories to the preprocessor rule. The Fortran + // compilation rule still needs them for the INCLUDE directive. + ppVars.Includes = vars.Includes; + + // Preprocessing and compilation use the same flags. + std::string ppFlags = flags; + + // If using a response file, move defines, includes, and flags into it. + if (!responseFlag.empty()) { + rule.RspFile = "$RSP_FILE"; + rule.RspContent = + cmStrCat(' ', ppVars.Defines, ' ', ppVars.Includes, ' ', ppFlags); + ppFlags = cmStrCat(responseFlag, rule.RspFile); + ppVars.Defines = ""; + ppVars.Includes = ""; + } + + ppVars.Flags = ppFlags.c_str(); + + // Rule for preprocessing source file. + std::vector<std::string> ppCmds; + + if (!preprocessCommand.empty()) { + // Lookup the explicit preprocessing rule. + cmExpandList(preprocessCommand, ppCmds); + for (std::string& i : ppCmds) { + i = cmStrCat(launcher, i); + rulePlaceholderExpander->ExpandRuleVariables(generator, i, ppVars); + } + } + + // Run CMake dependency scanner on either preprocessed output or source file + ppCmds.emplace_back(std::move(scanCommand)); + rule.Command = generator->BuildCommandLine(ppCmds); + + return rule; +} +} + void cmNinjaTargetGenerator::WriteCompileRule(const std::string& lang, const std::string& config) { @@ -565,82 +660,42 @@ void cmNinjaTargetGenerator::WriteCompileRule(const std::string& lang, cmSystemTools::GetCMakeCommand(), cmLocalGenerator::SHELL); if (explicitPP) { - cmNinjaRule rule(this->LanguagePreprocessRule(lang, config)); - // Explicit preprocessing always uses a depfile. - rule.DepType = ""; // no deps= for multiple outputs - rule.DepFile = "$DEP_FILE"; + // Combined preprocessing and dependency scanning + const auto ppScanCommand = GetScanCommand( + cmakeCmd, tdi, lang, "$out", needDyndep, "$DYNDEP_INTERMEDIATE_FILE"); + const auto ppVar = cmStrCat("CMAKE_", lang, "_PREPROCESS_SOURCE"); - cmRulePlaceholderExpander::RuleVariables ppVars; - ppVars.CMTargetName = vars.CMTargetName; - ppVars.CMTargetType = vars.CMTargetType; - ppVars.Language = vars.Language; - ppVars.Object = "$out"; // for RULE_LAUNCH_COMPILE - ppVars.PreprocessedSource = "$out"; - ppVars.DependencyFile = rule.DepFile.c_str(); + auto ppRule = GetPreprocessScanRule( + this->LanguagePreprocessRule(lang, config), vars, responseFlag, flags, + launcher, rulePlaceholderExpander.get(), ppScanCommand, + this->GetLocalGenerator(), mf->GetRequiredDefinition(ppVar)); - // Preprocessing uses the original source, - // compilation uses preprocessed output. - ppVars.Source = vars.Source; - vars.Source = "$in"; + // Write the rule for preprocessing file of the given language. + ppRule.Comment = cmStrCat("Rule for preprocessing ", lang, " files."); + ppRule.Description = cmStrCat("Building ", lang, " preprocessed $out"); - // Preprocessing and compilation use the same flags. - std::string ppFlags = flags; + this->GetGlobalGenerator()->AddRule(ppRule); if (!compilePPWithDefines) { - // Move preprocessor definitions to the preprocessor rule. - ppVars.Defines = vars.Defines; + // Remove preprocessor definitions from compilation step vars.Defines = ""; - } else { - // Copy preprocessor definitions to the preprocessor rule. - ppVars.Defines = vars.Defines; - } - - // Copy include directories to the preprocessor rule. The Fortran - // compilation rule still needs them for the INCLUDE directive. - ppVars.Includes = vars.Includes; - - // If using a response file, move defines, includes, and flags into it. - if (!responseFlag.empty()) { - rule.RspFile = "$RSP_FILE"; - rule.RspContent = - cmStrCat(' ', ppVars.Defines, ' ', ppVars.Includes, ' ', ppFlags); - ppFlags = cmStrCat(responseFlag, rule.RspFile); - ppVars.Defines = ""; - ppVars.Includes = ""; } - ppVars.Flags = ppFlags.c_str(); + // Just dependency scanning for files that have preprocessing turned off + const auto scanCommand = + GetScanCommand(cmakeCmd, tdi, lang, "$in", needDyndep, "$out"); - // Rule for preprocessing source file. - std::vector<std::string> ppCmds; - { - // Lookup the explicit preprocessing rule. - std::string ppVar = cmStrCat("CMAKE_", lang, "_PREPROCESS_SOURCE"); - cmExpandList(this->GetMakefile()->GetRequiredDefinition(ppVar), ppCmds); - } + auto scanRule = GetPreprocessScanRule( + this->LanguageDependencyRule(lang, config), vars, "", flags, launcher, + rulePlaceholderExpander.get(), scanCommand, this->GetLocalGenerator()); - for (std::string& i : ppCmds) { - i = cmStrCat(launcher, i); - rulePlaceholderExpander->ExpandRuleVariables(this->GetLocalGenerator(), - i, ppVars); - } + // Write the rule for generating dependencies for the given language. + scanRule.Comment = cmStrCat("Rule for generating ", lang, + " dependencies on non-preprocessed files."); + scanRule.Description = + cmStrCat("Generating ", lang, " dependencies for $in"); - // Run CMake dependency scanner on preprocessed output. - { - std::string ccmd = - cmStrCat(cmakeCmd, " -E cmake_ninja_depends --tdi=", tdi, - " --lang=", lang, " --pp=$out --dep=$DEP_FILE"); - if (needDyndep) { - ccmd += " --obj=$OBJ_FILE --ddi=$DYNDEP_INTERMEDIATE_FILE"; - } - ppCmds.emplace_back(std::move(ccmd)); - } - rule.Command = this->GetLocalGenerator()->BuildCommandLine(ppCmds); - - // Write the rule for preprocessing file of the given language. - rule.Comment = cmStrCat("Rule for preprocessing ", lang, " files."); - rule.Description = cmStrCat("Building ", lang, " preprocessed $out"); - this->GetGlobalGenerator()->AddRule(rule); + this->GetGlobalGenerator()->AddRule(scanRule); } if (needDyndep) { @@ -996,6 +1051,82 @@ void cmNinjaTargetGenerator::WriteObjectBuildStatements( } } +namespace { +cmNinjaBuild GetPreprocessOrScanBuild( + const std::string& ruleName, const std::string& ppFileName, bool compilePP, + bool compilePPWithDefines, cmNinjaBuild& objBuild, cmNinjaVars& vars, + const std::string& depFileName, bool needDyndep, + const std::string& objectFileName) +{ + // Explicit preprocessing and dependency + cmNinjaBuild ppBuild(ruleName); + + if (!ppFileName.empty()) { + ppBuild.Outputs.push_back(ppFileName); + ppBuild.RspFile = cmStrCat(ppFileName, ".rsp"); + } else { + ppBuild.RspFile = "$out.rsp"; + } + + if (compilePP) { + // Move compilation dependencies to the preprocessing build statement. + std::swap(ppBuild.ExplicitDeps, objBuild.ExplicitDeps); + std::swap(ppBuild.ImplicitDeps, objBuild.ImplicitDeps); + std::swap(ppBuild.OrderOnlyDeps, objBuild.OrderOnlyDeps); + std::swap(ppBuild.Variables["IN_ABS"], vars["IN_ABS"]); + + // The actual compilation will now use the preprocessed source. + objBuild.ExplicitDeps.push_back(ppFileName); + } else { + // Copy compilation dependencies to the preprocessing build statement. + ppBuild.ExplicitDeps = objBuild.ExplicitDeps; + ppBuild.ImplicitDeps = objBuild.ImplicitDeps; + ppBuild.OrderOnlyDeps = objBuild.OrderOnlyDeps; + ppBuild.Variables["IN_ABS"] = vars["IN_ABS"]; + } + + // Preprocessing and compilation generally use the same flags. + ppBuild.Variables["FLAGS"] = vars["FLAGS"]; + + if (compilePP && !compilePPWithDefines) { + // Move preprocessor definitions to the preprocessor build statement. + std::swap(ppBuild.Variables["DEFINES"], vars["DEFINES"]); + } else { + // Copy preprocessor definitions to the preprocessor build statement. + ppBuild.Variables["DEFINES"] = vars["DEFINES"]; + } + + // Copy include directories to the preprocessor build statement. The + // Fortran compilation build statement still needs them for the INCLUDE + // directive. + ppBuild.Variables["INCLUDES"] = vars["INCLUDES"]; + + // Explicit preprocessing always uses a depfile. + ppBuild.Variables["DEP_FILE"] = depFileName; + if (compilePP) { + // The actual compilation does not need a depfile because it + // depends on the already-preprocessed source. + vars.erase("DEP_FILE"); + } + + if (needDyndep) { + // Tell dependency scanner the object file that will result from + // compiling the source. + ppBuild.Variables["OBJ_FILE"] = objectFileName; + + // Tell dependency scanner where to store dyndep intermediate results. + std::string const ddiFile = cmStrCat(objectFileName, ".ddi"); + if (ppFileName.empty()) { + ppBuild.Outputs.push_back(ddiFile); + } else { + ppBuild.Variables["DYNDEP_INTERMEDIATE_FILE"] = ddiFile; + ppBuild.ImplicitOuts.push_back(ddiFile); + } + } + return ppBuild; +} +} + void cmNinjaTargetGenerator::WriteObjectBuildStatement( cmSourceFile const* source, const std::string& config, const std::string& fileConfig, bool firstForConfig) @@ -1134,36 +1265,39 @@ void cmNinjaTargetGenerator::WriteObjectBuildStatement( // For some cases we do an explicit preprocessor invocation. bool const explicitPP = this->NeedExplicitPreprocessing(language); if (explicitPP) { - cmNinjaBuild ppBuild(this->LanguagePreprocessRule(language, config)); - std::string const ppFileName = - this->ConvertToNinjaPath(this->GetPreprocessedFilePath(source, config)); - ppBuild.Outputs.push_back(ppFileName); - - ppBuild.RspFile = cmStrCat(ppFileName, ".rsp"); + // If source/target has preprocessing turned off, we still need to + // generate an explicit dependency step + const auto srcpp = source->GetSafeProperty("Fortran_PREPROCESS"); + cmOutputConverter::FortranPreprocess preprocess = + cmOutputConverter::GetFortranPreprocess(srcpp); + if (preprocess == cmOutputConverter::FortranPreprocess::Unset) { + const auto& tgtpp = + this->GeneratorTarget->GetSafeProperty("Fortran_PREPROCESS"); + preprocess = cmOutputConverter::GetFortranPreprocess(tgtpp); + } - bool const compilePP = this->UsePreprocessedSource(language); + bool const compilePP = this->UsePreprocessedSource(language) && + (preprocess != cmOutputConverter::FortranPreprocess::NotNeeded); bool const compilePPWithDefines = compilePP && this->CompilePreprocessedSourceWithDefines(language); - if (compilePP) { - // Move compilation dependencies to the preprocessing build statement. - std::swap(ppBuild.ExplicitDeps, objBuild.ExplicitDeps); - std::swap(ppBuild.ImplicitDeps, objBuild.ImplicitDeps); - std::swap(ppBuild.OrderOnlyDeps, objBuild.OrderOnlyDeps); - std::swap(ppBuild.Variables["IN_ABS"], vars["IN_ABS"]); - - // The actual compilation will now use the preprocessed source. - objBuild.ExplicitDeps.push_back(ppFileName); - } else { - // Copy compilation dependencies to the preprocessing build statement. - ppBuild.ExplicitDeps = objBuild.ExplicitDeps; - ppBuild.ImplicitDeps = objBuild.ImplicitDeps; - ppBuild.OrderOnlyDeps = objBuild.OrderOnlyDeps; - ppBuild.Variables["IN_ABS"] = vars["IN_ABS"]; - } - // Preprocessing and compilation generally use the same flags. - ppBuild.Variables["FLAGS"] = vars["FLAGS"]; + std::string const ppFileName = compilePP + ? this->ConvertToNinjaPath(this->GetPreprocessedFilePath(source, config)) + : ""; + + std::string const buildName = compilePP + ? this->LanguagePreprocessRule(language, config) + : this->LanguageDependencyRule(language, config); + + const auto depExtension = compilePP ? ".pp.d" : ".d"; + const std::string depFileName = + this->GetLocalGenerator()->ConvertToOutputFormat( + cmStrCat(objectFileName, depExtension), cmOutputConverter::SHELL); + + cmNinjaBuild ppBuild = GetPreprocessOrScanBuild( + buildName, ppFileName, compilePP, compilePPWithDefines, objBuild, vars, + depFileName, needDyndep, objectFileName); if (compilePP) { // In case compilation requires flags that are incompatible with @@ -1171,22 +1305,7 @@ void cmNinjaTargetGenerator::WriteObjectBuildStatement( std::string const& postFlag = this->Makefile->GetSafeDefinition( cmStrCat("CMAKE_", language, "_POSTPROCESS_FLAG")); this->LocalGenerator->AppendFlags(vars["FLAGS"], postFlag); - } - if (compilePP && !compilePPWithDefines) { - // Move preprocessor definitions to the preprocessor build statement. - std::swap(ppBuild.Variables["DEFINES"], vars["DEFINES"]); - } else { - // Copy preprocessor definitions to the preprocessor build statement. - ppBuild.Variables["DEFINES"] = vars["DEFINES"]; - } - - // Copy include directories to the preprocessor build statement. The - // Fortran compilation build statement still needs them for the INCLUDE - // directive. - ppBuild.Variables["INCLUDES"] = vars["INCLUDES"]; - - if (compilePP) { // Prepend source file's original directory as an include directory // so e.g. Fortran INCLUDE statements can look for files in it. std::vector<std::string> sourceDirectory; @@ -1200,28 +1319,9 @@ void cmNinjaTargetGenerator::WriteObjectBuildStatement( vars["INCLUDES"] = cmStrCat(sourceDirectoryFlag, ' ', vars["INCLUDES"]); } - // Explicit preprocessing always uses a depfile. - ppBuild.Variables["DEP_FILE"] = - this->GetLocalGenerator()->ConvertToOutputFormat( - cmStrCat(objectFileName, ".pp.d"), cmOutputConverter::SHELL); - if (compilePP) { - // The actual compilation does not need a depfile because it - // depends on the already-preprocessed source. - vars.erase("DEP_FILE"); - } - - if (needDyndep) { - // Tell dependency scanner the object file that will result from - // compiling the source. - ppBuild.Variables["OBJ_FILE"] = objectFileName; - - // Tell dependency scanner where to store dyndep intermediate results. + if (firstForConfig && needDyndep) { std::string const ddiFile = cmStrCat(objectFileName, ".ddi"); - ppBuild.Variables["DYNDEP_INTERMEDIATE_FILE"] = ddiFile; - ppBuild.ImplicitOuts.push_back(ddiFile); - if (firstForConfig) { - this->Configs[config].DDIFiles[language].push_back(ddiFile); - } + this->Configs[config].DDIFiles[language].push_back(ddiFile); } this->addPoolNinjaVariable("JOB_POOL_COMPILE", this->GetGeneratorTarget(), diff --git a/Source/cmNinjaTargetGenerator.h b/Source/cmNinjaTargetGenerator.h index 1ac5683..8d4372e 100644 --- a/Source/cmNinjaTargetGenerator.h +++ b/Source/cmNinjaTargetGenerator.h @@ -70,6 +70,8 @@ protected: const std::string& config) const; std::string LanguagePreprocessRule(std::string const& lang, const std::string& config) const; + std::string LanguageDependencyRule(std::string const& lang, + const std::string& config) const; bool NeedExplicitPreprocessing(std::string const& lang) const; std::string LanguageDyndepRule(std::string const& lang, const std::string& config) const; diff --git a/Source/cmNinjaUtilityTargetGenerator.cxx b/Source/cmNinjaUtilityTargetGenerator.cxx index 134924e..b0b7953 100644 --- a/Source/cmNinjaUtilityTargetGenerator.cxx +++ b/Source/cmNinjaUtilityTargetGenerator.cxx @@ -160,10 +160,5 @@ void cmNinjaUtilityTargetGenerator::Generate(const std::string& config) // be per-directory and have one at the top-level anyway. if (genTarget->GetType() != cmStateEnums::GLOBAL_TARGET) { gg->AddTargetAlias(this->GetTargetName(), genTarget, config); - } else if (gg->IsMultiConfig() && genTarget->Target->IsPerConfig()) { - cmNinjaBuild phonyAlias("phony"); - gg->AppendTargetOutputs(genTarget, phonyAlias.Outputs, ""); - phonyAlias.ExplicitDeps = phonyBuild.Outputs; - gg->WriteBuild(this->GetImplFileStream(config), phonyAlias); } } diff --git a/Source/cmOutputConverter.cxx b/Source/cmOutputConverter.cxx index dc324cc..359e9f5 100644 --- a/Source/cmOutputConverter.cxx +++ b/Source/cmOutputConverter.cxx @@ -170,6 +170,17 @@ cmOutputConverter::FortranFormat cmOutputConverter::GetFortranFormat( return format; } +cmOutputConverter::FortranPreprocess cmOutputConverter::GetFortranPreprocess( + cm::string_view value) +{ + if (value.empty()) { + return FortranPreprocess::Unset; + } + + return cmIsOn(value) ? FortranPreprocess::Needed + : FortranPreprocess::NotNeeded; +} + void cmOutputConverter::SetLinkScriptShell(bool linkScriptShell) { this->LinkScriptShell = linkScriptShell; diff --git a/Source/cmOutputConverter.h b/Source/cmOutputConverter.h index 28582df..a8b4528 100644 --- a/Source/cmOutputConverter.h +++ b/Source/cmOutputConverter.h @@ -95,6 +95,14 @@ public: }; static FortranFormat GetFortranFormat(cm::string_view value); + enum class FortranPreprocess + { + Unset, + NotNeeded, + Needed + }; + static FortranPreprocess GetFortranPreprocess(cm::string_view value); + private: cmState* GetState() const; diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index e165f4c..4bb48fb 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -307,6 +307,7 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type, initProp("Fortran_FORMAT"); initProp("Fortran_MODULE_DIRECTORY"); initProp("Fortran_COMPILER_LAUNCHER"); + initProp("Fortran_PREPROCESS"); initProp("GNUtoMS"); initProp("OSX_ARCHITECTURES"); initProp("IOS_INSTALL_COMBINED"); diff --git a/Source/cmWorkerPool.cxx b/Source/cmWorkerPool.cxx index 9fec936..12aba4f 100644 --- a/Source/cmWorkerPool.cxx +++ b/Source/cmWorkerPool.cxx @@ -469,11 +469,9 @@ void cmWorkerPoolWorker::UVProcessStart(uv_async_t* handle) void cmWorkerPoolWorker::UVProcessFinished() { - { - std::lock_guard<std::mutex> lock(Proc_.Mutex); - if (Proc_.ROP && (Proc_.ROP->IsFinished() || !Proc_.ROP->IsStarted())) { - Proc_.ROP.reset(); - } + std::lock_guard<std::mutex> lock(Proc_.Mutex); + if (Proc_.ROP && (Proc_.ROP->IsFinished() || !Proc_.ROP->IsStarted())) { + Proc_.ROP.reset(); } // Notify idling thread Proc_.Condition.notify_one(); @@ -532,6 +530,7 @@ public: unsigned int JobsProcessing = 0; std::deque<cmWorkerPool::JobHandleT> Queue; std::condition_variable Condition; + std::condition_variable ConditionFence; std::vector<std::unique_ptr<cmWorkerPoolWorker>> Workers; // -- References @@ -593,19 +592,12 @@ bool cmWorkerPoolInternal::Process() void cmWorkerPoolInternal::Abort() { - bool notifyThreads = false; // Clear all jobs and set abort flag - { - std::lock_guard<std::mutex> guard(Mutex); - if (Processing && !Aborting) { - // Register abort and clear queue - Aborting = true; - Queue.clear(); - notifyThreads = true; - } - } - if (notifyThreads) { - // Wake threads + std::lock_guard<std::mutex> guard(Mutex); + if (!Aborting) { + // Register abort and clear queue + Aborting = true; + Queue.clear(); Condition.notify_all(); } } @@ -669,7 +661,7 @@ void cmWorkerPoolInternal::Work(unsigned int workerIndex) if (Aborting) { break; } - // Wait for new jobs + // Wait for new jobs on the main CV if (Queue.empty()) { ++WorkersIdle; Condition.wait(uLock); @@ -677,20 +669,34 @@ void cmWorkerPoolInternal::Work(unsigned int workerIndex) continue; } - // Check for fence jobs - if (FenceProcessing || Queue.front()->IsFence()) { - if (JobsProcessing != 0) { - Condition.wait(uLock); - continue; - } - // No jobs get processed. Set the fence job processing flag. - FenceProcessing = true; + // If there is a fence currently active or waiting, + // sleep on the main CV and try again. + if (FenceProcessing) { + Condition.wait(uLock); + continue; } // Pop next job from queue jobHandle = std::move(Queue.front()); Queue.pop_front(); + // Check for fence jobs + bool raisedFence = false; + if (jobHandle->IsFence()) { + FenceProcessing = true; + raisedFence = true; + // Wait on the Fence CV until all pending jobs are done. + while (JobsProcessing != 0 && !Aborting) { + ConditionFence.wait(uLock); + } + // When aborting, explicitly kick all threads alive once more. + if (Aborting) { + FenceProcessing = false; + Condition.notify_all(); + break; + } + } + // Unlocked scope for job processing ++JobsProcessing; { @@ -701,11 +707,18 @@ void cmWorkerPoolInternal::Work(unsigned int workerIndex) } --JobsProcessing; - // Was this a fence job? - if (FenceProcessing) { + // If this was the thread that entered fence processing + // originally, notify all idling workers that the fence + // is done. + if (raisedFence) { FenceProcessing = false; Condition.notify_all(); } + // If fence processing is still not done, notify the + // the fencing worker when all active jobs are done. + if (FenceProcessing && JobsProcessing == 0) { + ConditionFence.notify_all(); + } } // Decrement running workers count diff --git a/Tests/FortranOnly/CMakeLists.txt b/Tests/FortranOnly/CMakeLists.txt index 4327c2f..d24df2d 100644 --- a/Tests/FortranOnly/CMakeLists.txt +++ b/Tests/FortranOnly/CMakeLists.txt @@ -116,3 +116,46 @@ if(CMAKE_Fortran_COMPILER_ID STREQUAL "Intel") set_property(TARGET IntelIfDef PROPERTY Fortran_FORMAT FIXED) target_compile_definitions(IntelIfDef PRIVATE SOME_DEF) endif() + +# Skip these tests if compiler/version doesn't have preprocessing flags +if((CMAKE_Fortran_COMPILER_ID STREQUAL "GNU" AND CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 4.4) + OR (CMAKE_Fortran_COMPILER_ID STREQUAL "XL" AND CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 15.1.6)) + set(test_pp_flags 0) +else() + set(test_pp_flags 1) +endif() + +if(test_pp_flags) + # Test that we can always preprocess a target + add_executable(preprocess_target preprocess2.f) + set_property(TARGET preprocess_target PROPERTY Fortran_PREPROCESS ON) + + # Test that we can preprocess a single source file + add_executable(preprocess_source preprocess3.f) + set_property(SOURCE preprocess3.f PROPERTY Fortran_PREPROCESS ON) +endif() + +# Test that neither the compiler nor CMake performs unnecessary preprocessing. +add_library(no_preprocess_target_lower STATIC no_preprocess_target_lower.f) +target_compile_options(no_preprocess_target_lower PRIVATE -DINTEGER=nonsense) +set_property(TARGET no_preprocess_target_lower PROPERTY Fortran_PREPROCESS OFF) +add_library(no_preprocess_source_lower STATIC no_preprocess_source_lower.f) +target_compile_options(no_preprocess_source_lower PRIVATE -DINTEGER=nonsense) +set_property(SOURCE no_preprocess_source_lower.f PROPERTY Fortran_PREPROCESS OFF) + +# Test that we can explicitly not preprocess a target or source. +# This will not work on certain compilers due to either missing a +# "don't preprocess" flag, or due to choice of file extension. +if(test_pp_flags AND NOT CMAKE_Fortran_COMPILER_ID MATCHES "(Flang|NAG|PGI|SunPro|XL)") + add_library(no_preprocess_target STATIC no_preprocess_target_upper.F) + target_compile_options(no_preprocess_target PRIVATE -DINTEGER=nonsense) + add_library(no_preprocess_source STATIC no_preprocess_source_upper.F) + target_compile_options(no_preprocess_source PRIVATE -DINTEGER=nonsense) + if(NOT CMAKE_Fortran_COMPILER_ID STREQUAL "Cray" + AND NOT "${CMAKE_Fortran_COMPILER_ID};${CMAKE_Fortran_SIMULATE_ID}" STREQUAL "Intel;MSVC") + target_sources(no_preprocess_target PRIVATE no_preprocess_target_fpp.fpp) + target_sources(no_preprocess_source PRIVATE no_preprocess_source_fpp.fpp) + endif() + set_property(TARGET no_preprocess_target PROPERTY Fortran_PREPROCESS OFF) + set_property(SOURCE no_preprocess_source_upper.F no_preprocess_source_fpp.fpp PROPERTY Fortran_PREPROCESS OFF) +endif() diff --git a/Tests/FortranOnly/no_preprocess_source_fpp.fpp b/Tests/FortranOnly/no_preprocess_source_fpp.fpp new file mode 100644 index 0000000..8e48902 --- /dev/null +++ b/Tests/FortranOnly/no_preprocess_source_fpp.fpp @@ -0,0 +1,3 @@ + SUBROUTINE NOPREPROCESS_SOURCE_FPP + INTEGER F + END diff --git a/Tests/FortranOnly/no_preprocess_source_lower.f b/Tests/FortranOnly/no_preprocess_source_lower.f new file mode 100644 index 0000000..3b08782 --- /dev/null +++ b/Tests/FortranOnly/no_preprocess_source_lower.f @@ -0,0 +1,3 @@ + SUBROUTINE NOPREPROCESS_SOURCE_LOWER + INTEGER F + END diff --git a/Tests/FortranOnly/no_preprocess_source_upper.F b/Tests/FortranOnly/no_preprocess_source_upper.F new file mode 100644 index 0000000..02485c9 --- /dev/null +++ b/Tests/FortranOnly/no_preprocess_source_upper.F @@ -0,0 +1,3 @@ + SUBROUTINE NOPREPROCESS_SOURCE_UPPER + INTEGER F + END diff --git a/Tests/FortranOnly/no_preprocess_target_fpp.fpp b/Tests/FortranOnly/no_preprocess_target_fpp.fpp new file mode 100644 index 0000000..f9e6e3b --- /dev/null +++ b/Tests/FortranOnly/no_preprocess_target_fpp.fpp @@ -0,0 +1,3 @@ + SUBROUTINE NOPREPROCESS_TARGET_FPP + INTEGER F + END diff --git a/Tests/FortranOnly/no_preprocess_target_lower.f b/Tests/FortranOnly/no_preprocess_target_lower.f new file mode 100644 index 0000000..ea23a70 --- /dev/null +++ b/Tests/FortranOnly/no_preprocess_target_lower.f @@ -0,0 +1,3 @@ + SUBROUTINE NOPREPROCESS_TARGET_LOWER + INTEGER F + END diff --git a/Tests/FortranOnly/no_preprocess_target_upper.F b/Tests/FortranOnly/no_preprocess_target_upper.F new file mode 100644 index 0000000..34ee04d --- /dev/null +++ b/Tests/FortranOnly/no_preprocess_target_upper.F @@ -0,0 +1,3 @@ + SUBROUTINE NOPREPROCESS_TARGET_UPPER + INTEGER F + END diff --git a/Tests/FortranOnly/preprocess2.f b/Tests/FortranOnly/preprocess2.f new file mode 100644 index 0000000..6595d62 --- /dev/null +++ b/Tests/FortranOnly/preprocess2.f @@ -0,0 +1,4 @@ +#define int INTEGER + PROGRAM PREPRO + int f + END diff --git a/Tests/FortranOnly/preprocess3.f b/Tests/FortranOnly/preprocess3.f new file mode 100644 index 0000000..6595d62 --- /dev/null +++ b/Tests/FortranOnly/preprocess3.f @@ -0,0 +1,4 @@ +#define int INTEGER + PROGRAM PREPRO + int f + END diff --git a/Tests/QtAutogen/Complex/codeeditor.cpp b/Tests/QtAutogen/Complex/codeeditor.cpp index bb6f405..80d6a55 100644 --- a/Tests/QtAutogen/Complex/codeeditor.cpp +++ b/Tests/QtAutogen/Complex/codeeditor.cpp @@ -40,7 +40,10 @@ #include "codeeditor.h" -#include <QtGui> +#include <QPainter> +#include <QSize> +#include <QTextBlock> +#include <QWidget> CodeEditor::CodeEditor(QWidget* parent) : QPlainTextEdit(parent) diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index 230f168..0f94e4e 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -281,6 +281,7 @@ if(NOT CMake_TEST_EXTERNAL_CMAKE) endif() add_RunCMake_test(execute_process) add_RunCMake_test(export) +add_RunCMake_test(cmake_language) add_RunCMake_test(cmake_minimum_required) add_RunCMake_test(cmake_parse_arguments) add_RunCMake_test(continue) @@ -676,5 +677,3 @@ add_RunCMake_test("CTestCommandExpandLists") add_RunCMake_test(PrecompileHeaders -DCMAKE_C_COMPILER_ID=${CMAKE_C_COMPILER_ID}) add_RunCMake_test("UnityBuild") - -add_RunCMake_test(cmake_command) diff --git a/Tests/RunCMake/GenerateExportHeader/RunCMakeTest.cmake b/Tests/RunCMake/GenerateExportHeader/RunCMakeTest.cmake index 18c3340..b3977f1 100644 --- a/Tests/RunCMake/GenerateExportHeader/RunCMakeTest.cmake +++ b/Tests/RunCMake/GenerateExportHeader/RunCMakeTest.cmake @@ -26,4 +26,12 @@ function(run_GEH) endforeach() endfunction() +# remove these flags from the enviornment if they have been set +# so the tests run the correct env +set(env_cxx_flags $ENV{CXXFLAGS}) +if(env_cxx_flags) + string(REPLACE "-fvisibility=hidden" "" env_cxx_flags "${env_cxx_flags}") + string(REPLACE "-fvisibility-inlines-hidden" "" env_cxx_flags "${env_cxx_flags}") + set(ENV{CXXFLAGS} "${env_cxx_flags}") +endif() run_GEH() diff --git a/Tests/RunCMake/NinjaMultiConfig/Install-all-install-ninja-check.cmake b/Tests/RunCMake/NinjaMultiConfig/Install-all-install-ninja-check.cmake new file mode 100644 index 0000000..c588aac --- /dev/null +++ b/Tests/RunCMake/NinjaMultiConfig/Install-all-install-ninja-check.cmake @@ -0,0 +1,39 @@ +check_files("${RunCMake_TEST_BINARY_DIR}" + INCLUDE + ${TARGET_FILE_exe_Debug} + ${TARGET_OBJECT_FILES_exe_Debug} + + ${TARGET_FILE_mylib_Release} + ${TARGET_LINKER_FILE_mylib_Debug} + ${TARGET_OBJECT_FILES_mylib_Debug} + + ${RunCMake_TEST_BINARY_DIR}/install/bin/Debug/${TARGET_FILE_NAME_exe_Debug} + ${RunCMake_TEST_BINARY_DIR}/install/lib/Debug/${TARGET_FILE_NAME_mylib_Debug} + ${RunCMake_TEST_BINARY_DIR}/install/lib/Debug/${TARGET_LINKER_FILE_NAME_mylib_Debug} + + ${TARGET_FILE_exe_Release} + ${TARGET_OBJECT_FILES_exe_Release} + + ${TARGET_FILE_mylib_Release} + ${TARGET_LINKER_FILE_mylib_Release} + ${TARGET_OBJECT_FILES_mylib_Release} + + ${RunCMake_TEST_BINARY_DIR}/install/bin/Release/${TARGET_FILE_NAME_exe_Release} + ${RunCMake_TEST_BINARY_DIR}/install/lib/Release/${TARGET_FILE_NAME_mylib_Release} + ${RunCMake_TEST_BINARY_DIR}/install/lib/Release/${TARGET_LINKER_FILE_NAME_mylib_Release} + + ${TARGET_FILE_exe_RelWithDebInfo} + ${TARGET_OBJECT_FILES_exe_RelWithDebInfo} + + ${TARGET_FILE_mylib_RelWithDebInfo} + ${TARGET_LINKER_FILE_mylib_RelWithDebInfo} + ${TARGET_OBJECT_FILES_mylib_RelWithDebInfo} + + ${RunCMake_TEST_BINARY_DIR}/install/bin/RelWithDebInfo/${TARGET_FILE_NAME_exe_RelWithDebInfo} + ${RunCMake_TEST_BINARY_DIR}/install/lib/RelWithDebInfo/${TARGET_FILE_NAME_mylib_RelWithDebInfo} + ${RunCMake_TEST_BINARY_DIR}/install/lib/RelWithDebInfo/${TARGET_LINKER_FILE_NAME_mylib_RelWithDebInfo} + + EXCLUDE + ${TARGET_OBJECT_FILES_exe_MinSizeRel} + ${TARGET_OBJECT_FILES_mylib_MinSizeRel} + ) diff --git a/Tests/RunCMake/NinjaMultiConfig/Install-default-install-ninja-check.cmake b/Tests/RunCMake/NinjaMultiConfig/Install-default-install-ninja-check.cmake new file mode 100644 index 0000000..bc15a25 --- /dev/null +++ b/Tests/RunCMake/NinjaMultiConfig/Install-default-install-ninja-check.cmake @@ -0,0 +1,31 @@ +check_files("${RunCMake_TEST_BINARY_DIR}" + INCLUDE + ${TARGET_FILE_exe_Debug} + ${TARGET_OBJECT_FILES_exe_Debug} + + ${TARGET_FILE_mylib_Release} + ${TARGET_LINKER_FILE_mylib_Debug} + ${TARGET_OBJECT_FILES_mylib_Debug} + + ${RunCMake_TEST_BINARY_DIR}/install/bin/Debug/${TARGET_FILE_NAME_exe_Debug} + ${RunCMake_TEST_BINARY_DIR}/install/lib/Debug/${TARGET_FILE_NAME_mylib_Debug} + ${RunCMake_TEST_BINARY_DIR}/install/lib/Debug/${TARGET_LINKER_FILE_NAME_mylib_Debug} + + ${TARGET_FILE_exe_Release} + ${TARGET_OBJECT_FILES_exe_Release} + + ${TARGET_FILE_mylib_Release} + ${TARGET_LINKER_FILE_mylib_Release} + ${TARGET_OBJECT_FILES_mylib_Release} + + ${RunCMake_TEST_BINARY_DIR}/install/bin/Release/${TARGET_FILE_NAME_exe_Release} + ${RunCMake_TEST_BINARY_DIR}/install/lib/Release/${TARGET_FILE_NAME_mylib_Release} + ${RunCMake_TEST_BINARY_DIR}/install/lib/Release/${TARGET_LINKER_FILE_NAME_mylib_Release} + + EXCLUDE + ${TARGET_OBJECT_FILES_exe_MinSizeRel} + ${TARGET_OBJECT_FILES_mylib_MinSizeRel} + + ${TARGET_OBJECT_FILES_exe_RelWithDebInfo} + ${TARGET_OBJECT_FILES_mylib_RelWithDebInfo} + ) diff --git a/Tests/RunCMake/NinjaMultiConfig/RunCMakeTest.cmake b/Tests/RunCMake/NinjaMultiConfig/RunCMakeTest.cmake index 23b89d3..76b488e 100644 --- a/Tests/RunCMake/NinjaMultiConfig/RunCMakeTest.cmake +++ b/Tests/RunCMake/NinjaMultiConfig/RunCMakeTest.cmake @@ -263,12 +263,16 @@ run_cmake_build(AdditionalCleanFiles release-clean Release clean) run_ninja(AdditionalCleanFiles all-clean build-Debug.ninja clean:all) set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/Install-build) -set(RunCMake_TEST_OPTIONS "-DCMAKE_INSTALL_PREFIX=${RunCMake_TEST_BINARY_DIR}/install;-DCMAKE_CROSS_CONFIGS=all") +set(RunCMake_TEST_OPTIONS "-DCMAKE_INSTALL_PREFIX=${RunCMake_TEST_BINARY_DIR}/install;-DCMAKE_CROSS_CONFIGS=all;-DCMAKE_DEFAULT_CONFIGS=Debug\\;Release") run_cmake_configure(Install) unset(RunCMake_TEST_OPTIONS) include(${RunCMake_TEST_BINARY_DIR}/target_files.cmake) run_cmake_build(Install release-install Release install) run_ninja(Install debug-in-release-graph-install build-Release.ninja install:Debug) +file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}/install") +run_ninja(Install default-install build.ninja install) +file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}/install") +run_ninja(Install all-install build.ninja install:all) # FIXME Get this working #set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/AutoMocExecutable-build) diff --git a/Tests/RunCMake/cmake_command/RunCMakeTest.cmake b/Tests/RunCMake/cmake_command/RunCMakeTest.cmake deleted file mode 100644 index a6b2efe..0000000 --- a/Tests/RunCMake/cmake_command/RunCMakeTest.cmake +++ /dev/null @@ -1,23 +0,0 @@ -include(RunCMake) - -run_cmake(cmake_command_no_parameters) -run_cmake(cmake_command_unknown_meta_operation) -run_cmake(cmake_command_invoke_double_evaluation) -run_cmake(cmake_command_invoke_expanded_command) -run_cmake(cmake_command_invoke_expanded_command_and_arguments) -run_cmake(cmake_command_invoke_expanded_command_with_explicit_argument) -run_cmake(cmake_command_invoke_expand_command_name) -run_cmake(cmake_command_invoke_expand_function_name) -run_cmake(cmake_command_invoke_message) -run_cmake(cmake_command_invoke_message_fatal_error) -run_cmake(cmake_command_invoke_no_parameters) -run_cmake(cmake_command_invoke_preserve_arguments) -run_cmake(cmake_command_invoke_unknown_function) -run_cmake(cmake_command_eval_expand_command_name) -run_cmake(cmake_command_eval_expanded_command_and_arguments) -run_cmake(cmake_command_eval_extra_parameters_between_eval_and_code) -run_cmake(cmake_command_eval_message) -run_cmake(cmake_command_eval_message_fatal_error) -run_cmake(cmake_command_eval_no_code) -run_cmake(cmake_command_eval_no_parameters) -run_cmake(cmake_command_eval_variable_outside_message) diff --git a/Tests/RunCMake/cmake_command/cmake_command_eval_expand_command_name.cmake b/Tests/RunCMake/cmake_command/cmake_command_eval_expand_command_name.cmake deleted file mode 100644 index 4cea393..0000000 --- a/Tests/RunCMake/cmake_command/cmake_command_eval_expand_command_name.cmake +++ /dev/null @@ -1,2 +0,0 @@ -set (my_eval "EVAL") -cmake_command (${my_eval} CODE message("OK!")) diff --git a/Tests/RunCMake/cmake_command/cmake_command_eval_extra_parameters_between_eval_and_code-stderr.txt b/Tests/RunCMake/cmake_command/cmake_command_eval_extra_parameters_between_eval_and_code-stderr.txt deleted file mode 100644 index 13c114e..0000000 --- a/Tests/RunCMake/cmake_command/cmake_command_eval_extra_parameters_between_eval_and_code-stderr.txt +++ /dev/null @@ -1,5 +0,0 @@ -CMake Error at cmake_command_eval_extra_parameters_between_eval_and_code.cmake:1 \(cmake_command\): - cmake_command called with unsupported arguments between EVAL and CODE - arguments -Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/cmake_command/cmake_command_eval_extra_parameters_between_eval_and_code.cmake b/Tests/RunCMake/cmake_command/cmake_command_eval_extra_parameters_between_eval_and_code.cmake deleted file mode 100644 index 0927631..0000000 --- a/Tests/RunCMake/cmake_command/cmake_command_eval_extra_parameters_between_eval_and_code.cmake +++ /dev/null @@ -1 +0,0 @@ -cmake_command(EVAL BAD CODE "message(BAD CODE)") diff --git a/Tests/RunCMake/cmake_command/cmake_command_eval_message.cmake b/Tests/RunCMake/cmake_command/cmake_command_eval_message.cmake deleted file mode 100644 index 9ef5e25..0000000 --- a/Tests/RunCMake/cmake_command/cmake_command_eval_message.cmake +++ /dev/null @@ -1 +0,0 @@ -cmake_command(EVAL CODE message(WORKS!)) diff --git a/Tests/RunCMake/cmake_command/cmake_command_eval_message_fatal_error-stderr.txt b/Tests/RunCMake/cmake_command/cmake_command_eval_message_fatal_error-stderr.txt deleted file mode 100644 index 6a8a124..0000000 --- a/Tests/RunCMake/cmake_command/cmake_command_eval_message_fatal_error-stderr.txt +++ /dev/null @@ -1,5 +0,0 @@ -CMake Error at cmake_command_eval_message_fatal_error.cmake:1:EVAL:2 \(message\): - error! -Call Stack \(most recent call first\): - cmake_command_eval_message_fatal_error.cmake:1 \(cmake_command\) - CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/cmake_command/cmake_command_eval_no_code-stderr.txt b/Tests/RunCMake/cmake_command/cmake_command_eval_no_code-stderr.txt deleted file mode 100644 index ee53312..0000000 --- a/Tests/RunCMake/cmake_command/cmake_command_eval_no_code-stderr.txt +++ /dev/null @@ -1,2 +0,0 @@ -CMake Error at cmake_command_eval_no_code.cmake:1 \(cmake_command\): - cmake_command called without CODE argument diff --git a/Tests/RunCMake/cmake_command/cmake_command_eval_no_code.cmake b/Tests/RunCMake/cmake_command/cmake_command_eval_no_code.cmake deleted file mode 100644 index 22e1667..0000000 --- a/Tests/RunCMake/cmake_command/cmake_command_eval_no_code.cmake +++ /dev/null @@ -1 +0,0 @@ -cmake_command(EVAL message "too many parameters") diff --git a/Tests/RunCMake/cmake_command/cmake_command_eval_no_parameters-stderr.txt b/Tests/RunCMake/cmake_command/cmake_command_eval_no_parameters-stderr.txt deleted file mode 100644 index e9fc317..0000000 --- a/Tests/RunCMake/cmake_command/cmake_command_eval_no_parameters-stderr.txt +++ /dev/null @@ -1,2 +0,0 @@ -CMake Error at cmake_command_eval_no_parameters.cmake:1 \(cmake_command\): - cmake_command called with incorrect number of arguments diff --git a/Tests/RunCMake/cmake_command/cmake_command_eval_no_parameters.cmake b/Tests/RunCMake/cmake_command/cmake_command_eval_no_parameters.cmake deleted file mode 100644 index a5ba2c7..0000000 --- a/Tests/RunCMake/cmake_command/cmake_command_eval_no_parameters.cmake +++ /dev/null @@ -1 +0,0 @@ -cmake_command(EVAL) diff --git a/Tests/RunCMake/cmake_command/cmake_command_eval_variable_outside_message.cmake b/Tests/RunCMake/cmake_command/cmake_command_eval_variable_outside_message.cmake deleted file mode 100644 index b7a06a5..0000000 --- a/Tests/RunCMake/cmake_command/cmake_command_eval_variable_outside_message.cmake +++ /dev/null @@ -1,2 +0,0 @@ -cmake_command(EVAL CODE "set(phrase \"WORKS!\")") -message(${phrase}) diff --git a/Tests/RunCMake/cmake_command/cmake_command_invoke_double_evaluation.cmake b/Tests/RunCMake/cmake_command/cmake_command_invoke_double_evaluation.cmake deleted file mode 100644 index 10970fc..0000000 --- a/Tests/RunCMake/cmake_command/cmake_command_invoke_double_evaluation.cmake +++ /dev/null @@ -1,2 +0,0 @@ -set(var [[${foo}]]) -cmake_command(INVOKE cmake_command INVOKE message "var='${var}'") diff --git a/Tests/RunCMake/cmake_command/cmake_command_invoke_expand_command_name.cmake b/Tests/RunCMake/cmake_command/cmake_command_invoke_expand_command_name.cmake deleted file mode 100644 index d59afe4..0000000 --- a/Tests/RunCMake/cmake_command/cmake_command_invoke_expand_command_name.cmake +++ /dev/null @@ -1,2 +0,0 @@ -set (my_invoke "INVOKE") -cmake_command (${my_invoke} message "OK!") diff --git a/Tests/RunCMake/cmake_command/cmake_command_invoke_expanded_command_and_arguments-stderr.txt b/Tests/RunCMake/cmake_command/cmake_command_invoke_expanded_command_and_arguments-stderr.txt deleted file mode 100644 index 6d0e241..0000000 --- a/Tests/RunCMake/cmake_command/cmake_command_invoke_expanded_command_and_arguments-stderr.txt +++ /dev/null @@ -1,4 +0,0 @@ -CMake Error at cmake_command_invoke_expanded_command_and_arguments.cmake:2 \(cmake_command\): - cmake_command called with incorrect number of arguments -Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/cmake_command/cmake_command_invoke_expanded_command_and_arguments.cmake b/Tests/RunCMake/cmake_command/cmake_command_invoke_expanded_command_and_arguments.cmake deleted file mode 100644 index 6bfa3a7..0000000 --- a/Tests/RunCMake/cmake_command/cmake_command_invoke_expanded_command_and_arguments.cmake +++ /dev/null @@ -1,2 +0,0 @@ -set(invoke_message INVOKE message a b) -cmake_command(${invoke_message}) diff --git a/Tests/RunCMake/cmake_command/cmake_command_invoke_expanded_command_with_explicit_argument.cmake b/Tests/RunCMake/cmake_command/cmake_command_invoke_expanded_command_with_explicit_argument.cmake deleted file mode 100644 index eb0411f..0000000 --- a/Tests/RunCMake/cmake_command/cmake_command_invoke_expanded_command_with_explicit_argument.cmake +++ /dev/null @@ -1,2 +0,0 @@ -set (cmd INVOKE message) -cmake_command (${cmd} "OK!") diff --git a/Tests/RunCMake/cmake_command/cmake_command_invoke_message.cmake b/Tests/RunCMake/cmake_command/cmake_command_invoke_message.cmake deleted file mode 100644 index 336d78a..0000000 --- a/Tests/RunCMake/cmake_command/cmake_command_invoke_message.cmake +++ /dev/null @@ -1 +0,0 @@ -cmake_command(INVOKE message WORKS!) diff --git a/Tests/RunCMake/cmake_command/cmake_command_invoke_message_fatal_error-stderr.txt b/Tests/RunCMake/cmake_command/cmake_command_invoke_message_fatal_error-stderr.txt deleted file mode 100644 index 2c9dab5..0000000 --- a/Tests/RunCMake/cmake_command/cmake_command_invoke_message_fatal_error-stderr.txt +++ /dev/null @@ -1,5 +0,0 @@ -CMake Error at cmake_command_invoke_message_fatal_error.cmake:1 \(message\): - error! -Call Stack \(most recent call first\): - cmake_command_invoke_message_fatal_error.cmake:1 \(cmake_command\) - CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/cmake_command/cmake_command_invoke_message_fatal_error.cmake b/Tests/RunCMake/cmake_command/cmake_command_invoke_message_fatal_error.cmake deleted file mode 100644 index 6b42764..0000000 --- a/Tests/RunCMake/cmake_command/cmake_command_invoke_message_fatal_error.cmake +++ /dev/null @@ -1 +0,0 @@ -cmake_command(INVOKE message FATAL_ERROR error!) diff --git a/Tests/RunCMake/cmake_command/cmake_command_invoke_no_parameters-stderr.txt b/Tests/RunCMake/cmake_command/cmake_command_invoke_no_parameters-stderr.txt deleted file mode 100644 index 7741b41..0000000 --- a/Tests/RunCMake/cmake_command/cmake_command_invoke_no_parameters-stderr.txt +++ /dev/null @@ -1,2 +0,0 @@ -CMake Error at cmake_command_invoke_no_parameters.cmake:1 \(cmake_command\): - cmake_command called with incorrect number of arguments diff --git a/Tests/RunCMake/cmake_command/cmake_command_invoke_no_parameters.cmake b/Tests/RunCMake/cmake_command/cmake_command_invoke_no_parameters.cmake deleted file mode 100644 index b9c5e14..0000000 --- a/Tests/RunCMake/cmake_command/cmake_command_invoke_no_parameters.cmake +++ /dev/null @@ -1 +0,0 @@ -cmake_command(INVOKE) diff --git a/Tests/RunCMake/cmake_command/cmake_command_invoke_unknown_function-stderr.txt b/Tests/RunCMake/cmake_command/cmake_command_invoke_unknown_function-stderr.txt deleted file mode 100644 index 50a81a3..0000000 --- a/Tests/RunCMake/cmake_command/cmake_command_invoke_unknown_function-stderr.txt +++ /dev/null @@ -1,2 +0,0 @@ -CMake Error at cmake_command_invoke_unknown_function.cmake:1 \(unknown\): - Unknown CMake command "unknown". diff --git a/Tests/RunCMake/cmake_command/cmake_command_invoke_unknown_function.cmake b/Tests/RunCMake/cmake_command/cmake_command_invoke_unknown_function.cmake deleted file mode 100644 index f19a04b..0000000 --- a/Tests/RunCMake/cmake_command/cmake_command_invoke_unknown_function.cmake +++ /dev/null @@ -1 +0,0 @@ -cmake_command(INVOKE unknown) diff --git a/Tests/RunCMake/cmake_command/cmake_command_no_parameters-stderr.txt b/Tests/RunCMake/cmake_command/cmake_command_no_parameters-stderr.txt deleted file mode 100644 index 772b604..0000000 --- a/Tests/RunCMake/cmake_command/cmake_command_no_parameters-stderr.txt +++ /dev/null @@ -1,2 +0,0 @@ -CMake Error at cmake_command_no_parameters.cmake:1 \(cmake_command\): - cmake_command called with incorrect number of arguments diff --git a/Tests/RunCMake/cmake_command/cmake_command_no_parameters.cmake b/Tests/RunCMake/cmake_command/cmake_command_no_parameters.cmake deleted file mode 100644 index b9c5e14..0000000 --- a/Tests/RunCMake/cmake_command/cmake_command_no_parameters.cmake +++ /dev/null @@ -1 +0,0 @@ -cmake_command(INVOKE) diff --git a/Tests/RunCMake/cmake_command/cmake_command_unknown_meta_operation-stderr.txt b/Tests/RunCMake/cmake_command/cmake_command_unknown_meta_operation-stderr.txt deleted file mode 100644 index 7b9b915..0000000 --- a/Tests/RunCMake/cmake_command/cmake_command_unknown_meta_operation-stderr.txt +++ /dev/null @@ -1,2 +0,0 @@ -CMake Error at cmake_command_unknown_meta_operation.cmake:1 \(cmake_command\): - cmake_command called with unknown meta-operation diff --git a/Tests/RunCMake/cmake_command/cmake_command_unknown_meta_operation.cmake b/Tests/RunCMake/cmake_command/cmake_command_unknown_meta_operation.cmake deleted file mode 100644 index f7c77e5..0000000 --- a/Tests/RunCMake/cmake_command/cmake_command_unknown_meta_operation.cmake +++ /dev/null @@ -1 +0,0 @@ -cmake_command(UNKNOWN) diff --git a/Tests/RunCMake/cmake_command/CMakeLists.txt b/Tests/RunCMake/cmake_language/CMakeLists.txt index 2632ffa..2632ffa 100644 --- a/Tests/RunCMake/cmake_command/CMakeLists.txt +++ b/Tests/RunCMake/cmake_language/CMakeLists.txt diff --git a/Tests/RunCMake/cmake_language/RunCMakeTest.cmake b/Tests/RunCMake/cmake_language/RunCMakeTest.cmake new file mode 100644 index 0000000..c556e42 --- /dev/null +++ b/Tests/RunCMake/cmake_language/RunCMakeTest.cmake @@ -0,0 +1,23 @@ +include(RunCMake) + +run_cmake(no_parameters) +run_cmake(unknown_meta_operation) +run_cmake(call_double_evaluation) +run_cmake(call_expanded_command) +run_cmake(call_expanded_command_and_arguments) +run_cmake(call_expanded_command_with_explicit_argument) +run_cmake(call_expand_command_name) +run_cmake(call_expand_function_name) +run_cmake(call_message) +run_cmake(call_message_fatal_error) +run_cmake(call_no_parameters) +run_cmake(call_preserve_arguments) +run_cmake(call_unknown_function) +run_cmake(eval_expand_command_name) +run_cmake(eval_expanded_command_and_arguments) +run_cmake(eval_extra_parameters_between_eval_and_code) +run_cmake(eval_message) +run_cmake(eval_message_fatal_error) +run_cmake(eval_no_code) +run_cmake(eval_no_parameters) +run_cmake(eval_variable_outside_message) diff --git a/Tests/RunCMake/cmake_command/cmake_command_invoke_double_evaluation-stderr.txt b/Tests/RunCMake/cmake_language/call_double_evaluation-stderr.txt index 59a70bd..59a70bd 100644 --- a/Tests/RunCMake/cmake_command/cmake_command_invoke_double_evaluation-stderr.txt +++ b/Tests/RunCMake/cmake_language/call_double_evaluation-stderr.txt diff --git a/Tests/RunCMake/cmake_language/call_double_evaluation.cmake b/Tests/RunCMake/cmake_language/call_double_evaluation.cmake new file mode 100644 index 0000000..cf8fc91 --- /dev/null +++ b/Tests/RunCMake/cmake_language/call_double_evaluation.cmake @@ -0,0 +1,2 @@ +set(var [[${foo}]]) +cmake_language(CALL cmake_language CALL message "var='${var}'") diff --git a/Tests/RunCMake/cmake_command/cmake_command_invoke_expanded_command_with_explicit_argument-stderr.txt b/Tests/RunCMake/cmake_language/call_expand_command_name-stderr.txt index d640661..d640661 100644 --- a/Tests/RunCMake/cmake_command/cmake_command_invoke_expanded_command_with_explicit_argument-stderr.txt +++ b/Tests/RunCMake/cmake_language/call_expand_command_name-stderr.txt diff --git a/Tests/RunCMake/cmake_language/call_expand_command_name.cmake b/Tests/RunCMake/cmake_language/call_expand_command_name.cmake new file mode 100644 index 0000000..e03bb1f --- /dev/null +++ b/Tests/RunCMake/cmake_language/call_expand_command_name.cmake @@ -0,0 +1,2 @@ +set (my_call "CALL") +cmake_language (${my_call} message "OK!") diff --git a/Tests/RunCMake/cmake_command/cmake_command_unknown_meta_operation-result.txt b/Tests/RunCMake/cmake_language/call_expand_function_name-stderr.txt index d00491f..d00491f 100644 --- a/Tests/RunCMake/cmake_command/cmake_command_unknown_meta_operation-result.txt +++ b/Tests/RunCMake/cmake_language/call_expand_function_name-stderr.txt diff --git a/Tests/RunCMake/cmake_command/cmake_command_invoke_expand_function_name.cmake b/Tests/RunCMake/cmake_language/call_expand_function_name.cmake index 923ddaa..565a7df 100644 --- a/Tests/RunCMake/cmake_command/cmake_command_invoke_expand_function_name.cmake +++ b/Tests/RunCMake/cmake_language/call_expand_function_name.cmake @@ -8,4 +8,4 @@ endfunction() set(function_version 1) -cmake_command(INVOKE some_function_${function_version}) +cmake_language(CALL some_function_${function_version}) diff --git a/Tests/RunCMake/cmake_command/cmake_command_invoke_expanded_command-stderr.txt b/Tests/RunCMake/cmake_language/call_expanded_command-stderr.txt index d640661..d640661 100644 --- a/Tests/RunCMake/cmake_command/cmake_command_invoke_expanded_command-stderr.txt +++ b/Tests/RunCMake/cmake_language/call_expanded_command-stderr.txt diff --git a/Tests/RunCMake/cmake_command/cmake_command_invoke_expanded_command.cmake b/Tests/RunCMake/cmake_language/call_expanded_command.cmake index bca7d2f..e76e612 100644 --- a/Tests/RunCMake/cmake_command/cmake_command_invoke_expanded_command.cmake +++ b/Tests/RunCMake/cmake_language/call_expanded_command.cmake @@ -2,5 +2,5 @@ function (itsok) message(OK!) endfunction() -set (cmd INVOKE itsok) -cmake_command (${cmd}) +set (cmd CALL itsok) +cmake_language (${cmd}) diff --git a/Tests/RunCMake/cmake_command/cmake_command_no_parameters-result.txt b/Tests/RunCMake/cmake_language/call_expanded_command_and_arguments-result.txt index d00491f..d00491f 100644 --- a/Tests/RunCMake/cmake_command/cmake_command_no_parameters-result.txt +++ b/Tests/RunCMake/cmake_language/call_expanded_command_and_arguments-result.txt diff --git a/Tests/RunCMake/cmake_language/call_expanded_command_and_arguments-stderr.txt b/Tests/RunCMake/cmake_language/call_expanded_command_and_arguments-stderr.txt new file mode 100644 index 0000000..e87e9bc --- /dev/null +++ b/Tests/RunCMake/cmake_language/call_expanded_command_and_arguments-stderr.txt @@ -0,0 +1,4 @@ +CMake Error at call_expanded_command_and_arguments.cmake:2 \(cmake_language\): + cmake_language called with incorrect number of arguments +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/cmake_language/call_expanded_command_and_arguments.cmake b/Tests/RunCMake/cmake_language/call_expanded_command_and_arguments.cmake new file mode 100644 index 0000000..4ce6b34 --- /dev/null +++ b/Tests/RunCMake/cmake_language/call_expanded_command_and_arguments.cmake @@ -0,0 +1,2 @@ +set(call_message CALL message a b) +cmake_language(${call_message}) diff --git a/Tests/RunCMake/cmake_command/cmake_command_invoke_expand_command_name-stderr.txt b/Tests/RunCMake/cmake_language/call_expanded_command_with_explicit_argument-stderr.txt index d640661..d640661 100644 --- a/Tests/RunCMake/cmake_command/cmake_command_invoke_expand_command_name-stderr.txt +++ b/Tests/RunCMake/cmake_language/call_expanded_command_with_explicit_argument-stderr.txt diff --git a/Tests/RunCMake/cmake_language/call_expanded_command_with_explicit_argument.cmake b/Tests/RunCMake/cmake_language/call_expanded_command_with_explicit_argument.cmake new file mode 100644 index 0000000..0563400 --- /dev/null +++ b/Tests/RunCMake/cmake_language/call_expanded_command_with_explicit_argument.cmake @@ -0,0 +1,2 @@ +set (cmd CALL message) +cmake_language (${cmd} "OK!") diff --git a/Tests/RunCMake/cmake_command/cmake_command_invoke_message-stderr.txt b/Tests/RunCMake/cmake_language/call_message-stderr.txt index cfc8694..cfc8694 100644 --- a/Tests/RunCMake/cmake_command/cmake_command_invoke_message-stderr.txt +++ b/Tests/RunCMake/cmake_language/call_message-stderr.txt diff --git a/Tests/RunCMake/cmake_language/call_message.cmake b/Tests/RunCMake/cmake_language/call_message.cmake new file mode 100644 index 0000000..31aefdf --- /dev/null +++ b/Tests/RunCMake/cmake_language/call_message.cmake @@ -0,0 +1 @@ +cmake_language(CALL message WORKS!) diff --git a/Tests/RunCMake/cmake_command/cmake_command_invoke_unknown_function-result.txt b/Tests/RunCMake/cmake_language/call_message_fatal_error-result.txt index d00491f..d00491f 100644 --- a/Tests/RunCMake/cmake_command/cmake_command_invoke_unknown_function-result.txt +++ b/Tests/RunCMake/cmake_language/call_message_fatal_error-result.txt diff --git a/Tests/RunCMake/cmake_language/call_message_fatal_error-stderr.txt b/Tests/RunCMake/cmake_language/call_message_fatal_error-stderr.txt new file mode 100644 index 0000000..83eb3d8 --- /dev/null +++ b/Tests/RunCMake/cmake_language/call_message_fatal_error-stderr.txt @@ -0,0 +1,5 @@ +CMake Error at call_message_fatal_error.cmake:1 \(message\): + error! +Call Stack \(most recent call first\): + call_message_fatal_error.cmake:1 \(cmake_language\) + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/cmake_language/call_message_fatal_error.cmake b/Tests/RunCMake/cmake_language/call_message_fatal_error.cmake new file mode 100644 index 0000000..935b437 --- /dev/null +++ b/Tests/RunCMake/cmake_language/call_message_fatal_error.cmake @@ -0,0 +1 @@ +cmake_language(CALL message FATAL_ERROR error!) diff --git a/Tests/RunCMake/cmake_command/cmake_command_invoke_no_parameters-result.txt b/Tests/RunCMake/cmake_language/call_no_parameters-result.txt index d00491f..d00491f 100644 --- a/Tests/RunCMake/cmake_command/cmake_command_invoke_no_parameters-result.txt +++ b/Tests/RunCMake/cmake_language/call_no_parameters-result.txt diff --git a/Tests/RunCMake/cmake_language/call_no_parameters-stderr.txt b/Tests/RunCMake/cmake_language/call_no_parameters-stderr.txt new file mode 100644 index 0000000..9e2c08f --- /dev/null +++ b/Tests/RunCMake/cmake_language/call_no_parameters-stderr.txt @@ -0,0 +1,2 @@ +CMake Error at call_no_parameters.cmake:1 \(cmake_language\): + cmake_language called with incorrect number of arguments diff --git a/Tests/RunCMake/cmake_language/call_no_parameters.cmake b/Tests/RunCMake/cmake_language/call_no_parameters.cmake new file mode 100644 index 0000000..8353e08 --- /dev/null +++ b/Tests/RunCMake/cmake_language/call_no_parameters.cmake @@ -0,0 +1 @@ +cmake_language(CALL) diff --git a/Tests/RunCMake/cmake_command/cmake_command_invoke_preserve_arguments-stderr.txt b/Tests/RunCMake/cmake_language/call_preserve_arguments-stderr.txt index 4670e60..8ec5483 100644 --- a/Tests/RunCMake/cmake_command/cmake_command_invoke_preserve_arguments-stderr.txt +++ b/Tests/RunCMake/cmake_language/call_preserve_arguments-stderr.txt @@ -1,6 +1,6 @@ foo\(...\) \[a;b\] \[c;d\] -cmake_command\(INVOKE foo ...\) +cmake_language\(CALL foo ...\) \[a;b\] \[c;d\] diff --git a/Tests/RunCMake/cmake_command/cmake_command_invoke_preserve_arguments.cmake b/Tests/RunCMake/cmake_language/call_preserve_arguments.cmake index 53ac2e6..bfef0fd 100644 --- a/Tests/RunCMake/cmake_command/cmake_command_invoke_preserve_arguments.cmake +++ b/Tests/RunCMake/cmake_language/call_preserve_arguments.cmake @@ -8,5 +8,5 @@ endfunction() message("foo(...)") foo("a;b" "c;d") -message("cmake_command(INVOKE foo ...)") -cmake_command(INVOKE foo "a;b" "c;d") +message("cmake_language(CALL foo ...)") +cmake_language(CALL foo "a;b" "c;d") diff --git a/Tests/RunCMake/cmake_command/cmake_command_invoke_message_fatal_error-result.txt b/Tests/RunCMake/cmake_language/call_unknown_function-result.txt index d00491f..d00491f 100644 --- a/Tests/RunCMake/cmake_command/cmake_command_invoke_message_fatal_error-result.txt +++ b/Tests/RunCMake/cmake_language/call_unknown_function-result.txt diff --git a/Tests/RunCMake/cmake_language/call_unknown_function-stderr.txt b/Tests/RunCMake/cmake_language/call_unknown_function-stderr.txt new file mode 100644 index 0000000..d09e708 --- /dev/null +++ b/Tests/RunCMake/cmake_language/call_unknown_function-stderr.txt @@ -0,0 +1,2 @@ +CMake Error at call_unknown_function.cmake:1 \(unknown\): + Unknown CMake command "unknown". diff --git a/Tests/RunCMake/cmake_language/call_unknown_function.cmake b/Tests/RunCMake/cmake_language/call_unknown_function.cmake new file mode 100644 index 0000000..efd6baf --- /dev/null +++ b/Tests/RunCMake/cmake_language/call_unknown_function.cmake @@ -0,0 +1 @@ +cmake_language(CALL unknown) diff --git a/Tests/RunCMake/cmake_command/cmake_command_eval_expanded_command_and_arguments-stderr.txt b/Tests/RunCMake/cmake_language/eval_expand_command_name-stderr.txt index d640661..d640661 100644 --- a/Tests/RunCMake/cmake_command/cmake_command_eval_expanded_command_and_arguments-stderr.txt +++ b/Tests/RunCMake/cmake_language/eval_expand_command_name-stderr.txt diff --git a/Tests/RunCMake/cmake_language/eval_expand_command_name.cmake b/Tests/RunCMake/cmake_language/eval_expand_command_name.cmake new file mode 100644 index 0000000..2397232 --- /dev/null +++ b/Tests/RunCMake/cmake_language/eval_expand_command_name.cmake @@ -0,0 +1,2 @@ +set (my_eval "EVAL") +cmake_language (${my_eval} CODE message("OK!")) diff --git a/Tests/RunCMake/cmake_command/cmake_command_eval_expand_command_name-stderr.txt b/Tests/RunCMake/cmake_language/eval_expanded_command_and_arguments-stderr.txt index d640661..d640661 100644 --- a/Tests/RunCMake/cmake_command/cmake_command_eval_expand_command_name-stderr.txt +++ b/Tests/RunCMake/cmake_language/eval_expanded_command_and_arguments-stderr.txt diff --git a/Tests/RunCMake/cmake_command/cmake_command_eval_expanded_command_and_arguments.cmake b/Tests/RunCMake/cmake_language/eval_expanded_command_and_arguments.cmake index fcc399b..f7d2d51 100644 --- a/Tests/RunCMake/cmake_command/cmake_command_eval_expanded_command_and_arguments.cmake +++ b/Tests/RunCMake/cmake_language/eval_expanded_command_and_arguments.cmake @@ -1,2 +1,2 @@ set(cmd EVAL CODE [[message("OK!")]]) -cmake_command(${cmd}) +cmake_language(${cmd}) diff --git a/Tests/RunCMake/cmake_command/cmake_command_invoke_expanded_command_and_arguments-result.txt b/Tests/RunCMake/cmake_language/eval_extra_parameters_between_eval_and_code-result.txt index d00491f..d00491f 100644 --- a/Tests/RunCMake/cmake_command/cmake_command_invoke_expanded_command_and_arguments-result.txt +++ b/Tests/RunCMake/cmake_language/eval_extra_parameters_between_eval_and_code-result.txt diff --git a/Tests/RunCMake/cmake_language/eval_extra_parameters_between_eval_and_code-stderr.txt b/Tests/RunCMake/cmake_language/eval_extra_parameters_between_eval_and_code-stderr.txt new file mode 100644 index 0000000..d32054f --- /dev/null +++ b/Tests/RunCMake/cmake_language/eval_extra_parameters_between_eval_and_code-stderr.txt @@ -0,0 +1,5 @@ +CMake Error at eval_extra_parameters_between_eval_and_code.cmake:1 \(cmake_language\): + cmake_language called with unsupported arguments between EVAL and CODE + arguments +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/cmake_language/eval_extra_parameters_between_eval_and_code.cmake b/Tests/RunCMake/cmake_language/eval_extra_parameters_between_eval_and_code.cmake new file mode 100644 index 0000000..7c004d7 --- /dev/null +++ b/Tests/RunCMake/cmake_language/eval_extra_parameters_between_eval_and_code.cmake @@ -0,0 +1 @@ +cmake_language(EVAL BAD CODE "message(BAD CODE)") diff --git a/Tests/RunCMake/cmake_command/cmake_command_eval_variable_outside_message-stderr.txt b/Tests/RunCMake/cmake_language/eval_message-stderr.txt index cfc8694..cfc8694 100644 --- a/Tests/RunCMake/cmake_command/cmake_command_eval_variable_outside_message-stderr.txt +++ b/Tests/RunCMake/cmake_language/eval_message-stderr.txt diff --git a/Tests/RunCMake/cmake_language/eval_message.cmake b/Tests/RunCMake/cmake_language/eval_message.cmake new file mode 100644 index 0000000..91edcdd --- /dev/null +++ b/Tests/RunCMake/cmake_language/eval_message.cmake @@ -0,0 +1 @@ +cmake_language(EVAL CODE message(WORKS!)) diff --git a/Tests/RunCMake/cmake_command/cmake_command_invoke_expand_function_name-stderr.txt b/Tests/RunCMake/cmake_language/eval_message_fatal_error-result.txt index d00491f..d00491f 100644 --- a/Tests/RunCMake/cmake_command/cmake_command_invoke_expand_function_name-stderr.txt +++ b/Tests/RunCMake/cmake_language/eval_message_fatal_error-result.txt diff --git a/Tests/RunCMake/cmake_language/eval_message_fatal_error-stderr.txt b/Tests/RunCMake/cmake_language/eval_message_fatal_error-stderr.txt new file mode 100644 index 0000000..5cf11e3 --- /dev/null +++ b/Tests/RunCMake/cmake_language/eval_message_fatal_error-stderr.txt @@ -0,0 +1,5 @@ +CMake Error at eval_message_fatal_error.cmake:1:EVAL:2 \(message\): + error! +Call Stack \(most recent call first\): + eval_message_fatal_error.cmake:1 \(cmake_language\) + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/cmake_command/cmake_command_eval_message_fatal_error.cmake b/Tests/RunCMake/cmake_language/eval_message_fatal_error.cmake index 22913de..72e155d 100644 --- a/Tests/RunCMake/cmake_command/cmake_command_eval_message_fatal_error.cmake +++ b/Tests/RunCMake/cmake_language/eval_message_fatal_error.cmake @@ -1,4 +1,4 @@ -cmake_command(EVAL CODE +cmake_language(EVAL CODE " message(FATAL_ERROR error!) " diff --git a/Tests/RunCMake/cmake_command/cmake_command_eval_no_parameters-result.txt b/Tests/RunCMake/cmake_language/eval_no_code-result.txt index d00491f..d00491f 100644 --- a/Tests/RunCMake/cmake_command/cmake_command_eval_no_parameters-result.txt +++ b/Tests/RunCMake/cmake_language/eval_no_code-result.txt diff --git a/Tests/RunCMake/cmake_language/eval_no_code-stderr.txt b/Tests/RunCMake/cmake_language/eval_no_code-stderr.txt new file mode 100644 index 0000000..608ba88 --- /dev/null +++ b/Tests/RunCMake/cmake_language/eval_no_code-stderr.txt @@ -0,0 +1,2 @@ +CMake Error at eval_no_code.cmake:1 \(cmake_language\): + cmake_language called without CODE argument diff --git a/Tests/RunCMake/cmake_language/eval_no_code.cmake b/Tests/RunCMake/cmake_language/eval_no_code.cmake new file mode 100644 index 0000000..7f5bc21 --- /dev/null +++ b/Tests/RunCMake/cmake_language/eval_no_code.cmake @@ -0,0 +1 @@ +cmake_language(EVAL message "too many parameters") diff --git a/Tests/RunCMake/cmake_command/cmake_command_eval_no_code-result.txt b/Tests/RunCMake/cmake_language/eval_no_parameters-result.txt index d00491f..d00491f 100644 --- a/Tests/RunCMake/cmake_command/cmake_command_eval_no_code-result.txt +++ b/Tests/RunCMake/cmake_language/eval_no_parameters-result.txt diff --git a/Tests/RunCMake/cmake_language/eval_no_parameters-stderr.txt b/Tests/RunCMake/cmake_language/eval_no_parameters-stderr.txt new file mode 100644 index 0000000..6166898 --- /dev/null +++ b/Tests/RunCMake/cmake_language/eval_no_parameters-stderr.txt @@ -0,0 +1,2 @@ +CMake Error at eval_no_parameters.cmake:1 \(cmake_language\): + cmake_language called with incorrect number of arguments diff --git a/Tests/RunCMake/cmake_language/eval_no_parameters.cmake b/Tests/RunCMake/cmake_language/eval_no_parameters.cmake new file mode 100644 index 0000000..e7ae808 --- /dev/null +++ b/Tests/RunCMake/cmake_language/eval_no_parameters.cmake @@ -0,0 +1 @@ +cmake_language(EVAL) diff --git a/Tests/RunCMake/cmake_command/cmake_command_eval_message-stderr.txt b/Tests/RunCMake/cmake_language/eval_variable_outside_message-stderr.txt index cfc8694..cfc8694 100644 --- a/Tests/RunCMake/cmake_command/cmake_command_eval_message-stderr.txt +++ b/Tests/RunCMake/cmake_language/eval_variable_outside_message-stderr.txt diff --git a/Tests/RunCMake/cmake_language/eval_variable_outside_message.cmake b/Tests/RunCMake/cmake_language/eval_variable_outside_message.cmake new file mode 100644 index 0000000..71f0457 --- /dev/null +++ b/Tests/RunCMake/cmake_language/eval_variable_outside_message.cmake @@ -0,0 +1,2 @@ +cmake_language(EVAL CODE "set(phrase \"WORKS!\")") +message(${phrase}) diff --git a/Tests/RunCMake/cmake_command/cmake_command_eval_message_fatal_error-result.txt b/Tests/RunCMake/cmake_language/no_parameters-result.txt index d00491f..d00491f 100644 --- a/Tests/RunCMake/cmake_command/cmake_command_eval_message_fatal_error-result.txt +++ b/Tests/RunCMake/cmake_language/no_parameters-result.txt diff --git a/Tests/RunCMake/cmake_language/no_parameters-stderr.txt b/Tests/RunCMake/cmake_language/no_parameters-stderr.txt new file mode 100644 index 0000000..194bbe3 --- /dev/null +++ b/Tests/RunCMake/cmake_language/no_parameters-stderr.txt @@ -0,0 +1,2 @@ +CMake Error at no_parameters.cmake:1 \(cmake_language\): + cmake_language called with incorrect number of arguments diff --git a/Tests/RunCMake/cmake_language/no_parameters.cmake b/Tests/RunCMake/cmake_language/no_parameters.cmake new file mode 100644 index 0000000..8353e08 --- /dev/null +++ b/Tests/RunCMake/cmake_language/no_parameters.cmake @@ -0,0 +1 @@ +cmake_language(CALL) diff --git a/Tests/RunCMake/cmake_command/cmake_command_eval_extra_parameters_between_eval_and_code-result.txt b/Tests/RunCMake/cmake_language/unknown_meta_operation-result.txt index d00491f..d00491f 100644 --- a/Tests/RunCMake/cmake_command/cmake_command_eval_extra_parameters_between_eval_and_code-result.txt +++ b/Tests/RunCMake/cmake_language/unknown_meta_operation-result.txt diff --git a/Tests/RunCMake/cmake_language/unknown_meta_operation-stderr.txt b/Tests/RunCMake/cmake_language/unknown_meta_operation-stderr.txt new file mode 100644 index 0000000..6a1d4fd --- /dev/null +++ b/Tests/RunCMake/cmake_language/unknown_meta_operation-stderr.txt @@ -0,0 +1,2 @@ +CMake Error at unknown_meta_operation.cmake:1 \(cmake_language\): + cmake_language called with unknown meta-operation diff --git a/Tests/RunCMake/cmake_language/unknown_meta_operation.cmake b/Tests/RunCMake/cmake_language/unknown_meta_operation.cmake new file mode 100644 index 0000000..699f36f --- /dev/null +++ b/Tests/RunCMake/cmake_language/unknown_meta_operation.cmake @@ -0,0 +1 @@ +cmake_language(UNKNOWN) diff --git a/Tests/RunCMake/install/RunCMakeTest.cmake b/Tests/RunCMake/install/RunCMakeTest.cmake index bd0bbe3..a681c7e 100644 --- a/Tests/RunCMake/install/RunCMakeTest.cmake +++ b/Tests/RunCMake/install/RunCMakeTest.cmake @@ -174,6 +174,13 @@ elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows") run_cmake(file-GET_RUNTIME_DEPENDENCIES-badargs1) run_cmake(file-GET_RUNTIME_DEPENDENCIES-badargs2) elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux") + if(DEFINED ENV{LDFLAGS}) + # Some setups prebake disable-new-dtags into LDFLAGS + set(new_ldflags $ENV{LDFLAGS}}) + string(REPLACE "-Wl,--disable-new-dtags" "" new_ldflags "${new_ldflags}") + set(ENV{LDFLAGS} "${new_ldflags}") + endif() + if(NOT CMAKE_C_COMPILER_ID MATCHES "^XL") run_install_test(file-GET_RUNTIME_DEPENDENCIES-linux) endif() |