1 # Manages the shared library creation/use
2 # * Creates an option ${LIBRARY_NAME}_BUILD_SHARED
3 # * Generates the file ${LIBRARY_NAME}DLLImportExport.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_MANAGE_SHARED_LIBRARY LIBRARY_NAME)
8 # STATIC OR DYNAMIC (SHARED) ?
9 OPTION( ${LIBRARY_NAME}_BUILD_SHARED
10 #JPR 8 Avr 2011 ON-> OFF, to avoid troubles with unaware users
11 "Build ${LIBRARY_NAME} as a shared library (dynamic) ?" OFF)
12 IF (${LIBRARY_NAME}_BUILD_SHARED)
13 SET(${LIBRARY_NAME}_SHARED SHARED)
14 CREA_DEFINE(${LIBRARY_NAME}_BUILD_SHARED)
15 ENDIF(${LIBRARY_NAME}_BUILD_SHARED)
17 CREA_DEFINE(${LIBRARY_NAME}_EXPORT_SYMBOLS)
19 # ADDS CURRENT BINARY DIR TO INCLUDE DIRS
20 INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR})
22 # CONFIGURES ${LIBRARY_NAME}DLLImportExport.h
24 ${CREA_CMAKE_DIR}/LIBRARY_NAMEDLLImportExport.h.in
25 ${CMAKE_CURRENT_BINARY_DIR}/${LIBRARY_NAME}DLLImportExport.h
28 # ADDS IT TO THE LIST OF HEADERS
29 SET(${LIBRARY_NAME}_HEADERS
30 ${${LIBRARY_NAME}_HEADERS}
31 ${CMAKE_CURRENT_BINARY_DIR}/${LIBRARY_NAME}DLLImportExport.h
35 ENDMACRO(CREA_MANAGE_SHARED_LIBRARY LIBRARY_NAME)