Add VERBATIM to all add_custom_target() calls in the CMake build
[centerim5.git] / src / CMakeLists.txt
blob1c6eaa31b928c653752e7983ec9ca36bc54f7562
1 # When you add files here, also add them in po/POTFILES.in.
2 set(centerim5_SOURCES
3   AccountStatusMenu.cpp
4   AccountWindow.cpp
5   Accounts.cpp
6   BuddyList.cpp
7   BuddyListNode.cpp
8   CenterIM.cpp
9   Connections.cpp
10   Conversation.cpp
11   ConversationRoomList.cpp
12   Conversations.cpp
13   Footer.cpp
14   GeneralMenu.cpp
15   Header.cpp
16   Log.cpp
17   Notify.cpp
18   OptionWindow.cpp
19   PluginWindow.cpp
20   Request.cpp
21   Transfers.cpp
22   Utils.cpp
23   git-version.cpp)
25 set(centerim5_HEADERS
26   AccountStatusMenu.h
27   AccountWindow.h
28   Accounts.h
29   BuddyList.h
30   BuddyListNode.h
31   CenterIM.h
32   Connections.h
33   Conversation.h
34   ConversationRoomList.h
35   Conversations.h
36   Footer.h
37   GeneralMenu.h
38   Header.h
39   Log.h
40   Notify.h
41   OptionWindow.h
42   PluginWindow.h
43   Request.h
44   Transfers.h
45   Utils.h
46   git-version.h.in)
48 include_directories("${centerim5_BINARY_DIR}/src")
50 add_custom_target(git-version.h VERBATIM
51   COMMAND sh -c "cd \"${centerim5_SOURCE_DIR}\"; \
52     version=`misc/git-version-gen .tarball-version`; \
53     cd \"${CMAKE_CURRENT_BINARY_DIR}\"; \
54     if test \"$version\" != \"`cat .version 2> /dev/null`\"; then \
55       printf '%s' \"$version\" > .version; \
56       sed -e \"s/@GIT_VERSION@/`cat .version`/\" \
57         < \"${CMAKE_CURRENT_SOURCE_DIR}/git-version.h.in\" > git-version.h; \
58     fi")
60 add_executable(centerim5
61   ${centerim5_SOURCES}
62   ${centerim5_HEADERS})
64 add_dependencies(centerim5 git-version.h)
66 set_property(TARGET centerim5
67   PROPERTY INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
68 target_compile_options(centerim5 PRIVATE
69   ${PURPLE_CFLAGS} ${GLIB2_CFLAGS} ${SIGC_CFLAGS})
70 target_link_libraries(centerim5 PRIVATE
71   ${PURPLE_LDFLAGS} ${GLIB2_LDFLAGS} ${SIGC_LDFLAGS} cppconsui)
73 install(TARGETS centerim5 DESTINATION bin)