[prev in list] [next in list] [prev in thread] [next in thread]
List: cmake
Subject: Re: [CMake] global variable passing up via INTERNAL cache
From: "Tal Blum" <tblum () bbn ! com>
Date: 2007-11-29 23:17:38
Message-ID: 00af01c832de$0baee940$13162180 () d4m ! bbn ! com
[Download RAW message or body]
I only use one variable and I define 2 macros. The second macro is used to
initialize the list before I call APPEND_INTERNAL_LIST(). Notice that I do
not use a temp variable that is shared between calls and can cause problems.
# A macro for passing lists between different directories
# through an internal cache variable.
MACRO (APPEND_INTERNAL_LIST LIST_NAME VALUE)
# If the list in not in the cache, create it.
IF (${LIST_NAME})
SET (${LIST_NAME} "${${LIST_NAME}};${VALUE}" CACHE INTERNAL "Internal
variable")
ELSE (${LIST_NAME})
SET (${LIST_NAME} "${VALUE}" CACHE INTERNAL "Internal variable")
ENDIF (${LIST_NAME})
ENDMACRO (APPEND_INTERNAL_LIST)
# A macro for passing lists between different directories
# through an internal cache variable.
# This function empties the variable (usually because of older runs)
MACRO (INITIALIZE_INTERNAL_LIST LIST_NAME)
SET (${LIST_NAME} "" CACHE INTERNAL "Internal variable")
ENDMACRO (INITIALIZE_INTERNAL_LIST)
-Tal
_______________________________________________
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic