1 # Creates and installs a library
2 # Uses CREA_DYNAMIC_LIBRARY_EXPORT and CREA_INSTALL_LIBRARY
3 # hence the variables to be set for these are needed
4 # Additionnaly one needs to set :
5 # ${LIBRARY_NAME}_HEADERS : the list of headers to install
6 # ${LIBRARY_NAME}_SOURCES : the list of files to compile to build the lib
7 # ${LIBRARY_NAME}_LINK_LIBRARIES : the list of libs to link with
8 MACRO(CREA_ADD_LIBRARY LIBRARY_NAME)
10 IF(CREA_VERBOSE_CMAKE)
11 MESSAGE(STATUS "===============================================")
12 MESSAGE(STATUS "Configuring library ${LIBRARY_NAME}")
13 MESSAGE(STATUS " Headers : ${${LIBRARY_NAME}_HEADERS}")
14 MESSAGE(STATUS " Sources : ${${LIBRARY_NAME}_SOURCES}")
15 MESSAGE(STATUS " Link libs: ${${LIBRARY_NAME}_LINK_LIBRARIES}")
16 MESSAGE(STATUS "===============================================")
17 ENDIF(CREA_VERBOSE_CMAKE)
21 CREA_DYNAMIC_LIBRARY_EXPORT_OPTION(${LIBRARY_NAME})
24 ADD_LIBRARY(${LIBRARY_NAME} ${${LIBRARY_NAME}_SHARED} ${${LIBRARY_NAME}_SOURCES})
27 TARGET_LINK_LIBRARIES(${LIBRARY_NAME} ${${LIBRARY_NAME}_LINK_LIBRARIES})
29 # INSTALLS LIBRARY FOR CMAKE
30 CREA_INSTALL_LIBRARY_FOR_CMAKE(${LIBRARY_NAME})
34 FILES ${${LIBRARY_NAME}_HEADERS}
35 DESTINATION ${${LIBRARY_NAME}_INSTALL_TREE_RELATIVE_INCLUDE_PATHS}
40 TARGETS ${LIBRARY_NAME}
44 TARGETS ${LIBRARY_NAME}
45 DESTINATION ${CMAKE_CREA_LIB_PATH} )
50 add_definitions(-fPIC)
54 ENDMACRO(CREA_ADD_LIBRARY)