From 5085d23dd1837ba2243da5404c3b2a8652831331 Mon Sep 17 00:00:00 2001 From: Ted John Date: Sun, 12 Nov 2017 21:32:13 +0000 Subject: [PATCH] Improve cmakelists for vcpkg building - Remove forced /MT directive. - Allow building for debug. - Add option to prevent building of example apps. --- CMakeLists.txt | 6 +++++- src/CMakeLists.txt | 4 ---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9411b07..43f0163 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,8 @@ cmake_minimum_required (VERSION 3.7.0) project (DiscordRPC) +option(BUILD_EXAMPLES "Build example apps" ON) + # format file(GLOB_RECURSE ALL_SOURCE_FILES examples/*.cpp examples/*.h examples/*.c @@ -51,4 +53,6 @@ add_library(rapidjson STATIC IMPORTED ${RAPIDJSON}) # add subdirs add_subdirectory(src) -add_subdirectory(examples/send-presence) +if (BUILD_EXAMPLES) + add_subdirectory(examples/send-presence) +endif(BUILD_EXAMPLES) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 3839781..34d415d 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -27,7 +27,6 @@ if(WIN32) add_library(discord-rpc ${BASE_RPC_SRC}) if (MSVC) target_compile_options(discord-rpc PRIVATE /EHsc - /MT /Wall /wd4100 # unreferenced formal parameter /wd4514 # unreferenced inline @@ -105,13 +104,10 @@ install( EXPORT "discord-rpc" RUNTIME DESTINATION "bin" - CONFIGURATIONS Release LIBRARY DESTINATION "lib" - CONFIGURATIONS Release ARCHIVE DESTINATION "lib" - CONFIGURATIONS Release INCLUDES DESTINATION "include" )