annotate win32/CMakeLists.txt @ 573:067240931226

Tests: forgot test-cmd-rule-remove in previous commit
author David Demelier <markand@malikania.fr>
date Wed, 29 Nov 2017 09:48:40 +0100
parents 928a40398dec
children 27587ff92a64
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
55
fe9854a09ee7 Misc: switch CRLF -> LF
David Demelier <markand@malikania.fr>
parents: 0
diff changeset
1 #
fe9854a09ee7 Misc: switch CRLF -> LF
David Demelier <markand@malikania.fr>
parents: 0
diff changeset
2 # CMakeLists.txt -- CMake build system for irccd
fe9854a09ee7 Misc: switch CRLF -> LF
David Demelier <markand@malikania.fr>
parents: 0
diff changeset
3 #
267
c26567bba526 CMake: install MinGW DLLs automatically, closes #539
David Demelier <markand@malikania.fr>
parents: 207
diff changeset
4 # Copyright (c) 2013-2016 David Demelier <markand@malikania.fr>
55
fe9854a09ee7 Misc: switch CRLF -> LF
David Demelier <markand@malikania.fr>
parents: 0
diff changeset
5 #
fe9854a09ee7 Misc: switch CRLF -> LF
David Demelier <markand@malikania.fr>
parents: 0
diff changeset
6 # Permission to use, copy, modify, and/or distribute this software for any
fe9854a09ee7 Misc: switch CRLF -> LF
David Demelier <markand@malikania.fr>
parents: 0
diff changeset
7 # purpose with or without fee is hereby granted, provided that the above
fe9854a09ee7 Misc: switch CRLF -> LF
David Demelier <markand@malikania.fr>
parents: 0
diff changeset
8 # copyright notice and this permission notice appear in all copies.
fe9854a09ee7 Misc: switch CRLF -> LF
David Demelier <markand@malikania.fr>
parents: 0
diff changeset
9 #
fe9854a09ee7 Misc: switch CRLF -> LF
David Demelier <markand@malikania.fr>
parents: 0
diff changeset
10 # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
fe9854a09ee7 Misc: switch CRLF -> LF
David Demelier <markand@malikania.fr>
parents: 0
diff changeset
11 # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
fe9854a09ee7 Misc: switch CRLF -> LF
David Demelier <markand@malikania.fr>
parents: 0
diff changeset
12 # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
fe9854a09ee7 Misc: switch CRLF -> LF
David Demelier <markand@malikania.fr>
parents: 0
diff changeset
13 # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
fe9854a09ee7 Misc: switch CRLF -> LF
David Demelier <markand@malikania.fr>
parents: 0
diff changeset
14 # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
fe9854a09ee7 Misc: switch CRLF -> LF
David Demelier <markand@malikania.fr>
parents: 0
diff changeset
15 # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
fe9854a09ee7 Misc: switch CRLF -> LF
David Demelier <markand@malikania.fr>
parents: 0
diff changeset
16 # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
fe9854a09ee7 Misc: switch CRLF -> LF
David Demelier <markand@malikania.fr>
parents: 0
diff changeset
17 #
fe9854a09ee7 Misc: switch CRLF -> LF
David Demelier <markand@malikania.fr>
parents: 0
diff changeset
18
fe9854a09ee7 Misc: switch CRLF -> LF
David Demelier <markand@malikania.fr>
parents: 0
diff changeset
19 #
267
c26567bba526 CMake: install MinGW DLLs automatically, closes #539
David Demelier <markand@malikania.fr>
parents: 207
diff changeset
20 # This file consists of installing required .dll files for Windows.
c26567bba526 CMake: install MinGW DLLs automatically, closes #539
David Demelier <markand@malikania.fr>
parents: 207
diff changeset
21 #
c26567bba526 CMake: install MinGW DLLs automatically, closes #539
David Demelier <markand@malikania.fr>
parents: 207
diff changeset
22 # It currently only supports MinGW.
c26567bba526 CMake: install MinGW DLLs automatically, closes #539
David Demelier <markand@malikania.fr>
parents: 207
diff changeset
23 #
c26567bba526 CMake: install MinGW DLLs automatically, closes #539
David Demelier <markand@malikania.fr>
parents: 207
diff changeset
24
c26567bba526 CMake: install MinGW DLLs automatically, closes #539
David Demelier <markand@malikania.fr>
parents: 207
diff changeset
25 project(win32)
c26567bba526 CMake: install MinGW DLLs automatically, closes #539
David Demelier <markand@malikania.fr>
parents: 207
diff changeset
26
c26567bba526 CMake: install MinGW DLLs automatically, closes #539
David Demelier <markand@malikania.fr>
parents: 207
diff changeset
27 #
c26567bba526 CMake: install MinGW DLLs automatically, closes #539
David Demelier <markand@malikania.fr>
parents: 207
diff changeset
28 # MinGW libraries.
c26567bba526 CMake: install MinGW DLLs automatically, closes #539
David Demelier <markand@malikania.fr>
parents: 207
diff changeset
29 # -------------------------------------------------------------------
55
fe9854a09ee7 Misc: switch CRLF -> LF
David Demelier <markand@malikania.fr>
parents: 0
diff changeset
30 #
267
c26567bba526 CMake: install MinGW DLLs automatically, closes #539
David Demelier <markand@malikania.fr>
parents: 207
diff changeset
31
c26567bba526 CMake: install MinGW DLLs automatically, closes #539
David Demelier <markand@malikania.fr>
parents: 207
diff changeset
32 if (MINGW)
c26567bba526 CMake: install MinGW DLLs automatically, closes #539
David Demelier <markand@malikania.fr>
parents: 207
diff changeset
33 if (IRCCD_64BITS)
270
90909cf677b1 CMake: make installation of DLLs more generic
David Demelier <markand@malikania.fr>
parents: 267
diff changeset
34 set(LIBGCC_DLL libgcc_s_seh-1.dll)
267
c26567bba526 CMake: install MinGW DLLs automatically, closes #539
David Demelier <markand@malikania.fr>
parents: 207
diff changeset
35 else ()
270
90909cf677b1 CMake: make installation of DLLs more generic
David Demelier <markand@malikania.fr>
parents: 267
diff changeset
36 set(LIBGCC_DLL libgcc_s_sjlj-1.dll)
267
c26567bba526 CMake: install MinGW DLLs automatically, closes #539
David Demelier <markand@malikania.fr>
parents: 207
diff changeset
37 endif ()
c26567bba526 CMake: install MinGW DLLs automatically, closes #539
David Demelier <markand@malikania.fr>
parents: 207
diff changeset
38
270
90909cf677b1 CMake: make installation of DLLs more generic
David Demelier <markand@malikania.fr>
parents: 267
diff changeset
39 set(LIBWINPTHREAD_DLL libwinpthread-1.dll)
90909cf677b1 CMake: make installation of DLLs more generic
David Demelier <markand@malikania.fr>
parents: 267
diff changeset
40 set(LIBSTDCPP_DLL libstdc++-6.dll)
90909cf677b1 CMake: make installation of DLLs more generic
David Demelier <markand@malikania.fr>
parents: 267
diff changeset
41 list(APPEND DLLS LIBGCC_DLL LIBWINPTHREAD_DLL LIBSTDCPP_DLL)
55
fe9854a09ee7 Misc: switch CRLF -> LF
David Demelier <markand@malikania.fr>
parents: 0
diff changeset
42 endif ()
fe9854a09ee7 Misc: switch CRLF -> LF
David Demelier <markand@malikania.fr>
parents: 0
diff changeset
43
267
c26567bba526 CMake: install MinGW DLLs automatically, closes #539
David Demelier <markand@malikania.fr>
parents: 207
diff changeset
44 #
c26567bba526 CMake: install MinGW DLLs automatically, closes #539
David Demelier <markand@malikania.fr>
parents: 207
diff changeset
45 # SSL libraries.
c26567bba526 CMake: install MinGW DLLs automatically, closes #539
David Demelier <markand@malikania.fr>
parents: 207
diff changeset
46 # -------------------------------------------------------------------
c26567bba526 CMake: install MinGW DLLs automatically, closes #539
David Demelier <markand@malikania.fr>
parents: 207
diff changeset
47 #
c26567bba526 CMake: install MinGW DLLs automatically, closes #539
David Demelier <markand@malikania.fr>
parents: 207
diff changeset
48
513
928a40398dec CMake: split options and conditions, closes #716
David Demelier <markand@malikania.fr>
parents: 270
diff changeset
49 if (HAVE_SSL)
270
90909cf677b1 CMake: make installation of DLLs more generic
David Demelier <markand@malikania.fr>
parents: 267
diff changeset
50 set(SSL_EAY_DLL libeay32.dll)
90909cf677b1 CMake: make installation of DLLs more generic
David Demelier <markand@malikania.fr>
parents: 267
diff changeset
51 set(SSL_LIB_DLL ssleay32.dll)
90909cf677b1 CMake: make installation of DLLs more generic
David Demelier <markand@malikania.fr>
parents: 267
diff changeset
52 list(APPEND DLLS SSL_EAY_DLL SSL_LIB_DLL)
90909cf677b1 CMake: make installation of DLLs more generic
David Demelier <markand@malikania.fr>
parents: 267
diff changeset
53 endif ()
55
fe9854a09ee7 Misc: switch CRLF -> LF
David Demelier <markand@malikania.fr>
parents: 0
diff changeset
54
270
90909cf677b1 CMake: make installation of DLLs more generic
David Demelier <markand@malikania.fr>
parents: 267
diff changeset
55 #
90909cf677b1 CMake: make installation of DLLs more generic
David Demelier <markand@malikania.fr>
parents: 267
diff changeset
56 # Find DLL to copy/install by iterating DLLS value.
90909cf677b1 CMake: make installation of DLLs more generic
David Demelier <markand@malikania.fr>
parents: 267
diff changeset
57 #
90909cf677b1 CMake: make installation of DLLs more generic
David Demelier <markand@malikania.fr>
parents: 267
diff changeset
58 # Creates a cache WITH_<NAME> variable with the path to the DLL if found,
90909cf677b1 CMake: make installation of DLLs more generic
David Demelier <markand@malikania.fr>
parents: 267
diff changeset
59 # otherwise, set to not found.
90909cf677b1 CMake: make installation of DLLs more generic
David Demelier <markand@malikania.fr>
parents: 267
diff changeset
60 #
90909cf677b1 CMake: make installation of DLLs more generic
David Demelier <markand@malikania.fr>
parents: 267
diff changeset
61 # If found, WITH_<NAME> is appended to IRCCD_DLLS global variable and set as
90909cf677b1 CMake: make installation of DLLs more generic
David Demelier <markand@malikania.fr>
parents: 267
diff changeset
62 # parent scope.
90909cf677b1 CMake: make installation of DLLs more generic
David Demelier <markand@malikania.fr>
parents: 267
diff changeset
63 #
90909cf677b1 CMake: make installation of DLLs more generic
David Demelier <markand@malikania.fr>
parents: 267
diff changeset
64 # If not found, WITH_<NAME> is appended to IRCCD_DLLS_NOT_FOUND variable.
90909cf677b1 CMake: make installation of DLLs more generic
David Demelier <markand@malikania.fr>
parents: 267
diff changeset
65 #
55
fe9854a09ee7 Misc: switch CRLF -> LF
David Demelier <markand@malikania.fr>
parents: 0
diff changeset
66
270
90909cf677b1 CMake: make installation of DLLs more generic
David Demelier <markand@malikania.fr>
parents: 267
diff changeset
67 foreach (name ${DLLS})
90909cf677b1 CMake: make installation of DLLs more generic
David Demelier <markand@malikania.fr>
parents: 267
diff changeset
68 find_program(
90909cf677b1 CMake: make installation of DLLs more generic
David Demelier <markand@malikania.fr>
parents: 267
diff changeset
69 WITH_${name}
90909cf677b1 CMake: make installation of DLLs more generic
David Demelier <markand@malikania.fr>
parents: 267
diff changeset
70 NAMES ${${name}}
90909cf677b1 CMake: make installation of DLLs more generic
David Demelier <markand@malikania.fr>
parents: 267
diff changeset
71 DOC "Path to DLL"
90909cf677b1 CMake: make installation of DLLs more generic
David Demelier <markand@malikania.fr>
parents: 267
diff changeset
72 )
90909cf677b1 CMake: make installation of DLLs more generic
David Demelier <markand@malikania.fr>
parents: 267
diff changeset
73
90909cf677b1 CMake: make installation of DLLs more generic
David Demelier <markand@malikania.fr>
parents: 267
diff changeset
74 if (EXISTS ${WITH_${name}})
90909cf677b1 CMake: make installation of DLLs more generic
David Demelier <markand@malikania.fr>
parents: 267
diff changeset
75 file(
90909cf677b1 CMake: make installation of DLLs more generic
David Demelier <markand@malikania.fr>
parents: 267
diff changeset
76 COPY ${WITH_${name}}
90909cf677b1 CMake: make installation of DLLs more generic
David Demelier <markand@malikania.fr>
parents: 267
diff changeset
77 DESTINATION ${IRCCD_FAKEROOTDIR}/${WITH_BINDIR}
90909cf677b1 CMake: make installation of DLLs more generic
David Demelier <markand@malikania.fr>
parents: 267
diff changeset
78 )
267
c26567bba526 CMake: install MinGW DLLs automatically, closes #539
David Demelier <markand@malikania.fr>
parents: 207
diff changeset
79 install(
270
90909cf677b1 CMake: make installation of DLLs more generic
David Demelier <markand@malikania.fr>
parents: 267
diff changeset
80 PROGRAMS ${WITH_${name}}
267
c26567bba526 CMake: install MinGW DLLs automatically, closes #539
David Demelier <markand@malikania.fr>
parents: 207
diff changeset
81 COMPONENT libirccd
c26567bba526 CMake: install MinGW DLLs automatically, closes #539
David Demelier <markand@malikania.fr>
parents: 207
diff changeset
82 DESTINATION bin
c26567bba526 CMake: install MinGW DLLs automatically, closes #539
David Demelier <markand@malikania.fr>
parents: 207
diff changeset
83 )
270
90909cf677b1 CMake: make installation of DLLs more generic
David Demelier <markand@malikania.fr>
parents: 267
diff changeset
84 list(APPEND IRCCD_DLLS WITH_${name})
90909cf677b1 CMake: make installation of DLLs more generic
David Demelier <markand@malikania.fr>
parents: 267
diff changeset
85 else ()
90909cf677b1 CMake: make installation of DLLs more generic
David Demelier <markand@malikania.fr>
parents: 267
diff changeset
86 set(IRCCD_PACKAGE Off PARENT_SCOPE)
90909cf677b1 CMake: make installation of DLLs more generic
David Demelier <markand@malikania.fr>
parents: 267
diff changeset
87 set(IRCCD_PACKAGE_MSG "No (some .dll were not found)" PARENT_SCOPE)
90909cf677b1 CMake: make installation of DLLs more generic
David Demelier <markand@malikania.fr>
parents: 267
diff changeset
88 list(APPEND IRCCD_DLLS_NOT_FOUND WITH_${name})
267
c26567bba526 CMake: install MinGW DLLs automatically, closes #539
David Demelier <markand@malikania.fr>
parents: 207
diff changeset
89 endif ()
270
90909cf677b1 CMake: make installation of DLLs more generic
David Demelier <markand@malikania.fr>
parents: 267
diff changeset
90 endforeach ()
90909cf677b1 CMake: make installation of DLLs more generic
David Demelier <markand@malikania.fr>
parents: 267
diff changeset
91
90909cf677b1 CMake: make installation of DLLs more generic
David Demelier <markand@malikania.fr>
parents: 267
diff changeset
92 set(IRCCD_DLLS ${IRCCD_DLLS} PARENT_SCOPE)
90909cf677b1 CMake: make installation of DLLs more generic
David Demelier <markand@malikania.fr>
parents: 267
diff changeset
93 set(IRCCD_DLLS_NOT_FOUND ${IRCCD_DLLS_NOT_FOUND} PARENT_SCOPE)