1
#---------------------------------------------------------------------------
3
# Project: OpenWalnut ( http://www.openwalnut.org )
5
# Copyright 2009 OpenWalnut Community, BSV@Uni-Leipzig and CNCF@MPI-CBS
6
# For more information see http:#www.openwalnut.org/copying
8
# This file is part of OpenWalnut.
10
# OpenWalnut is free software: you can redistribute it and/or modify
11
# it under the terms of the GNU Lesser General Public License as published by
12
# the Free Software Foundation, either version 3 of the License, or
13
# (at your option) any later version.
15
# OpenWalnut is distributed in the hope that it will be useful,
16
# but WITHOUT ANY WARRANTY; without even the implied warranty of
17
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
# GNU Lesser General Public License for more details.
20
# You should have received a copy of the GNU Lesser General Public License
21
# along with OpenWalnut. If not, see <http:#www.gnu.org/licenses/>.
23
#---------------------------------------------------------------------------
25
# ---------------------------------------------------------------------------------------------------------------------------------------------------
27
# ---------------------------------------------------------------------------------------------------------------------------------------------------
29
# we use the directory name as module name
30
GET_FILENAME_COMPONENT( MODULE_NAME ${CMAKE_CURRENT_SOURCE_DIR} NAME )
32
# ---------------------------------------------------------------------------------------------------------------------------------------------------
33
# Search own dependencies
34
# ---------------------------------------------------------------------------------------------------------------------------------------------------
36
# 1: FindPackage( LibYouNeed )
37
# 2: INCLUDE_DIRECTORIES( ${LIBYOUNEED_INCLUDE_DIR} )
38
# 3: LINK_DIRECTORIES( ${LIBYOUNEED_LIBRARY_DIRS} )
39
# 4: Add ${LIBYOUNEED_LIBRARY} as _MODULE_DEPENDENCIES parameter to SETUP_MODULE
42
# -----------------------------------------------------------------------------------------------------------------------------------------------
43
# NiftiLib, at least 2.0.0
44
# See http://niftilib.sourceforge.net
46
# we provide the niftilib in ext. If it is found on the system, the system version is used
47
SET( OWExtNiftiIOName "openwalnut_niftiio" )
48
SET( OWExtNiftiZNZName "openwalnut_niftiznz" )
50
FIND_PACKAGE( niftilib QUIET )
52
MESSAGE( STATUS "Using system installed nifitlib." )
53
INCLUDE_DIRECTORIES( ${NIFTILIB_INCLUDE_DIR} )
54
SET( OWExtNiftiIOName ${NIFTILIB_LIBRARY} )
56
IF( EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/ext/nifti/CMakeLists.txt" )
57
MESSAGE( STATUS "Found niftilib in \"${CMAKE_CURRENT_SOURCE_DIR}/ext/nifti\"" )
58
INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_SOURCE_DIR}/ext/nifti )
59
ADD_SUBDIRECTORY( ext/nifti )
61
MESSAGE( FATAL_ERROR "Could not find niftilib." )
65
# -----------------------------------------------------------------------------------------------------------------------------------------------
66
# BioSig, at least 0.84
67
# See http://biosig.sourceforge.net
69
# we provide the biosig in ext. If it is found on the system, the system version is used
70
SET( OWExtBioSigName "openwalnut_biosig" )
72
FIND_PACKAGE( biosig QUIET )
74
MESSAGE( STATUS "Using system installed biosig." )
75
INCLUDE_DIRECTORIES( ${BIOSIG_INCLUDE_DIR} )
76
SET( OWExtBioSigName ${BIOSIG_LIBRARY} )
78
IF( EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/ext/biosig/CMakeLists.txt" )
79
MESSAGE( STATUS "Found biosig in \"${CMAKE_CURRENT_SOURCE_DIR}/ext/biosig\"" )
80
INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_SOURCE_DIR}/ext/biosig )
81
ADD_SUBDIRECTORY( ext/biosig )
83
MESSAGE( FATAL_ERROR "Could not find biosig." )
87
# -----------------------------------------------------------------------------------------------------------------------------------------------
90
SET( OWExtEEPName "openwalnut_eep" )
92
# libcnt needs absolute inclusion somewhere
93
INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_SOURCE_DIR}/ext/libeep )
94
INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_SOURCE_DIR}/ext )
96
# build external libs in ext/
97
ADD_SUBDIRECTORY( ext/libeep) # The needed external libraries
99
# ---------------------------------------------------------------------------------------------------------------------------------------------------
100
# Setup for compilation
101
# ---------------------------------------------------------------------------------------------------------------------------------------------------
103
# Let this function do the job. It sets up tests and copies shaders automatically. It additionally configures the stylecheck mechanism for this
105
SETUP_MODULE( ${MODULE_NAME} # name of the module
106
"${CMAKE_CURRENT_SOURCE_DIR}" # where to find the source ${CMAKE_CURRENT_SOURCE_DIR} is a good idea here mostly
107
"${OWExtBioSigName};${OWExtEEPName};${OWExtNiftiIOName}" # does your module need additional libs to compile?
108
"ext" # do you want to exclude files from stylechecking? (externals for example)