Skip to main content
  • Home
  • Development
  • Documentation
  • Donate
  • Operational login
  • Browse the archive

swh logo
SoftwareHeritage
Software
Heritage
Archive
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

Revision 70d2abaa53616af35c7857bf8f52c8a234f150ff authored by X.ZhaoMa on 27 January 2021, 15:43:51 UTC, committed by GitHub on 27 January 2021, 15:43:51 UTC
fix: compilation error caused by missing "inline" keyword. (#1709)
1 parent 780a5fb
  • Files
  • Changes
  • 856706a
  • /
  • tests
  • /
  • CMakeLists.txt
Raw File Download

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • revision
  • directory
  • content
revision badge
swh:1:rev:70d2abaa53616af35c7857bf8f52c8a234f150ff
directory badge
swh:1:dir:7f9801604a908ea815bfa818b5925d1509f49514
content badge
swh:1:cnt:2410c199bfdfcd2c08c748b0c0e1d1f1a5bdc3d1

This interface enables to generate software citations, provided that the root directory of browsed objects contains a citation.cff or codemeta.json file.
Select below a type of object currently browsed in order to generate citations for them.

  • revision
  • directory
  • content
(requires biblatex-software package)
Generating citation ...
(requires biblatex-software package)
Generating citation ...
(requires biblatex-software package)
Generating citation ...
CMakeLists.txt
cmake_minimum_required(VERSION 3.1)
project(libigl_tests)

list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/../cmake)

### Adding libIGL: choose the path to your local copy libIGL
if(NOT TARGET igl::core)
  include(libigl)
else()
  include(LibiglDownloadExternal)
endif()

### Download data
igl_download_test_data()
set(IGL_TEST_DATA ${LIBIGL_EXTERNAL}/../tests/data)

### Download Catch2 unit test framework
igl_download_catch2()
list(APPEND CMAKE_MODULE_PATH ${LIBIGL_EXTERNAL}/catch2/contrib)


# Add catch2
add_subdirectory(${LIBIGL_EXTERNAL}/catch2 catch2)


# Create test executable
add_executable(libigl_tests main.cpp test_common.h)
target_link_libraries(libigl_tests PUBLIC igl::core Catch2::Catch2)
target_include_directories(libigl_tests PUBLIC ${CMAKE_CURRENT_LIST_DIR})
target_compile_definitions(libigl_tests PUBLIC CATCH_CONFIG_ENABLE_BENCHMARKING)

# Set DATA_DIR definition
set(DATA_DIR "${CMAKE_CURRENT_SOURCE_DIR}/data/")
target_compile_definitions(libigl_tests PUBLIC -DLIBIGL_DATA_DIR="${IGL_TEST_DATA}")

# Silencing some compile warnings
if(MSVC)
  target_compile_options(libigl_tests PRIVATE
    # Type conversion warnings. These can be fixed with some effort and possibly more verbose code.
    /wd4267 # conversion from 'size_t' to 'type', possible loss of data
    /wd4244 # conversion from 'type1' to 'type2', possible loss of data
    /wd4018 # signed/unsigned mismatch
    /wd4305 # truncation from 'double' to 'float'
  )
endif(MSVC)

