1 # ---------------------------------------------------------------------
3 # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
5 # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
7 # This software is governed by the CeCILL-B license under French law and
8 # abiding by the rules of distribution of free software. You can use,
9 # modify and/ or redistribute the software under the terms of the CeCILL-B
10 # license as circulated by CEA, CNRS and INRIA at the following URL
11 # http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
12 # or in the file LICENSE.txt.
14 # As a counterpart to the access to the source code and rights to copy,
15 # modify and redistribute granted by the license, users are provided only
16 # with a limited warranty and the software's author, the holder of the
17 # economic rights, and the successive licensors have only limited
20 # The fact that you are presently reading this means that you have had
21 # knowledge of the CeCILL-B license and that you accept its terms.
22 # ------------------------------------------------------------------------ */
25 # Creates and installs a library
26 # Uses CREA_DYNAMIC_LIBRARY_EXPORT and CREA_INSTALL_LIBRARY
27 # hence the variables to be set for these are needed
28 # Additionnaly one needs to set :
29 # ${LIBRARY_NAME}_HEADERS : the list of headers to install
30 # ${LIBRARY_NAME}_SOURCES : the list of files to compile to build the lib
31 # ${LIBRARY_NAME}_LINK_LIBRARIES : the list of libs to link with
32 MACRO(CREA_ADD_LIBRARY LIBRARY_NAME)
34 IF(CREA_VERBOSE_CMAKE)
35 MESSAGE(STATUS "===============================================")
36 MESSAGE(STATUS "Configuring library ${LIBRARY_NAME}")
37 MESSAGE(STATUS " Headers : ${${LIBRARY_NAME}_HEADERS}")
38 MESSAGE(STATUS " Sources : ${${LIBRARY_NAME}_SOURCES}")
39 MESSAGE(STATUS " Link libs: ${${LIBRARY_NAME}_LINK_LIBRARIES}")
40 MESSAGE(STATUS "===============================================")
41 ENDIF(CREA_VERBOSE_CMAKE)
45 CREA_DYNAMIC_LIBRARY_EXPORT_OPTION(${LIBRARY_NAME})
48 ADD_LIBRARY(${LIBRARY_NAME} ${${LIBRARY_NAME}_SHARED} ${${LIBRARY_NAME}_SOURCES})
51 TARGET_LINK_LIBRARIES(${LIBRARY_NAME} ${${LIBRARY_NAME}_LINK_LIBRARIES})
53 # INSTALLS LIBRARY FOR CMAKE
54 CREA_INSTALL_LIBRARY_FOR_CMAKE(${LIBRARY_NAME})
58 FILES ${${LIBRARY_NAME}_HEADERS}
59 DESTINATION ${${LIBRARY_NAME}_INSTALL_TREE_RELATIVE_INCLUDE_PATHS}
64 TARGETS ${LIBRARY_NAME}
68 TARGETS ${LIBRARY_NAME}
69 DESTINATION ${CMAKE_CREA_LIB_PATH} )
74 add_definitions(-fPIC)
78 ENDMACRO(CREA_ADD_LIBRARY)