[cmake-developers] [ANNOUNCE] CMake 3.11.0-rc1 is now ready for testing
I am proud to announce the first CMake 3.11 release candidate. https://cmake.org/download/ Documentation is available at: https://cmake.org/cmake/help/v3.11 Release notes appear below and are also published at https://cmake.org/cmake/help/v3.11/release/3.11.html Some of the more significant changes in CMake 3.11 are: * The Makefile Generators and the "Ninja" generator learned to add compiler launcher tools along with the compiler for the "Fortran" language ("C", "CXX", and "CUDA" were supported previously). See the "CMAKE__COMPILER_LAUNCHER" variable and "_COMPILER_LAUNCHER" target property for details. * Visual Studio Generators learned to support the "COMPILE_LANGUAGE" "generator expression" in target-wide "COMPILE_DEFINITIONS", "INCLUDE_DIRECTORIES", "COMPILE_OPTIONS", and "file(GENERATE)". See generator expression documentation for caveats. * The "Xcode" Generator learned to support the "COMPILE_LANGUAGE" "generator expression" in target-wide "COMPILE_DEFINITIONS" and "INCLUDE_DIRECTORIES". It previously supported only "COMPILE_OPTIONS" and "file(GENERATE)". See generator expression documentation for caveats. * "add_library()" and "add_executable()" commands can now be called without any sources and will not complain as long as sources are added later via the "target_sources()" command. * The "target_compile_definitions()" command learned to set the "INTERFACE_COMPILE_DEFINITIONS" property on Imported Targets. * The "target_compile_features()" command learned to set the "INTERFACE_COMPILE_FEATURES" property on Imported Targets. * The "target_compile_options()" command learned to set the "INTERFACE_COMPILE_OPTIONS" property on Imported Targets. * The "target_include_directories()" command learned to set the "INTERFACE_INCLUDE_DIRECTORIES" property on Imported Targets. * The "target_sources()" command learned to set the "INTERFACE_SOURCES" property on Imported Targets. * The "target_link_libraries()" command learned to set the "INTERFACE_LINK_LIBRARIES" property on Imported Targets. * The "COMPILE_DEFINITIONS" source file property learned to support "generator expressions". * A "COMPILE_OPTIONS" source file property was added to manage list of options to pass to the compiler. * When using "AUTOMOC" or "AUTOUIC", CMake now starts multiple parallel "moc" or "uic" processes to reduce the build time. A new "CMAKE_AUTOGEN_PARALLEL" variable and "AUTOGEN_PARALLEL" target property may be set to specify the number of parallel "moc" or "uic" processes to start. The default is derived from the number of CPUs on the host. CMake 3.11 Release Notes Changes made since CMake 3.10 include the following. New Features Platforms - * TI C/C++ compilers are now supported by the "Ninja" generator. Generators -- * The "CodeBlocks" extra generator learned to check a "CMAKE_CODEBLOCKS_COMPILER_ID" variable for a custom compiler identification value to place in the project file. * The Makefile Generators and the "Ninja" generator learned to add compiler launcher tools along with the compiler for the "Fortran" language ("C", "CXX", and "CUDA" were supported previously). See the "CMAKE__COMPILER_LAUNCHER" variable and "_COMPILER_LAUNCHER" target property for details. * Visual Studio Generators learned to support the "COMPILE_LANGUAGE" "generator expression" in target-wide "COMPILE_DEFINITIONS", "INCLUDE_DIRECTORIES", "COMPILE_OPTIONS", and "file(GENERATE)". See generator expression documentation for caveats. * The "Xcode" generator learned to support the "COMPILE_LANGUAGE" "generator expression" in target-wide "COMPILE_DEFINITIONS" and "INCLUDE_DIRECTORIES". It previously supported only "COMPILE_OPTIONS" and "file(GENERATE)". See generator expression documentation for caveats. Commands * "add_library()" and "add_executable()" commands can now be called without any sources and will not complain as long as sources are added later via the "target_sources()" command. * The "file(DOWNLOAD)" and "file(UPLOAD)" commands gained "NETRC" and "NETRC_FILE" options to specify use of a ".netrc" file. * The "target_compile_definitions()" command learned to set the "INTERFACE_COMPILE_DEFINITIONS" property on Imported Targets. * The "target_compile_features()" command learned to set the "INTERFACE_COMPILE_FEATURES" property on Imported Targets. * The "target_compile_options()" command learned to set the "INTERFACE_COMPILE_OPTIONS" property on Imported Targets. * The "target_include_directories()" command learned to set the "INTERFACE_INCLUDE_DIRECTORIES" property on Imported Targets. * The "target_sources()" command learned to set the "INTERFACE_SOURCES" property on Imported Targets. * The "target_link_libraries()" command learned to set the "INTERFACE_LINK_LIBRARIES" property on Imported Targets. Variables - * A "CMAKE_GENERATOR_I
Re: [cmake-developers] Cmake-server question
Sure but how would CMake solve it? It would have to keep a backtrace of all properties when a target is created. Or at least all properties involved in the list of sources. You need a backtrace (or some other way to store a source location) in order to find a source location. That seems kinda obvious. Okay maybe not a backtrace then, but just the top of the trace. -Original Message- From: cmake-developers On Behalf Of Tobias Hunger Sent: Thursday, February 15, 2018 7:38 AM To: Ben Boeckel Cc: CMake Developers Subject: Re: [cmake-developers] Cmake-server question On Thu, Feb 15, 2018 at 3:18 PM, Ben Boeckel wrote: > On Wed, Feb 14, 2018 at 19:19:39 +0100, Paweł Rutka wrote: >> I would like to ask about some important feature: >> Is there any possibility to provide form Cmake Server side location >> of command that generate the target? The Use Case is as follow: >> In IDE you want to, after Class creation, automatically add CPP file >> into proper add_executable or extend some variable passed to >> add_executable or any other case that lead to target creation. > > Note that this is a very hard problem. Take the following examples: I am very aware that adding files to cmake targets is a hard problem:-/ That's why Creator does not even try to do it. It is bound to do it wrong and thus users can not trust the functionality. If there is any chance to solve this problem, then inside cmake. At least you and your code do fully understand the cmake language. Best Regards, Tobias -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: https://cmake.org/mailman/listinfo/cmake-developers -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: https://cmake.org/mailman/listinfo/cmake-developers
Re: [cmake-developers] Cmake-server question
On Thu, Feb 15, 2018 at 3:18 PM, Ben Boeckel wrote: > On Wed, Feb 14, 2018 at 19:19:39 +0100, Paweł Rutka wrote: >> I would like to ask about some important feature: >> Is there any possibility to provide form Cmake Server side location of >> command that generate the target? The Use Case is as follow: >> In IDE you want to, after Class creation, automatically add CPP file into >> proper add_executable or extend some variable passed to add_executable or >> any other case that lead to target creation. > > Note that this is a very hard problem. Take the following examples: I am very aware that adding files to cmake targets is a hard problem:-/ That's why Creator does not even try to do it. It is bound to do it wrong and thus users can not trust the functionality. If there is any chance to solve this problem, then inside cmake. At least you and your code do fully understand the cmake language. Best Regards, Tobias -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: https://cmake.org/mailman/listinfo/cmake-developers
Re: [cmake-developers] Cmake-server question
On Wed, Feb 14, 2018 at 19:19:39 +0100, Paweł Rutka wrote: > I would like to ask about some important feature: > Is there any possibility to provide form Cmake Server side location of > command that generate the target? The Use Case is as follow: > In IDE you want to, after Class creation, automatically add CPP file into > proper add_executable or extend some variable passed to add_executable or > any other case that lead to target creation. Note that this is a very hard problem. Take the following examples: === add_executable(myexe a.c b.c) === === set(sources a.c b.c) add_executable(myexe ${sources}) === === set(sources a.c b.c) add_subdirectory(foo) # does a `set(sources PARENT_SCOPE)` add_executable(myexe ${sources}) === === set(sources a.c b.c) if (some_option) list(APPEND sources c.c) endif () add_executable(myexe ${sources}) === === set(sources a.c b.c) add_executable(myexe ${sources}) set_property(TARGET myexe APPEND SOURCES d.c) === What would the IDE be expected to do for each of these cases? Personally, I think it would be best to just get where the target is declared. This should have a backtrace available so that this pattern is supported: === function (wrap_add_library) add_library(${ARGN}) # Project-specific bits. endfunction () # Somewhere else... wrap_add_library(mylib STATIC ...) === Once the main location is found, I think just having the "your cursor is on FOO, I'll highlight other instances of FOO" feature should be enough to get one to the right place. --Ben -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: https://cmake.org/mailman/listinfo/cmake-developers
Re: [cmake-developers] Cmake-server question
We get some talk and backtraces will not probably either way can handle multiple scenerios with functions and macros... But currenly I think Cmake do not have any knowledge how to match for example Variables used in initial call and one passed at the bottom to add_executable (seems like all this data is lost while processing file, backtrace is recored but it do not record params so you cannot backmatch anything usefull). But this topic should probably be ask to someone in Cmake dev team how It could be resolved. Regards, Pawel 2018-02-15 10:28 GMT+01:00 Tobias Hunger : > On Wed, Feb 14, 2018 at 7:27 PM, Rich Chiodo via cmake-developers > wrote: > > This would require backtraces, I believe, on every property so you can > trace > > all the properties back to where they’re defined. I need this too for > Visual > > Studio to support adding files as well. > > I disagree: Using backtraces for this is a pretty ugly hack! > > IDEs should not need to examine backtraces for a simple and common > task like adding files to a target! Ideally server-mode would have a > way to ask cmake where to add a source into a target and that will > then tell you the file/line/column to add the file into. > > Best Regards, > Tobias > -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: https://cmake.org/mailman/listinfo/cmake-developers
Re: [cmake-developers] Cmake-server question
On Wed, Feb 14, 2018 at 7:27 PM, Rich Chiodo via cmake-developers wrote: > This would require backtraces, I believe, on every property so you can trace > all the properties back to where they’re defined. I need this too for Visual > Studio to support adding files as well. I disagree: Using backtraces for this is a pretty ugly hack! IDEs should not need to examine backtraces for a simple and common task like adding files to a target! Ideally server-mode would have a way to ask cmake where to add a source into a target and that will then tell you the file/line/column to add the file into. Best Regards, Tobias -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: https://cmake.org/mailman/listinfo/cmake-developers