CMakeLists.txt 4.63 KB
Newer Older
1 2 3 4 5 6 7 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 38 39 40 41 42 43 44 45
#---------------------------------------------------------------------------
#
# Project: OpenWalnut ( http://www.openwalnut.org )
#
# Copyright 2009 OpenWalnut Community, BSV@Uni-Leipzig and CNCF@MPI-CBS
# For more information see http:#www.openwalnut.org/copying
#
# This file is part of OpenWalnut.
#
# OpenWalnut is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# OpenWalnut is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with OpenWalnut. If not, see <http:#www.gnu.org/licenses/>.
#
#---------------------------------------------------------------------------

# ---------------------------------------------------------------------------------------------------------------------------------------------------
# Some common setup
# ---------------------------------------------------------------------------------------------------------------------------------------------------

# we use the directory name as module name
GET_FILENAME_COMPONENT( MODULE_NAME ${CMAKE_CURRENT_SOURCE_DIR} NAME )

# ---------------------------------------------------------------------------------------------------------------------------------------------------
# Search own dependencies
# ---------------------------------------------------------------------------------------------------------------------------------------------------

# 1: FindPackage( LibYouNeed )
# 2: INCLUDE_DIRECTORIES( ${LIBYOUNEED_INCLUDE_DIR} )
# 3: LINK_DIRECTORIES( ${LIBYOUNEED_LIBRARY_DIRS} )
# 4: Add ${LIBYOUNEED_LIBRARY} as _MODULE_DEPENDENCIES parameter to SETUP_MODULE


# -----------------------------------------------------------------------------------------------------------------------------------------------
# NiftiLib, at least 2.0.0
# See  http://niftilib.sourceforge.net

46 47
# If it is found on the system, the system version is used
SET( OWExtNiftiIOName  "" )
48
SET( OWExtNiftiZNZName "" )
49 50

FIND_PACKAGE( niftilib REQUIRED )
51 52

IF( NIFTILIB_FOUND )
53 54 55
   MESSAGE( STATUS "Using system installed nifitlib." )
   INCLUDE_DIRECTORIES( ${NIFTILIB_INCLUDE_DIR} )
   SET( OWExtNiftiIOName  ${NIFTILIB_LIBRARY} )
56
   SET( OWExtNiftiZNZName  ${NIFTIZNZ_LIBRARY} )
57
   SET( OWExtZLibName  ${ZLIB_LIBRARY} )
58 59 60 61 62 63
ENDIF()

# -----------------------------------------------------------------------------------------------------------------------------------------------
# BioSig, at least 0.84
# See http://biosig.sourceforge.net

64 65
# If it is found on the system, the system version is used
SET( OWExtBioSigName "" )
66 67 68

FIND_PACKAGE( biosig QUIET )
IF( BIOSIG_FOUND )
69 70 71
   MESSAGE( STATUS "Using system installed biosig." )
   INCLUDE_DIRECTORIES( ${BIOSIG_INCLUDE_DIR} )
   SET( OWExtBioSigName  ${BIOSIG_LIBRARY} )
72
   ADD_DEFINITIONS( "-DWBIOSIG_ENABLED" )
73 74 75 76 77
ENDIF()

# -----------------------------------------------------------------------------------------------------------------------------------------------
# other external libs

78 79 80
SET( OWExtEEPName "" )
IF( NOT OW_FIX_EEP_WINDOWS_ERROR )
    ADD_DEFINITIONS( "-DWEEP_ENABLED" )
81

82
    SET( OWExtEEPName    "openwalnut_eep" )
83

84 85 86 87 88 89 90
    # libcnt needs absolute inclusion somewhere
    INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_SOURCE_DIR}/ext/libeep )
    INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_SOURCE_DIR}/ext )

    # build external libs in ext/
    ADD_SUBDIRECTORY( ext/libeep ) # The needed external libraries
ENDIF()
91 92 93 94 95 96 97 98 99

# ---------------------------------------------------------------------------------------------------------------------------------------------------
# Setup for compilation
# ---------------------------------------------------------------------------------------------------------------------------------------------------

# Let this function do the job. It sets up tests and copies shaders automatically. It additionally configures the stylecheck mechanism for this
# module.
SETUP_MODULE( ${MODULE_NAME}                # name of the module
             "${CMAKE_CURRENT_SOURCE_DIR}"  # where to find the source ${CMAKE_CURRENT_SOURCE_DIR} is a good idea here mostly
100
             "${OWExtBioSigName};${OWExtEEPName};${OWExtNiftiIOName};${OWExtNiftiZNZName};${OWExtZLibName}" # does your module need additional libs to compile?
101 102 103
             "ext"                             # do you want to exclude files from stylechecking? (externals for example)
)