CMakeLists.txt 3.55 KB
Newer Older
1 2
cmake_minimum_required(VERSION 2.6)

3
PROJECT(meshalyzer)
4

5 6 7
find_package(FLTK REQUIRED NO_MODULE)
include(${FLTK_USE_FILE})
link_libraries(fltk_SHARED fltk_images_SHARED fltk_gl_SHARED)
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

include(FindZLIB)
if (ZLIB_FOUND)
  include_directories(${ZLIB_INCLUDE_DIR})
  link_libraries(${ZLIB_LIBRARIES})
else (ZLIB_FOUND)
  message(FATAL_ERROR "Couldn't find development files for zlib")
endif (ZLIB_FOUND)

include(FindPNG)
if (PNG_FOUND)
  include_directories(${PNG_INCLUDE_DIR})
  link_libraries(${PNG_LIBRARIES})
  add_definitions(${PNG_DEFINITIONS})
else (PNG_FOUND)
  message(FATAL_ERROR "Couldn't find development files for PNG")
endif (PNG_FOUND)

if (CYGWIN)
  add_definitions(-DNOMINMAX)
endif (CYGWIN)

# No common library for pthreads yet.
find_library(PTHREAD_LIB pthread)
if (PTHREAD_LIB)
  link_libraries(${PTHREAD_LIB})
else (PTHREAD_LIB)
  message(FATAL_ERROR "Couldn't find pthread library")
endif (PTHREAD_LIB)

38 39 40 41 42 43 44 45
#Check for GLU
find_library(GLU_LIB GLU)
if (GLU_LIB)
  link_libraries(${GLU_LIB})
else (GLU_LIB)
  message(FATAL_ERROR "Couldn't find GLU")
endif (GLU_LIB)

46 47 48 49
option(USE_GLFRAMEBUFFERS "Use the glFramebuffer* extensions to render PNG images.  It should be superior to onscreen rendering, but on nvidia cards it has problems." OFF)
if (NOT USE_GLFRAMEBUFFERS)
  add_definitions(-DONSCREEN_DUMP)
endif (NOT USE_GLFRAMEBUFFERS)
50 51 52 53 54

# ok, now adding everything else
add_definitions(
-DOBJ_CLASS
-D_REENTRANT
55
-DNOMINMAX
56
)
57 58 59 60

add_definitions(-fopenmp)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fopenmp")

61 62
include_directories(.)

63 64 65 66 67 68 69 70 71
fltk_wrap_ui(meshalyzer 
ClipPlane.fl
colourchoice.fl
DataOpacity.fl
HiLiteWinInfo.fl
isosurf.fl
plottingwin.fl
Sequence.fl
trimesh.fl
Robert Blake's avatar
Robert Blake committed
72
TimeLink.fl
73
HDF5DataBrowser.fl
74 75
)

76
add_executable(meshalyzer
77
${meshalyzer_FLTK_UI_SRCS}
78
AuxGrid.cc
79 80 81 82
Colourscale.cc
Connection.cc
ContCable.cc
CutSurfaces.cc
83
DrawingObjects.cc
84 85 86 87 88
FileType.cc
Fl_Gl_Tb_Window.C
gl2ps.c
Graph.cc
Hexahedron.cc
89 90
IsoLines.cc
IsoSurface.cc
91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106
IGBheader.cc
main.cc
Matrix4x4.C
Model.cc
ModInt.C
Mouse.C
Myslider.cc
MyValueInput.cc
PlotWin.cc
PNGwrite.cc
Point.cc
PolyGon.cc
Prism.cc
Pyramid.cc
Quadrilateral.cc
Surfaces.cc
107
Region.cc
108 109 110 111 112 113 114
TBmeshWin.cc
Tetrahedral.cc
Trackball.C
Triangle.cc
VecData.cc
Vector3D.C
Vector4D.C
Robert Blake's avatar
Robert Blake committed
115
GLee.c
116
Orienter.cc
117
)
118 119 120

install(TARGETS meshalyzer RUNTIME DESTINATION bin)

121

122 123
set(CPACK_PACKAGE_VERSION_MAJOR 0)
set(CPACK_PACKAGE_VERSION_MINOR 0)
124
set(CPACK_PACKAGE_VERSION_PATCH r3675)
125
set(CPACK_PACKAGE_VENDOR cardiosolv)
126 127 128 129 130 131 132 133 134 135
set(CPACK_STRIP_FILES ON)

set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Visualization software for CARP files.")
set(CPACK_PACKAGE_DESCRIPTION "
Meshalyzer is an OpenGL scientific visualization program for CARP data 
files.  It is designed to read in CARP finite element meshes and the .dat/.igb
files produced by CARP.

For more information, go to http://cardiosolv.com
")
136 137

set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Robert Blake <rblake@cardiosolv.com>")
138
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libfltk1.3 (>=1.3.0), zlib1g, libglu1-mesa")
139
set(CPACK_DEBIAN_PACKAGE_SECTION "science")
140 141 142

set(RPM_DISTRIBUTION "centos" CACHE STRING "Linux distribution for RPM, either centos, opensuse, or fedora")
if (RPM_DISTRIBUTION STREQUAL "centos")
143
  set(CPACK_RPM_PACKAGE_REQUIRES "fltk >= 1.3, zlib, freeglut, libpng")
144
elseif(RPM_DISTRIBUTION STREQUAL "opensuse")
145
  set(CPACK_RPM_PACKAGE_REQUIRES "libfltk1 >= 1.3, zlib, freeglut, libpng14-14")
146
elseif(RPM_DISTRIBUTION STREQUAL "fedora")
147
  set(CPACK_RPM_PACKAGE_REQUIRES "fltk >= 1.3, zlib, freeglut, libpng >= 1.2.44")
148 149 150 151
else(RPM_DISTRIBUTION STREQUAL "centos")
  message(SEND_ERROR "Invalid RPM distribution")
endif(RPM_DISTRIBUTION STREQUAL "centos")

152 153 154 155
include(CPack)