vcpkg/ports/triangle/CMakeLists.txt

48 lines
1.5 KiB
CMake
Raw Normal View History

cmake_minimum_required(VERSION 3.5...3.30)
[triangle] Add new port (#13322) * New Port : libigl-triangle * Update ci.baseline.txt for libigl-triangle port * Update ports/libigl-triangle/CONTROL Unnecessary Port-Version Co-authored-by: NancyLi1013 <46708020+NancyLi1013@users.noreply.github.com> * Update ports/libigl-triangle/portfile.cmake Unnecessary inclusion of vcpkg_common_functions Co-authored-by: NancyLi1013 <46708020+NancyLi1013@users.noreply.github.com> * Update ports/libigl-triangle/portfile.cmake Use README from source as the copyright file Co-authored-by: NancyLi1013 <46708020+NancyLi1013@users.noreply.github.com> * Updates to libigl-translate port * Update libigl-triangle port * Update ports/libigl-triangle/CONTROL Co-authored-by: NancyLi1013 <46708020+NancyLi1013@users.noreply.github.com> * Update ports/libigl-triangle/portfile.cmake Co-authored-by: NancyLi1013 <46708020+NancyLi1013@users.noreply.github.com> * Make the header copy properly and add CMake targets * Utilize original sources for triangle library and rename to triangle * Build triangle executable and add it to tools * Fix Linux build which requires linking to m library for math functions * Update scripts/ci.baseline.txt Co-authored-by: NancyLi1013 <46708020+NancyLi1013@users.noreply.github.com> * Instead of defining INT_PTR, use uintptr_t from stdint.h Also, define FLOAT and VOID in the header so the user of the library does not have to define them * Make sure the port works and can be used * Remove the use of the SINGLE define for switching the REAL define to be float or double. Also make the define for VOID be void rather than replacing all VOID with void in order to reduce the patch size. Co-authored-by: Nathan Mercer <nmercer@intermap.com> Co-authored-by: NancyLi1013 <46708020+NancyLi1013@users.noreply.github.com> Co-authored-by: NancyLi1013 <lirui09@beyondsoft.com>
2020-09-15 08:11:49 +08:00
project(triangle)
option(BUILD_TOOL "Build the command line tool" OFF)
[triangle] Add new port (#13322) * New Port : libigl-triangle * Update ci.baseline.txt for libigl-triangle port * Update ports/libigl-triangle/CONTROL Unnecessary Port-Version Co-authored-by: NancyLi1013 <46708020+NancyLi1013@users.noreply.github.com> * Update ports/libigl-triangle/portfile.cmake Unnecessary inclusion of vcpkg_common_functions Co-authored-by: NancyLi1013 <46708020+NancyLi1013@users.noreply.github.com> * Update ports/libigl-triangle/portfile.cmake Use README from source as the copyright file Co-authored-by: NancyLi1013 <46708020+NancyLi1013@users.noreply.github.com> * Updates to libigl-translate port * Update libigl-triangle port * Update ports/libigl-triangle/CONTROL Co-authored-by: NancyLi1013 <46708020+NancyLi1013@users.noreply.github.com> * Update ports/libigl-triangle/portfile.cmake Co-authored-by: NancyLi1013 <46708020+NancyLi1013@users.noreply.github.com> * Make the header copy properly and add CMake targets * Utilize original sources for triangle library and rename to triangle * Build triangle executable and add it to tools * Fix Linux build which requires linking to m library for math functions * Update scripts/ci.baseline.txt Co-authored-by: NancyLi1013 <46708020+NancyLi1013@users.noreply.github.com> * Instead of defining INT_PTR, use uintptr_t from stdint.h Also, define FLOAT and VOID in the header so the user of the library does not have to define them * Make sure the port works and can be used * Remove the use of the SINGLE define for switching the REAL define to be float or double. Also make the define for VOID be void rather than replacing all VOID with void in order to reduce the patch size. Co-authored-by: Nathan Mercer <nmercer@intermap.com> Co-authored-by: NancyLi1013 <46708020+NancyLi1013@users.noreply.github.com> Co-authored-by: NancyLi1013 <lirui09@beyondsoft.com>
2020-09-15 08:11:49 +08:00
include(GNUInstallDirs)
[triangle] Add new port (#13322) * New Port : libigl-triangle * Update ci.baseline.txt for libigl-triangle port * Update ports/libigl-triangle/CONTROL Unnecessary Port-Version Co-authored-by: NancyLi1013 <46708020+NancyLi1013@users.noreply.github.com> * Update ports/libigl-triangle/portfile.cmake Unnecessary inclusion of vcpkg_common_functions Co-authored-by: NancyLi1013 <46708020+NancyLi1013@users.noreply.github.com> * Update ports/libigl-triangle/portfile.cmake Use README from source as the copyright file Co-authored-by: NancyLi1013 <46708020+NancyLi1013@users.noreply.github.com> * Updates to libigl-translate port * Update libigl-triangle port * Update ports/libigl-triangle/CONTROL Co-authored-by: NancyLi1013 <46708020+NancyLi1013@users.noreply.github.com> * Update ports/libigl-triangle/portfile.cmake Co-authored-by: NancyLi1013 <46708020+NancyLi1013@users.noreply.github.com> * Make the header copy properly and add CMake targets * Utilize original sources for triangle library and rename to triangle * Build triangle executable and add it to tools * Fix Linux build which requires linking to m library for math functions * Update scripts/ci.baseline.txt Co-authored-by: NancyLi1013 <46708020+NancyLi1013@users.noreply.github.com> * Instead of defining INT_PTR, use uintptr_t from stdint.h Also, define FLOAT and VOID in the header so the user of the library does not have to define them * Make sure the port works and can be used * Remove the use of the SINGLE define for switching the REAL define to be float or double. Also make the define for VOID be void rather than replacing all VOID with void in order to reduce the patch size. Co-authored-by: Nathan Mercer <nmercer@intermap.com> Co-authored-by: NancyLi1013 <46708020+NancyLi1013@users.noreply.github.com> Co-authored-by: NancyLi1013 <lirui09@beyondsoft.com>
2020-09-15 08:11:49 +08:00
add_library(triangle triangle.c exports.def)
set_target_properties(triangle PROPERTIES PUBLIC_HEADER "${CMAKE_SOURCE_DIR}/triangle.h")
target_compile_definitions(triangle PRIVATE -DTRILIBRARY)
add_executable(triangle_exe triangle.c)
set_target_properties(triangle_exe PROPERTIES OUTPUT_NAME "triangle")
foreach(target IN ITEMS triangle triangle_exe)
target_compile_definitions(${target} PRIVATE -DANSI_DECLARATORS)
target_include_directories(${target} PUBLIC
"$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}>"
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>"
)
if(WIN32)
target_compile_definitions(${target} PRIVATE -DNO_TIMER)
endif()
if(UNIX AND NOT APPLE AND NOT ANDROID)
target_link_libraries(${target} PRIVATE m)
endif()
endforeach()
install(TARGETS triangle
EXPORT triangle-targets
[triangle] Add new port (#13322) * New Port : libigl-triangle * Update ci.baseline.txt for libigl-triangle port * Update ports/libigl-triangle/CONTROL Unnecessary Port-Version Co-authored-by: NancyLi1013 <46708020+NancyLi1013@users.noreply.github.com> * Update ports/libigl-triangle/portfile.cmake Unnecessary inclusion of vcpkg_common_functions Co-authored-by: NancyLi1013 <46708020+NancyLi1013@users.noreply.github.com> * Update ports/libigl-triangle/portfile.cmake Use README from source as the copyright file Co-authored-by: NancyLi1013 <46708020+NancyLi1013@users.noreply.github.com> * Updates to libigl-translate port * Update libigl-triangle port * Update ports/libigl-triangle/CONTROL Co-authored-by: NancyLi1013 <46708020+NancyLi1013@users.noreply.github.com> * Update ports/libigl-triangle/portfile.cmake Co-authored-by: NancyLi1013 <46708020+NancyLi1013@users.noreply.github.com> * Make the header copy properly and add CMake targets * Utilize original sources for triangle library and rename to triangle * Build triangle executable and add it to tools * Fix Linux build which requires linking to m library for math functions * Update scripts/ci.baseline.txt Co-authored-by: NancyLi1013 <46708020+NancyLi1013@users.noreply.github.com> * Instead of defining INT_PTR, use uintptr_t from stdint.h Also, define FLOAT and VOID in the header so the user of the library does not have to define them * Make sure the port works and can be used * Remove the use of the SINGLE define for switching the REAL define to be float or double. Also make the define for VOID be void rather than replacing all VOID with void in order to reduce the patch size. Co-authored-by: Nathan Mercer <nmercer@intermap.com> Co-authored-by: NancyLi1013 <46708020+NancyLi1013@users.noreply.github.com> Co-authored-by: NancyLi1013 <lirui09@beyondsoft.com>
2020-09-15 08:11:49 +08:00
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)
install(EXPORT triangle-targets
FILE unofficial-triangle-config.cmake
NAMESPACE unofficial::triangle::
DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/unofficial-triangle"
[triangle] Add new port (#13322) * New Port : libigl-triangle * Update ci.baseline.txt for libigl-triangle port * Update ports/libigl-triangle/CONTROL Unnecessary Port-Version Co-authored-by: NancyLi1013 <46708020+NancyLi1013@users.noreply.github.com> * Update ports/libigl-triangle/portfile.cmake Unnecessary inclusion of vcpkg_common_functions Co-authored-by: NancyLi1013 <46708020+NancyLi1013@users.noreply.github.com> * Update ports/libigl-triangle/portfile.cmake Use README from source as the copyright file Co-authored-by: NancyLi1013 <46708020+NancyLi1013@users.noreply.github.com> * Updates to libigl-translate port * Update libigl-triangle port * Update ports/libigl-triangle/CONTROL Co-authored-by: NancyLi1013 <46708020+NancyLi1013@users.noreply.github.com> * Update ports/libigl-triangle/portfile.cmake Co-authored-by: NancyLi1013 <46708020+NancyLi1013@users.noreply.github.com> * Make the header copy properly and add CMake targets * Utilize original sources for triangle library and rename to triangle * Build triangle executable and add it to tools * Fix Linux build which requires linking to m library for math functions * Update scripts/ci.baseline.txt Co-authored-by: NancyLi1013 <46708020+NancyLi1013@users.noreply.github.com> * Instead of defining INT_PTR, use uintptr_t from stdint.h Also, define FLOAT and VOID in the header so the user of the library does not have to define them * Make sure the port works and can be used * Remove the use of the SINGLE define for switching the REAL define to be float or double. Also make the define for VOID be void rather than replacing all VOID with void in order to reduce the patch size. Co-authored-by: Nathan Mercer <nmercer@intermap.com> Co-authored-by: NancyLi1013 <46708020+NancyLi1013@users.noreply.github.com> Co-authored-by: NancyLi1013 <lirui09@beyondsoft.com>
2020-09-15 08:11:49 +08:00
)
if(BUILD_TOOL)
install(TARGETS triangle_exe DESTINATION tools/triangle)
else()
set_target_properties(triangle_exe PROPERTIES EXCLUDE_FROM_ALL 1)
endif()