DEFINED should be used with the variable name itself, not the value of the variable:<br><br>IF(NOT DEFINED PROJECT_A_LIB_NAME)<br><br>Scratch the ${} and see what happens...<br><br><br><div><span class="gmail_quote">On 12/19/06, 
<b class="gmail_sendername">Mike Jackson</b> &lt;<a href="mailto:mike.jackson@imts.us">mike.jackson@imts.us</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I have couple of projects, lets call them A and B. In project A I<br>&quot;SET&quot; a variable as follows:<br><br>SET (PROJECT_A_LIB_NAME MyLib)<br><br>then use that further down A&#39;s cmake file in the ADD_LIBRARY() function.
<br><br>Now in Project B I would like to automagically be able to read the<br>PROJECT_A_LIB_NAME variable. I have&nbsp;&nbsp;added the &quot;ADD_SUBDIRECTORY<br>(PATH_TO_A BIN_DIR) to B&#39;s CMakeLists.txt file and then I tried just
<br>using the variable like usual ( ${PROJECT_A_LIB_NAME} )&nbsp;&nbsp;but it is<br>undefined.<br><br>IF (NOT DEFINED ${PROJECT_A_LIB_NAME} )<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;MESSAGE (FATAL_ERROR &quot;Ahh.. this is a problem&quot;)<br>ENDIF (NOT DEFINED ${PROJECT_A_LIB_NAME} )
<br><br>So.. is there a way to get the variable value from one CMakeLists.txt<br>file to another?<br><br>Thanks for any help.<br>--<br>Mike Jackson&nbsp;&nbsp; Senior Research Engineer<br>Innovative Management &amp; Technology Services
<br><br><br><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>