-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathXerces-C_Import.cmake
executable file
·52 lines (44 loc) · 1.87 KB
/
Xerces-C_Import.cmake
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
set (XERCESC_BASE "${CMAKE_CURRENT_LIST_DIR}/external/Xerces-C")
if(WIN32)
if(MSVC80)
set(XERCES_C_MSVCVER VC8)
elseif(MSVC90)
set(XERCES_C_MSVCVER VC9)
elseif(MSVC10)
set(XERCES_C_MSVCVER VC10)
endif()
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(XERCES_C_X64_SUFFIX X64)
endif()
set(XERCESC_BIN_BASE ${XERCESC_BASE}/bin/${XERCES_C_MSVCVER})
set(XERCESC_LIB_BASE ${XERCESC_BASE}/lib/${XERCES_C_MSVCVER})
add_library(xerces-c-hd SHARED IMPORTED)
set_target_properties(
xerces-c-hd PROPERTIES
IMPORTED_LOCATION_DEBUG ${XERCESC_BIN_BASE}/Debug${XERCES_C_X64_SUFFIX}/xerces-c_3_1D.dll
IMPORTED_LOCATION_RELEASE ${XERCESC_BIN_BASE}/Release${XERCES_C_X64_SUFFIX}/xerces-c_3_1.dll
IMPORTED_IMPLIB_DEBUG ${XERCESC_LIB_BASE}/Debug${XERCES_C_X64_SUFFIX}/xerces-c_3D.lib
IMPORTED_IMPLIB_RELEASE ${XERCESC_LIB_BASE}/Release${XERCES_C_X64_SUFFIX}/xerces-c_3.lib
)
install(FILES ${XERCESC_BIN_BASE}/Debug${XERCES_C_X64_SUFFIX}/xerces-c_3_1D.dll CONFIGURATIONS Debug DESTINATION ${RUNTIME_DESTINATION})
install(FILES ${XERCESC_BIN_BASE}/Release${XERCES_C_X64_SUFFIX}/xerces-c_3_1.dll CONFIGURATIONS Release DESTINATION ${RUNTIME_DESTINATION})
install(FILES ${XERCESC_LIB_BASE}/Debug${XERCES_C_X64_SUFFIX}/xerces-c_3D.lib CONFIGURATIONS Debug DESTINATION ${ARCHIVE_DESTINATION})
install(FILES ${XERCESC_LIB_BASE}/Release${XERCES_C_X64_SUFFIX}/xerces-c_3.lib CONFIGURATIONS Release DESTINATION ${ARCHIVE_DESTINATION})
else()
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(ARCH x64)
else()
set(ARCH x86)
endif()
if(APPLE)
set(XERCESC_LIB ${XERCESC_BASE}/lib/Mac/${ARCH}/libxerces-c.a)
else()
set(XERCESC_LIB ${XERCESC_BASE}/lib/Linux/${ARCH}/libxerces-c.a)
endif()
add_library(xerces-c STATIC IMPORTED)
set_property(TARGET xerces-c PROPERTY IMPORTED_LOCATION ${XERCESC_LIB})
install(FILES ${XERCESC_LIB} DESTINATION ${LIBRARY_DESTINATION})
endif()
include_directories(
${XERCESC_BASE}/src
)