Commit 26bccf29 authored by Jan Möbius's avatar Jan Möbius

Append a d to the libs if in debug mode and none in release mode



git-svn-id: http://www.openmesh.org/svnrepo/OpenMesh/trunk@401 fdac6126-5c0c-442c-9429-916003d36597
parent 9a3f014d
...@@ -4,6 +4,7 @@ project (OpenMesh) ...@@ -4,6 +4,7 @@ project (OpenMesh)
# add our macro directory to cmake search path # add our macro directory to cmake search path
set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake) set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake)
set (CMAKE_DEBUG_POSTFIX "d")
# include our cmake files # include our cmake files
include (ACGCommon) include (ACGCommon)
......
...@@ -432,6 +432,15 @@ function (acg_add_library _target _libtype) ...@@ -432,6 +432,15 @@ function (acg_add_library _target _libtype)
endif () endif ()
endif () endif ()
if( ${CMAKE_BUILD_TYPE} STREQUAL Debug )
set ( postfix ${CMAKE_DEBUG_POSTFIX} )
else ()
set ( postfix "" )
endif ()
set( fullname ${_target}${postfix} )
if (WIN32) if (WIN32)
# copy exe file to "Build" directory # copy exe file to "Build" directory
# Visual studio will create this file in a subdirectory so we can't use # Visual studio will create this file in a subdirectory so we can't use
...@@ -440,8 +449,8 @@ function (acg_add_library _target _libtype) ...@@ -440,8 +449,8 @@ function (acg_add_library _target _libtype)
add_custom_command (TARGET ${_target} POST_BUILD add_custom_command (TARGET ${_target} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E COMMAND ${CMAKE_COMMAND} -E
copy_if_different copy_if_different
${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${_target}.dll ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${fullname}.dll
${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_BINDIR}/${_target}.dll) ${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_BINDIR}/${fullname}.dll)
elseif (${_type} STREQUAL MODULE) elseif (${_type} STREQUAL MODULE)
if (NOT EXISTS ${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_PLUGINDIR}) if (NOT EXISTS ${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_PLUGINDIR})
file (MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_PLUGINDIR}) file (MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_PLUGINDIR})
...@@ -449,23 +458,23 @@ function (acg_add_library _target _libtype) ...@@ -449,23 +458,23 @@ function (acg_add_library _target _libtype)
add_custom_command (TARGET ${_target} POST_BUILD add_custom_command (TARGET ${_target} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E COMMAND ${CMAKE_COMMAND} -E
copy_if_different copy_if_different
${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${_target}.dll ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${fullname}.dll
${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_PLUGINDIR}/${_target}.dll) ${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_PLUGINDIR}/${fullname}.dll)
endif () endif ()
if (${_type} STREQUAL SHARED OR ${_type} STREQUAL STATIC) if (${_type} STREQUAL SHARED OR ${_type} STREQUAL STATIC)
add_custom_command (TARGET ${_target} POST_BUILD add_custom_command (TARGET ${_target} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E COMMAND ${CMAKE_COMMAND} -E
copy_if_different copy_if_different
${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${_target}.lib ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${fullname}.lib
${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_LIBDIR}/${_target}.lib) ${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_LIBDIR}/${fullname}.lib)
endif () endif ()
elseif (APPLE AND NOT ACG_PROJECT_MACOS_BUNDLE) elseif (APPLE AND NOT ACG_PROJECT_MACOS_BUNDLE)
if (${_type} STREQUAL SHARED) if (${_type} STREQUAL SHARED)
add_custom_command (TARGET ${_target} POST_BUILD add_custom_command (TARGET ${_target} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E COMMAND ${CMAKE_COMMAND} -E
copy_if_different copy_if_different
${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib${_target}.dylib ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib${fullname}.dylib
${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_LIBDIR}/lib${_target}.dylib) ${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_LIBDIR}/lib${fullname}.dylib)
elseif (${_type} STREQUAL MODULE) elseif (${_type} STREQUAL MODULE)
if (NOT EXISTS ${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_PLUGINDIR}) if (NOT EXISTS ${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_PLUGINDIR})
file (MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_PLUGINDIR}) file (MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_PLUGINDIR})
...@@ -473,29 +482,29 @@ function (acg_add_library _target _libtype) ...@@ -473,29 +482,29 @@ function (acg_add_library _target _libtype)
add_custom_command (TARGET ${_target} POST_BUILD add_custom_command (TARGET ${_target} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E COMMAND ${CMAKE_COMMAND} -E
copy_if_different copy_if_different
${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib${_target}.so ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib${fullname}.so
${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_PLUGINDIR}/lib${_target}.so) ${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_PLUGINDIR}/lib${fullname}.so)
elseif (${_type} STREQUAL STATIC) elseif (${_type} STREQUAL STATIC)
add_custom_command (TARGET ${_target} POST_BUILD add_custom_command (TARGET ${_target} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E COMMAND ${CMAKE_COMMAND} -E
copy_if_different copy_if_different
${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib${_target}.a ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib${fullname}.a
${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_LIBDIR}/lib${_target}.a) ${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_LIBDIR}/lib${fullname}.a)
endif () endif ()
if (_and_static) if (_and_static)
add_custom_command (TARGET ${_target}Static POST_BUILD add_custom_command (TARGET ${_target}Static POST_BUILD
COMMAND ${CMAKE_COMMAND} -E COMMAND ${CMAKE_COMMAND} -E
copy_if_different copy_if_different
${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib${_target}Static.a ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib${_target}Static${postfix}.a
${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_LIBDIR}/lib${_target}.a) ${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_LIBDIR}/lib${fullname}.a)
endif () endif ()
elseif (NOT APPLE AND _and_static) elseif (NOT APPLE AND _and_static)
add_custom_command (TARGET ${_target}Static POST_BUILD add_custom_command (TARGET ${_target}Static POST_BUILD
COMMAND ${CMAKE_COMMAND} -E COMMAND ${CMAKE_COMMAND} -E
copy_if_different copy_if_different
${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib${_target}Static.a ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib${_target}Static${postfix}.a
${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_LIBDIR}/lib${_target}.a) ${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_LIBDIR}/lib${fullname}.a)
endif () endif ()
...@@ -509,9 +518,9 @@ function (acg_add_library _target _libtype) ...@@ -509,9 +518,9 @@ function (acg_add_library _target _libtype)
LIBRARY DESTINATION ${ACG_PROJECT_LIBDIR} LIBRARY DESTINATION ${ACG_PROJECT_LIBDIR}
ARCHIVE DESTINATION ${ACG_PROJECT_LIBDIR}) ARCHIVE DESTINATION ${ACG_PROJECT_LIBDIR})
if (_and_static) if (_and_static)
install (FILES ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib${_target}Static.a install (FILES ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib${_target}Static${postfix}.a
DESTINATION ${ACG_PROJECT_LIBDIR} DESTINATION ${ACG_PROJECT_LIBDIR}
RENAME lib${_target}.a RENAME lib${fullname}.a
PERMISSIONS OWNER_WRITE OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) PERMISSIONS OWNER_WRITE OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
endif () endif ()
elseif (${_type} STREQUAL MODULE) elseif (${_type} STREQUAL MODULE)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment