Updated CMake file
This commit is contained in:
+33
-1
@@ -1,7 +1,39 @@
|
|||||||
# CMakeList.txt : Top-level CMake project file, do global configuration
|
# CMakeList.txt : Top-level CMake project file, do global configuration
|
||||||
# and include sub-projects here.
|
# and include sub-projects here.
|
||||||
#
|
#
|
||||||
cmake_minimum_required (VERSION 3.8)
|
cmake_minimum_required (VERSION 3.12)
|
||||||
|
|
||||||
|
|
||||||
|
if(NOT DEFINED VCPKG_ROOT_PATH)
|
||||||
|
set(VCPKG_ROOT_PATH ${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/vcpkg)
|
||||||
|
set(CMAKE_TOOLCHAIN_FILE
|
||||||
|
"${VCPKG_ROOT_PATH}/scripts/buildsystems/vcpkg.cmake"
|
||||||
|
CACHE STRING "Vcpkg toolchain file")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
message("The vcpkg root path ${VCPKG_ROOT_PATH}")
|
||||||
|
|
||||||
|
if(NOT DEFINED CMAKE_TOOLCHAIN_FILE)
|
||||||
|
set(TOOLCHAIN_PATH ${VCPKG_ROOT_PATH}/scripts/buildsystems/vcpkg.cmake)
|
||||||
|
|
||||||
|
set(CMAKE_TOOLCHAIN_FILE
|
||||||
|
"${TOOLCHAIN_PATH}"
|
||||||
|
CACHE STRING "Vcpkg toolchain file")
|
||||||
|
|
||||||
|
message("Using default toolchain file")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(NOT DEFINED VCPKG_TRIPLET)
|
||||||
|
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
||||||
|
set(MACOSX TRUE)
|
||||||
|
set(VCPKG_TRIPLET "x64-osx")
|
||||||
|
else ()
|
||||||
|
set(VCPKG_TRIPLET "x64-linux")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
message("Using default ${VCPKG_TRIPLET} triplet")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
|
||||||
project ("SpotifyDemo")
|
project ("SpotifyDemo")
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,37 @@
|
|||||||
|
# SpotifyDemo
|
||||||
|
|
||||||
|
Experimenting with the Sptofiy API
|
||||||
|
|
||||||
|
|
||||||
|
## Built with
|
||||||
|
|
||||||
|
* C++
|
||||||
|
* cmake
|
||||||
|
* vcpkg
|
||||||
|
* nlohmann-json
|
||||||
|
* cpr
|
||||||
|
* cppcodec
|
||||||
|
|
||||||
|
## Getting Started
|
||||||
|
|
||||||
|
Install dependencies using `vcpkg`
|
||||||
|
|
||||||
|
```console
|
||||||
|
vcpkg install nlohmann-json cpr cppcodec
|
||||||
|
```
|
||||||
|
|
||||||
|
Bootstrap vcpkg
|
||||||
|
|
||||||
|
```
|
||||||
|
cd SpotifyDemo/3rdparty/vcpkg
|
||||||
|
./[bootstrap.bat || bootstrap.sh]
|
||||||
|
```
|
||||||
|
|
||||||
|
Build the software
|
||||||
|
|
||||||
|
```console
|
||||||
|
mkdir build
|
||||||
|
cd build
|
||||||
|
cmake ..
|
||||||
|
cmake --build .
|
||||||
|
```
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
# CMakeList.txt : CMake project for SpotifyDemo, include source and define
|
# CMakeList.txt : CMake project for SpotifyDemo, include source and define
|
||||||
# project specific logic here.
|
# project specific logic here.
|
||||||
#
|
#
|
||||||
cmake_minimum_required (VERSION 3.8)
|
# cmake_minimum_required (VERSION 3.8)
|
||||||
|
|
||||||
set (CMAKE_CXX_STANDARD_REQUIRED ON)
|
set (CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||||
set (CMAKE_CXX_STANDARD 14)
|
set (CMAKE_CXX_STANDARD 14)
|
||||||
@@ -33,5 +33,5 @@ configure_file ("${CMAKE_CURRENT_SOURCE_DIR}/client_information.json" "${CMAKE_B
|
|||||||
# Add source to this project's executable.
|
# Add source to this project's executable.
|
||||||
add_executable (SpotifyDemo ${SOURCES})
|
add_executable (SpotifyDemo ${SOURCES})
|
||||||
|
|
||||||
target_link_libraries (SpotifyDemo PRIVATE nlohmann_json nlohmann_json::nlohmann_json cpr)
|
target_link_libraries (SpotifyDemo PRIVATE nlohmann_json nlohmann_json::nlohmann_json cpr::cpr)
|
||||||
target_include_directories (SpotifyDemo PRIVATE ${CPPCODEC_INCLUDE_DIRS})
|
target_include_directories (SpotifyDemo PRIVATE ${CPPCODEC_INCLUDE_DIRS})
|
||||||
|
|||||||
Reference in New Issue
Block a user