Re: [CMake] Setting Policy CMP0028
Just to update. I managed to solve the issue by adding this line: cmake_policy(SET CMP0028 OLD) directly to the macro that ends up calling the add_library/add_executable commands. Thank you for the help. Regards, Pierre Andersson From: Nils Gladitz To: pierre.anders...@se.atlascopco.com Cc: cmake@cmake.org Date: 2014-07-11 15:47 Subject:Re: [CMake] Setting Policy CMP0028 On 07/11/2014 03:33 PM, pierre.anders...@se.atlascopco.com wrote: > Then it is odd that it does not work, the warning is given during > generation time and I have tested to print the status of the 0028 policy > at all points where the projects that get the warning has their > add_library/add_executable command called, as well as at the end of > their respective CMakeLists.txt files and it remains in the state OLD > throughout. > At which point is the state of the policy stored when it comes to > generation time? I can see that it works when I construct a minimal > example, so knowing when it's state is 'used' would greaty help in > solving the issue or creating a minimal example that showcases the problem. Given that the warning is at generation time I think it should be the state of the policy at the end of the CMakeLists.txt that defines the target (add_library/add_executable). Nils -- 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: http://public.kitware.com/mailman/listinfo/cmake
Re: [CMake] Setting Policy CMP0028
Then it is odd that it does not work, the warning is given during generation time and I have tested to print the status of the 0028 policy at all points where the projects that get the warning has their add_library/add_executable command called, as well as at the end of their respective CMakeLists.txt files and it remains in the state OLD throughout. At which point is the state of the policy stored when it comes to generation time? I can see that it works when I construct a minimal example, so knowing when it's state is 'used' would greaty help in solving the issue or creating a minimal example that showcases the problem. Regards, Pierre Andersson From: Nils Gladitz To: pierre.anders...@se.atlascopco.com Cc: cmake@cmake.org Date: 2014-07-11 14:32 Subject:Re: [CMake] Setting Policy CMP0028 On 07/11/2014 01:33 PM, pierre.anders...@se.atlascopco.com wrote: > Thanks for the response. None of those are called in the CMakeLists.txt > file that the warning is issued for, they are both called in a file > above that one in the build tree but said file also sets the CML0028 > policy afterwards. Is it possible that a call to cmake_minimum_required > resets the policies even for CMakeLists.txt that are not below it in the > build system tree? You can not change policies for the parent; only for the current and subdirectories. It might help if you could create a minimal, selfcontained test case to reproduce and debug the issue. Nils -- 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: http://public.kitware.com/mailman/listinfo/cmake
Re: [CMake] Setting Policy CMP0028
Thanks for the response. None of those are called in the CMakeLists.txt file that the warning is issued for, they are both called in a file above that one in the build tree but said file also sets the CML0028 policy afterwards. Is it possible that a call to cmake_minimum_required resets the policies even for CMakeLists.txt that are not below it in the build system tree? Regards, Pierre Andersson From: Nils Gladitz To: pierre.anders...@se.atlascopco.com, cmake@cmake.org Date: 2014-07-11 11:31 Subject:Re: [CMake] Setting Policy CMP0028 On 07/11/2014 11:00 AM, pierre.anders...@se.atlascopco.com wrote: > I have a very large project that is built with CMake, and I'm trying to > make it work a little nicer with CMake 3. Right now we, we see everal > warnigns that policy CMP0028 is not set. > > Using > > cmake_policy(SET CMP0028 OLD) > > does not seem to take effect. It's set at the same, top level, place > where other policies are set and these do take effect. Likewise, setting > the policy to NEW does not make CMake produce the fatal error like the > documentation says it should. What am I missing here? With a minimal test case the policy seems to work for me in 3.0. What might reset the policy after it was set is: - A call to cmake_minimum_required() - A call to cmake_policy(VERSION) Nils -- 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: http://public.kitware.com/mailman/listinfo/cmake
[CMake] Setting Policy CMP0028
I have a very large project that is built with CMake, and I'm trying to make it work a little nicer with CMake 3. Right now we, we see everal warnigns that policy CMP0028 is not set. Using cmake_policy(SET CMP0028 OLD) does not seem to take effect. It's set at the same, top level, place where other policies are set and these do take effect. Likewise, setting the policy to NEW does not make CMake produce the fatal error like the documentation says it should. What am I missing here? Regards, Pierre Andersson-- 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: http://public.kitware.com/mailman/listinfo/cmake