<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; ">well, that verified what I am seeing:<DIV>#-- from Project B CMakeLists.txt file</DIV><DIV>IF ( NOT DEFINED  MHD_INTERFACE_LIB_NAME)</DIV><DIV>  MESSAGE ( FATAL_ERROR "MHD_INTERFACE_LIB_NAME is not defined and should be")</DIV><DIV>ENDIF ( NOT DEFINED  )</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>where MHD_INTERFACE_LIB_NAME is defined in Project A, and I want to use it in Project B. </DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>When I run cmake on the project B directory I get the fatal error.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>So.. do I get access to variables in other CMakeLists.txt files that are included from top level cmake file?</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Thanks</DIV><DIV><DIV> <SPAN class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Bitstream Vera Sans; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">-- </DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Mike Jackson   Senior Research Engineer</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Innovative Management &amp; Technology Services</DIV><BR class="Apple-interchange-newline"></SPAN> </DIV><BR><DIV><DIV>On Dec 19, 2006, at 1:37 PM, David Cole wrote:</DIV><BR class="Apple-interchange-newline"><BLOCKQUOTE type="cite">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>"SET" a variable as follows:<BR><BR>SET (PROJECT_A_LIB_NAME MyLib)<BR><BR>then use that further down A'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  added the "ADD_SUBDIRECTORY<BR>(PATH_TO_A BIN_DIR) to B's CMakeLists.txt file and then I tried just <BR>using the variable like usual ( ${PROJECT_A_LIB_NAME} )  but it is<BR>undefined.<BR><BR>IF (NOT DEFINED ${PROJECT_A_LIB_NAME} )<BR>        MESSAGE (FATAL_ERROR "Ahh.. this is a problem")<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   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></BLOCKQUOTE></DIV><BR></DIV></BODY></HTML>