| | 199 | |
| | 200 | |
| | 201 | ####################################################################################################### |
| | 202 | # macro for common setup of libraries it expect some variables to be set: |
| | 203 | # either within the local CMakeLists or higher in hierarchy |
| | 204 | # LIB_NAME is the name of the target library |
| | 205 | # TARGET_SRC are the sources of the target |
| | 206 | # TARGET_H are the eventual headers of the target |
| | 207 | # TARGET_LIBRARIES are the libraries to link to that are internal to the project and have d suffix for debug |
| | 208 | # TARGET_EXTERNAL_LIBRARIES are external libraries and are not differentiated with d suffix |
| | 209 | # TARGET_LABEL is the label IDE should show up for targets |
| | 210 | ########################################################################################################## |
| | 211 | |
| | 212 | MACRO(SETUP_LIBRARY LIB_NAME) |
| | 213 | |
| | 214 | SET(TARGET_NAME ${LIB_NAME} ) |
| | 215 | SET(TARGET_TARGETNAME ${LIB_NAME} ) |
| | 216 | |
| | 217 | ADD_LIBRARY(${LIB_NAME} |
| | 218 | ${OPENSCENEGRAPH_USER_DEFINED_DYNAMIC_OR_STATIC} |
| | 219 | ${TARGET_H} |
| | 220 | ${TARGET_SRC} |
| | 221 | ) |
| | 222 | |
| | 223 | IF(TARGET_LABEL) |
| | 224 | SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES PROJECT_LABEL "${TARGET_LABEL}") |
| | 225 | ENDIF(TARGET_LABEL) |
| | 226 | |
| | 227 | IF(TARGET_LIBRARIES) |
| | 228 | LINK_INTERNAL(${LIB_NAME} ${TARGET_LIBRARIES}) |
| | 229 | ENDIF() |
| | 230 | IF(TARGET_EXTERNAL_LIBRARIES) |
| | 231 | LINK_EXTERNAL(${LIB_NAME} ${TARGET_EXTERNAL_LIBRARIES}) |
| | 232 | ENDIF() |
| | 233 | IF(TARGET_LIBRARIES_VARS) |
| | 234 | LINK_WITH_VARIABLES(${LIB_NAME} ${TARGET_LIBRARIES_VARS}) |
| | 235 | ENDIF(TARGET_LIBRARIES_VARS) |
| | 236 | LINK_CORELIB_DEFAULT(${LIB_NAME}) |
| | 237 | |
| | 238 | INCLUDE(ModuleInstall OPTIONAL) |
| | 239 | |
| | 240 | ENDMACRO(SETUP_LIBRARY LIB_NAME) |