External mXML project library inclusion
[apps/agl-service-unicens.git] / 3rdparty / CMakeLists.txt
1 ###########################################################################
2 # Copyright 2015, 2016, 2017 IoT.bzh
3 #
4 # author: Fulup Ar Foll <fulup@iot.bzh>
5 #
6 # Licensed under the Apache License, Version 2.0 (the "License");
7 # you may not use this file except in compliance with the License.
8 # You may obtain a copy of the License at
9 #
10 #     http://www.apache.org/licenses/LICENSE-2.0
11 #
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS,
14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 # See the License for the specific language governing permissions and
16 # limitations under the License.
17 ###########################################################################
18
19 set(MXML external-mxml)
20 set(MXML_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/mxml)
21 include(${CMAKE_ROOT}/Modules/ExternalProject.cmake)
22 ExternalProject_Add(${MXML}
23     GIT_REPOSITORY https://github.com/michaelrsweet/mxml.git
24     GIT_TAG release-2.10
25     SOURCE_DIR ${MXML_SOURCE_DIR}
26     CONFIGURE_COMMAND ./configure --build x86_64 --host aarch64
27     BUILD_COMMAND make libmxml.so.1.5
28     BUILD_IN_SOURCE 1
29     INSTALL_COMMAND ""
30 )
31
32 PROJECT_TARGET_ADD(mxml)
33
34 add_library(${TARGET_NAME} SHARED IMPORTED GLOBAL)
35
36 SET_TARGET_PROPERTIES(${TARGET_NAME} PROPERTIES
37     LABELS LIBRARY
38     IMPORTED_LOCATION ${MXML_SOURCE_DIR}/libmxml.so.1
39     INTERFACE_INCLUDE_DIRECTORIES ${MXML_SOURCE_DIR}
40 )
41
42 add_dependencies(${TARGET_NAME} ${MXML})