diff --git a/appveyor.yml b/appveyor.yml index f4966a3..5d497de 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 +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 -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 +build_script: + - cmake --version + - cd c:\projects\jsoncpp + - cmake -G "%CMAKE_GENERATOR%" -DCMAKE_INSTALL_PREFIX=%CD:\=/%/install -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON . + - cmake --build . --config Release --target install deploy: provider: GitHub diff --git a/src/lib_json/CMakeLists.txt b/src/lib_json/CMakeLists.txt index c64aab2..9730e9a 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}