mirror of https://github.com/Icinga/icinga2.git
47 lines
1.9 KiB
CMake
47 lines
1.9 KiB
CMake
# Copyright (c) 2007-2014, Lloyd Hilaiel <me@lloyd.io>
|
|
#
|
|
# Permission to use, copy, modify, and/or distribute this software for any
|
|
# purpose with or without fee is hereby granted, provided that the above
|
|
# copyright notice and this permission notice appear in all copies.
|
|
#
|
|
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
|
|
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
|
|
|
|
PROJECT(YetAnotherJSONParser C)
|
|
|
|
SET (YAJL_MAJOR 2)
|
|
SET (YAJL_MINOR 1)
|
|
SET (YAJL_MICRO 0)
|
|
|
|
IF (WIN32)
|
|
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W4")
|
|
ADD_DEFINITIONS(-DWIN32)
|
|
|
|
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /wd4996 /wd4255 /wd4130 /wd4100 /wd4711")
|
|
SET(CMAKE_C_FLAGS_DEBUG "/D DEBUG /Od /Z7")
|
|
SET(CMAKE_C_FLAGS_RELEASE "/D NDEBUG /O2")
|
|
ELSE (WIN32)
|
|
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall")
|
|
IF(CMAKE_COMPILER_IS_GNUCC)
|
|
INCLUDE(CheckCCompilerFlag)
|
|
CHECK_C_COMPILER_FLAG(-fvisibility=hidden HAVE_GCC_VISIBILITY)
|
|
IF(HAVE_GCC_VISIBILITY)
|
|
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility=hidden")
|
|
ENDIF(HAVE_GCC_VISIBILITY)
|
|
ENDIF(CMAKE_COMPILER_IS_GNUCC)
|
|
SET(CMAKE_C_FLAGS
|
|
"${CMAKE_C_FLAGS} -std=c99 -pedantic -Wpointer-arith -Wno-format-y2k -Wstrict-prototypes -Wmissing-declarations -Wnested-externs -Wextra -Wundef -Wwrite-strings -Wold-style-definition -Wredundant-decls -Wno-unused-parameter -Wno-sign-compare -Wmissing-prototypes")
|
|
|
|
SET(CMAKE_C_FLAGS_DEBUG "-DDEBUG")
|
|
SET(CMAKE_C_FLAGS_RELEASE "-DNDEBUG -Wuninitialized")
|
|
ENDIF (WIN32)
|
|
|
|
ADD_SUBDIRECTORY(src)
|