summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_asyncore.py
blob: 084d2472952cd1d5efb3fcb9dc7b15fb829152fd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
import asyncore
import unittest
import select
import os
import socket
import sys
import time
import warnings
import errno
import struct

from test import support
from test.support import TESTFN, run_unittest, unlink, HOST, HOSTv6
from io import BytesIO
from io import StringIO

try:
    import threading
except ImportError:
    threading = None

TIMEOUT = 3
HAS_UNIX_SOCKETS = hasattr(socket, 'AF_UNIX')

class dummysocket:
    def __init__(self):
        self.closed = False

    def close(self):
        self.closed = True

    def fileno(self):
        return 42

class dummychannel:
    def __init__(self):
        self.socket = dummysocket()

    def close(self):
        self.socket.close()

class exitingdummy:
    def __init__(self):
        pass

    def handle_read_event(self):
        raise asyncore.ExitNow()

    handle_write_event = handle_read_event
    handle_close = handle_read_event
    handle_expt_event = handle_read_event

class crashingdummy:
    def __init__(self):
        self.error_handled = False

    def handle_read_event(self):
        raise Exception()

    handle_write_event = handle_read_event
    handle_close = handle_read_event
    handle_expt_event = handle_read_event

    def handle_error(self):
        self.error_handled = True

# used when testing senders; just collects what it gets until newline is sent
def capture_server(evt, buf, serv):
    try:
        serv.listen(5)
        conn, addr = serv.accept()
    except socket.timeout:
        pass
    else:
        n = 200
        start = time.time()
        while n > 0 and time.time() - start < 3.0:
            r, w, e = select.select([conn], [], [], 0.1)
            if r:
                n -= 1
                data = conn.recv(10)
                # keep everything except for the newline terminator
                buf.write(data.replace(b'\n', b''))
                if b'\n' in data:
                    break
            time.sleep(0.01)

        conn.close()
    finally:
        serv.close()
        evt.set()

def bind_af_aware(sock, addr):
    """Helper function to bind a socket according to its family."""
    if HAS_UNIX_SOCKETS and sock.family == socket.AF_UNIX:
        # Make sure the path doesn't exist.
        unlink(addr)
    sock.bind(addr)


class HelperFunctionTests(unittest.TestCase):
    def test_readwriteexc(self):
        # Check exception handling behavior of read, write and _exception

        # check that ExitNow exceptions in the object handler method
        # bubbles all the way up through asyncore read/write/_exception calls
        tr1 = exitingdummy()
        self.assertRaises(asyncore.ExitNow, asyncore.read, tr1)
        self.assertRaises(asyncore.ExitNow, asyncore.write, tr1)
        self.assertRaises(asyncore.ExitNow, asyncore._exception, tr1)

        # check that an exception other than ExitNow in the object handler
        # method causes the handle_error method to get called
        tr2 = crashingdummy()
        asyncore.read(tr2)
        self.assertEqual(tr2.error_handled, True)

        tr2 = crashingdummy()
        asyncore.write(tr2)
        self.assertEqual(tr2.error_handled, True)

        tr2 = crashingdummy()
        asyncore._exception(tr2)
        self.assertEqual(tr2.error_handled, True)

    # asyncore.readwrite uses constants in the select module that
    # are not present in Windows systems (see this thread:
    # http://mail.python.org/pipermail/python-list/2001-October/109973.html)
    # These constants should be present as long as poll is available

    @unittest.skipUnless(hasattr(select, 'poll'), 'select.poll required')
    def test_readwrite(self):
        # Check that correct methods are called by readwrite()

        attributes = ('read', 'expt', 'write', 'closed', 'error_handled')

        expected = (
            (select.POLLIN, 'read'),
            (select.POLLPRI, 'expt'),
            (select.POLLOUT, 'write'),
            (select.POLLERR, 'closed'),
            (select.POLLHUP, 'closed'),
            (select.POLLNVAL, 'closed'),
            )

        class testobj:
            def __init__(self):
                self.read = False
                self.write = False
                self.closed = False
                self.expt = False
                self.error_handled = False

            def handle_read_event(self):
                self.read = True

            def handle_write_event(self):
                self.write = True

            def handle_close(self):
                self.closed = True

            def handle_expt_event(self):
                self.expt = True

            def handle_error(self):
                self.error_handled = True

        for flag, expectedattr in expected:
            tobj = testobj()
            self.assertEqual(getattr(tobj, expectedattr), False)
            asyncore.readwrite(tobj, flag)

            # Only the attribute modified by the routine we expect to be
            # called should be True.
            for attr in attributes:
                self.assertEqual(getattr(tobj, attr), attr==expectedattr)

            # check that ExitNow exceptions in the object handler method
            # bubbles all the way up through asyncore readwrite call
            tr1 = exitingdummy()
            self.assertRaises(asyncore.ExitNow, asyncore.readwrite, tr1, flag)

            # check that an exception other than ExitNow in the object handler
            # method causes the handle_error method to get called
            tr2 = crashingdummy()
            self.assertEqual(tr2.error_handled, False)
            asyncore.readwrite(tr2, flag)
            self.assertEqual(tr2.error_handled, True)

    def test_closeall(self):
        self.closeall_check(False)

    def test_closeall_default(self):
        self.closeall_check(True)

    def closeall_check(self, usedefault):
        # Check that close_all() closes everything in a given map

        l = []
        testmap = {}
        for i in range(10):
            c = dummychannel()
            l.append(c)
            self.assertEqual(c.socket.closed, False)
            testmap[i] = c

        if usedefault:
            socketmap = asyncore.socket_map
            try:
                asyncore.socket_map = testmap
                asyncore.close_all()
            finally:
                testmap, asyncore.socket_map = asyncore.socket_map, socketmap
        else:
            asyncore.close_all(testmap)

        self.assertEqual(len(testmap), 0)

        for c in l:
            self.assertEqual(c.socket.closed, True)

    def test_compact_traceback(self):
        try:
            raise Exception("I don't like spam!")
        except:
            real_t, real_v, real_tb = sys.exc_info()
            r = asyncore.compact_traceback()
        else:
            self.fail("Expected exception")

        (f, function, line), t, v, info = r
        self.assertEqual(os.path.split(f)[-1], 'test_asyncore.py')
        self.assertEqual(function, 'test_compact_traceback')
        self.assertEqual(t, real_t)
        self.assertEqual(v, real_v)
        self.assertEqual(info, '[%s|%s|%s]' % (f, function, line))


class DispatcherTests(unittest.TestCase):
    def setUp(self):
        pass

    def tearDown(self):
        asyncore.close_all()

    def test_basic(self):
        d = asyncore.dispatcher()
        self.assertEqual(d.readable(), True)
        self.assertEqual(d.writable(), True)

    def test_repr(self):
        d = asyncore.dispatcher()
        self.assertEqual(repr(d), '<asyncore.dispatcher at %#x>' % id(d))

    def test_log(self):
        d = asyncore.dispatcher()

        # capture output of dispatcher.log() (to stderr)
        fp = StringIO()
        stderr = sys.stderr
        l1 = "Lovely spam! Wonderful spam!"
        l2 = "I don't like spam!"
        try:
            sys.stderr = fp
            d.log(l1)
            d.log(l2)
        finally:
            sys.stderr = stderr

        lines = fp.getvalue().splitlines()
        self.assertEqual(lines, ['log: %s' % l1, 'log: %s' % l2])

    def test_log_info(self):
        d = asyncore.dispatcher()

        # capture output of dispatcher.log_info() (to stdout via print)
        fp = StringIO()
        stdout = sys.stdout
        l1 = "Have you got anything without spam?"
        l2 = "Why can't she have egg bacon spam and sausage?"
        l3 = "THAT'S got spam in it!"
        try:
            sys.stdout = fp
            d.log_info(l1, 'EGGS')
            d.log_info(l2)
            d.log_info(l3, 'SPAM')
        finally:
            sys.stdout = stdout

        lines = fp.getvalue().splitlines()
        expected = ['EGGS: %s' % l1, 'info: %s' % l2, 'SPAM: %s' % l3]

        self.assertEqual(lines, expected)

    def test_unhandled(self):
        d = asyncore.dispatcher()
        d.ignore_log_types = ()

        # capture output of dispatcher.log_info() (to stdout via print)
        fp = StringIO()
        stdout = sys.stdout
        try:
            sys.stdout = fp
            d.handle_expt()
            d.handle_read()
            d.handle_write()
            d.handle_connect()
        finally:
            sys.stdout = stdout

        lines = fp.getvalue().splitlines()
        expected = ['warning: unhandled incoming priority event',
                    'warning: unhandled read event',
                    'warning: unhandled write event',
                    'warning: unhandled connect event']
        self.assertEqual(lines, expected)

    def test_issue_8594(self):
        # XXX - this test is supposed to be removed in next major Python
        # version
        d = asyncore.dispatcher(socket.socket())
        # make sure the error message no longer refers to the socket
        # object but the dispatcher instance instead
        self.assertRaisesRegex(AttributeError, 'dispatcher instance',
                               getattr, d, 'foo')
        # cheap inheritance with the underlying socket is supposed
        # to still work but a DeprecationWarning is expected
        with warnings.catch_warnings(record=True) as w:
            warnings.simplefilter("always")
            family = d.family
            self.assertEqual(family, socket.AF_INET)
            self.assertEqual(len(w), 1)
            self.assertTrue(issubclass(w[0].category, DeprecationWarning))

    def test_strerror(self):
        # refers to bug #8573
        err = asyncore._strerror(errno.EPERM)
        if hasattr(os, 'strerror'):
            self.assertEqual(err, os.strerror(errno.EPERM))
        err = asyncore._strerror(-1)
        self.assertTrue(err != "")


class dispatcherwithsend_noread(asyncore.dispatcher_with_send):
    def readable(self):
        return False

    def handle_connect(self):
        pass

class DispatcherWithSendTests(unittest.TestCase):
    usepoll = False

    def setUp(self):
        pass

    def tearDown(self):
        asyncore.close_all()

    @unittest.skipUnless(threading, 'Threading required for this test.')
    @support.reap_threads
    def test_send(self):
        evt = threading.Event()
        sock = socket.socket()
        sock.settimeout(3)
        port = support.bind_port(sock)

        cap = BytesIO()
        args = (evt, cap, sock)
        t = threading.Thread(target=capture_server, args=args)
        t.start()
        try:
            # wait a little longer for the server to initialize (it sometimes
            # refuses connections on slow machines without this wait)
            time.sleep(0.2)

            data = b"Suppose there isn't a 16-ton weight?"
            d = dispatcherwithsend_noread()
            d.create_socket()
            d.connect((HOST, port))

            # give time for socket to connect
            time.sleep(0.1)

            d.send(data)
            d.send(data)
            d.send(b'\n')

            n = 1000
            while d.out_buffer and n > 0:
                asyncore.poll()
                n -= 1

            evt.wait()

            self.assertEqual(cap.getvalue(), data*2)
        finally:
            t.join(timeout=TIMEOUT)
            if t.is_alive():
                self.fail("join() timed out")



class DispatcherWithSendTests_UsePoll(DispatcherWithSendTests):
    usepoll = True

@unittest.skipUnless(hasattr(asyncore, 'file_wrapper'),
                     'asyncore.file_wrapper required')
class FileWrapperTest(unittest.TestCase):
    def setUp(self):
        self.d = b"It's not dead, it's sleeping!"
        with open(TESTFN, 'wb') as file:
            file.write(self.d)

    def tearDown(self):
        unlink(TESTFN)

    def test_recv(self):
        fd = os.open(TESTFN, os.O_RDONLY)
        w = asyncore.file_wrapper(fd)
        os.close(fd)

        self.assertNotEqual(w.fd, fd)
        self.assertNotEqual(w.fileno(), fd)
        self.assertEqual(w.recv(13), b"It's not dead")
        self.assertEqual(w.read(6), b", it's")
        w.close()
        self.assertRaises(OSError, w.read, 1)

    def test_send(self):
        d1 = b"Come again?"
        d2 = b"I want to buy some cheese."
        fd = os.open(TESTFN, os.O_WRONLY | os.O_APPEND)
        w = asyncore.file_wrapper(fd)
        os.close(fd)

        w.write(d1)
        w.send(d2)
        w.close()
        with open(TESTFN, 'rb') as file:
            self.assertEqual(file.read(), self.d + d1 + d2)

    @unittest.skipUnless(hasattr(asyncore, 'file_dispatcher'),
                         'asyncore.file_dispatcher required')
    def test_dispatcher(self):
        fd = os.open(TESTFN, os.O_RDONLY)
        data = []
        class FileDispatcher(asyncore.file_dispatcher):
            def handle_read(self):
                data.append(self.recv(29))
        s = FileDispatcher(fd)
        os.close(fd)
        asyncore.loop(timeout=0.01, use_poll=True, count=2)
        self.assertEqual(b"".join(data), self.d)


class BaseTestHandler(asyncore.dispatcher):

    def __init__(self, sock=None):
        asyncore.dispatcher.__init__(self, sock)
        self.flag = False

    def handle_accept(self):
        raise Exception("handle_accept not supposed to be called")

    def handle_accepted(self):
        raise Exception("handle_accepted not supposed to be called")

    def handle_connect(self):
        raise Exception("handle_connect not supposed to be called")

    def handle_expt(self):
        raise Exception("handle_expt not supposed to be called")

    def handle_close(self):
        raise Exception("handle_close not supposed to be called")

    def handle_error(self):
        raise


class BaseServer(asyncore.dispatcher):
    """A server which listens on an address and dispatches the
    connection to a handler.
    """

    def __init__(self, family, addr, handler=BaseTestHandler):
        asyncore.dispatcher.__init__(self)
        self.create_socket(family)
        self.set_reuse_addr()
        bind_af_aware(self.socket, addr)
        self.listen(5)
        self.handler = handler

    @property
    def address(self):
        return self.socket.getsockname()

    def handle_accepted(self, sock, addr):
        self.handler(sock)

    def handle_error(self):
        raise


class BaseClient(BaseTestHandler):

    def __init__(self, family, address):
        BaseTestHandler.__init__(self)
        self.create_socket(family)
        self.connect(address)

    def handle_connect(self):
        pass


class BaseTestAPI:

    def tearDown(self):
        asyncore.close_all()

    def loop_waiting_for_flag(self, instance, timeout=5):
        timeout = float(timeout) / 100
        count = 100
        while asyncore.socket_map and count > 0:
            asyncore.loop(timeout=0.01, count=1, use_poll=self.use_poll)
            if instance.flag:
                return
            count -= 1
            time.sleep(timeout)
        self.fail("flag not set")

    def test_handle_connect(self):
        # make sure handle_connect is called on connect()

        class TestClient(BaseClient):
            def handle_connect(self):
                self.flag = True

        server = BaseServer(self.family, self.addr)
        client = TestClient(self.family, server.address)
        self.loop_waiting_for_flag(client)

    def test_handle_accept(self):
        # make sure handle_accept() is called when a client connects

        class TestListener(BaseTestHandler):

            def __init__(self, family, addr):
                BaseTestHandler.__init__(self)
                self.create_socket(family)
                bind_af_aware(self.socket, addr)
                self.listen(5)
                self.address = self.socket.getsockname()

            def handle_accept(self):
                self.flag = True

        server = TestListener(self.family, self.addr)
        client = BaseClient(self.family, server.address)
        self.loop_waiting_for_flag(server)

    def test_handle_accepted(self):
        # make sure handle_accepted() is called when a client connects

        class TestListener(BaseTestHandler):

            def __init__(self, family, addr):
                BaseTestHandler.__init__(self)
                self.create_socket(family)
                bind_af_aware(self.socket, addr)
                self.listen(5)
                self.address = self.socket.getsockname()

            def handle_accept(self):
                asyncore.dispatcher.handle_accept(self)

            def handle_accepted(self, sock, addr):
                sock.close()
                self.flag = True

        server = TestListener(self.family, self.addr)
        client = BaseClient(self.family, server.address)
        self.loop_waiting_for_flag(server)


    def test_handle_read(self):
        # make sure handle_read is called on data received

        class TestClient(BaseClient):
            def handle_read(self):
                self.flag = True

        class TestHandler(BaseTestHandler):
            def __init__(self, conn):
                BaseTestHandler.__init__(self, conn)
                self.send(b'x' * 1024)

        server = BaseServer(self.family, self.addr, TestHandler)
        client = TestClient(self.family, server.address)
        self.loop_waiting_for_flag(client)

    def test_handle_write(self):
        # make sure handle_write is called

        class TestClient(BaseClient):
            def handle_write(self):
                self.flag = True

        server = BaseServer(self.family, self.addr)
        client = TestClient(self.family, server.address)
        self.loop_waiting_for_flag(client)

    def test_handle_close(self):
        # make sure handle_close is called when the other end closes
        # the connection

        class TestClient(BaseClient):

            def handle_read(self):
                # in order to make handle_close be called we are supposed
                # to make at least one recv() call
                self.recv(1024)

            def handle_close(self):
                self.flag = True
                self.close()

        class TestHandler(BaseTestHandler):
            def __init__(self, conn):
                BaseTestHandler.__init__(self, conn)
                self.close()

        server = BaseServer(self.family, self.addr, TestHandler)
        client = TestClient(self.family, server.address)
        self.loop_waiting_for_flag(client)

    def test_handle_close_after_conn_broken(self):
        # Check that ECONNRESET/EPIPE is correctly handled (issues #5661 and
        # #11265).

        data = b'\0' * 128

        class TestClient(BaseClient):

            def handle_write(self):
                self.send(data)

            def handle_close(self):
                self.flag = True
                self.close()

            def handle_expt(self):
                self.flag = True
                self.close()

        class TestHandler(BaseTestHandler):

            def handle_read(self):
                self.recv(len(data))
                self.close()

            def writable(self):
                return False

        server = BaseServer(self.family, self.addr, TestHandler)
        client = TestClient(self.family, server.address)
        self.loop_waiting_for_flag(client)

    @unittest.skipIf(sys.platform.startswith("sunos"),
                     "OOB support is broken on Solaris")
    def test_handle_expt(self):
        # Make sure handle_expt is called on OOB data received.
        # Note: this might fail on some platforms as OOB data is
        # tenuously supported and rarely used.
        if HAS_UNIX_SOCKETS and self.family == socket.AF_UNIX:
            self.skipTest("Not applicable to AF_UNIX sockets.")

        class TestClient(BaseClient):
            def handle_expt(self):
                self.socket.recv(1024, socket.MSG_OOB)
                self.flag = True

        class TestHandler(BaseTestHandler):
            def __init__(self, conn):
                BaseTestHandler.__init__(self, conn)
                self.socket.send(bytes(chr(244), 'latin-1'), socket.MSG_OOB)

        server = BaseServer(self.family, self.addr, TestHandler)
        client = TestClient(self.family, server.address)
        self.loop_waiting_for_flag(client)

    def test_handle_error(self):

        class TestClient(BaseClient):
            def handle_write(self):
                1.0 / 0
            def handle_error(self):
                self.flag = True
                try:
                    raise
                except ZeroDivisionError:
                    pass
                else:
                    raise Exception("exception not raised")

        server = BaseServer(self.family, self.addr)
        client = TestClient(self.family, server.address)
        self.loop_waiting_for_flag(client)

    def test_connection_attributes(self):
        server = BaseServer(self.family, self.addr)
        client = BaseClient(self.family, server.address)

        # we start disconnected
        self.assertFalse(server.connected)
        self.assertTrue(server.accepting)
        # this can't be taken for granted across all platforms
        #self.assertFalse(client.connected)
        self.assertFalse(client.accepting)

        # execute some loops so that client connects to server
        asyncore.loop(timeout=0.01, use_poll=self.use_poll, count=100)
        self.assertFalse(server.connected)
        self.assertTrue(server.accepting)
        self.assertTrue(client.connected)
        self.assertFalse(client.accepting)

        # disconnect the client
        client.close()
        self.assertFalse(server.connected)
        self.assertTrue(server.accepting)
        self.assertFalse(client.connected)
        self.assertFalse(client.accepting)

        # stop serving
        server.close()
        self.assertFalse(server.connected)
        self.assertFalse(server.accepting)

    def test_create_socket(self):
        s = asyncore.dispatcher()
        s.create_socket(self.family)
        self.assertEqual(s.socket.family, self.family)
        SOCK_NONBLOCK = getattr(socket, 'SOCK_NONBLOCK', 0)
        sock_type = socket.SOCK_STREAM | SOCK_NONBLOCK
        if hasattr(socket, 'SOCK_CLOEXEC'):
            self.assertIn(s.socket.type,
                          (sock_type | socket.SOCK_CLOEXEC, sock_type))
        else:
            self.assertEqual(s.socket.type, sock_type)

    def test_bind(self):
        if HAS_UNIX_SOCKETS and self.family == socket.AF_UNIX:
            self.skipTest("Not applicable to AF_UNIX sockets.")
        s1 = asyncore.dispatcher()
        s1.create_socket(self.family)
        s1.bind(self.addr)
        s1.listen(5)
        port = s1.socket.getsockname()[1]

        s2 = asyncore.dispatcher()
        s2.create_socket(self.family)
        # EADDRINUSE indicates the socket was correctly bound
        self.assertRaises(OSError, s2.bind, (self.addr[0], port))

    def test_set_reuse_addr(self):
        if HAS_UNIX_SOCKETS and self.family == socket.AF_UNIX:
            self.skipTest("Not applicable to AF_UNIX sockets.")
        sock = socket.socket(self.family)
        try:
            sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
        except OSError:
            unittest.skip("SO_REUSEADDR not supported on this platform")
        else:
            # if SO_REUSEADDR succeeded for sock we expect asyncore
            # to do the same
            s = asyncore.dispatcher(socket.socket(self.family))
            self.assertFalse(s.socket.getsockopt(socket.SOL_SOCKET,
                                                 socket.SO_REUSEADDR))
            s.socket.close()
            s.create_socket(self.family)
            s.set_reuse_addr()
            self.assertTrue(s.socket.getsockopt(socket.SOL_SOCKET,
                                                 socket.SO_REUSEADDR))
        finally:
            sock.close()

    @unittest.skipUnless(threading, 'Threading required for this test.')
    @support.reap_threads
    def test_quick_connect(self):
        # see: http://bugs.python.org/issue10340
        if self.family in (socket.AF_INET, getattr(socket, "AF_INET6", object())):
            server = BaseServer(self.family, self.addr)
            t = threading.Thread(target=lambda: asyncore.loop(timeout=0.1,
                                                              count=500))
            t.start()
            def cleanup():
                t.join(timeout=TIMEOUT)
                if t.is_alive():
                    self.fail("join() timed out")
            self.addCleanup(cleanup)

            s = socket.socket(self.family, socket.SOCK_STREAM)
            s.settimeout(.2)
            s.setsockopt(socket.SOL_SOCKET, socket.SO_LINGER,
                         struct.pack('ii', 1, 0))
            try:
                s.connect(server.address)
            except OSError:
                pass
            finally:
                s.close()

class TestAPI_UseIPv4Sockets(BaseTestAPI):
    family = socket.AF_INET
    addr = (HOST, 0)

@unittest.skipUnless(support.IPV6_ENABLED, 'IPv6 support required')
class TestAPI_UseIPv6Sockets(BaseTestAPI):
    family = socket.AF_INET6
    addr = (HOSTv6, 0)

@unittest.skipUnless(HAS_UNIX_SOCKETS, 'Unix sockets required')
class TestAPI_UseUnixSockets(BaseTestAPI):
    if HAS_UNIX_SOCKETS:
        family = socket.AF_UNIX
    addr = support.TESTFN

    def tearDown(self):
        unlink(self.addr)
        BaseTestAPI.tearDown(self)

class TestAPI_UseIPv4Select(TestAPI_UseIPv4Sockets, unittest.TestCase):
    use_poll = False

@unittest.skipUnless(hasattr(select, 'poll'), 'select.poll required')
class TestAPI_UseIPv4Poll(TestAPI_UseIPv4Sockets, unittest.TestCase):
    use_poll = True

class TestAPI_UseIPv6Select(TestAPI_UseIPv6Sockets, unittest.TestCase):
    use_poll = False

@unittest.skipUnless(hasattr(select, 'poll'), 'select.poll required')
class TestAPI_UseIPv6Poll(TestAPI_UseIPv6Sockets, unittest.TestCase):
    use_poll = True

class TestAPI_UseUnixSocketsSelect(TestAPI_UseUnixSockets, unittest.TestCase):
    use_poll = False

@unittest.skipUnless(hasattr(select, 'poll'), 'select.poll required')
class TestAPI_UseUnixSocketsPoll(TestAPI_UseUnixSockets, unittest.TestCase):
    use_poll = True

if __name__ == "__main__":
    unittest.main()
