fixed: auto_ptr -> unique_ptr
[opensg.git] / Support / expat / CMakeLists.txt
blob6a3de71ccd1d9b4bf847a6c5b4588230dabfcfe1
1 CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
3 IF(OSGExpatSrcDir)
5   MESSAGE(STATUS "adding expat from : ${OSGExpatSrcDir}")
7   PROJECT(OSGExpat)
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)
25   IF(BUILD_SHARED_LIBS)
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
31                           DEBUG_POSTFIX "D")
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}
49                 CONFIGURATIONS Debug
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)
56   IF(BUILD_STATIC_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
62                           DEBUG_POSTFIX "D")
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}
76                 CONFIGURATIONS Debug
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
87                       GROUP_READ
88                       WORLD_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 "")
94 ELSE(OSGExpatSrcDir)
95   MESSAGE(STATUS "ignoring expat")
97   SET(OSGExpatSrcDir "" CACHE PATH "")
98 ENDIF(OSGExpatSrcDir)