Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

[a21201]: cmake / FindARTS.cmake Maximize Restore History

Download this file

FindARTS.cmake    154 lines (133 with data), 5.3 kB

  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
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
# - Try to find ARTS
# Once done this will define
#
# ARTS_FOUND - system has ARTS
# ARTS_CFLAGS - Compiler switches required for using ARTS
# ARTS_LDLFAGS- Linker switches required for using ARTS
# ARTSC_INCLUDE_DIR - the ARTS C include directory
# ARTS_INCLUDE_DIR - the ARTS IDL include directory
# KDE3_MCOPIDL_EXECUTABLE - MCOP IDL Preprocessor
#
# based on FindARTS.cmake
# Copyright (c) 2006 Andreas Schneider <mail@cynapses.org>
#
# 2007-05-09
# heavily modified by Thomas Eschenbacher <Thomas.Eschenbacher@gmx.de>
#
# Redistribution and use is allowed according to the terms of the New
# BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
#
OPTION(WITH_ARTS "use aRts for internal streaming [defalt=on]" ON)
IF (WITH_ARTS)
IF (ARTS_CFLAGS AND ARTS_LDLFAGS AND ARTSC_INCLUDE_DIR AND ARTS_INCLUDE_DIR)
# in cache already
SET(ARTS_FOUND TRUE)
ELSE (ARTS_CFLAGS AND ARTS_LDLFAGS AND ARTSC_INCLUDE_DIR AND ARTS_INCLUDE_DIR)
FIND_PROGRAM(ARTSC_CONFIG_EXECUTABLE
NAMES
artsc-config
PATHS
${KDE3_BIN_DIR}
/usr/bin
/usr/local/bin
/opt/kde3/bin
/opt/kde4/bin
/opt/gnome/bin
)
IF (ARTSC_CONFIG_EXECUTABLE)
EXECUTE_PROCESS(
COMMAND
${ARTSC_CONFIG_EXECUTABLE} --arts-prefix
OUTPUT_VARIABLE
ARTS_PREFIX
OUTPUT_STRIP_TRAILING_WHITESPACE
)
EXECUTE_PROCESS(
COMMAND
${ARTSC_CONFIG_EXECUTABLE} --cflags
OUTPUT_VARIABLE
ARTS_CFLAGS
OUTPUT_STRIP_TRAILING_WHITESPACE
)
EXECUTE_PROCESS(
COMMAND
${ARTSC_CONFIG_EXECUTABLE} --libs
OUTPUT_VARIABLE
ARTS_LDLFAGS
OUTPUT_STRIP_TRAILING_WHITESPACE
)
FIND_PROGRAM(KDE3_MCOPIDL_EXECUTABLE
NAMES
mcopidl
PATHS
${ARTS_PREFIX}/bin
${KDE3_BIN_DIR}
/usr/bin
/usr/local/bin
/opt/kde3/bin
/opt/kde4/bin
/opt/gnome/bin
)
MESSAGE(STATUS "Found KDE3 mcopidl preprocessor: ${KDE3_MCOPIDL_EXECUTABLE}")
FIND_PATH(ARTSC_INCLUDE_DIR
NAMES
artsc.h
PATHS
${ARTS_PREFIX}/include
${ARTS_PREFIX}/include/kde
${KDE3_INCLUDE_DIR}
/usr/include
/usr/local/include
/opt/local/include
/opt/kde3/include
/sw/include
PATH_SUFFIXES
artsc
arts
)
MESSAGE(STATUS "Found aRts C include dir: ${ARTSC_INCLUDE_DIR}")
FIND_PATH(ARTS_INCLUDE_DIR
NAMES
artsflow.idl
PATHS
${ARTS_PREFIX}/include
${ARTS_PREFIX}/include/kde
${KDE3_INCLUDE_DIR}
/usr/include
/usr/local/include
/opt/local/include
/opt/kde3/include
/sw/include
PATH_SUFFIXES
artsc
arts
)
MESSAGE(STATUS "Found aRts idl include dir: ${ARTS_INCLUDE_DIR}")
ENDIF (ARTSC_CONFIG_EXECUTABLE)
# abort if not all flags found
IF (ARTS_CFLAGS AND ARTS_LDLFAGS AND ARTSC_INCLUDE_DIR AND ARTS_INCLUDE_DIR)
SET(ARTS_FOUND TRUE)
ELSE (ARTS_CFLAGS AND ARTS_LDLFAGS AND ARTSC_INCLUDE_DIR AND ARTS_INCLUDE_DIR)
MESSAGE(FATAL_ERROR "Could not find ARTS")
ENDIF (ARTS_CFLAGS AND ARTS_LDLFAGS AND ARTSC_INCLUDE_DIR AND ARTS_INCLUDE_DIR)
# abort if mcopidl was not found
IF (KDE3_MCOPIDL_EXECUTABLE)
SET(KDE3_MCOPIDL_EXECUTABLE_FOUND TRUE)
ELSE (KDE3_MCOPIDL_EXECUTABLE)
MESSAGE(FATAL_ERROR "Could not find mcopidl preprocessor")
ENDIF (KDE3_MCOPIDL_EXECUTABLE)
# show the ARTS_CFLAGS and ARTS_LDFLAGS variables only in the advanced view
MARK_AS_ADVANCED(ARTS_CFLAGS ARTS_LDFLAGS)
# append aRts C include directory and C flags
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${ARTS_CFLAGS} -I${ARTS_INCLUDE_DIR}")
# workaround for problems in aRts with non-virtual destructors
STRING(REGEX REPLACE "-Wnon-virtual-dtor" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} )
REMOVE_DEFINITIONS("-Wnon-virtual-dtor")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-non-virtual-dtor")
ENDIF (ARTS_CFLAGS AND ARTS_LDLFAGS AND ARTSC_INCLUDE_DIR AND ARTS_INCLUDE_DIR)
# set the flag for config.h
SET(HAVE_ARTS_SUPPORT true)
ENDIF (WITH_ARTS)
#############################################################################
#############################################################################