The following issue has been SUBMITTED. ====================================================================== http://www.cmake.org/Bug/view.php?id=15529 ====================================================================== Reported By: marc.chevrier Assigned To: ====================================================================== Project: CMake Issue ID: 15529 Category: CMake Reproducibility: N/A Severity: feature Priority: normal Status: new ====================================================================== Date Submitted: 2015-04-22 09:15 EDT Last Modified: 2015-04-22 09:15 EDT ====================================================================== Summary: enhance if() to support list Description: Currently, to test if a list contains an element, the following pattern must be used: list (FIND my_list ${my_item} is_found) if (NOT ${is_found} EQUAL -1) # item exists in list endif ()
I suggest to extend if() syntax to support test of existence of an item in a list: if (<variable|string> IN <list>) So, the previous test becomes: if (my_item IN my_list) ... endif () ====================================================================== Issue History Date Modified Username Field Change ====================================================================== 2015-04-22 09:15 marc.chevrier New Issue ====================================================================== -- 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
