--- CMakeLists.txt.orig 2023-03-30 09:53:15 +++ CMakeLists.txt 2023-03-30 09:51:22 @@ -1,14 +1,26 @@ # Set the minimum required version of cmake for a project. cmake_minimum_required(VERSION 2.6) -# Add an executable to the project using the specified source files. -add_executable(tetgen tetgen.cxx predicates.cxx) +set(TET_MAJOR_VERSION 1) +set(TET_MINOR_VERSION 6) +set(TET_PATCH_VERSION 0) -#Add a library to the project using the specified source files. -# In Linux/Unix, it will creates the libtet.a -add_library(tet STATIC tetgen.cxx predicates.cxx) - +#Add a shared library to the project using the specified source files. +add_library(tetlib SHARED tetgen.cxx predicates.cxx) #Set properties on a target. #We use this here to set -DTETLIBRARY for when compiling the #library -set_target_properties(tet PROPERTIES "COMPILE_DEFINITIONS" TETLIBRARY) \ No newline at end of file +set_target_properties(tetlib PROPERTIES "COMPILE_DEFINITIONS" TETLIBRARY) +set_target_properties(tetlib PROPERTIES OUTPUT_NAME tet) +set_target_properties(tetlib PROPERTIES + VERSION ${TET_MAJOR_VERSION}.${TET_MINOR_VERSION}.${TET_PATCH_VERSION} + SOVERSION ${TET_MAJOR_VERSION}.${TET_MINOR_VERSION}) + +# Add an executable to the project using the specified source files. +add_executable(tetgen tetgen.cxx) +target_link_libraries(tetgen tetlib) + +# Install +install(TARGETS tetgen DESTINATION ${CMAKE_INSTALL_PREFIX}/bin) +install(TARGETS tetlib DESTINATION ${CMAKE_INSTALL_PREFIX}/lib) +install(FILES tetgen.h DESTINATION ${CMAKE_INSTALL_PREFIX}/include)