From ecb25fc910ec59674420657b882f8d20aeff52c1 Mon Sep 17 00:00:00 2001 From: Jeremy Tregunna Date: Tue, 15 May 2018 09:51:00 -0600 Subject: [PATCH 1/2] fix compiler checking for vc2017 --- CMakeLists.txt | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e2b1819..fc74c8d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -30,10 +30,16 @@ else() message(STATUS "Checking compiler flags for C++11 support.") include(CheckCXXCompilerFlag) - check_cxx_compiler_flag("-std=c++11" COMPILER_SUPPORTS_CXX11) - check_cxx_compiler_flag("-std=c++0x" COMPILER_SUPPORTS_CXX0X) + if(NOT MSVC) + CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11) + CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X) + endif(NOT MSVC) - if(COMPILER_SUPPORTS_CXX11) + if(MSVC) + if(NOT CMAKE_CXX_STANDARD) + message(STATUS "Something's wrong with your compiler dude.") + endif(NOT CMAKE_CXX_STANDARD) + elseif(COMPILER_SUPPORTS_CXX11) message(STATUS "C++11 is supported.") if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") From 23622b891eb9c4f05e482db0202da5202b50b8e5 Mon Sep 17 00:00:00 2001 From: Jeremy Tregunna Date: Tue, 15 May 2018 10:28:05 -0600 Subject: [PATCH 2/2] fix curl path --- .gitignore | 3 +++ CMakeLists.txt | 5 ++--- CMakeSettings.json | 17 +++++++++++++++++ 3 files changed, 22 insertions(+), 3 deletions(-) create mode 100644 CMakeSettings.json diff --git a/.gitignore b/.gitignore index f9b4b75..8a8944a 100644 --- a/.gitignore +++ b/.gitignore @@ -43,3 +43,6 @@ metis.config.yml # Lib trash libs/sse/parse-sse.c + +# Visual Studio +.vs diff --git a/CMakeLists.txt b/CMakeLists.txt index fc74c8d..d102f3d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -36,9 +36,7 @@ else() endif(NOT MSVC) if(MSVC) - if(NOT CMAKE_CXX_STANDARD) - message(STATUS "Something's wrong with your compiler dude.") - endif(NOT CMAKE_CXX_STANDARD) + message(STATUS "Building with Visual Studio") elseif(COMPILER_SUPPORTS_CXX11) message(STATUS "C++11 is supported.") @@ -107,6 +105,7 @@ else() set(EXE_NAME skafos) endif() +target_include_directories(${EXEC_NAME} PRIVATE ${CURL_INCLUDE_DIRS}) add_executable(${EXE_NAME} ${SOURCES}) target_link_libraries(${EXE_NAME} sse yaml-cpp ${CMAKE_THREAD_LIBS_INIT} ${CURL_LIBRARIES} ${LibArchive_LIBRARIES} ${YAMLCPP_LIBRARY}) diff --git a/CMakeSettings.json b/CMakeSettings.json new file mode 100644 index 0000000..f3fd012 --- /dev/null +++ b/CMakeSettings.json @@ -0,0 +1,17 @@ +{ + "configurations": [ + { + "name": "x86-Debug", + "generator": "Visual Studio 15 2017", + "configurationType": "Debug", + "cmakeCommandArgs": "", + "buildCommandArgs": "-m -v:minimal", + "variables": [ + { + "name": "CMAKE_TOOLCHAIN_FILE", + "value": "C:\\Contracts\\MetisMachine\\vcpkg\\scripts\\buildsystems\\vcpkg.cmake" + } + ] + } + ] +} \ No newline at end of file