1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
|
Description: update CMakeLists.txt
Author: Anton Gladky <gladk@debian.org>, Christophe Trophime <christophe.trophime@lncmi.cnrs.fr>
Last-Update: 2014-01-28
Index: tetgen/CMakeLists.txt
===================================================================
--- tetgen.orig/CMakeLists.txt
+++ tetgen/CMakeLists.txt
@@ -1,14 +1,30 @@
# 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)
+
+INCLUDE(GNUInstallDirs)
-#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_definitions(-DTETLIBRARY)
+add_executable(tetgen tetgen_main.cxx)
+target_link_libraries(tetgen tetlib)
+
+# Install
+install(TARGETS tetgen DESTINATION ${CMAKE_INSTALL_BINDIR})
+install(TARGETS tetlib DESTINATION ${CMAKE_INSTALL_LIBDIR})
+install(FILES tetgen.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
|