From 9f20c3a75a1851e83ae5ee2876951f84fdc6d676 Mon Sep 17 00:00:00 2001 From: Mario Emmenlauer Date: Sun, 22 Jul 2018 11:45:05 +0200 Subject: [PATCH 1/4] CMakeLists.txt: No need to specify shared and static versions of add_library() --- CMakeLists.txt | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d322a63..6969f3e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,7 +2,6 @@ cmake_minimum_required(VERSION 3.0) project(pugixml VERSION 1.9) -option(BUILD_SHARED_LIBS "Build shared instead of static library" OFF) option(BUILD_TESTS "Build tests" OFF) option(USE_VERSIONED_LIBDIR "Use a private subdirectory to install the headers and libs" OFF) option(USE_POSTFIX "Use separate postfix for each configuration to make sure you can install multiple build outputs" OFF) @@ -37,11 +36,7 @@ if(DEFINED BUILD_DEFINES) endforeach() endif() -if(BUILD_SHARED_LIBS) - add_library(pugixml SHARED ${HEADERS} ${SOURCES}) -else() - add_library(pugixml STATIC ${HEADERS} ${SOURCES}) -endif() +add_library(pugixml ${HEADERS} ${SOURCES}) # Export symbols for shared library builds if(BUILD_SHARED_LIBS AND MSVC) From 1a089055b285c8376c3a9f86918264c4a671b4a4 Mon Sep 17 00:00:00 2001 From: Mario Emmenlauer Date: Sun, 22 Jul 2018 11:52:13 +0200 Subject: [PATCH 2/4] CMakeLists.txt: use PROJECT_VERSION and PROJECT_VERSION_MAJOR in dll version numbering --- CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6969f3e..9fb4ea9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -48,7 +48,10 @@ if(NOT ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} STRLESS 3.1 AND ";${CMAKE_C target_compile_features(pugixml PUBLIC cxx_long_long_type) endif() -set_target_properties(pugixml PROPERTIES VERSION ${pugixml_VERSION} SOVERSION 1) +set_target_properties(${PROJECT_NAME} PROPERTIES + VERSION ${PROJECT_VERSION} + SOVERSION ${PROJECT_VERSION_MAJOR} + POSITION_INDEPENDENT_CODE ON) if(USE_VERSIONED_LIBDIR) # Install library into its own directory under LIBDIR From ecac77c68ddfcabf07965997b717ef77c5636cb7 Mon Sep 17 00:00:00 2001 From: Mario Emmenlauer Date: Sun, 22 Jul 2018 11:46:49 +0200 Subject: [PATCH 3/4] CMakeLists.txt: error if cmake <= 3.0 is used --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9fb4ea9..9830779 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.0) +cmake_minimum_required(VERSION 3.0 FATAL_ERROR) project(pugixml VERSION 1.9) From 267a02edaf564e20aa0172637706218fc76a6d01 Mon Sep 17 00:00:00 2001 From: Mario Emmenlauer Date: Sun, 22 Jul 2018 11:45:59 +0200 Subject: [PATCH 4/4] .gitignore: ignore vim swap files --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 653fa51..57334a0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ /build/ /.vscode/ +.*.swp