2017-11-26 07:53:32 +08:00
|
|
|
cmake_minimum_required(VERSION 3.3)
|
|
|
|
project(vcpkg CXX)
|
|
|
|
|
2017-11-29 05:06:56 +08:00
|
|
|
add_compile_options(-std=c++1z)
|
|
|
|
|
2017-12-15 06:31:16 +08:00
|
|
|
if(CMAKE_COMPILER_IS_GNUXX OR CMAKE_CXX_COMPILER_ID MATCHES "GNU")
|
2017-11-29 05:06:56 +08:00
|
|
|
set(GCC 1)
|
|
|
|
elseif(CMAKE_CXX_COMPILER_ID MATCHES "[Cc]lang")
|
|
|
|
set(CLANG 1)
|
2017-12-15 06:31:16 +08:00
|
|
|
else()
|
|
|
|
message(FATAL_ERROR "Unknown compiler: ${CMAKE_CXX_COMPILER_ID}")
|
2017-11-29 05:06:56 +08:00
|
|
|
endif()
|
|
|
|
|
2017-11-26 07:53:32 +08:00
|
|
|
file(GLOB_RECURSE VCPKGLIB_SOURCES src/vcpkg/*.cpp)
|
|
|
|
|
|
|
|
add_library(vcpkglib STATIC ${VCPKGLIB_SOURCES})
|
|
|
|
target_compile_definitions(vcpkglib PRIVATE -DDISABLE_METRICS=0)
|
|
|
|
target_include_directories(vcpkglib PUBLIC include)
|
2017-11-29 02:50:33 +08:00
|
|
|
|
2017-11-29 05:06:56 +08:00
|
|
|
if(GCC)
|
|
|
|
target_link_libraries(vcpkglib PUBLIC stdc++fs)
|
|
|
|
elseif(CLANG)
|
|
|
|
target_link_libraries(vcpkglib PUBLIC c++experimental)
|
2017-11-29 02:50:33 +08:00
|
|
|
endif()
|
2017-11-26 07:53:32 +08:00
|
|
|
|
|
|
|
add_executable(vcpkg src/vcpkg.cpp)
|
|
|
|
target_link_libraries(vcpkg PRIVATE vcpkglib)
|