summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Sinclair <radarsat1@gmail.com>2019-04-16 22:24:52 +0200
committerStephen Sinclair <radarsat1@gmail.com>2019-04-16 22:29:00 +0200
commit944c378e2a6eeb365d0993da3521462be7063fa0 (patch)
treea7c9e9db91b7b2cbe23c71565faa2b44271291c4
parentd3a4e88162eb374f14719a5d08ef3dba8ae14de6 (diff)
[cmake] expose some standard CMake options
- make build type a drop-down if it's not otherwise set. - default to 'd' suffix for Windows debug builds only.
-rw-r--r--CMakeLists.txt10
1 files changed, 10 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2cee314..1786947 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -28,6 +28,16 @@ if(MINGW)
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
endif()
+# Standard CMake options
+option(BUILD_SHARED_LIBS "Build as shared library" ON)
+
+if (NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE)
+ set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug;Release;RelWithDebInfo;MinSizeRel")
+endif()
+if(WINDOWS)
+ set(CMAKE_DEBUG_POSTFIX d CACHE STRING "Postfix for debug version of library")
+endif()
+
# Build Options
option(RTAUDIO_BUILD_PYTHON "Build PyRtAudio python bindings" OFF)
set(RTAUDIO_TARGETNAME_UNINSTALL "uninstall" CACHE STRING "Name of 'uninstall' build target")