summaryrefslogtreecommitdiffstats
path: root/cmake/modules/LibraryDebugAndRelease.cmake
diff options
context:
space:
mode:
authorcraig <craig@11d20701-8431-0410-a711-e3c959e3b870>2012-01-01 11:40:09 +0000
committercraig <craig@11d20701-8431-0410-a711-e3c959e3b870>2012-01-01 11:40:09 +0000
commit7ed83b6c6666eb8b6b104c211ae7e52907350372 (patch)
tree4430b556abac0ad660a0aacf1887d77f85d8be02 /cmake/modules/LibraryDebugAndRelease.cmake
downloadscribus-7ed83b6c6666eb8b6b104c211ae7e52907350372.tar.gz
scribus-7ed83b6c6666eb8b6b104c211ae7e52907350372.tar.xz
scribus-7ed83b6c6666eb8b6b104c211ae7e52907350372.zip
Branch 1.3.5 tree to 1.4.x tree, goodbye 1.3.x
git-svn-id: svn://scribus.net/branches/Version14x/Scribus@17163 11d20701-8431-0410-a711-e3c959e3b870
Diffstat (limited to 'cmake/modules/LibraryDebugAndRelease.cmake')
-rw-r--r--cmake/modules/LibraryDebugAndRelease.cmake25
1 files changed, 25 insertions, 0 deletions
diff --git a/cmake/modules/LibraryDebugAndRelease.cmake b/cmake/modules/LibraryDebugAndRelease.cmake
new file mode 100644
index 0000000..b7f64f0
--- /dev/null
+++ b/cmake/modules/LibraryDebugAndRelease.cmake
@@ -0,0 +1,25 @@
+#
+# This macro is used when we may have a debug and or release build of a library,
+# and we want to produce a single easy to use library string that'll do the right
+# thing. If both debug and release versions are available, we'll automatically use the
+# debug version for debug builds and the release version for release builds.
+#
+# If only one build exists, we use that one irrespective of build type.
+#
+MACRO(SET_LIBRARY_FROM_DEBUG_AND_RELEASE _NAME)
+
+ IF(NOT DEFINED "${_NAME}_LIBRARY_RELEASE" OR NOT DEFINED "${_NAME}_LIBRARY_DEBUG")
+ MESSAGE(FATAL_ERROR "${_NAME}_LIBRARY_DEBUG OR ${_NAME}_LIBRARY_RELEASE undefined")
+ ENDIF(NOT DEFINED "${_NAME}_LIBRARY_RELEASE" OR NOT DEFINED "${_NAME}_LIBRARY_DEBUG")
+ IF(${_NAME}_LIBRARY_RELEASE AND ${_NAME}_LIBRARY_DEBUG)
+ SET(${_NAME}_LIBRARY "optimized;${${_NAME}_LIBRARY_RELEASE};debug;${${_NAME}_LIBRARY_DEBUG}")
+ ELSE(${_NAME}_LIBRARY_RELEASE AND ${_NAME}_LIBRARY_DEBUG)
+ IF(${_NAME}_LIBRARY_DEBUG)
+ MESSAGE("WARNING: ${_NAME} debug library will be used even for release builds")
+ SET(${_NAME}_LIBRARY ${${_NAME}_LIBRARY_DEBUG})
+ ELSE(${_NAME}_LIBRARY_DEBUG)
+ SET(${_NAME}_LIBRARY ${${_NAME}_LIBRARY_RELEASE})
+ ENDIF(${_NAME}_LIBRARY_DEBUG)
+ ENDIF(${_NAME}_LIBRARY_RELEASE AND ${_NAME}_LIBRARY_DEBUG)
+
+ENDMACRO(SET_LIBRARY_FROM_DEBUG_AND_RELEASE)