On 7/19/07, <b class="gmail_sendername">cjacker</b> &lt;<a href="mailto:jzhuang@redflag-linux.com">jzhuang@redflag-linux.com</a>&gt; wrote:<div><span class="gmail_quote"></span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I am writing a not too short Chinese tutorial about cmake.<br>Up to now nine chapter had already been finished, include:</blockquote><div><br>Interesting. Is RedFlag&#39;s project using CMake? :-)<br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
prefix<br>1,about cmake<br>2,how to install cmake.<br><br>3,Hello World in cmake<br>use helloworld as a demo to illustrate how to use cmake to manage and<br>build a project.<br>introduce PROJECT ADD_EXECUTABLE command and
<br>&lt;projectname&gt;_SOURCE_DIR,&lt;projectname&gt;_BINARY_DIR.<br>also introduce in-source build and out-of-source build.<br><br>4,make Hello World better<br>add more things to Helloworld, document, scripts, and illustrate the
<br>syntax of INSTALL and how to use it.<br><br>5,Manage shared library and static library<br>introduce ADD_LIBRARY SET_TARGET_PROPERTIES command.<br>also include how to build same name shared and static library and shared
<br>library versioning.<br><br>6,Use libraries in your project<br>introduce INCLUDE_DIRECTORIES LINK_DIRECTORIES and TARGET_LINK_LIBRARIES<br>command.<br><br>7,pre-defined cmake variables<br>a lot of varibles in cmake, like CMAKE_BINARY_DIR and so on.
<br><br>8,cmake command<br>all commands in cmake.<br><br>9,how to use Find_ modules and write you own modules.<br>also include CMAKE_MODULE_PATH varible.<br><br><br><br><br>when I use cmake, the variable usage is confused me.
<br>for example, commonly if we want to use a variable, we should use ${},<br>for example:<br><br>MESSAGE(STATUS &quot;the dir is: ${PROJECT_SOURCE_DIR}&quot;)<br><br>SET(SRC_LIST main.c t1.c)<br>ADD_EXECUTABLE(hello ${SRC_LIST})
<br><br>but when we use IF ELSEIF ENDIF command.<br><br>we had to use it like<br><br>FIND_PACKAGE(libX X11 /usr/lib/xorg)<br>IF(libX) or IF(NOT libX)<br><br>I can not use it like IF(${libX}) or IF(NOT ${libX}).</blockquote>
<div><br>The `IF(var)&#39; or `IF(NOT var)&#39; command expects `var&#39; to be the name of a variable. This is stated in CMake&#39;s manual. So, for your situation `IF(${libX})&#39; is the same as `IF(/usr/lib/xorg)&#39; and then CMake will check the value of the variable named `/usr/lib/xorg&#39;.
<br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">anybody can explain the rule that how to use variable in cmake?<br>_______________________________________________
<br>CMake mailing list<br><a href="mailto:CMake@cmake.org">CMake@cmake.org</a><br><a href="http://www.cmake.org/mailman/listinfo/cmake">http://www.cmake.org/mailman/listinfo/cmake</a><br></blockquote></div><br>