1 cmake_minimum_required(VERSION 2.8.0)
4 set (GPIVTOOLS_VERSION_MAJOR 0)
5 set (GPIVTOOLS_VERSION_MINOR 7)
6 set (GPIVTOOLS_VERSION_PATCH 0)
8 ${GPIVTOOLS_VERSION_MAJOR}.${GPIVTOOLS_VERSION_MINOR}.${GPIVTOOLS_VERSION_PATCH})
10 # add binary directory as include directory
11 include_directories(${CMAKE_CURRENT_BINARY_DIR})
13 # set up custom cmake module path
14 set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/CMake/Modules)
17 include(${CMAKE_SOURCE_DIR}/CMake/GpivUtilities.cmake)
19 set( CMAKE_VERBOSE_MAKEFILE on )
21 find_package(Gpiv REQUIRED)
23 MESSAGE(FATAL_ERROR "Could not find Gpiv library")
25 #message (Gpiv_INCLUDE_DIR = ${GPIV_INCLUDE_DIR} )
26 include_directories( ${GPIV_INCLUDE_DIR} )
27 set( LIBS ${LIBS} ${Gpiv_LIBRARIES} )
29 find_package(GSL REQUIRED)
30 #include_directories( ${Gsl_INCLUDE_DIR} )
31 #set( LIBS ${LIBS} ${Gsl_LIBRARIES} )
33 find_package( Glib REQUIRED )
34 include_directories( ${Glib_INCLUDE_DIRS} )
35 set( LIBS ${LIBS} ${Glib_LIBRARIES} )
37 #message (env var home = $ENV{HOME})
40 set (_DEFAULT_EXE_PREFIX "gpiv_")
41 set(EXE_PREFIX "${_DEFAULT_EXE_PREFIX}"
42 CACHE STRING "Prefix for application output-names")
43 mark_as_advanced(EXE_PREFIX)
45 # --enable-mpi enable Message Protocol Interface (MPI)
46 option( USE_MPI "Parallel processing on distributed memory systems" OFF )
48 add_definitions(-DENABLE_MPI)
50 include_directories( ${MPI_INCLUDE_PATH} )
51 set( LIBS ${LIBS} ${MPI_LIBRARY} )
54 # --enable-cam enable (IEEE-1394) camera
55 option( USE_CAM "Use (IEEE-1394) camera software for image recording" OFF )
57 add_definitions(-DENABLE_CAM)
60 # --enable-trig enable (realtime) triggering
61 option( USE_TRIG "Use RTAI software for laser and camera triggering" OFF )
63 add_definitions(-DENABLE_TRIG)
66 # --disable-rta=RTATOPDIR place where the RTAI code \
67 #resides (default /usr/lib/realtime)
68 # --enable-k=KTOPDIR place where the installed kernel \
69 #headers resides (default /usr/src/kernel-headers-2.4.27-adeos)
71 # --enable-omp enable Open Multi-Processing (OMP)
72 option( USE_OMP "Use Open Multi-Processing (OMP)" ON )
74 add_definitions(-DENABLE_OMP)
77 # select debug behaviour and execution
78 option(DEBUG_V "Verbose behaviour for debugging." OFF)
80 add_definitions(-DDEBUG_V)
83 option(DISABLE_EXEC "Reduced execution for debugging." OFF)
85 add_definitions(-DDISABLE_EXEC)
88 # Man pages having identic prefix as executables
89 file(REMOVE_RECURSE ${CMAKE_BINARY_DIR}/man/)
90 set(DOC_PATH "share/man/man1")
91 install(FILES ${CMAKE_SOURCE_DIR}/man/gpivtools.1
92 DESTINATION ${DOC_PATH}
95 ## INCLUDE_DIRECTORIES($ENV{HOME}/include)
98 if (EXISTS ${CMAKE_SOURCE_DIR}/.git)
99 option(USE_GIT_HASH "Show Git hash when -v | --version is used" ON)
103 add_definitions(-DGIT_HASH)
106 message ("No GIT executable is found. GIT_REVISION disabled")
107 git_msg ("No git binary")
112 else (EXISTS ${CMAKE_SOURCE_DIR}/.git)
113 git_msg ("Disabled: no git repo")
114 endif (EXISTS ${CMAKE_SOURCE_DIR}/.git)
116 # Adding other configurations
118 "${PROJECT_SOURCE_DIR}/config.h.in"
119 "${PROJECT_BINARY_DIR}/config.h"
124 "${CMAKE_SOURCE_DIR}/CMake/Modules/cmake_uninstall.cmake.in"
125 "${CMAKE_BINARY_DIR}/cmake_uninstall.cmake"
129 add_custom_target(uninstall
130 "${CMAKE_COMMAND}" -P "${CMAKE_BINARY_DIR}/cmake_uninstall.cmake"
133 add_subdirectory (src)