]> Creatis software - crea.git/blobdiff - cmake/CREAMacro_AddLibrary.cmake
Fixed important bug in CREA_ADD_LIBRARY macro
[crea.git] / cmake / CREAMacro_AddLibrary.cmake
index ef2fc17777d769c6607253385762101db402c0b2..f4aea4dcbd1f7528fd78a449aa83f01697d52ab5 100644 (file)
@@ -1,5 +1,5 @@
 # Creates and installs a library
-# Uses CREA_MANAGE_SHARED_LIBRARY and CREA_INSTALL_LIBRARY
+# Uses CREA_DYNAMIC_LIBRARY_EXPORT and CREA_INSTALL_LIBRARY
 # hence the variables to be set for these are needed 
 # Additionnaly one needs to set :
 # ${LIBRARY_NAME}_HEADERS : the list of headers to install
@@ -8,15 +8,17 @@
 MACRO(CREA_ADD_LIBRARY LIBRARY_NAME)
 
   IF(CREA_VERBOSE_CMAKE)
-    MESSAGE(STATUS "** Creating library ${LIBRARY_NAME}")
+    MESSAGE(STATUS "===============================================")
+    MESSAGE(STATUS "Configuring library ${LIBRARY_NAME}")
     MESSAGE(STATUS "   Headers  : ${${LIBRARY_NAME}_HEADERS}")
     MESSAGE(STATUS "   Sources  : ${${LIBRARY_NAME}_SOURCES}")
     MESSAGE(STATUS "   Link libs: ${${LIBRARY_NAME}_LINK_LIBRARIES}")
+    MESSAGE(STATUS "===============================================")
   ENDIF(CREA_VERBOSE_CMAKE)
 
 
   # MANAGE SHARED LIB
-  CREA_MANAGE_SHARED_LIBRARY(${LIBRARY_NAME})
+  CREA_DYNAMIC_LIBRARY_EXPORT_OPTION(${LIBRARY_NAME})
 
   # CREATE THE TARGET
   ADD_LIBRARY(${LIBRARY_NAME} ${${LIBRARY_NAME}_SHARED} ${${LIBRARY_NAME}_SOURCES})
@@ -32,11 +34,16 @@ MACRO(CREA_ADD_LIBRARY LIBRARY_NAME)
     FILES ${${LIBRARY_NAME}_HEADERS}
     DESTINATION ${${LIBRARY_NAME}_INSTALL_TREE_RELATIVE_INCLUDE_PATHS}
     )  
-       
+
+IF(WIN32)      
   INSTALL(
     TARGETS ${LIBRARY_NAME}
     DESTINATION bin)
-
+ELSE(WIN32)
+  INSTALL(
+    TARGETS ${LIBRARY_NAME}
+    DESTINATION lib)
+ENDIF(WIN32)
 
 ENDMACRO(CREA_ADD_LIBRARY)