HPCW 3.0
Loading...
Searching...
No Matches
libfyaml.cmake
Go to the documentation of this file.
1# Copyright (c) 2024 David Guibert
2# Copyright (c) 2024 Niclas Schroeter
3# Copyright (c) 2024 Antoine Morvan
4# All rights reserved.
5#
6# SPDX-License-Identifier: Apache-2.0
7
8set_property(GLOBAL PROPERTY libfyaml_can_use_system TRUE)
9set_property(GLOBAL PROPERTY libfyaml_depends)
10
11set(libfyaml_cmake_args "" CACHE STRING "Custom CMake arguments for libfyaml")
12set(libfyaml_build_args "" CACHE STRING "Custom Make arguments for libfyaml")
13
14if(libfyaml_enabled)
15 if(USE_SYSTEM_libfyaml)
16 message(STATUS "libfyaml: enabled (system installed)")
17 find_package(Libfyaml)
18 else()
19 message(STATUS "libfyaml: enabled (internally built)")
20
21 include(GNUInstallDirs)
22 find_package(Python REQUIRED)
23
24 ExternalProject_Data_Add(
25 libfyaml
26 ${libfyaml_revision}
27 CMAKE_ARGS ${cmake_params}
28 -DCMAKE_INSTALL_PREFIX:FILEPATH=<INSTALL_DIR>
29 ${default_cmake_args}
30 ${libfyaml_cmake_args}
31 BUILD_COMMAND ${CMAKE_MAKE_PROGRAM} -j${BUILD_PARALLEL_LEVEL} ${default_build_args} ${libfyaml_build_args}
32 INSTALL_COMMAND ${CMAKE_MAKE_PROGRAM} -j${BUILD_PARALLEL_LEVEL} install
33 )
34
35 ExternalProject_Get_Property(libfyaml INSTALL_DIR)
36 set(LIBFYAML_INCLUDE_DIR "${INSTALL_DIR}/include")
37 set(LIBFYAML_LIB_DIR "${INSTALL_DIR}/${CMAKE_INSTALL_LIBDIR}")
38 endif()
39endif(libfyaml_enabled)