MINIFI-34 Establishing CMake build system to provide build functionality equivalent...
[nifi-minifi-cpp.git] / libminifi / CMakeLists.txt
1 # Licensed to the Apache Software Foundation (ASF) under one
2 #
3 # or more contributor license agreements.  See the NOTICE file
4 # distributed with this work for additional information
5 # regarding copyright ownership.  The ASF licenses this file
6 # to you under the Apache License, Version 2.0 (the
7 # "License"); you may not use this file except in compliance
8 # with the License.  You may obtain a copy of the License at
9 #
10 #   http://www.apache.org/licenses/LICENSE-2.0
11 #
12 # Unless qrequired by applicable law or agreed to in writing,
13 # software distributed under the License is distributed on an
14 # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 # KIND, either express or implied.  See the License for the
16 # specific language governing permissions and limitations
17 # under the License.
18 #
19
20 cmake_minimum_required (VERSION 2.6)
21
22 set(PROJECT "apache-nifi-minifi-cpp")
23 set(VERSION "0.1.0")
24
25 #### Establish Project Configuration ####
26 # Enable usage of the VERSION specifier
27 # https://cmake.org/cmake/help/v3.0/policy/CMP0048.html#policy:CMP0048
28 cmake_policy(SET CMP0048 NEW)
29
30 project(${PROJECT}
31         VERSION ${VERSION})
32
33 set(CMAKE_CXX_STANDARD 11)
34 set(CMAKE_CXX_STANDARD_REQUIRED ON)
35
36 include_directories(../include)
37 include_directories(include)
38
39 file(GLOB SOURCES "src/*.cpp")
40
41 add_library(spdlog INTERFACE)
42 add_library(minifi STATIC ${SOURCES})
43
44 # Include libxml2
45 find_package (LibXml2)
46 if (LIBXML2_FOUND)
47     include_directories(${LIBXML2_INCLUDE_DIR})
48     target_link_libraries (minifi ${LIBXML2_LIBRARIES})
49 else ()
50     # Build from our local version
51 endif (LIBXML2_FOUND)