Improve cmakelists for vcpkg building
- Remove forced /MT directive. - Allow building for debug. - Add option to prevent building of example apps.
This commit is contained in:
parent
1675d5d2dc
commit
5085d23dd1
2 changed files with 5 additions and 5 deletions
|
@ -1,6 +1,8 @@
|
||||||
cmake_minimum_required (VERSION 3.7.0)
|
cmake_minimum_required (VERSION 3.7.0)
|
||||||
project (DiscordRPC)
|
project (DiscordRPC)
|
||||||
|
|
||||||
|
option(BUILD_EXAMPLES "Build example apps" ON)
|
||||||
|
|
||||||
# format
|
# format
|
||||||
file(GLOB_RECURSE ALL_SOURCE_FILES
|
file(GLOB_RECURSE ALL_SOURCE_FILES
|
||||||
examples/*.cpp examples/*.h examples/*.c
|
examples/*.cpp examples/*.h examples/*.c
|
||||||
|
@ -51,4 +53,6 @@ add_library(rapidjson STATIC IMPORTED ${RAPIDJSON})
|
||||||
# add subdirs
|
# add subdirs
|
||||||
|
|
||||||
add_subdirectory(src)
|
add_subdirectory(src)
|
||||||
add_subdirectory(examples/send-presence)
|
if (BUILD_EXAMPLES)
|
||||||
|
add_subdirectory(examples/send-presence)
|
||||||
|
endif(BUILD_EXAMPLES)
|
||||||
|
|
|
@ -27,7 +27,6 @@ if(WIN32)
|
||||||
add_library(discord-rpc ${BASE_RPC_SRC})
|
add_library(discord-rpc ${BASE_RPC_SRC})
|
||||||
if (MSVC)
|
if (MSVC)
|
||||||
target_compile_options(discord-rpc PRIVATE /EHsc
|
target_compile_options(discord-rpc PRIVATE /EHsc
|
||||||
/MT
|
|
||||||
/Wall
|
/Wall
|
||||||
/wd4100 # unreferenced formal parameter
|
/wd4100 # unreferenced formal parameter
|
||||||
/wd4514 # unreferenced inline
|
/wd4514 # unreferenced inline
|
||||||
|
@ -105,13 +104,10 @@ install(
|
||||||
EXPORT "discord-rpc"
|
EXPORT "discord-rpc"
|
||||||
RUNTIME
|
RUNTIME
|
||||||
DESTINATION "bin"
|
DESTINATION "bin"
|
||||||
CONFIGURATIONS Release
|
|
||||||
LIBRARY
|
LIBRARY
|
||||||
DESTINATION "lib"
|
DESTINATION "lib"
|
||||||
CONFIGURATIONS Release
|
|
||||||
ARCHIVE
|
ARCHIVE
|
||||||
DESTINATION "lib"
|
DESTINATION "lib"
|
||||||
CONFIGURATIONS Release
|
|
||||||
INCLUDES
|
INCLUDES
|
||||||
DESTINATION "include"
|
DESTINATION "include"
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue