Commit 39827e0e authored by Sylvain Thery's avatar Sylvain Thery

tinyxml2 copy in third_party

parent 69b46a46
cmake_minimum_required(VERSION 2.8)
project(CGoGN)
cmake_policy(SET CMP0042 NEW) # rpath new policy
#SET ( CMAKE_VERBOSE_MAKEFILE 1 )
......@@ -42,8 +43,15 @@ IF (NOT (${CMAKE_BUILD_TYPE} MATCHES "Debug|Release"))
ENDIF()
# for shared or not shared
SET ( BUILD_SHARED_LIBS OFF CACHE BOOL "if used all library are build as shared type (.so/.dylib/.dll)" )
# for shared or not shared (default except on windows)
if(WIN32)
SET ( BUILD_SHARED_LIBS OFF CACHE BOOL "if used all library are build as shared type (.so/.dylib/.dll)" )
else()
SET ( BUILD_SHARED_LIBS ON CACHE BOOL "if used all library are build as shared type (.so/.dylib/.dll)" )
endif()
#IF(EXISTS "${CGoGN_ROOT_DIR}/ThirdParty/include/Assimp")
IF(EXISTS "${CGoGN_ROOT_DIR}/lib/${CMAKE_BUILD_TYPE}/*assimp*")
......@@ -68,9 +76,10 @@ SET ( COMPILE_BENCHES ON CACHE BOOL "compile benches" )
SET ( COMPILE_SANDBOX ON CACHE BOOL "compile all in sandbox" )
#create one big lib
#create one big lib
SET ( ONELIB OFF CACHE BOOL "build CGoGN in one lib" )
SET ( WITH_GLEWMX OFF CACHE BOOL "use multi-contex GLEW" )
SET( USE_OGL_CORE_PROFILE OFF CACHE BOOL "use OpenGL 3.3 core profile (do not work on mac)" )
......
cmake_minimum_required(VERSION 2.8)
include(ExternalProject)
project(CGoGN_ThirdParty)
# for access to var CMAKE_INSTALL_LIBDIR
include(GNUInstallDirs)
cmake_policy(SET CMP0042 NEW) # rpath new policy
SET(CGoGN_ROOT_DIR ${CMAKE_SOURCE_DIR}/..)
IF(WIN32)
ENDIF(WIN32)
IF (${CMAKE_CURRENT_BINARY_DIR} MATCHES "(.*)Debug")
set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Debug/Release" FORCE)
......@@ -24,29 +18,14 @@ IF(WIN32)
INCLUDE_DIRECTORIES(${CGoGN_ROOT_DIR}/windows_dependencies/include/suitesparse)
SET(LIBRARY_OUTPUT_PATH ${CGoGN_ROOT_DIR}/lib)
set(CMAKE_CONFIGURATION_TYPES Release Debug)
SET (BUILD_SHARED_LIBS OFF CACHE BOOL "if used all library are build as shared type (.so/.dylib/.dll)")
ELSE()
SET(LIBRARY_OUTPUT_PATH ${CGoGN_ROOT_DIR}/lib/${CMAKE_BUILD_TYPE})
ExternalProject_Add(
Tinyxml2
PREFIX ${CMAKE_CURRENT_BINARY_DIR}/tinyxml2
GIT_REPOSITORY https://github.com/leethomason/tinyxml2.git
CMAKE_CACHE_ARGS "-DCMAKE_BUILD_TYPE:string=${CMAKE_BUILD_TYPE}"
CMAKE_ARGS "-DCMAKE_INSTALL_PREFIX=${CGoGN_ROOT_DIR}/ThirdParty/TinyXml2"
BUILD_COMMAND make
INSTALL_COMMAND make install
)
INSTALL (DIRECTORY TinyXml2/include/ DESTINATION ${CGoGN_ROOT_DIR}/ThirdParty/include)
INSTALL (DIRECTORY TinyXml2/${CMAKE_INSTALL_LIBDIR}/ DESTINATION ${CGoGN_ROOT_DIR}/lib/${CMAKE_BUILD_TYPE}
PATTERN "pkgconfig" EXCLUDE )
SET (BUILD_SHARED_LIBS ON CACHE BOOL "if used all library are build as shared type (.so/.dylib/.dll)")
ENDIF()
# for shared or not shared
SET (BUILD_SHARED_LIBS OFF CACHE BOOL
"if used all library are build as shared type (.so/.dylib/.dll)")
SET (WITH_ASSIMP OFF CACHE BOOL "build with Assimp")
SET (WITH_ZINRI ON CACHE BOOL "build with Zinri libs")
......@@ -78,3 +57,7 @@ IF (WITH_ASSIMP)
add_subdirectory(Assimp Assimp/build)
INSTALL (DIRECTORY Assimp/include/ DESTINATION ${CGoGN_ROOT_DIR}/ThirdParty/include/Assimp)
ENDIF (WITH_ASSIMP)
add_subdirectory(TinyXml2 TinyXml2/build)
INSTALL (DIRECTORY TinyXml2/ DESTINATION ${CGoGN_ROOT_DIR}/ThirdParty/include/TinyXml2 FILES_MATCHING PATTERN "*.h")
cmake_minimum_required(VERSION 2.6 FATAL_ERROR)
#cmake_policy(VERSION 2.6)
project(tinyxml2)
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/.")
if(MSVC)
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
endif(MSVC)
option(BUILD_SHARED_LIBS "build shared or static libraries" ON)
add_library(tinyxml2 tinyxml2.cpp tinyxml2.h)
set_target_properties(tinyxml2 PROPERTIES COMPILE_DEFINITIONS "TINYXML2_EXPORT")
#install(TARGETS tinyxml2
# RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
# LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
# ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
#install(FILES tinyxml2.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
#foreach(p LIB INCLUDE)
# set(var CMAKE_INSTALL_${p}DIR)
# if(NOT IS_ABSOLUTE "${${var}}")
# set(${var} "${CMAKE_INSTALL_PREFIX}/${${var}}")
# endif()
#endforeach()
#configure_file(tinyxml2.pc.in tinyxml2.pc @ONLY)
#install(FILES ${CMAKE_CURRENT_BINARY_DIR}/tinyxml2.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
#add_test(xmltest ${SAMPLE_NAME} COMMAND $<TARGET_FILE:${SAMPLE_NAME}>)
This is a "partial" copy of original TinyXML-2 library.
http://www.grinninglizard.com/tinyxml2/
Packaged version is not usable on all Linux distribution
Git version is not locally installabe on mac.
CMakeLists.txt has been modified for easy local installation.
Only needed files for building the library have been kept.
This diff is collapsed.
This diff is collapsed.
......@@ -27,7 +27,7 @@
#include <string>
#include "Utils/cgognStream.h"
#include <tinyxml2.h>
#include "TinyXml2/tinyxml2.h"
namespace CGoGN
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment