c4proj: fix install of incorporated targets

This commit is contained in:
Joao Paulo Magalhaes
2020-01-10 23:18:12 +01:00
parent c6de006936
commit eab9050064
3 changed files with 35 additions and 45 deletions

View File

@@ -20,48 +20,35 @@ set(RYML_SRC_DIR ${CMAKE_CURRENT_LIST_DIR}/src)
set(RYML_EXT_DIR ${CMAKE_CURRENT_LIST_DIR}/extern)
set(RYML_API_DIR ${CMAKE_CURRENT_LIST_DIR}/api)
#-------------------------------------------------------
set(RYML_CPP
c4/yml/common.cpp
c4/yml/parse.cpp
c4/yml/tree.cpp
)
set(RYML_HPP
ryml.hpp
ryml_std.hpp
c4/yml/detail/stack.hpp
c4/yml/detail/parser_dbg.hpp
c4/yml/common.hpp
c4/yml/emit.def.hpp
c4/yml/emit.hpp
c4/yml/node.hpp
c4/yml/parse.hpp
c4/yml/std/map.hpp
c4/yml/std/std.hpp
c4/yml/std/string.hpp
c4/yml/std/vector.hpp
c4/yml/tree.hpp
c4/yml/writer.hpp
c4/yml/yml.hpp
)
set(RYML_FILES
ryml.natvis
)
set(RYML_SRC ${RYML_CPP} ${RYML_HPP} ${RYML_FILES}
SOURCE_ROOT ${RYML_SRC_DIR})
#-------------------------------------------------------
c4_require_subproject(c4core
c4_require_subproject(c4core INCORPORATE
SUBDIRECTORY ${RYML_EXT_DIR}/c4core)
c4_add_library(ryml SANITIZE
SOURCES ${RYML_SRC}
c4_add_library(ryml
SOURCES
ryml.hpp
ryml_std.hpp
c4/yml/detail/stack.hpp
c4/yml/detail/parser_dbg.hpp
c4/yml/common.hpp
c4/yml/common.cpp
c4/yml/emit.def.hpp
c4/yml/emit.hpp
c4/yml/node.hpp
c4/yml/parse.hpp
c4/yml/parse.cpp
c4/yml/std/map.hpp
c4/yml/std/std.hpp
c4/yml/std/string.hpp
c4/yml/std/vector.hpp
c4/yml/tree.hpp
c4/yml/tree.cpp
c4/yml/writer.hpp
c4/yml/yml.hpp
ryml.natvis
SOURCE_ROOT ${RYML_SRC_DIR}
INC_DIRS
$<BUILD_INTERFACE:${RYML_SRC_DIR}>
$<INSTALL_INTERFACE:include>
@@ -119,17 +106,17 @@ endif()
#-------------------------------------------------------
if(RYML_BUILD_TESTS)
enable_testing()
add_subdirectory(test test)
add_subdirectory(test)
endif()
#-------------------------------------------------------
if(RYML_BUILD_BENCHMARKS)
add_subdirectory(bm bm)
add_subdirectory(bm)
endif()
#-------------------------------------------------------
if(RYML_BUILD_API)
add_subdirectory(api api)
add_subdirectory(api)
endif()

View File

@@ -1,7 +1,7 @@
option(RYML_BUILD_API_PYTHON3 "Enable Python3 API" ON)
option(RYML_BUILD_API_PYTHON2 "Enable Python2 API" OFF)
message(STATUS "ryml: enabling API")
c4_log("enabling API")
cmake_policy(PUSH)
cmake_policy(SET CMP0078 NEW) # https://cmake.org/cmake/help/v3.13/policy/CMP0078.html
@@ -11,7 +11,7 @@ find_package(SWIG)
if(NOT SWIG_FOUND)
message(FATAL_ERROR "cannot find swig")
endif()
message(STATUS "found swig ${SWIG_VERSION}: ${SWIG_EXECUTABLE}")
c4_log("found swig ${SWIG_VERSION}: ${SWIG_EXECUTABLE}")
# https://cmake.org/cmake/help/v3.13/module/UseSWIG.html
include(UseSWIG)
@@ -27,6 +27,7 @@ foreach(f ${RYML_SWIG_SRC})
)
endforeach()
function(create_setup_py src dst)
set(opt0arg
)
@@ -44,6 +45,7 @@ function(create_setup_py src dst)
configure_file("${src}" "${dst}" @ONLY)
endfunction()
function(pylist li out)
print_var(li)
set(l)
@@ -53,13 +55,14 @@ function(pylist li out)
set(${out} ${l} PARENT_SCOPE)
endfunction()
if(RYML_BUILD_API_PYTHON3)
message(STATUS "ryml: enabling python3 API")
c4_log("enabling python3 API")
find_package(Python3 COMPONENTS Interpreter Development)
if(NOT Python3_FOUND)
message(FATAL_ERROR "cannot find python3")
endif()
message(STATUS "found python ${Python3_VERSION}: ${Python3_EXECUTABLE}")
c4_log("found python ${Python3_VERSION}: ${Python3_EXECUTABLE}")
#
set(t ryml-api-python3) # the target name
set(g ${CMAKE_CURRENT_BINARY_DIR}/src/python3) # where to put c++ generated srcs

2
extern/c4core vendored