[cmake-developers] [PATCH] Tests: Refactor testing of extra generators.
From: Chaoren Lin Use a loop instead of repeating the same thing multiple times. --- Tests/CMakeLists.txt | 77 1 file changed, 30 insertions(+), 47 deletions(-) diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 6f1805b..c119cfd 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -569,60 +569,43 @@ if(BUILD_TESTING) ADD_LINK_FLAGS_TEST(mod_flags_config dll_flags_config) ADD_LINK_FLAGS_TEST(exe_flags_config mod_flags_config) - # If we are running right now with a UnixMakefiles based generator, + # If we are running right now with a Unix Makefiles or Ninja based generator, # build the "Simple" test with the ExtraGenerators, if available # This doesn't test whether the generated project files work (unfortunately), # mainly it tests that cmake doesn't crash when generating these project files. - if(${CMAKE_GENERATOR} MATCHES "Unix Makefiles" OR ${CMAKE_GENERATOR} MATCHES "KDevelop") + if(${CMAKE_GENERATOR} MATCHES "Unix Makefiles" OR ${CMAKE_GENERATOR} MATCHES "Ninja") + # check which generators we have execute_process(COMMAND ${CMAKE_CMAKE_COMMAND} --help OUTPUT_VARIABLE cmakeOutput ERROR_VARIABLE cmakeOutput) -# check for the Eclipse generator -if ("${cmakeOutput}" MATCHES Eclipse) - add_test(Simple_EclipseGenerator ${CMAKE_CTEST_COMMAND} - --build-and-test - "${CMake_SOURCE_DIR}/Tests/Simple" - "${CMake_BINARY_DIR}/Tests/Simple_EclipseGenerator" - --build-two-config - --build-generator "Eclipse CDT4 - Unix Makefiles" - --build-generator-platform "${CMAKE_GENERATOR_PLATFORM}" - --build-generator-toolset "${CMAKE_GENERATOR_TOOLSET}" - --build-project Simple - --build-options ${build_options} - --test-command Simple) - list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Simple_EclipseGenerator") -endif () -# check for the CodeBlocks generator -if ("${cmakeOutput}" MATCHES CodeBlocks) - add_test(Simple_CodeBlocksGenerator ${CMAKE_CTEST_COMMAND} - --build-and-test - "${CMake_SOURCE_DIR}/Tests/Simple" - "${CMake_BINARY_DIR}/Tests/Simple_CodeBlocksGenerator" - --build-two-config - --build-generator "CodeBlocks - Unix Makefiles" - --build-generator-platform "${CMAKE_GENERATOR_PLATFORM}" - --build-generator-toolset "${CMAKE_GENERATOR_TOOLSET}" - --build-project Simple - --build-options ${build_options} - --test-command Simple) - list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Simple_CodeBlocksGenerator") -endif () -# check for the KDevelop3 generator -if ("${cmakeOutput}" MATCHES KDevelop3) - add_test(Simple_KDevelop3Generator ${CMAKE_CTEST_COMMAND} - --build-and-test - "${CMake_SOURCE_DIR}/Tests/Simple" - "${CMake_BINARY_DIR}/Tests/Simple_KDevelop3Generator" - --build-two-config - --build-generator "KDevelop3 - Unix Makefiles" - --build-generator-platform "${CMAKE_GENERATOR_PLATFORM}" - --build-generator-toolset "${CMAKE_GENERATOR_TOOLSET}" - --build-project Simple - --build-options ${build_options} - --test-command Simple) - list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Simple_KDevelop3Generator") -endif () +set(extraGenerators + "CodeBlocks" + "CodeLite" + "Eclipse CDT4" + "Kate" + "KDevelop3" + "Sublime Text 2") + +foreach(extraGenerator ${extraGenerators}) + if ("${cmakeOutput}" MATCHES "${extraGenerator} - ${CMAKE_GENERATOR}") +set(extraGeneratorTestName "Simple_${extraGenerator}Generator") +string(REPLACE " " "" extraGeneratorTestName ${extraGeneratorTestName}) + +add_test(${extraGeneratorTestName} ${CMAKE_CTEST_COMMAND} + --build-and-test + "${CMake_SOURCE_DIR}/Tests/Simple" + "${CMake_BINARY_DIR}/Tests/${extraGeneratorTestName}" + --build-two-config + --build-generator "${extraGenerator} - ${CMAKE_GENERATOR}" + --build-generator-platform "${CMAKE_GENERATOR_PLATFORM}" + --build-generator-toolset "${CMAKE_GENERATOR_TOOLSET}" + --build-project Simple + --build-options ${build_options} + --test-command Simple) +list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/${extraGeneratorTestName}") + endif () +endforeach(extraGenerator) endif() -- 2.8.0.rc3.226.g39d4020 -- 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.h
Re: [cmake-developers] FindOpenSSL: Link libraries needed for static OpenSSL.
Am 2016-08-17 14:53, schrieb Brad King: On 08/16/2016 04:44 PM, Alexander Lamaison wrote: I've attached a new patch without the changes to the singular-named variables. Thanks. +if(WIN32 AND NOT CYGWIN) + set_target_properties(OpenSSL::Crypto PROPERTIES +INTERFACE_LINK_LIBRARIES crypt32) +else() + set_target_properties(OpenSSL::Crypto PROPERTIES +INTERFACE_LINK_LIBRARIES "${CMAKE_DL_LIBS}") +endif() The addition of crypt32/dl is done with this logic in several places. Instead please use a _OPENSSL_LIBRARY_DEPENDS variable to hold the value and then reference it in the other locations so that the conditions for setting it do not have to be duplicated. Don't forget to unset() the variable at the end of the module. Greetings, Eike -- -- 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-developers
Re: [cmake-developers] [PATCH v7] For Windows encode process output to internally used encoding
On 08/17/2016 06:11 AM, Dāvis Mosāns wrote: >> Applied with minor tweaks and merged to `next` for testing: > > Great! Thanks! I squashed in one warning fix: Windows: Encode child process output to internally-used encoding https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=12924660 However, then I had to revert the change from `next` because it causes the CTest.UpdateGIT test to fail on Windows machines. I think the problem is that we run Git with a `-z` option to produce binary output. In such cases we should not do any encoding conversions. cmProcessTools and RunSingleCommand will need to gain options for this. Also I noticed that if DecodeText buffers partial characters we may need a finalize step later to finish them off. Otherwise invalid byte sequences may be dropped if they appear at the end. Please fetch the above version and revise it as needed. Thanks, -Brad -- 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-developers
Re: [cmake-developers] FindOpenSSL: Link libraries needed for static OpenSSL.
On 08/16/2016 04:44 PM, Alexander Lamaison wrote: > I've attached a new patch without the changes to the singular-named variables. Thanks. > +if(WIN32 AND NOT CYGWIN) > + set_target_properties(OpenSSL::Crypto PROPERTIES > +INTERFACE_LINK_LIBRARIES crypt32) > +else() > + set_target_properties(OpenSSL::Crypto PROPERTIES > +INTERFACE_LINK_LIBRARIES "${CMAKE_DL_LIBS}") > +endif() The addition of crypt32/dl is done with this logic in several places. Instead please use a _OPENSSL_LIBRARY_DEPENDS variable to hold the value and then reference it in the other locations so that the conditions for setting it do not have to be duplicated. Thanks, -Brad -- 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-developers
Re: [cmake-developers] Appx generator for CPack?
On 08/16/2016 06:43 PM, Ryan Saunders via cmake-developers wrote: > I notice that there is no CPack generator for Microsoft's .appx > package format. > > 1. Is anyone already working on this? If not, then I'll attempt it. > 2. Am I missing anything? Any "gotchas" I should worry about? I'm not aware of anyone working on this. Please go ahead if you wish. Thanks, -Brad -- 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-developers
Re: [cmake-developers] [PATCH v7] For Windows encode process output to internally used encoding
2016-08-16 21:09 GMT+03:00 Brad King : > On 08/15/2016 04:34 PM, Dāvis Mosāns wrote: >> Typically Windows applications (eg. MSVC compiler) use current console's >> codepage for output to pipes so we need to encode that to internally used >> encoding (KWSYS_ENCODING_DEFAULT_CODEPAGE). > > Thanks. Applied with minor tweaks and merged to `next` for testing: > > Windows: Encode child process output to internally-used encoding > https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0a818239 Great! Thanks! -- 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-developers