1 # ---------------------------------------------------------------------
3 # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
5 # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
6 # Previous Authors : Laurent Guigues, Jean-Pierre Roux
7 # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
9 # This software is governed by the CeCILL-B license under French law and
10 # abiding by the rules of distribution of free software. You can use,
11 # modify and/ or redistribute the software under the terms of the CeCILL-B
12 # license as circulated by CEA, CNRS and INRIA at the following URL
13 # http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
14 # or in the file LICENSE.txt.
16 # As a counterpart to the access to the source code and rights to copy,
17 # modify and redistribute granted by the license, users are provided only
18 # with a limited warranty and the software's author, the holder of the
19 # economic rights, and the successive licensors have only limited
22 # The fact that you are presently reading this means that you have had
23 # knowledge of the CeCILL-B license and that you accept its terms.
24 # ------------------------------------------------------------------------ */
27 # Creates and installs a library
28 # Uses CREA_DYNAMIC_LIBRARY_EXPORT and CREA_INSTALL_LIBRARY
29 # hence the variables to be set for these are needed
30 # Additionnaly one needs to set :
31 # ${LIBRARY_NAME}_HEADERS : the list of headers to install
32 # ${LIBRARY_NAME}_SOURCES : the list of files to compile to build the lib
33 # ${LIBRARY_NAME}_LINK_LIBRARIES : the list of libs to link with
34 MACRO(CREA_ADD_LIBRARY LIBRARY_NAME)
36 IF(CREA_VERBOSE_CMAKE)
37 MESSAGE(STATUS "===============================================")
38 MESSAGE(STATUS "Configuring library ${LIBRARY_NAME}")
39 MESSAGE(STATUS " Headers : ${${LIBRARY_NAME}_HEADERS}")
40 MESSAGE(STATUS " Sources : ${${LIBRARY_NAME}_SOURCES}")
41 MESSAGE(STATUS " Link libs: ${${LIBRARY_NAME}_LINK_LIBRARIES}")
42 MESSAGE(STATUS "===============================================")
43 ENDIF(CREA_VERBOSE_CMAKE)
47 CREA_DYNAMIC_LIBRARY_EXPORT_OPTION(${LIBRARY_NAME})
50 ADD_LIBRARY(${LIBRARY_NAME} ${${LIBRARY_NAME}_SHARED} ${${LIBRARY_NAME}_SOURCES})
53 TARGET_LINK_LIBRARIES(${LIBRARY_NAME} ${${LIBRARY_NAME}_LINK_LIBRARIES})
55 # INSTALLS LIBRARY FOR CMAKE
56 CREA_INSTALL_LIBRARY_FOR_CMAKE(${LIBRARY_NAME})
60 FILES ${${LIBRARY_NAME}_HEADERS}
61 DESTINATION ${${LIBRARY_NAME}_INSTALL_TREE_RELATIVE_INCLUDE_PATHS}
66 TARGETS ${LIBRARY_NAME}
70 TARGETS ${LIBRARY_NAME}
71 DESTINATION ${CMAKE_CREA_LIB_PATH} )
76 add_definitions(-fPIC)
80 ENDMACRO(CREA_ADD_LIBRARY)