1 CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
5 MESSAGE(STATUS "adding expat from : ${OSGExpatSrcDir}")
9 SET(${PROJECT_NAME}SharedTarget osgexpat)
10 SET(${PROJECT_NAME}StaticTarget libosgexpat)
12 SET(OSG_EXPAT_SRCS ${OSGExpatSrcDir}/lib/xmlparse.c
13 ${OSGExpatSrcDir}/lib/xmlrole.c
14 ${OSGExpatSrcDir}/lib/xmltok.c
15 ${OSGExpatSrcDir}/lib/xmltok_impl.c
16 ${OSGExpatSrcDir}/lib/xmltok_ns.c)
18 SET(OSG_EXPAT_HDR ${OSGExpatSrcDir}/lib/expat.h
19 ${OSGExpatSrcDir}/lib/expat_external.h)
21 INCLUDE_DIRECTORIES(${OSGExpatSrcDir}/lib)
23 SET(OSGEXPAT_DEF COMPILED_FROM_DSP)
26 ADD_LIBRARY(${${PROJECT_NAME}SharedTarget} SHARED ${OSG_EXPAT_SRCS})
28 ADD_DEPENDENCIES(ALL_STANDARD_BUILD ${${PROJECT_NAME}SharedTarget})
30 SET_TARGET_PROPERTIES(${${PROJECT_NAME}SharedTarget} PROPERTIES
33 SET(OSGEXPAT_DEF_SHARED ${OSGEXPAT_DEF};_USRDLL;_WINDLL)
35 SET_TARGET_PROPERTIES(${${PROJECT_NAME}SharedTarget} PROPERTIES
36 COMPILE_DEFINITIONS "${OSGEXPAT_DEF_SHARED}")
38 SET_TARGET_PROPERTIES(${${PROJECT_NAME}SharedTarget} PROPERTIES
39 LINK_FLAGS /DEF:"${OSGExpatSrcDir}/lib/libexpat.def")
42 INSTALL(TARGETS ${${PROJECT_NAME}SharedTarget}
43 CONFIGURATIONS Release
44 RUNTIME DESTINATION bin COMPONENT release_runtimes
45 LIBRARY DESTINATION lib COMPONENT release_libraries
46 ARCHIVE DESTINATION lib COMPONENT release_libraries)
48 INSTALL(TARGETS ${${PROJECT_NAME}SharedTarget}
50 RUNTIME DESTINATION bin COMPONENT debug_runtimes
51 LIBRARY DESTINATION lib COMPONENT debug_libraries
52 ARCHIVE DESTINATION lib COMPONENT debug_libraries)
54 ENDIF(BUILD_SHARED_LIBS)
57 ADD_LIBRARY(${${PROJECT_NAME}StaticTarget} STATIC ${OSG_EXPAT_SRCS})
59 ADD_DEPENDENCIES(ALL_STANDARD_BUILD ${${PROJECT_NAME}StaticTarget})
61 SET_TARGET_PROPERTIES(${${PROJECT_NAME}StaticTarget} PROPERTIES
64 SET(OSGEXPAT_DEF_STATIC ${OSGEXPAT_DEF};_LIB)
66 SET_TARGET_PROPERTIES(${${PROJECT_NAME}StaticTarget} PROPERTIES
67 COMPILE_DEFINITIONS "${OSGEXPAT_DEF_STATIC}")
69 INSTALL(TARGETS ${${PROJECT_NAME}StaticTarget}
70 CONFIGURATIONS Release
71 RUNTIME DESTINATION lib COMPONENT release_libraries
72 LIBRARY DESTINATION lib COMPONENT release_libraries
73 ARCHIVE DESTINATION lib COMPONENT release_libraries)
75 INSTALL(TARGETS ${${PROJECT_NAME}StaticTarget}
77 RUNTIME DESTINATION lib COMPONENT debug_libraries
78 LIBRARY DESTINATION lib COMPONENT debug_libraries
79 ARCHIVE DESTINATION lib COMPONENT debug_libraries)
81 ENDIF(BUILD_STATIC_LIBS)
83 INSTALL(FILES ${OSG_EXPAT_HDR}
84 DESTINATION include${OSG_SUPPORT_INC_SUBDIR}
85 COMPONENT code_headers
86 PERMISSIONS OWNER_WRITE OWNER_READ
90 SET(OSG_EXPAT_INCLUDE_DIR ${OSGExpatSrcDir}/lib CACHE PATH "")
91 SET(OSG_EXPAT_STATIC_LIBRARY ${${PROJECT_NAME}StaticTarget} CACHE STRING "")
92 SET(OSG_EXPAT_SHARED_LIBRARY ${${PROJECT_NAME}SharedTarget} CACHE STRING "")
95 MESSAGE(STATUS "ignoring expat")
97 SET(OSGExpatSrcDir "" CACHE PATH "")