You can inherit from the top level CMakelists.txt variables.
So if the GET_DIRECTORY_PROPERTY command does not work for your case,
you can use the SET command in the top level CMakeLists.txt which calls
the command ADD_SUBDIRECTORY of your libraries A and B.
Something like:
IF(condition)
SET (PROJECT_A_LIB_NAME MyLib)
ADD_SUBDIRECTORY(A_Directory)
ENDIF(condition)
Then you can safely try to read the PROJECT_A_LIB_NAME variable in the
CMakeLists.txt of lib B.
-Sylvain
_______________________________________________
CMake mailing list
[email protected]
http://www.cmake.org/mailman/listinfo/cmake