Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[triangle] Add new port #13322

Merged
merged 18 commits into from
Sep 15, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions ports/triangle/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
cmake_minimum_required(VERSION 2.8.12)
project(triangle)

include(GNUInstallDirs)

add_library(triangleLib triangle.c exports.def)
add_executable(triangle triangle.c)

target_compile_definitions(triangleLib PRIVATE -DTRILIBRARY -DANSI_DECLARATORS)
target_compile_definitions(triangle PRIVATE -DANSI_DECLARATORS)
if(WIN32)
target_compile_definitions(triangleLib PRIVATE -DNO_TIMER)
target_compile_definitions(triangle PRIVATE -DNO_TIMER)
endif()

if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
target_link_libraries(triangle m)
endif()

target_include_directories(triangleLib PUBLIC
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}>
)

set_target_properties(triangleLib PROPERTIES POSITION_INDEPENDENT_CODE ON)

set_target_properties(triangleLib PROPERTIES PUBLIC_HEADER
"${CMAKE_SOURCE_DIR}/triangle.h"
)

set_target_properties(triangleLib PROPERTIES OUTPUT_NAME "triangle")

install(TARGETS triangleLib EXPORT triangleTargets
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)

install(TARGETS triangle DESTINATION tools/triangle)

install(EXPORT triangleTargets
FILE triangleConfig.cmake
NAMESPACE triangle::
DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/triangle"
)
5 changes: 5 additions & 0 deletions ports/triangle/CONTROL
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Source: triangle
Version: 1.6
Homepage: http://www.cs.cmu.edu/~quake/triangle.html
Description: A Two-Dimensional Quality Mesh Generator and Delaunay Triangulator.
Supports: !uwp
Loading