cleanup autotools and CVS directories
[gpivtools.git] / CMakeLists.txt
blob4d97650cf6899e989dc1241ba3f69f355908e18a
1 cmake_minimum_required(VERSION 2.8.0)
3 project (GPIVTOOLS)
4 set (GPIVTOOLS_VERSION_MAJOR 0)
5 set (GPIVTOOLS_VERSION_MINOR 7)
6 set (GPIVTOOLS_VERSION_PATCH 0)
7 set (GPIVTOOLS_VERSION 
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)
16 # include utilities
17 include(${CMAKE_SOURCE_DIR}/CMake/GpivUtilities.cmake)
19 set( CMAKE_VERBOSE_MAKEFILE on )
21 find_package(Gpiv REQUIRED)
22 IF(NOT GPIV_FOUND)
23 MESSAGE(FATAL_ERROR "Could not find Gpiv library")
24 ENDIF()
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})
39 # Executable-prefix
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 include_directories( ${MPI_INCLUDE_PATH} )
47 set( LIBS ${LIBS} ${MPI_LIBRARY} )
48 option( USE_MPI "Parallel processing on distributed memory systems" OFF )
49 if(USE_MPI)
50   add_definitions(-DENABLE_MPI)
51   find_package( MPI )
52 endif()
54 #  --enable-cam            enable (IEEE-1394) camera
55 option( USE_CAM "Use (IEEE-1394) camera software for image recording" OFF )
56 if(USE_CAM)
57   add_definitions(-DENABLE_CAM)
58 endif()
60 #  --enable-trig           enable (realtime) triggering
61 option( USE_TRIG "Use RTAI software for laser and camera triggering" OFF )
62 if(USE_TRIG)
63   add_definitions(-DENABLE_TRIG)
64 endif()
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 )
73 if(USE_OMP)
74   add_definitions(-DENABLE_OMP)
75 endif()
77 # select debug behaviour and execution
78 option(DEBUG_V "Verbose behaviour for debugging." OFF)
79 if (DEBUG_V)
80   add_definitions(-DDEBUG_V)
81 endif (DEBUG_V)
83 option(DISABLE_EXEC "Reduced execution for debugging." OFF)
84 if (DISABLE_EXEC)
85   add_definitions(-DDISABLE_EXEC)
86 endif (DISABLE_EXEC)
88 # Man pages
89 file(GLOB DOC_FILES man/gpiv_*)
90 set(DOC_PATH "share/man/man1")
91 install(FILES ${DOC_FILES}
92         DESTINATION ${DOC_PATH})
94 ## INCLUDE_DIRECTORIES($ENV{HOME}/include)
96 # Adding git hash
97 if (EXISTS ${CMAKE_SOURCE_DIR}/.git)
98   option(USE_GIT_HASH "Show Git hash when -v | --version is used" ON)
99   if (USE_GIT_HASH)
100     find_package(Git)
101     if (GIT_FOUND)
102       add_definitions(-DGIT_HASH)
103       git_hash ()
104     else (GIT_FOUND)
105       message ("No GIT executable is found. GIT_REVISION disabled")
106       git_msg ("No git binary")
107     endif (GIT_FOUND)
108   else (USE_GIT_HASH)
109     git_msg (Disabled)
110   endif (USE_GIT_HASH)
111 else (EXISTS ${CMAKE_SOURCE_DIR}/.git)
112   git_msg ("Disabled: no git repo")
113 endif (EXISTS ${CMAKE_SOURCE_DIR}/.git)
115 # Adding other configurations
116 configure_file (
117   "${PROJECT_SOURCE_DIR}/config.h.in"
118   "${PROJECT_BINARY_DIR}/config.h"
119   )
121 # uninstall target
122 configure_file(
123   "${CMAKE_SOURCE_DIR}/CMake/Modules/cmake_uninstall.cmake.in"
124   "${CMAKE_BINARY_DIR}/cmake_uninstall.cmake"
125   @ONLY
126   )
128 add_custom_target(uninstall
129   "${CMAKE_COMMAND}" -P "${CMAKE_BINARY_DIR}/cmake_uninstall.cmake"
130   )
132 add_subdirectory (src)