From 944c378e2a6eeb365d0993da3521462be7063fa0 Mon Sep 17 00:00:00 2001 From: Stephen Sinclair Date: Tue, 16 Apr 2019 22:24:52 +0200 Subject: [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. --- CMakeLists.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) 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") -- cgit v1.2.3