-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
84 lines (69 loc) · 2.72 KB
/
CMakeLists.txt
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
# This file is part of adms - http://sourceforge.net/projects/mot-adms.
#
# adms is a code generator for the Verilog-AMS language.
#
# Copyright (C) 2014-2015 Guilherme Brondani Torri <[email protected]>
# 2014 Luther T. Cat <lutherthecat@github>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program 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 General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# skip CMake 3.0 project version management for the moment
if(POLICY CMP0048)
cmake_policy(SET CMP0048 OLD)
endif()
#==================================
PROJECT(ADMS C)
cmake_minimum_required(VERSION 2.8)
# TODO: store version in a sensible place
# e.g. qucs: file(STRINGS "${qucs-project_SOURCE_DIR}/VERSION" QUCS_VERSION)
SET(PACKAGE_NAME "adms")
SET(PACKAGE_VERSION "2.3.7")
SET(PACKAGE_BUGREPORT "[email protected]")
# Default to static libs ( shared needs work, BUG with MinGW).
OPTION ( BUILD_STATIC_LIBS "Build static libraries." ON )
IF ( MINGW )
IF ( BUILD_STATIC_LIBS )
ADD_DEFINITIONS(-Dstaticlink)
ENDIF()
ENDIF()
INCLUDE( CheckIncludeFile )
check_include_file( sys/stat.h HAVE_SYS_STAT_H )
check_include_file( locale.h HAVE_LOCALE_H)
check_include_file( float.h HAVE_FLOAT_H)
check_include_file( unistd.h HAVE_UNISTD_H)
check_include_file( stdlib.h HAVE_STDLIB_H)
check_include_file( string.h HAVE_STRING_H)
INCLUDE( CheckFunctionExists )
CHECK_FUNCTION_EXISTS (putenv HAVE_PUTENV)
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h)
# Perl is used to recreate sources
# * mkelements.pl
# * mktext.pl
# * mkgrammar.pl
# Checking for perl modules requires FindPerlModules.cmake
# Check all required modules at once
SET(CMAKE_MODULE_PATH "${ADMS_SOURCE_DIR}/cmake/modules")
include(FindPerlModules)
find_package(PerlModules COMPONENTS XML::LibXML)
if(NOT PERLMODULES_FOUND)
message(FATAL_ERROR "Not all required perl modules were found on your system")
endif(NOT PERLMODULES_FOUND)
find_package(BISON 2.5)
# handle api.prefix, unused for the moment
IF (${BISON_VERSION} VERSION_LESS "2.6")
SET (BISON_APIPREFIX "-p")
ELSE (${BISON_VERSION} VERSION_LESS "2.6")
SET (BISON_APIPREFIX "-Dapi.prefix=")
ENDIF (${BISON_VERSION} VERSION_LESS "2.6")
find_package(FLEX)
ADD_SUBDIRECTORY(admsXml)