Add BUILD_DEFINES parameter to CMakeLists.txt

git-svn-id: https://pugixml.googlecode.com/svn/trunk@1000 99668b35-9821-0410-8761-19e4c4f06640
This commit is contained in:
Arseny Kapoulkine 2014-07-28 16:08:43 +00:00
parent 757c494340
commit 7528aaf961

View File

@ -1,7 +1,9 @@
project(pugixml)
cmake_minimum_required(VERSION 2.6)
set(BUILD_SHARED_LIBS OFF CACHE BOOL "Build shared instead of static library")
set(BUILD_DEFINES "" CACHE STRING "Build defines")
if(NOT DEFINED CMAKE_INSTALL_LIBDIR)
SET(CMAKE_INSTALL_LIBDIR lib CACHE PATH "Output directory for libraries")
@ -10,6 +12,10 @@ endif()
set(HEADERS ../src/pugixml.hpp ../src/pugiconfig.hpp)
set(SOURCES ${HEADERS} ../src/pugixml.cpp)
if(DEFINED BUILD_DEFINES)
add_definitions(${BUILD_DEFINES})
endif()
if(BUILD_SHARED_LIBS)
add_library(pugixml SHARED ${SOURCES})
else()