Michael,<br><br>Ya. For now it is the best solution. <br><br>Another solution is to generate project files for debug and release separately.<br><br>Regards,<br>Dima<br><br><div class="gmail_quote">2009/3/4 Michael Jackson <span dir="ltr"><<a href="mailto:mike.jackson@bluequartz.net">mike.jackson@bluequartz.net</a>></span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">I started another thread to ask for some clarification on those issues.<br>
<br>
If I were you I would write a macro that combines everything that I sent into a single macro call. That way in each of your projects you could do something like:<br>
<br>
add_my_executable(exename sources other_stuff debug_postfix)<br>
<br>
and then you can get all the benefits of having a _debug post fix on your libraries and executables.<div class="im"><br>
<br>
<br>
_________________________________________________________<br>
Mike Jackson <a href="mailto:mike.jackson@bluequartz.net" target="_blank">mike.jackson@bluequartz.net</a><br>
BlueQuartz Software <a href="http://www.bluequartz.net" target="_blank">www.bluequartz.net</a><br>
Principal Software Engineer Dayton, Ohio<br>
<br>
<br>
<br></div><div><div></div><div class="h5">
On Mar 4, 2009, at 11:21 AM, Dmytro Ovdiienko wrote:<br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Michael,<br>
<br>
Thank you for your replay.<br>
<br>
<CONFIG>_POSTFIX is a target property. User still have to update all projects in the source tree.<br>
<br>
BTW why CMAKE_<CONFIG>_POSTFIX applies only for non-executable?<br>
<br>
Regards,<br>
Dima<br>
<br>
2009/3/4 Michael Jackson <<a href="mailto:mike.jackson@bluequartz.net" target="_blank">mike.jackson@bluequartz.net</a>><br>
• <CONFIG>_POSTFIX: Postfix to append to the target file name for configuration <CONFIG>.<br>
When building with configuration <CONFIG> the value of this property is appended to the target file name built on disk. For non-executable targets, this property is initialized by the value of the variable CMAKE_<CONFIG>_POSTFIX if it is set when a target is created. This property is ignored on the Mac for Frameworks and App Bundles.<br>
<br>
• CMAKE_<CONFIG>_POSTFIX: Default filename postfix for libraries under configuration <CONFIG>.<br>
When a non-executable target is created its <CONFIG>_POSTFIX target property is initialized with the value of this variable if it is set.<br>
<br>
<br>
<br>
<br>
<br>
_________________________________________________________<br>
Mike Jackson <a href="mailto:mike.jackson@bluequartz.net" target="_blank">mike.jackson@bluequartz.net</a><br>
BlueQuartz Software <a href="http://www.bluequartz.net" target="_blank">www.bluequartz.net</a><br>
Principal Software Engineer Dayton, Ohio<br>
<br>
<br>
<br>
On Mar 4, 2009, at 10:37 AM, Dmytro Ovdiienko wrote:<br>
<br>
Michael,<br>
<br>
RELEASE_OUTPUT_NAME/DEBUG_OUTPUT_NAME properties are the only way to do this. But I have to set these properties for every project (I have 36 projects). Noo.. I'm too lazy to do this :)<br>
<br>
I beleive there is a property like CMAKE_<CONFIG>_POSTFIX to change suffix for executable.<br>
<br>
2009/3/4 Michael Jackson <<a href="mailto:mike.jackson@bluequartz.net" target="_blank">mike.jackson@bluequartz.net</a>><br>
I wrote/tweaked a Tiff cmake build system, this is what I use:<br>
<br>
IF (BUILD_SHARED_LIBS)<br>
IF (WIN32 AND NOT MINGW)<br>
SET(LIB_RELEASE_NAME "tiffdll")<br>
SET(LIB_DEBUG_NAME "tiffdll_D")<br>
ELSE (WIN32 AND NOT MINGW)<br>
SET(LIB_RELEASE_NAME "tiff")<br>
SET(LIB_DEBUG_NAME "tiff_debug")<br>
ENDIF(WIN32 AND NOT MINGW)<br>
ELSE (BUILD_SHARED_LIBS)<br>
IF (WIN32 AND NOT MINGW)<br>
SET(LIB_RELEASE_NAME "libtiff")<br>
SET(LIB_DEBUG_NAME "libtiff_D")<br>
ELSE (WIN32 AND NOT MINGW)<br>
SET(LIB_RELEASE_NAME "tiff")<br>
SET(LIB_DEBUG_NAME "tiff_debug")<br>
ENDIF(WIN32 AND NOT MINGW)<br>
ENDIF (BUILD_SHARED_LIBS)<br>
<br>
ADD_LIBRARY(tiff ${LIB_TYPE} ${TIFF_SRCS} ${TIFF_HEADERS})<br>
TARGET_LINK_LIBRARIES( tiff ${SUPPORT_LIBS} )<br>
<br>
SET_TARGET_PROPERTIES( tiff<br>
PROPERTIES<br>
DEBUG_OUTPUT_NAME ${LIB_DEBUG_NAME}<br>
RELEASE_OUTPUT_NAME ${LIB_RELEASE_NAME}<br>
)<br>
<br>
#----- Use MSVC Naming conventions for Shared Libraries<br>
IF (MINGW AND BUILD_SHARED_LIBS)<br>
SET_TARGET_PROPERTIES( tiff<br>
PROPERTIES<br>
IMPORT_SUFFIX ".lib"<br>
IMPORT_PREFIX ""<br>
PREFIX ""<br>
)<br>
ENDIF (MINGW AND BUILD_SHARED_LIBS)<br>
<br>
<br>
_________________________________________________________<br>
Mike Jackson <a href="mailto:mike.jackson@bluequartz.net" target="_blank">mike.jackson@bluequartz.net</a><br>
BlueQuartz Software <a href="http://www.bluequartz.net" target="_blank">www.bluequartz.net</a><br>
Principal Software Engineer Dayton, Ohio<br>
<br>
<br>
<br>
<br>
On Mar 4, 2009, at 10:06 AM, Dmytro Ovdiienko wrote:<br>
<br>
Hello All,<br>
<br>
I use CMake to build my project's sources on windows and linux using static and dynamic runtimes.<br>
<br>
I would like to add information about build configuration to the output file name as suffix.<br>
<br>
For instance:<br>
- libsome_lib_linux_x32.a - static library "some_lib" for linux 32bit<br>
- some_lib_windows_x64_md.lib - static library "some_lib" for windows 64bit with dynamic release runtime<br>
- some_lib_windows_x62_mtd.lib - static library "some_lib" for windows 32bit with static debug runtime<br>
<br>
For windows I generate projects with debug and release configurations.<br>
<br>
Right now I play with<br>
- CMAKE_STATIC_LIBRARY_SUFFIX<br>
- CMAKE_SHARED_MODULE_SUFFIX<br>
- CMAKE_SHARED_LIBRARY_SUFFIX<br>
- CMAKE_EXECUTABLE_SUFFIX<br>
- CMAKE_<CONFIG>_POSTFIX<br>
<br>
But it is not enought. CMAKE_<CONFIG>_POSTFIX changes suffix only for dll and lib files. But not for exe file.<br>
<br>
Also I played with <CONFIG>_OUTPUT_NAME. It solves my problem but I have to change this property for all my projects. It is not obvious in my case. I have too much projects.<br>
<br>
Question: How can I setup suffixes for every configuration in one place?<br>
<br>
Regards,<br>
Dima<br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br>
<br>
<br>
<br>
<br>
</blockquote>
<br>
</div></div></blockquote></div><br>