started to remove obsolete attributes and functionality
[engrid-github.git] / src / CMakeLists.txt
blob66c0e706d5e193602d6e62544a2d4f9ed51c3d91
1 # ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 # +                                                                      +
3 # + This file is part of enGrid.                                         +
4 # +                                                                      +
5 # + Copyright 2008-2014 enGits GmbH                                      +
6 # +                                                                      +
7 # + enGrid is free software: you can redistribute it and/or modify       +
8 # + it under the terms of the GNU General Public License as published by +
9 # + the Free Software Foundation, either version 3 of the License, or    +
10 # + (at your option) any later version.                                  +
11 # +                                                                      +
12 # + enGrid is distributed in the hope that it will be useful,            +
13 # + but WITHOUT ANY WARRANTY; without even the implied warranty of       +
14 # + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        +
15 # + GNU General Public License for more details.                         +
16 # +                                                                      +
17 # + You should have received a copy of the GNU General Public License    +
18 # + along with enGrid. If not, see <http://www.gnu.org/licenses/>.       +
19 # +                                                                      +
20 # ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
23 cmake_minimum_required(VERSION 2.8)
25 # limit configuration types (must be done before project() statement)
26 set(CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE STRING "limited config" FORCE)
28 project(ENGRID)
30 set(CMAKE_VERBOSE_MAKEFILE off)
32 set(ENGRID_MAJOR_VERSION 2)
33 set(ENGRID_MINOR_VERSION 0)
34 set(ENGRID_PATCH_VERSION 0)
35 set(ENGRID_VERSION ${ENGRID_MAJOR_VERSION}.${ENGRID_MINOR_VERSION}.${ENGRID_PATCH_VERSION})
37 exec_program(
38     "git"
39     ${CMAKE_CURRENT_SOURCE_DIR}
40     ARGS "describe"
41     OUTPUT_VARIABLE GIT_SHA1)
42 string(REGEX MATCH "-g.*$" GIT_SHA1 ${GIT_SHA1})
43 string(REGEX REPLACE "[-g]" "" GIT_SHA1 ${GIT_SHA1} )
44 add_definitions( -DGIT_SHA1="${GIT_SHA1}" )
46 exec_program(
47     "git"
48     ${CMAKE_CURRENT_SOURCE_DIR}
49     ARGS "symbolic-ref --short HEAD"
50     OUTPUT_VARIABLE GIT_BRANCH)
51 add_definitions( -DGIT_BRANCH="${GIT_BRANCH}" )
53 FIND_PACKAGE(VTK REQUIRED)
54 include(${VTK_USE_FILE})
55 include_directories(${VTK_INCLUDE_DIRS})
57 FIND_PACKAGE(CGAL REQUIRED)
58 include(${CGAL_USE_FILE})
59 #include_directories(${VTK_INCLUDE_DIRS})
61 # Qt4
62 find_package(Qt4 COMPONENTS QtCore REQUIRED)
63 find_package(Qt4 COMPONENTS QtGui REQUIRED)
64 find_package(Qt4 COMPONENTS QtXml REQUIRED)
66 #include(${QT_USE_FILE})
67 include_directories(${QT_QTCORE_INCLUDE_DIR})
68 include_directories(${QT_QTGUI_INCLUDE_DIR})
69 include_directories(${QT_QTXML_INCLUDE_DIR})
71 # set include directory, add src directories
72 include_directories(${CMAKE_CURRENT_SOURCE_DIR}/tetgen)
73 include_directories(${CMAKE_CURRENT_SOURCE_DIR}/libengrid)
74 include_directories(${CMAKE_CURRENT_BINARY_DIR}/libengrid)
75 include_directories(${CMAKE_CURRENT_SOURCE_DIR})
77 if (${CMAKE_BUILD_TYPE} STREQUAL "Release")
78   add_definitions(-DNDEBUG)
79   add_definitions(-DQT_NO_DEBUG)
80   remove_definitions(-DQT_DEBUG)
81 else()
82   add_definitions(-DQT_DEBUG)
83 endif()
85 add_subdirectory(tetgen)
86 add_subdirectory(libengrid)
88 add_executable(engrid main.cpp)
90 # CGAL
91 #find_path(CGAL_INCLUDE_PATH CGAL/Exact_predicates_inexact_constructions_kernel.h /usr/include /usr/local/include)
92 #add_definitions(-DUSE_CGAL_PREDICATES)
93 #include_directories(${CGAL_INCLUDE_PATH})
94 #find_path (BOOST_INCLUDE_PATH any.hpp /usr/include/boost /usr/local/include/boost)
95 #include_directories(${BOOST_INCLUDE_PATH})
96 #find_library(GMP_LIBRARY
97 #             NAMES libgmp.so
98 #             PATHS /usr/lib /usr/lib64 /usr/local/lib /usr/local/lib64)
99 #find_library(CGAL_LIBRARY
100 #             NAMES libCGAL.so
101 #             PATHS /usr/lib /usr/lib64 /usr/local/lib /usr/local/lib64)
102 #find_library(CGAL_CORE_LIBRARY
103 #             NAMES libCGAL_Core.so
104 #             PATHS /usr/lib /usr/lib64 /usr/local/lib /usr/local/lib64)
105 #find_library(BOOST_SYSTEM_LIBRARY
106 #             NAMES libboost_system.so
107 #             PATHS /usr/lib /usr/lib64 /usr/local/lib /usr/local/lib64)
109 target_link_libraries(engrid libengrid)
110 target_link_libraries(engrid tet)
111 target_link_libraries(engrid ${QT_LIBRARIES})
112 target_link_libraries(engrid ${VTK_LIBRARIES})
113 target_link_libraries(engrid Qt4::QtCore)
114 target_link_libraries(engrid Qt4::QtGui)
115 target_link_libraries(engrid Qt4::QtXml)
116 #target_link_libraries(engrid ${GMP_LIBRARY})
117 #target_link_libraries(engrid ${BOOST_SYSTEM_LIBRARY})
118 #target_link_libraries(engrid ${GGAL_CORE_LIBRARY})
119 #target_link_libraries(engrid ${GGAL_LIBRARY})
121 install(TARGETS engrid DESTINATION bin)
123 add_dependencies(engrid tetgen libengrid)