# Process code in each subdirectories: add in decreasing order of complexity
# (last added will run first and those should be the fastest tests)
if(LIBIGL_WITH_MOSEK)
  file(GLOB TEST_SRC_FILES ./include/igl/mosek/*.cpp)
  file(GLOB TEST_INC_FILES ./include/igl/mosek/*.h ./include/igl/mosek/*.inl)
  target_sources(libigl_tests PRIVATE ${TEST_SRC_FILES} ${TEST_INC_FILES})

  target_link_libraries(libigl_tests PUBLIC igl::mosek)
  # fix mosek
  IF(APPLE)
    INCLUDE(../cmake/OSXFixDylibReferences.cmake)
    OSX_FIX_DYLIB_REFERENCES(libigl_tests "${MOSEK_LIBRARIES}")
  ENDIF()
endif()

if(LIBIGL_WITH_CGAL)
  file(GLOB TEST_SRC_FILES ./include/igl/copyleft/boolean/*.cpp ./include/igl/copyleft/cgal/*.cpp)
  file(GLOB TEST_INC_FILES ./include/igl/copyleft/boolean/*.h ./include/igl/copyleft/cgal/*.h ./include/igl/copyleft/boolean/*.inl ./include/igl/copyleft/cgal/*.inl)
  target_sources(libigl_tests PRIVATE ${TEST_SRC_FILES} ${TEST_INC_FILES})

  target_link_libraries(libigl_tests PUBLIC igl::cgal)
  igl_copy_cgal_dll(libigl_tests)
endif()

if(LIBIGL_WITH_TETGEN)
  file(GLOB TEST_SRC_FILES ./include/igl/copyleft/tetgen/*.cpp)
  file(GLOB TEST_INC_FILES ./include/igl/copyleft/tetgen/*.h ./include/igl/copyleft/tetgen/*.inl)
  target_sources(libigl_tests PRIVATE ${TEST_SRC_FILES} ${TEST_INC_FILES})

  target_link_libraries(libigl_tests PUBLIC igl::tetgen)
endif()

if(LIBIGL_WITH_COMISO)
  file(GLOB TEST_SRC_FILES ./include/igl/copyleft/comiso/*.cpp)
  file(GLOB TEST_INC_FILES ./include/igl/copyleft/comiso/*.h ./include/igl/copyleft/comiso/*.inl)
  target_sources(libigl_tests PRIVATE ${TEST_SRC_FILES} ${TEST_INC_FILES})

  target_link_libraries(libigl_tests PUBLIC igl::comiso)
endif()

if(LIBIGL_WITH_EMBREE)
  file(GLOB TEST_SRC_FILES ./include/igl/embree/*.cpp)
  file(GLOB TEST_INC_FILES ./include/igl/embree/*.h ./include/igl/embree/*.inl)
  target_sources(libigl_tests PRIVATE ${TEST_SRC_FILES} ${TEST_INC_FILES})

  target_link_libraries(libigl_tests PUBLIC igl::embree)
endif()

if(LIBIGL_WITH_PREDICATES AND LIBIGL_WITH_TRIANGLE)
  file(GLOB TEST_SRC_FILES ./include/igl/predicates/*.cpp)
  file(GLOB TEST_INC_FILES ./include/igl/predicates/*.h ./include/igl/predicates/*.inl)
  target_sources(libigl_tests PRIVATE ${TEST_SRC_FILES} ${TEST_INC_FILES})

  target_link_libraries(libigl_tests PUBLIC igl::predicates igl::triangle)
endif()

if(LIBIGL_WITH_TRIANGLE)
  file(GLOB TEST_SRC_FILES ./include/igl/triangle/*.cpp)
  file(GLOB TEST_INC_FILES ./include/igl/triangle/*.h ./include/igl/triangle/*.inl)
  target_sources(libigl_tests PRIVATE ${TEST_SRC_FILES} ${TEST_INC_FILES})

  target_link_libraries(libigl_tests PUBLIC igl::triangle)
endif()

file(GLOB TEST_SRC_FILES ./include/igl/*.cpp)
file(GLOB TEST_INC_FILES ./include/igl/*.h ./include/igl/*.inl)
target_sources(libigl_tests PRIVATE ${TEST_SRC_FILES} ${TEST_INC_FILES})


# Register tests
set(PARSE_CATCH_TESTS_ADD_TO_CONFIGURE_DEPENDS ON)
include(Catch)
catch_discover_tests(libigl_tests)
The diff you're trying to view is too large. Only the first 1000 changed files have been loaded.
Showing with 0 additions and 0 deletions (0 / 0 diffs computed)
swh spinner

Computing file changes ...

back to top

Software Heritage — Copyright (C) 2015–2026, The Software Heritage developers. License: GNU AGPLv3+.
The source code of Software Heritage itself is available on our development forge.
The source code files archived by Software Heritage are available under their own copyright and licenses.
Terms of use: Archive access, API— Content policy— Contact— JavaScript license information— Web API