Commit 82c83351 authored by Pierre Kraemer's avatar Pierre Kraemer

Merge remote-tracking branch 'cgogn/develop' into develop

parents 8c8c80df 760088df
cmake_minimum_required(VERSION 2.8)
project(CGoGN)
cmake_policy(SET CMP0042 NEW) # rpath new policy
#SET ( CMAKE_VERBOSE_MAKEFILE 1 )
......@@ -32,7 +33,7 @@ if(WIN32)
endif()
endif()
# ======== Check Build Type =============
IF (NOT (${CMAKE_BUILD_TYPE} MATCHES "Debug|Release"))
IF (${CMAKE_CURRENT_BINARY_DIR} MATCHES "(.*)Debug|(.*)debug|(.*)DEBUG")
SET(CMAKE_BUILD_TYPE "Debug")
......@@ -41,8 +42,16 @@ IF (NOT (${CMAKE_BUILD_TYPE} MATCHES "Debug|Release"))
ENDIF()
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*")
......@@ -67,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)" )
......@@ -193,11 +203,8 @@ ELSE()
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Woverride-init -fPIC")
# remove the 60000+ "no unused local typedefs" warnings with GCC4.8+
if(CMAKE_COMPILER_IS_GNUCXX)
execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION)
if (GCC_VERSION VERSION_GREATER 4.8 OR GCC_VERSION VERSION_EQUAL 4.8)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-local-typedefs")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-local-typedefs")
endif(GCC_VERSION VERSION_GREATER 4.8 OR GCC_VERSION VERSION_EQUAL 4.8)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-local-typedefs")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-local-typedefs")
endif()
ENDIF()
......
cmake_minimum_required(VERSION 2.8)
include(ExternalProject)
project(CGoGN_ThirdParty)
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)
......@@ -23,23 +18,15 @@ 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(CMAKE_CONFIGURATION_TYPES ${CMAKE_BUILD_TYPE})
# SET(CMAKE_CONFIGURATION_TYPES "${CMAKE_CONFIGURATION_TYPES}" CACHE STRING "" FORCE)
# MARK_AS_ADVANCED(CMAKE_CONFIGURATION_TYPES)
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})
SET (BUILD_SHARED_LIBS ON CACHE BOOL "if used all library are build as shared type (.so/.dylib/.dll)")
ENDIF()
IF(WIN32)
ENDIF(WIN32)
# 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_TINYXML2 ON CACHE BOOL "get & build tinyxml2")
SET (WITH_ASSIMP OFF CACHE BOOL "build with Assimp")
SET (WITH_ZINRI ON CACHE BOOL "build with Zinri libs")
SET (WITH_PYTHONQT ON CACHE BOOL "build PythonQt (for Schnapps)")
......@@ -71,18 +58,6 @@ IF (WITH_ASSIMP)
INSTALL (DIRECTORY Assimp/include/ DESTINATION ${CGoGN_ROOT_DIR}/ThirdParty/include/Assimp)
ENDIF (WITH_ASSIMP)
IF (WITH_TINYXML2)
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)
FILE(GLOB_RECURSE tinyLib_files ${CGoGN_ROOT_DIR}/ThirdParty/TinyXml2/lib/*.so.* ${CGoGN_ROOT_DIR}/ThirdParty/TinyXml2/lib/*.a )
INSTALL (FILES ${tinyLib_files} DESTINATION ${CGoGN_ROOT_DIR}/lib/${CMAKE_BUILD_TYPE})
ENDIF (WITH_TINYXML2)
\ No newline at end of file
add_subdirectory(TinyXml2 TinyXml2/build)
INSTALL (DIRECTORY TinyXml2/ DESTINATION ${CGoGN_ROOT_DIR}/ThirdParty/include/TinyXml2 FILES_MATCHING PATTERN "*.h")
......@@ -25,6 +25,9 @@ IF(USE_SUPERLU)
ENDIF(USE_SUPERLU)
IF(USE_CHOLMOD)
IF (APPLE)
FIND_LIBRARY(CHOL_DEPS Accelerate)
ENDIF (APPLE)
ADD_DEFINITIONS(-DNL_USE_CHOLMOD)
INCLUDE_DIRECTORIES(${SUITESPARSE_INCLUDE_DIRS})
ENDIF(USE_CHOLMOD)
......@@ -41,8 +44,14 @@ IF(USE_CNC)
CUDA_ADD_CUBLAS_TO_TARGET(nl)
ELSE(USE_CNC)
IF(WIN32)
ADD_LIBRARY(nl ${SOURCES} ${HeaderFiles})
ADD_LIBRARY(nl ${SOURCES} ${HeaderFiles})
ELSE(WIN32)
ADD_LIBRARY(nl ${SOURCES} )
ADD_LIBRARY(nl ${SOURCES} )
IF(USE_CHOLMOD)
TARGET_LINK_LIBRARIES(nl ${SUITESPARSE_LIBRARIES} ${CHOL_DEPS})
ENDIF(USE_CHOLMOD)
IF(USE_SUPERLU)
TARGET_LINK_LIBRARIES(nl ${SUPERLU_LIBRARIES})
ENDIF(USE_SUPERLU)
ENDIF(WIN32)
ENDIF(USE_CNC)
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