Hi Braden, the purpose of CMAKE_CFG_INTDIR is to expand to something that is meaningful to the build system you're using. It's a way to transport information from CMake-time (when your CMakeLists are processed) to build-time (when you run a build).
The exact value of CMAKE_CFG_INTDIR depends on the generator you're using. For Visual Studio, for example, it's $(OutDir) or $(Configuration), depending on VS version. Note that these aren't CMake variable, they're Visual Studio macros, which are expanded by VS itself when it sees them in a command-line it's processing. CMAKE_CFG_INTDIR will have a value with similar properties for other multi-configuration generators (e.g. $(CONFIGURATION) for XCode). On single-config generators, the value is just ".", because these do not have different paths for different configurations (since they just have one). With such generators, the name of the configuration is available at CMake-time in the variable CMAKE_BUILD_TYPE. On multi-config generators, there is no "current configuration" at CMake-time. When a reference to a configuration-specific path (or something else configuration-specific) is necessary, its dereferencing must be done at build time, and for this purpose, the "meta" variable CMAKE_CFG_INTDIR is used. I hope this helps you. Regarding your particular question about replacing in the value, are you sure CMAKE_CFG_INTDIR expands to a text with braces, not parentheses? Petr On Fri, Mar 29, 2013 at 9:58 PM, Braden McDaniel <[email protected]>wrote: > The value of the variable CMAKE_CFG_INTDIR is the literal string > "${config}" > (that is, CMake does not expand this variable itself). I'd like to expand > this > literal variable within CMake using a value I supply; that is, I'd like to > replace the literal string "${config}" with something else; say, "foo". > Alas, I > have not been able to get this to work: > > string(REPLACE "\${config}" foo MY_OUTPUT_VAR ${CMAKE_CFG_INTDIR}) > > Why isn't this working? Is there some other way to accomplish what I want? > > Braden > > > -- > > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the CMake FAQ at: > http://www.cmake.org/Wiki/CMake_FAQ > > Follow this link to subscribe/unsubscribe: > http://www.cmake.org/mailman/listinfo/cmake >
-- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
