From 3c2069fdd15166fd655d7f4c2d59012274144a32 Mon Sep 17 00:00:00 2001 From: Julien Schueller Date: Wed, 12 Jul 2017 17:35:22 +0200 Subject: [PATCH 1/3] Cleanup appveyor script --- appveyor.yml | 37 ++++++++++++------------------------- 1 file changed, 12 insertions(+), 25 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index f4966a34d..c9ebf9863 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,30 +1,17 @@ -# This is a comment. - -version: build.{build} - -os: Windows Server 2012 R2 - clone_folder: c:\projects\jsoncpp -platform: - - Win32 - - x64 - -configuration: - - Debug - - Release - -# scripts to run before build -before_build: - - echo "Running cmake..." - - cd c:\projects\jsoncpp - - cmake --version - - set PATH=C:\Program Files (x86)\MSBuild\14.0\Bin;%PATH% - - if %PLATFORM% == Win32 cmake . - - if %PLATFORM% == x64 cmake -G "Visual Studio 12 2013 Win64" . - -build: - project: jsoncpp.sln # path to Visual Studio solution or project +environment: + matrix: + - CMAKE_GENERATOR: Visual Studio 12 2013 + - CMAKE_GENERATOR: Visual Studio 12 2013 Win64 + - CMAKE_GENERATOR: Visual Studio 14 2015 + - CMAKE_GENERATOR: Visual Studio 14 2015 Win64 + +build_script: + - cmake --version + - cd c:\projects\jsoncpp + - cmake -G "%CMAKE_GENERATOR%" -DCMAKE_INSTALL_PREFIX=%CD:\=/%/install -DCMAKE_BUILD_TYPE=Release . + - cmake --build . --config Release --target install deploy: provider: GitHub From f45c01a46e499f08ad9bb4f351cefdc2718708b0 Mon Sep 17 00:00:00 2001 From: Julien Schueller Date: Wed, 12 Jul 2017 17:36:23 +0200 Subject: [PATCH 2/3] Enable shared libs on appveyor --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index c9ebf9863..5d497de14 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -10,7 +10,7 @@ environment: build_script: - cmake --version - cd c:\projects\jsoncpp - - cmake -G "%CMAKE_GENERATOR%" -DCMAKE_INSTALL_PREFIX=%CD:\=/%/install -DCMAKE_BUILD_TYPE=Release . + - cmake -G "%CMAKE_GENERATOR%" -DCMAKE_INSTALL_PREFIX=%CD:\=/%/install -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON . - cmake --build . --config Release --target install deploy: From ffdcc9355dce120df3da45aa299add519db8235c Mon Sep 17 00:00:00 2001 From: Julien Schueller Date: Wed, 12 Jul 2017 18:21:01 +0200 Subject: [PATCH 3/3] Avoid import/static libs name clash --- src/lib_json/CMakeLists.txt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/lib_json/CMakeLists.txt b/src/lib_json/CMakeLists.txt index c64aab2ef..9730e9ace 100644 --- a/src/lib_json/CMakeLists.txt +++ b/src/lib_json/CMakeLists.txt @@ -95,8 +95,12 @@ ENDIF() IF(BUILD_STATIC_LIBS) ADD_LIBRARY(jsoncpp_lib_static STATIC ${PUBLIC_HEADERS} ${jsoncpp_sources}) SET_TARGET_PROPERTIES( jsoncpp_lib_static PROPERTIES VERSION ${JSONCPP_VERSION} SOVERSION ${JSONCPP_SOVERSION}) - SET_TARGET_PROPERTIES( jsoncpp_lib_static PROPERTIES OUTPUT_NAME jsoncpp - DEBUG_OUTPUT_NAME jsoncpp${DEBUG_LIBNAME_SUFFIX} ) + # avoid name clashes on windows as the shared import lib is also named jsoncpp.lib + if (NOT DEFINED STATIC_SUFFIX AND BUILD_SHARED_LIBS) + set (STATIC_SUFFIX "_static") + endif () + set_target_properties (jsoncpp_lib_static PROPERTIES OUTPUT_NAME jsoncpp${STATIC_SUFFIX} + DEBUG_OUTPUT_NAME jsoncpp${STATIC_SUFFIX}${DEBUG_LIBNAME_SUFFIX}) INSTALL( TARGETS jsoncpp_lib_static ${INSTALL_EXPORT} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}