path it will be evaluated +with respect to the current output directory, but it may also be an +absolute path. If binary_dir is not specified, the value of +source_dir, before expanding any relative path, will be used (the +typical usage). The CMakeLists.txt file in the specified source +directory will be processed immediately by CMake before processing in +the current input file continues beyond this command. + +If the EXCLUDE_FROM_ALL argument is provided then targets in the +subdirectory will not be included in the ALL target of the parent +directory by default, and will be excluded from IDE project files. +Users must explicitly build targets in the subdirectory. This is +meant for use when the subdirectory contains a separate part of the +project that is useful but not necessary, such as a set of examples. +Typically the subdirectory should contain its own project() command +invocation so that a full build system will be generated in the +subdirectory (such as a VS IDE solution file). Note that inter-target +dependencies supercede this exclusion. If a target built by the +parent project depends on a target in the subdirectory, the dependee +target will be included in the parent project build system to satisfy +the dependency. diff --git a/Help/command/add_test.rst b/Help/command/add_test.rst new file mode 100644 index 0000000..335db73 --- /dev/null +++ b/Help/command/add_test.rst @@ -0,0 +1,117 @@ +add_test +-------- + +Add a test to the project with the specified arguments. + +:: + + add_test(testname Exename arg1 arg2 ... ) + +If the ENABLE_TESTING command has been run, this command adds a test +target to the current directory. If ENABLE_TESTING has not been run, +this command does nothing. The tests are run by the testing subsystem +by executing Exename with the specified arguments. Exename can be +either an executable built by this project or an arbitrary executable +on the system (like tclsh). The test will be run with the current +working directory set to the CMakeList.txt files corresponding +directory in the binary tree. Tests added using this signature do not +support generator expressions. + + + +:: + + add_test(NAME [CONFIGURATIONS [Debug|Release|...]] + [WORKING_DIRECTORY dir] + COMMAND [arg1 [arg2 ...]]) + +Add a test called . The test name may not contain spaces, +quotes, or other characters special in CMake syntax. If COMMAND +specifies an executable target (created by add_executable) it will +automatically be replaced by the location of the executable created at +build time. If a CONFIGURATIONS option is given then the test will be +executed only when testing under one of the named configurations. If +a WORKING_DIRECTORY option is given then the test will be executed in +the given directory. + +Arguments after COMMAND may use "generator expressions" with the +syntax "$<...>". Generator expressions are evaluated during build +system generation to produce information specific to each build +configuration. Valid expressions are: + +:: + + $<0:...> = empty string (ignores "...") + $<1:...> = content of "..." + $ = '1' if config is "cfg", else '0' + $ = configuration name + $ = '1' if the '...' is true, else '0' + $ = '1' if a is STREQUAL b, else '0' + $ = A literal '>'. Used to compare strings which contain a '>' for example. + $ = A literal ','. Used to compare strings which contain a ',' for example. + $ = A literal ';'. Used to prevent list expansion on an argument with ';'. + $ = joins the list with the content of "..." + $ = Marks ... as being the name of a target. This is required if exporting targets to multiple dependent export sets. The '...' must be a literal name of a target- it may not contain generator expressions. + $ = content of "..." when the property is exported using install(EXPORT), and empty otherwise. + $ = content of "..." when the property is exported using export(), or when the target is used by another target in the same buildsystem. Expands to the empty string otherwise. + $ = The CMake-id of the platform $ = '1' if the The CMake-id of the platform matches comp, otherwise '0'. + $ = The CMake-id of the C compiler used. + $ = '1' if the CMake-id of the C compiler matches comp, otherwise '0'. + $ = The CMake-id of the CXX compiler used. + $ = '1' if the CMake-id of the CXX compiler matches comp, otherwise '0'. + $ = '1' if v1 is a version greater than v2, else '0'. + $ = '1' if v1 is a version less than v2, else '0'. + $ = '1' if v1 is the same version as v2, else '0'. + $ = The version of the C compiler used. + $ = '1' if the version of the C compiler matches ver, otherwise '0'. + $ = The version of the CXX compiler used. + $ = '1' if the version of the CXX compiler matches ver, otherwise '0'. + $ = main file (.exe, .so.1.2, .a) + $ = file used to link (.a, .lib, .so) + $ = file with soname (.so.3) + +where "tgt" is the name of a target. Target file expressions produce +a full path, but _DIR and _NAME versions can produce the directory and +file name components: + +:: + + $/$ + $/$ + $/$ + + + +:: + + $ = The value of the property prop on the target tgt. + +Note that tgt is not added as a dependency of the target this +expression is evaluated on. + +:: + + $ = '1' if the policy was NEW when the 'head' target was created, else '0'. If the policy was not set, the warning message for the policy will be emitted. This generator expression only works for a subset of policies. + $ = Content of the install prefix when the target is exported via INSTALL(EXPORT) and empty otherwise. + +Boolean expressions: + +:: + + $ = '1' if all '?' are '1', else '0' + $ = '0' if all '?' are '0', else '1' + $ = '0' if '?' is '1', else '1' + +where '?' is always either '0' or '1'. + +Example usage: + +:: + + add_test(NAME mytest + COMMAND testDriver --config $ + --exe $) + +This creates a test "mytest" whose command runs a testDriver tool +passing the configuration name and the full path to the executable +file produced by target "myexe". diff --git a/Help/command/aux_source_directory.rst b/Help/command/aux_source_directory.rst new file mode 100644 index 0000000..434d7a9 --- /dev/null +++ b/Help/command/aux_source_directory.rst @@ -0,0 +1,24 @@ +aux_source_directory +-------------------- + +Find all source files in a directory. + +:: + + aux_source_directory( ) + +Collects the names of all the source files in the specified directory +and stores the list in the provided. This command is +intended to be used by projects that use explicit template +instantiation. Template instantiation files can be stored in a +"Templates" subdirectory and collected automatically using this +command to avoid manually listing all instantiations. + +It is tempting to use this command to avoid writing the list of source +files for a library or executable target. While this seems to work, +there is no way for CMake to generate a build system that knows when a +new source file has been added. Normally the generated build system +knows when it needs to rerun CMake because the CMakeLists.txt file is +modified to add a new source. When the source is just added to the +directory without modifying this file, one would have to manually +rerun CMake to generate a build system incorporating the new file. diff --git a/Help/command/break.rst b/Help/command/break.rst new file mode 100644 index 0000000..8f1067b --- /dev/null +++ b/Help/command/break.rst @@ -0,0 +1,10 @@ +break +----- + +Break from an enclosing foreach or while loop. + +:: + + break() + +Breaks from an enclosing foreach loop or while loop diff --git a/Help/command/build_command.rst b/Help/command/build_command.rst new file mode 100644 index 0000000..f4a56f0 --- /dev/null +++ b/Help/command/build_command.rst @@ -0,0 +1,37 @@ +build_command +------------- + +Get the command line to build this project. + +:: + + build_command( + [CONFIGURATION ] + [PROJECT_NAME ] + [TARGET ]) + +Sets the given to a string containing the command line for +building one configuration of a target in a project using the build +tool appropriate for the current CMAKE_GENERATOR. + +If CONFIGURATION is omitted, CMake chooses a reasonable default value +for multi-configuration generators. CONFIGURATION is ignored for +single-configuration generators. + +If PROJECT_NAME is omitted, the resulting command line will build the +top level PROJECT in the current build tree. + +If TARGET is omitted, the resulting command line will build +everything, effectively using build target 'all' or 'ALL_BUILD'. + +:: + + build_command( ) + +This second signature is deprecated, but still available for backwards +compatibility. Use the first signature instead. + +Sets the given to a string containing the command to +build this project from the root of the build tree using the build +tool given by . should be the full path to +msdev, devenv, nmake, make or one of the end user build tools. diff --git a/Help/command/build_name.rst b/Help/command/build_name.rst new file mode 100644 index 0000000..2148e49 --- /dev/null +++ b/Help/command/build_name.rst @@ -0,0 +1,12 @@ +build_name +---------- + +Deprecated. Use ${CMAKE_SYSTEM} and ${CMAKE_CXX_COMPILER} instead. + +:: + + build_name(variable) + +Sets the specified variable to a string representing the platform and +compiler settings. These values are now available through the +CMAKE_SYSTEM and CMAKE_CXX_COMPILER variables. diff --git a/Help/command/cmake_host_system_information.rst b/Help/command/cmake_host_system_information.rst new file mode 100644 index 0000000..ba545d5 --- /dev/null +++ b/Help/command/cmake_host_system_information.rst @@ -0,0 +1,25 @@ +cmake_host_system_information +----------------------------- + +Query host system specific information. + +:: + + cmake_host_system_information(RESULT QUERY ...) + +Queries system information of the host system on which cmake runs. +One or more can be provided to select the information to be +queried. The list of queried values is stored in . + + can be one of the following values: + +:: + + NUMBER_OF_LOGICAL_CORES = Number of logical cores. + NUMBER_OF_PHYSICAL_CORES = Number of physical cores. + HOSTNAME = Hostname. + FQDN = Fully qualified domain name. + TOTAL_VIRTUAL_MEMORY = Total virtual memory in megabytes. + AVAILABLE_VIRTUAL_MEMORY = Available virtual memory in megabytes. + TOTAL_PHYSICAL_MEMORY = Total physical memory in megabytes. + AVAILABLE_PHYSICAL_MEMORY = Available physical memory in megabytes. diff --git a/Help/command/cmake_minimum_required.rst b/Help/command/cmake_minimum_required.rst new file mode 100644 index 0000000..1bdffa4 --- /dev/null +++ b/Help/command/cmake_minimum_required.rst @@ -0,0 +1,30 @@ +cmake_minimum_required +---------------------- + +Set the minimum required version of cmake for a project. + +:: + + cmake_minimum_required(VERSION major[.minor[.patch[.tweak]]] + [FATAL_ERROR]) + +If the current version of CMake is lower than that required it will +stop processing the project and report an error. When a version +higher than 2.4 is specified the command implicitly invokes + +:: + + cmake_policy(VERSION major[.minor[.patch[.tweak]]]) + +which sets the cmake policy version level to the version specified. +When version 2.4 or lower is given the command implicitly invokes + +:: + + cmake_policy(VERSION 2.4) + +which enables compatibility features for CMake 2.4 and lower. + +The FATAL_ERROR option is accepted but ignored by CMake 2.6 and +higher. It should be specified so CMake versions 2.4 and lower fail +with an error instead of just a warning. diff --git a/Help/command/cmake_policy.rst b/Help/command/cmake_policy.rst new file mode 100644 index 0000000..46db8d3 --- /dev/null +++ b/Help/command/cmake_policy.rst @@ -0,0 +1,78 @@ +cmake_policy +------------ + +Manage CMake Policy settings. + +As CMake evolves it is sometimes necessary to change existing behavior +in order to fix bugs or improve implementations of existing features. +The CMake Policy mechanism is designed to help keep existing projects +building as new versions of CMake introduce changes in behavior. Each +new policy (behavioral change) is given an identifier of the form +"CMP" where "" is an integer index. Documentation +associated with each policy describes the OLD and NEW behavior and the +reason the policy was introduced. Projects may set each policy to +select the desired behavior. When CMake needs to know which behavior +to use it checks for a setting specified by the project. If no +setting is available the OLD behavior is assumed and a warning is +produced requesting that the policy be set. + +The cmake_policy command is used to set policies to OLD or NEW +behavior. While setting policies individually is supported, we +encourage projects to set policies based on CMake versions. + +:: + + cmake_policy(VERSION major.minor[.patch[.tweak]]) + +Specify that the current CMake list file is written for the given +version of CMake. All policies introduced in the specified version or +earlier will be set to use NEW behavior. All policies introduced +after the specified version will be unset (unless variable +CMAKE_POLICY_DEFAULT_CMP sets a default). This effectively +requests behavior preferred as of a given CMake version and tells +newer CMake versions to warn about their new policies. The policy +version specified must be at least 2.4 or the command will report an +error. In order to get compatibility features supporting versions +earlier than 2.4 see documentation of policy CMP0001. + +:: + + cmake_policy(SET CMP NEW) + cmake_policy(SET CMP OLD) + +Tell CMake to use the OLD or NEW behavior for a given policy. +Projects depending on the old behavior of a given policy may silence a +policy warning by setting the policy state to OLD. Alternatively one +may fix the project to work with the new behavior and set the policy +state to NEW. + +:: + + cmake_policy(GET CMP ) + +Check whether a given policy is set to OLD or NEW behavior. The +output variable value will be "OLD" or "NEW" if the policy is set, and +empty otherwise. + +CMake keeps policy settings on a stack, so changes made by the +cmake_policy command affect only the top of the stack. A new entry on +the policy stack is managed automatically for each subdirectory to +protect its parents and siblings. CMake also manages a new entry for +scripts loaded by include() and find_package() commands except when +invoked with the NO_POLICY_SCOPE option (see also policy CMP0011). +The cmake_policy command provides an interface to manage custom +entries on the policy stack: + +:: + + cmake_policy(PUSH) + cmake_policy(POP) + +Each PUSH must have a matching POP to erase any changes. This is +useful to make temporary changes to policy settings. + +Functions and macros record policy settings when they are created and +use the pre-record policies when they are invoked. If the function or +macro implementation sets policies, the changes automatically +propagate up through callers until they reach the closest nested +policy stack entry. diff --git a/Help/command/configure_file.rst b/Help/command/configure_file.rst new file mode 100644 index 0000000..5e5a33a --- /dev/null +++ b/Help/command/configure_file.rst @@ -0,0 +1,46 @@ +configure_file +-------------- + +Copy a file to another location and modify its contents. + +:: + + configure_file( + [COPYONLY] [ESCAPE_QUOTES] [@ONLY] + [NEWLINE_STYLE [UNIX|DOS|WIN32|LF|CRLF] ]) + +Copies a file to file and substitutes variable values +referenced in the file content. If is a relative path it is +evaluated with respect to the current source directory. The +must be a file, not a directory. If is a relative path it is +evaluated with respect to the current binary directory. If +names an existing directory the input file is placed in that directory +with its original name. + +If the file is modified the build system will re-run CMake to +re-configure the file and generate the build system again. + +This command replaces any variables in the input file referenced as +${VAR} or @VAR@ with their values as determined by CMake. If a +variable is not defined, it will be replaced with nothing. If +COPYONLY is specified, then no variable expansion will take place. If +ESCAPE_QUOTES is specified then any substituted quotes will be C-style +escaped. The file will be configured with the current values of CMake +variables. If @ONLY is specified, only variables of the form @VAR@ +will be replaced and ${VAR} will be ignored. This is useful for +configuring scripts that use ${VAR}. + +Input file lines of the form "#cmakedefine VAR ..." will be replaced +with either "#define VAR ..." or "/* #undef VAR */" depending on +whether VAR is set in CMake to any value not considered a false +constant by the if() command. (Content of "...", if any, is processed +as above.) Input file lines of the form "#cmakedefine01 VAR" will be +replaced with either "#define VAR 1" or "#define VAR 0" similarly. + +With NEWLINE_STYLE the line ending could be adjusted: + +:: + + 'UNIX' or 'LF' for \n, 'DOS', 'WIN32' or 'CRLF' for \r\n. + +COPYONLY must not be used with NEWLINE_STYLE. diff --git a/Help/command/create_test_sourcelist.rst b/Help/command/create_test_sourcelist.rst new file mode 100644 index 0000000..9addd67 --- /dev/null +++ b/Help/command/create_test_sourcelist.rst @@ -0,0 +1,30 @@ +create_test_sourcelist +---------------------- + +Create a test driver and source list for building test programs. + +:: + + create_test_sourcelist(sourceListName driverName + test1 test2 test3 + EXTRA_INCLUDE include.h + FUNCTION function) + +A test driver is a program that links together many small tests into a +single executable. This is useful when building static executables +with large libraries to shrink the total required size. The list of +source files needed to build the test driver will be in +sourceListName. DriverName is the name of the test driver program. +The rest of the arguments consist of a list of test source files, can +be semicolon separated. Each test source file should have a function +in it that is the same name as the file with no extension (foo.cxx +should have int foo(int, char*[]);) DriverName will be able to call +each of the tests by name on the command line. If EXTRA_INCLUDE is +specified, then the next argument is included into the generated file. +If FUNCTION is specified, then the next argument is taken as a +function name that is passed a pointer to ac and av. This can be used +to add extra command line processing to each test. The cmake variable +CMAKE_TESTDRIVER_BEFORE_TESTMAIN can be set to have code that will be +placed directly before calling the test main function. +CMAKE_TESTDRIVER_AFTER_TESTMAIN can be set to have code that will be +placed directly after the call to the test main function. diff --git a/Help/command/ctest_build.rst b/Help/command/ctest_build.rst new file mode 100644 index 0000000..ac2a0c1 --- /dev/null +++ b/Help/command/ctest_build.rst @@ -0,0 +1,24 @@ +ctest_build +----------- + +Build the project. + +:: + + ctest_build([BUILD build_dir] [TARGET target] [RETURN_VALUE res] + [APPEND][NUMBER_ERRORS val] [NUMBER_WARNINGS val]) + +Builds the given build directory and stores results in Build.xml. If +no BUILD is given, the CTEST_BINARY_DIRECTORY variable is used. + +The TARGET variable can be used to specify a build target. If none is +specified, the "all" target will be built. + +The RETURN_VALUE option specifies a variable in which to store the +return value of the native build tool. The NUMBER_ERRORS and +NUMBER_WARNINGS options specify variables in which to store the number +of build errors and warnings detected. + +The APPEND option marks results for append to those previously +submitted to a dashboard server since the last ctest_start. Append +semantics are defined by the dashboard server in use. diff --git a/Help/command/ctest_configure.rst b/Help/command/ctest_configure.rst new file mode 100644 index 0000000..2c4e305 --- /dev/null +++ b/Help/command/ctest_configure.rst @@ -0,0 +1,21 @@ +ctest_configure +--------------- + +Configure the project build tree. + +:: + + ctest_configure([BUILD build_dir] [SOURCE source_dir] [APPEND] + [OPTIONS options] [RETURN_VALUE res]) + +Configures the given build directory and stores results in +Configure.xml. If no BUILD is given, the CTEST_BINARY_DIRECTORY +variable is used. If no SOURCE is given, the CTEST_SOURCE_DIRECTORY +variable is used. The OPTIONS argument specifies command line +arguments to pass to the configuration tool. The RETURN_VALUE option +specifies a variable in which to store the return value of the native +build tool. + +The APPEND option marks results for append to those previously +submitted to a dashboard server since the last ctest_start. Append +semantics are defined by the dashboard server in use. diff --git a/Help/command/ctest_coverage.rst b/Help/command/ctest_coverage.rst new file mode 100644 index 0000000..4c90f9c --- /dev/null +++ b/Help/command/ctest_coverage.rst @@ -0,0 +1,20 @@ +ctest_coverage +-------------- + +Collect coverage tool results. + +:: + + ctest_coverage([BUILD build_dir] [RETURN_VALUE res] [APPEND] + [LABELS label1 [label2 [...]]]) + +Perform the coverage of the given build directory and stores results +in Coverage.xml. The second argument is a variable that will hold +value. + +The LABELS option filters the coverage report to include only source +files labeled with at least one of the labels specified. + +The APPEND option marks results for append to those previously +submitted to a dashboard server since the last ctest_start. Append +semantics are defined by the dashboard server in use. diff --git a/Help/command/ctest_empty_binary_directory.rst b/Help/command/ctest_empty_binary_directory.rst new file mode 100644 index 0000000..7753667 --- /dev/null +++ b/Help/command/ctest_empty_binary_directory.rst @@ -0,0 +1,12 @@ +ctest_empty_binary_directory +---------------------------- + +empties the binary directory + +:: + + ctest_empty_binary_directory( directory ) + +Removes a binary directory. This command will perform some checks +prior to deleting the directory in an attempt to avoid malicious or +accidental directory deletion. diff --git a/Help/command/ctest_memcheck.rst b/Help/command/ctest_memcheck.rst new file mode 100644 index 0000000..ca47ed0 --- /dev/null +++ b/Help/command/ctest_memcheck.rst @@ -0,0 +1,28 @@ +ctest_memcheck +-------------- + +Run tests with a dynamic analysis tool. + +:: + + ctest_memcheck([BUILD build_dir] [RETURN_VALUE res] [APPEND] + [START start number] [END end number] + [STRIDE stride number] [EXCLUDE exclude regex ] + [INCLUDE include regex] + [EXCLUDE_LABEL exclude regex] + [INCLUDE_LABEL label regex] + [PARALLEL_LEVEL level] ) + +Tests the given build directory and stores results in MemCheck.xml. +The second argument is a variable that will hold value. Optionally, +you can specify the starting test number START, the ending test number +END, the number of tests to skip between each test STRIDE, a regular +expression for tests to run INCLUDE, or a regular expression for tests +not to run EXCLUDE. EXCLUDE_LABEL and INCLUDE_LABEL are regular +expressions for tests to be included or excluded by the test property +LABEL. PARALLEL_LEVEL should be set to a positive number representing +the number of tests to be run in parallel. + +The APPEND option marks results for append to those previously +submitted to a dashboard server since the last ctest_start. Append +semantics are defined by the dashboard server in use. diff --git a/Help/command/ctest_read_custom_files.rst b/Help/command/ctest_read_custom_files.rst new file mode 100644 index 0000000..0bc57cd --- /dev/null +++ b/Help/command/ctest_read_custom_files.rst @@ -0,0 +1,11 @@ +ctest_read_custom_files +----------------------- + +read CTestCustom files. + +:: + + ctest_read_custom_files( directory ... ) + +Read all the CTestCustom.ctest or CTestCustom.cmake files from the +given directory. diff --git a/Help/command/ctest_run_script.rst b/Help/command/ctest_run_script.rst new file mode 100644 index 0000000..0f35019 --- /dev/null +++ b/Help/command/ctest_run_script.rst @@ -0,0 +1,15 @@ +ctest_run_script +---------------- + +runs a ctest -S script + +:: + + ctest_run_script([NEW_PROCESS] script_file_name script_file_name1 + script_file_name2 ... [RETURN_VALUE var]) + +Runs a script or scripts much like if it was run from ctest -S. If no +argument is provided then the current script is run using the current +settings of the variables. If NEW_PROCESS is specified then each +script will be run in a separate process.If RETURN_VALUE is specified +the return value of the last script run will be put into var. diff --git a/Help/command/ctest_sleep.rst b/Help/command/ctest_sleep.rst new file mode 100644 index 0000000..16a914c --- /dev/null +++ b/Help/command/ctest_sleep.rst @@ -0,0 +1,16 @@ +ctest_sleep +----------- + +sleeps for some amount of time + +:: + + ctest_sleep() + +Sleep for given number of seconds. + +:: + + ctest_sleep( ) + +Sleep for t=(time1 + duration - time2) seconds if t > 0. diff --git a/Help/command/ctest_start.rst b/Help/command/ctest_start.rst new file mode 100644 index 0000000..f16142e --- /dev/null +++ b/Help/command/ctest_start.rst @@ -0,0 +1,16 @@ +ctest_start +----------- + +Starts the testing for a given model + +:: + + ctest_start(Model [TRACK ] [APPEND] [source [binary]]) + +Starts the testing for a given model. The command should be called +after the binary directory is initialized. If the 'source' and +'binary' directory are not specified, it reads the +CTEST_SOURCE_DIRECTORY and CTEST_BINARY_DIRECTORY. If the track is +specified, the submissions will go to the specified track. If APPEND +is used, the existing TAG is used rather than creating a new one based +on the current time stamp. diff --git a/Help/command/ctest_submit.rst b/Help/command/ctest_submit.rst new file mode 100644 index 0000000..29d2f5d --- /dev/null +++ b/Help/command/ctest_submit.rst @@ -0,0 +1,34 @@ +ctest_submit +------------ + +Submit results to a dashboard server. + +:: + + ctest_submit([PARTS ...] [FILES ...] [RETRY_COUNT count] [RETRY_DELAY delay][RETURN_VALUE res]) + +By default all available parts are submitted if no PARTS or FILES are +specified. The PARTS option lists a subset of parts to be submitted. +Valid part names are: + +:: + + Start = nothing + Update = ctest_update results, in Update.xml + Configure = ctest_configure results, in Configure.xml + Build = ctest_build results, in Build.xml + Test = ctest_test results, in Test.xml + Coverage = ctest_coverage results, in Coverage.xml + MemCheck = ctest_memcheck results, in DynamicAnalysis.xml + Notes = Files listed by CTEST_NOTES_FILES, in Notes.xml + ExtraFiles = Files listed by CTEST_EXTRA_SUBMIT_FILES + Submit = nothing + +The FILES option explicitly lists specific files to be submitted. +Each individual file must exist at the time of the call. + +The RETRY_DELAY option specifies how long in seconds to wait after a +timed-out submission before attempting to re-submit. + +The RETRY_COUNT option specifies how many times to retry a timed-out +submission. diff --git a/Help/command/ctest_test.rst b/Help/command/ctest_test.rst new file mode 100644 index 0000000..5f28083 --- /dev/null +++ b/Help/command/ctest_test.rst @@ -0,0 +1,33 @@ +ctest_test +---------- + +Run tests in the project build tree. + +:: + + ctest_test([BUILD build_dir] [APPEND] + [START start number] [END end number] + [STRIDE stride number] [EXCLUDE exclude regex ] + [INCLUDE include regex] [RETURN_VALUE res] + [EXCLUDE_LABEL exclude regex] + [INCLUDE_LABEL label regex] + [PARALLEL_LEVEL level] + [SCHEDULE_RANDOM on] + [STOP_TIME time of day]) + +Tests the given build directory and stores results in Test.xml. The +second argument is a variable that will hold value. Optionally, you +can specify the starting test number START, the ending test number +END, the number of tests to skip between each test STRIDE, a regular +expression for tests to run INCLUDE, or a regular expression for tests +to not run EXCLUDE. EXCLUDE_LABEL and INCLUDE_LABEL are regular +expression for test to be included or excluded by the test property +LABEL. PARALLEL_LEVEL should be set to a positive number representing +the number of tests to be run in parallel. SCHEDULE_RANDOM will +launch tests in a random order, and is typically used to detect +implicit test dependencies. STOP_TIME is the time of day at which the +tests should all stop running. + +The APPEND option marks results for append to those previously +submitted to a dashboard server since the last ctest_start. Append +semantics are defined by the dashboard server in use. diff --git a/Help/command/ctest_update.rst b/Help/command/ctest_update.rst new file mode 100644 index 0000000..d34e192 --- /dev/null +++ b/Help/command/ctest_update.rst @@ -0,0 +1,13 @@ +ctest_update +------------ + +Update the work tree from version control. + +:: + + ctest_update([SOURCE source] [RETURN_VALUE res]) + +Updates the given source directory and stores results in Update.xml. +If no SOURCE is given, the CTEST_SOURCE_DIRECTORY variable is used. +The RETURN_VALUE option specifies a variable in which to store the +result, which is the number of files updated or -1 on error. diff --git a/Help/command/ctest_upload.rst b/Help/command/ctest_upload.rst new file mode 100644 index 0000000..9156af5 --- /dev/null +++ b/Help/command/ctest_upload.rst @@ -0,0 +1,11 @@ +ctest_upload +------------ + +Upload files to a dashboard server. + +:: + + ctest_upload(FILES ...) + +Pass a list of files to be sent along with the build results to the +dashboard server. diff --git a/Help/command/define_property.rst b/Help/command/define_property.rst new file mode 100644 index 0000000..62bcd1b --- /dev/null +++ b/Help/command/define_property.rst @@ -0,0 +1,45 @@ +define_property +--------------- + +Define and document custom properties. + +:: + + define_property( + PROPERTY [INHERITED] + BRIEF_DOCS [docs...] + FULL_DOCS [docs...]) + +Define one property in a scope for use with the set_property and +get_property commands. This is primarily useful to associate +documentation with property names that may be retrieved with the +get_property command. The first argument determines the kind of scope +in which the property should be used. It must be one of the +following: + +:: + + GLOBAL = associated with the global namespace + DIRECTORY = associated with one directory + TARGET = associated with one target + SOURCE = associated with one source file + TEST = associated with a test named with add_test + VARIABLE = documents a CMake language variable + CACHED_VARIABLE = documents a CMake cache variable + +Note that unlike set_property and get_property no actual scope needs +to be given; only the kind of scope is important. + +The required PROPERTY option is immediately followed by the name of +the property being defined. + +If the INHERITED option then the get_property command will chain up to +the next higher scope when the requested property is not set in the +scope given to the command. DIRECTORY scope chains to GLOBAL. +TARGET, SOURCE, and TEST chain to DIRECTORY. + +The BRIEF_DOCS and FULL_DOCS options are followed by strings to be +associated with the property as its brief and full documentation. +Corresponding options to the get_property command will retrieve the +documentation. diff --git a/Help/command/else.rst b/Help/command/else.rst new file mode 100644 index 0000000..5eece95 --- /dev/null +++ b/Help/command/else.rst @@ -0,0 +1,10 @@ +else +---- + +Starts the else portion of an if block. + +:: + + else(expression) + +See the if command. diff --git a/Help/command/elseif.rst b/Help/command/elseif.rst new file mode 100644 index 0000000..96ee0e9 --- /dev/null +++ b/Help/command/elseif.rst @@ -0,0 +1,10 @@ +elseif +------ + +Starts the elseif portion of an if block. + +:: + + elseif(expression) + +See the if command. diff --git a/Help/command/enable_language.rst b/Help/command/enable_language.rst new file mode 100644 index 0000000..d46ff7e --- /dev/null +++ b/Help/command/enable_language.rst @@ -0,0 +1,22 @@ +enable_language +--------------- + +Enable a language (CXX/C/Fortran/etc) + +:: + + enable_language( [OPTIONAL] ) + +This command enables support for the named language in CMake. This is +the same as the project command but does not create any of the extra +variables that are created by the project command. Example languages +are CXX, C, Fortran. + +This command must be called in file scope, not in a function call. +Furthermore, it must be called in the highest directory common to all +targets using the named language directly for compiling sources or +indirectly through link dependencies. It is simplest to enable all +needed languages in the top-level directory of a project. + +The OPTIONAL keyword is a placeholder for future implementation and +does not currently work. diff --git a/Help/command/enable_testing.rst b/Help/command/enable_testing.rst new file mode 100644 index 0000000..41ecd5b --- /dev/null +++ b/Help/command/enable_testing.rst @@ -0,0 +1,13 @@ +enable_testing +-------------- + +Enable testing for current directory and below. + +:: + + enable_testing() + +Enables testing for this directory and below. See also the add_test +command. Note that ctest expects to find a test file in the build +directory root. Therefore, this command should be in the source +directory root. diff --git a/Help/command/endforeach.rst b/Help/command/endforeach.rst new file mode 100644 index 0000000..f23552d --- /dev/null +++ b/Help/command/endforeach.rst @@ -0,0 +1,10 @@ +endforeach +---------- + +Ends a list of commands in a FOREACH block. + +:: + + endforeach(expression) + +See the FOREACH command. diff --git a/Help/command/endfunction.rst b/Help/command/endfunction.rst new file mode 100644 index 0000000..63e70ba --- /dev/null +++ b/Help/command/endfunction.rst @@ -0,0 +1,10 @@ +endfunction +----------- + +Ends a list of commands in a function block. + +:: + + endfunction(expression) + +See the function command. diff --git a/Help/command/endif.rst b/Help/command/endif.rst new file mode 100644 index 0000000..4c9955c --- /dev/null +++ b/Help/command/endif.rst @@ -0,0 +1,10 @@ +endif +----- + +Ends a list of commands in an if block. + +:: + + endif(expression) + +See the if command. diff --git a/Help/command/endmacro.rst b/Help/command/endmacro.rst new file mode 100644 index 0000000..524fc80 --- /dev/null +++ b/Help/command/endmacro.rst @@ -0,0 +1,10 @@ +endmacro +-------- + +Ends a list of commands in a macro block. + +:: + + endmacro(expression) + +See the macro command. diff --git a/Help/command/endwhile.rst b/Help/command/endwhile.rst new file mode 100644 index 0000000..11fdc1b --- /dev/null +++ b/Help/command/endwhile.rst @@ -0,0 +1,10 @@ +endwhile +-------- + +Ends a list of commands in a while block. + +:: + + endwhile(expression) + +See the while command. diff --git a/Help/command/exec_program.rst b/Help/command/exec_program.rst new file mode 100644 index 0000000..aaa0dac --- /dev/null +++ b/Help/command/exec_program.rst @@ -0,0 +1,24 @@ +exec_program +------------ + +Deprecated. Use the execute_process() command instead. + +Run an executable program during the processing of the CMakeList.txt +file. + +:: + + exec_program(Executable [directory in which to run] + [ARGS ] + [OUTPUT_VARIABLE ] + [RETURN_VALUE ]) + +The executable is run in the optionally specified directory. The +executable can include arguments if it is double quoted, but it is +better to use the optional ARGS argument to specify arguments to the +program. This is because cmake will then be able to escape spaces in +the executable path. An optional argument OUTPUT_VARIABLE specifies a +variable in which to store the output. To capture the return value of +the execution, provide a RETURN_VALUE. If OUTPUT_VARIABLE is +specified, then no output will go to the stdout/stderr of the console +running cmake. diff --git a/Help/command/execute_process.rst b/Help/command/execute_process.rst new file mode 100644 index 0000000..3f0ccc2 --- /dev/null +++ b/Help/command/execute_process.rst @@ -0,0 +1,48 @@ +execute_process +--------------- + +Execute one or more child processes. + +:: + + execute_process(COMMAND [args1...]] + [COMMAND [args2...] [...]] + [WORKING_DIRECTORY ] + [TIMEOUT ] + [RESULT_VARIABLE ] + [OUTPUT_VARIABLE ] + [ERROR_VARIABLE ] + [INPUT_FILE ] + [OUTPUT_FILE ] + [ERROR_FILE ] + [OUTPUT_QUIET] + [ERROR_QUIET] + [OUTPUT_STRIP_TRAILING_WHITESPACE] + [ERROR_STRIP_TRAILING_WHITESPACE]) + +Runs the given sequence of one or more commands with the standard +output of each process piped to the standard input of the next. A +single standard error pipe is used for all processes. If +WORKING_DIRECTORY is given the named directory will be set as the +current working directory of the child processes. If TIMEOUT is given +the child processes will be terminated if they do not finish in the +specified number of seconds (fractions are allowed). If +RESULT_VARIABLE is given the variable will be set to contain the +result of running the processes. This will be an integer return code +from the last child or a string describing an error condition. If +OUTPUT_VARIABLE or ERROR_VARIABLE are given the variable named will be +set with the contents of the standard output and standard error pipes +respectively. If the same variable is named for both pipes their +output will be merged in the order produced. If INPUT_FILE, +OUTPUT_FILE, or ERROR_FILE is given the file named will be attached to +the standard input of the first process, standard output of the last +process, or standard error of all processes respectively. If +OUTPUT_QUIET or ERROR_QUIET is given then the standard output or +standard error results will be quietly ignored. If more than one +OUTPUT_* or ERROR_* option is given for the same pipe the precedence +is not specified. If no OUTPUT_* or ERROR_* options are given the +output will be shared with the corresponding pipes of the CMake +process itself. + +The execute_process command is a newer more powerful version of +exec_program, but the old command has been kept for compatibility. diff --git a/Help/command/export.rst b/Help/command/export.rst new file mode 100644 index 0000000..d9f63f0 --- /dev/null +++ b/Help/command/export.rst @@ -0,0 +1,44 @@ +export +------ + +Export targets from the build tree for use by outside projects. + +:: + + export(TARGETS [target1 [target2 [...]]] [NAMESPACE ] + [APPEND] FILE [EXPORT_LINK_INTERFACE_LIBRARIES]) + +Create a file that may be included by outside projects to +import targets from the current project's build tree. This is useful +during cross-compiling to build utility executables that can run on +the host platform in one project and then import them into another +project being compiled for the target platform. If the NAMESPACE +option is given the string will be prepended to all target +names written to the file. If the APPEND option is given the +generated code will be appended to the file instead of overwriting it. +The EXPORT_LINK_INTERFACE_LIBRARIES keyword, if present, causes the +contents of the properties matching +(IMPORTED_)?LINK_INTERFACE_LIBRARIES(_)? to be exported, when +policy CMP0022 is NEW. If a library target is included in the export +but a target to which it links is not included the behavior is +unspecified. + +The file created by this command is specific to the build tree and +should never be installed. See the install(EXPORT) command to export +targets from an installation tree. + +The properties set on the generated IMPORTED targets will have the +same values as the final values of the input TARGETS. + +:: + + export(PACKAGE ) + +Store the current build directory in the CMake user package registry +for package . The find_package command may consider the +directory while searching for package . This helps dependent +projects find and use a package from the current project's build tree +without help from the user. Note that the entry in the package +registry that this command creates works only in conjunction with a +package configuration file (Config.cmake) that works with the +build tree. diff --git a/Help/command/export_library_dependencies.rst b/Help/command/export_library_dependencies.rst new file mode 100644 index 0000000..c09f3d5 --- /dev/null +++ b/Help/command/export_library_dependencies.rst @@ -0,0 +1,26 @@ +export_library_dependencies +--------------------------- + +Deprecated. Use INSTALL(EXPORT) or EXPORT command. + +This command generates an old-style library dependencies file. +Projects requiring CMake 2.6 or later should not use the command. Use +instead the install(EXPORT) command to help export targets from an +installation tree and the export() command to export targets from a +build tree. + +The old-style library dependencies file does not take into account +per-configuration names of libraries or the LINK_INTERFACE_LIBRARIES +target property. + +:: + + export_library_dependencies( [APPEND]) + +Create a file named that can be included into a CMake listfile +with the INCLUDE command. The file will contain a number of SET +commands that will set all the variables needed for library dependency +information. This should be the last command in the top level +CMakeLists.txt file of the project. If the APPEND option is +specified, the SET commands will be appended to the given file instead +of replacing it. diff --git a/Help/command/file.rst b/Help/command/file.rst new file mode 100644 index 0000000..83ade1d --- /dev/null +++ b/Help/command/file.rst @@ -0,0 +1,213 @@ +file +---- + +File manipulation command. + +:: + + file(WRITE filename "message to write"... ) + file(APPEND filename "message to write"... ) + file(READ filename variable [LIMIT numBytes] [OFFSET offset] [HEX]) + file( filename variable) + file(STRINGS filename variable [LIMIT_COUNT num] + [LIMIT_INPUT numBytes] [LIMIT_OUTPUT numBytes] + [LENGTH_MINIMUM numBytes] [LENGTH_MAXIMUM numBytes] + [NEWLINE_CONSUME] [REGEX regex] + [NO_HEX_CONVERSION]) + file(GLOB variable [RELATIVE path] [globbing expressions]...) + file(GLOB_RECURSE variable [RELATIVE path] + [FOLLOW_SYMLINKS] [globbing expressions]...) + file(RENAME ) + file(REMOVE [file1 ...]) + file(REMOVE_RECURSE [file1 ...]) + file(MAKE_DIRECTORY [directory1 directory2 ...]) + file(RELATIVE_PATH variable directory file) + file(TO_CMAKE_PATH path result) + file(TO_NATIVE_PATH path result) + file(DOWNLOAD url file [INACTIVITY_TIMEOUT timeout] + [TIMEOUT timeout] [STATUS status] [LOG log] [SHOW_PROGRESS] + [EXPECTED_HASH ALGO=value] [EXPECTED_MD5 sum] + [TLS_VERIFY on|off] [TLS_CAINFO file]) + file(UPLOAD filename url [INACTIVITY_TIMEOUT timeout] + [TIMEOUT timeout] [STATUS status] [LOG log] [SHOW_PROGRESS]) + file(TIMESTAMP filename variable [] [UTC]) + file(GENERATE OUTPUT output_file + + [CONDITION expression]) + +WRITE will write a message into a file called 'filename'. It +overwrites the file if it already exists, and creates the file if it +does not exist. (If the file is a build input, use configure_file to +update the file only when its content changes.) + +APPEND will write a message into a file same as WRITE, except it will +append it to the end of the file + +READ will read the content of a file and store it into the variable. +It will start at the given offset and read up to numBytes. If the +argument HEX is given, the binary data will be converted to +hexadecimal representation and this will be stored in the variable. + +MD5, SHA1, SHA224, SHA256, SHA384, and SHA512 will compute a +cryptographic hash of the content of a file. + +STRINGS will parse a list of ASCII strings from a file and store it in +a variable. Binary data in the file are ignored. Carriage return +(CR) characters are ignored. It works also for Intel Hex and Motorola +S-record files, which are automatically converted to binary format +when reading them. Disable this using NO_HEX_CONVERSION. + +LIMIT_COUNT sets the maximum number of strings to return. LIMIT_INPUT +sets the maximum number of bytes to read from the input file. +LIMIT_OUTPUT sets the maximum number of bytes to store in the output +variable. LENGTH_MINIMUM sets the minimum length of a string to +return. Shorter strings are ignored. LENGTH_MAXIMUM sets the maximum +length of a string to return. Longer strings are split into strings +no longer than the maximum length. NEWLINE_CONSUME allows newlines to +be included in strings instead of terminating them. + +REGEX specifies a regular expression that a string must match to be +returned. Typical usage + +:: + + file(STRINGS myfile.txt myfile) + +stores a list in the variable "myfile" in which each item is a line +from the input file. + +GLOB will generate a list of all files that match the globbing +expressions and store it into the variable. Globbing expressions are +similar to regular expressions, but much simpler. If RELATIVE flag is +specified for an expression, the results will be returned as a +relative path to the given path. (We do not recommend using GLOB to +collect a list of source files from your source tree. If no +CMakeLists.txt file changes when a source is added or removed then the +generated build system cannot know when to ask CMake to regenerate.) + +Examples of globbing expressions include: + +:: + + *.cxx - match all files with extension cxx + *.vt? - match all files with extension vta,...,vtz + f[3-5].txt - match files f3.txt, f4.txt, f5.txt + +GLOB_RECURSE will generate a list similar to the regular GLOB, except +it will traverse all the subdirectories of the matched directory and +match the files. Subdirectories that are symlinks are only traversed +if FOLLOW_SYMLINKS is given or cmake policy CMP0009 is not set to NEW. +See cmake --help-policy CMP0009 for more information. + +Examples of recursive globbing include: + +:: + + /dir/*.py - match all python files in /dir and subdirectories + +MAKE_DIRECTORY will create the given directories, also if their parent +directories don't exist yet + +RENAME moves a file or directory within a filesystem, replacing the +destination atomically. + +REMOVE will remove the given files, also in subdirectories + +REMOVE_RECURSE will remove the given files and directories, also +non-empty directories + +RELATIVE_PATH will determine relative path from directory to the given +file. + +TO_CMAKE_PATH will convert path into a cmake style path with unix /. +The input can be a single path or a system path like "$ENV{PATH}". +Note the double quotes around the ENV call TO_CMAKE_PATH only takes +one argument. This command will also convert the native list +delimiters for a list of paths like the PATH environment variable. + +TO_NATIVE_PATH works just like TO_CMAKE_PATH, but will convert from a +cmake style path into the native path style \ for windows and / for +UNIX. + +DOWNLOAD will download the given URL to the given file. If LOG var is +specified a log of the download will be put in var. If STATUS var is +specified the status of the operation will be put in var. The status +is returned in a list of length 2. The first element is the numeric +return value for the operation, and the second element is a string +value for the error. A 0 numeric error means no error in the +operation. If TIMEOUT time is specified, the operation will timeout +after time seconds, time should be specified as an integer. The +INACTIVITY_TIMEOUT specifies an integer number of seconds of +inactivity after which the operation should terminate. If +EXPECTED_HASH ALGO=value is specified, the operation will verify that +the downloaded file's actual hash matches the expected value, where +ALGO is one of MD5, SHA1, SHA224, SHA256, SHA384, or SHA512. If it +does not match, the operation fails with an error. ("EXPECTED_MD5 +sum" is short-hand for "EXPECTED_HASH MD5=sum".) If SHOW_PROGRESS is +specified, progress information will be printed as status messages +until the operation is complete. For https URLs CMake must be built +with OpenSSL. TLS/SSL certificates are not checked by default. Set +TLS_VERIFY to ON to check certificates and/or use EXPECTED_HASH to +verify downloaded content. Set TLS_CAINFO to specify a custom +Certificate Authority file. If either TLS option is not given CMake +will check variables CMAKE_TLS_VERIFY and CMAKE_TLS_CAINFO, +respectively. + +UPLOAD will upload the given file to the given URL. If LOG var is +specified a log of the upload will be put in var. If STATUS var is +specified the status of the operation will be put in var. The status +is returned in a list of length 2. The first element is the numeric +return value for the operation, and the second element is a string +value for the error. A 0 numeric error means no error in the +operation. If TIMEOUT time is specified, the operation will timeout +after time seconds, time should be specified as an integer. The +INACTIVITY_TIMEOUT specifies an integer number of seconds of +inactivity after which the operation should terminate. If +SHOW_PROGRESS is specified, progress information will be printed as +status messages until the operation is complete. + +TIMESTAMP will write a string representation of the modification time +of filename to variable. + +Should the command be unable to obtain a timestamp variable will be +set to the empty string "". + +See documentation of the string TIMESTAMP sub-command for more +details. + +The file() command also provides COPY and INSTALL signatures: + +:: + + file( files... DESTINATION + [FILE_PERMISSIONS permissions...] + [DIRECTORY_PERMISSIONS permissions...] + [NO_SOURCE_PERMISSIONS] [USE_SOURCE_PERMISSIONS] + [FILES_MATCHING] + [[PATTERN | REGEX ] + [EXCLUDE] [PERMISSIONS permissions...]] [...]) + +The COPY signature copies files, directories, and symlinks to a +destination folder. Relative input paths are evaluated with respect +to the current source directory, and a relative destination is +evaluated with respect to the current build directory. Copying +preserves input file timestamps, and optimizes out a file if it exists +at the destination with the same timestamp. Copying preserves input +permissions unless explicit permissions or NO_SOURCE_PERMISSIONS are +given (default is USE_SOURCE_PERMISSIONS). See the install(DIRECTORY) +command for documentation of permissions, PATTERN, REGEX, and EXCLUDE +options. + +The INSTALL signature differs slightly from COPY: it prints status +messages, and NO_SOURCE_PERMISSIONS is default. Installation scripts +generated by the install() command use this signature (with some +undocumented options for internal use). + +GENERATE will write an with content from an +, or from . The output is generated +conditionally based on the content of the . The file is +written at CMake generate-time and the input may contain generator +expressions. The , and may also +contain generator expressions. The must evaluate to +either '0' or '1'. The must evaluate to a unique name +among all configurations and among all invocations of file(GENERATE). diff --git a/Help/command/find_file.rst b/Help/command/find_file.rst new file mode 100644 index 0000000..c5956f8 --- /dev/null +++ b/Help/command/find_file.rst @@ -0,0 +1,154 @@ +find_file +--------- + +Find the full path to a file. + +:: + + find_file( name1 [path1 path2 ...]) + +This is the short-hand signature for the command that is sufficient in +many cases. It is the same as find_file( name1 [PATHS path1 +path2 ...]) + +:: + + find_file( + + name | NAMES name1 [name2 ...] + [HINTS path1 [path2 ... ENV var]] + [PATHS path1 [path2 ... ENV var]] + [PATH_SUFFIXES suffix1 [suffix2 ...]] + [DOC "cache documentation string"] + [NO_DEFAULT_PATH] + [NO_CMAKE_ENVIRONMENT_PATH] + [NO_CMAKE_PATH] + [NO_SYSTEM_ENVIRONMENT_PATH] + [NO_CMAKE_SYSTEM_PATH] + [CMAKE_FIND_ROOT_PATH_BOTH | + ONLY_CMAKE_FIND_ROOT_PATH | + NO_CMAKE_FIND_ROOT_PATH] + ) + +This command is used to find a full path to named file. A cache entry +named by is created to store the result of this command. If the +full path to a file is found the result is stored in the variable and +the search will not be repeated unless the variable is cleared. If +nothing is found, the result will be -NOTFOUND, and the search +will be attempted again the next time find_file is invoked with the +same variable. The name of the full path to a file that is searched +for is specified by the names listed after the NAMES argument. +Additional search locations can be specified after the PATHS argument. +If ENV var is found in the HINTS or PATHS section the environment +variable var will be read and converted from a system environment +variable to a cmake style list of paths. For example ENV PATH would +be a way to list the system path variable. The argument after DOC +will be used for the documentation string in the cache. PATH_SUFFIXES +specifies additional subdirectories to check below each search path. + +If NO_DEFAULT_PATH is specified, then no additional paths are added to +the search. If NO_DEFAULT_PATH is not specified, the search process +is as follows: + +1. Search paths specified in cmake-specific cache variables. These +are intended to be used on the command line with a -DVAR=value. This +can be skipped if NO_CMAKE_PATH is passed. + +:: + + /include/ if CMAKE_LIBRARY_ARCHITECTURE is set, and + /include for each in CMAKE_PREFIX_PATH + CMAKE_INCLUDE_PATH + CMAKE_FRAMEWORK_PATH + +2. Search paths specified in cmake-specific environment variables. +These are intended to be set in the user's shell configuration. This +can be skipped if NO_CMAKE_ENVIRONMENT_PATH is passed. + +:: + + /include/ if CMAKE_LIBRARY_ARCHITECTURE is set, and + /include for each in CMAKE_PREFIX_PATH + CMAKE_INCLUDE_PATH + CMAKE_FRAMEWORK_PATH + +3. Search the paths specified by the HINTS option. These should be +paths computed by system introspection, such as a hint provided by the +location of another item already found. Hard-coded guesses should be +specified with the PATHS option. + +4. Search the standard system environment variables. This can be +skipped if NO_SYSTEM_ENVIRONMENT_PATH is an argument. + +:: + + PATH + INCLUDE + +5. Search cmake variables defined in the Platform files for the +current system. This can be skipped if NO_CMAKE_SYSTEM_PATH is +passed. + +:: + + /include/ if CMAKE_LIBRARY_ARCHITECTURE is set, and + /include for each in CMAKE_SYSTEM_PREFIX_PATH + CMAKE_SYSTEM_INCLUDE_PATH + CMAKE_SYSTEM_FRAMEWORK_PATH + +6. Search the paths specified by the PATHS option or in the +short-hand version of the command. These are typically hard-coded +guesses. + +On Darwin or systems supporting OS X Frameworks, the cmake variable +CMAKE_FIND_FRAMEWORK can be set to empty or one of the following: + +:: + + "FIRST" - Try to find frameworks before standard + libraries or headers. This is the default on Darwin. + "LAST" - Try to find frameworks after standard + libraries or headers. + "ONLY" - Only try to find frameworks. + "NEVER" - Never try to find frameworks. + +On Darwin or systems supporting OS X Application Bundles, the cmake +variable CMAKE_FIND_APPBUNDLE can be set to empty or one of the +following: + +:: + + "FIRST" - Try to find application bundles before standard + programs. This is the default on Darwin. + "LAST" - Try to find application bundles after standard + programs. + "ONLY" - Only try to find application bundles. + "NEVER" - Never try to find application bundles. + +The CMake variable CMAKE_FIND_ROOT_PATH specifies one or more +directories to be prepended to all other search directories. This +effectively "re-roots" the entire search under given locations. By +default it is empty. It is especially useful when cross-compiling to +point to the root directory of the target environment and CMake will +search there too. By default at first the directories listed in +CMAKE_FIND_ROOT_PATH and then the non-rooted directories will be +searched. The default behavior can be adjusted by setting +CMAKE_FIND_ROOT_PATH_MODE_INCLUDE. This behavior can be manually +overridden on a per-call basis. By using CMAKE_FIND_ROOT_PATH_BOTH +the search order will be as described above. If +NO_CMAKE_FIND_ROOT_PATH is used then CMAKE_FIND_ROOT_PATH will not be +used. If ONLY_CMAKE_FIND_ROOT_PATH is used then only the re-rooted +directories will be searched. + +The default search order is designed to be most-specific to +least-specific for common use cases. Projects may override the order +by simply calling the command multiple times and using the NO_* +options: + +:: + + find_file( NAMES name PATHS paths... NO_DEFAULT_PATH) + find_file( NAMES name) + +Once one of the calls succeeds the result variable will be set and +stored in the cache so that no call will search again. diff --git a/Help/command/find_library.rst b/Help/command/find_library.rst new file mode 100644 index 0000000..39ec4af --- /dev/null +++ b/Help/command/find_library.rst @@ -0,0 +1,171 @@ +find_library +------------ + +Find a library. + +:: + + find_library( name1 [path1 path2 ...]) + +This is the short-hand signature for the command that is sufficient in +many cases. It is the same as find_library( name1 [PATHS path1 +path2 ...]) + +:: + + find_library( + + name | NAMES name1 [name2 ...] [NAMES_PER_DIR] + [HINTS path1 [path2 ... ENV var]] + [PATHS path1 [path2 ... ENV var]] + [PATH_SUFFIXES suffix1 [suffix2 ...]] + [DOC "cache documentation string"] + [NO_DEFAULT_PATH] + [NO_CMAKE_ENVIRONMENT_PATH] + [NO_CMAKE_PATH] + [NO_SYSTEM_ENVIRONMENT_PATH] + [NO_CMAKE_SYSTEM_PATH] + [CMAKE_FIND_ROOT_PATH_BOTH | + ONLY_CMAKE_FIND_ROOT_PATH | + NO_CMAKE_FIND_ROOT_PATH] + ) + +This command is used to find a library. A cache entry named by +is created to store the result of this command. If the library is +found the result is stored in the variable and the search will not be +repeated unless the variable is cleared. If nothing is found, the +result will be -NOTFOUND, and the search will be attempted again +the next time find_library is invoked with the same variable. The +name of the library that is searched for is specified by the names +listed after the NAMES argument. Additional search locations can be +specified after the PATHS argument. If ENV var is found in the HINTS +or PATHS section the environment variable var will be read and +converted from a system environment variable to a cmake style list of +paths. For example ENV PATH would be a way to list the system path +variable. The argument after DOC will be used for the documentation +string in the cache. PATH_SUFFIXES specifies additional +subdirectories to check below each search path. + +If NO_DEFAULT_PATH is specified, then no additional paths are added to +the search. If NO_DEFAULT_PATH is not specified, the search process +is as follows: + +1. Search paths specified in cmake-specific cache variables. These +are intended to be used on the command line with a -DVAR=value. This +can be skipped if NO_CMAKE_PATH is passed. + +:: + + /lib/ if CMAKE_LIBRARY_ARCHITECTURE is set, and + /lib for each in CMAKE_PREFIX_PATH + CMAKE_LIBRARY_PATH + CMAKE_FRAMEWORK_PATH + +2. Search paths specified in cmake-specific environment variables. +These are intended to be set in the user's shell configuration. This +can be skipped if NO_CMAKE_ENVIRONMENT_PATH is passed. + +:: + + /lib/ if CMAKE_LIBRARY_ARCHITECTURE is set, and + /lib for each in CMAKE_PREFIX_PATH + CMAKE_LIBRARY_PATH + CMAKE_FRAMEWORK_PATH + +3. Search the paths specified by the HINTS option. These should be +paths computed by system introspection, such as a hint provided by the +location of another item already found. Hard-coded guesses should be +specified with the PATHS option. + +4. Search the standard system environment variables. This can be +skipped if NO_SYSTEM_ENVIRONMENT_PATH is an argument. + +:: + + PATH + LIB + +5. Search cmake variables defined in the Platform files for the +current system. This can be skipped if NO_CMAKE_SYSTEM_PATH is +passed. + +:: + + /lib/ if CMAKE_LIBRARY_ARCHITECTURE is set, and + /lib for each in CMAKE_SYSTEM_PREFIX_PATH + CMAKE_SYSTEM_LIBRARY_PATH + CMAKE_SYSTEM_FRAMEWORK_PATH + +6. Search the paths specified by the PATHS option or in the +short-hand version of the command. These are typically hard-coded +guesses. + +On Darwin or systems supporting OS X Frameworks, the cmake variable +CMAKE_FIND_FRAMEWORK can be set to empty or one of the following: + +:: + + "FIRST" - Try to find frameworks before standard + libraries or headers. This is the default on Darwin. + "LAST" - Try to find frameworks after standard + libraries or headers. + "ONLY" - Only try to find frameworks. + "NEVER" - Never try to find frameworks. + +On Darwin or systems supporting OS X Application Bundles, the cmake +variable CMAKE_FIND_APPBUNDLE can be set to empty or one of the +following: + +:: + + "FIRST" - Try to find application bundles before standard + programs. This is the default on Darwin. + "LAST" - Try to find application bundles after standard + programs. + "ONLY" - Only try to find application bundles. + "NEVER" - Never try to find application bundles. + +The CMake variable CMAKE_FIND_ROOT_PATH specifies one or more +directories to be prepended to all other search directories. This +effectively "re-roots" the entire search under given locations. By +default it is empty. It is especially useful when cross-compiling to +point to the root directory of the target environment and CMake will +search there too. By default at first the directories listed in +CMAKE_FIND_ROOT_PATH and then the non-rooted directories will be +searched. The default behavior can be adjusted by setting +CMAKE_FIND_ROOT_PATH_MODE_LIBRARY. This behavior can be manually +overridden on a per-call basis. By using CMAKE_FIND_ROOT_PATH_BOTH +the search order will be as described above. If +NO_CMAKE_FIND_ROOT_PATH is used then CMAKE_FIND_ROOT_PATH will not be +used. If ONLY_CMAKE_FIND_ROOT_PATH is used then only the re-rooted +directories will be searched. + +The default search order is designed to be most-specific to +least-specific for common use cases. Projects may override the order +by simply calling the command multiple times and using the NO_* +options: + +:: + + find_library( NAMES name PATHS paths... NO_DEFAULT_PATH) + find_library( NAMES name) + +Once one of the calls succeeds the result variable will be set and +stored in the cache so that no call will search again. + +When more than one value is given to the NAMES option this command by +default will consider one name at a time and search every directory +for it. The NAMES_PER_DIR option tells this command to consider one +directory at a time and search for all names in it. + +If the library found is a framework, then VAR will be set to the full +path to the framework /A.framework. When a full path to a +framework is used as a library, CMake will use a -framework A, and a +-F to link the framework to the target. + +If the global property FIND_LIBRARY_USE_LIB64_PATHS is set all search +paths will be tested as normal, with "64/" appended, and with all +matches of "lib/" replaced with "lib64/". This property is +automatically set for the platforms that are known to need it if at +least one of the languages supported by the PROJECT command is +enabled. diff --git a/Help/command/find_package.rst b/Help/command/find_package.rst new file mode 100644 index 0000000..27d0ac7 --- /dev/null +++ b/Help/command/find_package.rst @@ -0,0 +1,406 @@ +find_package +------------ + +Load settings for an external project. + +:: + + find_package( [version] [EXACT] [QUIET] [MODULE] + [REQUIRED] [[COMPONENTS] [components...]] + [OPTIONAL_COMPONENTS components...] + [NO_POLICY_SCOPE]) + +Finds and loads settings from an external project. _FOUND +will be set to indicate whether the package was found. When the +package is found package-specific information is provided through +variables and imported targets documented by the package itself. The +QUIET option disables messages if the package cannot be found. The +MODULE option disables the second signature documented below. The +REQUIRED option stops processing with an error message if the package +cannot be found. + +A package-specific list of required components may be listed after the +COMPONENTS option (or after the REQUIRED option if present). +Additional optional components may be listed after +OPTIONAL_COMPONENTS. Available components and their influence on +whether a package is considered to be found are defined by the target +package. + +The [version] argument requests a version with which the package found +should be compatible (format is major[.minor[.patch[.tweak]]]). The +EXACT option requests that the version be matched exactly. If no +[version] and/or component list is given to a recursive invocation +inside a find-module, the corresponding arguments are forwarded +automatically from the outer call (including the EXACT flag for +[version]). Version support is currently provided only on a +package-by-package basis (details below). + +User code should generally look for packages using the above simple +signature. The remainder of this command documentation specifies the +full command signature and details of the search process. Project +maintainers wishing to provide a package to be found by this command +are encouraged to read on. + +The command has two modes by which it searches for packages: "Module" +mode and "Config" mode. Module mode is available when the command is +invoked with the above reduced signature. CMake searches for a file +called "Find.cmake" in the CMAKE_MODULE_PATH followed by the +CMake installation. If the file is found, it is read and processed by +CMake. It is responsible for finding the package, checking the +version, and producing any needed messages. Many find-modules provide +limited or no support for versioning; check the module documentation. +If no module is found and the MODULE option is not given the command +proceeds to Config mode. + +The complete Config mode command signature is: + +:: + + find_package( [version] [EXACT] [QUIET] + [REQUIRED] [[COMPONENTS] [components...]] + [CONFIG|NO_MODULE] + [NO_POLICY_SCOPE] + [NAMES name1 [name2 ...]] + [CONFIGS config1 [config2 ...]] + [HINTS path1 [path2 ... ]] + [PATHS path1 [path2 ... ]] + [PATH_SUFFIXES suffix1 [suffix2 ...]] + [NO_DEFAULT_PATH] + [NO_CMAKE_ENVIRONMENT_PATH] + [NO_CMAKE_PATH] + [NO_SYSTEM_ENVIRONMENT_PATH] + [NO_CMAKE_PACKAGE_REGISTRY] + [NO_CMAKE_BUILDS_PATH] + [NO_CMAKE_SYSTEM_PATH] + [NO_CMAKE_SYSTEM_PACKAGE_REGISTRY] + [CMAKE_FIND_ROOT_PATH_BOTH | + ONLY_CMAKE_FIND_ROOT_PATH | + NO_CMAKE_FIND_ROOT_PATH]) + +The CONFIG option may be used to skip Module mode explicitly and +switch to Config mode. It is synonymous to using NO_MODULE. Config +mode is also implied by use of options not specified in the reduced +signature. + +Config mode attempts to locate a configuration file provided by the +package to be found. A cache entry called _DIR is created to +hold the directory containing the file. By default the command +searches for a package with the name . If the NAMES option +is given the names following it are used instead of . The +command searches for a file called "Config.cmake" or +"-config.cmake" for each name specified. A +replacement set of possible configuration file names may be given +using the CONFIGS option. The search procedure is specified below. +Once found, the configuration file is read and processed by CMake. +Since the file is provided by the package it already knows the +location of package contents. The full path to the configuration file +is stored in the cmake variable _CONFIG. + +All configuration files which have been considered by CMake while +searching for an installation of the package with an appropriate +version are stored in the cmake variable _CONSIDERED_CONFIGS, +the associated versions in _CONSIDERED_VERSIONS. + +If the package configuration file cannot be found CMake will generate +an error describing the problem unless the QUIET argument is +specified. If REQUIRED is specified and the package is not found a +fatal error is generated and the configure step stops executing. If +_DIR has been set to a directory not containing a +configuration file CMake will ignore it and search from scratch. + +When the [version] argument is given Config mode will only find a +version of the package that claims compatibility with the requested +version (format is major[.minor[.patch[.tweak]]]). If the EXACT +option is given only a version of the package claiming an exact match +of the requested version may be found. CMake does not establish any +convention for the meaning of version numbers. Package version +numbers are checked by "version" files provided by the packages +themselves. For a candidate package configuration file +".cmake" the corresponding version file is located next +to it and named either "-version.cmake" or +"Version.cmake". If no such version file is available +then the configuration file is assumed to not be compatible with any +requested version. A basic version file containing generic version +matching code can be created using the macro +write_basic_package_version_file(), see its documentation for more +details. When a version file is found it is loaded to check the +requested version number. The version file is loaded in a nested +scope in which the following variables have been defined: + +:: + + PACKAGE_FIND_NAME = the name + PACKAGE_FIND_VERSION = full requested version string + PACKAGE_FIND_VERSION_MAJOR = major version if requested, else 0 + PACKAGE_FIND_VERSION_MINOR = minor version if requested, else 0 + PACKAGE_FIND_VERSION_PATCH = patch version if requested, else 0 + PACKAGE_FIND_VERSION_TWEAK = tweak version if requested, else 0 + PACKAGE_FIND_VERSION_COUNT = number of version components, 0 to 4 + +The version file checks whether it satisfies the requested version and +sets these variables: + +:: + + PACKAGE_VERSION = full provided version string + PACKAGE_VERSION_EXACT = true if version is exact match + PACKAGE_VERSION_COMPATIBLE = true if version is compatible + PACKAGE_VERSION_UNSUITABLE = true if unsuitable as any version + +These variables are checked by the find_package command to determine +whether the configuration file provides an acceptable version. They +are not available after the find_package call returns. If the version +is acceptable the following variables are set: + +:: + + _VERSION = full provided version string + _VERSION_MAJOR = major version if provided, else 0 + _VERSION_MINOR = minor version if provided, else 0 + _VERSION_PATCH = patch version if provided, else 0 + _VERSION_TWEAK = tweak version if provided, else 0 + _VERSION_COUNT = number of version components, 0 to 4 + +and the corresponding package configuration file is loaded. When +multiple package configuration files are available whose version files +claim compatibility with the version requested it is unspecified which +one is chosen. No attempt is made to choose a highest or closest +version number. + +Config mode provides an elaborate interface and search procedure. +Much of the interface is provided for completeness and for use +internally by find-modules loaded by Module mode. Most user code +should simply call + +:: + + find_package( [major[.minor]] [EXACT] [REQUIRED|QUIET]) + +in order to find a package. Package maintainers providing CMake +package configuration files are encouraged to name and install them +such that the procedure outlined below will find them without +requiring use of additional options. + +CMake constructs a set of possible installation prefixes for the +package. Under each prefix several directories are searched for a +configuration file. The tables below show the directories searched. +Each entry is meant for installation trees following Windows (W), UNIX +(U), or Apple (A) conventions. + +:: + + / (W) + /(cmake|CMake)/ (W) + /*/ (W) + /*/(cmake|CMake)/ (W) + /(lib/|lib|share)/cmake/*/ (U) + /(lib/|lib|share)/*/ (U) + /(lib/|lib|share)/*/(cmake|CMake)/ (U) + +On systems supporting OS X Frameworks and Application Bundles the +following directories are searched for frameworks or bundles +containing a configuration file: + +:: + + /.framework/Resources/ (A) + /.framework/Resources/CMake/ (A) + /.framework/Versions/*/Resources/ (A) + /.framework/Versions/*/Resources/CMake/ (A) + /.app/Contents/Resources/ (A) + /.app/Contents/Resources/CMake/ (A) + +In all cases the is treated as case-insensitive and corresponds +to any of the names specified ( or names given by NAMES). +Paths with lib/ are enabled if CMAKE_LIBRARY_ARCHITECTURE is +set. If PATH_SUFFIXES is specified the suffixes are appended to each +(W) or (U) directory entry one-by-one. + +This set of directories is intended to work in cooperation with +projects that provide configuration files in their installation trees. +Directories above marked with (W) are intended for installations on +Windows where the prefix may point at the top of an application's +installation directory. Those marked with (U) are intended for +installations on UNIX platforms where the prefix is shared by multiple +packages. This is merely a convention, so all (W) and (U) directories +are still searched on all platforms. Directories marked with (A) are +intended for installations on Apple platforms. The cmake variables +CMAKE_FIND_FRAMEWORK and CMAKE_FIND_APPBUNDLE determine the order of +preference as specified below. + +The set of installation prefixes is constructed using the following +steps. If NO_DEFAULT_PATH is specified all NO_* options are enabled. + +1. Search paths specified in cmake-specific cache variables. These +are intended to be used on the command line with a -DVAR=value. This +can be skipped if NO_CMAKE_PATH is passed. + +:: + + CMAKE_PREFIX_PATH + CMAKE_FRAMEWORK_PATH + CMAKE_APPBUNDLE_PATH + +2. Search paths specified in cmake-specific environment variables. +These are intended to be set in the user's shell configuration. This +can be skipped if NO_CMAKE_ENVIRONMENT_PATH is passed. + +:: + + _DIR + CMAKE_PREFIX_PATH + CMAKE_FRAMEWORK_PATH + CMAKE_APPBUNDLE_PATH + +3. Search paths specified by the HINTS option. These should be paths +computed by system introspection, such as a hint provided by the +location of another item already found. Hard-coded guesses should be +specified with the PATHS option. + +4. Search the standard system environment variables. This can be +skipped if NO_SYSTEM_ENVIRONMENT_PATH is passed. Path entries ending +in "/bin" or "/sbin" are automatically converted to their parent +directories. + +:: + + PATH + +5. Search project build trees recently configured in a CMake GUI. +This can be skipped if NO_CMAKE_BUILDS_PATH is passed. It is intended +for the case when a user is building multiple dependent projects one +after another. + +6. Search paths stored in the CMake user package registry. This can +be skipped if NO_CMAKE_PACKAGE_REGISTRY is passed. On Windows a + may appear under registry key + +:: + + HKEY_CURRENT_USER\Software\Kitware\CMake\Packages\ + +as a REG_SZ value, with arbitrary name, that specifies the directory +containing the package configuration file. On UNIX platforms a + may appear under the directory + +:: + + ~/.cmake/packages/ + +as a file, with arbitrary name, whose content specifies the directory +containing the package configuration file. See the export(PACKAGE) +command to create user package registry entries for project build +trees. + +7. Search cmake variables defined in the Platform files for the +current system. This can be skipped if NO_CMAKE_SYSTEM_PATH is +passed. + +:: + + CMAKE_SYSTEM_PREFIX_PATH + CMAKE_SYSTEM_FRAMEWORK_PATH + CMAKE_SYSTEM_APPBUNDLE_PATH + +8. Search paths stored in the CMake system package registry. This +can be skipped if NO_CMAKE_SYSTEM_PACKAGE_REGISTRY is passed. On +Windows a may appear under registry key + +:: + + HKEY_LOCAL_MACHINE\Software\Kitware\CMake\Packages\ + +as a REG_SZ value, with arbitrary name, that specifies the directory +containing the package configuration file. There is no system package +registry on non-Windows platforms. + +9. Search paths specified by the PATHS option. These are typically +hard-coded guesses. + +On Darwin or systems supporting OS X Frameworks, the cmake variable +CMAKE_FIND_FRAMEWORK can be set to empty or one of the following: + +:: + + "FIRST" - Try to find frameworks before standard + libraries or headers. This is the default on Darwin. + "LAST" - Try to find frameworks after standard + libraries or headers. + "ONLY" - Only try to find frameworks. + "NEVER" - Never try to find frameworks. + +On Darwin or systems supporting OS X Application Bundles, the cmake +variable CMAKE_FIND_APPBUNDLE can be set to empty or one of the +following: + +:: + + "FIRST" - Try to find application bundles before standard + programs. This is the default on Darwin. + "LAST" - Try to find application bundles after standard + programs. + "ONLY" - Only try to find application bundles. + "NEVER" - Never try to find application bundles. + +The CMake variable CMAKE_FIND_ROOT_PATH specifies one or more +directories to be prepended to all other search directories. This +effectively "re-roots" the entire search under given locations. By +default it is empty. It is especially useful when cross-compiling to +point to the root directory of the target environment and CMake will +search there too. By default at first the directories listed in +CMAKE_FIND_ROOT_PATH and then the non-rooted directories will be +searched. The default behavior can be adjusted by setting +CMAKE_FIND_ROOT_PATH_MODE_PACKAGE. This behavior can be manually +overridden on a per-call basis. By using CMAKE_FIND_ROOT_PATH_BOTH +the search order will be as described above. If +NO_CMAKE_FIND_ROOT_PATH is used then CMAKE_FIND_ROOT_PATH will not be +used. If ONLY_CMAKE_FIND_ROOT_PATH is used then only the re-rooted +directories will be searched. + +The default search order is designed to be most-specific to +least-specific for common use cases. Projects may override the order +by simply calling the command multiple times and using the NO_* +options: + +:: + + find_package( PATHS paths... NO_DEFAULT_PATH) + find_package() + +Once one of the calls succeeds the result variable will be set and +stored in the cache so that no call will search again. + +Every non-REQUIRED find_package() call can be disabled by setting the +variable CMAKE_DISABLE_FIND_PACKAGE_ to TRUE. See the +documentation for the CMAKE_DISABLE_FIND_PACKAGE_ variable +for more information. + +When loading a find module or package configuration file find_package +defines variables to provide information about the call arguments (and +restores their original state before returning): + +:: + + _FIND_REQUIRED = true if REQUIRED option was given + _FIND_QUIETLY = true if QUIET option was given + _FIND_VERSION = full requested version string + _FIND_VERSION_MAJOR = major version if requested, else 0 + _FIND_VERSION_MINOR = minor version if requested, else 0 + _FIND_VERSION_PATCH = patch version if requested, else 0 + _FIND_VERSION_TWEAK = tweak version if requested, else 0 + _FIND_VERSION_COUNT = number of version components, 0 to 4 + _FIND_VERSION_EXACT = true if EXACT option was given + _FIND_COMPONENTS = list of requested components + _FIND_REQUIRED_ = true if component is required + false if component is optional + +In Module mode the loaded find module is responsible to honor the +request detailed by these variables; see the find module for details. +In Config mode find_package handles REQUIRED, QUIET, and version +options automatically but leaves it to the package configuration file +to handle components in a way that makes sense for the package. The +package configuration file may set _FOUND to false to tell +find_package that component requirements are not satisfied. + +See the cmake_policy() command documentation for discussion of the +NO_POLICY_SCOPE option. diff --git a/Help/command/find_path.rst b/Help/command/find_path.rst new file mode 100644 index 0000000..2ffe6aa --- /dev/null +++ b/Help/command/find_path.rst @@ -0,0 +1,160 @@ +find_path +--------- + +Find the directory containing a file. + +:: + + find_path( name1 [path1 path2 ...]) + +This is the short-hand signature for the command that is sufficient in +many cases. It is the same as find_path( name1 [PATHS path1 +path2 ...]) + +:: + + find_path( + + name | NAMES name1 [name2 ...] + [HINTS path1 [path2 ... ENV var]] + [PATHS path1 [path2 ... ENV var]] + [PATH_SUFFIXES suffix1 [suffix2 ...]] + [DOC "cache documentation string"] + [NO_DEFAULT_PATH] + [NO_CMAKE_ENVIRONMENT_PATH] + [NO_CMAKE_PATH] + [NO_SYSTEM_ENVIRONMENT_PATH] + [NO_CMAKE_SYSTEM_PATH] + [CMAKE_FIND_ROOT_PATH_BOTH | + ONLY_CMAKE_FIND_ROOT_PATH | + NO_CMAKE_FIND_ROOT_PATH] + ) + +This command is used to find a directory containing the named file. A +cache entry named by is created to store the result of this +command. If the file in a directory is found the result is stored in +the variable and the search will not be repeated unless the variable +is cleared. If nothing is found, the result will be -NOTFOUND, +and the search will be attempted again the next time find_path is +invoked with the same variable. The name of the file in a directory +that is searched for is specified by the names listed after the NAMES +argument. Additional search locations can be specified after the +PATHS argument. If ENV var is found in the HINTS or PATHS section the +environment variable var will be read and converted from a system +environment variable to a cmake style list of paths. For example ENV +PATH would be a way to list the system path variable. The argument +after DOC will be used for the documentation string in the cache. +PATH_SUFFIXES specifies additional subdirectories to check below each +search path. + +If NO_DEFAULT_PATH is specified, then no additional paths are added to +the search. If NO_DEFAULT_PATH is not specified, the search process +is as follows: + +1. Search paths specified in cmake-specific cache variables. These +are intended to be used on the command line with a -DVAR=value. This +can be skipped if NO_CMAKE_PATH is passed. + +:: + + /include/ if CMAKE_LIBRARY_ARCHITECTURE is set, and + /include for each in CMAKE_PREFIX_PATH + CMAKE_INCLUDE_PATH + CMAKE_FRAMEWORK_PATH + +2. Search paths specified in cmake-specific environment variables. +These are intended to be set in the user's shell configuration. This +can be skipped if NO_CMAKE_ENVIRONMENT_PATH is passed. + +:: + + /include/ if CMAKE_LIBRARY_ARCHITECTURE is set, and + /include for each in CMAKE_PREFIX_PATH + CMAKE_INCLUDE_PATH + CMAKE_FRAMEWORK_PATH + +3. Search the paths specified by the HINTS option. These should be +paths computed by system introspection, such as a hint provided by the +location of another item already found. Hard-coded guesses should be +specified with the PATHS option. + +4. Search the standard system environment variables. This can be +skipped if NO_SYSTEM_ENVIRONMENT_PATH is an argument. + +:: + + PATH + INCLUDE + +5. Search cmake variables defined in the Platform files for the +current system. This can be skipped if NO_CMAKE_SYSTEM_PATH is +passed. + +:: + + /include/ if CMAKE_LIBRARY_ARCHITECTURE is set, and + /include for each in CMAKE_SYSTEM_PREFIX_PATH + CMAKE_SYSTEM_INCLUDE_PATH + CMAKE_SYSTEM_FRAMEWORK_PATH + +6. Search the paths specified by the PATHS option or in the +short-hand version of the command. These are typically hard-coded +guesses. + +On Darwin or systems supporting OS X Frameworks, the cmake variable +CMAKE_FIND_FRAMEWORK can be set to empty or one of the following: + +:: + + "FIRST" - Try to find frameworks before standard + libraries or headers. This is the default on Darwin. + "LAST" - Try to find frameworks after standard + libraries or headers. + "ONLY" - Only try to find frameworks. + "NEVER" - Never try to find frameworks. + +On Darwin or systems supporting OS X Application Bundles, the cmake +variable CMAKE_FIND_APPBUNDLE can be set to empty or one of the +following: + +:: + + "FIRST" - Try to find application bundles before standard + programs. This is the default on Darwin. + "LAST" - Try to find application bundles after standard + programs. + "ONLY" - Only try to find application bundles. + "NEVER" - Never try to find application bundles. + +The CMake variable CMAKE_FIND_ROOT_PATH specifies one or more +directories to be prepended to all other search directories. This +effectively "re-roots" the entire search under given locations. By +default it is empty. It is especially useful when cross-compiling to +point to the root directory of the target environment and CMake will +search there too. By default at first the directories listed in +CMAKE_FIND_ROOT_PATH and then the non-rooted directories will be +searched. The default behavior can be adjusted by setting +CMAKE_FIND_ROOT_PATH_MODE_INCLUDE. This behavior can be manually +overridden on a per-call basis. By using CMAKE_FIND_ROOT_PATH_BOTH +the search order will be as described above. If +NO_CMAKE_FIND_ROOT_PATH is used then CMAKE_FIND_ROOT_PATH will not be +used. If ONLY_CMAKE_FIND_ROOT_PATH is used then only the re-rooted +directories will be searched. + +The default search order is designed to be most-specific to +least-specific for common use cases. Projects may override the order +by simply calling the command multiple times and using the NO_* +options: + +:: + + find_path( NAMES name PATHS paths... NO_DEFAULT_PATH) + find_path( NAMES name) + +Once one of the calls succeeds the result variable will be set and +stored in the cache so that no call will search again. + +When searching for frameworks, if the file is specified as A/b.h, then +the framework search will look for A.framework/Headers/b.h. If that +is found the path will be set to the path to the framework. CMake +will convert this to the correct -F option to include the file. diff --git a/Help/command/find_program.rst b/Help/command/find_program.rst new file mode 100644 index 0000000..656fbe5 --- /dev/null +++ b/Help/command/find_program.rst @@ -0,0 +1,151 @@ +find_program +------------ + +Find an executable program. + +:: + + find_program( name1 [path1 path2 ...]) + +This is the short-hand signature for the command that is sufficient in +many cases. It is the same as find_program( name1 [PATHS path1 +path2 ...]) + +:: + + find_program( + + name | NAMES name1 [name2 ...] + [HINTS path1 [path2 ... ENV var]] + [PATHS path1 [path2 ... ENV var]] + [PATH_SUFFIXES suffix1 [suffix2 ...]] + [DOC "cache documentation string"] + [NO_DEFAULT_PATH] + [NO_CMAKE_ENVIRONMENT_PATH] + [NO_CMAKE_PATH] + [NO_SYSTEM_ENVIRONMENT_PATH] + [NO_CMAKE_SYSTEM_PATH] + [CMAKE_FIND_ROOT_PATH_BOTH | + ONLY_CMAKE_FIND_ROOT_PATH | + NO_CMAKE_FIND_ROOT_PATH] + ) + +This command is used to find a program. A cache entry named by +is created to store the result of this command. If the program is +found the result is stored in the variable and the search will not be +repeated unless the variable is cleared. If nothing is found, the +result will be -NOTFOUND, and the search will be attempted again +the next time find_program is invoked with the same variable. The +name of the program that is searched for is specified by the names +listed after the NAMES argument. Additional search locations can be +specified after the PATHS argument. If ENV var is found in the HINTS +or PATHS section the environment variable var will be read and +converted from a system environment variable to a cmake style list of +paths. For example ENV PATH would be a way to list the system path +variable. The argument after DOC will be used for the documentation +string in the cache. PATH_SUFFIXES specifies additional +subdirectories to check below each search path. + +If NO_DEFAULT_PATH is specified, then no additional paths are added to +the search. If NO_DEFAULT_PATH is not specified, the search process +is as follows: + +1. Search paths specified in cmake-specific cache variables. These +are intended to be used on the command line with a -DVAR=value. This +can be skipped if NO_CMAKE_PATH is passed. + +:: + + /[s]bin for each in CMAKE_PREFIX_PATH + CMAKE_PROGRAM_PATH + CMAKE_APPBUNDLE_PATH + +2. Search paths specified in cmake-specific environment variables. +These are intended to be set in the user's shell configuration. This +can be skipped if NO_CMAKE_ENVIRONMENT_PATH is passed. + +:: + + /[s]bin for each in CMAKE_PREFIX_PATH + CMAKE_PROGRAM_PATH + CMAKE_APPBUNDLE_PATH + +3. Search the paths specified by the HINTS option. These should be +paths computed by system introspection, such as a hint provided by the +location of another item already found. Hard-coded guesses should be +specified with the PATHS option. + +4. Search the standard system environment variables. This can be +skipped if NO_SYSTEM_ENVIRONMENT_PATH is an argument. + +:: + + PATH + + +5. Search cmake variables defined in the Platform files for the +current system. This can be skipped if NO_CMAKE_SYSTEM_PATH is +passed. + +:: + + /[s]bin for each in CMAKE_SYSTEM_PREFIX_PATH + CMAKE_SYSTEM_PROGRAM_PATH + CMAKE_SYSTEM_APPBUNDLE_PATH + +6. Search the paths specified by the PATHS option or in the +short-hand version of the command. These are typically hard-coded +guesses. + +On Darwin or systems supporting OS X Frameworks, the cmake variable +CMAKE_FIND_FRAMEWORK can be set to empty or one of the following: + +:: + + "FIRST" - Try to find frameworks before standard + libraries or headers. This is the default on Darwin. + "LAST" - Try to find frameworks after standard + libraries or headers. + "ONLY" - Only try to find frameworks. + "NEVER" - Never try to find frameworks. + +On Darwin or systems supporting OS X Application Bundles, the cmake +variable CMAKE_FIND_APPBUNDLE can be set to empty or one of the +following: + +:: + + "FIRST" - Try to find application bundles before standard + programs. This is the default on Darwin. + "LAST" - Try to find application bundles after standard + programs. + "ONLY" - Only try to find application bundles. + "NEVER" - Never try to find application bundles. + +The CMake variable CMAKE_FIND_ROOT_PATH specifies one or more +directories to be prepended to all other search directories. This +effectively "re-roots" the entire search under given locations. By +default it is empty. It is especially useful when cross-compiling to +point to the root directory of the target environment and CMake will +search there too. By default at first the directories listed in +CMAKE_FIND_ROOT_PATH and then the non-rooted directories will be +searched. The default behavior can be adjusted by setting +CMAKE_FIND_ROOT_PATH_MODE_PROGRAM. This behavior can be manually +overridden on a per-call basis. By using CMAKE_FIND_ROOT_PATH_BOTH +the search order will be as described above. If +NO_CMAKE_FIND_ROOT_PATH is used then CMAKE_FIND_ROOT_PATH will not be +used. If ONLY_CMAKE_FIND_ROOT_PATH is used then only the re-rooted +directories will be searched. + +The default search order is designed to be most-specific to +least-specific for common use cases. Projects may override the order +by simply calling the command multiple times and using the NO_* +options: + +:: + + find_program( NAMES name PATHS paths... NO_DEFAULT_PATH) + find_program( NAMES name) + +Once one of the calls succeeds the result variable will be set and +stored in the cache so that no call will search again. diff --git a/Help/command/fltk_wrap_ui.rst b/Help/command/fltk_wrap_ui.rst new file mode 100644 index 0000000..448ae64 --- /dev/null +++ b/Help/command/fltk_wrap_ui.rst @@ -0,0 +1,14 @@ +fltk_wrap_ui +------------ + +Create FLTK user interfaces Wrappers. + +:: + + fltk_wrap_ui(resultingLibraryName source1 + source2 ... sourceN ) + +Produce .h and .cxx files for all the .fl and .fld files listed. The +resulting .h and .cxx files will be added to a variable named +resultingLibraryName_FLTK_UI_SRCS which should be added to your +library. diff --git a/Help/command/foreach.rst b/Help/command/foreach.rst new file mode 100644 index 0000000..9ac70b3 --- /dev/null +++ b/Help/command/foreach.rst @@ -0,0 +1,46 @@ +foreach +------- + +Evaluate a group of commands for each value in a list. + +:: + + foreach(loop_var arg1 arg2 ...) + COMMAND1(ARGS ...) + COMMAND2(ARGS ...) + ... + endforeach(loop_var) + +All commands between foreach and the matching endforeach are recorded +without being invoked. Once the endforeach is evaluated, the recorded +list of commands is invoked once for each argument listed in the +original foreach command. Before each iteration of the loop +"${loop_var}" will be set as a variable with the current value in the +list. + +:: + + foreach(loop_var RANGE total) + foreach(loop_var RANGE start stop [step]) + +Foreach can also iterate over a generated range of numbers. There are +three types of this iteration: + +* When specifying single number, the range will have elements 0 to +"total". + +* When specifying two numbers, the range will have elements from the +first number to the second number. + +* The third optional number is the increment used to iterate from the +first number to the second number. + +:: + + foreach(loop_var IN [LISTS [list1 [...]]] + [ITEMS [item1 [...]]]) + +Iterates over a precise list of items. The LISTS option names +list-valued variables to be traversed, including empty elements (an +empty string is a zero-length list). The ITEMS option ends argument +parsing and includes all arguments following it in the iteration. diff --git a/Help/command/function.rst b/Help/command/function.rst new file mode 100644 index 0000000..b18e03c --- /dev/null +++ b/Help/command/function.rst @@ -0,0 +1,31 @@ +function +-------- + +Start recording a function for later invocation as a command. + +:: + + function( [arg1 [arg2 [arg3 ...]]]) + COMMAND1(ARGS ...) + COMMAND2(ARGS ...) + ... + endfunction() + +Define a function named that takes arguments named arg1 arg2 +arg3 (...). Commands listed after function, but before the matching +endfunction, are not invoked until the function is invoked. When it +is invoked, the commands recorded in the function are first modified +by replacing formal parameters (${arg1}) with the arguments passed, +and then invoked as normal commands. In addition to referencing the +formal parameters you can reference the variable ARGC which will be +set to the number of arguments passed into the function as well as +ARGV0 ARGV1 ARGV2 ... which will have the actual values of the +arguments passed in. This facilitates creating functions with +optional arguments. Additionally ARGV holds the list of all arguments +given to the function and ARGN holds the list of arguments past the +last expected argument. + +A function opens a new scope: see set(var PARENT_SCOPE) for details. + +See the cmake_policy() command documentation for the behavior of +policies inside functions. diff --git a/Help/command/get_cmake_property.rst b/Help/command/get_cmake_property.rst new file mode 100644 index 0000000..bcfc5e8 --- /dev/null +++ b/Help/command/get_cmake_property.rst @@ -0,0 +1,15 @@ +get_cmake_property +------------------ + +Get a property of the CMake instance. + +:: + + get_cmake_property(VAR property) + +Get a property from the CMake instance. The value of the property is +stored in the variable VAR. If the property is not found, VAR will be +set to "NOTFOUND". Some supported properties include: VARIABLES, +CACHE_VARIABLES, COMMANDS, MACROS, and COMPONENTS. + +See also the more general get_property() command. diff --git a/Help/command/get_directory_property.rst b/Help/command/get_directory_property.rst new file mode 100644 index 0000000..f2a0a80 --- /dev/null +++ b/Help/command/get_directory_property.rst @@ -0,0 +1,24 @@ +get_directory_property +---------------------- + +Get a property of DIRECTORY scope. + +:: + + get_directory_property( [DIRECTORY ] ) + +Store a property of directory scope in the named variable. If the +property is not defined the empty-string is returned. The DIRECTORY +argument specifies another directory from which to retrieve the +property value. The specified directory must have already been +traversed by CMake. + +:: + + get_directory_property( [DIRECTORY ] + DEFINITION ) + +Get a variable definition from a directory. This form is useful to +get a variable definition from another directory. + +See also the more general get_property() command. diff --git a/Help/command/get_filename_component.rst b/Help/command/get_filename_component.rst new file mode 100644 index 0000000..5eec792 --- /dev/null +++ b/Help/command/get_filename_component.rst @@ -0,0 +1,37 @@ +get_filename_component +---------------------- + +Get a specific component of a full filename. + +:: + + get_filename_component( [CACHE]) + +Set to a component of , where is one of: + +:: + + DIRECTORY = Directory without file name + NAME = File name without directory + EXT = File name longest extension (.b.c from d/a.b.c) + NAME_WE = File name without directory or longest extension + ABSOLUTE = Full path to file + REALPATH = Full path to existing file with symlinks resolved + PATH = Legacy alias for DIRECTORY (use for CMake <= 2.8.11) + +Paths are returned with forward slashes and have no trailing slahes. +The longest file extension is always considered. If the optional +CACHE argument is specified, the result variable is added to the +cache. + +:: + + get_filename_component( FileName + PROGRAM [PROGRAM_ARGS ] + [CACHE]) + +The program in FileName will be found in the system search path or +left as a full path. If PROGRAM_ARGS is present with PROGRAM, then +any command-line arguments present in the FileName string are split +from the program name and stored in . This is used to +separate a program name from its arguments in a command line string. diff --git a/Help/command/get_property.rst b/Help/command/get_property.rst new file mode 100644 index 0000000..c2937be --- /dev/null +++ b/Help/command/get_property.rst @@ -0,0 +1,49 @@ +get_property +------------ + +Get a property. + +:: + + get_property( + | + SOURCE | + TEST | + CACHE | + VARIABLE> + PROPERTY + [SET | DEFINED | BRIEF_DOCS | FULL_DOCS]) + +Get one property from one object in a scope. The first argument +specifies the variable in which to store the result. The second +argument determines the scope from which to get the property. It must +be one of the following: + +GLOBAL scope is unique and does not accept a name. + +DIRECTORY scope defaults to the current directory but another +directory (already processed by CMake) may be named by full or +relative path. + +TARGET scope must name one existing target. + +SOURCE scope must name one source file. + +TEST scope must name one existing test. + +CACHE scope must name one cache entry. + +VARIABLE scope is unique and does not accept a name. + +The required PROPERTY option is immediately followed by the name of +the property to get. If the property is not set an empty value is +returned. If the SET option is given the variable is set to a boolean +value indicating whether the property has been set. If the DEFINED +option is given the variable is set to a boolean value indicating +whether the property has been defined such as with define_property. +If BRIEF_DOCS or FULL_DOCS is given then the variable is set to a +string containing documentation for the requested property. If +documentation is requested for a property that has not been defined +NOTFOUND is returned. diff --git a/Help/command/get_source_file_property.rst b/Help/command/get_source_file_property.rst new file mode 100644 index 0000000..80c512b --- /dev/null +++ b/Help/command/get_source_file_property.rst @@ -0,0 +1,16 @@ +get_source_file_property +------------------------ + +Get a property for a source file. + +:: + + get_source_file_property(VAR file property) + +Get a property from a source file. The value of the property is +stored in the variable VAR. If the property is not found, VAR will be +set to "NOTFOUND". Use set_source_files_properties to set property +values. Source file properties usually control how the file is built. +One property that is always there is LOCATION + +See also the more general get_property() command. diff --git a/Help/command/get_target_property.rst b/Help/command/get_target_property.rst new file mode 100644 index 0000000..4017d31 --- /dev/null +++ b/Help/command/get_target_property.rst @@ -0,0 +1,18 @@ +get_target_property +------------------- + +Get a property from a target. + +:: + + get_target_property(VAR target property) + +Get a property from a target. The value of the property is stored in +the variable VAR. If the property is not found, VAR will be set to +"NOTFOUND". Use set_target_properties to set property values. +Properties are usually used to control how a target is built, but some +query the target instead. This command can get properties for any +target so far created. The targets do not need to be in the current +CMakeLists.txt file. + +See also the more general get_property() command. diff --git a/Help/command/get_test_property.rst b/Help/command/get_test_property.rst new file mode 100644 index 0000000..2623755 --- /dev/null +++ b/Help/command/get_test_property.rst @@ -0,0 +1,15 @@ +get_test_property +----------------- + +Get a property of the test. + +:: + + get_test_property(test property VAR) + +Get a property from the Test. The value of the property is stored in +the variable VAR. If the property is not found, VAR will be set to +"NOTFOUND". For a list of standard properties you can type cmake +--help-property-list + +See also the more general get_property() command. diff --git a/Help/command/if.rst b/Help/command/if.rst new file mode 100644 index 0000000..b879ae1 --- /dev/null +++ b/Help/command/if.rst @@ -0,0 +1,238 @@ +if +-- + +Conditionally execute a group of commands. + +:: + + if(expression) + # then section. + COMMAND1(ARGS ...) + COMMAND2(ARGS ...) + ... + elseif(expression2) + # elseif section. + COMMAND1(ARGS ...) + COMMAND2(ARGS ...) + ... + else(expression) + # else section. + COMMAND1(ARGS ...) + COMMAND2(ARGS ...) + ... + endif(expression) + +Evaluates the given expression. If the result is true, the commands +in the THEN section are invoked. Otherwise, the commands in the else +section are invoked. The elseif and else sections are optional. You +may have multiple elseif clauses. Note that the expression in the +else and endif clause is optional. Long expressions can be used and +there is a traditional order of precedence. Parenthetical expressions +are evaluated first followed by unary operators such as EXISTS, +COMMAND, and DEFINED. Then any EQUAL, LESS, GREATER, STRLESS, +STRGREATER, STREQUAL, MATCHES will be evaluated. Then NOT operators +and finally AND, OR operators will be evaluated. Possible expressions +are: + +:: + + if() + +True if the constant is 1, ON, YES, TRUE, Y, or a non-zero number. +False if the constant is 0, OFF, NO, FALSE, N, IGNORE, NOTFOUND, '', +or ends in the suffix '-NOTFOUND'. Named boolean constants are +case-insensitive. If the argument is not one of these constants, it +is treated as a variable: + +:: + + if() + +True if the variable is defined to a value that is not a false +constant. False otherwise. (Note macro arguments are not variables.) + +:: + + if(NOT ) + +True if the expression is not true. + +:: + + if( AND ) + +True if both expressions would be considered true individually. + +:: + + if( OR ) + +True if either expression would be considered true individually. + +:: + + if(COMMAND command-name) + +True if the given name is a command, macro or function that can be +invoked. + +:: + + if(POLICY policy-id) + +True if the given name is an existing policy (of the form CMP). + +:: + + if(TARGET target-name) + +True if the given name is an existing target, built or imported. + +:: + + if(EXISTS file-name) + if(EXISTS directory-name) + +True if the named file or directory exists. Behavior is well-defined +only for full paths. + +:: + + if(file1 IS_NEWER_THAN file2) + +True if file1 is newer than file2 or if one of the two files doesn't +exist. Behavior is well-defined only for full paths. If the file +time stamps are exactly the same, an IS_NEWER_THAN comparison returns +true, so that any dependent build operations will occur in the event +of a tie. This includes the case of passing the same file name for +both file1 and file2. + +:: + + if(IS_DIRECTORY directory-name) + +True if the given name is a directory. Behavior is well-defined only +for full paths. + +:: + + if(IS_SYMLINK file-name) + +True if the given name is a symbolic link. Behavior is well-defined +only for full paths. + +:: + + if(IS_ABSOLUTE path) + +True if the given path is an absolute path. + +:: + + if( MATCHES regex) + +True if the given string or variable's value matches the given regular +expression. + +:: + + if( LESS ) + if( GREATER ) + if( EQUAL ) + +True if the given string or variable's value is a valid number and the +inequality or equality is true. + +:: + + if( STRLESS ) + if( STRGREATER ) + if( STREQUAL ) + +True if the given string or variable's value is lexicographically less +(or greater, or equal) than the string or variable on the right. + +:: + + if( VERSION_LESS ) + if( VERSION_EQUAL ) + if( VERSION_GREATER ) + +Component-wise integer version number comparison (version format is +major[.minor[.patch[.tweak]]]). + +:: + + if(DEFINED ) + +True if the given variable is defined. It does not matter if the +variable is true or false just if it has been set. + +:: + + if((expression) AND (expression OR (expression))) + +The expressions inside the parenthesis are evaluated first and then +the remaining expression is evaluated as in the previous examples. +Where there are nested parenthesis the innermost are evaluated as part +of evaluating the expression that contains them. + +The if command was written very early in CMake's history, predating +the ${} variable evaluation syntax, and for convenience evaluates +variables named by its arguments as shown in the above signatures. +Note that normal variable evaluation with ${} applies before the if +command even receives the arguments. Therefore code like + +:: + + set(var1 OFF) + set(var2 "var1") + if(${var2}) + +appears to the if command as + +:: + + if(var1) + +and is evaluated according to the if() case documented +above. The result is OFF which is false. However, if we remove the +${} from the example then the command sees + +:: + + if(var2) + +which is true because var2 is defined to "var1" which is not a false +constant. + +Automatic evaluation applies in the other cases whenever the +above-documented signature accepts : + +1) The left hand argument to MATCHES is first checked to see if it is +a defined variable, if so the variable's value is used, otherwise the +original value is used. + +2) If the left hand argument to MATCHES is missing it returns false +without error + +3) Both left and right hand arguments to LESS GREATER EQUAL are +independently tested to see if they are defined variables, if so their +defined values are used otherwise the original value is used. + +4) Both left and right hand arguments to STRLESS STREQUAL STRGREATER +are independently tested to see if they are defined variables, if so +their defined values are used otherwise the original value is used. + +5) Both left and right hand argumemnts to VERSION_LESS VERSION_EQUAL +VERSION_GREATER are independently tested to see if they are defined +variables, if so their defined values are used otherwise the original +value is used. + +6) The right hand argument to NOT is tested to see if it is a boolean +constant, if so the value is used, otherwise it is assumed to be a +variable and it is dereferenced. + +7) The left and right hand arguments to AND OR are independently +tested to see if they are boolean constants, if so they are used as +such, otherwise they are assumed to be variables and are dereferenced. diff --git a/Help/command/include.rst b/Help/command/include.rst new file mode 100644 index 0000000..a9074c1 --- /dev/null +++ b/Help/command/include.rst @@ -0,0 +1,25 @@ +include +------- + +Load and run CMake code from a file or module. + +:: + + include( [OPTIONAL] [RESULT_VARIABLE ] + [NO_POLICY_SCOPE]) + +Load and run CMake code from the file given. Variable reads and +writes access the scope of the caller (dynamic scoping). If OPTIONAL +is present, then no error is raised if the file does not exist. If +RESULT_VARIABLE is given the variable will be set to the full filename +which has been included or NOTFOUND if it failed. + +If a module is specified instead of a file, the file with name +.cmake is searched first in CMAKE_MODULE_PATH, then in the +CMake module directory. There is one exception to this: if the file +which calls include() is located itself in the CMake module directory, +then first the CMake module directory is searched and +CMAKE_MODULE_PATH afterwards. See also policy CMP0017. + +See the cmake_policy() command documentation for discussion of the +NO_POLICY_SCOPE option. diff --git a/Help/command/include_directories.rst b/Help/command/include_directories.rst new file mode 100644 index 0000000..6744427 --- /dev/null +++ b/Help/command/include_directories.rst @@ -0,0 +1,30 @@ +include_directories +------------------- + +Add include directories to the build. + +:: + + include_directories([AFTER|BEFORE] [SYSTEM] dir1 dir2 ...) + +Add the given directories to those the compiler uses to search for +include files. Relative paths are interpreted as relative to the +current source directory. + +The include directories are added to the directory property +INCLUDE_DIRECTORIES for the current CMakeLists file. They are also +added to the target property INCLUDE_DIRECTORIES for each target in +the current CMakeLists file. The target property values are the ones +used by the generators. + +By default the directories are appended onto the current list of +directories. This default behavior can be changed by setting +CMAKE_INCLUDE_DIRECTORIES_BEFORE to ON. By using AFTER or BEFORE +explicitly, you can select between appending and prepending, +independent of the default. + +If the SYSTEM option is given, the compiler will be told the +directories are meant as system include directories on some platforms +(signalling this setting might achieve effects such as the compiler +skipping warnings, or these fixed-install system files not being +considered in dependency calculations - see compiler docs). diff --git a/Help/command/include_external_msproject.rst b/Help/command/include_external_msproject.rst new file mode 100644 index 0000000..ba9a393 --- /dev/null +++ b/Help/command/include_external_msproject.rst @@ -0,0 +1,23 @@ +include_external_msproject +-------------------------- + +Include an external Microsoft project file in a workspace. + +:: + + include_external_msproject(projectname location + [TYPE projectTypeGUID] + [GUID projectGUID] + [PLATFORM platformName] + dep1 dep2 ...) + +Includes an external Microsoft project in the generated workspace +file. Currently does nothing on UNIX. This will create a target +named [projectname]. This can be used in the add_dependencies command +to make things depend on the external project. + +TYPE, GUID and PLATFORM are optional parameters that allow one to +specify the type of project, id (GUID) of the project and the name of +the target platform. This is useful for projects requiring values +other than the default (e.g. WIX projects). These options are not +supported by the Visual Studio 6 generator. diff --git a/Help/command/include_regular_expression.rst b/Help/command/include_regular_expression.rst new file mode 100644 index 0000000..dd887df --- /dev/null +++ b/Help/command/include_regular_expression.rst @@ -0,0 +1,18 @@ +include_regular_expression +-------------------------- + +Set the regular expression used for dependency checking. + +:: + + include_regular_expression(regex_match [regex_complain]) + +Set the regular expressions used in dependency checking. Only files +matching regex_match will be traced as dependencies. Only files +matching regex_complain will generate warnings if they cannot be found +(standard header paths are not searched). The defaults are: + +:: + + regex_match = "^.*$" (match everything) + regex_complain = "^$" (match empty string only) diff --git a/Help/command/install.rst b/Help/command/install.rst new file mode 100644 index 0000000..9b27cae --- /dev/null +++ b/Help/command/install.rst @@ -0,0 +1,316 @@ +install +------- + +Specify rules to run at install time. + +This command generates installation rules for a project. Rules +specified by calls to this command within a source directory are +executed in order during installation. The order across directories +is not defined. + +There are multiple signatures for this command. Some of them define +installation properties for files and targets. Properties common to +multiple signatures are covered here but they are valid only for +signatures that specify them. + +DESTINATION arguments specify the directory on disk to which a file +will be installed. If a full path (with a leading slash or drive +letter) is given it is used directly. If a relative path is given it +is interpreted relative to the value of CMAKE_INSTALL_PREFIX. The +prefix can be relocated at install time using DESTDIR mechanism +explained in the CMAKE_INSTALL_PREFIX variable documentation. + +PERMISSIONS arguments specify permissions for installed files. Valid +permissions are OWNER_READ, OWNER_WRITE, OWNER_EXECUTE, GROUP_READ, +GROUP_WRITE, GROUP_EXECUTE, WORLD_READ, WORLD_WRITE, WORLD_EXECUTE, +SETUID, and SETGID. Permissions that do not make sense on certain +platforms are ignored on those platforms. + +The CONFIGURATIONS argument specifies a list of build configurations +for which the install rule applies (Debug, Release, etc.). + +The COMPONENT argument specifies an installation component name with +which the install rule is associated, such as "runtime" or +"development". During component-specific installation only install +rules associated with the given component name will be executed. +During a full installation all components are installed. If COMPONENT +is not provided a default component "Unspecified" is created. The +default component name may be controlled with the +CMAKE_INSTALL_DEFAULT_COMPONENT_NAME variable. + +The RENAME argument specifies a name for an installed file that may be +different from the original file. Renaming is allowed only when a +single file is installed by the command. + +The OPTIONAL argument specifies that it is not an error if the file to +be installed does not exist. + +The TARGETS signature: + +:: + + install(TARGETS targets... [EXPORT ] + [[ARCHIVE|LIBRARY|RUNTIME|FRAMEWORK|BUNDLE| + PRIVATE_HEADER|PUBLIC_HEADER|RESOURCE] + [DESTINATION ] + [INCLUDES DESTINATION [ ...]] + [PERMISSIONS permissions...] + [CONFIGURATIONS [Debug|Release|...]] + [COMPONENT ] + [OPTIONAL] [NAMELINK_ONLY|NAMELINK_SKIP] + ] [...]) + +The TARGETS form specifies rules for installing targets from a +project. There are five kinds of target files that may be installed: +ARCHIVE, LIBRARY, RUNTIME, FRAMEWORK, and BUNDLE. Executables are +treated as RUNTIME targets, except that those marked with the +MACOSX_BUNDLE property are treated as BUNDLE targets on OS X. Static +libraries are always treated as ARCHIVE targets. Module libraries are +always treated as LIBRARY targets. For non-DLL platforms shared +libraries are treated as LIBRARY targets, except that those marked +with the FRAMEWORK property are treated as FRAMEWORK targets on OS X. +For DLL platforms the DLL part of a shared library is treated as a +RUNTIME target and the corresponding import library is treated as an +ARCHIVE target. All Windows-based systems including Cygwin are DLL +platforms. The ARCHIVE, LIBRARY, RUNTIME, and FRAMEWORK arguments +change the type of target to which the subsequent properties apply. +If none is given the installation properties apply to all target +types. If only one is given then only targets of that type will be +installed (which can be used to install just a DLL or just an import +library).The INCLUDES DESTINATION specifies a list of directories +which will be added to the INTERFACE_INCLUDE_DIRECTORIES of the + when exported by install(EXPORT). If a relative path is +specified, it is treated as relative to the $. + +The PRIVATE_HEADER, PUBLIC_HEADER, and RESOURCE arguments cause +subsequent properties to be applied to installing a FRAMEWORK shared +library target's associated files on non-Apple platforms. Rules +defined by these arguments are ignored on Apple platforms because the +associated files are installed into the appropriate locations inside +the framework folder. See documentation of the PRIVATE_HEADER, +PUBLIC_HEADER, and RESOURCE target properties for details. + +Either NAMELINK_ONLY or NAMELINK_SKIP may be specified as a LIBRARY +option. On some platforms a versioned shared library has a symbolic +link such as + +:: + + lib.so -> lib.so.1 + +where "lib.so.1" is the soname of the library and "lib.so" +is a "namelink" allowing linkers to find the library when given +"-l". The NAMELINK_ONLY option causes installation of only the +namelink when a library target is installed. The NAMELINK_SKIP option +causes installation of library files other than the namelink when a +library target is installed. When neither option is given both +portions are installed. On platforms where versioned shared libraries +do not have namelinks or when a library is not versioned the +NAMELINK_SKIP option installs the library and the NAMELINK_ONLY option +installs nothing. See the VERSION and SOVERSION target properties for +details on creating versioned shared libraries. + +One or more groups of properties may be specified in a single call to +the TARGETS form of this command. A target may be installed more than +once to different locations. Consider hypothetical targets "myExe", +"mySharedLib", and "myStaticLib". The code + +:: + + install(TARGETS myExe mySharedLib myStaticLib + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib/static) + install(TARGETS mySharedLib DESTINATION /some/full/path) + +will install myExe to /bin and myStaticLib to +/lib/static. On non-DLL platforms mySharedLib will be +installed to /lib and /some/full/path. On DLL platforms the +mySharedLib DLL will be installed to /bin and /some/full/path +and its import library will be installed to /lib/static and +/some/full/path. + +The EXPORT option associates the installed target files with an export +called . It must appear before any RUNTIME, LIBRARY, or +ARCHIVE options. To actually install the export file itself, call +install(EXPORT). See documentation of the install(EXPORT ...) +signature below for details. + +Installing a target with EXCLUDE_FROM_ALL set to true has undefined +behavior. + +The FILES signature: + +:: + + install(FILES files... DESTINATION + [PERMISSIONS permissions...] + [CONFIGURATIONS [Debug|Release|...]] + [COMPONENT ] + [RENAME ] [OPTIONAL]) + +The FILES form specifies rules for installing files for a project. +File names given as relative paths are interpreted with respect to the +current source directory. Files installed by this form are by default +given permissions OWNER_WRITE, OWNER_READ, GROUP_READ, and WORLD_READ +if no PERMISSIONS argument is given. + +The PROGRAMS signature: + +:: + + install(PROGRAMS files... DESTINATION + [PERMISSIONS permissions...] + [CONFIGURATIONS [Debug|Release|...]] + [COMPONENT ] + [RENAME ] [OPTIONAL]) + +The PROGRAMS form is identical to the FILES form except that the +default permissions for the installed file also include OWNER_EXECUTE, +GROUP_EXECUTE, and WORLD_EXECUTE. This form is intended to install +programs that are not targets, such as shell scripts. Use the TARGETS +form to install targets built within the project. + +The DIRECTORY signature: + +:: + + install(DIRECTORY dirs... DESTINATION + [FILE_PERMISSIONS permissions...] + [DIRECTORY_PERMISSIONS permissions...] + [USE_SOURCE_PERMISSIONS] [OPTIONAL] + [CONFIGURATIONS [Debug|Release|...]] + [COMPONENT ] [FILES_MATCHING] + [[PATTERN | REGEX ] + [EXCLUDE] [PERMISSIONS permissions...]] [...]) + +The DIRECTORY form installs contents of one or more directories to a +given destination. The directory structure is copied verbatim to the +destination. The last component of each directory name is appended to +the destination directory but a trailing slash may be used to avoid +this because it leaves the last component empty. Directory names +given as relative paths are interpreted with respect to the current +source directory. If no input directory names are given the +destination directory will be created but nothing will be installed +into it. The FILE_PERMISSIONS and DIRECTORY_PERMISSIONS options +specify permissions given to files and directories in the destination. +If USE_SOURCE_PERMISSIONS is specified and FILE_PERMISSIONS is not, +file permissions will be copied from the source directory structure. +If no permissions are specified files will be given the default +permissions specified in the FILES form of the command, and the +directories will be given the default permissions specified in the +PROGRAMS form of the command. + +Installation of directories may be controlled with fine granularity +using the PATTERN or REGEX options. These "match" options specify a +globbing pattern or regular expression to match directories or files +encountered within input directories. They may be used to apply +certain options (see below) to a subset of the files and directories +encountered. The full path to each input file or directory (with +forward slashes) is matched against the expression. A PATTERN will +match only complete file names: the portion of the full path matching +the pattern must occur at the end of the file name and be preceded by +a slash. A REGEX will match any portion of the full path but it may +use '/' and '$' to simulate the PATTERN behavior. By default all +files and directories are installed whether or not they are matched. +The FILES_MATCHING option may be given before the first match option +to disable installation of files (but not directories) not matched by +any expression. For example, the code + +:: + + install(DIRECTORY src/ DESTINATION include/myproj + FILES_MATCHING PATTERN "*.h") + +will extract and install header files from a source tree. + +Some options may follow a PATTERN or REGEX expression and are applied +only to files or directories matching them. The EXCLUDE option will +skip the matched file or directory. The PERMISSIONS option overrides +the permissions setting for the matched file or directory. For +example the code + +:: + + install(DIRECTORY icons scripts/ DESTINATION share/myproj + PATTERN "CVS" EXCLUDE + PATTERN "scripts/*" + PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ + GROUP_EXECUTE GROUP_READ) + +will install the icons directory to share/myproj/icons and the scripts +directory to share/myproj. The icons will get default file +permissions, the scripts will be given specific permissions, and any +CVS directories will be excluded. + +The SCRIPT and CODE signature: + +:: + + install([[SCRIPT ] [CODE ]] [...]) + +The SCRIPT form will invoke the given CMake script files during +installation. If the script file name is a relative path it will be +interpreted with respect to the current source directory. The CODE +form will invoke the given CMake code during installation. Code is +specified as a single argument inside a double-quoted string. For +example, the code + +:: + + install(CODE "MESSAGE(\"Sample install message.\")") + +will print a message during installation. + +The EXPORT signature: + +:: + + install(EXPORT DESTINATION + [NAMESPACE ] [FILE .cmake] + [PERMISSIONS permissions...] + [CONFIGURATIONS [Debug|Release|...]] + [EXPORT_LINK_INTERFACE_LIBRARIES] + [COMPONENT ]) + +The EXPORT form generates and installs a CMake file containing code to +import targets from the installation tree into another project. +Target installations are associated with the export +using the EXPORT option of the install(TARGETS ...) signature +documented above. The NAMESPACE option will prepend to +the target names as they are written to the import file. By default +the generated file will be called .cmake but the FILE +option may be used to specify a different name. The value given to +the FILE option must be a file name with the ".cmake" extension. If a +CONFIGURATIONS option is given then the file will only be installed +when one of the named configurations is installed. Additionally, the +generated import file will reference only the matching target +configurations. The EXPORT_LINK_INTERFACE_LIBRARIES keyword, if +present, causes the contents of the properties matching +(IMPORTED_)?LINK_INTERFACE_LIBRARIES(_)? to be exported, when +policy CMP0022 is NEW. If a COMPONENT option is specified that does +not match that given to the targets associated with the +behavior is undefined. If a library target is included in the export +but a target to which it links is not included the behavior is +unspecified. + +The EXPORT form is useful to help outside projects use targets built +and installed by the current project. For example, the code + +:: + + install(TARGETS myexe EXPORT myproj DESTINATION bin) + install(EXPORT myproj NAMESPACE mp_ DESTINATION lib/myproj) + +will install the executable myexe to /bin and code to import +it in the file "/lib/myproj/myproj.cmake". An outside project +may load this file with the include command and reference the myexe +executable from the installation tree using the imported target name +mp_myexe as if the target were built in its own tree. + +NOTE: This command supercedes the INSTALL_TARGETS command and the +target properties PRE_INSTALL_SCRIPT and POST_INSTALL_SCRIPT. It also +replaces the FILES forms of the INSTALL_FILES and INSTALL_PROGRAMS +commands. The processing order of these install rules relative to +those generated by INSTALL_TARGETS, INSTALL_FILES, and +INSTALL_PROGRAMS commands is not defined. diff --git a/Help/command/install_files.rst b/Help/command/install_files.rst new file mode 100644 index 0000000..7b6bd81 --- /dev/null +++ b/Help/command/install_files.rst @@ -0,0 +1,39 @@ +install_files +------------- + +Deprecated. Use the install(FILES ) command instead. + +This command has been superceded by the install command. It is +provided for compatibility with older CMake code. The FILES form is +directly replaced by the FILES form of the install command. The +regexp form can be expressed more clearly using the GLOB form of the +file command. + +:: + + install_files( extension file file ...) + +Create rules to install the listed files with the given extension into +the given directory. Only files existing in the current source tree +or its corresponding location in the binary tree may be listed. If a +file specified already has an extension, that extension will be +removed first. This is useful for providing lists of source files +such as foo.cxx when you want the corresponding foo.h to be installed. +A typical extension is '.h'. + +:: + + install_files( regexp) + +Any files in the current source directory that match the regular +expression will be installed. + +:: + + install_files( FILES file file ...) + +Any files listed after the FILES keyword will be installed explicitly +from the names given. Full paths are allowed in this form. + +The directory is relative to the installation prefix, which is +stored in the variable CMAKE_INSTALL_PREFIX. diff --git a/Help/command/install_programs.rst b/Help/command/install_programs.rst new file mode 100644 index 0000000..26789d8 --- /dev/null +++ b/Help/command/install_programs.rst @@ -0,0 +1,33 @@ +install_programs +---------------- + +Deprecated. Use the install(PROGRAMS ) command instead. + +This command has been superceded by the install command. It is +provided for compatibility with older CMake code. The FILES form is +directly replaced by the PROGRAMS form of the INSTALL command. The +regexp form can be expressed more clearly using the GLOB form of the +FILE command. + +:: + + install_programs( file1 file2 [file3 ...]) + install_programs( FILES file1 [file2 ...]) + +Create rules to install the listed programs into the given directory. +Use the FILES argument to guarantee that the file list version of the +command will be used even when there is only one argument. + +:: + + install_programs( regexp) + +In the second form any program in the current source directory that +matches the regular expression will be installed. + +This command is intended to install programs that are not built by +cmake, such as shell scripts. See the TARGETS form of the INSTALL +command to create installation rules for targets built by cmake. + +The directory is relative to the installation prefix, which is +stored in the variable CMAKE_INSTALL_PREFIX. diff --git a/Help/command/install_targets.rst b/Help/command/install_targets.rst new file mode 100644 index 0000000..caa933f --- /dev/null +++ b/Help/command/install_targets.rst @@ -0,0 +1,17 @@ +install_targets +--------------- + +Deprecated. Use the install(TARGETS ) command instead. + +This command has been superceded by the install command. It is +provided for compatibility with older CMake code. + +:: + + install_targets( [RUNTIME_DIRECTORY dir] target target) + +Create rules to install the listed targets into the given directory. +The directory is relative to the installation prefix, which is +stored in the variable CMAKE_INSTALL_PREFIX. If RUNTIME_DIRECTORY is +specified, then on systems with special runtime files (Windows DLL), +the files will be copied to that directory. diff --git a/Help/command/link_directories.rst b/Help/command/link_directories.rst new file mode 100644 index 0000000..bdc94cd --- /dev/null +++ b/Help/command/link_directories.rst @@ -0,0 +1,19 @@ +link_directories +---------------- + +Specify directories in which the linker will look for libraries. + +:: + + link_directories(directory1 directory2 ...) + +Specify the paths in which the linker should search for libraries. +The command will apply only to targets created after it is called. +Relative paths given to this command are interpreted as relative to +the current source directory, see CMP0015. + +Note that this command is rarely necessary. Library locations +returned by find_package() and find_library() are absolute paths. +Pass these absolute library file paths directly to the +target_link_libraries() command. CMake will ensure the linker finds +them. diff --git a/Help/command/link_libraries.rst b/Help/command/link_libraries.rst new file mode 100644 index 0000000..d690c9b --- /dev/null +++ b/Help/command/link_libraries.rst @@ -0,0 +1,16 @@ +link_libraries +-------------- + +Deprecated. Use the target_link_libraries() command instead. + +Link libraries to all targets added later. + +:: + + link_libraries(library1 library2 ...) + +Specify a list of libraries to be linked into any following targets +(typically added with the add_executable or add_library calls). This +command is passed down to all subdirectories. The debug and optimized +strings may be used to indicate that the next library listed is to be +used only for that specific type of build. diff --git a/Help/command/list.rst b/Help/command/list.rst new file mode 100644 index 0000000..f044dba --- /dev/null +++ b/Help/command/list.rst @@ -0,0 +1,60 @@ +list +---- + +List operations. + +:: + + list(LENGTH ) + list(GET [ ...] + ) + list(APPEND [ ...]) + list(FIND ) + list(INSERT [ ...]) + list(REMOVE_ITEM [ ...]) + list(REMOVE_AT [ ...]) + list(REMOVE_DUPLICATES ) + list(REVERSE ) + list(SORT ) + +LENGTH will return a given list's length. + +GET will return list of elements specified by indices from the list. + +APPEND will append elements to the list. + +FIND will return the index of the element specified in the list or -1 +if it wasn't found. + +INSERT will insert elements to the list to the specified location. + +REMOVE_AT and REMOVE_ITEM will remove items from the list. The +difference is that REMOVE_ITEM will remove the given items, while +REMOVE_AT will remove the items at the given indices. + +REMOVE_DUPLICATES will remove duplicated items in the list. + +REVERSE reverses the contents of the list in-place. + +SORT sorts the list in-place alphabetically. + +The list subcommands APPEND, INSERT, REMOVE_AT, REMOVE_ITEM, +REMOVE_DUPLICATES, REVERSE and SORT may create new values for the list +within the current CMake variable scope. Similar to the SET command, +the LIST command creates new variable values in the current scope, +even if the list itself is actually defined in a parent scope. To +propagate the results of these operations upwards, use SET with +PARENT_SCOPE, SET with CACHE INTERNAL, or some other means of value +propagation. + +NOTES: A list in cmake is a ; separated group of strings. To create a +list the set command can be used. For example, set(var a b c d e) +creates a list with a;b;c;d;e, and set(var "a b c d e") creates a +string or a list with one item in it. + +When specifying index values, if is 0 or greater, it +is indexed from the beginning of the list, with 0 representing the +first list element. If is -1 or lesser, it is indexed +from the end of the list, with -1 representing the last list element. +Be careful when counting with negative indices: they do not start from +0. -0 is equivalent to 0, the first list element. diff --git a/Help/command/load_cache.rst b/Help/command/load_cache.rst new file mode 100644 index 0000000..b7484cb --- /dev/null +++ b/Help/command/load_cache.rst @@ -0,0 +1,27 @@ +load_cache +---------- + +Load in the values from another project's CMake cache. + +:: + + load_cache(pathToCacheFile READ_WITH_PREFIX + prefix entry1...) + +Read the cache and store the requested entries in variables with their +name prefixed with the given prefix. This only reads the values, and +does not create entries in the local project's cache. + +:: + + load_cache(pathToCacheFile [EXCLUDE entry1...] + [INCLUDE_INTERNALS entry1...]) + +Load in the values from another cache and store them in the local +project's cache as internal entries. This is useful for a project +that depends on another project built in a different tree. EXCLUDE +option can be used to provide a list of entries to be excluded. +INCLUDE_INTERNALS can be used to provide a list of internal entries to +be included. Normally, no internal entries are brought in. Use of +this form of the command is strongly discouraged, but it is provided +for backward compatibility. diff --git a/Help/command/load_command.rst b/Help/command/load_command.rst new file mode 100644 index 0000000..63f23be --- /dev/null +++ b/Help/command/load_command.rst @@ -0,0 +1,21 @@ +load_command +------------ + +Load a command into a running CMake. + +:: + + load_command(COMMAND_NAME [loc2 ...]) + +The given locations are searched for a library whose name is +cmCOMMAND_NAME. If found, it is loaded as a module and the command is +added to the set of available CMake commands. Usually, TRY_COMPILE is +used before this command to compile the module. If the command is +successfully loaded a variable named + +:: + + CMAKE_LOADED_COMMAND_ + +will be set to the full path of the module that was loaded. Otherwise +the variable will not be set. diff --git a/Help/command/macro.rst b/Help/command/macro.rst new file mode 100644 index 0000000..aa16352 --- /dev/null +++ b/Help/command/macro.rst @@ -0,0 +1,33 @@ +macro +----- + +Start recording a macro for later invocation as a command. + +:: + + macro( [arg1 [arg2 [arg3 ...]]]) + COMMAND1(ARGS ...) + COMMAND2(ARGS ...) + ... + endmacro() + +Define a macro named that takes arguments named arg1 arg2 arg3 +(...). Commands listed after macro, but before the matching endmacro, +are not invoked until the macro is invoked. When it is invoked, the +commands recorded in the macro are first modified by replacing formal +parameters (${arg1}) with the arguments passed, and then invoked as +normal commands. In addition to referencing the formal parameters you +can reference the values ${ARGC} which will be set to the number of +arguments passed into the function as well as ${ARGV0} ${ARGV1} +${ARGV2} ... which will have the actual values of the arguments +passed in. This facilitates creating macros with optional arguments. +Additionally ${ARGV} holds the list of all arguments given to the +macro and ${ARGN} holds the list of arguments past the last expected +argument. Note that the parameters to a macro and values such as ARGN +are not variables in the usual CMake sense. They are string +replacements much like the C preprocessor would do with a macro. If +you want true CMake variables and/or better CMake scope control you +should look at the function command. + +See the cmake_policy() command documentation for the behavior of +policies inside macros. diff --git a/Help/command/make_directory.rst b/Help/command/make_directory.rst new file mode 100644 index 0000000..44dbe97 --- /dev/null +++ b/Help/command/make_directory.rst @@ -0,0 +1,12 @@ +make_directory +-------------- + +Deprecated. Use the file(MAKE_DIRECTORY ) command instead. + +:: + + make_directory(directory) + +Creates the specified directory. Full paths should be given. Any +parent directories that do not exist will also be created. Use with +care. diff --git a/Help/command/mark_as_advanced.rst b/Help/command/mark_as_advanced.rst new file mode 100644 index 0000000..30b1289 --- /dev/null +++ b/Help/command/mark_as_advanced.rst @@ -0,0 +1,19 @@ +mark_as_advanced +---------------- + +Mark cmake cached variables as advanced. + +:: + + mark_as_advanced([CLEAR|FORCE] VAR [VAR2 ...]) + +Mark the named cached variables as advanced. An advanced variable +will not be displayed in any of the cmake GUIs unless the show +advanced option is on. If CLEAR is the first argument advanced +variables are changed back to unadvanced. If FORCE is the first +argument, then the variable is made advanced. If neither FORCE nor +CLEAR is specified, new values will be marked as advanced, but if the +variable already has an advanced/non-advanced state, it will not be +changed. + +It does nothing in script mode. diff --git a/Help/command/math.rst b/Help/command/math.rst new file mode 100644 index 0000000..38fde1d --- /dev/null +++ b/Help/command/math.rst @@ -0,0 +1,13 @@ +math +---- + +Mathematical expressions. + +:: + + math(EXPR ) + +EXPR evaluates mathematical expression and returns result in the +output variable. Example mathematical expression is '5 * ( 10 + 13 +)'. Supported operators are + - * / % | & ^ ~ << >> * / %. They have +the same meaning as they do in C code. diff --git a/Help/command/message.rst b/Help/command/message.rst new file mode 100644 index 0000000..a20325a --- /dev/null +++ b/Help/command/message.rst @@ -0,0 +1,33 @@ +message +------- + +Display a message to the user. + +:: + + message([] "message to display" ...) + +The optional keyword determines the type of message: + +:: + + (none) = Important information + STATUS = Incidental information + WARNING = CMake Warning, continue processing + AUTHOR_WARNING = CMake Warning (dev), continue processing + SEND_ERROR = CMake Error, continue processing, + but skip generation + FATAL_ERROR = CMake Error, stop processing and generation + DEPRECATION = CMake Deprecation Error or Warning if variable + CMAKE_ERROR_DEPRECATED or CMAKE_WARN_DEPRECATED + is enabled, respectively, else no message. + +The CMake command-line tool displays STATUS messages on stdout and all +other message types on stderr. The CMake GUI displays all messages in +its log area. The interactive dialogs (ccmake and CMakeSetup) show +STATUS messages one at a time on a status line and other messages in +interactive pop-up boxes. + +CMake Warning and Error message text displays using a simple markup +language. Non-indented text is formatted in line-wrapped paragraphs +delimited by newlines. Indented text is considered pre-formatted. diff --git a/Help/command/option.rst b/Help/command/option.rst new file mode 100644 index 0000000..244ed07 --- /dev/null +++ b/Help/command/option.rst @@ -0,0 +1,15 @@ +option +------ + +Provides an option that the user can optionally select. + +:: + + option( "help string describing option" + [initial value]) + +Provide an option for the user to select as ON or OFF. If no initial +value is provided, OFF is used. + +If you have options that depend on the values of other options, see +the module help for CMakeDependentOption. diff --git a/Help/command/output_required_files.rst b/Help/command/output_required_files.rst new file mode 100644 index 0000000..d6bce13 --- /dev/null +++ b/Help/command/output_required_files.rst @@ -0,0 +1,17 @@ +output_required_files +--------------------- + +Deprecated. Approximate C preprocessor dependency scanning. + +This command exists only because ancient CMake versions provided it. +CMake handles preprocessor dependency scanning automatically using a +more advanced scanner. + +:: + + output_required_files(srcfile outputfile) + +Outputs a list of all the source files that are required by the +specified srcfile. This list is written into outputfile. This is +similar to writing out the dependencies for srcfile except that it +jumps from .h files into .cxx, .c and .cpp files if possible. diff --git a/Help/command/project.rst b/Help/command/project.rst new file mode 100644 index 0000000..9b9f93f --- /dev/null +++ b/Help/command/project.rst @@ -0,0 +1,27 @@ +project +------- + +Set a name for the entire project. + +:: + + project( [languageName1 languageName2 ... ] ) + +Sets the name of the project. Additionally this sets the variables +_BINARY_DIR and _SOURCE_DIR to the +respective values. + +Optionally you can specify which languages your project supports. +Example languages are CXX (i.e. C++), C, Fortran, etc. By default C +and CXX are enabled. E.g. if you do not have a C++ compiler, you can +disable the check for it by explicitly listing the languages you want +to support, e.g. C. By using the special language "NONE" all checks +for any language can be disabled. If a variable exists called +CMAKE_PROJECT__INCLUDE, the file pointed to by that +variable will be included as the last step of the project command. + +The top-level CMakeLists.txt file for a project must contain a +literal, direct call to the project() command; loading one through the +include() command is not sufficient. If no such call exists CMake +will implicitly add one to the top that enables the default languages +(C and CXX). diff --git a/Help/command/qt_wrap_cpp.rst b/Help/command/qt_wrap_cpp.rst new file mode 100644 index 0000000..81bbc06 --- /dev/null +++ b/Help/command/qt_wrap_cpp.rst @@ -0,0 +1,12 @@ +qt_wrap_cpp +----------- + +Create Qt Wrappers. + +:: + + qt_wrap_cpp(resultingLibraryName DestName + SourceLists ...) + +Produce moc files for all the .h files listed in the SourceLists. The +moc files will be added to the library using the DestName source list. diff --git a/Help/command/qt_wrap_ui.rst b/Help/command/qt_wrap_ui.rst new file mode 100644 index 0000000..4e033a8 --- /dev/null +++ b/Help/command/qt_wrap_ui.rst @@ -0,0 +1,14 @@ +qt_wrap_ui +---------- + +Create Qt user interfaces Wrappers. + +:: + + qt_wrap_ui(resultingLibraryName HeadersDestName + SourcesDestName SourceLists ...) + +Produce .h and .cxx files for all the .ui files listed in the +SourceLists. The .h files will be added to the library using the +HeadersDestNamesource list. The .cxx files will be added to the +library using the SourcesDestNamesource list. diff --git a/Help/command/remove.rst b/Help/command/remove.rst new file mode 100644 index 0000000..ddf0e9a --- /dev/null +++ b/Help/command/remove.rst @@ -0,0 +1,12 @@ +remove +------ + +Deprecated. Use the list(REMOVE_ITEM ) command instead. + +:: + + remove(VAR VALUE VALUE ...) + +Removes VALUE from the variable VAR. This is typically used to remove +entries from a vector (e.g. semicolon separated list). VALUE is +expanded. diff --git a/Help/command/remove_definitions.rst b/Help/command/remove_definitions.rst new file mode 100644 index 0000000..566da6e --- /dev/null +++ b/Help/command/remove_definitions.rst @@ -0,0 +1,11 @@ +remove_definitions +------------------ + +Removes -D define flags added by add_definitions. + +:: + + remove_definitions(-DFOO -DBAR ...) + +Removes flags (added by add_definitions) from the compiler command +line for sources in the current directory and below. diff --git a/Help/command/return.rst b/Help/command/return.rst new file mode 100644 index 0000000..899470c --- /dev/null +++ b/Help/command/return.rst @@ -0,0 +1,18 @@ +return +------ + +Return from a file, directory or function. + +:: + + return() + +Returns from a file, directory or function. When this command is +encountered in an included file (via include() or find_package()), it +causes processing of the current file to stop and control is returned +to the including file. If it is encountered in a file which is not +included by another file, e.g. a CMakeLists.txt, control is returned +to the parent directory if there is one. If return is called in a +function, control is returned to the caller of the function. Note +that a macro is not a function and does not handle return like a +function does. diff --git a/Help/command/separate_arguments.rst b/Help/command/separate_arguments.rst new file mode 100644 index 0000000..a876595 --- /dev/null +++ b/Help/command/separate_arguments.rst @@ -0,0 +1,31 @@ +separate_arguments +------------------ + +Parse space-separated arguments into a semicolon-separated list. + +:: + + separate_arguments( _COMMAND "") + +Parses a unix- or windows-style command-line string "" and +stores a semicolon-separated list of the arguments in . The +entire command line must be given in one "" argument. + +The UNIX_COMMAND mode separates arguments by unquoted whitespace. It +recognizes both single-quote and double-quote pairs. A backslash +escapes the next literal character (\" is "); there are no special +escapes (\n is just n). + +The WINDOWS_COMMAND mode parses a windows command-line using the same +syntax the runtime library uses to construct argv at startup. It +separates arguments by whitespace that is not double-quoted. +Backslashes are literal unless they precede double-quotes. See the +MSDN article "Parsing C Command-Line Arguments" for details. + +:: + + separate_arguments(VARIABLE) + +Convert the value of VARIABLE to a semi-colon separated list. All +spaces are replaced with ';'. This helps with generating command +lines. diff --git a/Help/command/set.rst b/Help/command/set.rst new file mode 100644 index 0000000..7a59550 --- /dev/null +++ b/Help/command/set.rst @@ -0,0 +1,116 @@ +set +--- + +Set a CMake, cache or environment variable to a given value. + +:: + + set( + [[CACHE [FORCE]] | PARENT_SCOPE]) + +Within CMake sets to the value . is +expanded before is set to it. Normally, set will set a +regular CMake variable. If CACHE is present, then the is +put in the cache instead, unless it is already in the cache. See +section 'Variable types in CMake' below for details of regular and +cache variables and their interactions. If CACHE is used, and + are required. is used by the CMake GUI to choose a +widget with which the user sets a value. The value for may be +one of + +:: + + FILEPATH = File chooser dialog. + PATH = Directory chooser dialog. + STRING = Arbitrary string. + BOOL = Boolean ON/OFF checkbox. + INTERNAL = No GUI entry (used for persistent variables). + +If is INTERNAL, the cache variable is marked as internal, and +will not be shown to the user in tools like cmake-gui. This is +intended for values that should be persisted in the cache, but which +users should not normally change. INTERNAL implies FORCE. + +Normally, set(...CACHE...) creates cache variables, but does not +modify them. If FORCE is specified, the value of the cache variable +is set, even if the variable is already in the cache. This should +normally be avoided, as it will remove any changes to the cache +variable's value by the user. + +If PARENT_SCOPE is present, the variable will be set in the scope +above the current scope. Each new directory or function creates a new +scope. This command will set the value of a variable into the parent +directory or calling function (whichever is applicable to the case at +hand). PARENT_SCOPE cannot be combined with CACHE. + +If is not specified then the variable is removed instead of +set. See also: the unset() command. + +:: + + set( ... ) + +In this case is set to a semicolon separated list of +values. + + can be an environment variable such as: + +:: + + set( ENV{PATH} /home/martink ) + +in which case the environment variable will be set. + +*** Variable types in CMake *** + +In CMake there are two types of variables: normal variables and cache +variables. Normal variables are meant for the internal use of the +script (just like variables in most programming languages); they are +not persisted across CMake runs. Cache variables (unless set with +INTERNAL) are mostly intended for configuration settings where the +first CMake run determines a suitable default value, which the user +can then override, by editing the cache with tools such as ccmake or +cmake-gui. Cache variables are stored in the CMake cache file, and +are persisted across CMake runs. + +Both types can exist at the same time with the same name but different +values. When ${FOO} is evaluated, CMake first looks for a normal +variable 'FOO' in scope and uses it if set. If and only if no normal +variable exists then it falls back to the cache variable 'FOO'. + +Some examples: + +The code 'set(FOO "x")' sets the normal variable 'FOO'. It does not +touch the cache, but it will hide any existing cache value 'FOO'. + +The code 'set(FOO "x" CACHE ...)' checks for 'FOO' in the cache, +ignoring any normal variable of the same name. If 'FOO' is in the +cache then nothing happens to either the normal variable or the cache +variable. If 'FOO' is not in the cache, then it is added to the +cache. + +Finally, whenever a cache variable is added or modified by a command, +CMake also *removes* the normal variable of the same name from the +current scope so that an immediately following evaluation of it will +expose the newly cached value. + +Normally projects should avoid using normal and cache variables of the +same name, as this interaction can be hard to follow. However, in +some situations it can be useful. One example (used by some +projects): + +A project has a subproject in its source tree. The child project has +its own CMakeLists.txt, which is included from the parent +CMakeLists.txt using add_subdirectory(). Now, if the parent and the +child project provide the same option (for example a compiler option), +the parent gets the first chance to add a user-editable option to the +cache. Normally, the child would then use the same value that the +parent uses. However, it may be necessary to hard-code the value for +the child project's option while still allowing the user to edit the +value used by the parent project. The parent project can achieve this +simply by setting a normal variable with the same name as the option +in a scope sufficient to hide the option's cache variable from the +child completely. The parent has already set the cache variable, so +the child's set(...CACHE...) will do nothing, and evaluating the +option variable will use the value from the normal variable, which +hides the cache variable. diff --git a/Help/command/set_directory_properties.rst b/Help/command/set_directory_properties.rst new file mode 100644 index 0000000..834013a --- /dev/null +++ b/Help/command/set_directory_properties.rst @@ -0,0 +1,15 @@ +set_directory_properties +------------------------ + +Set a property of the directory. + +:: + + set_directory_properties(PROPERTIES prop1 value1 prop2 value2) + +Set a property for the current directory and subdirectories. If the +property is not found, CMake will report an error. The properties +include: INCLUDE_DIRECTORIES, LINK_DIRECTORIES, +INCLUDE_REGULAR_EXPRESSION, and ADDITIONAL_MAKE_CLEAN_FILES. +ADDITIONAL_MAKE_CLEAN_FILES is a list of files that will be cleaned as +a part of "make clean" stage. diff --git a/Help/command/set_property.rst b/Help/command/set_property.rst new file mode 100644 index 0000000..8cb963e --- /dev/null +++ b/Help/command/set_property.rst @@ -0,0 +1,43 @@ +set_property +------------ + +Set a named property in a given scope. + +:: + + set_property( + [APPEND] [APPEND_STRING] + PROPERTY [value1 [value2 ...]]) + +Set one property on zero or more objects of a scope. The first +argument determines the scope in which the property is set. It must +be one of the following: + +GLOBAL scope is unique and does not accept a name. + +DIRECTORY scope defaults to the current directory but another +directory (already processed by CMake) may be named by full or +relative path. + +TARGET scope may name zero or more existing targets. + +SOURCE scope may name zero or more source files. Note that source +file properties are visible only to targets added in the same +directory (CMakeLists.txt). + +TEST scope may name zero or more existing tests. + +CACHE scope must name zero or more cache existing entries. + +The required PROPERTY option is immediately followed by the name of +the property to set. Remaining arguments are used to compose the +property value in the form of a semicolon-separated list. If the +APPEND option is given the list is appended to any existing property +value.If the APPEND_STRING option is given the string is append to any +existing property value as string, i.e. it results in a longer string +and not a list of strings. diff --git a/Help/command/set_source_files_properties.rst b/Help/command/set_source_files_properties.rst new file mode 100644 index 0000000..8ea02a3 --- /dev/null +++ b/Help/command/set_source_files_properties.rst @@ -0,0 +1,15 @@ +set_source_files_properties +--------------------------- + +Source files can have properties that affect how they are built. + +:: + + set_source_files_properties([file1 [file2 [...]]] + PROPERTIES prop1 value1 + [prop2 value2 [...]]) + +Set properties associated with source files using a key/value paired +list. See properties documentation for those known to CMake. +Unrecognized properties are ignored. Source file properties are +visible only to targets added in the same directory (CMakeLists.txt). diff --git a/Help/command/set_target_properties.rst b/Help/command/set_target_properties.rst new file mode 100644 index 0000000..f65ee24 --- /dev/null +++ b/Help/command/set_target_properties.rst @@ -0,0 +1,104 @@ +set_target_properties +--------------------- + +Targets can have properties that affect how they are built. + +:: + + set_target_properties(target1 target2 ... + PROPERTIES prop1 value1 + prop2 value2 ...) + +Set properties on a target. The syntax for the command is to list all +the files you want to change, and then provide the values you want to +set next. You can use any prop value pair you want and extract it +later with the GET_TARGET_PROPERTY command. + +Properties that affect the name of a target's output file are as +follows. The PREFIX and SUFFIX properties override the default target +name prefix (such as "lib") and suffix (such as ".so"). IMPORT_PREFIX +and IMPORT_SUFFIX are the equivalent properties for the import library +corresponding to a DLL (for SHARED library targets). OUTPUT_NAME sets +the real name of a target when it is built and can be used to help +create two targets of the same name even though CMake requires unique +logical target names. There is also a _OUTPUT_NAME that can +set the output name on a per-configuration basis. _POSTFIX +sets a postfix for the real name of the target when it is built under +the configuration named by (in upper-case, such as +"DEBUG_POSTFIX"). The value of this property is initialized when the +target is created to the value of the variable CMAKE__POSTFIX +(except for executable targets because earlier CMake versions which +did not use this variable for executables). + +The LINK_FLAGS property can be used to add extra flags to the link +step of a target. LINK_FLAGS_ will add to the configuration +, for example, DEBUG, RELEASE, MINSIZEREL, RELWITHDEBINFO. +DEFINE_SYMBOL sets the name of the preprocessor symbol defined when +compiling sources in a shared library. If not set here then it is set +to target_EXPORTS by default (with some substitutions if the target is +not a valid C identifier). This is useful for headers to know whether +they are being included from inside their library or outside to +properly setup dllexport/dllimport decorations. The COMPILE_FLAGS +property sets additional compiler flags used to build sources within +the target. It may also be used to pass additional preprocessor +definitions. + +The LINKER_LANGUAGE property is used to change the tool used to link +an executable or shared library. The default is set the language to +match the files in the library. CXX and C are common values for this +property. + +For shared libraries VERSION and SOVERSION can be used to specify the +build version and API version respectively. When building or +installing appropriate symlinks are created if the platform supports +symlinks and the linker supports so-names. If only one of both is +specified the missing is assumed to have the same version number. For +executables VERSION can be used to specify the build version. When +building or installing appropriate symlinks are created if the +platform supports symlinks. For shared libraries and executables on +Windows the VERSION attribute is parsed to extract a "major.minor" +version number. These numbers are used as the image version of the +binary. + +There are a few properties used to specify RPATH rules. INSTALL_RPATH +is a semicolon-separated list specifying the rpath to use in installed +targets (for platforms that support it). INSTALL_RPATH_USE_LINK_PATH +is a boolean that if set to true will append directories in the linker +search path and outside the project to the INSTALL_RPATH. +SKIP_BUILD_RPATH is a boolean specifying whether to skip automatic +generation of an rpath allowing the target to run from the build tree. +BUILD_WITH_INSTALL_RPATH is a boolean specifying whether to link the +target in the build tree with the INSTALL_RPATH. This takes +precedence over SKIP_BUILD_RPATH and avoids the need for relinking +before installation. INSTALL_NAME_DIR is a string specifying the +directory portion of the "install_name" field of shared libraries on +Mac OSX to use in the installed targets. When the target is created +the values of the variables CMAKE_INSTALL_RPATH, +CMAKE_INSTALL_RPATH_USE_LINK_PATH, CMAKE_SKIP_BUILD_RPATH, +CMAKE_BUILD_WITH_INSTALL_RPATH, and CMAKE_INSTALL_NAME_DIR are used to +initialize these properties. + +PROJECT_LABEL can be used to change the name of the target in an IDE +like visual studio. VS_KEYWORD can be set to change the visual studio +keyword, for example Qt integration works better if this is set to +Qt4VSv1.0. + +VS_SCC_PROJECTNAME, VS_SCC_LOCALPATH, VS_SCC_PROVIDER and +VS_SCC_AUXPATH can be set to add support for source control bindings +in a Visual Studio project file. + +VS_GLOBAL_ can be set to add a Visual Studio +project-specific global variable. Qt integration works better if +VS_GLOBAL_QtVersion is set to the Qt version FindQt4.cmake found. For +example, "4.7.3" + +The PRE_INSTALL_SCRIPT and POST_INSTALL_SCRIPT properties are the old +way to specify CMake scripts to run before and after installing a +target. They are used only when the old INSTALL_TARGETS command is +used to install the target. Use the INSTALL command instead. + +The EXCLUDE_FROM_DEFAULT_BUILD property is used by the visual studio +generators. If it is set to 1 the target will not be part of the +default build when you select "Build Solution". This can also be set +on a per-configuration basis using +EXCLUDE_FROM_DEFAULT_BUILD_. diff --git a/Help/command/set_tests_properties.rst b/Help/command/set_tests_properties.rst new file mode 100644 index 0000000..82cd5d8 --- /dev/null +++ b/Help/command/set_tests_properties.rst @@ -0,0 +1,36 @@ +set_tests_properties +-------------------- + +Set a property of the tests. + +:: + + set_tests_properties(test1 [test2...] PROPERTIES prop1 value1 prop2 value2) + +Set a property for the tests. If the property is not found, CMake +will report an error. Generator expressions will be expanded the same +as supported by the test's add_test call. The properties include: + +WILL_FAIL: If set to true, this will invert the pass/fail flag of the +test. + +PASS_REGULAR_EXPRESSION: If set, the test output will be checked +against the specified regular expressions and at least one of the +regular expressions has to match, otherwise the test will fail. + +:: + + Example: PASS_REGULAR_EXPRESSION "TestPassed;All ok" + +FAIL_REGULAR_EXPRESSION: If set, if the output will match to one of +specified regular expressions, the test will fail. + +:: + + Example: PASS_REGULAR_EXPRESSION "[^a-z]Error;ERROR;Failed" + +Both PASS_REGULAR_EXPRESSION and FAIL_REGULAR_EXPRESSION expect a list +of regular expressions. + +TIMEOUT: Setting this will limit the test runtime to the number of +seconds specified. diff --git a/Help/command/site_name.rst b/Help/command/site_name.rst new file mode 100644 index 0000000..e17c1ee --- /dev/null +++ b/Help/command/site_name.rst @@ -0,0 +1,8 @@ +site_name +--------- + +Set the given variable to the name of the computer. + +:: + + site_name(variable) diff --git a/Help/command/source_group.rst b/Help/command/source_group.rst new file mode 100644 index 0000000..77bb9ad --- /dev/null +++ b/Help/command/source_group.rst @@ -0,0 +1,28 @@ +source_group +------------ + +Define a grouping for sources in the makefile. + +:: + + source_group(name [REGULAR_EXPRESSION regex] [FILES src1 src2 ...]) + +Defines a group into which sources will be placed in project files. +This is mainly used to setup file tabs in Visual Studio. Any file +whose name is listed or matches the regular expression will be placed +in this group. If a file matches multiple groups, the LAST group that +explicitly lists the file will be favored, if any. If no group +explicitly lists the file, the LAST group whose regular expression +matches the file will be favored. + +The name of the group may contain backslashes to specify subgroups: + +:: + + source_group(outer\\inner ...) + +For backwards compatibility, this command also supports the format: + +:: + + source_group(name regex) diff --git a/Help/command/string.rst b/Help/command/string.rst new file mode 100644 index 0000000..c191c63 --- /dev/null +++ b/Help/command/string.rst @@ -0,0 +1,152 @@ +string +------ + +String operations. + +:: + + string(REGEX MATCH + [...]) + string(REGEX MATCHALL + [...]) + string(REGEX REPLACE + + [...]) + string(REPLACE + + [...]) + string( + ) + string(COMPARE EQUAL ) + string(COMPARE NOTEQUAL ) + string(COMPARE LESS ) + string(COMPARE GREATER ) + string(ASCII [ ...] ) + string(CONFIGURE + [@ONLY] [ESCAPE_QUOTES]) + string(TOUPPER ) + string(TOLOWER ) + string(LENGTH ) + string(SUBSTRING ) + string(STRIP ) + string(RANDOM [LENGTH ] [ALPHABET ] + [RANDOM_SEED ] ) + string(FIND [REVERSE]) + string(TIMESTAMP [] [UTC]) + string(MAKE_C_IDENTIFIER ) + +REGEX MATCH will match the regular expression once and store the match +in the output variable. + +REGEX MATCHALL will match the regular expression as many times as +possible and store the matches in the output variable as a list. + +REGEX REPLACE will match the regular expression as many times as +possible and substitute the replacement expression for the match in +the output. The replace expression may refer to paren-delimited +subexpressions of the match using \1, \2, ..., \9. Note that two +backslashes (\\1) are required in CMake code to get a backslash +through argument parsing. + +REPLACE will replace all occurrences of match_string in the input with +replace_string and store the result in the output. + +MD5, SHA1, SHA224, SHA256, SHA384, and SHA512 will compute a +cryptographic hash of the input string. + +COMPARE EQUAL/NOTEQUAL/LESS/GREATER will compare the strings and store +true or false in the output variable. + +ASCII will convert all numbers into corresponding ASCII characters. + +CONFIGURE will transform a string like CONFIGURE_FILE transforms a +file. + +TOUPPER/TOLOWER will convert string to upper/lower characters. + +LENGTH will return a given string's length. + +SUBSTRING will return a substring of a given string. If length is -1 +the remainder of the string starting at begin will be returned. + +STRIP will return a substring of a given string with leading and +trailing spaces removed. + +RANDOM will return a random string of given length consisting of +characters from the given alphabet. Default length is 5 characters +and default alphabet is all numbers and upper and lower case letters. +If an integer RANDOM_SEED is given, its value will be used to seed the +random number generator. + +FIND will return the position where the given substring was found in +the supplied string. If the REVERSE flag was used, the command will +search for the position of the last occurrence of the specified +substring. + +The following characters have special meaning in regular expressions: + +:: + + ^ Matches at beginning of input + $ Matches at end of input + . Matches any single character + [ ] Matches any character(s) inside the brackets + [^ ] Matches any character(s) not inside the brackets + - Inside brackets, specifies an inclusive range between + characters on either side e.g. [a-f] is [abcdef] + To match a literal - using brackets, make it the first + or the last character e.g. [+*/-] matches basic + mathematical operators. + * Matches preceding pattern zero or more times + + Matches preceding pattern one or more times + ? Matches preceding pattern zero or once only + | Matches a pattern on either side of the | + () Saves a matched subexpression, which can be referenced + in the REGEX REPLACE operation. Additionally it is saved + by all regular expression-related commands, including + e.g. if( MATCHES ), in the variables CMAKE_MATCH_(0..9). + +*, + and ? have higher precedence than concatenation. | has lower +precedence than concatenation. This means that the regular expression +"^ab+d$" matches "abbd" but not "ababd", and the regular expression +"^(ab|cd)$" matches "ab" but not "abd". + +TIMESTAMP will write a string representation of the current date +and/or time to the output variable. + +Should the command be unable to obtain a timestamp the output variable +will be set to the empty string "". + +The optional UTC flag requests the current date/time representation to +be in Coordinated Universal Time (UTC) rather than local time. + +The optional may contain the following format +specifiers: + +:: + + %d The day of the current month (01-31). + %H The hour on a 24-hour clock (00-23). + %I The hour on a 12-hour clock (01-12). + %j The day of the current year (001-366). + %m The month of the current year (01-12). + %M The minute of the current hour (00-59). + %S The second of the current minute. + 60 represents a leap second. (00-60) + %U The week number of the current year (00-53). + %w The day of the current week. 0 is Sunday. (0-6) + %y The last two digits of the current year (00-99) + %Y The current year. + +Unknown format specifiers will be ignored and copied to the output +as-is. + +If no explicit is given it will default to: + +:: + + %Y-%m-%dT%H:%M:%S for local time. + %Y-%m-%dT%H:%M:%SZ for UTC. + +MAKE_C_IDENTIFIER will write a string which can be used as an +identifier in C. diff --git a/Help/command/subdir_depends.rst b/Help/command/subdir_depends.rst new file mode 100644 index 0000000..c72a4af --- /dev/null +++ b/Help/command/subdir_depends.rst @@ -0,0 +1,11 @@ +subdir_depends +-------------- + +Deprecated. Does nothing. + +:: + + subdir_depends(subdir dep1 dep2 ...) + +Does not do anything. This command used to help projects order +parallel builds correctly. This functionality is now automatic. diff --git a/Help/command/subdirs.rst b/Help/command/subdirs.rst new file mode 100644 index 0000000..dee49f8 --- /dev/null +++ b/Help/command/subdirs.rst @@ -0,0 +1,24 @@ +subdirs +------- + +Deprecated. Use the add_subdirectory() command instead. + +Add a list of subdirectories to the build. + +:: + + subdirs(dir1 dir2 ...[EXCLUDE_FROM_ALL exclude_dir1 exclude_dir2 ...] + [PREORDER] ) + +Add a list of subdirectories to the build. The add_subdirectory +command should be used instead of subdirs although subdirs will still +work. This will cause any CMakeLists.txt files in the sub directories +to be processed by CMake. Any directories after the PREORDER flag are +traversed first by makefile builds, the PREORDER flag has no effect on +IDE projects. Any directories after the EXCLUDE_FROM_ALL marker will +not be included in the top level makefile or project file. This is +useful for having CMake create makefiles or projects for a set of +examples in a project. You would want CMake to generate makefiles or +project files for all the examples at the same time, but you would not +want them to show up in the top level project or be built each time +make is run from the top. diff --git a/Help/command/target_compile_definitions.rst b/Help/command/target_compile_definitions.rst new file mode 100644 index 0000000..0746d2a --- /dev/null +++ b/Help/command/target_compile_definitions.rst @@ -0,0 +1,96 @@ +target_compile_definitions +-------------------------- + +Add compile definitions to a target. + +:: + + target_compile_definitions( [items1...] + [ [items2...] ...]) + +Specify compile definitions to use when compiling a given target. The +named must have been created by a command such as +add_executable or add_library and must not be an IMPORTED target. The +INTERFACE, PUBLIC and PRIVATE keywords are required to specify the +scope of the following arguments. PRIVATE and PUBLIC items will +populate the COMPILE_DEFINITIONS property of . PUBLIC and +INTERFACE items will populate the INTERFACE_COMPILE_DEFINITIONS +property of . The following arguments specify compile +definitions. Repeated calls for the same append items in the +order called. + +Arguments to target_compile_definitions may use "generator +expressions" with the syntax "$<...>". Generator expressions are +evaluated during build system generation to produce information +specific to each build configuration. Valid expressions are: + +:: + + $<0:...> = empty string (ignores "...") + $<1:...> = content of "..." + $ = '1' if config is "cfg", else '0' + $ = configuration name + $ = '1' if the '...' is true, else '0' + $ = '1' if a is STREQUAL b, else '0' + $ = A literal '>'. Used to compare strings which contain a '>' for example. + $ = A literal ','. Used to compare strings which contain a ',' for example. + $ = A literal ';'. Used to prevent list expansion on an argument with ';'. + $ = joins the list with the content of "..." + $ = Marks ... as being the name of a target. This is required if exporting targets to multiple dependent export sets. The '...' must be a literal name of a target- it may not contain generator expressions. + $ = content of "..." when the property is exported using install(EXPORT), and empty otherwise. + $ = content of "..." when the property is exported using export(), or when the target is used by another target in the same buildsystem. Expands to the empty string otherwise. + $ = The CMake-id of the platform $ = '1' if the The CMake-id of the platform matches comp, otherwise '0'. + $ = The CMake-id of the C compiler used. + $ = '1' if the CMake-id of the C compiler matches comp, otherwise '0'. + $ = The CMake-id of the CXX compiler used. + $ = '1' if the CMake-id of the CXX compiler matches comp, otherwise '0'. + $ = '1' if v1 is a version greater than v2, else '0'. + $ = '1' if v1 is a version less than v2, else '0'. + $ = '1' if v1 is the same version as v2, else '0'. + $ = The version of the C compiler used. + $ = '1' if the version of the C compiler matches ver, otherwise '0'. + $ = The version of the CXX compiler used. + $ = '1' if the version of the CXX compiler matches ver, otherwise '0'. + $ = main file (.exe, .so.1.2, .a) + $ = file used to link (.a, .lib, .so) + $ = file with soname (.so.3) + +where "tgt" is the name of a target. Target file expressions produce +a full path, but _DIR and _NAME versions can produce the directory and +file name components: + +:: + + $/$ + $/$ + $/$ + + + +:: + + $ = The value of the property prop on the target tgt. + +Note that tgt is not added as a dependency of the target this +expression is evaluated on. + +:: + + $ = '1' if the policy was NEW when the 'head' target was created, else '0'. If the policy was not set, the warning message for the policy will be emitted. This generator expression only works for a subset of policies. + $ = Content of the install prefix when the target is exported via INSTALL(EXPORT) and empty otherwise. + +Boolean expressions: + +:: + + $ = '1' if all '?' are '1', else '0' + $ = '0' if all '?' are '0', else '1' + $ = '0' if '?' is '1', else '1' + +where '?' is always either '0' or '1'. + +Expressions with an implicit 'this' target: + +:: + + $ = The value of the property prop on the target on which the generator expression is evaluated. diff --git a/Help/command/target_compile_options.rst b/Help/command/target_compile_options.rst new file mode 100644 index 0000000..e086d5a --- /dev/null +++ b/Help/command/target_compile_options.rst @@ -0,0 +1,98 @@ +target_compile_options +---------------------- + +Add compile options to a target. + +:: + + target_compile_options( [BEFORE] [items1...] + [ [items2...] ...]) + +Specify compile options to use when compiling a given target. The +named must have been created by a command such as +add_executable or add_library and must not be an IMPORTED target. If +BEFORE is specified, the content will be prepended to the property +instead of being appended. + +The INTERFACE, PUBLIC and PRIVATE keywords are required to specify the +scope of the following arguments. PRIVATE and PUBLIC items will +populate the COMPILE_OPTIONS property of . PUBLIC and +INTERFACE items will populate the INTERFACE_COMPILE_OPTIONS property +of . The following arguments specify compile opitions. +Repeated calls for the same append items in the order called. + +Arguments to target_compile_options may use "generator expressions" +with the syntax "$<...>". Generator expressions are evaluated during +build system generation to produce information specific to each build +configuration. Valid expressions are: + +:: + + $<0:...> = empty string (ignores "...") + $<1:...> = content of "..." + $ = '1' if config is "cfg", else '0' + $ = configuration name + $ = '1' if the '...' is true, else '0' + $ = '1' if a is STREQUAL b, else '0' + $ = A literal '>'. Used to compare strings which contain a '>' for example. + $ = A literal ','. Used to compare strings which contain a ',' for example. + $ = A literal ';'. Used to prevent list expansion on an argument with ';'. + $ = joins the list with the content of "..." + $ = Marks ... as being the name of a target. This is required if exporting targets to multiple dependent export sets. The '...' must be a literal name of a target- it may not contain generator expressions. + $ = content of "..." when the property is exported using install(EXPORT), and empty otherwise. + $ = content of "..." when the property is exported using export(), or when the target is used by another target in the same buildsystem. Expands to the empty string otherwise. + $ = The CMake-id of the platform $ = '1' if the The CMake-id of the platform matches comp, otherwise '0'. + $ = The CMake-id of the C compiler used. + $ = '1' if the CMake-id of the C compiler matches comp, otherwise '0'. + $ = The CMake-id of the CXX compiler used. + $ = '1' if the CMake-id of the CXX compiler matches comp, otherwise '0'. + $ = '1' if v1 is a version greater than v2, else '0'. + $ = '1' if v1 is a version less than v2, else '0'. + $ = '1' if v1 is the same version as v2, else '0'. + $ = The version of the C compiler used. + $ = '1' if the version of the C compiler matches ver, otherwise '0'. + $ = The version of the CXX compiler used. + $ = '1' if the version of the CXX compiler matches ver, otherwise '0'. + $ = main file (.exe, .so.1.2, .a) + $ = file used to link (.a, .lib, .so) + $ = file with soname (.so.3) + +where "tgt" is the name of a target. Target file expressions produce +a full path, but _DIR and _NAME versions can produce the directory and +file name components: + +:: + + $/$ + $/$ + $/$ + + + +:: + + $ = The value of the property prop on the target tgt. + +Note that tgt is not added as a dependency of the target this +expression is evaluated on. + +:: + + $ = '1' if the policy was NEW when the 'head' target was created, else '0'. If the policy was not set, the warning message for the policy will be emitted. This generator expression only works for a subset of policies. + $ = Content of the install prefix when the target is exported via INSTALL(EXPORT) and empty otherwise. + +Boolean expressions: + +:: + + $ = '1' if all '?' are '1', else '0' + $ = '0' if all '?' are '0', else '1' + $ = '0' if '?' is '1', else '1' + +where '?' is always either '0' or '1'. + +Expressions with an implicit 'this' target: + +:: + + $ = The value of the property prop on the target on which the generator expression is evaluated. diff --git a/Help/command/target_include_directories.rst b/Help/command/target_include_directories.rst new file mode 100644 index 0000000..63306cd --- /dev/null +++ b/Help/command/target_include_directories.rst @@ -0,0 +1,108 @@ +target_include_directories +-------------------------- + +Add include directories to a target. + +:: + + target_include_directories( [SYSTEM] [BEFORE] [items1...] + [ [items2...] ...]) + +Specify include directories or targets to use when compiling a given +target. The named must have been created by a command such +as add_executable or add_library and must not be an IMPORTED target. + +If BEFORE is specified, the content will be prepended to the property +instead of being appended. + +The INTERFACE, PUBLIC and PRIVATE keywords are required to specify the +scope of the following arguments. PRIVATE and PUBLIC items will +populate the INCLUDE_DIRECTORIES property of . PUBLIC and +INTERFACE items will populate the INTERFACE_INCLUDE_DIRECTORIES +property of . The following arguments specify include +directories. Specified include directories may be absolute paths or +relative paths. Repeated calls for the same append items in +the order called.If SYSTEM is specified, the compiler will be told the +directories are meant as system include directories on some platforms +(signalling this setting might achieve effects such as the compiler +skipping warnings, or these fixed-install system files not being +considered in dependency calculations - see compiler docs). If SYSTEM +is used together with PUBLIC or INTERFACE, the +INTERFACE_SYSTEM_INCLUDE_DIRECTORIES target property will be populated +with the specified directories. + +Arguments to target_include_directories may use "generator +expressions" with the syntax "$<...>". Generator expressions are +evaluated during build system generation to produce information +specific to each build configuration. Valid expressions are: + +:: + + $<0:...> = empty string (ignores "...") + $<1:...> = content of "..." + $ = '1' if config is "cfg", else '0' + $ = configuration name + $ = '1' if the '...' is true, else '0' + $ = '1' if a is STREQUAL b, else '0' + $ = A literal '>'. Used to compare strings which contain a '>' for example. + $ = A literal ','. Used to compare strings which contain a ',' for example. + $ = A literal ';'. Used to prevent list expansion on an argument with ';'. + $ = joins the list with the content of "..." + $ = Marks ... as being the name of a target. This is required if exporting targets to multiple dependent export sets. The '...' must be a literal name of a target- it may not contain generator expressions. + $ = content of "..." when the property is exported using install(EXPORT), and empty otherwise. + $ = content of "..." when the property is exported using export(), or when the target is used by another target in the same buildsystem. Expands to the empty string otherwise. + $ = The CMake-id of the platform $ = '1' if the The CMake-id of the platform matches comp, otherwise '0'. + $ = The CMake-id of the C compiler used. + $ = '1' if the CMake-id of the C compiler matches comp, otherwise '0'. + $ = The CMake-id of the CXX compiler used. + $ = '1' if the CMake-id of the CXX compiler matches comp, otherwise '0'. + $ = '1' if v1 is a version greater than v2, else '0'. + $ = '1' if v1 is a version less than v2, else '0'. + $ = '1' if v1 is the same version as v2, else '0'. + $ = The version of the C compiler used. + $ = '1' if the version of the C compiler matches ver, otherwise '0'. + $ = The version of the CXX compiler used. + $ = '1' if the version of the CXX compiler matches ver, otherwise '0'. + $ = main file (.exe, .so.1.2, .a) + $ = file used to link (.a, .lib, .so) + $ = file with soname (.so.3) + +where "tgt" is the name of a target. Target file expressions produce +a full path, but _DIR and _NAME versions can produce the directory and +file name components: + +:: + + $/$ + $/$ + $/$ + + + +:: + + $ = The value of the property prop on the target tgt. + +Note that tgt is not added as a dependency of the target this +expression is evaluated on. + +:: + + $ = '1' if the policy was NEW when the 'head' target was created, else '0'. If the policy was not set, the warning message for the policy will be emitted. This generator expression only works for a subset of policies. + $ = Content of the install prefix when the target is exported via INSTALL(EXPORT) and empty otherwise. + +Boolean expressions: + +:: + + $ = '1' if all '?' are '1', else '0' + $ = '0' if all '?' are '0', else '1' + $ = '0' if '?' is '1', else '1' + +where '?' is always either '0' or '1'. + +Expressions with an implicit 'this' target: + +:: + + $ = The value of the property prop on the target on which the generator expression is evaluated. diff --git a/Help/command/target_link_libraries.rst b/Help/command/target_link_libraries.rst new file mode 100644 index 0000000..049d465 --- /dev/null +++ b/Help/command/target_link_libraries.rst @@ -0,0 +1,215 @@ +target_link_libraries +--------------------- + +Link a target to given libraries. + +:: + + target_link_libraries( [item1 [item2 [...]]] + [[debug|optimized|general] ] ...) + +Specify libraries or flags to use when linking a given target. The +named must have been created in the current directory by a +command such as add_executable or add_library. The remaining +arguments specify library names or flags. Repeated calls for the same + append items in the order called. + +If a library name matches that of another target in the project a +dependency will automatically be added in the build system to make +sure the library being linked is up-to-date before the target links. +Item names starting with '-', but not '-l' or '-framework', are +treated as linker flags. + +A "debug", "optimized", or "general" keyword indicates that the +library immediately following it is to be used only for the +corresponding build configuration. The "debug" keyword corresponds to +the Debug configuration (or to configurations named in the +DEBUG_CONFIGURATIONS global property if it is set). The "optimized" +keyword corresponds to all other configurations. The "general" +keyword corresponds to all configurations, and is purely optional +(assumed if omitted). Higher granularity may be achieved for +per-configuration rules by creating and linking to IMPORTED library +targets. See the IMPORTED mode of the add_library command for more +information. + +Library dependencies are transitive by default. When this target is +linked into another target then the libraries linked to this target +will appear on the link line for the other target too. See the +INTERFACE_LINK_LIBRARIES target property to override the set of +transitive link dependencies for a target. Calls to other signatures +of this command may set the property making any libraries linked +exclusively by this signature private. + +CMake will also propagate "usage requirements" from linked library +targets. Usage requirements affect compilation of sources in the +. They are specified by properties defined on linked targets. +During generation of the build system, CMake integrates usage +requirement property values with the corresponding build properties +for : + +:: + + INTERFACE_COMPILE_DEFINITONS: Appends to COMPILE_DEFINITONS + INTERFACE_INCLUDE_DIRECTORIES: Appends to INCLUDE_DIRECTORIES + INTERFACE_POSITION_INDEPENDENT_CODE: Sets POSITION_INDEPENDENT_CODE + or checked for consistency with existing value + + + +If an is a library in a Mac OX framework, the Headers directory +of the framework will also be processed as a "usage requirement". +This has the same effect as passing the framework directory as an +include directory. target_link_libraries( + +:: + + ... + [ ... ] ...]) + +The PUBLIC, PRIVATE and INTERFACE keywords can be used to specify both +the link dependencies and the link interface in one command. +Libraries and targets following PUBLIC are linked to, and are made +part of the link interface. Libraries and targets following PRIVATE +are linked to, but are not made part of the link interface. Libraries +following INTERFACE are appended to the link interface and are not +used for linking . + +:: + + target_link_libraries( LINK_INTERFACE_LIBRARIES + [[debug|optimized|general] ] ...) + +The LINK_INTERFACE_LIBRARIES mode appends the libraries to the +INTERFACE_LINK_LIBRARIES target property instead of using them for +linking. If policy CMP0022 is not NEW, then this mode also appends +libraries to the LINK_INTERFACE_LIBRARIES and its per-configuration +equivalent. This signature is for compatibility only. Prefer the +INTERFACE mode instead. Libraries specified as "debug" are wrapped in +a generator expression to correspond to debug builds. If policy +CMP0022 is not NEW, the libraries are also appended to the +LINK_INTERFACE_LIBRARIES_DEBUG property (or to the properties +corresponding to configurations listed in the DEBUG_CONFIGURATIONS +global property if it is set). Libraries specified as "optimized" are +appended to the INTERFACE_LINK_LIBRARIES property. If policy CMP0022 +is not NEW, they are also appended to the LINK_INTERFACE_LIBRARIES +property. Libraries specified as "general" (or without any keyword) +are treated as if specified for both "debug" and "optimized". + +:: + + target_link_libraries( + + [[debug|optimized|general] ] ... + [ + [[debug|optimized|general] ] ...]) + +The LINK_PUBLIC and LINK_PRIVATE modes can be used to specify both the +link dependencies and the link interface in one command. This +signature is for compatibility only. Prefer the PUBLIC or PRIVATE +keywords instead. Libraries and targets following LINK_PUBLIC are +linked to, and are made part of the INTERFACE_LINK_LIBRARIES. If +policy CMP0022 is not NEW, they are also made part of the +LINK_INTERFACE_LIBRARIES. Libraries and targets following +LINK_PRIVATE are linked to, but are not made part of the +INTERFACE_LINK_LIBRARIES (or LINK_INTERFACE_LIBRARIES). + +The library dependency graph is normally acyclic (a DAG), but in the +case of mutually-dependent STATIC libraries CMake allows the graph to +contain cycles (strongly connected components). When another target +links to one of the libraries CMake repeats the entire connected +component. For example, the code + +:: + + add_library(A STATIC a.c) + add_library(B STATIC b.c) + target_link_libraries(A B) + target_link_libraries(B A) + add_executable(main main.c) + target_link_libraries(main A) + +links 'main' to 'A B A B'. (While one repetition is usually +sufficient, pathological object file and symbol arrangements can +require more. One may handle such cases by manually repeating the +component in the last target_link_libraries call. However, if two +archives are really so interdependent they should probably be combined +into a single archive.) + +Arguments to target_link_libraries may use "generator expressions" +with the syntax "$<...>". Note however, that generator expressions +will not be used in OLD handling of CMP0003 or CMP0004. + +Generator expressions are evaluated during build system generation to +produce information specific to each build configuration. Valid +expressions are: + +:: + + $<0:...> = empty string (ignores "...") + $<1:...> = content of "..." + $ = '1' if config is "cfg", else '0' + $ = configuration name + $ = '1' if the '...' is true, else '0' + $ = '1' if a is STREQUAL b, else '0' + $ = A literal '>'. Used to compare strings which contain a '>' for example. + $ = A literal ','. Used to compare strings which contain a ',' for example. + $ = A literal ';'. Used to prevent list expansion on an argument with ';'. + $ = joins the list with the content of "..." + $ = Marks ... as being the name of a target. This is required if exporting targets to multiple dependent export sets. The '...' must be a literal name of a target- it may not contain generator expressions. + $ = content of "..." when the property is exported using install(EXPORT), and empty otherwise. + $ = content of "..." when the property is exported using export(), or when the target is used by another target in the same buildsystem. Expands to the empty string otherwise. + $ = The CMake-id of the platform $ = '1' if the The CMake-id of the platform matches comp, otherwise '0'. + $ = The CMake-id of the C compiler used. + $ = '1' if the CMake-id of the C compiler matches comp, otherwise '0'. + $ = The CMake-id of the CXX compiler used. + $ = '1' if the CMake-id of the CXX compiler matches comp, otherwise '0'. + $ = '1' if v1 is a version greater than v2, else '0'. + $ = '1' if v1 is a version less than v2, else '0'. + $ = '1' if v1 is the same version as v2, else '0'. + $ = The version of the C compiler used. + $ = '1' if the version of the C compiler matches ver, otherwise '0'. + $ = The version of the CXX compiler used. + $ = '1' if the version of the CXX compiler matches ver, otherwise '0'. + $ = main file (.exe, .so.1.2, .a) + $ = file used to link (.a, .lib, .so) + $ = file with soname (.so.3) + +where "tgt" is the name of a target. Target file expressions produce +a full path, but _DIR and _NAME versions can produce the directory and +file name components: + +:: + + $/$ + $/$ + $/$ + + + +:: + + $ = The value of the property prop on the target tgt. + +Note that tgt is not added as a dependency of the target this +expression is evaluated on. + +:: + + $ = '1' if the policy was NEW when the 'head' target was created, else '0'. If the policy was not set, the warning message for the policy will be emitted. This generator expression only works for a subset of policies. + $ = Content of the install prefix when the target is exported via INSTALL(EXPORT) and empty otherwise. + +Boolean expressions: + +:: + + $ = '1' if all '?' are '1', else '0' + $ = '0' if all '?' are '0', else '1' + $ = '0' if '?' is '1', else '1' + +where '?' is always either '0' or '1'. + +Expressions with an implicit 'this' target: + +:: + + $ = The value of the property prop on the target on which the generator expression is evaluated. diff --git a/Help/command/try_compile.rst b/Help/command/try_compile.rst new file mode 100644 index 0000000..8ed3cf4 --- /dev/null +++ b/Help/command/try_compile.rst @@ -0,0 +1,71 @@ +try_compile +----------- + +Try building some code. + +:: + + try_compile(RESULT_VAR + [targetName] [CMAKE_FLAGS flags...] + [OUTPUT_VARIABLE ]) + +Try building a project. In this form, srcdir should contain a +complete CMake project with a CMakeLists.txt file and all sources. +The bindir and srcdir will not be deleted after this command is run. +Specify targetName to build a specific target instead of the 'all' or +'ALL_BUILD' target. + +:: + + try_compile(RESULT_VAR + [CMAKE_FLAGS flags...] + [COMPILE_DEFINITIONS flags...] + [LINK_LIBRARIES libs...] + [OUTPUT_VARIABLE ] + [COPY_FILE [COPY_FILE_ERROR ]]) + +Try building an executable from one or more source files. In this +form the user need only supply one or more source files that include a +definition for 'main'. CMake will create a CMakeLists.txt file to +build the source(s) as an executable. Specify COPY_FILE to get a copy +of the linked executable at the given fileName and optionally +COPY_FILE_ERROR to capture any error. + +In this version all files in bindir/CMakeFiles/CMakeTmp will be +cleaned automatically. For debugging, --debug-trycompile can be +passed to cmake to avoid this clean. However, multiple sequential +try_compile operations reuse this single output directory. If you use +--debug-trycompile, you can only debug one try_compile call at a time. +The recommended procedure is to configure with cmake all the way +through once, then delete the cache entry associated with the +try_compile call of interest, and then re-run cmake again with +--debug-trycompile. + +Some extra flags that can be included are, INCLUDE_DIRECTORIES, +LINK_DIRECTORIES, and LINK_LIBRARIES. COMPILE_DEFINITIONS are +-Ddefinition that will be passed to the compile line. + +The srcfile signature also accepts a LINK_LIBRARIES argument which may +contain a list of libraries or IMPORTED targets which will be linked +to in the generated project. If LINK_LIBRARIES is specified as a +parameter to try_compile, then any LINK_LIBRARIES passed as +CMAKE_FLAGS will be ignored. + +try_compile creates a CMakeList.txt file on the fly that looks like +this: + +:: + + add_definitions( ) + include_directories(${INCLUDE_DIRECTORIES}) + link_directories(${LINK_DIRECTORIES}) + add_executable(cmTryCompileExec sources) + target_link_libraries(cmTryCompileExec ${LINK_LIBRARIES}) + +In both versions of the command, if OUTPUT_VARIABLE is specified, then +the output from the build process is stored in the given variable. +The success or failure of the try_compile, i.e. TRUE or FALSE +respectively, is returned in RESULT_VAR. CMAKE_FLAGS can be used to +pass -DVAR:TYPE=VALUE flags to the cmake that is run during the build. +Set variable CMAKE_TRY_COMPILE_CONFIGURATION to choose a build +configuration. diff --git a/Help/command/try_run.rst b/Help/command/try_run.rst new file mode 100644 index 0000000..9a17ad9 --- /dev/null +++ b/Help/command/try_run.rst @@ -0,0 +1,52 @@ +try_run +------- + +Try compiling and then running some code. + +:: + + try_run(RUN_RESULT_VAR COMPILE_RESULT_VAR + bindir srcfile [CMAKE_FLAGS ] + [COMPILE_DEFINITIONS ] + [COMPILE_OUTPUT_VARIABLE comp] + [RUN_OUTPUT_VARIABLE run] + [OUTPUT_VARIABLE var] + [ARGS ...]) + +Try compiling a srcfile. Return TRUE or FALSE for success or failure +in COMPILE_RESULT_VAR. Then if the compile succeeded, run the +executable and return its exit code in RUN_RESULT_VAR. If the +executable was built, but failed to run, then RUN_RESULT_VAR will be +set to FAILED_TO_RUN. COMPILE_OUTPUT_VARIABLE specifies the variable +where the output from the compile step goes. RUN_OUTPUT_VARIABLE +specifies the variable where the output from the running executable +goes. + +For compatibility reasons OUTPUT_VARIABLE is still supported, which +gives you the output from the compile and run step combined. + +Cross compiling issues + +When cross compiling, the executable compiled in the first step +usually cannot be run on the build host. try_run() checks the +CMAKE_CROSSCOMPILING variable to detect whether CMake is in +crosscompiling mode. If that's the case, it will still try to compile +the executable, but it will not try to run the executable. Instead it +will create cache variables which must be filled by the user or by +presetting them in some CMake script file to the values the executable +would have produced if it had been run on its actual target platform. +These variables are RUN_RESULT_VAR (explanation see above) and if +RUN_OUTPUT_VARIABLE (or OUTPUT_VARIABLE) was used, an additional cache +variable RUN_RESULT_VAR__COMPILE_RESULT_VAR__TRYRUN_OUTPUT.This is +intended to hold stdout and stderr from the executable. + +In order to make cross compiling your project easier, use try_run only +if really required. If you use try_run, use RUN_OUTPUT_VARIABLE (or +OUTPUT_VARIABLE) only if really required. Using them will require +that when crosscompiling, the cache variables will have to be set +manually to the output of the executable. You can also "guard" the +calls to try_run with if(CMAKE_CROSSCOMPILING) and provide an +easy-to-preset alternative for this case. + +Set variable CMAKE_TRY_COMPILE_CONFIGURATION to choose a build +configuration. diff --git a/Help/command/unset.rst b/Help/command/unset.rst new file mode 100644 index 0000000..d8f0dcd --- /dev/null +++ b/Help/command/unset.rst @@ -0,0 +1,25 @@ +unset +----- + +Unset a variable, cache variable, or environment variable. + +:: + + unset( [CACHE | PARENT_SCOPE]) + +Removes the specified variable causing it to become undefined. If +CACHE is present then the variable is removed from the cache instead +of the current scope. + +If PARENT_SCOPE is present then the variable is removed from the scope +above the current scope. See the same option in the set() command for +further details. + + can be an environment variable such as: + +:: + + unset(ENV{LD_LIBRARY_PATH}) + +in which case the variable will be removed from the current +environment. diff --git a/Help/command/use_mangled_mesa.rst b/Help/command/use_mangled_mesa.rst new file mode 100644 index 0000000..a4d77e9 --- /dev/null +++ b/Help/command/use_mangled_mesa.rst @@ -0,0 +1,13 @@ +use_mangled_mesa +---------------- + +Copy mesa headers for use in combination with system GL. + +:: + + use_mangled_mesa(PATH_TO_MESA OUTPUT_DIRECTORY) + +The path to mesa includes, should contain gl_mangle.h. The mesa +headers are copied to the specified output directory. This allows +mangled mesa headers to override other GL headers by being added to +the include directory path earlier. diff --git a/Help/command/utility_source.rst b/Help/command/utility_source.rst new file mode 100644 index 0000000..e513627 --- /dev/null +++ b/Help/command/utility_source.rst @@ -0,0 +1,22 @@ +utility_source +-------------- + +Specify the source tree of a third-party utility. + +:: + + utility_source(cache_entry executable_name + path_to_source [file1 file2 ...]) + +When a third-party utility's source is included in the distribution, +this command specifies its location and name. The cache entry will +not be set unless the path_to_source and all listed files exist. It +is assumed that the source tree of the utility will have been built +before it is needed. + +When cross compiling CMake will print a warning if a utility_source() +command is executed, because in many cases it is used to build an +executable which is executed later on. This doesn't work when cross +compiling, since the executable can run only on their target platform. +So in this case the cache entry has to be adjusted manually so it +points to an executable which is runnable on the build host. diff --git a/Help/command/variable_requires.rst b/Help/command/variable_requires.rst new file mode 100644 index 0000000..7535e40 --- /dev/null +++ b/Help/command/variable_requires.rst @@ -0,0 +1,20 @@ +variable_requires +----------------- + +Deprecated. Use the if() command instead. + +Assert satisfaction of an option's required variables. + +:: + + variable_requires(TEST_VARIABLE RESULT_VARIABLE + REQUIRED_VARIABLE1 + REQUIRED_VARIABLE2 ...) + +The first argument (TEST_VARIABLE) is the name of the variable to be +tested, if that variable is false nothing else is done. If +TEST_VARIABLE is true, then the next argument (RESULT_VARIABLE) is a +variable that is set to true if all the required variables are set. +The rest of the arguments are variables that must be true or not set +to NOTFOUND to avoid an error. If any are not true, an error is +reported. diff --git a/Help/command/variable_watch.rst b/Help/command/variable_watch.rst new file mode 100644 index 0000000..a2df058 --- /dev/null +++ b/Help/command/variable_watch.rst @@ -0,0 +1,13 @@ +variable_watch +-------------- + +Watch the CMake variable for change. + +:: + + variable_watch( []) + +If the specified variable changes, the message will be printed about +the variable being changed. If the command is specified, the command +will be executed. The command will receive the following arguments: +COMMAND( ) diff --git a/Help/command/while.rst b/Help/command/while.rst new file mode 100644 index 0000000..72c055d --- /dev/null +++ b/Help/command/while.rst @@ -0,0 +1,17 @@ +while +----- + +Evaluate a group of commands while a condition is true + +:: + + while(condition) + COMMAND1(ARGS ...) + COMMAND2(ARGS ...) + ... + endwhile(condition) + +All commands between while and the matching endwhile are recorded +without being invoked. Once the endwhile is evaluated, the recorded +list of commands is invoked as long as the condition is true. The +condition is evaluated using the same logic as the if command. diff --git a/Help/command/write_file.rst b/Help/command/write_file.rst new file mode 100644 index 0000000..015514b --- /dev/null +++ b/Help/command/write_file.rst @@ -0,0 +1,20 @@ +write_file +---------- + +Deprecated. Use the file(WRITE ) command instead. + +:: + + write_file(filename "message to write"... [APPEND]) + +The first argument is the file name, the rest of the arguments are +messages to write. If the argument APPEND is specified, then the +message will be appended. + +NOTE 1: file(WRITE ... and file(APPEND ... do exactly the same as +this one but add some more functionality. + +NOTE 2: When using write_file the produced file cannot be used as an +input to CMake (CONFIGURE_FILE, source file ...) because it will lead +to an infinite loop. Use configure_file if you want to generate input +files to CMake. diff --git a/Help/generator/CodeBlocks - Ninja.rst b/Help/generator/CodeBlocks - Ninja.rst new file mode 100644 index 0000000..0253af6 --- /dev/null +++ b/Help/generator/CodeBlocks - Ninja.rst @@ -0,0 +1,11 @@ +CodeBlocks - Ninja +------------------ + +Generates CodeBlocks project files. + +Project files for CodeBlocks will be created in the top directory and +in every subdirectory which features a CMakeLists.txt file containing +a PROJECT() call. Additionally a hierarchy of makefiles is generated +into the build tree. The appropriate make program can build the +project through the default make target. A "make install" target is +also provided. diff --git a/Help/generator/CodeBlocks - Unix Makefiles.rst b/Help/generator/CodeBlocks - Unix Makefiles.rst new file mode 100644 index 0000000..0a29835 --- /dev/null +++ b/Help/generator/CodeBlocks - Unix Makefiles.rst @@ -0,0 +1,11 @@ +CodeBlocks - Unix Makefiles +--------------------------- + +Generates CodeBlocks project files. + +Project files for CodeBlocks will be created in the top directory and +in every subdirectory which features a CMakeLists.txt file containing +a PROJECT() call. Additionally a hierarchy of makefiles is generated +into the build tree. The appropriate make program can build the +project through the default make target. A "make install" target is +also provided. diff --git a/Help/generator/Eclipse CDT4 - Ninja.rst b/Help/generator/Eclipse CDT4 - Ninja.rst new file mode 100644 index 0000000..270011f --- /dev/null +++ b/Help/generator/Eclipse CDT4 - Ninja.rst @@ -0,0 +1,11 @@ +Eclipse CDT4 - Ninja +-------------------- + +Generates Eclipse CDT 4.0 project files. + +Project files for Eclipse will be created in the top directory. In +out of source builds, a linked resource to the top level source +directory will be created. Additionally a hierarchy of makefiles is +generated into the build tree. The appropriate make program can build +the project through the default make target. A "make install" target +is also provided. diff --git a/Help/generator/Eclipse CDT4 - Unix Makefiles.rst b/Help/generator/Eclipse CDT4 - Unix Makefiles.rst new file mode 100644 index 0000000..c3449a7 --- /dev/null +++ b/Help/generator/Eclipse CDT4 - Unix Makefiles.rst @@ -0,0 +1,11 @@ +Eclipse CDT4 - Unix Makefiles +----------------------------- + +Generates Eclipse CDT 4.0 project files. + +Project files for Eclipse will be created in the top directory. In +out of source builds, a linked resource to the top level source +directory will be created. Additionally a hierarchy of makefiles is +generated into the build tree. The appropriate make program can build +the project through the default make target. A "make install" target +is also provided. diff --git a/Help/generator/KDevelop3 - Unix Makefiles.rst b/Help/generator/KDevelop3 - Unix Makefiles.rst new file mode 100644 index 0000000..2a29a2e --- /dev/null +++ b/Help/generator/KDevelop3 - Unix Makefiles.rst @@ -0,0 +1,13 @@ +KDevelop3 - Unix Makefiles +-------------------------- + +Generates KDevelop 3 project files. + +Project files for KDevelop 3 will be created in the top directory and +in every subdirectory which features a CMakeLists.txt file containing +a PROJECT() call. If you change the settings using KDevelop cmake +will try its best to keep your changes when regenerating the project +files. Additionally a hierarchy of UNIX makefiles is generated into +the build tree. Any standard UNIX-style make program can build the +project through the default make target. A "make install" target is +also provided. diff --git a/Help/generator/KDevelop3.rst b/Help/generator/KDevelop3.rst new file mode 100644 index 0000000..788d557 --- /dev/null +++ b/Help/generator/KDevelop3.rst @@ -0,0 +1,13 @@ +KDevelop3 +--------- + +Generates KDevelop 3 project files. + +Project files for KDevelop 3 will be created in the top directory and +in every subdirectory which features a CMakeLists.txt file containing +a PROJECT() call. If you change the settings using KDevelop cmake +will try its best to keep your changes when regenerating the project +files. Additionally a hierarchy of UNIX makefiles is generated into +the build tree. Any standard UNIX-style make program can build the +project through the default make target. A "make install" target is +also provided. diff --git a/Help/generator/Ninja.rst b/Help/generator/Ninja.rst new file mode 100644 index 0000000..08f74fb --- /dev/null +++ b/Help/generator/Ninja.rst @@ -0,0 +1,8 @@ +Ninja +----- + +Generates build.ninja files (experimental). + +A build.ninja file is generated into the build tree. Recent versions +of the ninja program can build the project through the "all" target. +An "install" target is also provided. diff --git a/Help/generator/Sublime Text 2 - Ninja.rst b/Help/generator/Sublime Text 2 - Ninja.rst new file mode 100644 index 0000000..b7a2b88 --- /dev/null +++ b/Help/generator/Sublime Text 2 - Ninja.rst @@ -0,0 +1,11 @@ +Sublime Text 2 - Ninja +---------------------- + +Generates Sublime Text 2 project files. + +Project files for Sublime Text 2 will be created in the top directory +and in every subdirectory which features a CMakeLists.txt file +containing a PROJECT() call. Additionally Makefiles (or build.ninja +files) are generated into the build tree. The appropriate make +program can build the project through the default make target. A +"make install" target is also provided. diff --git a/Help/generator/Sublime Text 2 - Unix Makefiles.rst b/Help/generator/Sublime Text 2 - Unix Makefiles.rst new file mode 100644 index 0000000..67d329e --- /dev/null +++ b/Help/generator/Sublime Text 2 - Unix Makefiles.rst @@ -0,0 +1,11 @@ +Sublime Text 2 - Unix Makefiles +------------------------------- + +Generates Sublime Text 2 project files. + +Project files for Sublime Text 2 will be created in the top directory +and in every subdirectory which features a CMakeLists.txt file +containing a PROJECT() call. Additionally Makefiles (or build.ninja +files) are generated into the build tree. The appropriate make +program can build the project through the default make target. A +"make install" target is also provided. diff --git a/Help/generator/Unix Makefiles.rst b/Help/generator/Unix Makefiles.rst new file mode 100644 index 0000000..97d74a8 --- /dev/null +++ b/Help/generator/Unix Makefiles.rst @@ -0,0 +1,8 @@ +Unix Makefiles +-------------- + +Generates standard UNIX makefiles. + +A hierarchy of UNIX makefiles is generated into the build tree. Any +standard UNIX-style make program can build the project through the +default make target. A "make install" target is also provided. diff --git a/Help/manual/ccmake.1.rst b/Help/manual/ccmake.1.rst new file mode 100644 index 0000000..cde51a6 --- /dev/null +++ b/Help/manual/ccmake.1.rst @@ -0,0 +1,173 @@ +ccmake(1) +********* + +:: + + ccmake - Curses Interface for CMake. + +:: + + ccmake + ccmake + +The "ccmake" executable is the CMake curses interface. Project +configuration settings may be specified interactively through this +GUI. Brief instructions are provided at the bottom of the terminal +when the program is running. + +CMake is a cross-platform build system generator. Projects specify +their build process with platform-independent CMake listfiles included +in each directory of a source tree with the name CMakeLists.txt. +Users build a project by using CMake to generate a build system for a +native tool on their platform. + + +* ``-C ``: Pre-load a script to populate the cache. + + When cmake is first run in an empty build tree, it creates a + CMakeCache.txt file and populates it with customizable settings for + the project. This option may be used to specify a file from which + to load cache entries before the first pass through the project's + cmake listfiles. The loaded entries take priority over the + project's default values. The given file should be a CMake script + containing SET commands that use the CACHE option, not a + cache-format file. + +* ``-D :=``: Create a cmake cache entry. + + When cmake is first run in an empty build tree, it creates a + CMakeCache.txt file and populates it with customizable settings for + the project. This option may be used to specify a setting that + takes priority over the project's default value. The option may be + repeated for as many cache entries as desired. + +* ``-U ``: Remove matching entries from CMake cache. + + This option may be used to remove one or more variables from the + CMakeCache.txt file, globbing expressions using * and ? are + supported. The option may be repeated for as many cache entries as + desired. + + Use with care, you can make your CMakeCache.txt non-working. + +* ``-G ``: Specify a build system generator. + + CMake may support multiple native build systems on certain + platforms. A generator is responsible for generating a particular + build system. Possible generator names are specified in the + Generators section. + +* ``-T ``: Specify toolset name if supported by generator. + + Some CMake generators support a toolset name to be given to the + native build system to choose a compiler. This is supported only on + specific generators: + + :: + + Visual Studio >= 10 + Xcode >= 3.0 + + See native build system documentation for allowed toolset names. + +* ``-Wno-dev``: Suppress developer warnings. + + Suppress warnings that are meant for the author of the + CMakeLists.txt files. + +* ``-Wdev``: Enable developer warnings. + + Enable warnings that are meant for the author of the CMakeLists.txt + files. + +* ``--copyright [file]``: Print the CMake copyright and exit. + + If a file is specified, the copyright is written into it. + +* ``--help,-help,-usage,-h,-H,/?``: Print usage information and exit. + + Usage describes the basic command line interface and its options. + +* ``--help-full [file]``: Print full help and exit. + + Full help displays most of the documentation provided by the UNIX + man page. It is provided for use on non-UNIX platforms, but is also + convenient if the man page is not installed. If a file is + specified, the help is written into it. + +* ``--help-html [file]``: Print full help in HTML format. + + This option is used by CMake authors to help produce web pages. If + a file is specified, the help is written into it. + +* ``--help-man [file]``: Print full help as a UNIX man page and exit. + + This option is used by the cmake build to generate the UNIX man + page. If a file is specified, the help is written into it. + +* ``--version,-version,/V [file]``: Show program name/version banner and exit. + + If a file is specified, the version is written into it. +:: + + CMake Properties - Properties supported by CMake, the Cross-Platform Makefile Generator. + +This is the documentation for the properties supported by CMake. +Properties can have different scopes. They can either be assigned to +a source file, a directory, a target or globally to CMake. By +modifying the values of properties the behaviour of the build system +can be customized. + +Copyright 2000-2012 Kitware, Inc., Insight Software Consortium. All +rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. + +Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. + +Neither the names of Kitware, Inc., the Insight Software Consortium, +nor the names of their contributors may be used to endorse or promote +products derived from this software without specific prior written +permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +The following resources are available to get help using CMake: + + +* ``Home Page``: http://www.cmake.org + + The primary starting point for learning about CMake. + +* ``Frequently Asked Questions``: http://www.cmake.org/Wiki/CMake_FAQ + + A Wiki is provided containing answers to frequently asked questions. + +* ``Online Documentation``: http://www.cmake.org/HTML/Documentation.html + + Links to available documentation may be found on this web page. + +* ``Mailing List``: http://www.cmake.org/HTML/MailingLists.html + + For help and discussion about using cmake, a mailing list is + provided at cmake@cmake.org. The list is member-post-only but one + may sign up on the CMake web page. Please first read the full + documentation at http://www.cmake.org before posting questions to + the list. diff --git a/Help/manual/cmake-commands.7.rst b/Help/manual/cmake-commands.7.rst new file mode 100644 index 0000000..71d7375 --- /dev/null +++ b/Help/manual/cmake-commands.7.rst @@ -0,0 +1,141 @@ +cmake-commands(7) +***************** + +.. only:: html or latex + + .. contents:: + +Normal Commands +=============== + +These commands may be used freely in CMake projects. + +.. toctree:: + /command/add_compile_options + /command/add_custom_command + /command/add_custom_target + /command/add_definitions + /command/add_dependencies + /command/add_executable + /command/add_library + /command/add_subdirectory + /command/add_test + /command/aux_source_directory + /command/break + /command/build_command + /command/cmake_host_system_information + /command/cmake_minimum_required + /command/cmake_policy + /command/configure_file + /command/create_test_sourcelist + /command/define_property + /command/elseif + /command/else + /command/enable_language + /command/enable_testing + /command/endforeach + /command/endfunction + /command/endif + /command/endmacro + /command/endwhile + /command/execute_process + /command/export + /command/file + /command/find_file + /command/find_library + /command/find_package + /command/find_path + /command/find_program + /command/fltk_wrap_ui + /command/foreach + /command/function + /command/get_cmake_property + /command/get_directory_property + /command/get_filename_component + /command/get_property + /command/get_source_file_property + /command/get_target_property + /command/get_test_property + /command/if + /command/include_directories + /command/include_external_msproject + /command/include_regular_expression + /command/include + /command/install + /command/link_directories + /command/list + /command/load_cache + /command/load_command + /command/macro + /command/mark_as_advanced + /command/math + /command/message + /command/option + /command/project + /command/qt_wrap_cpp + /command/qt_wrap_ui + /command/remove_definitions + /command/return + /command/separate_arguments + /command/set_directory_properties + /command/set_property + /command/set + /command/set_source_files_properties + /command/set_target_properties + /command/set_tests_properties + /command/site_name + /command/source_group + /command/string + /command/target_compile_definitions + /command/target_compile_options + /command/target_include_directories + /command/target_link_libraries + /command/try_compile + /command/try_run + /command/unset + /command/variable_watch + /command/while + +Deprecated Commands +=================== + +These commands are available only for compatibility with older +versions of CMake. Do not use them in new code. + +.. toctree:: + /command/build_name + /command/exec_program + /command/export_library_dependencies + /command/install_files + /command/install_programs + /command/install_targets + /command/link_libraries + /command/make_directory + /command/output_required_files + /command/remove + /command/subdir_depends + /command/subdirs + /command/use_mangled_mesa + /command/utility_source + /command/variable_requires + /command/write_file + +CTest Commands +============== + +These commands are available only in ctest scripts. + +.. toctree:: + /command/ctest_build + /command/ctest_configure + /command/ctest_coverage + /command/ctest_empty_binary_directory + /command/ctest_memcheck + /command/ctest_read_custom_files + /command/ctest_run_script + /command/ctest_sleep + /command/ctest_start + /command/ctest_submit + /command/ctest_test + /command/ctest_update + /command/ctest_upload diff --git a/Help/manual/cmake-generators.7.rst b/Help/manual/cmake-generators.7.rst new file mode 100644 index 0000000..c73d587 --- /dev/null +++ b/Help/manual/cmake-generators.7.rst @@ -0,0 +1,42 @@ +cmake-generators(7) +******************* + +.. only:: html or latex + + .. contents:: + +All Generators +============== + +.. toctree:: + /generator/Borland Makefiles + /generator/CodeBlocks - MinGW Makefiles + /generator/CodeBlocks - Ninja + /generator/CodeBlocks - NMake Makefiles + /generator/CodeBlocks - Unix Makefiles + /generator/Eclipse CDT4 - MinGW Makefiles + /generator/Eclipse CDT4 - Ninja + /generator/Eclipse CDT4 - NMake Makefiles + /generator/Eclipse CDT4 - Unix Makefiles + /generator/KDevelop3 + /generator/KDevelop3 - Unix Makefiles + /generator/MinGW Makefiles + /generator/MSYS Makefiles + /generator/Ninja + /generator/NMake Makefiles JOM + /generator/NMake Makefiles + /generator/Sublime Text 2 - MinGW Makefiles + /generator/Sublime Text 2 - Ninja + /generator/Sublime Text 2 - NMake Makefiles + /generator/Sublime Text 2 - Unix Makefiles + /generator/Unix Makefiles + /generator/Visual Studio 10 + /generator/Visual Studio 11 + /generator/Visual Studio 12 + /generator/Visual Studio 6 + /generator/Visual Studio 7 .NET 2003 + /generator/Visual Studio 7 + /generator/Visual Studio 8 2005 + /generator/Visual Studio 9 2008 + /generator/Watcom WMake + /generator/Xcode diff --git a/Help/manual/cmake-gui.1.rst b/Help/manual/cmake-gui.1.rst new file mode 100644 index 0000000..6edfe27 --- /dev/null +++ b/Help/manual/cmake-gui.1.rst @@ -0,0 +1,138 @@ +cmake-gui(1) +************ + +:: + + cmake-gui - CMake GUI. + +:: + + cmake-gui [options] + cmake-gui [options] + cmake-gui [options] + +The "cmake-gui" executable is the CMake GUI. Project configuration +settings may be specified interactively. Brief instructions are +provided at the bottom of the window when the program is running. + +CMake is a cross-platform build system generator. Projects specify +their build process with platform-independent CMake listfiles included +in each directory of a source tree with the name CMakeLists.txt. +Users build a project by using CMake to generate a build system for a +native tool on their platform. + + +* ``--copyright [file]``: Print the CMake copyright and exit. + + If a file is specified, the copyright is written into it. + +* ``--help,-help,-usage,-h,-H,/?``: Print usage information and exit. + + Usage describes the basic command line interface and its options. + +* ``--help-full [file]``: Print full help and exit. + + Full help displays most of the documentation provided by the UNIX + man page. It is provided for use on non-UNIX platforms, but is also + convenient if the man page is not installed. If a file is + specified, the help is written into it. + +* ``--help-html [file]``: Print full help in HTML format. + + This option is used by CMake authors to help produce web pages. If + a file is specified, the help is written into it. + +* ``--help-man [file]``: Print full help as a UNIX man page and exit. + + This option is used by the cmake build to generate the UNIX man + page. If a file is specified, the help is written into it. + +* ``--version,-version,/V [file]``: Show program name/version banner and exit. + + If a file is specified, the version is written into it. +The following generators are available on this platform: + +:: + + CMake Properties - Properties supported by CMake, the Cross-Platform Makefile Generator. + +This is the documentation for the properties supported by CMake. +Properties can have different scopes. They can either be assigned to +a source file, a directory, a target or globally to CMake. By +modifying the values of properties the behaviour of the build system +can be customized. + +:: + + CMake Compatibility Listfile Commands - Obsolete commands supported by CMake for compatibility. + +This is the documentation for now obsolete listfile commands from +previous CMake versions, which are still supported for compatibility +reasons. You should instead use the newer, faster and shinier new +commands. ;-) + +The following modules are provided with CMake. They can be used with +INCLUDE(ModuleName). + +:: + + CMake Modules - Modules coming with CMake, the Cross-Platform Makefile Generator. + +This is the documentation for the modules and scripts coming with +CMake. Using these modules you can check the computer system for +installed software packages, features of the compiler and the +existence of headers to name just a few. + +Copyright 2000-2012 Kitware, Inc., Insight Software Consortium. All +rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. + +Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. + +Neither the names of Kitware, Inc., the Insight Software Consortium, +nor the names of their contributors may be used to endorse or promote +products derived from this software without specific prior written +permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +The following resources are available to get help using CMake: + + +* ``Home Page``: http://www.cmake.org + + The primary starting point for learning about CMake. + +* ``Frequently Asked Questions``: http://www.cmake.org/Wiki/CMake_FAQ + + A Wiki is provided containing answers to frequently asked questions. + +* ``Online Documentation``: http://www.cmake.org/HTML/Documentation.html + + Links to available documentation may be found on this web page. + +* ``Mailing List``: http://www.cmake.org/HTML/MailingLists.html + + For help and discussion about using cmake, a mailing list is + provided at cmake@cmake.org. The list is member-post-only but one + may sign up on the CMake web page. Please first read the full + documentation at http://www.cmake.org before posting questions to + the list. diff --git a/Help/manual/cmake-modules.7.rst b/Help/manual/cmake-modules.7.rst new file mode 100644 index 0000000..da518d3 --- /dev/null +++ b/Help/manual/cmake-modules.7.rst @@ -0,0 +1,230 @@ +cmake-modules(7) +**************** + +.. only:: html or latex + + .. contents:: + +All Modules +=========== + +.. toctree:: + /module/AddFileDependencies + /module/BundleUtilities + /module/CheckCCompilerFlag + /module/CheckCSourceCompiles + /module/CheckCSourceRuns + /module/CheckCXXCompilerFlag + /module/CheckCXXSourceCompiles + /module/CheckCXXSourceRuns + /module/CheckCXXSymbolExists + /module/CheckFortranFunctionExists + /module/CheckFunctionExists + /module/CheckIncludeFileCXX + /module/CheckIncludeFile + /module/CheckIncludeFiles + /module/CheckLanguage + /module/CheckLibraryExists + /module/CheckPrototypeDefinition + /module/CheckStructHasMember + /module/CheckSymbolExists + /module/CheckTypeSize + /module/CheckVariableExists + /module/CMakeAddFortranSubdirectory + /module/CMakeBackwardCompatibilityCXX + /module/CMakeDependentOption + /module/CMakeDetermineVSServicePack + /module/CMakeExpandImportedTargets + /module/CMakeFindFrameworks + /module/CMakeFindPackageMode + /module/CMakeForceCompiler + /module/CMakeGraphVizOptions + /module/CMakePackageConfigHelpers + /module/CMakeParseArguments + /module/CMakePrintHelpers + /module/CMakePrintSystemInformation + /module/CMakePushCheckState + /module/CMakeVerifyManifest + /module/CPackBundle + /module/CPackComponent + /module/CPackCygwin + /module/CPackDeb + /module/CPackDMG + /module/CPackNSIS + /module/CPackPackageMaker + /module/CPackRPM + /module/CPack + /module/CPackWIX + /module/CTest + /module/CTestScriptMode + /module/CTestUseLaunchers + /module/Dart + /module/DeployQt4 + /module/Documentation + /module/ExternalData + /module/ExternalProject + /module/FeatureSummary + /module/FindALSA + /module/FindArmadillo + /module/FindASPELL + /module/FindAVIFile + /module/FindBISON + /module/FindBLAS + /module/FindBoost + /module/FindBullet + /module/FindBZip2 + /module/FindCABLE + /module/FindCoin3D + /module/FindCUDA + /module/FindCups + /module/FindCURL + /module/FindCurses + /module/FindCVS + /module/FindCxxTest + /module/FindCygwin + /module/FindDart + /module/FindDCMTK + /module/FindDevIL + /module/FindDoxygen + /module/FindEXPAT + /module/FindFLEX + /module/FindFLTK2 + /module/FindFLTK + /module/FindFreetype + /module/FindGCCXML + /module/FindGDAL + /module/FindGettext + /module/FindGIF + /module/FindGit + /module/FindGLEW + /module/FindGLUT + /module/FindGnuplot + /module/FindGnuTLS + /module/FindGTest + /module/FindGTK2 + /module/FindGTK + /module/FindHDF5 + /module/FindHg + /module/FindHSPELL + /module/FindHTMLHelp + /module/FindIcotool + /module/FindImageMagick + /module/FindITK + /module/FindJasper + /module/FindJava + /module/FindJNI + /module/FindJPEG + /module/FindKDE3 + /module/FindKDE4 + /module/FindLAPACK + /module/FindLATEX + /module/FindLibArchive + /module/FindLibLZMA + /module/FindLibXml2 + /module/FindLibXslt + /module/FindLua50 + /module/FindLua51 + /module/FindLua + /module/FindMatlab + /module/FindMFC + /module/FindMotif + /module/FindMPEG2 + /module/FindMPEG + /module/FindMPI + /module/FindOpenAL + /module/FindOpenGL + /module/FindOpenMP + /module/FindOpenSceneGraph + /module/FindOpenSSL + /module/FindOpenThreads + /module/FindosgAnimation + /module/FindosgDB + /module/Findosg_functions + /module/FindosgFX + /module/FindosgGA + /module/FindosgIntrospection + /module/FindosgManipulator + /module/FindosgParticle + /module/FindosgPresentation + /module/FindosgProducer + /module/FindosgQt + /module/Findosg + /module/FindosgShadow + /module/FindosgSim + /module/FindosgTerrain + /module/FindosgText + /module/FindosgUtil + /module/FindosgViewer + /module/FindosgVolume + /module/FindosgWidget + /module/FindPackageHandleStandardArgs + /module/FindPackageMessage + /module/FindPerlLibs + /module/FindPerl + /module/FindPHP4 + /module/FindPhysFS + /module/FindPike + /module/FindPkgConfig + /module/FindPNG + /module/FindPostgreSQL + /module/FindProducer + /module/FindProtobuf + /module/FindPythonInterp + /module/FindPythonLibs + /module/FindQt3 + /module/FindQt4 + /module/FindQt + /module/FindQuickTime + /module/FindRTI + /module/FindRuby + /module/FindSDL_image + /module/FindSDL_mixer + /module/FindSDL_net + /module/FindSDL + /module/FindSDL_sound + /module/FindSDL_ttf + /module/FindSelfPackers + /module/FindSquish + /module/FindSubversion + /module/FindSWIG + /module/FindTCL + /module/FindTclsh + /module/FindTclStub + /module/FindThreads + /module/FindTIFF + /module/FindUnixCommands + /module/FindVTK + /module/FindWget + /module/FindWish + /module/FindwxWidgets + /module/FindwxWindows + /module/FindX11 + /module/FindXMLRPC + /module/FindZLIB + /module/FortranCInterface + /module/GenerateExportHeader + /module/GetPrerequisites + /module/GNUInstallDirs + /module/InstallRequiredSystemLibraries + /module/MacroAddFileDependencies + /module/ProcessorCount + /module/Qt4ConfigDependentSettings + /module/Qt4Macros + /module/SelectLibraryConfigurations + /module/SquishTestScript + /module/TestBigEndian + /module/TestCXXAcceptsFlag + /module/TestForANSIForScope + /module/TestForANSIStreamHeaders + /module/TestForSSTREAM + /module/TestForSTDNamespace + /module/UseEcos + /module/UseJavaClassFilelist + /module/UseJava + /module/UseJavaSymlinks + /module/UsePkgConfig + /module/UseQt4 + /module/UseSWIG + /module/UsewxWidgets + /module/Use_wxWindows + /module/WriteBasicConfigVersionFile diff --git a/Help/manual/cmake-policies.7.rst b/Help/manual/cmake-policies.7.rst new file mode 100644 index 0000000..cd91c91 --- /dev/null +++ b/Help/manual/cmake-policies.7.rst @@ -0,0 +1,38 @@ +cmake-policies(7) +***************** + +.. only:: html or latex + + .. contents:: + +All Policies +============ + +.. toctree:: + /policy/CMP0000 + /policy/CMP0001 + /policy/CMP0002 + /policy/CMP0003 + /policy/CMP0004 + /policy/CMP0005 + /policy/CMP0006 + /policy/CMP0007 + /policy/CMP0008 + /policy/CMP0009 + /policy/CMP0010 + /policy/CMP0011 + /policy/CMP0012 + /policy/CMP0013 + /policy/CMP0014 + /policy/CMP0015 + /policy/CMP0016 + /policy/CMP0017 + /policy/CMP0018 + /policy/CMP0019 + /policy/CMP0020 + /policy/CMP0021 + /policy/CMP0022 + /policy/CMP0023 + /policy/CMP0024 + /policy/CMP0025 + /policy/CMP0026 diff --git a/Help/manual/cmake-properties.7.rst b/Help/manual/cmake-properties.7.rst new file mode 100644 index 0000000..bb3acff --- /dev/null +++ b/Help/manual/cmake-properties.7.rst @@ -0,0 +1,262 @@ +cmake-properties(7) +******************* + +.. only:: html or latex + + .. contents:: + +Properties of Global Scope +========================== + +.. toctree:: + /prop_gbl/ALLOW_DUPLICATE_CUSTOM_TARGETS + /prop_gbl/AUTOMOC_TARGETS_FOLDER + /prop_gbl/DEBUG_CONFIGURATIONS + /prop_gbl/DISABLED_FEATURES + /prop_gbl/ENABLED_FEATURES + /prop_gbl/ENABLED_LANGUAGES + /prop_gbl/FIND_LIBRARY_USE_LIB64_PATHS + /prop_gbl/FIND_LIBRARY_USE_OPENBSD_VERSIONING + /prop_gbl/GLOBAL_DEPENDS_DEBUG_MODE + /prop_gbl/GLOBAL_DEPENDS_NO_CYCLES + /prop_gbl/IN_TRY_COMPILE + /prop_gbl/PACKAGES_FOUND + /prop_gbl/PACKAGES_NOT_FOUND + /prop_gbl/PREDEFINED_TARGETS_FOLDER + /prop_gbl/REPORT_UNDEFINED_PROPERTIES + /prop_gbl/RULE_LAUNCH_COMPILE + /prop_gbl/RULE_LAUNCH_CUSTOM + /prop_gbl/RULE_LAUNCH_LINK + /prop_gbl/RULE_MESSAGES + /prop_gbl/TARGET_ARCHIVES_MAY_BE_SHARED_LIBS + /prop_gbl/TARGET_SUPPORTS_SHARED_LIBS + /prop_gbl/USE_FOLDERS + +Properties on Directories +========================= + +.. toctree:: + /prop_dir/ADDITIONAL_MAKE_CLEAN_FILES + /prop_dir/CACHE_VARIABLES + /prop_dir/CLEAN_NO_CUSTOM + /prop_dir/COMPILE_DEFINITIONS_CONFIG + /prop_dir/COMPILE_DEFINITIONS + /prop_dir/COMPILE_OPTIONS + /prop_dir/DEFINITIONS + /prop_dir/EXCLUDE_FROM_ALL + /prop_dir/IMPLICIT_DEPENDS_INCLUDE_TRANSFORM + /prop_dir/INCLUDE_DIRECTORIES + /prop_dir/INCLUDE_REGULAR_EXPRESSION + /prop_dir/INTERPROCEDURAL_OPTIMIZATION_CONFIG + /prop_dir/INTERPROCEDURAL_OPTIMIZATION + /prop_dir/LINK_DIRECTORIES + /prop_dir/LISTFILE_STACK + /prop_dir/MACROS + /prop_dir/PARENT_DIRECTORY + /prop_dir/RULE_LAUNCH_COMPILE + /prop_dir/RULE_LAUNCH_CUSTOM + /prop_dir/RULE_LAUNCH_LINK + /prop_dir/TEST_INCLUDE_FILE + /prop_dir/VARIABLES + /prop_dir/VS_GLOBAL_SECTION_POST_section + /prop_dir/VS_GLOBAL_SECTION_PRE_section + +Properties on Targets +===================== + +.. toctree:: + /prop_tgt/ALIASED_TARGET + /prop_tgt/ARCHIVE_OUTPUT_DIRECTORY_CONFIG + /prop_tgt/ARCHIVE_OUTPUT_DIRECTORY + /prop_tgt/ARCHIVE_OUTPUT_NAME_CONFIG + /prop_tgt/ARCHIVE_OUTPUT_NAME + /prop_tgt/AUTOMOC_MOC_OPTIONS + /prop_tgt/AUTOMOC + /prop_tgt/BUILD_WITH_INSTALL_RPATH + /prop_tgt/BUNDLE_EXTENSION + /prop_tgt/BUNDLE + /prop_tgt/COMPATIBLE_INTERFACE_BOOL + /prop_tgt/COMPATIBLE_INTERFACE_STRING + /prop_tgt/COMPILE_DEFINITIONS_CONFIG + /prop_tgt/COMPILE_DEFINITIONS + /prop_tgt/COMPILE_FLAGS + /prop_tgt/COMPILE_OPTIONS + /prop_tgt/CONFIG_OUTPUT_NAME + /prop_tgt/CONFIG_POSTFIX + /prop_tgt/DEBUG_POSTFIX + /prop_tgt/DEFINE_SYMBOL + /prop_tgt/EchoString + /prop_tgt/ENABLE_EXPORTS + /prop_tgt/EXCLUDE_FROM_ALL + /prop_tgt/EXCLUDE_FROM_DEFAULT_BUILD_CONFIG + /prop_tgt/EXCLUDE_FROM_DEFAULT_BUILD + /prop_tgt/EXPORT_NAME + /prop_tgt/FOLDER + /prop_tgt/Fortran_FORMAT + /prop_tgt/Fortran_MODULE_DIRECTORY + /prop_tgt/FRAMEWORK + /prop_tgt/GENERATOR_FILE_NAME + /prop_tgt/GNUtoMS + /prop_tgt/HAS_CXX + /prop_tgt/IMPLICIT_DEPENDS_INCLUDE_TRANSFORM + /prop_tgt/IMPORTED_CONFIGURATIONS + /prop_tgt/IMPORTED_IMPLIB_CONFIG + /prop_tgt/IMPORTED_IMPLIB + /prop_tgt/IMPORTED_LINK_DEPENDENT_LIBRARIES_CONFIG + /prop_tgt/IMPORTED_LINK_DEPENDENT_LIBRARIES + /prop_tgt/IMPORTED_LINK_INTERFACE_LANGUAGES_CONFIG + /prop_tgt/IMPORTED_LINK_INTERFACE_LANGUAGES + /prop_tgt/IMPORTED_LINK_INTERFACE_LIBRARIES_CONFIG + /prop_tgt/IMPORTED_LINK_INTERFACE_LIBRARIES + /prop_tgt/IMPORTED_LINK_INTERFACE_MULTIPLICITY_CONFIG + /prop_tgt/IMPORTED_LINK_INTERFACE_MULTIPLICITY + /prop_tgt/IMPORTED_LOCATION_CONFIG + /prop_tgt/IMPORTED_LOCATION + /prop_tgt/IMPORTED_NO_SONAME_CONFIG + /prop_tgt/IMPORTED_NO_SONAME + /prop_tgt/IMPORTED + /prop_tgt/IMPORTED_SONAME_CONFIG + /prop_tgt/IMPORTED_SONAME + /prop_tgt/IMPORT_PREFIX + /prop_tgt/IMPORT_SUFFIX + /prop_tgt/INCLUDE_DIRECTORIES + /prop_tgt/INSTALL_NAME_DIR + /prop_tgt/INSTALL_RPATH + /prop_tgt/INSTALL_RPATH_USE_LINK_PATH + /prop_tgt/INTERFACE_COMPILE_DEFINITIONS + /prop_tgt/INTERFACE_COMPILE_OPTIONS + /prop_tgt/INTERFACE_INCLUDE_DIRECTORIES + /prop_tgt/INTERFACE_LINK_LIBRARIES + /prop_tgt/INTERFACE_POSITION_INDEPENDENT_CODE + /prop_tgt/INTERFACE_SYSTEM_INCLUDE_DIRECTORIES + /prop_tgt/INTERPROCEDURAL_OPTIMIZATION_CONFIG + /prop_tgt/INTERPROCEDURAL_OPTIMIZATION + /prop_tgt/LABELS + /prop_tgt/LANG_VISIBILITY_PRESET + /prop_tgt/LIBRARY_OUTPUT_DIRECTORY_CONFIG + /prop_tgt/LIBRARY_OUTPUT_DIRECTORY + /prop_tgt/LIBRARY_OUTPUT_NAME_CONFIG + /prop_tgt/LIBRARY_OUTPUT_NAME + /prop_tgt/LINK_DEPENDS_NO_SHARED + /prop_tgt/LINK_DEPENDS + /prop_tgt/LINKER_LANGUAGE + /prop_tgt/LINK_FLAGS_CONFIG + /prop_tgt/LINK_FLAGS + /prop_tgt/LINK_INTERFACE_LIBRARIES_CONFIG + /prop_tgt/LINK_INTERFACE_LIBRARIES + /prop_tgt/LINK_INTERFACE_MULTIPLICITY_CONFIG + /prop_tgt/LINK_INTERFACE_MULTIPLICITY + /prop_tgt/LINK_LIBRARIES + /prop_tgt/LINK_SEARCH_END_STATIC + /prop_tgt/LINK_SEARCH_START_STATIC + /prop_tgt/LOCATION_CONFIG + /prop_tgt/LOCATION + /prop_tgt/MACOSX_BUNDLE_INFO_PLIST + /prop_tgt/MACOSX_BUNDLE + /prop_tgt/MACOSX_FRAMEWORK_INFO_PLIST + /prop_tgt/MACOSX_RPATH + /prop_tgt/MAP_IMPORTED_CONFIG_CONFIG + /prop_tgt/NAME + /prop_tgt/NO_SONAME + /prop_tgt/NO_SYSTEM_FROM_IMPORTED + /prop_tgt/OSX_ARCHITECTURES_CONFIG + /prop_tgt/OSX_ARCHITECTURES + /prop_tgt/OUTPUT_NAME_CONFIG + /prop_tgt/OUTPUT_NAME + /prop_tgt/PDB_NAME_CONFIG + /prop_tgt/PDB_NAME + /prop_tgt/PDB_OUTPUT_DIRECTORY_CONFIG + /prop_tgt/PDB_OUTPUT_DIRECTORY + /prop_tgt/POSITION_INDEPENDENT_CODE + /prop_tgt/POST_INSTALL_SCRIPT + /prop_tgt/PREFIX + /prop_tgt/PRE_INSTALL_SCRIPT + /prop_tgt/PRIVATE_HEADER + /prop_tgt/PROJECT_LABEL + /prop_tgt/PUBLIC_HEADER + /prop_tgt/RESOURCE + /prop_tgt/RULE_LAUNCH_COMPILE + /prop_tgt/RULE_LAUNCH_CUSTOM + /prop_tgt/RULE_LAUNCH_LINK + /prop_tgt/RUNTIME_OUTPUT_DIRECTORY_CONFIG + /prop_tgt/RUNTIME_OUTPUT_DIRECTORY + /prop_tgt/RUNTIME_OUTPUT_NAME_CONFIG + /prop_tgt/RUNTIME_OUTPUT_NAME + /prop_tgt/SKIP_BUILD_RPATH + /prop_tgt/SOURCES + /prop_tgt/SOVERSION + /prop_tgt/STATIC_LIBRARY_FLAGS_CONFIG + /prop_tgt/STATIC_LIBRARY_FLAGS + /prop_tgt/SUFFIX + /prop_tgt/TYPE + /prop_tgt/VERSION + /prop_tgt/VISIBILITY_INLINES_HIDDEN + /prop_tgt/VS_DOTNET_REFERENCES + /prop_tgt/VS_DOTNET_TARGET_FRAMEWORK_VERSION + /prop_tgt/VS_GLOBAL_KEYWORD + /prop_tgt/VS_GLOBAL_PROJECT_TYPES + /prop_tgt/VS_GLOBAL_ROOTNAMESPACE + /prop_tgt/VS_GLOBAL_variable + /prop_tgt/VS_KEYWORD + /prop_tgt/VS_SCC_AUXPATH + /prop_tgt/VS_SCC_LOCALPATH + /prop_tgt/VS_SCC_PROJECTNAME + /prop_tgt/VS_SCC_PROVIDER + /prop_tgt/VS_WINRT_EXTENSIONS + /prop_tgt/VS_WINRT_REFERENCES + /prop_tgt/WIN32_EXECUTABLE + /prop_tgt/XCODE_ATTRIBUTE_an-attribute + +Properties on Tests +=================== + +.. toctree:: + /prop_test/ATTACHED_FILES_ON_FAIL + /prop_test/ATTACHED_FILES + /prop_test/COST + /prop_test/DEPENDS + /prop_test/ENVIRONMENT + /prop_test/FAIL_REGULAR_EXPRESSION + /prop_test/LABELS + /prop_test/MEASUREMENT + /prop_test/PASS_REGULAR_EXPRESSION + /prop_test/PROCESSORS + /prop_test/REQUIRED_FILES + /prop_test/RESOURCE_LOCK + /prop_test/RUN_SERIAL + /prop_test/TIMEOUT + /prop_test/WILL_FAIL + /prop_test/WORKING_DIRECTORY + +Properties on Source Files +========================== + +.. toctree:: + /prop_sf/ABSTRACT + /prop_sf/COMPILE_DEFINITIONS_CONFIG + /prop_sf/COMPILE_DEFINITIONS + /prop_sf/COMPILE_FLAGS + /prop_sf/EXTERNAL_OBJECT + /prop_sf/Fortran_FORMAT + /prop_sf/GENERATED + /prop_sf/HEADER_FILE_ONLY + /prop_sf/KEEP_EXTENSION + /prop_sf/LABELS + /prop_sf/LANGUAGE + /prop_sf/LOCATION + /prop_sf/MACOSX_PACKAGE_LOCATION + /prop_sf/OBJECT_DEPENDS + /prop_sf/OBJECT_OUTPUTS + /prop_sf/SYMBOLIC + /prop_sf/WRAP_EXCLUDE + +Properties on Cache Entries +=========================== + +.. toctree:: + /prop_cache/ADVANCED + /prop_cache/HELPSTRING + /prop_cache/MODIFIED + /prop_cache/STRINGS + /prop_cache/TYPE + /prop_cache/VALUE diff --git a/Help/manual/cmake-variables.7.rst b/Help/manual/cmake-variables.7.rst new file mode 100644 index 0000000..99c782d --- /dev/null +++ b/Help/manual/cmake-variables.7.rst @@ -0,0 +1,254 @@ +cmake-variables(7) +****************** + +.. only:: html or latex + + .. contents:: + +Variables that Provide Information +================================== + +.. toctree:: + /variable/CMAKE_ARGC + /variable/CMAKE_ARGV0 + /variable/CMAKE_AR + /variable/CMAKE_BINARY_DIR + /variable/CMAKE_BUILD_TOOL + /variable/CMAKE_CACHEFILE_DIR + /variable/CMAKE_CACHE_MAJOR_VERSION + /variable/CMAKE_CACHE_MINOR_VERSION + /variable/CMAKE_CACHE_PATCH_VERSION + /variable/CMAKE_CFG_INTDIR + /variable/CMAKE_COMMAND + /variable/CMAKE_CROSSCOMPILING + /variable/CMAKE_CTEST_COMMAND + /variable/CMAKE_CURRENT_BINARY_DIR + /variable/CMAKE_CURRENT_LIST_DIR + /variable/CMAKE_CURRENT_LIST_FILE + /variable/CMAKE_CURRENT_LIST_LINE + /variable/CMAKE_CURRENT_SOURCE_DIR + /variable/CMAKE_DL_LIBS + /variable/CMAKE_EDIT_COMMAND + /variable/CMAKE_EXECUTABLE_SUFFIX + /variable/CMAKE_EXTRA_GENERATOR + /variable/CMAKE_EXTRA_SHARED_LIBRARY_SUFFIXES + /variable/CMAKE_GENERATOR + /variable/CMAKE_GENERATOR_TOOLSET + /variable/CMAKE_HOME_DIRECTORY + /variable/CMAKE_IMPORT_LIBRARY_PREFIX + /variable/CMAKE_IMPORT_LIBRARY_SUFFIX + /variable/CMAKE_LINK_LIBRARY_SUFFIX + /variable/CMAKE_MAJOR_VERSION + /variable/CMAKE_MAKE_PROGRAM + /variable/CMAKE_MINIMUM_REQUIRED_VERSION + /variable/CMAKE_MINOR_VERSION + /variable/CMAKE_PARENT_LIST_FILE + /variable/CMAKE_PATCH_VERSION + /variable/CMAKE_PROJECT_NAME + /variable/CMAKE_RANLIB + /variable/CMAKE_ROOT + /variable/CMAKE_SCRIPT_MODE_FILE + /variable/CMAKE_SHARED_LIBRARY_PREFIX + /variable/CMAKE_SHARED_LIBRARY_SUFFIX + /variable/CMAKE_SHARED_MODULE_PREFIX + /variable/CMAKE_SHARED_MODULE_SUFFIX + /variable/CMAKE_SIZEOF_VOID_P + /variable/CMAKE_SKIP_RPATH + /variable/CMAKE_SOURCE_DIR + /variable/CMAKE_STANDARD_LIBRARIES + /variable/CMAKE_STATIC_LIBRARY_PREFIX + /variable/CMAKE_STATIC_LIBRARY_SUFFIX + /variable/CMAKE_TWEAK_VERSION + /variable/CMAKE_VERBOSE_MAKEFILE + /variable/CMAKE_VERSION + /variable/CMAKE_VS_PLATFORM_TOOLSET + /variable/CMAKE_XCODE_PLATFORM_TOOLSET + /variable/PROJECT_BINARY_DIR + /variable/PROJECT-NAME_BINARY_DIR + /variable/PROJECT_NAME + /variable/PROJECT-NAME_SOURCE_DIR + /variable/PROJECT_SOURCE_DIR + +Variables that Change Behavior +============================== + +.. toctree:: + /variable/BUILD_SHARED_LIBS + /variable/CMAKE_ABSOLUTE_DESTINATION_FILES + /variable/CMAKE_AUTOMOC_RELAXED_MODE + /variable/CMAKE_BACKWARDS_COMPATIBILITY + /variable/CMAKE_BUILD_TYPE + /variable/CMAKE_COLOR_MAKEFILE + /variable/CMAKE_CONFIGURATION_TYPES + /variable/CMAKE_DEBUG_TARGET_PROPERTIES + /variable/CMAKE_DISABLE_FIND_PACKAGE_PackageName + /variable/CMAKE_ERROR_DEPRECATED + /variable/CMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION + /variable/CMAKE_FIND_LIBRARY_PREFIXES + /variable/CMAKE_FIND_LIBRARY_SUFFIXES + /variable/CMAKE_FIND_PACKAGE_WARN_NO_MODULE + /variable/CMAKE_IGNORE_PATH + /variable/CMAKE_INCLUDE_PATH + /variable/CMAKE_INSTALL_DEFAULT_COMPONENT_NAME + /variable/CMAKE_INSTALL_PREFIX + /variable/CMAKE_LIBRARY_PATH + /variable/CMAKE_MFC_FLAG + /variable/CMAKE_MODULE_PATH + /variable/CMAKE_NOT_USING_CONFIG_FLAGS + /variable/CMAKE_POLICY_DEFAULT_CMPNNNN + /variable/CMAKE_PREFIX_PATH + /variable/CMAKE_PROGRAM_PATH + /variable/CMAKE_SKIP_INSTALL_ALL_DEPENDENCY + /variable/CMAKE_SYSTEM_IGNORE_PATH + /variable/CMAKE_SYSTEM_INCLUDE_PATH + /variable/CMAKE_SYSTEM_LIBRARY_PATH + /variable/CMAKE_SYSTEM_PREFIX_PATH + /variable/CMAKE_SYSTEM_PROGRAM_PATH + /variable/CMAKE_USER_MAKE_RULES_OVERRIDE + /variable/CMAKE_WARN_DEPRECATED + /variable/CMAKE_WARN_ON_ABSOLUTE_INSTALL_DESTINATION + +Variables that Describe the System +================================== + +.. toctree:: + /variable/APPLE + /variable/BORLAND + /variable/CMAKE_CL_64 + /variable/CMAKE_COMPILER_2005 + /variable/CMAKE_HOST_APPLE + /variable/CMAKE_HOST_SYSTEM_NAME + /variable/CMAKE_HOST_SYSTEM_PROCESSOR + /variable/CMAKE_HOST_SYSTEM + /variable/CMAKE_HOST_SYSTEM_VERSION + /variable/CMAKE_HOST_UNIX + /variable/CMAKE_HOST_WIN32 + /variable/CMAKE_LIBRARY_ARCHITECTURE_REGEX + /variable/CMAKE_LIBRARY_ARCHITECTURE + /variable/CMAKE_OBJECT_PATH_MAX + /variable/CMAKE_SYSTEM_NAME + /variable/CMAKE_SYSTEM_PROCESSOR + /variable/CMAKE_SYSTEM + /variable/CMAKE_SYSTEM_VERSION + /variable/CYGWIN + /variable/ENV + /variable/MSVC10 + /variable/MSVC11 + /variable/MSVC12 + /variable/MSVC60 + /variable/MSVC70 + /variable/MSVC71 + /variable/MSVC80 + /variable/MSVC90 + /variable/MSVC_IDE + /variable/MSVC + /variable/MSVC_VERSION + /variable/UNIX + /variable/WIN32 + /variable/XCODE_VERSION + +Variables that Control the Build +================================ + +.. toctree:: + /variable/CMAKE_ARCHIVE_OUTPUT_DIRECTORY + /variable/CMAKE_AUTOMOC_MOC_OPTIONS + /variable/CMAKE_AUTOMOC + /variable/CMAKE_BUILD_WITH_INSTALL_RPATH + /variable/CMAKE_CONFIG_POSTFIX + /variable/CMAKE_DEBUG_POSTFIX + /variable/CMAKE_EXE_LINKER_FLAGS_CONFIG + /variable/CMAKE_EXE_LINKER_FLAGS + /variable/CMAKE_Fortran_FORMAT + /variable/CMAKE_Fortran_MODULE_DIRECTORY + /variable/CMAKE_GNUtoMS + /variable/CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE + /variable/CMAKE_INCLUDE_CURRENT_DIR + /variable/CMAKE_INSTALL_NAME_DIR + /variable/CMAKE_INSTALL_RPATH + /variable/CMAKE_INSTALL_RPATH_USE_LINK_PATH + /variable/CMAKE_LANG_VISIBILITY_PRESET + /variable/CMAKE_LIBRARY_OUTPUT_DIRECTORY + /variable/CMAKE_LIBRARY_PATH_FLAG + /variable/CMAKE_LINK_DEF_FILE_FLAG + /variable/CMAKE_LINK_DEPENDS_NO_SHARED + /variable/CMAKE_LINK_INTERFACE_LIBRARIES + /variable/CMAKE_LINK_LIBRARY_FILE_FLAG + /variable/CMAKE_LINK_LIBRARY_FLAG + /variable/CMAKE_MACOSX_BUNDLE + /variable/CMAKE_MAP_IMPORTED_CONFIG_CONFIG + /variable/CMAKE_MODULE_LINKER_FLAGS_CONFIG + /variable/CMAKE_MODULE_LINKER_FLAGS + /variable/CMAKE_NO_BUILTIN_CHRPATH + /variable/CMAKE_NO_SYSTEM_FROM_IMPORTED + /variable/CMAKE_PDB_OUTPUT_DIRECTORY + /variable/CMAKE_POSITION_INDEPENDENT_CODE + /variable/CMAKE_RUNTIME_OUTPUT_DIRECTORY + /variable/CMAKE_SHARED_LINKER_FLAGS_CONFIG + /variable/CMAKE_SHARED_LINKER_FLAGS + /variable/CMAKE_SKIP_BUILD_RPATH + /variable/CMAKE_SKIP_INSTALL_RPATH + /variable/CMAKE_STATIC_LINKER_FLAGS_CONFIG + /variable/CMAKE_STATIC_LINKER_FLAGS + /variable/CMAKE_TRY_COMPILE_CONFIGURATION + /variable/CMAKE_USE_RELATIVE_PATHS + /variable/CMAKE_VISIBILITY_INLINES_HIDDEN + /variable/CMAKE_WIN32_EXECUTABLE + /variable/EXECUTABLE_OUTPUT_PATH + /variable/LIBRARY_OUTPUT_PATH + +Variables for Languages +======================= + +.. toctree:: + /variable/CMAKE_COMPILER_IS_GNULANG + /variable/CMAKE_Fortran_MODDIR_DEFAULT + /variable/CMAKE_Fortran_MODDIR_FLAG + /variable/CMAKE_Fortran_MODOUT_FLAG + /variable/CMAKE_INTERNAL_PLATFORM_ABI + /variable/CMAKE_LANG_ARCHIVE_APPEND + /variable/CMAKE_LANG_ARCHIVE_CREATE + /variable/CMAKE_LANG_ARCHIVE_FINISH + /variable/CMAKE_LANG_COMPILE_OBJECT + /variable/CMAKE_LANG_COMPILER_ABI + /variable/CMAKE_LANG_COMPILER_ID + /variable/CMAKE_LANG_COMPILER_LOADED + /variable/CMAKE_LANG_COMPILER + /variable/CMAKE_LANG_COMPILER_VERSION + /variable/CMAKE_LANG_CREATE_SHARED_LIBRARY + /variable/CMAKE_LANG_CREATE_SHARED_MODULE + /variable/CMAKE_LANG_CREATE_STATIC_LIBRARY + /variable/CMAKE_LANG_FLAGS_DEBUG + /variable/CMAKE_LANG_FLAGS_MINSIZEREL + /variable/CMAKE_LANG_FLAGS_RELEASE + /variable/CMAKE_LANG_FLAGS_RELWITHDEBINFO + /variable/CMAKE_LANG_FLAGS + /variable/CMAKE_LANG_IGNORE_EXTENSIONS + /variable/CMAKE_LANG_IMPLICIT_INCLUDE_DIRECTORIES + /variable/CMAKE_LANG_IMPLICIT_LINK_DIRECTORIES + /variable/CMAKE_LANG_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES + /variable/CMAKE_LANG_IMPLICIT_LINK_LIBRARIES + /variable/CMAKE_LANG_LIBRARY_ARCHITECTURE + /variable/CMAKE_LANG_LINKER_PREFERENCE_PROPAGATES + /variable/CMAKE_LANG_LINKER_PREFERENCE + /variable/CMAKE_LANG_LINK_EXECUTABLE + /variable/CMAKE_LANG_OUTPUT_EXTENSION + /variable/CMAKE_LANG_PLATFORM_ID + /variable/CMAKE_LANG_SIMULATE_ID + /variable/CMAKE_LANG_SIMULATE_VERSION + /variable/CMAKE_LANG_SIZEOF_DATA_PTR + /variable/CMAKE_LANG_SOURCE_FILE_EXTENSIONS + /variable/CMAKE_USER_MAKE_RULES_OVERRIDE_LANG + +Variables for CPack +=================== + +.. toctree:: + /variable/CPACK_ABSOLUTE_DESTINATION_FILES + /variable/CPACK_COMPONENT_INCLUDE_TOPLEVEL_DIRECTORY + /variable/CPACK_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION + /variable/CPACK_INCLUDE_TOPLEVEL_DIRECTORY + /variable/CPACK_INSTALL_SCRIPT + /variable/CPACK_PACKAGING_INSTALL_PREFIX + /variable/CPACK_SET_DESTDIR + /variable/CPACK_WARN_ON_ABSOLUTE_INSTALL_DESTINATION diff --git a/Help/manual/cmake.1.rst b/Help/manual/cmake.1.rst new file mode 100644 index 0000000..1147ab8 --- /dev/null +++ b/Help/manual/cmake.1.rst @@ -0,0 +1,441 @@ +cmake(1) +******** + +:: + + cmake - Cross-Platform Makefile Generator. + +:: + + cmake [options] + cmake [options] + +The "cmake" executable is the CMake command-line interface. It may be +used to configure projects in scripts. Project configuration settings +may be specified on the command line with the -D option. The -i +option will cause cmake to interactively prompt for such settings. + +CMake is a cross-platform build system generator. Projects specify +their build process with platform-independent CMake listfiles included +in each directory of a source tree with the name CMakeLists.txt. +Users build a project by using CMake to generate a build system for a +native tool on their platform. + + +* ``-C ``: Pre-load a script to populate the cache. + + When cmake is first run in an empty build tree, it creates a + CMakeCache.txt file and populates it with customizable settings for + the project. This option may be used to specify a file from which + to load cache entries before the first pass through the project's + cmake listfiles. The loaded entries take priority over the + project's default values. The given file should be a CMake script + containing SET commands that use the CACHE option, not a + cache-format file. + +* ``-D :=``: Create a cmake cache entry. + + When cmake is first run in an empty build tree, it creates a + CMakeCache.txt file and populates it with customizable settings for + the project. This option may be used to specify a setting that + takes priority over the project's default value. The option may be + repeated for as many cache entries as desired. + +* ``-U ``: Remove matching entries from CMake cache. + + This option may be used to remove one or more variables from the + CMakeCache.txt file, globbing expressions using * and ? are + supported. The option may be repeated for as many cache entries as + desired. + + Use with care, you can make your CMakeCache.txt non-working. + +* ``-G ``: Specify a build system generator. + + CMake may support multiple native build systems on certain + platforms. A generator is responsible for generating a particular + build system. Possible generator names are specified in the + Generators section. + +* ``-T ``: Specify toolset name if supported by generator. + + Some CMake generators support a toolset name to be given to the + native build system to choose a compiler. This is supported only on + specific generators: + + :: + + Visual Studio >= 10 + Xcode >= 3.0 + + See native build system documentation for allowed toolset names. + +* ``-Wno-dev``: Suppress developer warnings. + + Suppress warnings that are meant for the author of the + CMakeLists.txt files. + +* ``-Wdev``: Enable developer warnings. + + Enable warnings that are meant for the author of the CMakeLists.txt + files. + +* ``-E``: CMake command mode. + + For true platform independence, CMake provides a list of commands + that can be used on all systems. Run with -E help for the usage + information. Commands available are: chdir, compare_files, copy, + copy_directory, copy_if_different, echo, echo_append, environment, + make_directory, md5sum, remove, remove_directory, rename, tar, time, + touch, touch_nocreate. In addition, some platform specific commands + are available. On Windows: comspec, delete_regv, write_regv. On + UNIX: create_symlink. + +* ``-i``: Run in wizard mode. + + Wizard mode runs cmake interactively without a GUI. The user is + prompted to answer questions about the project configuration. The + answers are used to set cmake cache values. + +* ``-L[A][H]``: List non-advanced cached variables. + + List cache variables will run CMake and list all the variables from + the CMake cache that are not marked as INTERNAL or ADVANCED. This + will effectively display current CMake settings, which can then be + changed with -D option. Changing some of the variables may result + in more variables being created. If A is specified, then it will + display also advanced variables. If H is specified, it will also + display help for each variable. + +* ``--build ``: Build a CMake-generated project binary tree. + + This abstracts a native build tool's command-line interface with the + following options: + + :: + + = Project binary directory to be built. + --target = Build instead of default targets. + --config = For multi-configuration tools, choose . + --clean-first = Build target 'clean' first, then build. + (To clean only, use --target 'clean'.) + --use-stderr = Don't merge stdout/stderr output and pass the + original stdout/stderr handles to the native + tool so it can use the capabilities of the + calling terminal (e.g. colored output). + -- = Pass remaining options to the native tool. + + Run cmake --build with no options for quick help. + +* ``-N``: View mode only. + + Only load the cache. Do not actually run configure and generate + steps. + +* ``-P ``: Process script mode. + + Process the given cmake file as a script written in the CMake + language. No configure or generate step is performed and the cache + is not modified. If variables are defined using -D, this must be + done before the -P argument. + +* ``--find-package``: Run in pkg-config like mode. + + Search a package using find_package() and print the resulting flags + to stdout. This can be used to use cmake instead of pkg-config to + find installed libraries in plain Makefile-based projects or in + autoconf-based projects (via share/aclocal/cmake.m4). + +* ``--graphviz=[file]``: Generate graphviz of dependencies, see CMakeGraphVizOptions.cmake for more. + + Generate a graphviz input file that will contain all the library and + executable dependencies in the project. See the documentation for + CMakeGraphVizOptions.cmake for more details. + +* ``--system-information [file]``: Dump information about this system. + + Dump a wide range of information about the current system. If run + from the top of a binary tree for a CMake project it will dump + additional information such as the cache, log files etc. + +* ``--debug-trycompile``: Do not delete the try_compile build tree. Only useful on one try_compile at a time. + + Do not delete the files and directories created for try_compile + calls. This is useful in debugging failed try_compiles. It may + however change the results of the try-compiles as old junk from a + previous try-compile may cause a different test to either pass or + fail incorrectly. This option is best used for one try-compile at a + time, and only when debugging. + +* ``--debug-output``: Put cmake in a debug mode. + + Print extra stuff during the cmake run like stack traces with + message(send_error ) calls. + +* ``--trace``: Put cmake in trace mode. + + Print a trace of all calls made and from where with + message(send_error ) calls. + +* ``--warn-uninitialized``: Warn about uninitialized values. + + Print a warning when an uninitialized variable is used. + +* ``--warn-unused-vars``: Warn about unused variables. + + Find variables that are declared or set, but not used. + +* ``--no-warn-unused-cli``: Don't warn about command line options. + + Don't find variables that are declared on the command line, but not + used. + +* ``--check-system-vars``: Find problems with variable usage in system files. + + Normally, unused and uninitialized variables are searched for only + in CMAKE_SOURCE_DIR and CMAKE_BINARY_DIR. This flag tells CMake to + warn about other files as well. + +* ``--help-command cmd [file]``: Print help for a single command and exit. + + Full documentation specific to the given command is displayed. If a + file is specified, the documentation is written into and the output + format is determined depending on the filename suffix. Supported + are man page, HTML, DocBook and plain text. + +* ``--help-command-list [file]``: List available listfile commands and exit. + + The list contains all commands for which help may be obtained by + using the --help-command argument followed by a command name. If a + file is specified, the documentation is written into and the output + format is determined depending on the filename suffix. Supported + are man page, HTML, DocBook and plain text. + +* ``--help-commands [file]``: Print help for all commands and exit. + + Full documentation specific for all current commands is displayed.If + a file is specified, the documentation is written into and the + output format is determined depending on the filename suffix. + Supported are man page, HTML, DocBook and plain text. + +* ``--help-compatcommands [file]``: Print help for compatibility commands. + + Full documentation specific for all compatibility commands is + displayed.If a file is specified, the documentation is written into + and the output format is determined depending on the filename + suffix. Supported are man page, HTML, DocBook and plain text. + +* ``--help-module module [file]``: Print help for a single module and exit. + + Full documentation specific to the given module is displayed.If a + file is specified, the documentation is written into and the output + format is determined depending on the filename suffix. Supported + are man page, HTML, DocBook and plain text. + +* ``--help-module-list [file]``: List available modules and exit. + + The list contains all modules for which help may be obtained by + using the --help-module argument followed by a module name. If a + file is specified, the documentation is written into and the output + format is determined depending on the filename suffix. Supported + are man page, HTML, DocBook and plain text. + +* ``--help-modules [file]``: Print help for all modules and exit. + + Full documentation for all modules is displayed. If a file is + specified, the documentation is written into and the output format + is determined depending on the filename suffix. Supported are man + page, HTML, DocBook and plain text. + +* ``--help-custom-modules [file]``: Print help for all custom modules and exit. + + Full documentation for all custom modules is displayed. If a file + is specified, the documentation is written into and the output + format is determined depending on the filename suffix. Supported + are man page, HTML, DocBook and plain text. + +* ``--help-policy cmp [file]``: Print help for a single policy and exit. + + Full documentation specific to the given policy is displayed.If a + file is specified, the documentation is written into and the output + format is determined depending on the filename suffix. Supported + are man page, HTML, DocBook and plain text. + +* ``--help-policy-list [file]``: List available policies and exit. + + The list contains all policies for which help may be obtained by + using the --help-policy argument followed by a policy name. If a + file is specified, the documentation is written into and the output + format is determined depending on the filename suffix. Supported + are man page, HTML, DocBook and plain text. + +* ``--help-policies [file]``: Print help for all policies and exit. + + Full documentation for all policies is displayed.If a file is + specified, the documentation is written into and the output format + is determined depending on the filename suffix. Supported are man + page, HTML, DocBook and plain text. + +* ``--help-property prop [file]``: Print help for a single property and exit. + + Full documentation specific to the given property is displayed.If a + file is specified, the documentation is written into and the output + format is determined depending on the filename suffix. Supported + are man page, HTML, DocBook and plain text. + +* ``--help-property-list [file]``: List available properties and exit. + + The list contains all properties for which help may be obtained by + using the --help-property argument followed by a property name. If + a file is specified, the help is written into it.If a file is + specified, the documentation is written into and the output format + is determined depending on the filename suffix. Supported are man + page, HTML, DocBook and plain text. + +* ``--help-properties [file]``: Print help for all properties and exit. + + Full documentation for all properties is displayed.If a file is + specified, the documentation is written into and the output format + is determined depending on the filename suffix. Supported are man + page, HTML, DocBook and plain text. + +* ``--help-variable var [file]``: Print help for a single variable and exit. + + Full documentation specific to the given variable is displayed.If a + file is specified, the documentation is written into and the output + format is determined depending on the filename suffix. Supported + are man page, HTML, DocBook and plain text. + +* ``--help-variable-list [file]``: List documented variables and exit. + + The list contains all variables for which help may be obtained by + using the --help-variable argument followed by a variable name. If + a file is specified, the help is written into it.If a file is + specified, the documentation is written into and the output format + is determined depending on the filename suffix. Supported are man + page, HTML, DocBook and plain text. + +* ``--help-variables [file]``: Print help for all variables and exit. + + Full documentation for all variables is displayed.If a file is + specified, the documentation is written into and the output format + is determined depending on the filename suffix. Supported are man + page, HTML, DocBook and plain text. + +* ``--copyright [file]``: Print the CMake copyright and exit. + + If a file is specified, the copyright is written into it. + +* ``--help,-help,-usage,-h,-H,/?``: Print usage information and exit. + + Usage describes the basic command line interface and its options. + +* ``--help-full [file]``: Print full help and exit. + + Full help displays most of the documentation provided by the UNIX + man page. It is provided for use on non-UNIX platforms, but is also + convenient if the man page is not installed. If a file is + specified, the help is written into it. + +* ``--help-html [file]``: Print full help in HTML format. + + This option is used by CMake authors to help produce web pages. If + a file is specified, the help is written into it. + +* ``--help-man [file]``: Print full help as a UNIX man page and exit. + + This option is used by the cmake build to generate the UNIX man + page. If a file is specified, the help is written into it. + +* ``--version,-version,/V [file]``: Show program name/version banner and exit. + + If a file is specified, the version is written into it. +The following generators are available on this platform: + +:: + + CMake Properties - Properties supported by CMake, the Cross-Platform Makefile Generator. + +This is the documentation for the properties supported by CMake. +Properties can have different scopes. They can either be assigned to +a source file, a directory, a target or globally to CMake. By +modifying the values of properties the behaviour of the build system +can be customized. + +:: + + CMake Compatibility Listfile Commands - Obsolete commands supported by CMake for compatibility. + +This is the documentation for now obsolete listfile commands from +previous CMake versions, which are still supported for compatibility +reasons. You should instead use the newer, faster and shinier new +commands. ;-) + +The following modules are provided with CMake. They can be used with +INCLUDE(ModuleName). + +:: + + CMake Modules - Modules coming with CMake, the Cross-Platform Makefile Generator. + +This is the documentation for the modules and scripts coming with +CMake. Using these modules you can check the computer system for +installed software packages, features of the compiler and the +existence of headers to name just a few. + +variables defined by cmake, that give information about the project, +and cmake + +Copyright 2000-2012 Kitware, Inc., Insight Software Consortium. All +rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. + +Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. + +Neither the names of Kitware, Inc., the Insight Software Consortium, +nor the names of their contributors may be used to endorse or promote +products derived from this software without specific prior written +permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +The following resources are available to get help using CMake: + + +* ``Home Page``: http://www.cmake.org + + The primary starting point for learning about CMake. + +* ``Frequently Asked Questions``: http://www.cmake.org/Wiki/CMake_FAQ + + A Wiki is provided containing answers to frequently asked questions. + +* ``Online Documentation``: http://www.cmake.org/HTML/Documentation.html + + Links to available documentation may be found on this web page. + +* ``Mailing List``: http://www.cmake.org/HTML/MailingLists.html + + For help and discussion about using cmake, a mailing list is + provided at cmake@cmake.org. The list is member-post-only but one + may sign up on the CMake web page. Please first read the full + documentation at http://www.cmake.org before posting questions to + the list. diff --git a/Help/manual/cpack.1.rst b/Help/manual/cpack.1.rst new file mode 100644 index 0000000..d9f46f4 --- /dev/null +++ b/Help/manual/cpack.1.rst @@ -0,0 +1,210 @@ +cpack(1) +******** + +:: + + cpack - Packaging driver provided by CMake. + +:: + + cpack -G [options] + +The "cpack" executable is the CMake packaging program. +CMake-generated build trees created for projects that use the +INSTALL_* commands have packaging support. This program will generate +the package. + +CMake is a cross-platform build system generator. Projects specify +their build process with platform-independent CMake listfiles included +in each directory of a source tree with the name CMakeLists.txt. +Users build a project by using CMake to generate a build system for a +native tool on their platform. + + +* ``-G ``: Use the specified generator to generate package. + + CPack may support multiple native packaging systems on certain + platforms. A generator is responsible for generating input files + for particular system and invoking that systems. Possible generator + names are specified in the Generators section. + +* ``-C ``: Specify the project configuration + + This option specifies the configuration that the project was build + with, for example 'Debug', 'Release'. + +* ``-D =``: Set a CPack variable. + + Set a variable that can be used by the generator. + +* ``--config ``: Specify the config file. + + Specify the config file to use to create the package. By default + CPackConfig.cmake in the current directory will be used. + +* ``--verbose,-V``: enable verbose output + + Run cpack with verbose output. + +* ``--debug``: enable debug output (for CPack developers) + + Run cpack with debug output (for CPack developers). + +* ``-P ``: override/define CPACK_PACKAGE_NAME + + If the package name is not specified on cpack commmand line + thenCPack.cmake defines it as CMAKE_PROJECT_NAME + +* ``-R ``: override/define CPACK_PACKAGE_VERSION + + If version is not specified on cpack command line thenCPack.cmake + defines it from CPACK_PACKAGE_VERSION_[MAJOR|MINOR|PATCH]look into + CPack.cmake for detail + +* ``-B ``: override/define CPACK_PACKAGE_DIRECTORY + + The directory where CPack will be doing its packaging work.The + resulting package will be found there. Inside this directoryCPack + creates '_CPack_Packages' sub-directory which is theCPack temporary + directory. + +* ``--vendor ``: override/define CPACK_PACKAGE_VENDOR + + If vendor is not specified on cpack command line (or inside + CMakeLists.txt) thenCPack.cmake defines it with a default value + +* ``--help-command cmd [file]``: Print help for a single command and exit. + + Full documentation specific to the given command is displayed. If a + file is specified, the documentation is written into and the output + format is determined depending on the filename suffix. Supported + are man page, HTML, DocBook and plain text. + +* ``--help-command-list [file]``: List available commands and exit. + + The list contains all commands for which help may be obtained by + using the --help-command argument followed by a command name. If a + file is specified, the documentation is written into and the output + format is determined depending on the filename suffix. Supported + are man page, HTML, DocBook and plain text. + +* ``--help-commands [file]``: Print help for all commands and exit. + + Full documentation specific for all current command is displayed.If + a file is specified, the documentation is written into and the + output format is determined depending on the filename suffix. + Supported are man page, HTML, DocBook and plain text. + +* ``--help-variable var [file]``: Print help for a single variable and exit. + + Full documentation specific to the given variable is displayed.If a + file is specified, the documentation is written into and the output + format is determined depending on the filename suffix. Supported + are man page, HTML, DocBook and plain text. + +* ``--help-variable-list [file]``: List documented variables and exit. + + The list contains all variables for which help may be obtained by + using the --help-variable argument followed by a variable name. If + a file is specified, the help is written into it.If a file is + specified, the documentation is written into and the output format + is determined depending on the filename suffix. Supported are man + page, HTML, DocBook and plain text. + +* ``--help-variables [file]``: Print help for all variables and exit. + + Full documentation for all variables is displayed.If a file is + specified, the documentation is written into and the output format + is determined depending on the filename suffix. Supported are man + page, HTML, DocBook and plain text. + +* ``--copyright [file]``: Print the CMake copyright and exit. + + If a file is specified, the copyright is written into it. + +* ``--help,-help,-usage,-h,-H,/?``: Print usage information and exit. + + Usage describes the basic command line interface and its options. + +* ``--help-full [file]``: Print full help and exit. + + Full help displays most of the documentation provided by the UNIX + man page. It is provided for use on non-UNIX platforms, but is also + convenient if the man page is not installed. If a file is + specified, the help is written into it. + +* ``--help-html [file]``: Print full help in HTML format. + + This option is used by CMake authors to help produce web pages. If + a file is specified, the help is written into it. + +* ``--help-man [file]``: Print full help as a UNIX man page and exit. + + This option is used by the cmake build to generate the UNIX man + page. If a file is specified, the help is written into it. + +* ``--version,-version,/V [file]``: Show program name/version banner and exit. + + If a file is specified, the version is written into it. +:: + + CMake Compatibility Listfile Commands - Obsolete commands supported by CMake for compatibility. + +This is the documentation for now obsolete listfile commands from +previous CMake versions, which are still supported for compatibility +reasons. You should instead use the newer, faster and shinier new +commands. ;-) + +Copyright 2000-2012 Kitware, Inc., Insight Software Consortium. All +rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. + +Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. + +Neither the names of Kitware, Inc., the Insight Software Consortium, +nor the names of their contributors may be used to endorse or promote +products derived from this software without specific prior written +permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +The following resources are available to get help using CMake: + + +* ``Home Page``: http://www.cmake.org + + The primary starting point for learning about CMake. + +* ``Frequently Asked Questions``: http://www.cmake.org/Wiki/CMake_FAQ + + A Wiki is provided containing answers to frequently asked questions. + +* ``Online Documentation``: http://www.cmake.org/HTML/Documentation.html + + Links to available documentation may be found on this web page. + +* ``Mailing List``: http://www.cmake.org/HTML/MailingLists.html + + For help and discussion about using cmake, a mailing list is + provided at cmake@cmake.org. The list is member-post-only but one + may sign up on the CMake web page. Please first read the full + documentation at http://www.cmake.org before posting questions to + the list. diff --git a/Help/manual/ctest.1.rst b/Help/manual/ctest.1.rst new file mode 100644 index 0000000..82a8396 --- /dev/null +++ b/Help/manual/ctest.1.rst @@ -0,0 +1,419 @@ +ctest(1) +******** + +:: + + ctest - Testing driver provided by CMake. + +:: + + ctest [options] + +The "ctest" executable is the CMake test driver program. +CMake-generated build trees created for projects that use the +ENABLE_TESTING and ADD_TEST commands have testing support. This +program will run the tests and report results. + + +* ``-C , --build-config ``: Choose configuration to test. + + Some CMake-generated build trees can have multiple build + configurations in the same tree. This option can be used to specify + which one should be tested. Example configurations are "Debug" and + "Release". + +* ``-V,--verbose``: Enable verbose output from tests. + + Test output is normally suppressed and only summary information is + displayed. This option will show all test output. + +* ``-VV,--extra-verbose``: Enable more verbose output from tests. + + Test output is normally suppressed and only summary information is + displayed. This option will show even more test output. + +* ``--debug``: Displaying more verbose internals of CTest. + + This feature will result in a large number of output that is mostly + useful for debugging dashboard problems. + +* ``--output-on-failure``: Output anything outputted by the test program if the test should fail. This option can also be enabled by setting the environment variable CTEST_OUTPUT_ON_FAILURE + +* ``-F``: Enable failover. + + This option allows ctest to resume a test set execution that was + previously interrupted. If no interruption occurred, the -F option + will have no effect. + +* ``-j , --parallel ``: Run the tests in parallel using thegiven number of jobs. + + This option tells ctest to run the tests in parallel using given + number of jobs. This option can also be set by setting the + environment variable CTEST_PARALLEL_LEVEL. + +* ``-Q,--quiet``: Make ctest quiet. + + This option will suppress all the output. The output log file will + still be generated if the --output-log is specified. Options such + as --verbose, --extra-verbose, and --debug are ignored if --quiet is + specified. + +* ``-O , --output-log ``: Output to log file + + This option tells ctest to write all its output to a log file. + +* ``-N,--show-only``: Disable actual execution of tests. + + This option tells ctest to list the tests that would be run but not + actually run them. Useful in conjunction with the -R and -E + options. + +* ``-L , --label-regex ``: Run tests with labels matching regular expression. + + This option tells ctest to run only the tests whose labels match the + given regular expression. + +* ``-R , --tests-regex ``: Run tests matching regular expression. + + This option tells ctest to run only the tests whose names match the + given regular expression. + +* ``-E , --exclude-regex ``: Exclude tests matching regular expression. + + This option tells ctest to NOT run the tests whose names match the + given regular expression. + +* ``-LE , --label-exclude ``: Exclude tests with labels matching regular expression. + + This option tells ctest to NOT run the tests whose labels match the + given regular expression. + +* ``-D , --dashboard ``: Execute dashboard test + + This option tells ctest to act as a Dart client and perform a + dashboard test. All tests are , where Mode can be + Experimental, Nightly, and Continuous, and Test can be Start, + Update, Configure, Build, Test, Coverage, and Submit. + +* ``-D :=``: Define a variable for script mode + + Pass in variable values on the command line. Use in conjunction + with -S to pass variable values to a dashboard script. Parsing -D + arguments as variable values is only attempted if the value + following -D does not match any of the known dashboard types. + +* ``-M , --test-model ``: Sets the model for a dashboard + + This option tells ctest to act as a Dart client where the TestModel + can be Experimental, Nightly, and Continuous. Combining -M and -T + is similar to -D + +* ``-T , --test-action ``: Sets the dashboard action to perform + + This option tells ctest to act as a Dart client and perform some + action such as start, build, test etc. Combining -M and -T is + similar to -D + +* ``--track ``: Specify the track to submit dashboard to + + Submit dashboard to specified track instead of default one. By + default, the dashboard is submitted to Nightly, Experimental, or + Continuous track, but by specifying this option, the track can be + arbitrary. + +* ``-S