]> git.lyx.org Git - lyx.git/blob - development/cmake/modules/LyXMacros.cmake
Add documentation for notes cite engine type.
[lyx.git] / development / cmake / modules / LyXMacros.cmake
1 #
2 #  Copyright (c) 2006-2011 Peter Kümmel, <syntheticpp@gmx.net>
3 #
4 #  Redistribution and use in source and binary forms, with or without
5 #  modification, are permitted provided that the following conditions
6 #  are met:
7 #
8 #  1. Redistributions of source code must retain the copyright
9 #         notice, this list of conditions and the following disclaimer.
10 #  2. Redistributions in binary form must reproduce the copyright
11 #         notice, this list of conditions and the following disclaimer in the
12 #         documentation and/or other materials provided with the distribution.
13 #  3. The name of the author may not be used to endorse or promote products
14 #         derived from this software without specific prior written permission.
15 #
16 #  THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
17 #  IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
18 #  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19 #  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
20 #  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21 #  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22 #  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23 #  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 #  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25 #  THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 #
27
28 include (MacroAddFileDependencies)
29
30 set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS true)
31
32 macro(lyx_add_path _list _prefix)
33         set(_tmp)
34         foreach(_current ${${_list}})
35                 set(_tmp ${_tmp} ${_prefix}/${_current})
36         endforeach(_current)
37         set(${_list} ${_tmp})
38 endmacro(lyx_add_path _out _prefix)
39
40
41 #create the implementation files from the ui files and add them
42 #to the list of sources
43 #usage: LYX_ADD_UI_FILES(foo_SRCS ${ui_files})
44 macro(LYX_ADD_UI_FILES _sources _ui_files)
45         set(uifiles})
46         foreach (_current_FILE ${ARGN})
47                 get_filename_component(_tmp_FILE ${_current_FILE} ABSOLUTE)
48                 get_filename_component(_basename ${_tmp_FILE} NAME_WE)
49                 set(_header ${CMAKE_CURRENT_BINARY_DIR}/ui_${_basename}.h)
50
51                 # we need to run uic and replace some things in the generated file
52                 # this is done by executing the cmake script LyXuic.cmake
53                 # ######
54                 # Latest test showed on linux and windows show no bad consequeces,
55                 # so we removed the call to LyXuic.cmake
56                 qt_wrap_uifiles(${_header} ${_tmp_FILE} OPTIONS -tr lyx::qt_)
57                 list(APPEND uifiles ${_header})
58         endforeach()
59         set(${_ui_files} ${uifiles})
60 endmacro(LYX_ADD_UI_FILES)
61
62
63
64 macro(LYX_AUTOMOC)
65         set(_matching_FILES)
66         foreach (_current_FILE ${ARGN})
67
68                 get_filename_component(_abs_FILE ${_current_FILE} ABSOLUTE)
69                 # if "SKIP_AUTOMOC" is set to true, we will not handle this file here.
70                 # here. this is required to make bouic work correctly:
71                 # we need to add generated .cpp files to the sources (to compile them),
72                 # but we cannot let automoc handle them, as the .cpp files don't exist yet when
73                 # cmake is run for the very first time on them -> however the .cpp files might
74                 # exist at a later run. at that time we need to skip them, so that we don't add two
75                 # different rules for the same moc file
76                 get_source_file_property(_skip ${_abs_FILE} SKIP_AUTOMOC)
77
78                 if (EXISTS ${_abs_FILE} AND NOT _skip)
79
80                         file(READ ${_abs_FILE} _contents)
81
82                         get_filename_component(_abs_PATH ${_abs_FILE} PATH)
83
84                         string(REGEX MATCHALL "#include +[\"<]moc_[^ ]+\\.cpp[\">]" _match "${_contents}")
85                         if (_match)
86                                 foreach (_current_MOC_INC ${_match})
87                                         string(REGEX MATCH "moc_[^ <\"]+\\.cpp" _current_MOC "${_current_MOC_INC}")
88
89                                         get_filename_component(_basename ${_current_MOC} NAME_WE)
90
91                                         string(LENGTH ${_basename} _length)
92                                         MATH(EXPR _mocless_length ${_length}-4)
93                                         STRING(SUBSTRING  ${_basename} 4 ${_mocless_length} _mocless_name )
94
95                                         set(_header ${_abs_PATH}/${_mocless_name}.h)
96
97                                         #message(STATUS "moc : ${_header}")
98                                         #set(_header ${CMAKE_CURRENT_SOURCE_DIR}/${_basename}.h)
99                                         #set(_header ${_abs_PATH}/${_basename}.h)
100
101                                         set(_moc  ${CMAKE_CURRENT_BINARY_DIR}/${_current_MOC})
102                                         if (WIN32)
103                                                 set(_def -D_WIN32)
104                                         else()
105                                                 set(_def)
106                                         endif()
107                                         #set(_moc ${_abs_PATH}/${_current_MOC})
108                                         add_custom_command(OUTPUT ${_moc}
109                                                           COMMAND ${QT_MOC_EXECUTABLE}
110                                                           ARGS "-DQT_VERSION=${QTx_VERSION}" ${_def} ${_moc_INCS} ${_header} -o ${_moc}
111                                                           MAIN_DEPENDENCY ${_header})
112                                         macro_add_file_dependencies(${_abs_FILE} ${_moc})
113                                         SET_SOURCE_FILES_PROPERTIES(${_moc} GENERATED)
114                                 endforeach (_current_MOC_INC)
115                         else()
116                                 #message(STATUS "moc not found : ${_abs_FILE} ")
117                         endif()
118                 endif()
119         endforeach (_current_FILE)
120 endmacro (LYX_AUTOMOC)
121
122
123 macro(lyx_const_touched_files _allinone_name _list)
124         set(_file_list ${_allinone_name}_files)
125         set(_file_const ${CMAKE_CURRENT_BINARY_DIR}/${_allinone_name}_const.C)
126         set(_file_touched ${CMAKE_CURRENT_BINARY_DIR}/${_allinone_name}_touched.C)
127
128         # don't touch exisiting or non-empty file,
129         # so a cmake re-run doesn't touch all created files
130         set(_rebuild_file_const 0)
131         if (NOT EXISTS ${_file_const})
132                 set(_rebuild_file_const 1)
133         else()
134                 FILE(READ ${_file_const} _file_content)
135                 if (NOT _file_content)
136                         set(_rebuild_file_const 1)
137                 endif()
138         endif()
139
140         set(_rebuild_file_touched 0)
141         if (NOT EXISTS ${_file_touched})
142                 set(_rebuild_file_touched 1)
143         else()
144                 FILE(READ ${_file_touched} _file_content)
145                 if (NOT _file_content)
146                         set(_rebuild_file_touched 1)
147                 endif()
148         endif()
149
150         if (LYX_MERGE_REBUILD)
151                 #message(STATUS "Merge files build: rebuilding generated files")
152                 set(_rebuild_file_const 1)
153                 set(_rebuild_file_touched 1)
154         endif()
155
156         if (_rebuild_file_const)
157                 file(WRITE  ${_file_const} "// autogenerated file \n//\n")
158                 file(APPEND ${_file_const} "//   * clear or delete this file to build it again by cmake \n//\n\n")
159         endif()
160
161         if (_rebuild_file_touched)
162                 file(WRITE  ${_file_touched} "// autogenerated file \n//\n")
163                 file(APPEND ${_file_touched} "//         * clear or delete this file to build it again by cmake \n//\n")
164                 file(APPEND ${_file_touched} "//         * don't touch this file \n//\n\n")
165                 file(APPEND ${_file_touched} "#define DONT_INCLUDE_CONST_FILES\n")
166                 file(APPEND ${_file_touched} "#include \"${_file_const}\"\n\n\n")
167         endif()
168
169         #add merged files also to the project so they become editable
170                 if(${GROUP_CODE} MATCHES "flat")
171                 lyx_add_info_files_no_group(${${_list}})
172         else()
173                 lyx_add_info_files(MergedFiles ${${_list}})
174         endif()
175
176         set(${_file_list} ${_file_const} ${_file_touched} ${lyx_${groupname}_info_files})
177
178         foreach (_current_FILE ${${_list}})
179                 get_filename_component(_abs_FILE ${_current_FILE} ABSOLUTE)
180                 # don't include any generated files in the final-file
181                 # because then cmake will not know the dependencies
182                 get_source_file_property(_isGenerated ${_abs_FILE} GENERATED)
183                 if (_isGenerated)
184                         list(APPEND ${_file_list} ${_abs_FILE})
185                 else()
186                   GET_FILENAME_COMPONENT(_file_name ${_abs_FILE} NAME_WE)
187                   STRING(REGEX REPLACE "-" "_" _file_name "${_file_name}")
188                   set(__macro_name ${_file_name}___ASSUME_CONST)
189
190                   if (_rebuild_file_const)
191                           file(APPEND ${_file_const}  "#define ${__macro_name}\n")
192                           file(APPEND ${_file_const}  "#if defined(${__macro_name}) && !defined(DONT_INCLUDE_CONST_FILES)\n")
193                           file(APPEND ${_file_const}  "#include \"${_abs_FILE}\"\n")
194                           file(APPEND ${_file_const}  "#endif\n\n")
195                   endif()
196
197                   if (_rebuild_file_touched)
198                           file(APPEND ${_file_touched}  "#ifndef ${__macro_name}\n")
199                           file(APPEND ${_file_touched}  "#include \"${_abs_FILE}\"\n")
200                           file(APPEND ${_file_touched}  "#endif\n\n")
201                   endif()
202                 endif()
203         endforeach (_current_FILE)
204 endmacro(lyx_const_touched_files)
205
206 macro(LYX_OPTION_INIT)
207         set(LYX_OPTIONS)
208         set(LYX_OPTION_STRINGS)
209 endmacro()
210
211
212 macro(LYX_OPTION _name _description _default _sys)
213         set(_msg OFF)
214         if(${_sys} MATCHES "GCC")
215                 set(_system CMAKE_COMPILER_IS_GNUCXX)
216         elseif(${_sys} MATCHES "MAC")
217                 set(_system APPLE)
218         else()
219                 set(_system ${_sys})
220         endif()
221         if(${_system} MATCHES "ALL")
222                 option(LYX_${_name} ${_description} ${_default})
223                 set(_msg ON)
224         else()
225                 if(${${_system}})
226                         option(LYX_${_name} ${_description} ${_default})
227                         set(_msg ON)
228                 endif()
229         endif()
230         list(APPEND LYX_OPTIONS LYX_${_name})
231         set(LYX_${_name}_description ${_description})
232         set(LYX_${_name}_show_message ${_msg})
233 endmacro()
234
235 macro(LYX_COMBO _name _description _default)
236   set(_lyx_name "LYX_${_name}")
237   set(${_lyx_name} ${_default} CACHE STRING "${_description}")
238   set(_combo_list ${_default} ${ARGN})
239   set_property(CACHE ${_lyx_name} PROPERTY STRINGS ${_combo_list})
240   list(APPEND LYX_OPTIONS ${_lyx_name})
241   set(${_lyx_name}_show_message ON)
242   string(REGEX REPLACE ";" " " _use_list "${_combo_list}")
243   set(${_lyx_name}_description "${_description} (${_use_list})")
244   list(APPEND LYX_OPTION_STRINGS ${_lyx_name})
245   # Now check the value
246   list(FIND _combo_list ${${_lyx_name}} _idx)
247   if (_idx LESS 0)
248     message(FATAL_ERROR "${_lyx_name} set to \"${${_lyx_name}}\", but has to be only one of (${_use_list})")
249   endif()
250 endmacro()
251
252 macro(LYX_STRING _name _description _default)
253   set(_lyx_name "LYX_${_name}")
254   list(APPEND LYX_OPTIONS ${_lyx_name})
255   set(${_lyx_name}_show_message ON)
256   set(${_lyx_name}_description "${_description}")
257   list(APPEND LYX_OPTION_STRINGS ${_lyx_name})
258   # Now check the value
259   # Should not contain ' '
260   set(tmp_lyx_name ${${_lyx_name}})
261   if (NOT "${${_lyx_name}}" STREQUAL "")
262     if (NOT "${tmp_lyx_name}" MATCHES "^\\..*$")
263       set(tmp_lyx_name ".${tmp_lyx_name}")
264     endif()
265     if (NOT "${tmp_lyx_name}" MATCHES "^\\.[a-zA-Z_0-9\\.]+$")
266       message(FATAL_ERROR "Invalid string for lyx suffix (${tmp_lyx_name})")
267     endif()
268   endif()
269   set(${_lyx_name} "${tmp_lyx_name}" CACHE STRING "${_description}" FORCE)
270 endmacro()
271
272 macro(LYX_OPTION_LIST_ALL)
273         if(UNIX)
274                 set(run_cmake ${CMAKE_BINARY_DIR}/run_cmake.sh)
275                 file(WRITE ${run_cmake} "#!/bin/bash \n")
276                 execute_process(COMMAND chmod 755 ${run_cmake})
277                 set(cont "\\\n")
278         elseif(WIN32)
279                 set(run_cmake ${CMAKE_BINARY_DIR}/run_cmake.bat)
280                 file(WRITE ${run_cmake} "")
281                 set(cont "<nul ^\n")
282         endif()
283         file(APPEND ${run_cmake} "cmake ${CMAKE_SOURCE_DIR}  ${cont}")
284         file(APPEND ${run_cmake} " -G\"${CMAKE_GENERATOR}\"  ${cont}")
285         foreach(_option ${LYX_OPTIONS})
286                 if(${_option}_show_message OR ${ARGV0} STREQUAL "help")
287                         get_property(_prop CACHE ${_option} PROPERTY STRINGS)
288                         list(FIND LYX_OPTION_STRINGS ${_option} _index)
289                         set(_type "BOOL")
290                         if (${_index} GREATER -1)
291                           #message(STATUS "${_option} is of type string")
292                           set(_isset ${${_option}})
293                           set(_type "STRING")
294                         elseif(${_option})
295                                 set(_isset ON)
296                         else()
297                                 set(_isset OFF)
298                         endif()
299                         string(SUBSTRING "${_option}:${_type}                            " 0 35 _var)
300                         string(SUBSTRING "${_isset}           " 0 7 _val)
301                         message(STATUS "${_var}= ${_val}: ${${_option}_description}")
302                         file(APPEND ${run_cmake} " -D${_option}:${_type}=${${_option}}  ${cont}")
303                 endif()
304         endforeach()
305         file(APPEND ${run_cmake} "\n")
306         message(STATUS)
307         message(STATUS "CMake command with options is available in shell script")
308         message(STATUS "    '${run_cmake}'")
309 endmacro()
310
311 macro(lyx_add_info_files group)
312         foreach(_it ${ARGN})
313                 if(NOT IS_DIRECTORY ${_it})
314                         get_filename_component(name ${_it} NAME)
315                         if(NOT ${_it} MATCHES "^/\\\\..*$;~$")
316                                 set_source_files_properties(${_it} PROPERTIES HEADER_FILE_ONLY TRUE)
317                                 set(lyx_${group}_info_files ${lyx_${group}_info_files} ${_it})
318                         endif()
319                 endif()
320         endforeach()
321         set(check_group ${group}) #cmake bug?
322         if(check_group)
323                 source_group(${group} FILES ${lyx_${group}_info_files})
324         endif()
325         set(lyx_info_files ${lyx_info_files} ${lyx_${group}_info_files})
326 endmacro()
327
328 macro(lyx_add_info_files_no_group)
329         lyx_add_info_files( "" ${ARGN})
330 endmacro()
331
332 macro(lyx_find_info_files group files)
333         file(GLOB _filelist ${files})
334         lyx_add_info_files(${group} ${_filelist})
335 endmacro()
336
337 macro(settestlabel testname)
338   get_property(_lab_list TEST ${testname} PROPERTY LABELS)
339   if(_lab_list)
340     list(APPEND _lab_list "${ARGN}")
341   else()
342     set(_lab_list "${ARGN}")
343   endif()
344   list(REMOVE_DUPLICATES _lab_list)
345   set_tests_properties(${testname} PROPERTIES LABELS "${_lab_list}")
346 endmacro()
347
348 macro(sortlabellist listout)
349   set(tmplist "")
350   foreach(_lab ${ARGN})
351     list(APPEND tmplist "${depth_${_lab}}${_lab}")
352   endforeach()
353   list(SORT tmplist)
354   string(REGEX REPLACE ";[-0-9]+" ";" ${listout} ";${tmplist}")
355 endmacro()
356
357 macro(createlabel reslabel first)
358   set(${reslabel} ${first})
359   foreach(_lab ${ARGN})
360     set(${reslabel} "${${reslabel}}:${_lab}")
361   endforeach()
362 endmacro()
363
364 macro(setmarkedtestlabel testname)
365   sortlabellist(mynewlablelist ${ARGN})
366   createlabel(mynewlabel ${mynewlablelist})
367   settestlabel(${testname} ${mynewlabel})
368 endmacro()
369
370 macro(lyx_target_link_libraries _target)
371   foreach(_lib ${ARGN})
372     string(TOUPPER ${_lib} _ulib)
373     if(${_ulib}_FOUND)
374       #message(STATUS "target_link_libraries(${_target} ${${_lib}_LIBRARY})")
375       target_link_libraries(${_target} ${${_lib}_LIBRARY})
376     endif()
377   endforeach()
378 endmacro()
379
380 # Check if python module exists
381 # Idea stolen from http://public.kitware.com/pipermail/cmake/2011-January/041666.html
382 function(find_python_module module)
383   string(TOUPPER ${module} module_upper)
384   if(NOT LYX_PY_${module_upper})
385     if(ARGC GREATER 1 AND ARGV1 STREQUAL "REQUIRED")
386       set(LYX_PY_${module}_FIND_REQUIRED TRUE)
387     endif()
388     # A module's location is usually a directory, but for binary modules
389     # it's a .so file.
390     execute_process(COMMAND "${LYX_PYTHON_EXECUTABLE}" "-c"
391       "import re, ${module}; print(re.compile('/__init__.py.*').sub('',${module}.__file__))"
392       RESULT_VARIABLE _${module}_status
393       OUTPUT_VARIABLE _${module}_location
394       ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
395     if(NOT _${module}_status)
396       set(LYX_PY_${module_upper} ${_${module}_location} CACHE STRING
397         "Location of Python module ${module}")
398     endif()
399   endif()
400   find_package_handle_standard_args(LYX_PY_${module} DEFAULT_MSG LYX_PY_${module_upper})
401 endfunction(find_python_module)
402
403 macro(setstripped _varname)
404         if(${ARGC} GREATER 1)
405                 string(STRIP "${ARGV1}" _v)
406                 if (_v MATCHES "^\\[\(.+\)\\]$")
407                   set(_v ${CMAKE_MATCH_1})
408                 endif()
409                 if(USE_POSIX_PACKAGING)
410                         string(TOLOWER ${_v} ${_varname})
411                 else()
412                         set(${_varname} ${_v})
413                 endif()
414         else()
415                 set(${_varname})
416         endif()
417 endmacro(setstripped)
418
419 # Determine the version and build-type
420 function(determineversionandbuildtype configfile package version dirs date buildtype)
421   file(STRINGS "${configfile}" _config_lines)
422   foreach(_c_l ${_config_lines} )
423     if(_c_l MATCHES "^AC_INIT\\(\([^,]+\),\([^,]+\), *\\[\([^,]+\)\\] *,\(.*\)")
424       # Not using CMAKE_MATCH_ directly is needed, because
425       # its value is now changed inside macro setstripped
426       set(_PB ${CMAKE_MATCH_1})
427       set(_PV ${CMAKE_MATCH_2})
428       set(_PBU ${CMAKE_MATCH_3})
429       setstripped(PACKAGE_BASE ${_PB})
430       setstripped(PACKAGE_VERSION ${_PV})
431       setstripped(PACKAGE_BUGREPORT ${_PBU})
432       set(${package} ${PACKAGE_BASE} ${PACKAGE_VERSION} ${PACKAGE_BUGREPORT} PARENT_SCOPE)
433       if(PACKAGE_VERSION MATCHES "^\([0-9]+\)\\.\([0-9]+\)\(\\.\([0-9]+\)\(\\.\([0-9]+\)\)?\)?[-~]?\([A-Za-z]+[0-9]*\).*$")
434         set(LYX_MAJOR_VERSION ${CMAKE_MATCH_1})
435         set(LYX_MINOR_VERSION ${CMAKE_MATCH_2})
436         set(LYX_RELEASE_LEVEL ${CMAKE_MATCH_4})
437         set(LYX_RELEASE_PATCH ${CMAKE_MATCH_6})
438         set(LYX_BUILD_TYPE_MATCH ${CMAKE_MATCH_7})
439         string(TOLOWER "${LYX_BUILD_TYPE_MATCH}" LYX_BUILD_TYPE)
440         set(LYX_DIR_VER "LYX_DIR_${CMAKE_MATCH_1}${CMAKE_MATCH_2}x")
441         set(LYX_USERDIR_VER "LYX_USERDIR_${CMAKE_MATCH_1}${CMAKE_MATCH_2}x")
442         if (NOT LYX_RELEASE_LEVEL)
443           set(LYX_RELEASE_LEVEL 0)
444         endif()
445         if (NOT LYX_RELEASE_PATCH)
446           set(LYX_RELEASE_PATCH 0)
447         endif()
448         set(LYX_VERSION "${LYX_MAJOR_VERSION}.${LYX_MINOR_VERSION}")
449       endif()
450     endif()
451     if(_c_l MATCHES "^AC_SUBST\\( *LYX_DATE *, *\\[\\\"(.*)\\\"\\].*")
452       set(LYX_DATE "${CMAKE_MATCH_1}")
453     endif()
454   endforeach(_c_l)
455   set(${version} ${LYX_VERSION} ${LYX_MAJOR_VERSION} ${LYX_MINOR_VERSION} ${LYX_RELEASE_LEVEL} ${LYX_RELEASE_PATCH} PARENT_SCOPE)
456   set(${dirs} ${LYX_DIR_VER} ${LYX_USERDIR_VER} PARENT_SCOPE)
457   set(${date} ${LYX_DATE} PARENT_SCOPE)
458   if(LYX_BUILD_TYPE MATCHES "^\(dev(el)?\)$")
459     set(${buildtype} "development" PARENT_SCOPE)
460   elseif(LYX_BUILD_TYPE MATCHES "^\(alpha|beta|rc|pre\)[0-9]*$")
461     set(${buildtype} "prerelease" PARENT_SCOPE)
462   elseif(LYX_BUILD_TYPE MATCHES "^$")
463     set(${buildtype} "release" PARENT_SCOPE)
464   else()
465     set(${buildtype} "unknown" PARENT_SCOPE)
466     message(FATAL_ERROR "\"${configfile}\": Unable to determine build-type from suffix \"${LYX_BUILD_TYPE}\" in AC_INIT macro")
467   endif()
468 endfunction(determineversionandbuildtype)
469
470 # determine known cmake cxx_std features but only if not greater than ${max_desired}
471 function(lyxgetknowncmakestd max_desired result)
472   set(tmp_list)
473   set(CXX_STD_LIST)
474   math(EXPR max_desired "${max_desired}+1")
475   if (CMAKE_VERSION VERSION_LESS "3.9")
476     list(APPEND tmp_list 98 11 14)
477   else()
478     foreach(_e ${CMAKE_CXX_COMPILE_FEATURES})
479       if (_e MATCHES "^cxx_std_\(.*)")
480         list(APPEND tmp_list ${CMAKE_MATCH_1})
481       endif()
482     endforeach()
483   endif()
484   list(REVERSE tmp_list)
485   # Filter undesired from list
486   foreach(i ${tmp_list})
487     if (i LESS ${max_desired} OR i GREATER 89)
488       list(APPEND CXX_STD_LIST ${i})
489     endif()
490   endforeach()
491   set(${result} ${CXX_STD_LIST} PARENT_SCOPE)
492 endfunction()
493