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> <<a href="mailto:mike.jackson@imts.us">mike.jackson@imts.us</a>> 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 & 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>