Adding new cmd-line option (daemonListenName) and fixing useDaemon
[baulk.git] / templates / templateCMakeLists.txt
blob34e8638d3853c14e5907432620d4b7f93af7b6c8
1 ###| CMAKE BUILDNAMEHERE |###
3 ###| Project
4 project( BUILDNAMEHERE )
5 cmake_minimum_required( VERSION 2.6 )
6 set( HEAD_DIR ${PROJECT_SOURCE_DIR}/<To Top Dir> )
9 #| Sources
10 set( SRCS
11         SOURCESHERE
14 #| Headers
15 set( HDRS
16         HEADERSHERE
19 #| Executable
20 set( EXEC
21         EXECUTABLENAMEHERE
24 #| Library
25 set( LIB
26         LIBRARYNAMEHERE
30 #| Baulk Common Libraries
31 include_directories(
32         ${HEAD_DIR}/src/Common
36 ###| Misc Qt4
37 add_definitions( -Wall )
38 find_package( Qt4 REQUIRED )
39 include( ${QT_USE_FILE} )
40 QT4_WRAP_CPP( MOC_SRCS ${HDRS} )
43 #| Library Versioning
44 set( cat_prog cat )
45 if( WIN32 )
46         set( cat_prog type )
47 endif( WIN32 )
49 exec_program( ${cat_prog} 
50         ARGS ${HEAD_DIR}/src/Common/VERSION 
51         OUTPUT_VARIABLE VERSION 
53 set( LIBRARY_VERSION
54         "${VERSION}"
58 #| Create the Executable
59 add_executable( ${EXEC} ${SRCS} ${MOC_SRCS} )
61 #| Link Needed Libraries to Executable
62 target_link_libraries( ${EXEC} ${QT_LIBRARIES} )
65 #| Create the Library
66 add_library( ${LIB} SHARED ${SRCS} ${MOC_SRCS} )
67 set( LIBRARY_OUTPUT_PATH
68         ${HEAD_DIR}/bin/BaulkLibs
70 set_target_properties( ${LIB} PROPERTIES VERSION ${LIBRARY_VERSION} )
72 #| Link Needed Libraries to Library
73 target_link_libraries( ${LIB} 
74         ${QT_LIBRARIES} 
75         BaulkWidget     # From Common
78 #| Installation
79 install( TARGETS ${LIB} ${EXEC}
80         DESTINATION <destination ie. lib/BaulkLibs>