Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

[r10103]: main / trunk / CMakeLists.txt Maximize Restore History

Download this file

CMakeLists.txt    1402 lines (1297 with data), 73.4 kB

   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
 858
 859
 860
 861
 862
 863
 864
 865
 866
 867
 868
 869
 870
 871
 872
 873
 874
 875
 876
 877
 878
 879
 880
 881
 882
 883
 884
 885
 886
 887
 888
 889
 890
 891
 892
 893
 894
 895
 896
 897
 898
 899
 900
 901
 902
 903
 904
 905
 906
 907
 908
 909
 910
 911
 912
 913
 914
 915
 916
 917
 918
 919
 920
 921
 922
 923
 924
 925
 926
 927
 928
 929
 930
 931
 932
 933
 934
 935
 936
 937
 938
 939
 940
 941
 942
 943
 944
 945
 946
 947
 948
 949
 950
 951
 952
 953
 954
 955
 956
 957
 958
 959
 960
 961
 962
 963
 964
 965
 966
 967
 968
 969
 970
 971
 972
 973
 974
 975
 976
 977
 978
 979
 980
 981
 982
 983
 984
 985
 986
 987
 988
 989
 990
 991
 992
 993
 994
 995
 996
 997
 998
 999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
#/*----------------------------------------------------------------------------*/
#/* */
#/* Copyright (c) 2014-2014 Rexx Language Association. All rights reserved. */
#/* */
#/* This program and the accompanying materials are made available under */
#/* the terms of the Common Public License v1.0 which accompanies this */
#/* distribution. A copy is also available at the following address: */
#/* http://www.oorexx.org/license.html */
#/* */
#/* 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 name of Rexx Language Association nor the names */
#/* of its 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 */
#/* OWNER 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. */
#/* */
#/*----------------------------------------------------------------------------*/
#/*----------------------------------------------------------------------------*/
#/* Global settings */
#/*----------------------------------------------------------------------------*/
cmake_minimum_required (VERSION 2.6)
cmake_policy(SET CMP0010 OLD)
include(CheckIncludeFile)
include(CheckLibraryExists)
include(CheckFunctionExists)
include(CheckSymbolExists)
include(CheckCSourceCompiles)
set (CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin)
set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin)
set (CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin)
set (CMAKE_PDB_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin)
#/*----------------------------------------------------------------------------*/
#/* Project settings */
#/*----------------------------------------------------------------------------*/
project (ooRexx)
# The version of ooRexx to make
set (ORX_MAJOR 4)
set (ORX_MINOR 3)
set (ORX_MOD_LVL 0)
set (ORX_BLD_LVL 0)
set (ORX_VERSION ${ORX_MAJOR}.${ORX_MINOR}.${ORX_MOD_LVL})
set (ORX_VER_STR ${ORX_MAJOR}.${ORX_MINOR}.${ORX_MOD_LVL})
string(TIMESTAMP ORX_YEAR %Y)
set (ORX_COPY_YEAR 2005-${ORX_YEAR})
string(TOUPPER ${CMAKE_SYSTEM_NAME} ORX_SYS_STR)
# Get the SVN revision number of an svn command line client is
# available. This version will run at build time rather than only
# at configuration generation time.
FIND_PROGRAM(SVN_EXECUTABLE svn
DOC "subversion command line client")
# only do this if we have an svn client.
if (SVN_EXECUTABLE)
MACRO(Subversion_GET_REVISION dir variable)
EXECUTE_PROCESS(COMMAND ${SVN_EXECUTABLE} info ${dir}
OUTPUT_VARIABLE ${variable}
OUTPUT_STRIP_TRAILING_WHITESPACE)
STRING(REGEX REPLACE "^(.*\n)?Revision: ([^\n]+).*"
"\\2" ${variable} "${${variable}}")
ENDMACRO(Subversion_GET_REVISION)
Subversion_GET_REVISION(${CMAKE_SOURCE_DIR} ORX_BLD_LVL)
endif ()
message(STATUS "SVN Revision Number is ${ORX_BLD_LVL}")
# The following supports the versioning of the rexx shared libraries
# This defines the oorexx library version. For ooRexx this should always be the
# same as the ORX_MAJOR number.
set (ORX_CURRENT ${ORX_MAJOR})
# Each public release of ooRexx should increment this number by one except
# when the ORX_MINOR goes back to zero. If that is the case then this entry
# should also be set to zero.
set (ORX_REVISION 7)
# For ooRexx, this number should ALWAYS be zero. This will force the linker to
# utilize all previous releases for linking.
set (ORX_AGE 0)
# Please note that the version-info has nothing to do with the release version.
# You need to know exactly what you are doing in order to get this correct.
set(VERSION_INFO "-version-info ${ORX_CURRENT}:${ORX_REVISION}:${ORX_AGE}")
# This is version information set on library properties
set(ORX_VERSION ${ORX_CURRENT}.${ORX_AGE}.${ORX_REVISION})
# The following are general settings
# Always create shared libraries (DLLs)
set (CMAKE_CXX_CREATE_SHARED_MODULE 1)
# Set the platform subdirectory name
if (WIN32)
set (ORX_PLATFORM_DIR platform/windows)
else ()
set (ORX_PLATFORM_DIR platform/unix)
endif ()
# Set path to look for include files
include_directories(BEFORE api api/${ORX_PLATFORM_DIR})
# Common install variables
SET(CPACK_PACKAGE_VERSION_MAJOR ${ORX_MAJOR})
SET(CPACK_PACKAGE_VERSION_MINOR ${ORX_MINOR})
SET(CPACK_PACKAGE_VERSION_PATCH ${ORX_MOD_LVL})
set(CPACK_PACKAGE_NAME "ooRexx")
set(CPACK_PACKAGE_VENDOR "Rexx Language Association")
# Set install variables
if (WIN32)
set (INSTALL_EXECUTABLE_DIR bin)
set (INSTALL_LIB_DIR bin)
set (INSTALL_CLS_DIR bin)
set (INSTALL_REX_DIR bin)
set (INSTALL_INCLUDE_DIR include)
else ()
set (CMAKE_INSTALL_PREFIX /usr)
set (catdir ${CMAKE_INSTALL_PREFIX}/bin)
set (INSTALL_EXECUTABLE_DIR ${CMAKE_INSTALL_PREFIX}/bin)
set (INSTALL_CLS_DIR ${CMAKE_INSTALL_PREFIX}/bin)
set (INSTALL_REX_DIR ${CMAKE_INSTALL_PREFIX}/bin)
set (INSTALL_INCLUDE_DIR ${CMAKE_INSTALL_PREFIX}/include)
find_path(INSTALL_LIB_DIR libc.so PATHS ${CMAKE_INSTALL_PREFIX}/lib/* ${CMAKE_INSTALL_PREFIX}/lib64)
endif ()
# Set compiler and linker flags common to all build environments
include_directories(${PROJECT_BINARY_DIR})
if (WIN32)
add_definitions(/DORX_VER=${ORX_MAJOR}
/DORX_REL=${ORX_MINOR}
/DORX_MOD=${ORX_MOD_LVL}
/DORX_BLD=${ORX_BLD_LVL}
/DORX_VER_STR=${ORX_VER_STR}
/DOOREXX_COPY_YEAR="${ORX_COPY_YEAR}"
/DORX_SYS_STR="${CMAKE_SYSTEM_NAME}"
/DORX_CATDIR="${catdir}"
/DORX_SHARED_LIBRARY_EXT="${CMAKE_SHARED_LIBRARY_SUFFIX}"
/D_CRT_SECURE_NO_DEPRECATE
/D_CRT_SECURE_NO_WARNINGS
/D_CRT_NONSTDC_NO_DEPRECATE
/DWIN32 /D_WINDOWS /DHAVE_CONFIG_H)
if ($ENV{Platform} STREQUAL "X64")
set (EXE_MANIFEST_FILE ${CMAKE_CURRENT_SOURCE_DIR}/${ORX_PLATFORM_DIR}/rexx64.exe.manifest)
else ()
set (EXE_MANIFEST_FILE ${CMAKE_CURRENT_SOURCE_DIR}/${ORX_PLATFORM_DIR}/rexx32.exe.manifest)
endif ()
file(TO_NATIVE_PATH ${EXE_MANIFEST_FILE} EXE_MANIFEST_FILE)
set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /STACK:524288")
else ()
add_definitions(-DORX_VER=${ORX_MAJOR} -DORX_REL=${ORX_MINOR} -DORX_MOD=${ORX_MOD_LVL} -DORX_FIX=0
-DOOREXX_COPY_YEAR="${ORX_COPY_YEAR}"
-DORX_SYS_STR="${CMAKE_SYSTEM_NAME}"
-DORX_CATDIR="${catdir}"
-DORX_SHARED_LIBRARY_EXT="${CMAKE_SHARED_LIBRARY_SUFFIX}"
-D${ORX_SYS_STR} -DOPSYS_${ORX_SYS_STR} -DHAVE_CONFIG_H)
set (ORX_SYSLIB_DL dl)
set (ORX_SYSLIB_PTHREAD pthread)
endif ()
# Check header files and functions. These are all defined to the config.h file.
check_include_file(attr/xattr.h HAVE_ATTR_XATTR_H)
check_function_exists(catopen HAVE_CATOPEN)
check_include_file(ctype.h HAVE_CTYPE_H)
check_include_file(dlfcn.h HAVE_DLFCN_H)
check_include_file(fcntl.h HAVE_FCNTL_H)
check_include_file(features.h HAVE_FEATURES_H)
check_include_file(filehdr.h HAVE_FILEHDR_H)
check_function_exists(fstat HAVE_FSTAT)
check_function_exists(gcvt HAVE_GCVT)
check_function_exists(geteuid HAVE_GETEUID)
check_function_exists(getpgrp HAVE_GETPGRP)
check_function_exists(getpwuid HAVE_GETPUID)
check_function_exists(gettimeofday HAVE_GETTIMEOFDAY)
check_function_exists(getuserattr HAVE_GETUSERATTR)
check_function_exists(IDtouser HAVE_IDTOUSER)
check_include_file(inttypes.h HAVE_INTTYPES_H)
check_include_file(float.h HAVE_FLOAT_H)
find_library(HAVE_LIBPTHREAD pthread)
find_library(HAVE_LIBRT rt)
check_include_file(limits.h HAVE_LIMITS_H)
check_include_file(locale.h HAVE_LOCALE_H)
check_include_file(malloc.h HAVE_MALLOC_H)
check_include_file(memory.h HAVE_MEMORY_H)
check_function_exists(memset HAVE_MEMSET)
check_include_file(mesg.h HAVE_MESG_H)
check_function_exists(nanosleep HAVE_NANOSLEEP)
check_include_file(netinet/in.h HAVE_NETINET_IN_H)
check_include_file(nl_types.h HAVE_NL_TYPES_H)
check_function_exists(nsleep HAVE_NSLEEP)
check_include_file(pthread.h HAVE_PTHREAD_H)
set(CMAKE_REQUIRED_LIBRARIES "pthread;pthread_nonshared")
check_function_exists(pthread_mutexattr_settype HAVE_PTHREAD_MUTEXATTR_SETTYPE)
check_c_source_compiles("#include <pthread.h>
int main(int arg, char **argv) {
int tryme;
tryme = PTHREAD_MUTEX_ERRORCHECK;
return 0;}"
HAVE_PTHREAD_MUTEX_ERRORCHECK)
check_c_source_compiles("#include <pthread.h>
int main(int arg, char **argv) {
int tryme;
tryme = PTHREAD_MUTEX_RECURSIVE;
return 0;}"
HAVE_PTHREAD_MUTEX_RECURSIVE)
check_c_source_compiles("#include <pthread.h>
int main(int arg, char **argv) {
int tryme;
tryme = PTHREAD_MUTEX_RECURSIVE_NP;
return 0;}"
HAVE_PTHREAD_MUTEX_RECURSIVE_NP)
check_symbol_exists(PTHREAD_MUTEX_RECURSIVE_NP "pthread.h" HAVE_PTHREAD_MUTEX_RECURSIVE_NP)
check_include_file(pwd.h HAVE_PWD_H)
check_include_file(sched.h HAVE_SCHED_H)
check_function_exists(setlocale HAVE_SETLOCALE)
check_function_exists(sighold HAVE_SIGHOLD)
check_include_file(signal.h HAVE_SIGNAL_H)
check_include_file(stdarg.h HAVE_STDARG_H)
check_include_file(stddef.h HAVE_STDDEF_H)
check_include_file(stdint.h HAVE_STDINT_H)
check_include_file(stdio.h HAVE_STDIO_H)
check_include_file(stdlib.h HAVE_STDLIB_H)
check_function_exists(strdup HAVE_STRDUP)
check_include_file(strings.h HAVE_STRINGS_H)
check_include_file(string.h HAVE_STRING_H)
check_include_file(stropts.h HAVE_STROPTS_H)
check_include_file(sys/filio.h HAVE_SYS_FILIO_H)
check_include_file(sys/ldr.h HAVE_SYS_LDR_H)
check_include_file(sys/resource.h HAVE_SYS_RESOURCE_H)
check_include_file(sys/select.h HAVE_SYS_SELECT_H)
check_include_file(sys/sem.h HAVE_SYS_SEM_H)
check_include_file(sys/signal.h HAVE_SYS_SIGNAL_H)
check_include_file(sys/socket.h HAVE_SYS_SOCKET_H)
check_include_file(sys/stat.h HAVE_SYS_STAT_H)
check_include_file(sys/syscall.h HAVE_SYS_SYSCALL_H)
check_include_file(sys/time.h HAVE_SYS_TIME_H)
check_include_file(sys/types.h HAVE_SYS_TYPES_H)
check_include_file(sys/utsname.h HAVE_SYS_UTSNAME_H)
check_include_file(sys/wait.h HAVE_SYS_WAIT_H)
check_include_file(time.h HAVE_TIME_H)
check_c_source_compiles("#include <sys/types.h>
#include <sys/sem.h>
int main(int arg, char **argv) {
union semun semopts;
return 0;}"
HAVE_UNION_SEMUN)
check_include_file(unistd.h HAVE_UNISTD_H)
check_include_file(usersec.h HAVE_USERSEC_H)
check_function_exists(vprintf HAVE_VPRINTF)
set (PACKAGE ${PROJECT_NAME})
set (PACKAGE_BUGREPORT "http://sourceforge.net/projects/oorexx/")
set (PACKAGE_NAME ${PROJECT_NAME})
set (PACKAGE_STRING ${PROJECT_NAME})
set (PACKAGE_TARNAME "ooRexx.tar")
set (PACKAGE_URL "http://www.oorexx.org/")
set (PACKAGE_VERSION ${ORX_VER_STR})
set (VERSION ${ORX_VER_STR})
set (STDC_HEADERS 1)
# Configure files
configure_file(config.h.in.cmake ${PROJECT_BINARY_DIR}/config.h)
# TODO: revisit this section later
if (NOT WIN32)
# configure_file(${CMAKE_CURRENT_SOURCE_DIR}/platform/unix/oorexx.spec.in ${CMAKE_CURRENT_SOURCE_DIR}/platform/unix/oorexx.spec)
# configure_file(platform/unix/debian/changelog.in platform/unix/debian/changelog)
# configure_file(platform/unix/debian/postinst.in platform/unix/debian/postinst)
# configure_file(rexxapi/server/platform/unix/rxapid.in rexxapi/server/platform/unix/rxapid)
# configure_file(platform/unix/oorexx-config.in platform/unix/oorexx-config)
endif ()
#/*----------------------------------------------------------------------------*/
#/* Subdirectory short names */
#/*----------------------------------------------------------------------------*/
set (build_common_dir common)
set (build_common_platform_dir ${build_common_dir}/${ORX_PLATFORM_DIR})
set (build_lib_dir lib)
set (build_platform_dir ${ORX_PLATFORM_DIR})
set (build_rexxapi_dir rexxapi)
set (build_rexxapi_client_dir ${build_rexxapi_dir}/client)
set (build_rexxapi_client_platform_dir ${build_rexxapi_client_dir}/${ORX_PLATFORM_DIR})
set (build_rexxapi_common_dir ${build_rexxapi_dir}/common)
set (build_rexxapi_common_platform_dir ${build_rexxapi_common_dir}/${ORX_PLATFORM_DIR})
set (build_rexxapi_server_dir ${build_rexxapi_dir}/server)
set (build_rexxapi_server_platform_dir ${build_rexxapi_server_dir}/${ORX_PLATFORM_DIR})
set (build_interpreter_dir interpreter)
set (build_interpreter_platform_dir ${build_interpreter_dir}/${ORX_PLATFORM_DIR})
set (build_interpreter_api_dir ${build_interpreter_dir}/api)
set (build_behaviour_dir ${build_interpreter_dir}/behaviour)
set (build_classes_dir ${build_interpreter_dir}/classes)
set (build_classes_support_dir ${build_interpreter_dir}/classes/support)
set (build_concurrency_dir ${build_interpreter_dir}/concurrency)
set (build_execution_dir ${build_interpreter_dir}/execution)
set (build_expression_dir ${build_interpreter_dir}/expression)
set (build_instructions_dir ${build_interpreter_dir}/instructions)
set (build_memory_dir ${build_interpreter_dir}/memory)
set (build_messages_dir ${build_interpreter_dir}/messages)
set (build_package_dir ${build_interpreter_dir}/package)
set (build_parser_dir ${build_interpreter_dir}/parser)
set (build_interpreter_common_dir ${build_interpreter_dir}/platform/common)
set (build_rexx_classes_dir ${build_interpreter_dir}/RexxClasses)
set (build_runtime_dir ${build_interpreter_dir}/runtime)
set (build_streamlibrary_dir ${build_interpreter_dir}/streamLibrary)
set (build_extensions_dir extensions)
set (build_extensions_platform_dir ${build_extensions_dir}/${ORX_PLATFORM_DIR})
set (build_extensions_rexxutil_dir ${build_extensions_dir}/rexxutil)
set (build_extensions_rexxutil_platform_dir ${build_extensions_rexxutil_dir}/${ORX_PLATFORM_DIR})
set (build_extensions_rxftp_dir ${build_extensions_dir}/rxftp)
set (build_extensions_csvstream_dir ${build_extensions_dir}/csvStream)
set (build_extensions_rxmath_dir ${build_extensions_dir}/rxmath)
set (build_extensions_rxregexp_dir ${build_extensions_dir}/rxregexp)
set (build_extensions_rxsock_dir ${build_extensions_dir}/rxsock)
set (build_extensions_hostemu_dir ${build_extensions_dir}/hostemu)
set (build_extensions_hostemu_platform_dir ${build_extensions_hostemu_dir}/${ORX_PLATFORM_DIR})
set (build_utilities_dir utilities)
set (build_utilities_rexx_dir ${build_utilities_dir}/rexx/${ORX_PLATFORM_DIR})
set (build_utilities_rexxc_dir ${build_utilities_dir}/rexxc/${ORX_PLATFORM_DIR})
set (build_utilities_rexximage_dir ${build_utilities_dir}/rexximage)
set (build_utilities_rxqueue_dir ${build_utilities_dir}/rxqueue/${ORX_PLATFORM_DIR})
set (build_utilities_rxsubcom_dir ${build_utilities_dir}/rxsubcom/${ORX_PLATFORM_DIR})
set (build_api_dir api)
set (build_api_platform_dir api/${ORX_PLATFORM_DIR})
set (build_samples_dir samples)
set (api_dir ${build_api_dir}/${ORX_PLATFORM_DIR})
if (WIN32)
set (platform_samples_dir ${build_samples_dir}/windows)
else ()
set (platform_samples_dir ${build_samples_dir}/unix)
endif ()
# The following are windows only
set (build_extensions_ole_dir ${build_extensions_dir}/platform/windows/ole)
set (build_extensions_oodialog_dir ${build_extensions_dir}/platform/windows/oodialog)
set (build_extensions_rxwinsys_dir ${build_extensions_dir}/platform/windows/rxwinsys)
set (build_utilities_rexxpaws_dir ${build_utilities_dir}/platform/windows/rexxpaws)
set (build_utilities_rexxhide_dir ${build_utilities_dir}/platform/windows/rexxhide)
#/*----------------------------------------------------------------------------*/
#/* Build targets */
#/*----------------------------------------------------------------------------*/
#################### librexxapi.so ##########################
# Full set of files used in all platforms.
set (common_rexxapi_sources
${build_rexxapi_client_dir}/ClientMessage.cpp
${build_rexxapi_client_dir}/LocalAPIContext.cpp
${build_rexxapi_client_dir}/LocalAPIManager.cpp
${build_rexxapi_client_dir}/LocalMacroSpaceManager.cpp
${build_rexxapi_client_dir}/LocalQueueManager.cpp
${build_rexxapi_client_dir}/LocalRegistrationManager.cpp
${build_rexxapi_client_dir}/MacroSpaceApi.cpp
${build_rexxapi_client_dir}/QueuesAPI.cpp
${build_rexxapi_client_dir}/RegistrationAPI.cpp
${build_rexxapi_client_platform_dir}/SysLegacyAPI.cpp
${build_rexxapi_client_platform_dir}/SysLocalAPIManager.cpp
${build_rexxapi_common_dir}/RegistrationTable.cpp
${build_rexxapi_common_dir}/ServiceMessage.cpp
${build_rexxapi_common_platform_dir}/SysAPIManager.cpp
${build_rexxapi_common_platform_dir}/SysCSStream.cpp
${build_rexxapi_common_platform_dir}/SysProcess.cpp
${build_common_dir}/Utilities.cpp
${build_common_platform_dir}/SysSemaphore.cpp
${build_common_platform_dir}/SysLibrary.cpp
${build_common_platform_dir}/SysFile.cpp
${build_common_platform_dir}/SysThread.cpp)
# additional source files required by specific platforms
if (WIN32)
set (platform_rexxapi_sources
${build_rexxapi_client_platform_dir}/rexxapi.def
${build_platform_dir}/verinfo.rc)
set (platform_rexxapi_libs wsock32)
else ()
set (platform_rexxapi_libs ${ORX_SYSLIB_DL} ${ORX_SYSLIB_PTHREAD})
endif ()
# Library definition
add_library(rexxapi SHARED
${common_rexxapi_sources}
${platform_rexxapi_sources})
# Include file definition
target_include_directories(rexxapi PUBLIC
${build_rexxapi_client_dir}
${build_rexxapi_client_platform_dir}
${build_rexxapi_common_dir}
${build_rexxapi_common_platform_dir}
${build_common_dir}
${build_common_platform_dir}
${build_lib_dir})
# Extra link library definitions
target_link_libraries(rexxapi ${platform_rexxapi_libs})
install(TARGETS rexxapi RUNTIME DESTINATION ${INSTALL_LIB_DIR} COMPONENT Core
LIBRARY DESTINATION ${INSTALL_LIB_DIR} COMPONENT Core
ARCHIVE DESTINATION ${INSTALL_INCLUDE_DIR} COMPONENT DevLib)
set_target_properties(rexxapi PROPERTIES VERSION ${ORX_VERSION})
#################### librexx.so ##########################
# Sources for librexx.so
set (interpreter_api_sources ${build_interpreter_api_dir}/CallContextStubs.cpp
${build_interpreter_api_dir}/InterpreterAPI.cpp
${build_interpreter_api_dir}/InterpreterInstanceStubs.cpp
${build_interpreter_api_dir}/MethodContextStubs.cpp
${build_interpreter_api_dir}/ThreadContextStubs.cpp)
set (classes_support_sources ${build_classes_support_dir}/ProgramMetaData.cpp
${build_classes_support_dir}/RexxCollection.cpp
${build_classes_support_dir}/RexxCompoundElement.cpp
${build_classes_support_dir}/RexxCompoundTable.cpp
${build_classes_support_dir}/RexxCompoundTail.cpp
${build_classes_support_dir}/RexxDateTime.cpp
${build_classes_support_dir}/RexxHashTable.cpp
${build_classes_support_dir}/RexxListTable.cpp
${build_classes_support_dir}/StringUtil.cpp)
set (classes_sources ${build_classes_dir}/ArrayClass.cpp
${build_classes_dir}/BufferClass.cpp
${build_classes_dir}/ClassClass.cpp
${build_classes_dir}/ContextClass.cpp
${build_classes_dir}/DirectoryClass.cpp
${build_classes_dir}/IntegerClass.cpp
${build_classes_dir}/ListClass.cpp
${build_classes_dir}/MessageClass.cpp
${build_classes_dir}/MethodClass.cpp
${build_classes_dir}/MutableBufferClass.cpp
${build_classes_dir}/NumberStringClass.cpp
${build_classes_dir}/NumberStringMath.cpp
${build_classes_dir}/NumberStringMath2.cpp
${build_classes_dir}/ObjectClass.cpp
${build_classes_dir}/PackageClass.cpp
${build_classes_dir}/PointerClass.cpp
${build_classes_dir}/QueueClass.cpp
${build_classes_dir}/RelationClass.cpp
${build_classes_dir}/RoutineClass.cpp
${build_classes_dir}/RexxQueueMethods.cpp
${build_classes_dir}/StackClass.cpp
${build_classes_dir}/StemClass.cpp
${build_classes_dir}/StringClass.cpp
${build_classes_dir}/StringClassBit.cpp
${build_classes_dir}/StringClassConversion.cpp
${build_classes_dir}/StringClassMisc.cpp
${build_classes_dir}/StringClassSub.cpp
${build_classes_dir}/StringClassUtil.cpp
${build_classes_dir}/StringClassWord.cpp
${build_classes_dir}/SupplierClass.cpp
${build_classes_dir}/TableClass.cpp
${build_classes_dir}/IdentityTableClass.cpp
${build_classes_dir}/WeakReferenceClass.cpp
${build_classes_dir}/StackFrameClass.cpp)
set (package_sources ${build_package_dir}/LibraryPackage.cpp
${build_package_dir}/PackageManager.cpp)
set (memory_sources ${build_memory_dir}/DeadObject.cpp
${build_memory_dir}/MemorySegment.cpp
${build_memory_dir}/MemoryStats.cpp
${build_memory_dir}/ProtectedObject.cpp
${build_memory_dir}/RexxEnvelope.cpp
${build_memory_dir}/RexxInternalStack.cpp
${build_memory_dir}/RexxSmartBuffer.cpp
${build_memory_dir}/UninitDispatcher.cpp
${build_memory_dir}/Setup.cpp
${build_memory_dir}/RexxMemory.cpp)
set (execution_sources ${build_execution_dir}/CPPCode.cpp
${build_execution_dir}/RexxActivation.cpp
${build_execution_dir}/RexxActivationStack.cpp
${build_execution_dir}/RexxCode.cpp
${build_execution_dir}/RexxLocalVariables.cpp
${build_execution_dir}/RexxNativeActivation.cpp
${build_execution_dir}/RexxNativeCode.cpp
${build_execution_dir}/RexxVariable.cpp
${build_execution_dir}/RexxVariableDictionary.cpp
${build_execution_dir}/SecurityManager.cpp)
set (behaviour_sources ${build_behaviour_dir}/PrimitiveBehaviours.cpp
${build_behaviour_dir}/RexxBehaviour.cpp
${build_behaviour_dir}/VirtualFunctionTable.cpp)
set (concurrency_sources ${build_concurrency_dir}/ActivityDispatcher.cpp
${build_concurrency_dir}/ActivityManager.cpp
${build_concurrency_dir}/ActivationFrame.cpp
${build_concurrency_dir}/CallbackDispatcher.cpp
${build_concurrency_dir}/TrappingDispatcher.cpp
${build_concurrency_dir}/ExitHandler.cpp
${build_concurrency_dir}/CommandHandler.cpp
${build_concurrency_dir}/MessageDispatcher.cpp
${build_concurrency_dir}/RexxActivity.cpp
${build_concurrency_dir}/RexxStartDispatcher.cpp
${build_concurrency_dir}/TranslateDispatcher.cpp)
set (expression_sources ${build_expression_dir}/BuiltinFunctions.cpp
${build_expression_dir}/CommonExternalFunctions.cpp
${build_expression_dir}/ExpressionCompoundVariable.cpp
${build_expression_dir}/ExpressionDotVariable.cpp
${build_expression_dir}/ExpressionFunction.cpp
${build_expression_dir}/ExpressionMessage.cpp
${build_expression_dir}/ExpressionOperator.cpp
${build_expression_dir}/ExpressionStack.cpp
${build_expression_dir}/ExpressionStem.cpp
${build_expression_dir}/ExpressionVariable.cpp
${build_expression_dir}/IndirectVariableReference.cpp
${build_expression_dir}/ExpressionLogical.cpp)
set (instructions_sources ${build_instructions_dir}/AddressInstruction.cpp
${build_instructions_dir}/AssignmentInstruction.cpp
${build_instructions_dir}/CallInstruction.cpp
${build_instructions_dir}/ClassDirective.cpp
${build_instructions_dir}/CommandInstruction.cpp
${build_instructions_dir}/DoBlock.cpp
${build_instructions_dir}/DoInstruction.cpp
${build_instructions_dir}/DropInstruction.cpp
${build_instructions_dir}/ElseInstruction.cpp
${build_instructions_dir}/EndIf.cpp
${build_instructions_dir}/EndInstruction.cpp
${build_instructions_dir}/ExitInstruction.cpp
${build_instructions_dir}/ExposeInstruction.cpp
${build_instructions_dir}/ForwardInstruction.cpp
${build_instructions_dir}/GuardInstruction.cpp
${build_instructions_dir}/IfInstruction.cpp
${build_instructions_dir}/InterpretInstruction.cpp
${build_instructions_dir}/LabelInstruction.cpp
${build_instructions_dir}/LeaveInstruction.cpp
${build_instructions_dir}/LibraryDirective.cpp
${build_instructions_dir}/MessageInstruction.cpp
${build_instructions_dir}/NopInstruction.cpp
${build_instructions_dir}/NumericInstruction.cpp
${build_instructions_dir}/OptionsInstruction.cpp
${build_instructions_dir}/OtherwiseInstruction.cpp
${build_instructions_dir}/ParseInstruction.cpp
${build_instructions_dir}/ParseTarget.cpp
${build_instructions_dir}/ParseTrigger.cpp
${build_instructions_dir}/ProcedureInstruction.cpp
${build_instructions_dir}/QueueInstruction.cpp
${build_instructions_dir}/RaiseInstruction.cpp
${build_instructions_dir}/ReplyInstruction.cpp
${build_instructions_dir}/RequiresDirective.cpp
${build_instructions_dir}/ReturnInstruction.cpp
${build_instructions_dir}/RexxInstruction.cpp
${build_instructions_dir}/SayInstruction.cpp
${build_instructions_dir}/SelectInstruction.cpp
${build_instructions_dir}/SignalInstruction.cpp
${build_instructions_dir}/ThenInstruction.cpp
${build_instructions_dir}/TraceInstruction.cpp
${build_instructions_dir}/UseStrictInstruction.cpp)
set (parser_sources ${build_parser_dir}/Clause.cpp
${build_parser_dir}/KeywordConstants.cpp
${build_parser_dir}/InstructionParser.cpp
${build_parser_dir}/Scanner.cpp
${build_parser_dir}/SourceFile.cpp
${build_parser_dir}/Token.cpp)
set (platform_sources ${build_interpreter_platform_dir}/ErrorMessages.cpp
${build_interpreter_platform_dir}/ExternalFunctions.cpp
${build_interpreter_platform_dir}/FileSystem.cpp
${build_interpreter_platform_dir}/MemorySupport.cpp
${build_interpreter_platform_dir}/MiscSystem.cpp
${build_interpreter_platform_dir}/SysActivity.cpp
${build_interpreter_platform_dir}/SysFileSystem.cpp
${build_interpreter_platform_dir}/SysInterpreterInstance.cpp
${build_interpreter_platform_dir}/SystemCommands.cpp
${build_interpreter_platform_dir}/SystemInitialization.cpp
${build_interpreter_platform_dir}/SystemInterpreter.cpp
${build_interpreter_platform_dir}/TimeSupport.cpp
${build_interpreter_platform_dir}/UseridFunction.cpp
${build_interpreter_platform_dir}/ValueFunction.cpp)
set (common_sources ${build_common_dir}/Utilities.cpp
${build_common_platform_dir}/SysFile.cpp
${build_common_platform_dir}/SysLibrary.cpp
${build_common_platform_dir}/SysSemaphore.cpp
${build_common_platform_dir}/SysThread.cpp)
set (runtime_sources ${build_runtime_dir}/GlobalData.cpp
${build_runtime_dir}/GlobalNames.cpp
${build_runtime_dir}/InternalPackage.cpp
${build_runtime_dir}/Interpreter.cpp
${build_runtime_dir}/InterpreterInstance.cpp
${build_runtime_dir}/Numerics.cpp
${build_runtime_dir}/RexxMisc.cpp
${build_runtime_dir}/Version.cpp)
set (streamlibrary_sources ${build_streamlibrary_dir}/StreamCommandParser.cpp
${build_streamlibrary_dir}/StreamNative.cpp
${build_streamlibrary_dir}/FileNative.cpp)
# Full set of files used in all platforms.
set (common_interpreter_sources ${classes_sources}
${classes_support_sources}
${interpreter_api_sources}
${behaviour_sources}
${execution_sources}
${memory_sources}
${package_sources}
${concurrency_sources}
${expression_sources}
${instructions_sources}
${parser_sources}
${platform_sources}
${common_sources}
${runtime_sources}
${streamlibrary_sources})
# additional source files required by specific platforms
if (WIN32)
set (platform_interpreter_sources ${build_interpreter_platform_dir}/rexx.def
${build_interpreter_platform_dir}/winmsgtb.rc)
set (platform_interpreter_libs comctl32)
else ()
set (platform_interpreter_sources ${build_interpreter_platform_dir}/RexxMain.cpp)
set (platform_rexx_libs ${ORX_SYSLIB_DL} ${ORX_SYSLIB_PTHREAD})
endif ()
# Library definition
add_library(rexx SHARED
${common_interpreter_sources}
${platform_interpreter_sources})
set (core_platform_classes ${build_interpreter_platform_dir}/PlatformObjects.orx)
# Include file definition
target_include_directories(rexx PUBLIC
${build_lib_dir}
${build_api_dir}
${build_api_platform_dir}
${build_common_dir}
${build_common_platform_dir}
${build_interpreter_dir}
${build_behaviour_dir}
${build_execution_dir}
${build_memory_dir}
${build_package_dir}
${build_concurrency_dir}
${build_expression_dir}
${build_instructions_dir}
${build_classes_dir}
${build_classes_support_dir}
${build_runtime_dir}
${build_parser_dir}
${build_messages_dir}
${build_streamlibrary_dir}
${build_interpreter_common_dir}
${build_interpreter_platform_dir})
# Extra link library definitions
target_link_libraries(rexx rexxapi ${platform_interpreter_libs})
install(TARGETS rexx RUNTIME DESTINATION ${INSTALL_LIB_DIR} COMPONENT Core
LIBRARY DESTINATION ${INSTALL_LIB_DIR} COMPONENT Core
ARCHIVE DESTINATION ${INSTALL_INCLUDE_DIR} COMPONENT DevLib)
set_target_properties(rexx PROPERTIES VERSION ${ORX_VERSION})
#################### rexx (executable) ##########################
# additional source files required by specific platforms
if (WIN32)
set (platform_rexx_exe_sources
${build_platform_dir}/rexx.rc)
else ()
set (platform_rexx_exe_libs ${ORX_SYSLIB_DL} ${ORX_SYSLIB_PTHREAD})
endif ()
# Sources for rexx. Note, the target must not be rexx, since we already
# have a rexx library target
add_executable(rexx_exe ${build_utilities_rexx_dir}/rexx.cpp
${platform_rexx_exe_sources})
# This allows the executable to have the same name as the library.
SET_TARGET_PROPERTIES(rexx_exe
PROPERTIES OUTPUT_NAME rexx)
# Include file definition
target_include_directories(rexx_exe PUBLIC
${build_lib_dir}
${build_api_dir}
${build_api_platform_dir}
${build_messages_dir})
# Extra link library definitions
target_link_libraries(rexx_exe rexx rexxapi ${platform_rexx_exe_libs})
# Merge in extra manifest information on Windows
if (WIN32)
add_custom_command(TARGET rexx_exe POST_BUILD
COMMAND "mt.exe" -manifest \"${EXE_MANIFEST_FILE}\" "-inputresource:bin\\rexx.exe;#1" "-outputresource:bin\\rexx.exe;#1"
COMMENT "Adding custom manifest to rexx.exe...")
endif ()
install(TARGETS rexx_exe RUNTIME COMPONENT Core DESTINATION ${INSTALL_EXECUTABLE_DIR}
LIBRARY DESTINATION ${INSTALL_LIB_DIR} COMPONENT Core)
#################### rexximage (bin file) ##########################
# These are the core classes built into the .img file.
set (core_classes ${build_rexx_classes_dir}/CoreClasses.orx
${build_rexx_classes_dir}/StreamClasses.orx
${build_rexx_classes_dir}/Serializable.orx)
# additional source files required by specific platforms
if (WIN32)
set (platform_rexximage_sources
${build_platform_dir}/rexx.rc)
endif ()
# Sources for rexximg
add_executable(rexximage ${build_utilities_rexximage_dir}/rexximage.cpp
${core_classes}
${platform_rexximage_sources})
# Include file definition
target_include_directories(rexximage PUBLIC
${build_lib_dir}
${build_api_dir}
${build_api_platform_dir})
# Extra link library definitions
target_link_libraries(rexximage rexx rexxapi ${platform_rexximg_libs})
# handy macro for copying files from the source into the build directory.
macro (copy_build_file name source)
ADD_CUSTOM_COMMAND(
OUTPUT ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${name}
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/${source}/${name} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${name}
DEPENDS ${source}/${name}
)
endmacro (copy_build_file)
# Copy the class files to the build directory
copy_build_file(CoreClasses.orx ${build_rexx_classes_dir})
copy_build_file(StreamClasses.orx ${build_rexx_classes_dir})
copy_build_file(Serializable.orx ${build_rexx_classes_dir})
copy_build_file(PlatformObjects.orx ${build_interpreter_platform_dir})
# These are the portable class files the image requires
set (image_class_files
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/CoreClasses.orx
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/StreamClasses.orx
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/Serializable.orx
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/PlatformObjects.orx)
# On Windows, the ole support is also included in the image
if (WIN32)
copy_build_file(orexxole.cls ${build_extensions_ole_dir})
set (platform_rexx_img_depends orexxole
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/orexxole.cls)
endif ()
# Build the rexx.img file
add_custom_command(OUTPUT ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/rexx.img
COMMAND $<TARGET_FILE:rexximage>
DEPENDS rexximage rxapi rexxutil ${image_class_files} ${platform_rexx_img_depends}
WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
add_custom_target(rexx_img ALL DEPENDS ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/rexx.img)
install(FILES ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/rexx.img COMPONENT Core DESTINATION ${INSTALL_EXECUTABLE_DIR} PERMISSIONS OWNER_EXECUTE GROUP_EXECUTE WORLD_EXECUTE OWNER_READ GROUP_READ WORLD_READ)
#################### rxapi (executable) #########################
# additional source files required by specific platforms
if (WIN32)
set (platform_rxapi_sources
${build_rexxapi_server_platform_dir}/APIService.cpp
${build_rexxapi_server_platform_dir}/rxapi.rc
${build_rexxapi_server_platform_dir}/rxapi.ico)
set (rxapi_executable_type WIN32)
set (platform_rxapi_libs wsock32 shlwapi)
else ()
set (platform_rxapi_sources
${build_rexxapi_server_platform_dir}/linux/APIService.cpp)
set (platform_rxapi_libs ${ORX_SYSLIB_DL} ${ORX_SYSLIB_PTHREAD})
endif ()
# Sources for rxapi
add_executable(rxapi ${rxapi_executable_type}
${build_rexxapi_server_dir}/APIServer.cpp
${build_rexxapi_server_dir}/APIServerInstance.cpp
${build_rexxapi_server_dir}/APIServerThread.cpp
${build_rexxapi_server_dir}/MacroSpaceManager.cpp
${build_rexxapi_server_dir}/QueueManager.cpp
${build_rexxapi_server_dir}/RegistrationManager.cpp
${build_rexxapi_common_dir}/RegistrationTable.cpp
${build_rexxapi_common_dir}/ServiceMessage.cpp
${build_rexxapi_common_platform_dir}/SysAPIManager.cpp
${build_rexxapi_common_platform_dir}/SysCSStream.cpp
${build_rexxapi_common_platform_dir}/SysProcess.cpp
${build_common_dir}/Utilities.cpp
${build_common_platform_dir}/SysSemaphore.cpp
${build_common_platform_dir}/SysThread.cpp
${platform_rxapi_sources})
# Include file definition
target_include_directories(rxapi PUBLIC
${build_rexxapi_server_dir})
# Extra link library definitions
target_link_libraries(rxapi rexx rexxapi ${platform_rxapi_libs})
# Kill the rxapi daemon whenever we have to build, otherwise the build
# will fail. Unfortunately, the killing of the process is not immediate,
# so we attach this as a dependency to multiple early pieces of the project
# to give it a chance to free up the file.
if (WIN32)
add_custom_target(kill_rexxapi
${CMAKE_SOURCE_DIR}/${ORX_PLATFORM_DIR}/killapi.bat
COMMENT "Killing rxapi daemon...")
# add this as a dependency for major bits to give it a chance to
# execute early.
add_dependencies(rexx kill_rexxapi)
add_dependencies(rexxapi kill_rexxapi)
add_dependencies(rxapi kill_rexxapi)
endif ()
install(TARGETS rxapi RUNTIME COMPONENT Core DESTINATION ${INSTALL_EXECUTABLE_DIR})
#################### rexxc (executable) #########################
# additional source files required by specific platforms
if (WIN32)
set (platform_rexxc_sources
${build_platform_dir}/rexx.rc)
else ()
set (platform_rexxc_libs ${ORX_SYSLIB_DL} ${ORX_SYSLIB_PTHREAD})
endif ()
# Sources for rexxc
add_executable(rexxc ${build_utilities_rexxc_dir}/RexxCompiler.cpp
${platform_rexxc_sources})
# Include file definition
target_include_directories(rexxc PUBLIC
${build_lib_dir}
${build_api_dir}
${build_api_platform_dir}
${build_messages_dir})
# Extra link library definitions
target_link_libraries(rexxc rexx rexxapi ${platform_rexxc_libs})
install(TARGETS rexxc RUNTIME COMPONENT Core DESTINATION ${INSTALL_EXECUTABLE_DIR})
#################### rxqueue (executable) #########################
# additional source files required by specific platforms
if (WIN32)
set (platform_rxqueue_sources
${build_platform_dir}/verinfo.rc)
else ()
set (platform_rxqueue_libs ${ORX_SYSLIB_DL} ${ORX_SYSLIB_PTHREAD})
endif ()
# Sources for rxqueue
add_executable(rxqueue ${build_utilities_rxqueue_dir}/rxqueue.cpp
${platform_rxqueue_sources})
# Include file definition
target_include_directories(rxqueue PUBLIC
${build_lib_dir}
${build_api_dir}
${build_api_platform_dir}
${build_interpreter_platform_dir}
${build_messages_dir})
# Extra link library definitions
target_link_libraries(rxqueue rexx rexxapi ${platform_rxqueue_libs})
install(TARGETS rxqueue RUNTIME COMPONENT Core DESTINATION ${INSTALL_EXECUTABLE_DIR})
#################### rxsubcom (executable) #########################
# additional source files required by specific platforms
if (WIN32)
set (platform_subcom_sources
${build_platform_dir}/verinfo.rc)
else ()
set (platform_subcom_libs ${ORX_SYSLIB_DL} ${ORX_SYSLIB_PTHREAD})
endif ()
# Sources for rxsubcom
add_executable(rxsubcom ${build_utilities_rxsubcom_dir}/rxsubcom.cpp
${platform_subcom_sources})
# Include file definition
target_include_directories(rxsubcom PUBLIC
${build_lib_dir}
${build_api_dir}
${build_api_platform_dir}
${build_interpreter_platform_dir}
${build_messages_dir})
# Extra link library definitions
target_link_libraries(rxsubcom rexx rexxapi ${platform_subcom_libs})
install(TARGETS rxsubcom RUNTIME COMPONENT Core DESTINATION ${INSTALL_EXECUTABLE_DIR})
#################### librexxutil.so ################
# additional source files required by specific platforms
if (WIN32)
set (platform_rexxutil_sources
${build_extensions_rexxutil_platform_dir}/rexxutil.def
${build_platform_dir}/verinfo.rc)
set (platform_rexxutil_libs shlwapi)
else ()
set (platform_rexxutil_libs ${ORX_SYSLIB_DL} ${ORX_SYSLIB_PTHREAD})
endif ()
# Sources for librexxutil.so
add_library(rexxutil SHARED ${build_extensions_rexxutil_platform_dir}/rexxutil.cpp
${platform_rexxutil_sources})
# Include file definition
target_include_directories(rexxutil PUBLIC
${build_lib_dir}
${build_api_dir}
${build_api_platform_dir}
${build_messages_dir})
# Extra link library definitions
target_link_libraries(rexxutil rexx rexxapi ${platform_rexxutil_libs})
install(TARGETS rexxutil RUNTIME COMPONENT Core DESTINATION ${INSTALL_LIB_DIR}
LIBRARY DESTINATION ${INSTALL_LIB_DIR} COMPONENT Core)
set_target_properties(rexxutil PROPERTIES VERSION ${ORX_VERSION})
#################### librxmath.so ################
# additional source files required by specific platforms
if (WIN32)
set (platform_rxmath_sources
${build_platform_dir}/rxmath.def
${build_platform_dir}/verinfo.rc)
endif ()
# Sources for librxmath.so
add_library(rxmath SHARED ${build_extensions_rxmath_dir}/rxmath.cpp
${platform_rxmath_sources})
# Include file definition
target_include_directories(rxmath PUBLIC
${build_lib_dir}
${build_api_dir}
${build_api_platform_dir})
# Extra link library definitions
target_link_libraries(rxmath rexx rexxapi ${platform_rxmath_libs})
install(TARGETS rxmath RUNTIME COMPONENT Core DESTINATION ${INSTALL_LIB_DIR}
LIBRARY DESTINATION ${INSTALL_LIB_DIR} COMPONENT Core)
set_target_properties(rxmath PROPERTIES VERSION ${ORX_VERSION})
#################### librxsock.so ################
# additional source files required by specific platforms
if (WIN32)
set (platform_rxsock_sources
${build_platform_dir}/rxsock.def
${build_platform_dir}/verinfo.rc)
endif ()
# Sources for librxsock.so
add_library(rxsock SHARED ${build_extensions_rxsock_dir}/rxsock.cpp
${build_extensions_rxsock_dir}/rxsockfn.cpp
${platform_rxsock_sources})
# Extra link library definitions
target_link_libraries(rxsock rexx rexxapi ${platform_rxsock_libs})
install(TARGETS rxsock RUNTIME COMPONENT Core DESTINATION ${INSTALL_LIB_DIR}
LIBRARY DESTINATION ${INSTALL_LIB_DIR} COMPONENT Core)
set_target_properties(rxsock PROPERTIES VERSION ${ORX_VERSION})
#################### librxregexp.so ################
# additional source files required by specific platforms
if (WIN32)
set (platform_rxregexp_sources
${build_platform_dir}/rxrexexp.def
${build_platform_dir}/verinfo.rc)
endif ()
# Sources for librxregexp.so
add_library(rxregexp SHARED ${build_extensions_rxregexp_dir}/automaton.cpp
${build_extensions_rxregexp_dir}/dblqueue.cpp
${build_extensions_rxregexp_dir}/rxregexp.cpp
${platform_rxrexexp_sources})
# Include file definition
target_include_directories(rxregexp PUBLIC
${build_lib_dir}
${build_api_dir}
${build_api_platform_dir}
${build_messages_dir})
# Extra link library definitions
target_link_libraries(rxregexp rexx rexxapi ${platform_rxregexp_libs})
install(TARGETS rxregexp RUNTIME COMPONENT Core DESTINATION ${INSTALL_LIB_DIR}
LIBRARY DESTINATION ${INSTALL_LIB_DIR} COMPONENT Core)
set_target_properties(rxregexp PROPERTIES VERSION ${ORX_VERSION})
#################### libhostemu.so ################
# additional source files required by specific platforms
if (WIN32)
set (platform_hostemu_sources
${build_platform_dir}/hostemu.def
${build_platform_dir}/verinfo.rc)
else ()
set (platform_hostemu_libs ${ORX_SYSLIB_DL} ${ORX_SYSLIB_PTHREAD})
endif ()
# Sources for libhostemu.so
# Note that we ignore the dependency on hostemu.ypp for now.
add_library(hostemu SHARED ${build_extensions_hostemu_platform_dir}/hostemu.cpp
${build_extensions_hostemu_dir}/cmdparse.cpp
${platform_hostemu_sources})
# Include file definition
target_include_directories(hostemu PUBLIC
${build_api_dir}
${build_api_platform_dir}
${build_extensions_hostemu_dir})
# Extra link library definitions
target_link_libraries(hostemu rexx rexxapi ${platform_hostemu_libs})
install(TARGETS hostemu RUNTIME COMPONENT Core DESTINATION ${INSTALL_LIB_DIR}
LIBRARY DESTINATION ${INSTALL_LIB_DIR} COMPONENT Core)
set_target_properties(hostemu PROPERTIES VERSION ${ORX_VERSION})
#################### librxunixsys.so ################
if (NOT WIN32)
# Sources for librxunixsys.so
add_library(rxunixsys SHARED ${build_extensions_platform_dir}/rxunixsys/rxunixsys.cpp)
# Include file definition
target_include_directories(rxunixsys PUBLIC
${build_api_dir}
${build_api_platform_dir}
${extensions_unix_dir}/rxunixsys)
# Extra link library definitions
target_link_libraries(rxunixsys rexx rexxapi)
set_target_properties(rxunixsys PROPERTIES VERSION ${ORX_VERSION})
install(TARGETS rxunixsys RUNTIME DESTINATION ${INSTALL_LIB_DIR}
LIBRARY DESTINATION ${INSTALL_LIB_DIR} COMPONENT Core)
endif ()
#################### orexxole.dll ################
if (WIN32)
# Sources for orexxole.dll
add_library(orexxole SHARED ${build_extensions_ole_dir}/orexxole.cpp
${build_extensions_ole_dir}/OLEVariant.cpp
${build_extensions_ole_dir}/events.cpp
${build_extensions_ole_dir}/orexxole.def
${build_platform_dir}/verinfo.rc)
# Include file definition
target_include_directories(orexxole PUBLIC
${build_extensions_ole_dir})
# Extra link library definitions
target_link_libraries(orexxole rexx rexxapi)
install(TARGETS orexxole RUNTIME COMPONENT Core DESTINATION ${INSTALL_LIB_DIR})
endif ()
#################### rxwinsys.dll ################
if (WIN32)
# Sources for rxwinwys.dll
add_library(rxwinsys SHARED ${build_extensions_rxwinsys_dir}/rxwinsys.cpp
${build_extensions_rxwinsys_dir}/rxwinsys.def
${build_platform_dir}/verinfo.rc
${build_extensions_rxwinsys_dir}/winsystm.cls)
# Include file definition
target_include_directories(rxwinsys PUBLIC
${build_extensions_rxwinsys_dir})
# Extra link library definitions
target_link_libraries(rxwinsys rexx rexxapi shlwapi)
install(TARGETS rxwinsys RUNTIME COMPONENT Core DESTINATION ${INSTALL_LIB_DIR})
endif ()
#################### oodialog.dll ################
if (WIN32)
set (OOD_MAJOR 4)
set (OOD_MINOR 2)
set (OOD_MOD_LVL 3)
set (OOD_BLD_LVL 9606)
set (OOD_VER_STR "4.2.3.9606")
set (OOD_COPY_YEAR "2005-2013")
set (OOD_SVN_REVSION 9150)
# Sources for oodialog.dll
add_library(oodialog SHARED
${build_extensions_oodialog_dir}/APICommon.cpp
${build_extensions_oodialog_dir}/oodBarControls.cpp
${build_extensions_oodialog_dir}/oodBaseDialog.cpp
${build_extensions_oodialog_dir}/oodBasicControls.cpp
${build_extensions_oodialog_dir}/oodCommon.cpp
${build_extensions_oodialog_dir}/oodControl.cpp
${build_extensions_oodialog_dir}/oodData.cpp
${build_extensions_oodialog_dir}/oodDeviceGraphics.cpp
${build_extensions_oodialog_dir}/ooDialog.cpp
${build_extensions_oodialog_dir}/oodKeyboard.cpp
${build_extensions_oodialog_dir}/oodListView.cpp
${build_extensions_oodialog_dir}/oodMenu.cpp
${build_extensions_oodialog_dir}/oodMessaging.cpp
${build_extensions_oodialog_dir}/oodMouse.cpp
${build_extensions_oodialog_dir}/oodPackageEntry.cpp
${build_extensions_oodialog_dir}/oodPropertySheetDialog.cpp
${build_extensions_oodialog_dir}/oodResizableDialog.cpp
${build_extensions_oodialog_dir}/oodResources.cpp
${build_extensions_oodialog_dir}/oodRoutines.cpp
${build_extensions_oodialog_dir}/oodShared.cpp
${build_extensions_oodialog_dir}/oodShellObjects.cpp
${build_extensions_oodialog_dir}/oodToolTip.cpp
${build_extensions_oodialog_dir}/oodTreeView.cpp
${build_extensions_oodialog_dir}/oodUser.cpp
${build_extensions_oodialog_dir}/oodUtilities.cpp
${build_extensions_oodialog_dir}/oodViewControls.cpp
${build_extensions_oodialog_dir}/ooDialog.def
${build_extensions_oodialog_dir}/ooDialog.rc)
# Override the compile definitions with ooDialog-exclusive defines
set_property(TARGET oodialog
PROPERTY COMPILE_DEFINITIONS
OOD_VER=${OOD_MAJOR}
OOD_REL=${OOD_MINOR}
OOD_MOD=${OOD_MOD_LVL}
OOD_BLD=${OOD_BLD_LVL}
OOD_COPY_YEAR=${OOD_COPY_YEAR}
OOD_VER_STR="ooDialog ${OOD_MAJOR}.${OOD_MINOR}.${OOD_MOD_LVL}.${OOD_BLD_LVL}"
OOD_BIN_NAME="oodialog.dll")
# Include file definition
target_include_directories(oodialog PUBLIC
${build_extensions_oodialog_dir})
# Extra link library definitions
target_link_libraries(oodialog rexx rexxapi winmm comdlg32 comctl32 shlwapi oleacc uxtheme rpcrt4 propsys delayimp)
install(TARGETS oodialog RUNTIME COMPONENT Core DESTINATION ${INSTALL_LIB_DIR})
#################### ooDialog.exe (executable) ##########################
# Sources for ooDialog.exe
add_executable(oodialog_exe WIN32 ${build_extensions_oodialog_dir}/oodWinMain.cpp
${build_extensions_oodialog_dir}/oodShared.cpp
${build_extensions_oodialog_dir}/ooDialogWinMain.rc)
set_property(TARGET oodialog_exe
PROPERTY COMPILE_DEFINITIONS
OOD_VER=${OOD_MAJOR}
OOD_REL=${OOD_MINOR}
OOD_MOD=${OOD_MOD_LVL}
OOD_BLD=${OOD_BLD_LVL}
OOD_COPY_YEAR=${OOD_COPY_YEAR}
OOD_VER_STR="ooDialog ${OOD_MAJOR}.${OOD_MINOR}.${OOD_MOD_LVL}.${OOD_BLD_LVL}"
OOD_BIN_NAME="oodialog.exe")
# This allows the executable to have the same name as the library.
SET_TARGET_PROPERTIES(oodialog_exe PROPERTIES OUTPUT_NAME ooDialog)
# Include file definition
target_include_directories(oodialog_exe PUBLIC
${build_extensions_oodialog_dir})
target_link_libraries(oodialog_exe rexx rexxapi shlwapi)
add_custom_command(TARGET oodialog_exe POST_BUILD
COMMAND "mt.exe" -manifest \"${EXE_MANIFEST_FILE}\" "-inputresource:bin\\ooDialog.exe;#1" "-outputresource:bin\\ooDialog.exe;#1"
COMMENT "Adding custom manifest to ooDialog.exe...")
install(TARGETS oodialog_exe RUNTIME COMPONENT Core DESTINATION ${INSTALL_EXECUTABLE_DIR})
#################### ooDialog.com (executable) ##########################
# Sources for ooDialog.com
add_executable(oodialog_com ${build_extensions_oodialog_dir}/oodMain.cpp
${build_extensions_oodialog_dir}/oodShared.cpp
${build_extensions_oodialog_dir}/ooDialogMain.rc)
set_property(TARGET oodialog_com
PROPERTY COMPILE_DEFINITIONS
OOD_VER=${OOD_MAJOR}
OOD_REL=${OOD_MINOR}
OOD_MOD=${OOD_MOD_LVL}
OOD_BLD=${OOD_BLD_LVL}
OOD_COPY_YEAR=${OOD_COPY_YEAR}
OOD_VER_STR="ooDialog ${OOD_MAJOR}.${OOD_MINOR}.${OOD_MOD_LVL}.${OOD_BLD_LVL}"
OOD_BIN_NAME="oodialog.com")
# This allows the executable to have the same name as the library.
SET_TARGET_PROPERTIES(oodialog_com PROPERTIES OUTPUT_NAME ooDialog)
SET_TARGET_PROPERTIES(oodialog_com PROPERTIES SUFFIX .com)
# Include file definition
target_include_directories(oodialog_com PUBLIC
${build_extensions_oodialog_dir})
target_link_libraries(oodialog_com rexx rexxapi shell32 Advapi32)
add_custom_command(TARGET oodialog_com POST_BUILD
COMMAND "mt.exe" -manifest \"${EXE_MANIFEST_FILE}\" "-inputresource:bin\\ooDialog.com;#1" "-outputresource:bin\\ooDialog.com;#1"
COMMENT "Adding custom manifest to ooDialog.com...")
install(TARGETS oodialog_com RUNTIME COMPONENT Core DESTINATION ${INSTALL_EXECUTABLE_DIR})
# Generate the oodialog .cls files used for the ::requires. These are generated from
# from a set of individual source files
set (oodialog_source_classFiles
${build_extensions_oodialog_dir}/UtilityClasses.cls
${build_extensions_oodialog_dir}/AnimatedButton.cls
${build_extensions_oodialog_dir}/BaseDialog.cls
${build_extensions_oodialog_dir}/ControlDialog.cls
${build_extensions_oodialog_dir}/DialogControls.cls
${build_extensions_oodialog_dir}/ListView.cls
${build_extensions_oodialog_dir}/TreeView.cls
${build_extensions_oodialog_dir}/ToolTip.cls
${build_extensions_oodialog_dir}/DialogExtensions.cls
${build_extensions_oodialog_dir}/DynamicDialog.cls
${build_extensions_oodialog_dir}/EventNotification.cls
${build_extensions_oodialog_dir}/PlainBaseDialog.cls
${build_extensions_oodialog_dir}/RcDialog.cls
${build_extensions_oodialog_dir}/Menu.cls
${build_extensions_oodialog_dir}/ResDialog.cls
${build_extensions_oodialog_dir}/UserDialog.cls
${build_extensions_oodialog_dir}/DeprecatedClasses.cls
${build_extensions_oodialog_dir}/ShellObjects.cls)
# We run a rexx program to generate these files, so we need to have the interpreter
# fully built first. The files are generated into the output directory.
add_custom_command(OUTPUT ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/oodPlain.cls ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/oodWin32.cls ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ooDialog.cls
COMMAND $<TARGET_FILE:rexx_exe> build_ooDialog_cls.rex ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
DEPENDS rexx_exe rexx_img ${build_extensions_oodialog_dir}/build_ooDialog_cls.rex ${oodialog_source_classfiles}
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/${build_extensions_oodialog_dir})
add_custom_target(oodialog_cls ALL DEPENDS ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/oodPlain.cls ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/oodWin32.cls ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ooDialog.cls)
install(FILES ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/oodPlain.cls COMPONENT Core DESTINATION ${INSTALL_EXECUTABLE_DIR} PERMISSIONS OWNER_READ GROUP_READ WORLD_READ)
install(FILES ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/oodWin32.cls COMPONENT Core DESTINATION ${INSTALL_EXECUTABLE_DIR} PERMISSIONS OWNER_READ GROUP_READ WORLD_READ)
install(FILES ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ooDialog.cls COMPONENT Core DESTINATION ${INSTALL_EXECUTABLE_DIR} PERMISSIONS OWNER_READ GROUP_READ WORLD_READ)
endif ()
#################### rexxhide (executable) ##########################
if (WIN32)
# Sources for rexxhide.
add_executable(rexxhide WIN32 ${build_utilities_rexxhide_dir}/rexxhide.cpp
${build_platform_dir}/rexx.rc)
# Include file definition
target_include_directories(rexxhide PUBLIC
${build_lib_dir}
${build_api_dir}
${build_api_platform_dir}
${build_messages_dir})
target_link_libraries(rexxhide rexx rexxapi)
add_custom_command(TARGET rexxhide POST_BUILD
COMMAND "mt.exe" -manifest \"${EXE_MANIFEST_FILE}\" "-inputresource:bin\\rexxhide.exe;#1" "-outputresource:bin\\rexxhide.exe;#1"
COMMENT "Adding custom manifest to rexxhide.exe...")
install(TARGETS rexxhide RUNTIME COMPONENT Core DESTINATION ${INSTALL_EXECUTABLE_DIR})
endif ()
#################### rexxpaws (executable) ##########################
if (WIN32)
# Sources for rexxpaws.
add_executable(rexxpaws ${build_utilities_rexxpaws_dir}/rexxpaws.cpp
${build_platform_dir}/rexx.rc)
# Include file definition
target_include_directories(rexxhide PUBLIC
${build_lib_dir}
${build_api_dir}
${build_api_platform_dir}
${build_messages_dir})
target_link_libraries(rexxpaws rexx rexxapi)
add_custom_command(TARGET rexxpaws POST_BUILD
COMMAND "mt.exe" -manifest \"${EXE_MANIFEST_FILE}\" "-inputresource:bin\\rexxpaws.exe;#1" "-outputresource:bin\\rexxpaws.exe;#1"
COMMENT "Adding custom manifest to rexxpaws.exe...")
install(TARGETS rexxpaws RUNTIME COMPONENT Core DESTINATION ${INSTALL_EXECUTABLE_DIR})
endif ()
#################### misc files ##########################
# These artifacts apply to all platforms
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${build_extensions_rxregexp_dir}/rxregexp.cls COMPONENT Core DESTINATION ${INSTALL_CLS_DIR} PERMISSIONS OWNER_READ GROUP_READ WORLD_READ)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${build_extensions_rxftp_dir}/rxftp.cls COMPONENT Core DESTINATION ${INSTALL_CLS_DIR} PERMISSIONS OWNER_READ GROUP_READ WORLD_READ)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${build_extensions_csvstream_dir}/csvStream.cls COMPONENT Core DESTINATION ${INSTALL_CLS_DIR} PERMISSIONS OWNER_READ GROUP_READ WORLD_READ)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${build_extensions_rxsock_dir}/socket.cls COMPONENT Core DESTINATION ${INSTALL_CLS_DIR} PERMISSIONS OWNER_READ GROUP_READ WORLD_READ)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${build_extensions_rxsock_dir}/streamsocket.cls COMPONENT Core DESTINATION ${INSTALL_CLS_DIR} PERMISSIONS OWNER_READ GROUP_READ WORLD_READ)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${build_extensions_rxsock_dir}/mime.cls COMPONENT Core DESTINATION ${INSTALL_CLS_DIR} PERMISSIONS OWNER_READ GROUP_READ WORLD_READ)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${build_extensions_rxsock_dir}/smtp.cls COMPONENT Core DESTINATION ${INSTALL_CLS_DIR} PERMISSIONS OWNER_READ GROUP_READ WORLD_READ)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${build_api_dir}/rexx.h COMPONENT DevLib DESTINATION ${INSTALL_INCLUDE_DIR} PERMISSIONS OWNER_READ GROUP_READ WORLD_READ)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${build_api_dir}/rexxapidefs.h COMPONENT DevLib DESTINATION ${INSTALL_INCLUDE_DIR} PERMISSIONS OWNER_READ GROUP_READ WORLD_READ)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${build_api_platform_dir}/rexxapitypes.h COMPONENT DevLib DESTINATION ${INSTALL_INCLUDE_DIR} PERMISSIONS OWNER_READ GROUP_READ WORLD_READ)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${build_api_platform_dir}/rexxplatformapis.h COMPONENT DevLib DESTINATION ${INSTALL_INCLUDE_DIR} PERMISSIONS OWNER_READ GROUP_READ WORLD_READ)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${build_api_platform_dir}/rexxplatformdefs.h COMPONENT DevLib DESTINATION ${INSTALL_INCLUDE_DIR} PERMISSIONS OWNER_READ GROUP_READ WORLD_READ)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${build_api_dir}/oorexxapi.h COMPONENT DevLib DESTINATION ${INSTALL_INCLUDE_DIR} PERMISSIONS OWNER_READ GROUP_READ WORLD_READ)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${build_api_dir}/oorexxerrors.h COMPONENT DevLib DESTINATION ${INSTALL_INCLUDE_DIR} PERMISSIONS OWNER_READ GROUP_READ WORLD_READ)
if (NOT WIN32)
install(FILES rexxapi/server/platform/unix/rxapid DESTINATION ${INSTALL_EXECUTABLE_DIR} PERMISSIONS OWNER_EXECUTE GROUP_EXECUTE WORLD_EXECUTE OWNER_READ GROUP_READ WORLD_READ)
add_custom_command(OUTPUT rexx.cat
COMMAND gencat rexx.cat ${CMAKE_CURRENT_SOURCE_DIR}/${build_messages_dir}/gencat.inp
DEPENDS ${image_class_files} ${platform_rexx_img_depends}
WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
add_custom_target(rexx_cat ALL DEPENDS rexx.cat)
install(FILES ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/rexx.cat DESTINATION ${CMAKE_INSTALL_PREFIX}/bin PERMISSIONS OWNER_READ GROUP_READ WORLD_READ)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${build_samples_dir}/rexxtry.rex DESTINATION ${CMAKE_INSTALL_PREFIX}/bin PERMISSIONS OWNER_EXECUTE GROUP_EXECUTE WORLD_EXECUTE OWNER_READ GROUP_READ WORLD_READ)
macro (add_manpage name cat)
add_custom_command(OUTPUT ${name}.${cat}.gz
COMMAND gzip -c
${CMAKE_CURRENT_SOURCE_DIR}/${build_platform_dir}/${name}.${cat}
> ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${name}.${cat}.gz
DEPENDS
${CMAKE_CURRENT_SOURCE_DIR}/${build_platform_dir}/${name}.${cat})
add_custom_target(${name}_man ALL DEPENDS ${name}.${cat}.gz)
install(FILES ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${name}.${cat}.gz
DESTINATION share/man/man${cat}
PERMISSIONS OWNER_READ GROUP_READ WORLD_READ)
endmacro (add_manpage)
# add_manpage (rexx 1)
# add_manpage (rexxc 1)
# add_manpage (rxqueue 1)
# add_manpage (rxsubcom 1)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${build_platform_dir}/rexx.sh DESTINATION ${CMAKE_INSTALL_PREFIX}/share/${CMAKE_PROJECT_NAME} PERMISSIONS OWNER_EXECUTE GROUP_EXECUTE WORLD_EXECUTE OWNER_READ GROUP_READ WORLD_READ)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${build_platform_dir}/rexx.csh DESTINATION ${CMAKE_INSTALL_PREFIX}/share/${CMAKE_PROJECT_NAME} PERMISSIONS OWNER_EXECUTE GROUP_EXECUTE WORLD_EXECUTE OWNER_READ GROUP_READ WORLD_READ)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${build_platform_dir}/rxapid.service DESTINATION ${CMAKE_INSTALL_PREFIX}/share/${CMAKE_PROJECT_NAME})
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${build_samples_dir}/ccreply.rex DESTINATION ${CMAKE_INSTALL_PREFIX}/share/${CMAKE_PROJECT_NAME} PERMISSIONS OWNER_EXECUTE GROUP_EXECUTE WORLD_EXECUTE OWNER_READ GROUP_READ WORLD_READ)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${build_samples_dir}/complex.rex DESTINATION ${CMAKE_INSTALL_PREFIX}/share/${CMAKE_PROJECT_NAME} PERMISSIONS OWNER_EXECUTE GROUP_EXECUTE WORLD_EXECUTE OWNER_READ GROUP_READ WORLD_READ)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${build_samples_dir}/factor.rex DESTINATION ${CMAKE_INSTALL_PREFIX}/share/${CMAKE_PROJECT_NAME} PERMISSIONS OWNER_EXECUTE GROUP_EXECUTE WORLD_EXECUTE OWNER_READ GROUP_READ WORLD_READ)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${build_samples_dir}/greply.rex DESTINATION ${CMAKE_INSTALL_PREFIX}/share/${CMAKE_PROJECT_NAME} PERMISSIONS OWNER_EXECUTE GROUP_EXECUTE WORLD_EXECUTE OWNER_READ GROUP_READ WORLD_READ)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${build_samples_dir}/guess.rex DESTINATION ${CMAKE_INSTALL_PREFIX}/share/${CMAKE_PROJECT_NAME} PERMISSIONS OWNER_EXECUTE GROUP_EXECUTE WORLD_EXECUTE OWNER_READ GROUP_READ WORLD_READ)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${build_samples_dir}/ktguard.rex DESTINATION ${CMAKE_INSTALL_PREFIX}/share/${CMAKE_PROJECT_NAME} PERMISSIONS OWNER_EXECUTE GROUP_EXECUTE WORLD_EXECUTE OWNER_READ GROUP_READ WORLD_READ)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${build_samples_dir}/month.rex DESTINATION ${CMAKE_INSTALL_PREFIX}/share/${CMAKE_PROJECT_NAME} PERMISSIONS OWNER_EXECUTE GROUP_EXECUTE WORLD_EXECUTE OWNER_READ GROUP_READ WORLD_READ)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${build_samples_dir}/philfork.rex DESTINATION ${CMAKE_INSTALL_PREFIX}/share/${CMAKE_PROJECT_NAME} PERMISSIONS OWNER_EXECUTE GROUP_EXECUTE WORLD_EXECUTE OWNER_READ GROUP_READ WORLD_READ)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${build_samples_dir}/pipe.rex DESTINATION ${CMAKE_INSTALL_PREFIX}/share/${CMAKE_PROJECT_NAME} PERMISSIONS OWNER_EXECUTE GROUP_EXECUTE WORLD_EXECUTE OWNER_READ GROUP_READ WORLD_READ)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${build_samples_dir}/properties.rex DESTINATION ${CMAKE_INSTALL_PREFIX}/share/${CMAKE_PROJECT_NAME} PERMISSIONS OWNER_EXECUTE GROUP_EXECUTE WORLD_EXECUTE OWNER_READ GROUP_READ WORLD_READ)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${build_samples_dir}/qdate.rex DESTINATION ${CMAKE_INSTALL_PREFIX}/share/${CMAKE_PROJECT_NAME} PERMISSIONS OWNER_EXECUTE GROUP_EXECUTE WORLD_EXECUTE OWNER_READ GROUP_READ WORLD_READ)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${build_samples_dir}/qtime.rex DESTINATION ${CMAKE_INSTALL_PREFIX}/share/${CMAKE_PROJECT_NAME} PERMISSIONS OWNER_EXECUTE GROUP_EXECUTE WORLD_EXECUTE OWNER_READ GROUP_READ WORLD_READ)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${build_samples_dir}/rexxcps.rex DESTINATION ${CMAKE_INSTALL_PREFIX}/share/${CMAKE_PROJECT_NAME} PERMISSIONS OWNER_EXECUTE GROUP_EXECUTE WORLD_EXECUTE OWNER_READ GROUP_READ WORLD_READ)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${build_samples_dir}/scclient.rex DESTINATION ${CMAKE_INSTALL_PREFIX}/share/${CMAKE_PROJECT_NAME} PERMISSIONS OWNER_EXECUTE GROUP_EXECUTE WORLD_EXECUTE OWNER_READ GROUP_READ WORLD_READ)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${build_samples_dir}/scserver.rex DESTINATION ${CMAKE_INSTALL_PREFIX}/share/${CMAKE_PROJECT_NAME} PERMISSIONS OWNER_EXECUTE GROUP_EXECUTE WORLD_EXECUTE OWNER_READ GROUP_READ WORLD_READ)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${build_samples_dir}/semcls.rex DESTINATION ${CMAKE_INSTALL_PREFIX}/share/${CMAKE_PROJECT_NAME} PERMISSIONS OWNER_EXECUTE GROUP_EXECUTE WORLD_EXECUTE OWNER_READ GROUP_READ WORLD_READ)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${build_samples_dir}/sfclient.rex DESTINATION ${CMAKE_INSTALL_PREFIX}/share/${CMAKE_PROJECT_NAME} PERMISSIONS OWNER_EXECUTE GROUP_EXECUTE WORLD_EXECUTE OWNER_READ GROUP_READ WORLD_READ)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${build_samples_dir}/sfserver.rex DESTINATION ${CMAKE_INSTALL_PREFIX}/share/${CMAKE_PROJECT_NAME} PERMISSIONS OWNER_EXECUTE GROUP_EXECUTE WORLD_EXECUTE OWNER_READ GROUP_READ WORLD_READ)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${build_samples_dir}/sscclient.rex DESTINATION ${CMAKE_INSTALL_PREFIX}/share/${CMAKE_PROJECT_NAME} PERMISSIONS OWNER_EXECUTE GROUP_EXECUTE WORLD_EXECUTE OWNER_READ GROUP_READ WORLD_READ)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${build_samples_dir}/stack.rex DESTINATION ${CMAKE_INSTALL_PREFIX}/share/${CMAKE_PROJECT_NAME} PERMISSIONS OWNER_EXECUTE GROUP_EXECUTE WORLD_EXECUTE OWNER_READ GROUP_READ WORLD_READ)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${build_samples_dir}/usecomp.rex DESTINATION ${CMAKE_INSTALL_PREFIX}/share/${CMAKE_PROJECT_NAME} PERMISSIONS OWNER_EXECUTE GROUP_EXECUTE WORLD_EXECUTE OWNER_READ GROUP_READ WORLD_READ)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${build_samples_dir}/usepipe.rex DESTINATION ${CMAKE_INSTALL_PREFIX}/share/${CMAKE_PROJECT_NAME} PERMISSIONS OWNER_EXECUTE GROUP_EXECUTE WORLD_EXECUTE OWNER_READ GROUP_READ WORLD_READ)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${build_samples_dir}/readme DESTINATION ${CMAKE_INSTALL_PREFIX}/share/${CMAKE_PROJECT_NAME} PERMISSIONS OWNER_EXECUTE GROUP_EXECUTE WORLD_EXECUTE OWNER_READ GROUP_READ WORLD_READ)
endif ()
# direct output into a samples subdir and only build on request
# add_subdirectory (samples samples EXCLUDE_FROM_ALL)
#################### NSIS Package Targets ##########################
#################### NSIS Package Targets ##########################
#################### NSIS Package Targets ##########################
#################### NSIS Package Targets ##########################
#################### NSIS Package Targets ##########################
# Build an NSIS installer
if (BUILD_NSIS)
set(CPACK_GENERATOR NSIS)
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "MyLib - CPack Component Installation Example")
set(CPACK_PACKAGE_INSTALL_DIRECTORY "Open Object Rexx")
SET(CPACK_NSIS_MODIFY_PATH ON)
endif ()
#################### Unix Package Targets ##########################
#################### Unix Package Targets ##########################
#################### Unix Package Targets ##########################
#################### Unix Package Targets ##########################
#################### Unix Package Targets ##########################
# Build an RPM
if (BUILD_RPM)
set(CPACK_GENERATOR RPM)
set(CPACK_RPM_PACKAGE_NAME ${CPACK_PACKAGE_NAME})
set(CPACK_PACKAGE_RELEASE 1)
set(CPACK_RPM_PACKAGE_LICENSE "CPL 1.0")
set(CPACK_RPM_PACKAGE_URL "http://www.oorexx.org/")
set(CPACK_PACKAGE_CONTACT "wdashley@sourceforge.net")
set(CPACK_PACKAGING_INSTALL_PREXIX "${CMAKE_INSTALL_PREFIX}")
set(CPACK_RPM_POST_INSTALL_SCRIPT_FILE ${CMAKE_SOURCE_DIR}/platform/unix/rpm_post.txt)
set(CPACK_RPM_PRE_UNINSTALL_SCRIPT_FILE ${CMAKE_SOURCE_DIR}/platform/unix/rpm_preun.txt)
if (${INSTALL_LIB_DIR} STREQUAL ${CMAKE_INSTALL_PREFIX}/lib64)
set(orx_install_arch "x86_64")
else ()
set(orx_install_arch "i386")
endif ()
set(CPACK_RPM_PACKAGE_ARCHITECTURE ${orx_install_arch})
if (DEFINED OS_DIST)
set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${ORX_MAJOR}.${ORX_MINOR}.${ORX_MOD_LVL}-${CPACK_PACKAGE_RELEASE}.${orx_install_arch}.${OS_DIST}")
else ()
set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${ORX_MAJOR}.${ORX_MINOR}.${ORX_MOD_LVL}-${CPACK_PACKAGE_RELEASE}.${orx_install_arch}")
endif ()
set(CPACK_RPM_PACKAGE_DESCRIPTION
"Open Object Rexx is an object-oriented scripting language. The language
is designed for both beginners and experienced Rexx programmers. It is
easy to learn and use, and provides an excellent vehicle to enter the
world of object-oriented programming without much effort.
It extends the procedural way of Rexx programming with object-oriented
features that allow you to gradually change your programming style as
you learn more about objects.
For more information on ooRexx, visit http://www.oorexx.org/
For more information on Rexx, visit http://www.rexxla.org/")
endif ()
# Build a DEB
if (BUILD_DEB)
set(CPACK_GENERATOR DEB)
set(CPACK_DEBIAN_PACKAGE_NAME ${CPACK_PACKAGE_NAME})
set(CPACK_PACKAGE_RELEASE 1)
set(CPACK_DEBIAN_PACKAGE_HOMEPAGE "http://www.oorexx.org/")
set(CPACK_PACKAGE_CONTACT "wdashley@sourceforge.net")
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "David Ashley <wdashley@sourceforge.net>")
set(CPACK_PACKAGING_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
# we need to copy these files so we can change the permissions
file(COPY ${CMAKE_SOURCE_DIR}/platform/unix/debian/cmake/postinst
DESTINATION ${CMAKE_BINARY_DIR}
FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ
GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
file(COPY ${CMAKE_SOURCE_DIR}/platform/unix/debian/cmake/prerm
DESTINATION ${CMAKE_BINARY_DIR}
FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ
GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA
"${CMAKE_BINARY_DIR}/postinst;${CMAKE_BINARY_DIR}/prerm;")
if (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86_64")
set(orx_install_arch "x86_64")
else ()
set(orx_install_arch "i386")
endif ()
if (DEFINED OS_DIST)
set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${ORX_MAJOR}.${ORX_MINOR}.${ORX_MOD_LVL}-${CPACK_PACKAGE_RELEASE}.${orx_install_arch}.${OS_DIST}")
else ()
set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${ORX_MAJOR}.${ORX_MINOR}.${ORX_MOD_LVL}-${CPACK_PACKAGE_RELEASE}.${orx_install_arch}")
endif ()
# The DEB generator does not support a multi-line description.
set(CPACK_DEBIAN_PACKAGE_DESCRIPTION "Open Object Rexx is an object-oriented scripting language.")
endif ()
# Do not move the following statement!! It must be the last statement in this file.
include(CPack)