fixed adjacent blayer smoothing bug ...
[engrid-github.git] / src / CMakeLists.txt
blob0023a82aef16838fdcc006cb9a660720210d6112
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})
76 include_directories(${CMAKE_CURRENT_BINARY_DIR})
78 option(PROFILING "add -g for profiling even in RELEASE configuration?" OFF)
80 if (${CMAKE_BUILD_TYPE} STREQUAL "Release")
81   add_definitions(-DNDEBUG)
82   add_definitions(-DQT_NO_DEBUG)
83   remove_definitions(-DQT_DEBUG)
84   if (PROFILING)
85     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g")
86   endif()
87 else()
88   add_definitions(-DQT_DEBUG)
89 endif()
91 add_subdirectory(tetgen)
92 add_subdirectory(libengrid)
94 add_executable(engrid main.cpp)
96 target_link_libraries(engrid libengrid)
97 target_link_libraries(engrid tet)
98 target_link_libraries(engrid ${QT_LIBRARIES})
99 target_link_libraries(engrid ${VTK_LIBRARIES})
100 target_link_libraries(engrid Qt4::QtCore)
101 target_link_libraries(engrid Qt4::QtGui)
102 target_link_libraries(engrid Qt4::QtXml)
104 install(TARGETS engrid DESTINATION bin)
106 install(
107   FILES engrid.bash
108   PERMISSIONS OWNER_EXECUTE OWNER_READ OWNER_WRITE GROUP_EXECUTE GROUP_READ
109   DESTINATION bin
112 add_dependencies(engrid tetgen libengrid)