aaron_wri...@selinc.com wrote:
> Is this the best way to generate a comment bar, such as this:
> 
> ////////////////////////////////////////////////////////////////////////////////
> 
> or this:
> 
> --------------------------------------------------------------------------------
> 
> or this:
> 
> ################################################################################
> 
> IF(OUTPUT_FILE_EXT MATCHES "^\\.h|\\.cpp$")
>    SET(COMMENT_CHARACTER "/")
> ELSEIF(OUTPUT_FILE_EXT MATCHES "^\\.sql$")
>    SET(COMMENT_CHARACTER "-")
> ELSEIF(OUTPUT_FILE_EXT MATCHES "^\\.nsi|\\.nsh$")
>    SET(COMMENT_CHARACTER "#")
> ELSE()
>    MESSAGE(WARNING "Unknown file type")
> ENDIF()
> 
> STRING(RANDOM LENGTH 80 ALPHABET "${COMMENT_CHARACTER}" COMMENT_BAR)


IMHO, it looks OK.


> The only reason I ask is that is seems weird to use the STRING(RANDOM 
> function to get this done.

The RANDOM is just a generalized generator.
In your case, you specify one-character alphabet
and it is still a random string of values from one element interval.
I don't see anything strange here myself.


Best regards,
-- 
Mateusz Loskot, http://mateusz.loskot.net
Charter Member of OSGeo, http://osgeo.org
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to