-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
78 lines (62 loc) · 2.54 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
cmake_minimum_required(VERSION 3.14)
# HACK: For cross-compilation to work
set(CMAKE_TRY_COMPILE_TARGET_TYPE "STATIC_LIBRARY")
project(xsd_embedded)
if (EXISTS ${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
set(CONAN_SYSTEM_INCLUDES ON)
conan_basic_setup()
else()
message(WARNING "conanfileinfo.cmake not found, please run `conan install`.")
endif()
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
##############################################################################
# xsdbin
##############################################################################
add_executable(xsdbin xsdbin.cxx)
target_include_directories(xsdbin PUBLIC include include)
target_link_libraries(xsdbin ${CONAN_LIBS})
# #
# # Make xsdbin if not already built
# #
# if (NOT EXISTS ${CMAKE_BINARY_DIR}/bin/xsdbin)
# execute_process(COMMAND echo ${CMAKE_BINARY_DIR}/bin/xsdbin)
# endif()
# #
# # Generate XSD binary representation
# #
# if (EXISTS ${CMAKE_BINARY_DIR}/bin/xsdbin)
# execute_process(COMMAND ${CMAKE_BINARY_DIR}/bin/xsdbin --output-dir ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/library.xsd)
# execute_process(COMMAND mv ${CMAKE_SOURCE_DIR}/include/library-schema.cxx ${CMAKE_SOURCE_DIR}/src)
# endif()
# #
# # Generate parser classes
# #
# if (DEFINED CONAN_XSD_ROOT)
# execute_process(COMMAND ${CONAN_XSD_ROOT}/bin/xsd cxx-tree --output-dir ${CMAKE_SOURCE_DIR}/include --include-prefix include/ ${CMAKE_SOURCE_DIR}/library.xsd)
# execute_process(COMMAND mv ${CMAKE_SOURCE_DIR}/include/library.cxx ${CMAKE_SOURCE_DIR}/src)
# endif()
##############################################################################
# driver
##############################################################################
add_executable(driver driver.cxx)
add_library(driver_lib STATIC
include/grammar-input-stream.hxx
include/library-schema.hxx
include/library-schema-32.hxx
include/library-schema-64.hxx
include/library.hxx
include/custom-error-handler.hxx
include/custom-dom-LS-parser-impl.hxx
src/grammar-input-stream.cxx
src/library-schema-32.cxx
src/library-schema-64.cxx
src/library.cxx
src/custom-error-handler.cxx
src/custom-dom-LS-parser-impl.cxx
)
target_include_directories(driver_lib PUBLIC include include)
target_link_libraries(driver_lib ${CONAN_LIBS})
target_link_libraries(driver driver_lib ${CONAN_LIBS})
install(TARGETS driver driver_lib)
install(DIRECTORY "./" DESTINATION .)