Commit ba466d18 authored by Heng Liu's avatar Heng Liu

new cmake system

parent eb770f86
.DS_Store
/build*/
/external
*.swp
......@@ -14,17 +14,10 @@ mkdir build
cd build
# Initialize the build directory
cmake -D OPENMESH_INCLUDE_DIR=/path/to/OpenMesh/src \
-D OPENMESH_CORE_LIBRARY=/path/to/OpenMesh/Core/binaries \
-D OPENMESH_TOOLS_LIBRARY=/path/to/OpenMesh/Tools/binaries \
-D OPENVOLUMEMESH_INCLUDE_DIR=/path/to/OpenVolumeMesh/src \
-D OPENVOLUMEMESH_LIBRARY_DIR=/path/to/OpenVolumeMesh/binaries \
-D EIGEN3_INCLUDE_DIR=/path/to/eigen3 \
-D GMM_INCLUDE_DIR=/path/to/gmm \
-D CHOLMOD_INCLUDE_DIR=/path/to/cholmod ..
cmake ..
# Build
make
# Try a demo
./demo/scof/scof ../demo/scof/ellipsoid.ovm ../demo/scof/ellipsoid_output.ovm
./Build/bin/scof ../demo/scof/ellipsoid.ovm ../demo/scof/ellipsoid_output.ovm
\ No newline at end of file
......@@ -18,71 +18,198 @@
# along with SCOF. If not, see <http://www.gnu.org/licenses/>.
#
cmake_minimum_required (VERSION 2.6)
cmake_minimum_required (VERSION 3.9)
# Only set project name if not build from within another project.
if("${PROJECT_NAME}" STREQUAL "")
project (SCOF)
list (APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
project (SCOF
VERSION 0.0.1
LANGUAGES C CXX
)
set(CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY ON)
option(BUILD_SHARED_LIBS "Build shared library (*.dll, *.so, *.dylib) instead of static library (*.a, *.lib)" ON)
if (CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
if (WIN32)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/Build")
else ()
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/Build/bin")
endif ()
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/Build/lib")
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/Build/lib")
set(CMAKE_CXX_STANDARD 14)
endif()
list (APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
set(SCOF_EXTERNAL "${CMAKE_CURRENT_SOURCE_DIR}/external")
add_definitions(-DINCLUDE_TEMPLATES)
if(NOT CMAKE_BUILD_TYPE)
message(STATUS "No build type selected, default to Release")
set(CMAKE_BUILD_TYPE "Release")
endif()
set (SOURCES "")
set (INCLUDE_DIRS "")
set (LIBRARIES "")
set (LIBRARY_DIRS "")
set (ACG_COMMON_DO_NOT_COPY_POST_BUILD TRUE)
include (SCOFDependencies)
get_target_property(INC_DIRS OpenMeshCore INCLUDE_DIRECTORIES)
message("Target openmesh include dirs: ${INC_DIRS}")
# add library
add_library (SCOF
src/AxisAlignment.hh
src/FrameFieldGeneratorT.hh
src/SingularityConstrainedOctahedralField.cc
src/SingularityGraphT.hh
src/TransitionQuaternionEigen.cc
src/CornerT.hh
src/MatchingsAndAlignmentExtractionT.cc
src/SingularityConstrainedOctahedralField.hh
src/StopWatch.hh
src/TransitionQuaternionEigen.hh
src/FrameFieldGeneratorT.cc
src/MatchingsAndAlignmentExtractionT.hh
src/SingularityGraphT.cc
src/TangentContinuityT.hh
src/Typedefs.hh
)
add_library (SCOF::SCOF ALIAS SCOF)
target_compile_options(SCOF PUBLIC
"$<$<CXX_COMPILER_ID:MSVC>:/bigobj>"
# cmake by default adds /W3, that's too much for us:
"$<$<CXX_COMPILER_ID:MSVC>:/W1>"
# disable MSVC inline warnings that are enabled with /Ob2, which is in the default cmake release cxxflags:
"$<$<CXX_COMPILER_ID:MSVC>:/wd4710>"
"$<$<CXX_COMPILER_ID:MSVC>:/wd4711>"
"$<$<CXX_COMPILER_ID:MSVC>:/wd4514>"
"$<$<CXX_COMPILER_ID:MSVC>:/wd4571>"
"$<$<CXX_COMPILER_ID:MSVC>:/wd5045>"
"$<$<CXX_COMPILER_ID:MSVC>:/wd5024>"
"$<$<CXX_COMPILER_ID:MSVC>:/wd5025>"
"$<$<CXX_COMPILER_ID:MSVC>:/wd5026>"
"$<$<CXX_COMPILER_ID:MSVC>:/wd5027>"
"$<$<CXX_COMPILER_ID:MSVC>:/wd4625>"
"$<$<CXX_COMPILER_ID:MSVC>:/wd4626>"
"$<$<CXX_COMPILER_ID:MSVC>:/wd4820>"
"$<$<CXX_COMPILER_ID:MSVC>:/wd4464>"
)
target_compile_definitions(SCOF
PUBLIC
"INCLUDE_TEMPLATES"
)
set_target_properties(SCOF PROPERTIES
VERSION ${SCOF_VERSION_MAJOR}.${SCOF_VERSION_MINOR}
SOVERSION ${SCOF_VERSION_MAJOR}.${SCOF_VERSION_MINOR}
CXX_STANDARD 14
CXX_STANDARD_REQUIRED YES
CXX_EXTENSIONS NO
CXX_VISIBILITY_PRESET hidden
)
if (CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
set_target_properties(SCOF PROPERTIES
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}
)
endif()
target_link_libraries (SCOF PUBLIC
OpenMeshCore
OpenMeshTools
OpenVolumeMesh::OpenVolumeMesh
${CHOLMOD_LIBRARIES}
)
configure_file (
"${CMAKE_CURRENT_SOURCE_DIR}/src/Config/Version.hh.in"
"${CMAKE_CURRENT_BINARY_DIR}/src/Config/Version.hh"
)
include(GenerateExportHeader)
generate_export_header(SCOF
BASE_NAME SCOF
EXPORT_FILE_NAME "src/Config/Export.hh"
)
if(CHOLMOD_INCLUDES)
add_definitions(-DENABLE_SUITESPARSE)
endif()
#Set target properties
target_include_directories(SCOF
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src>
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/src>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
# PRIVATE
#"${CMAKE_CURRENT_BINARY_DIR}/src"
${EIGEN3_INCLUDE_DIR}
${GMM_INCLUDE_DIR}
${CHOLMOD_INCLUDES}
)
if (CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
add_subdirectory(demo/scof)
endif()
file(GLOB SRCS "${CMAKE_CURRENT_LIST_DIR}/src/*.cc" "${CMAKE_CURRENT_LIST_DIR}/src/*.c")
include(CMakePackageConfigHelpers)
include(GNUInstallDirs)
find_package (OpenVolumeMesh REQUIRED)
find_package (OpenMesh REQUIRED)
find_package (EIGEN3 REQUIRED)
find_package (GMM REQUIRED)
find_package (CHOLMOD)
#enable suitesparse
if(CHOLMOD_INCLUDES)
add_definitions(-DENABLE_SUITESPARSE)
list (APPEND EIGEN3_INCLUDE_DIR ${CHOLMOD_INCLUDES})
list (APPEND LIBRARIES ${CHOLMOD_LIBRARIES})
endif(CHOLMOD_INCLUDES)
set(INSTALL_CONFIGDIR ${CMAKE_INSTALL_LIBDIR}/cmake/SCOF)
list (APPEND SOURCES ${SRCS})
list (APPEND INCLUDE_DIRS ${OPENVOLUMEMESH_INCLUDE_DIR}
${OPENMESH_INCLUDE_DIRS}
${EIGEN3_INCLUDE_DIR}
${GMM_INCLUDE_DIR})
list (APPEND LIBRARY_DIRS ${OPENVOLUMEMESH_LIBRARY_DIR})
list (APPEND LIBRARIES ${OPENVOLUMEMESH_LIBRARY}
${OPENMESH_LIBRARIES})
configure_package_config_file(
"${CMAKE_CURRENT_SOURCE_DIR}/CMAKE/SCOFConfig.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/SCOFConfig.cmake"
INSTALL_DESTINATION ${INSTALL_CONFIGDIR}
)
write_basic_package_version_file(
SCOFConfigVersion.cmake
VERSION ${PROJECT_VERSION}
COMPATIBILITY SameMajorVersion
)
include_directories (${INCLUDE_DIRS})
install(FILES
"${CMAKE_CURRENT_BINARY_DIR}/SCOFConfigVersion.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/SCOFConfig.cmake"
DESTINATION ${INSTALL_CONFIGDIR})
link_directories (${CMAKE_BINARY_DIR} ${LIBRARY_DIRS})
add_library (SCOF SHARED ${SOURCES})
add_library (SCOFStatic STATIC ${SOURCES})
install(DIRECTORY
"${CMAKE_CURRENT_BINARY_DIR}/SCOF/Config"
DESTINATION include/SCOF)
target_link_libraries (SCOF ${LIBRARIES})
target_link_libraries (SCOFStatic ${LIBRARIES})
# Install Header Files
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/src/SCOF
DESTINATION include
FILES_MATCHING PATTERN "*.hh"
)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -O3 -Wall -Wextra")
#
# Fake successful finder run if compiling as a dependent project.
#
if(NOT "${PROJECT_NAME}" MATCHES "SCOF")
set (SCOF_FOUND true PARENT_SCOPE)
set (SCOF_LIBRARIES SCOF PARENT_SCOPE)
set (SCOF_LIBRARY SCOF PARENT_SCOPE)
set (SCOF_INCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/src/" PARENT_SCOPE)
set (SCOF_LIBRARY_DIR "${CMAKE_CURRENT_BINARY_DIR}" CACHE PATH "The directory where the SCOF libraries can be found.")
endif()
install(TARGETS SCOF
EXPORT SCOFTargets
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)
if("${PROJECT_NAME}" MATCHES "SCOF")
add_subdirectory(demo/scof)
endif()
install(EXPORT SCOFTargets
FILE SCOFTargets.cmake
NAMESPACE SCOF::
DESTINATION ${INSTALL_CONFIGDIR}
)
export(EXPORT SCOFTargets
NAMESPACE SCOF::)
export(PACKAGE SCOF)
list(REMOVE_AT CMAKE_MODULE_PATH -1)
\ No newline at end of file
# Distributed under the OSI-approved MIT License. See accompanying
# file LICENSE or https://github.com/Crascit/DownloadProject for details.
cmake_minimum_required(VERSION 2.8.2)
project(${DL_ARGS_PROJ}-download NONE)
include(ExternalProject)
ExternalProject_Add(${DL_ARGS_PROJ}-download
${DL_ARGS_UNPARSED_ARGUMENTS}
SOURCE_DIR "${DL_ARGS_SOURCE_DIR}"
BINARY_DIR "${DL_ARGS_BINARY_DIR}"
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ""
TEST_COMMAND ""
)
# Distributed under the OSI-approved MIT License. See accompanying
# file LICENSE or https://github.com/Crascit/DownloadProject for details.
#
# MODULE: DownloadProject
#
# PROVIDES:
# download_project( PROJ projectName
# [PREFIX prefixDir]
# [DOWNLOAD_DIR downloadDir]
# [SOURCE_DIR srcDir]
# [BINARY_DIR binDir]
# [QUIET]
# ...
# )
#
# Provides the ability to download and unpack a tarball, zip file, git repository,
# etc. at configure time (i.e. when the cmake command is run). How the downloaded
# and unpacked contents are used is up to the caller, but the motivating case is
# to download source code which can then be included directly in the build with
# add_subdirectory() after the call to download_project(). Source and build
# directories are set up with this in mind.
#
# The PROJ argument is required. The projectName value will be used to construct
# the following variables upon exit (obviously replace projectName with its actual
# value):
#
# projectName_SOURCE_DIR
# projectName_BINARY_DIR
#
# The SOURCE_DIR and BINARY_DIR arguments are optional and would not typically
# need to be provided. They can be specified if you want the downloaded source
# and build directories to be located in a specific place. The contents of
# projectName_SOURCE_DIR and projectName_BINARY_DIR will be populated with the
# locations used whether you provide SOURCE_DIR/BINARY_DIR or not.
#
# The DOWNLOAD_DIR argument does not normally need to be set. It controls the
# location of the temporary CMake build used to perform the download.
#
# The PREFIX argument can be provided to change the base location of the default
# values of DOWNLOAD_DIR, SOURCE_DIR and BINARY_DIR. If all of those three arguments
# are provided, then PREFIX will have no effect. The default value for PREFIX is
# CMAKE_BINARY_DIR.
#
# The QUIET option can be given if you do not want to show the output associated
# with downloading the specified project.
#
# In addition to the above, any other options are passed through unmodified to
# ExternalProject_Add() to perform the actual download, patch and update steps.
# The following ExternalProject_Add() options are explicitly prohibited (they
# are reserved for use by the download_project() command):
#
# CONFIGURE_COMMAND
# BUILD_COMMAND
# INSTALL_COMMAND
# TEST_COMMAND
#
# Only those ExternalProject_Add() arguments which relate to downloading, patching
# and updating of the project sources are intended to be used. Also note that at
# least one set of download-related arguments are required.
#
# If using CMake 3.2 or later, the UPDATE_DISCONNECTED option can be used to
# prevent a check at the remote end for changes every time CMake is run
# after the first successful download. See the documentation of the ExternalProject
# module for more information. It is likely you will want to use this option if it
# is available to you. Note, however, that the ExternalProject implementation contains
# bugs which result in incorrect handling of the UPDATE_DISCONNECTED option when
# using the URL download method or when specifying a SOURCE_DIR with no download
# method. Fixes for these have been created, the last of which is scheduled for
# inclusion in CMake 3.8.0. Details can be found here:
#
# https://gitlab.kitware.com/cmake/cmake/commit/bdca68388bd57f8302d3c1d83d691034b7ffa70c
# https://gitlab.kitware.com/cmake/cmake/issues/16428
#
# If you experience build errors related to the update step, consider avoiding
# the use of UPDATE_DISCONNECTED.
#
# EXAMPLE USAGE:
#
# include(DownloadProject)
# download_project(PROJ googletest
# GIT_REPOSITORY https://github.com/google/googletest.git
# GIT_TAG master
# UPDATE_DISCONNECTED 1
# QUIET
# )
#
# add_subdirectory(${googletest_SOURCE_DIR} ${googletest_BINARY_DIR})
#
#========================================================================================
set(_DownloadProjectDir "${CMAKE_CURRENT_LIST_DIR}")
include(CMakeParseArguments)
function(download_project)
set(options QUIET)
set(oneValueArgs
PROJ
PREFIX
DOWNLOAD_DIR
SOURCE_DIR
BINARY_DIR
# Prevent the following from being passed through
CONFIGURE_COMMAND
BUILD_COMMAND
INSTALL_COMMAND
TEST_COMMAND
)
set(multiValueArgs "")
cmake_parse_arguments(DL_ARGS "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
# Hide output if requested
if (DL_ARGS_QUIET)
set(OUTPUT_QUIET "OUTPUT_QUIET")
else()
unset(OUTPUT_QUIET)
message(STATUS "Downloading/updating ${DL_ARGS_PROJ}")
endif()
# Set up where we will put our temporary CMakeLists.txt file and also
# the base point below which the default source and binary dirs will be.
# The prefix must always be an absolute path.
if (NOT DL_ARGS_PREFIX)
set(DL_ARGS_PREFIX "${CMAKE_BINARY_DIR}")
else()
get_filename_component(DL_ARGS_PREFIX "${DL_ARGS_PREFIX}" ABSOLUTE
BASE_DIR "${CMAKE_CURRENT_BINARY_DIR}")
endif()
if (NOT DL_ARGS_DOWNLOAD_DIR)
set(DL_ARGS_DOWNLOAD_DIR "${DL_ARGS_PREFIX}/${DL_ARGS_PROJ}-download")
endif()
# Ensure the caller can know where to find the source and build directories
if (NOT DL_ARGS_SOURCE_DIR)
set(DL_ARGS_SOURCE_DIR "${DL_ARGS_PREFIX}/${DL_ARGS_PROJ}-src")
endif()
if (NOT DL_ARGS_BINARY_DIR)
set(DL_ARGS_BINARY_DIR "${DL_ARGS_PREFIX}/${DL_ARGS_PROJ}-build")
endif()
set(${DL_ARGS_PROJ}_SOURCE_DIR "${DL_ARGS_SOURCE_DIR}" PARENT_SCOPE)
set(${DL_ARGS_PROJ}_BINARY_DIR "${DL_ARGS_BINARY_DIR}" PARENT_SCOPE)
# The way that CLion manages multiple configurations, it causes a copy of
# the CMakeCache.txt to be copied across due to it not expecting there to
# be a project within a project. This causes the hard-coded paths in the
# cache to be copied and builds to fail. To mitigate this, we simply
# remove the cache if it exists before we configure the new project. It
# is safe to do so because it will be re-generated. Since this is only
# executed at the configure step, it should not cause additional builds or
# downloads.
file(REMOVE "${DL_ARGS_DOWNLOAD_DIR}/CMakeCache.txt")
# Create and build a separate CMake project to carry out the download.
# If we've already previously done these steps, they will not cause
# anything to be updated, so extra rebuilds of the project won't occur.
# Make sure to pass through CMAKE_MAKE_PROGRAM in case the main project
# has this set to something not findable on the PATH.
configure_file("${_DownloadProjectDir}/DownloadProject.CMakeLists.cmake.in"
"${DL_ARGS_DOWNLOAD_DIR}/CMakeLists.txt")
execute_process(COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}"
-D "CMAKE_MAKE_PROGRAM:FILE=${CMAKE_MAKE_PROGRAM}"
.
RESULT_VARIABLE result
${OUTPUT_QUIET}
WORKING_DIRECTORY "${DL_ARGS_DOWNLOAD_DIR}"
)
if(result)
message(FATAL_ERROR "CMake step for ${DL_ARGS_PROJ} failed: ${result}")
endif()
execute_process(COMMAND ${CMAKE_COMMAND} --build .
RESULT_VARIABLE result
${OUTPUT_QUIET}
WORKING_DIRECTORY "${DL_ARGS_DOWNLOAD_DIR}"
)
if(result)
message(FATAL_ERROR "Build step for ${DL_ARGS_PROJ} failed: ${result}")
endif()
endfunction()
......@@ -27,6 +27,10 @@ elseif ( CMAKE_GENERATOR MATCHES "^Visual Studio 14.*Win64" )
SET(VS_SEARCH_PATH "${CMAKE_WINDOWS_LIBS_DIR}/vs2015/x64/")
elseif ( CMAKE_GENERATOR MATCHES "^Visual Studio 14.*" )
SET(VS_SEARCH_PATH "${CMAKE_WINDOWS_LIBS_DIR}/vs2015/x32/")
elseif ( CMAKE_GENERATOR MATCHES "^Visual Studio 15.*Win64" )
SET(VS_SEARCH_PATH "${CMAKE_WINDOWS_LIBS_DIR}/vs2017/x64/")
elseif ( CMAKE_GENERATOR MATCHES "^Visual Studio 15.*" )
SET(VS_SEARCH_PATH "${CMAKE_WINDOWS_LIBS_DIR}/vs2017/x32/")
endif()
......@@ -37,18 +41,19 @@ find_path( EIGEN3_INCLUDE_DIR
/usr/local/include
/usr/local/include/eigen3/
/opt/local/include/eigen3/
"${CMAKE_WINDOWS_LIBS_DIR}/general/Eigen-3.3.4"
"${CMAKE_WINDOWS_LIBS_DIR}/general/Eigen-3.2.8"
"${CMAKE_WINDOWS_LIBS_DIR}/general/Eigen-3.2.6"
"${CMAKE_WINDOWS_LIBS_DIR}/Eigen-3.2.6"
"${CMAKE_WINDOWS_LIBS_DIR}/Eigen-3.2.6/include"
"${CMAKE_WINDOWS_LIBS_DIR}/Eigen-3.2.6/include"
"${CMAKE_WINDOWS_LIBS_DIR}/Eigen-3.2.1"
"${CMAKE_WINDOWS_LIBS_DIR}/Eigen-3.2.1/include"
"${CMAKE_WINDOWS_LIBS_DIR}/Eigen-3.2/include"
"${CMAKE_WINDOWS_LIBS_DIR}/Eigen-3.2.1/include"
"${CMAKE_WINDOWS_LIBS_DIR}/Eigen-3.2/include"
"${CMAKE_WINDOWS_LIBS_DIR}/eigen3/include"
"${CMAKE_WINDOWS_LIBS_DIR}/eigen/include"
${PROJECT_SOURCE_DIR}/MacOS/Libs/eigen3/include
../../External/include
${module_file_path}/../../../External/include
"${CMAKE_WINDOWS_LIBS_DIR}/eigen/include"
${PROJECT_SOURCE_DIR}/MacOS/Libs/eigen3/include
../../External/include
${module_file_path}/../../../External/include
)
set(EIGEN3_INCLUDE_DIRS "${EIGEN3_INCLUDE_DIR}" )
......
# - Try to find GMM
# Once done this will define
# GMM_FOUND - System has GMM
# GMM_INCLUDE_DIRS - The GMM include directories
# GMM_COMPILER_FLAGS - Compiler flags that are necessary for GMM
set(GMM_DIR $ENV{GMM_DIR} CACHE PATH "GMM directory (contain gmm/gmm.h).")
if (GMM_INCLUDE_DIR)
# in cache already
set(GMM_FOUND TRUE)
set(GMM_INCLUDE_DIRS "${GMM_INCLUDE_DIR}" )
else (GMM_INCLUDE_DIR)
# Check if the base path is set
if ( NOT CMAKE_WINDOWS_LIBS_DIR )
# This is the base directory for windows library search used in the finders we shipp.
set(CMAKE_WINDOWS_LIBS_DIR "c:/libs" CACHE STRING "Default Library search dir on windows." )
endif()
find_path( GMM_INCLUDE_DIR
NAMES gmm/gmm.h
PATHS $ENV{GMM_DIR}
/usr/include
/usr/include
find_path(GMM_INCLUDE_DIR
NAMES gmm/gmm.h
PATHS ${GMM_DIR}
${GMM_DIR}/include
/usr/local/include
~/sw/gmm-5.0/include
~/sw/gmm-4.2/include
~/sw/gmm-4.1/include
"c:\\libs\\gmm-4.2\\include"
"c:\\libs\\gmm-4.1\\include"
"c:\\libs\\gmm-3.0\\include"
"${CMAKE_WINDOWS_LIBS_DIR}/general/gmm-5.0/include"
"${CMAKE_WINDOWS_LIBS_DIR}/general/gmm-4.2/include"
${PROJECT_SOURCE_DIR}/MacOS/Libs/gmm-3.1/include
../../External/include
/ACG/acgdev/gcc-4.3-i686/gmm-4.1/include/
/ACG/acgdev/gcc-4.3-i686/gmm-3/include/
${module_file_path}/../../../External/include
/usr/include
)
set(GMM_INCLUDE_DIRS "${GMM_INCLUDE_DIR}" )
# use c++ headers as default
IF (WIN32)
set(GMM_COMPILE_DEFINITIONS "_SCL_SECURE_NO_DEPRECATE" CACHE STRING "GMM Compiler Definitions")
# add_definitions(-D_SCL_SECURE_NO_DEPRECATE)
ELSE(WIN32)
set(GMM_COMPILE_DEFINITIONS "" CACHE STRING "GMM Compiler Definitions")
ENDIF(WIN32)
include(FindPackageHandleStandardArgs)
# handle the QUIETLY and REQUIRED arguments and set LIBCPLEX_FOUND to TRUE
# if all listed variables are TRUE
find_package_handle_standard_args(GMM DEFAULT_MSG
GMM_INCLUDE_DIR)
find_package_handle_standard_args(GMM DEFAULT_MSG GMM_INCLUDE_DIR)
if(GMM_FOUND AND NOT TARGET GMM::GMM)
add_library(GMM::GMM INTERFACE IMPORTED)
target_include_directories(GMM::GMM INTERFACE ${GMM_INCLUDE_DIR})
if(MSVC)
target_compile_definitions(GMM::GMM INTERFACE "_SCL_SECURE_NO_DEPRECATE")
endif()
endif()
mark_as_advanced(GMM_INCLUDE_DIR GMM_COMPILE_DEFINITIONS)
mark_as_advanced(GMM_INCLUDE_DIR)
endif(GMM_INCLUDE_DIR)
#
# Try to find OPENMESH
# Once done this will define
#
# OPENMESH_FOUND - system has OPENMESH
# OPENMESH_INCLUDE_DIRS - the OPENMESH include directories
# OPENMESH_LIBRARIES - Link these to use OPENMESH
#
# Copyright 2013 Computer Graphics Group, RWTH Aachen University
# Authors: Jan Möbius <moebius@cs.rwth-aachen.de>
# Hans-Christian Ebke <ebke@cs.rwth-aachen.de>
# Max Lyon <lyon@cs.rwth-aachen.de>
#
# This file is part of HexEx.
#
# HexEx is free software: you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free
# Software Foundation, either version 3 of the License, or (at your
# option) any later version.
#
# HexEx is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# for more details.
#
# You should have received a copy of the GNU General Public License
# along with HexEx. If not, see <http://www.gnu.org/licenses/>.
#
IF (OPENMESH_INCLUDE_DIR)
# Already in cache, be silent
SET(OPENMESH_FIND_QUIETLY TRUE)
ENDIF (OPENMESH_INCLUDE_DIR)
FIND_PATH(OPENMESH_INCLUDE_DIR OpenMesh/Core/Mesh/PolyMeshT.hh
PATHS /usr/local/include
/usr/include
/usr/local/OpenMesh-2.0rc4/include
"${CMAKE_SOURCE_DIR}/OpenMesh/src"
"${CMAKE_SOURCE_DIR}/libs_required/OpenMesh/src"
"${CMAKE_SOURCE_DIR}/../OpenMesh/src"
/ACG/acgdev/gcc-4.0-x86_64/OM2/OpenMesh-2.0/installed/include
"C:\\Program Files\\OpenMesh 2.0\\include"
)
SET(OPENMESH_LIBRARY_DIR NOTFOUND CACHE PATH "The directory where the OpenMesh libraries can be found.")
SET(SEARCH_PATHS
"${OPENMESH_INCLUDE_DIR}/../lib"
"${OPENMESH_INCLUDE_DIR}/../lib/OpenMesh"
"${OPENMESH_LIBRARY_DIR}")
FIND_LIBRARY(OPENMESH_CORE_LIBRARY NAMES OpenMeshCored OpenMeshCore PATHS ${SEARCH_PATHS})
FIND_LIBRARY(OPENMESH_TOOLS_LIBRARY NAMES OpenMeshToolsd OpenMeshTools PATHS ${SEARCH_PATHS})
INCLUDE (FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(OpenMesh DEFAULT_MSG OPENMESH_CORE_LIBRARY OPENMESH_TOOLS_LIBRARY OPENMESH_INCLUDE_DIR)
IF (OPENMESH_FOUND)
SET(OPENMESH_LIBRARIES "${OPENMESH_CORE_LIBRARY}" "${OPENMESH_TOOLS_LIBRARY}")
SET(OPENMESH_INCLUDE_DIRS "${OPENMESH_INCLUDE_DIR}")
ENDIF (OPENMESH_FOUND)
#
# Try to find OPENVOLUMEMESH
# Once done this will define
#
# OPENVOLUMEMESH_FOUND - system has OPENVOLUMEMESH
# OPENVOLUMEMESH_INCLUDE_DIR - the OPENVOLUMEMESH include directory
# OPENVOLUMEMESH_LIBRARY - Link these to use OPENVOLUMEMESH
# OPENVOLUMEMESH_LIBRARY_DIR - Library DIR of OPENVOLUMEMESH
#
# Copyright 2013 Computer Graphics Group, RWTH Aachen University
# Authors: Jan Möbius <moebius@cs.rwth-aachen.de>
# Hans-Christian Ebke <ebke@cs.rwth-aachen.de>
# Max Lyon <lyon@cs.rwth-aachen.de>
#
# This file is part of SCOF.
#
# SCOF is free software: you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free
# Software Foundation, either version 3 of the License, or (at your
# option) any later version.
#
# SCOF is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# for more details.
#
# You should have received a copy of the GNU General Public License
# along with SCOF. If not, see <http://www.gnu.org/licenses/>.
#
IF (OPENVOLUMEMESH_INCLUDE_DIR)
# Already in cache, be silent
SET(OPENVOLUMEMESH_FIND_QUIETLY TRUE)
ENDIF (OPENVOLUMEMESH_INCLUDE_DIR)
FIND_PATH(OPENVOLUMEMESH_INCLUDE_DIR OpenVolumeMesh/Mesh/TetrahedralMesh.hh
PATHS /usr/local/include
/usr/include
/usr/local/OpenVolumeMesh/include
"${CMAKE_SOURCE_DIR}/OpenVolumeMesh/src"
"${CMAKE_SOURCE_DIR}/libs_required/OpenVolumeMesh/src"
"${CMAKE_SOURCE_DIR}/../OpenVolumeMesh/src"
/ACG/acgdev/gcc-4.0-x86_64/OVM/OpenVolumeMesh/installed/include
"C:\\Program Files\\OpenVolumeMesh\\include"
)
IF (OPENVOLUMEMESH_INCLUDE_DIR )
SET(OPENVOLUMEMESH_FOUND TRUE)
ADD_DEFINITIONS(-DENABLE_OPENVOLUMEMESH)
IF (WIN32)
IF(EXISTS "${OPENVOLUMEMESH_INCLUDE_DIR}/../lib")
SET(OPENVOLUMEMESH_LIBRARY_DIR "${OPENVOLUMEMESH_INCLUDE_DIR}/../lib")
ENDIF()
ELSE (WIN32)
IF(EXISTS "${OPENVOLUMEMESH_INCLUDE_DIR}/../lib/OpenVolumeMesh")
SET(OPENVOLUMEMESH_LIBRARY_DIR "${OPENVOLUMEMESH_INCLUDE_DIR}/../lib/OpenVolumeMesh")
ENDIF()
ENDIF (WIN32)
SET(OPENVOLUMEMESH_LIBRARY "OpenVolumeMesh")
ELSE (OPENVOLUMEMESH_INCLUDE_DIR)
SET(OPENVOLUMEMESH_FOUND FALSE )
ENDIF (OPENVOLUMEMESH_INCLUDE_DIR )
get_filename_component(SCOF_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
if(NOT TARGET SCOF::SCOF)
include("${SCOF_CMAKE_DIR}/SCOFTargets.cmake")
endif()
################################################################################
# CMake download helpers
################################################################################
# download external dependencies
include(SCOFDownloadExternal)
################################################################################
# Required dependencies
################################################################################
find_package(OpenMesh QUIET)
if(NOT TARGET OpenMeshCore OR NOT TARGET OpenMeshTools)
scof_download_openmesh()
endif()
find_package(OpenVolumeMesh QUIET)
if(NOT TARGET OpenVolumeMesh::OpenVolumeMesh)
scof_download_openvolumemesh()
endif()
# Eigen
find_package(EIGEN3)
if(NOT EIGEN3_FOUND AND "${CMAKE_PROJECT_NAME}" STREQUAL "SCOF")