1 # Manages the shared library creation/use
2 # * Creates an option ${LIBRARY_NAME}_BUILD_SHARED
3 # * Generates the file ${LIBRARY_NAME}_EXPORT.h which
4 # defines the symbols ${LIBRARY_NAME}_EXPORT and ${LIBRARY_NAME}_CDECL
5 # to be used in exported classes/functions declarations
6 MACRO(CREA_DYNAMIC_LIBRARY_EXPORT_OPTION LIBRARY_NAME)
8 # STATIC OR DYNAMIC (SHARED) ?
9 OPTION( ${LIBRARY_NAME}_BUILD_SHARED
10 "Build ${LIBRARY_NAME} as a shared library (dynamic) ?" ON)
11 IF (${LIBRARY_NAME}_BUILD_SHARED)
12 SET(${LIBRARY_NAME}_SHARED SHARED)
13 CREA_DEFINE(${LIBRARY_NAME}_BUILD_SHARED)
14 ENDIF(${LIBRARY_NAME}_BUILD_SHARED)
16 CREA_DEFINE(${LIBRARY_NAME}_EXPORT_SYMBOLS)
18 # ADDS CURRENT BINARY DIR TO INCLUDE DIRS
19 INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR})
21 # CONFIGURES ${LIBRARY_NAME}_EXPORT.h
23 ${CREA_CMAKE_DIR}/LIBRARY_NAME_EXPORT.h.in
24 ${CMAKE_CURRENT_BINARY_DIR}/${LIBRARY_NAME}_EXPORT.h
27 # ADDS IT TO THE LIST OF HEADERS
28 SET(${LIBRARY_NAME}_HEADERS
29 ${${LIBRARY_NAME}_HEADERS}
30 ${CMAKE_CURRENT_BINARY_DIR}/${LIBRARY_NAME}_EXPORT.h
34 ENDMACRO(CREA_DYNAMIC_LIBRARY_EXPORT_OPTION LIBRARY_NAME)
37 # Manages the shared library creation/use
38 # * Generates the file ${LIBRARY_NAME}_EXPORT.h which
39 # defines the symbols ${LIBRARY_NAME}_EXPORT and ${LIBRARY_NAME}_CDECL
40 # to be used in exported classes/functions declarations
41 MACRO(CREA_DYNAMIC_LIBRARY_EXPORT LIBRARY_NAME)
43 CREA_DEFINE(${LIBRARY_NAME}_BUILD_SHARED)
44 CREA_DEFINE(${LIBRARY_NAME}_EXPORT_SYMBOLS)
46 # ADDS CURRENT BINARY DIR TO INCLUDE DIRS
47 INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR})
49 # CONFIGURES ${LIBRARY_NAME}_EXPORT.h
50 SET(LIBRARY_NAME ${LIBRARY_NAME})
52 ${CREA_CMAKE_DIR}/LIBRARY_NAME_EXPORT.h.in
53 ${CMAKE_CURRENT_BINARY_DIR}/${LIBRARY_NAME}_EXPORT.h
56 # ADDS IT TO THE LIST OF HEADERS
57 SET(${LIBRARY_NAME}_HEADERS
58 ${${LIBRARY_NAME}_HEADERS}
59 ${CMAKE_CURRENT_BINARY_DIR}/${LIBRARY_NAME}_EXPORT.h
62 ENDMACRO(CREA_DYNAMIC_LIBRARY_EXPORT LIBRARY_NAME)