On 28. Jan, 2010, at 11:19 , Micha Renner wrote: > There is a library, which has the suffix d, if it is compiled in > Debug-Mode > > ADD_LIBRARY(${_targetname} SHARED ${_src} ${_imIncludeFiles}) > SET_TARGET_PROPERTIES(${_targetname} PROPERTIES DEBUG_OUTPUT_NAME > ${_targetname}d) > INSTALL(TARGETS ${_targetname} EXPORT SLibName > RUNTIME DESTINATION dll > LIBRARY DESTINATION lib > ARCHIVE DESTINATION lib) > INSTALL(EXPORT SLibName NAMESPACE mp_ DESTINATION lib/SLibName) > > In an other project an application uses the library: > INCLUDE(${CMAKE_INSTALL_PREFIX}/lib/SLibName/SLibName.cmake) > ADD_EXECUTABLE(TestDll12 testC.c) > TARGET_LINK_LIBRARIES(TestDll12 mp_SLib1) > > If I set CMAKE_BUILD_TYPE to "Debug" (CMAKE-GUI), the application > program uses debug-library. > After switching into the "Release"-Mode, the application program still > uses the debug-library. > The trick is to delete the cache, then it works. > > So is it really always necessary to delete the cache, if I change the > build-mode? > > Micha
Not sure what's going on, I actually never tried to do that. But you'll certainly want to have a look at the <CONFIG>_POSTFIX target property or the <CONFIG>_POSTFIX variable for setting a postfix (such as "d") depending on the configuration. Michael _______________________________________________ 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