1 #----------------------------------------------------------------------------
2 # USER! : SET THE NAME OF YOUR LIBRARY
3 # (Replace 'MyLib' by your own library name)
5 #############################
6 SET ( LIBRARY_NAME MyLib )
7 #############################
9 #----------------------------------------------------------------------------
11 #----------------------------------------------------------------------------
12 # CREATES A USER OPTION IN CMAKE
13 OPTION ( BUILD_${LIBRARY_NAME} "Build ${LIBRARY_NAME} library ?" ON)
14 #----------------------------------------------------------------------------
16 #----------------------------------------------------------------------------
17 IF ( BUILD_${LIBRARY_NAME} )
18 #----------------------------------------------------------------------------
20 #----------------------------------------------------------------------------
22 #----------------------------------------------------------------------------
24 #----------------------------------------------------------------------------
25 # LIBRARY HEADERS (TO BE INSTALLED)
26 # EITHER LIST ALL .h, *.txx IN CURRENT DIR USING NEXT LINE:
28 FILE(GLOB ${LIBRARY_NAME}_HEADERS "*.h" "*.txx")
30 # OR MANUALLY LIST YOUR HEADERS WITH NEXT COMMAND
31 # SET ( ${LIBRARY_NAME}_HEADERS
34 #----------------------------------------------------------------------------
36 #----------------------------------------------------------------------------
37 # LIBRARY SOURCES (TO BE COMPILED)
38 # EITHER LIST ALL .cxx, *.cpp, *.cc IN CURRENT DIR USING NEXT LINE:
40 FILE(GLOB ${LIBRARY_NAME}_SOURCES *.cxx *.cpp *.cc)
42 # OR MANUALLY LIST YOUR FILES WITH NEXT COMMAND (WITHOUT EXTENSION)
43 # SET ( ${LIBRARY_NAME}_SOURCES
46 #----------------------------------------------------------------------------
48 #----------------------------------------------------------------------------
49 # LIBRARY DEPENDENCIES (LIBRARIES TO LINK WITH)
51 # USER! : Uncomment the Libraries you need
53 SET ( ${LIBRARY_NAME}_LINK_LIBRARIES
55 # ${WXWIDGETS_LIBRARIES}
56 # ${KWWidgets_LIBRARIES}
62 # If this library must link against other libraries
63 # USER! : Add here any extra Library you need
66 #----------------------------------------------------------------------------
68 #----------------------------------------------------------------------------
69 # MACRO WHICH DOES ALL THE JOB : BUILD AND INSTALL
71 # USER! : The default is to create a Dynamic Library.
72 # if you need to create a static library
73 # comment out the following line :
75 CREA_ADD_LIBRARY( ${LIBRARY_NAME} )
77 # and uncomment the 2 lines hereafter:
79 # ADD_LIBRARY(${LIBRARY_NAME} STATIC ${${LIBRARY_NAME}_SOURCES})
80 # TARGET_LINK_LIBRARIES(${LIBRARY_NAME} ${${LIBRARY_NAME}_LINK_LIBRARIES} )
83 #----------------------------------------------------------------------------
85 #---------------------------------------------------------------------------
86 ENDIF ( BUILD_${LIBRARY_NAME} )