[CMake] CMake CVS SET gratuitous semicolon
William A. Hoffman
billlist at nycap.rr.com
Wed Feb 15 15:00:04 EST 2006
At 01:58 PM 2/15/2006, you wrote:
>I'm using CMake CVS built with MinGW / MSYS. I have this in CMakeLists.txt.
>
>SET(SHARED_FLAGS -DC_NO_PIC_NO_DLL -DPIC)
>
>Then I do cmakesetup from the MSYS shell. I delete cache, configure, hit ok. "make -n chicken" reveals:
>
>e:/Dev-Cpp/bin/gcc.exe -DCBUILDING_LIBCHICKEN -DC_NO_PIC_NO_DLL;-DPIC -Dchicken_EXPORTS -IE:/devel/src/chicken-2.216 -Dsocklen_t=int -DHAVE_WINDOWS_H -o CMakeFiles/chicken.dir/posixwin.obj -c E:/devel/src/chicken-2.216/posixwin.c
>
>
>Note the gratuitous semicolon. When I change my code to
>
>SET(SHARED_FLAGS "-DC_NO_PIC_NO_DLL -DPIC")
>
>then do cmakesetup from the MSYS shell, delete cache, configure, hit ok, "make -n chicken" reveals correct behavior:
>
>e:/Dev-Cpp/bin/gcc.exe -DCBUILDING_LIBCHICKEN -DC_NO_PIC_NO_DLL -DPIC -Dchicken_EXPORTS -IE:/devel/src/chicken-2.216 -Dsocklen_t=int -DHAVE_WINDOWS_H -o CMakeFiles/chicken.dir/posixwin.obj -c E:/devel/src/chicken-2.216/posixwin.c
That is expected behavior. SET(FOO a b c) is the same as SET(FOO a;b;c), it
sets FOO to a list of elements. SET(FOO "a b c") sets FOO to a single element.
That being said, I am not exactly sure why we could not expand cmake lists before
we write variables into makefiles. Is there a case where ; would be expected in a
variable, what would this break?
-Bill
More information about the CMake
mailing list