forked from pilight/pilight
-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
786 lines (706 loc) · 30.3 KB
/
CMakeLists.txt
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
cmake_minimum_required(VERSION 2.8.8)
include(CMakeConfig.txt)
project(pilight)
set(VERSION 8.1.5)
set(MODULESPACK OFF)
set(CMAKE_BUILD_TYPE Debug)
set(CMAKE_SKIP_RULE_DEPENDENCY TRUE)
set(CPACK_DEB_COMPONENT_INSTALL TRUE)
MACRO(SUBDIRLIST result curdir)
FILE(GLOB children RELATIVE ${curdir} ${curdir}/*)
SET(dirlist "")
FOREACH(child ${children})
IF(IS_DIRECTORY ${curdir}/${child})
LIST(APPEND dirlist ${curdir}/${child})
ENDIF()
ENDFOREACH()
SET(${result} ${dirlist})
ENDMACRO()
if(CMAKE_BUILD_TOOL MATCHES "(msdev|devenv|nmake)")
# Use the highest warning level for visual studio.
if(CMAKE_CXX_FLAGS MATCHES "/W[0-4]")
string(REGEX REPLACE "/W[0-4]" "/W4" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
else(CMAKE_CXX_FLAGS MATCHES "/W[0-4]")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4")
endif(CMAKE_CXX_FLAGS MATCHES "/W[0-4]")
if(CMAKE_C_FLAGS MATCHES "/W[0-4]")
string(REGEX REPLACE "/W[0-4]" "/W4" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
else(CMAKE_C_FLAGS MATCHES "/W[0-4]")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W4")
endif(CMAKE_C_FLAGS MATCHES "/W[0-4]")
# Disable deprecation warnings for standard C functions in VS2005 and later
if(CMAKE_COMPILER_2005)
add_definitions(-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE)
endif(CMAKE_COMPILER_2005)
endif(CMAKE_BUILD_TOOL MATCHES "(msdev|devenv|nmake)")
if(CMAKE_BUILD_TOOL MATCHES "make")
if(NOT CMAKE_CXX_FLAGS MATCHES "-Wall")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
endif(NOT CMAKE_CXX_FLAGS MATCHES "-Wall")
if(NOT CMAKE_C_FLAGS MATCHES "-Wall")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall")
endif(NOT CMAKE_C_FLAGS MATCHES "-Wall")
endif(CMAKE_BUILD_TOOL MATCHES "make")
IF(CMAKE_COMPILER_IS_GNUCC)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O2")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2")
ENDIF(CMAKE_COMPILER_IS_GNUCC)
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DDEBUG")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DDEBUG")
if(NOT WIN32)
string(ASCII 27 Esc)
set(ColorReset "${Esc}[m")
set(ColorBold "${Esc}[1m")
set(Red "${Esc}[31m")
set(Green "${Esc}[32m")
set(Yellow "${Esc}[33m")
set(Blue "${Esc}[34m")
set(Magenta "${Esc}[35m")
set(Cyan "${Esc}[36m")
set(White "${Esc}[37m")
set(BoldRed "${Esc}[1;31m")
set(BoldGreen "${Esc}[1;32m")
set(BoldYellow "${Esc}[1;33m")
set(BoldBlue "${Esc}[1;34m")
set(BoldMagenta "${Esc}[1;35m")
set(BoldCyan "${Esc}[1;36m")
set(BoldWhite "${Esc}[1;37m")
endif()
set(CMAKE_SKIP_RPATH TRUE)
if(NOT WIN32)
set(CMAKE_EXE_LINKER_FLAGS " -Wl,-rpath=.,-rpath=/usr/local/lib/,-rpath=/usr/lib/,-rpath=/lib/")
set(CMAKE_SHARED_LINKER_FLAGS " -Wl,-rpath=.,-rpath=/usr/local/lib/,-rpath=/usr/lib/,-rpath=/lib/")
set(CMAKE_MODULE_LINKER_FLAGS " -Wl,-rpath=.,-rpath=/usr/local/lib/,-rpath=/usr/lib/,-rpath=/lib/")
else()
set(CMAKE_EXE_LINKER_FLAGS "-static -static-libgcc")
endif()
if(NOT WIN32)
# Start uninstaller generator
function(WRITE_UNINSTALL_TARGET_SCRIPT)
# Create uninstall target template file, if it doesn't exist...
if(NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in)
set(__uninstall_filename ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake.in)
# BEGIN actual write to file...
file(WRITE ${__uninstall_filename} "\# - uninstall target template\n\#")
file(APPEND ${__uninstall_filename} "
if (NOT EXISTS \"\@CMAKE_CURRENT_BINARY_DIR\@/install_manifest.txt\")
message(FATAL_ERROR \"Cannot find install manifest: \\\"\@CMAKE_CURRENT_BINARY_DIR\@/install_manifest.txt\\\"\")
endif(NOT EXISTS \"\@CMAKE_CURRENT_BINARY_DIR\@/install_manifest.txt\")
file(READ \"\@CMAKE_CURRENT_BINARY_DIR\@/install_manifest.txt\" files)
string(REGEX REPLACE \"\\n\" \";\" files \"\${files}\")
foreach (file \${files})
message(STATUS \"Uninstalling \\\"\$ENV{DESTDIR}\${file}\\\"\")
if (EXISTS \"\$ENV{DESTDIR}\${file}\")
execute_process(
COMMAND \@CMAKE_COMMAND\@ -E remove \"\$ENV{DESTDIR}\${file}\"
OUTPUT_VARIABLE rm_out
RESULT_VARIABLE rm_retval
)
if(NOT \${rm_retval} EQUAL 0)
message(FATAL_ERROR \"Problem when removing \\\"\$ENV{DESTDIR}\${file}\\\"\")
endif (NOT \${rm_retval} EQUAL 0)
else (EXISTS \"\$ENV{DESTDIR}\${file}\")
message(STATUS \"File \\\"\$ENV{DESTDIR}\${file}\\\" does not exist.\")
endif (EXISTS \"\$ENV{DESTDIR}\${file}\")
endforeach(file)
execute_process(COMMAND update-rc.d ${PROJECT_NAME} remove)
execute_process(COMMAND ldconfig)
") # END of appending to file...
endif()
endfunction()
# End of the uninstaller generator
if(NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/cmake_postinstall.cmake)
set(__uninstall_filename ${CMAKE_CURRENT_BINARY_DIR}/cmake_postinstall.cmake)
# BEGIN actual write to file...
file(WRITE ${__uninstall_filename} "execute_process(COMMAND update-rc.d ${PROJECT_NAME} defaults)")
endif()
endif()
execute_process(COMMAND git log -n 1 --pretty=format:"%h"
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
RESULT_VARIABLE git_result
OUTPUT_VARIABLE git_hash)
execute_process(COMMAND git describe --always --abbrev=0
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
RESULT_VARIABLE git_result
OUTPUT_VARIABLE git_ver)
execute_process(COMMAND git describe
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
RESULT_VARIABLE git_result
OUTPUT_VARIABLE git_check)
string(FIND "${git_check}" "-" git_pos)
string(REGEX REPLACE "\n" "" git_ver "${git_ver}")
string(REGEX REPLACE "\"" "" git_hash "${git_hash}")
if(${git_pos} MATCHES "-1")
add_definitions(-DHASH="${git_ver}")
else()
add_definitions(-DHASH="${git_ver}-nightly-${git_hash}")
endif()
file(MD5 ${PROJECT_SOURCE_DIR}/res/pilight.pem md5sum)
add_definitions(-DPILIGHT_PEM_MD5="${md5sum}")
if(${MODULESPACK} MATCHES "ON" AND NOT WIN32)
add_definitions(-DMODULE="1")
endif()
if(NOT WIN32)
if(${PROTOCOL_ARPING} MATCHES "ON" AND NOT ${CMAKE_SYSTEM_PROCESSOR} MATCHES "^aarch64")
set(CMAKE_PCAP_LIBS_INIT)
find_library(CMAKE_PCAP_LIBS_INIT
NAME pcap
PATHS
${CROSS_COMPILE_LIBS}
/usr/lib
/usr/lib32
/usr/lib64
/usr/lib/i386-linux-gnu
/usr/lib/x86_64-linux-gnu
/usr/local/lib
/usr/local/lib32
/usr/local/lib64
/usr/lib/arm-linux-gnueabi
/usr/lib/arm-linux-gnueabihf
/usr/lib/aarch64-linux-gnu
NO_DEFAULT_PATH)
if(${CMAKE_PCAP_LIBS_INIT} MATCHES "CMAKE_PCAP_LIBS_INIT-NOTFOUND")
message(FATAL_ERROR "Looking for libpcap - not found")
else()
message(STATUS "Looking for libpcap - found (${CMAKE_PCAP_LIBS_INIT})")
endif()
endif()
# set(CMAKE_UNWIND_LIBS_INIT)
# if(NOT ${CMAKE_SYSTEM_PROCESSOR} MATCHES "^mips" AND NOT ${CMAKE_SYSTEM_PROCESSOR} MATCHES "^aarch64")
# find_library(CMAKE_UNWIND_LIBS_INIT
# NAME unwind
# PATHS
# ${CROSS_COMPILE_LIBS}
# /usr/lib
# /usr/lib32
# /usr/lib64
# /usr/lib/i386-linux-gnu
# /usr/lib/x86_64-linux-gnu
# /usr/local/lib
# /usr/local/lib32
# /usr/local/lib64
# /usr/lib/arm-linux-gnueabi
# /usr/lib/arm-linux-gnueabihf
# /usr/lib/aarch64-linux-gnu
# NO_DEFAULT_PATH)
# if(${CMAKE_UNWIND_LIBS_INIT} MATCHES "CMAKE_UNWIND_LIBS_INIT-NOTFOUND")
# message(FATAL_ERROR "Looking for libunwind - not found")
# else()
# message(STATUS "Looking for libunwind - found (${CMAKE_UNWIND_LIBS_INIT})")
# endif()
# endif()
find_library(CMAKE_WIRINGX_LIBS_INIT
NAME wiringx
PATHS
${CROSS_COMPILE_LIBS}
/usr/lib
/usr/lib32
/usr/lib64
/usr/lib/i386-linux-gnu
/usr/lib/x86_64-linux-gnu
/usr/local/lib
/usr/local/lib32
/usr/local/lib64
/usr/lib/arm-linux-gnueabi
/usr/lib/arm-linux-gnueabihf
/usr/lib/aarch64-linux-gnu
NO_DEFAULT_PATH)
if(${CMAKE_WIRINGX_LIBS_INIT} MATCHES "CMAKE_WIRINGX_LIBS_INIT-NOTFOUND")
message(FATAL_ERROR "Looking for libwiringx - not found")
else()
message(STATUS "Looking for libwiringx - found (${CMAKE_WIRINGX_LIBS_INIT})")
endif()
endif()
find_library(CMAKE_MBEDTLS_LIBS_INIT
NAME mbedtls
PATHS
${CROSS_COMPILE_LIBS}
/usr/lib
/usr/lib32
/usr/lib64
/usr/lib/i386-linux-gnu
/usr/lib/x86_64-linux-gnu
/usr/local/lib
/usr/local/lib32
/usr/local/lib64
/usr/lib/arm-linux-gnueabi
/usr/lib/arm-linux-gnueabihf
/usr/lib/aarch64-linux-gnu
NO_DEFAULT_PATH)
if(${CMAKE_MBEDTLS_LIBS_INIT} MATCHES "CMAKE_MBEDTLS_LIBS_INIT-NOTFOUND")
message(FATAL_ERROR "Looking for libmbedtls - not found")
else()
message(STATUS "Looking for libmbedtls - found (${CMAKE_MBEDTLS_LIBS_INIT})")
endif()
find_library(CMAKE_MBEDCRYPTO_LIBS_INIT
NAME mbedcrypto
PATHS
${CROSS_COMPILE_LIBS}
/usr/lib
/usr/lib32
/usr/lib64
/usr/lib/i386-linux-gnu
/usr/lib/x86_64-linux-gnu
/usr/local/lib
/usr/local/lib32
/usr/local/lib64
/usr/lib/arm-linux-gnueabi
/usr/lib/arm-linux-gnueabihf
/usr/lib/aarch64-linux-gnu
NO_DEFAULT_PATH)
if(${CMAKE_MBEDCRYPTO_LIBS_INIT} MATCHES "CMAKE_MBEDCRYPTO_LIBS_INIT-NOTFOUND")
message(FATAL_ERROR "Looking for libmbedcrypto - not found")
else()
message(STATUS "Looking for libmbedcrypto - found (${CMAKE_MBEDCRYPTO_LIBS_INIT})")
endif()
find_library(CMAKE_MBEDX509_LIBS_INIT
NAME mbedx509
PATHS
${CROSS_COMPILE_LIBS}
/usr/lib
/usr/lib32
/usr/lib64
/usr/lib/i386-linux-gnu
/usr/lib/x86_64-linux-gnu
/usr/local/lib
/usr/local/lib32
/usr/local/lib64
/usr/lib/arm-linux-gnueabi
/usr/lib/arm-linux-gnueabihf
/usr/lib/aarch64-linux-gnu
NO_DEFAULT_PATH)
if(${CMAKE_MBEDX509_LIBS_INIT} MATCHES "CMAKE_MBEDX509_LIBS_INIT-NOTFOUND")
message(FATAL_ERROR "Looking for libmbedx509 - not found")
else()
message(STATUS "Looking for libmbedx509 - found (${CMAKE_MBEDX509_LIBS_INIT})")
endif()
if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "^aarch64")
find_library(CMAKE_LUA_LIBS_INIT
NAME lua5.1
PATHS
${CROSS_COMPILE_LIBS}
/usr/lib
/usr/lib32
/usr/lib64
/usr/lib/i386-linux-gnu
/usr/lib/x86_64-linux-gnu
/usr/local/lib
/usr/local/lib32
/usr/local/lib64
/usr/lib/arm-linux-gnueabi
/usr/lib/arm-linux-gnueabihf
/usr/lib/aarch64-linux-gnu
NO_DEFAULT_PATH)
if(${CMAKE_LUA_LIBS_INIT} MATCHES "CMAKE_LUA_LIBS_INIT-NOTFOUND")
message(FATAL_ERROR "Looking for libluajit - not found")
else()
message(STATUS "Looking for libluajit - found (${CMAKE_LUA_LIBS_INIT})")
endif()
else()
find_library(CMAKE_LUA_LIBS_INIT
NAME luajit-5.1
PATHS
${CROSS_COMPILE_LIBS}
/usr/lib
/usr/lib32
/usr/lib64
/usr/lib/i386-linux-gnu
/usr/lib/x86_64-linux-gnu
/usr/local/lib
/usr/local/lib32
/usr/local/lib64
/usr/lib/arm-linux-gnueabi
/usr/lib/arm-linux-gnueabihf
/usr/lib/aarch64-linux-gnu
NO_DEFAULT_PATH)
if(${CMAKE_LUA_LIBS_INIT} MATCHES "CMAKE_LUA_LIBS_INIT-NOTFOUND")
message(FATAL_ERROR "Looking for libluajit - not found")
else()
message(STATUS "Looking for libluajit - found (${CMAKE_LUA_LIBS_INIT})")
endif()
endif()
include_directories(${PROJECT_SOURCE_DIR}/inc)
include_directories(${PROJECT_SOURCE_DIR}/libs/libuv)
include_directories(/usr/local/include/)
add_subdirectory(inc)
add_subdirectory(libs)
if(WIN32)
set(THREADS_USE_PTHREADS_WIN32 true)
endif()
find_package(Threads REQUIRED)
if(NOT WIN32)
if(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
find_package(Backtrace REQUIRED)
endif()
endif()
if(${MODULESPACK} MATCHES "OFF" OR WIN32)
if(WIN32)
add_custom_command(OUTPUT ${PROJECT_SOURCE_DIR}/res/win32/admin.obj COMMAND ${CMAKE_RC_COMPILER} -o ${PROJECT_SOURCE_DIR}/res/win32/admin.obj ${PROJECT_SOURCE_DIR}/res/win32/admin.rc)
add_custom_command(OUTPUT ${PROJECT_SOURCE_DIR}/res/win32/icon.obj COMMAND ${CMAKE_RC_COMPILER} -o ${PROJECT_SOURCE_DIR}/res/win32/icon.obj ${PROJECT_SOURCE_DIR}/res/win32/icon.rc)
add_library(admin STATIC ${PROJECT_SOURCE_DIR}/res/win32/admin.obj)
add_library(icon STATIC ${PROJECT_SOURCE_DIR}/res/win32/icon.obj)
set_source_files_properties(${PROJECT_SOURCE_DIR}/res/win32/admin.obj PROPERTIES EXTERNAL_OBJECT true GENERATED true)
set_source_files_properties(${PROJECT_SOURCE_DIR}/res/win32/icon.obj PROPERTIES EXTERNAL_OBJECT true GENERATED true)
set_target_properties(admin PROPERTIES LINKER_LANGUAGE C)
set_target_properties(icon PROPERTIES LINKER_LANGUAGE C)
endif()
add_library(${PROJECT_NAME} OBJECT ${libs_files})
set_property(TARGET ${PROJECT_NAME} PROPERTY POSITION_INDEPENDENT_CODE TRUE)
if(WIN32)
add_library(${PROJECT_NAME}_shared STATIC $<TARGET_OBJECTS:${PROJECT_NAME}>)
else()
add_library(${PROJECT_NAME}_shared SHARED $<TARGET_OBJECTS:${PROJECT_NAME}>)
endif()
add_library(${PROJECT_NAME}_static STATIC $<TARGET_OBJECTS:${PROJECT_NAME}>)
target_link_libraries(${PROJECT_NAME}_shared ${CMAKE_THREAD_LIBS_INIT})
if(WIN32)
target_link_libraries(${PROJECT_NAME}_shared ws2_32)
target_link_libraries(${PROJECT_NAME}_shared user32)
target_link_libraries(${PROJECT_NAME}_shared userenv)
target_link_libraries(${PROJECT_NAME}_shared wsock32)
target_link_libraries(${PROJECT_NAME}_shared iphlpapi)
target_link_libraries(${PROJECT_NAME}_shared psapi)
target_link_libraries(${PROJECT_NAME}_static ws2_32)
target_link_libraries(${PROJECT_NAME}_static user32)
target_link_libraries(${PROJECT_NAME}_static userenv)
target_link_libraries(${PROJECT_NAME}_static wsock32)
target_link_libraries(${PROJECT_NAME}_static iphlpapi)
target_link_libraries(${PROJECT_NAME}_static psapi)
if(${PROTOCOL_ARPING} MATCHES "ON")
target_link_libraries(${PROJECT_NAME}_shared ${PROJECT_SOURCE_DIR}/res/win32/libwpcap.dll.a)
target_link_libraries(${PROJECT_NAME}_static ${PROJECT_SOURCE_DIR}/res/win32/libwpcap.dll.a)
endif()
endif()
target_link_libraries(${PROJECT_NAME}_shared m)
if(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
target_link_libraries(${PROJECT_NAME}_shared ${Backtrace_LIBRARIES})
endif()
if(NOT WIN32)
target_link_libraries(${PROJECT_NAME}_shared rt)
endif()
target_link_libraries(${PROJECT_NAME}_shared ${CMAKE_DL_LIBS})
target_link_libraries(${PROJECT_NAME}_shared ${CMAKE_WIRINGX_LIBS_INIT})
target_link_libraries(${PROJECT_NAME}_shared ${CMAKE_MBEDTLS_LIBS_INIT})
target_link_libraries(${PROJECT_NAME}_shared ${CMAKE_MBEDCRYPTO_LIBS_INIT})
target_link_libraries(${PROJECT_NAME}_shared ${CMAKE_MBEDX509_LIBS_INIT})
target_link_libraries(${PROJECT_NAME}_shared ${CMAKE_LUA_LIBS_INIT})
target_link_libraries(${PROJECT_NAME}_static ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries(${PROJECT_NAME}_static m)
if(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
target_link_libraries(${PROJECT_NAME}_static ${Backtrace_LIBRARIES})
endif()
if(NOT WIN32)
target_link_libraries(${PROJECT_NAME}_static rt)
endif()
target_link_libraries(${PROJECT_NAME}_static ${CMAKE_DL_LIBS})
target_link_libraries(${PROJECT_NAME}_static ${CMAKE_WIRINGX_LIBS_INIT})
target_link_libraries(${PROJECT_NAME}_static ${CMAKE_MBEDTLS_LIBS_INIT})
target_link_libraries(${PROJECT_NAME}_static ${CMAKE_MBEDCRYPTO_LIBS_INIT})
target_link_libraries(${PROJECT_NAME}_static ${CMAKE_MBEDX509_LIBS_INIT})
target_link_libraries(${PROJECT_NAME}_static ${CMAKE_LUA_LIBS_INIT})
if(${PROTOCOL_ARPING} MATCHES "ON")
target_link_libraries(${PROJECT_NAME}_shared ${CMAKE_PCAP_LIBS_INIT})
target_link_libraries(${PROJECT_NAME}_static ${CMAKE_PCAP_LIBS_INIT})
endif()
# if(NOT WIN32)
# target_link_libraries(${PROJECT_NAME}_shared ${CMAKE_UNWIND_LIBS_INIT})
# target_link_libraries(${PROJECT_NAME}_static ${CMAKE_UNWIND_LIBS_INIT})
# endif()
set_target_properties(${PROJECT_NAME}_shared ${PROJECT_NAME}_static PROPERTIES OUTPUT_NAME ${PROJECT_NAME})
if(NOT WIN32)
install(CODE "execute_process(COMMAND rm /usr/local/lib/lib${PROJECT_NAME}.so)")
install(FILES ${CMAKE_BINARY_DIR}/lib${PROJECT_NAME}.so DESTINATION lib RENAME lib${PROJECT_NAME}.so.${VERSION} COMPONENT ${PROJECT_NAME})
install(FILES ${CMAKE_BINARY_DIR}/lib${PROJECT_NAME}.a DESTINATION lib RENAME lib${PROJECT_NAME}.a COMPONENT ${PROJECT_NAME})
install(CODE "execute_process(COMMAND ln -s \"/usr/local/lib/lib${PROJECT_NAME}.so.${VERSION}\" \"/usr/local/lib/lib${PROJECT_NAME}.so\")")
if(EXISTS "/usr/local/lib/${PROJECT_NAME}/storage")
install(CODE "execute_process(COMMAND find /usr/local/lib/${PROJECT_NAME}/storage/ -type f -exec rm {} \\;)")
endif()
if(EXISTS "/usr/local/lib/${PROJECT_NAME}/protocols")
install(CODE "execute_process(COMMAND find /usr/local/lib/${PROJECT_NAME}/protocols/ -type f -exec rm {} \\;)")
endif()
if(EXISTS "/usr/local/lib/${PROJECT_NAME}/hardware")
install(CODE "execute_process(COMMAND find /usr/local/lib/${PROJECT_NAME}/hardware/ -type f -exec rm {} \\;)")
endif()
if(EXISTS "/usr/local/lib/${PROJECT_NAME}/actions")
install(CODE "execute_process(COMMAND find /usr/local/lib/${PROJECT_NAME}/actions/ -type f -exec rm {} \\;)")
endif()
if(EXISTS "/usr/local/lib/${PROJECT_NAME}/operators")
install(CODE "execute_process(COMMAND find /usr/local/lib/${PROJECT_NAME}/operators/ -type f -exec rm {} \\;)")
endif()
if(EXISTS "/usr/local/${PROJECT_NAME}/operators")
install(CODE "execute_process(COMMAND find /usr/local/${PROJECT_NAME}/operators/ -type f -exec rm {} \\;)")
endif()
if(EXISTS "/etc/${PROJECT_NAME}/config.json")
install(CODE "execute_process(COMMAND mv /etc/${PROJECT_NAME}/config.json /etc/${PROJECT_NAME}/config.json.bak)")
endif()
install(PROGRAMS ${PROJECT_SOURCE_DIR}/res/init/${PROJECT_NAME}.sysv DESTINATION /etc/init.d/ RENAME ${PROJECT_NAME})
install(PROGRAMS ${PROJECT_SOURCE_DIR}/res/init/${PROJECT_NAME}.systemd DESTINATION etc/systemd/system/ RENAME ${PROJECT_NAME}.service)
install(PROGRAMS ${PROJECT_SOURCE_DIR}/res/init/${PROJECT_NAME}.upstart DESTINATION /etc/init/ RENAME ${PROJECT_NAME}.conf)
install(FILES ${PROJECT_SOURCE_DIR}/res/config/config.json-default DESTINATION /etc/${PROJECT_NAME}/ RENAME config.json COMPONENT ${PROJECT_NAME})
else()
# install(FILES ${CMAKE_BINARY_DIR}/lib${PROJECT_NAME}.dll DESTINATION . RENAME lib${PROJECT_NAME}.dll COMPONENT ${PROJECT_NAME})
install(FILES ${PROJECT_SOURCE_DIR}/res/config/config.json-default-w32 DESTINATION . RENAME config.json-default COMPONENT ${PROJECT_NAME})
endif()
if(${WEBSERVER} MATCHES "ON")
if(WIN32)
install(DIRECTORY ${PROJECT_SOURCE_DIR}/libs/webgui/ DESTINATION web/ COMPONENT webgui)
else()
install(DIRECTORY ${PROJECT_SOURCE_DIR}/libs/webgui/ DESTINATION /usr/local/share/${PROJECT_NAME}/webgui COMPONENT webgui)
endif()
endif()
if(WIN32)
add_executable(${PROJECT_NAME}-daemon daemon.c ${PROJECT_SOURCE_DIR}/res/win32/icon.obj)
target_link_libraries(${PROJECT_NAME}-daemon "-Wl,--subsystem,windows")
else()
add_executable(${PROJECT_NAME}-daemon daemon.c)
endif()
target_link_libraries(${PROJECT_NAME}-daemon ${PROJECT_NAME}_shared)
if(${ZWAVE} MATCHES "ON")
target_link_libraries(${PROJECT_NAME}-daemon stdc++)
endif()
target_link_libraries(${PROJECT_NAME}-daemon ${CMAKE_DL_LIBS})
target_link_libraries(${PROJECT_NAME}-daemon m)
if(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
target_link_libraries(${PROJECT_NAME}-daemon ${Backtrace_LIBRARIES})
endif()
target_link_libraries(${PROJECT_NAME}-daemon ${CMAKE_THREAD_LIBS_INIT})
# if(WIN32)
# add_executable(${PROJECT_NAME}-unittest unittest.c ${PROJECT_SOURCE_DIR}/res/win32/icon.obj)
# target_link_libraries(${PROJECT_NAME}-unittest "-Wl,--subsystem,windows")
# else()
# add_executable(${PROJECT_NAME}-unittest unittest.c)
# endif()
# target_link_libraries(${PROJECT_NAME}-unittest ${PROJECT_NAME}_shared)
# if(${ZWAVE} MATCHES "ON")
# target_link_libraries(${PROJECT_NAME}-unittest stdc++)
# endif()
# target_link_libraries(${PROJECT_NAME}-unittest ${CMAKE_DL_LIBS})
# target_link_libraries(${PROJECT_NAME}-unittest m)
# if(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
# target_link_libraries(${PROJECT_NAME}-unittest ${Backtrace_LIBRARIES})
# endif()
# target_link_libraries(${PROJECT_NAME}-unittest ${CMAKE_THREAD_LIBS_INIT})
if(WIN32)
add_executable(${PROJECT_NAME}-raw raw.c ${PROJECT_SOURCE_DIR}/res/win32/icon.obj)
else()
add_executable(${PROJECT_NAME}-raw raw.c)
endif()
target_link_libraries(${PROJECT_NAME}-raw ${PROJECT_NAME}_shared)
if(${ZWAVE} MATCHES "ON")
target_link_libraries(${PROJECT_NAME}-raw stdc++)
endif()
target_link_libraries(${PROJECT_NAME}-raw ${CMAKE_DL_LIBS})
target_link_libraries(${PROJECT_NAME}-raw m)
if(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
target_link_libraries(${PROJECT_NAME}-raw ${Backtrace_LIBRARIES})
endif()
target_link_libraries(${PROJECT_NAME}-raw ${CMAKE_THREAD_LIBS_INIT})
if(WIN32)
add_executable(${PROJECT_NAME}-send send.c ${PROJECT_SOURCE_DIR}/res/win32/icon.obj)
else()
add_executable(${PROJECT_NAME}-send send.c)
endif()
target_link_libraries(${PROJECT_NAME}-send ${PROJECT_NAME}_shared)
target_link_libraries(${PROJECT_NAME}-send ${CMAKE_DL_LIBS})
if(${ZWAVE} MATCHES "ON")
target_link_libraries(${PROJECT_NAME}-send stdc++)
endif()
target_link_libraries(${PROJECT_NAME}-send m)
if(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
target_link_libraries(${PROJECT_NAME}-send ${Backtrace_LIBRARIES})
endif()
target_link_libraries(${PROJECT_NAME}-send ${CMAKE_THREAD_LIBS_INIT})
if(WIN32)
add_executable(${PROJECT_NAME}-control control.c ${PROJECT_SOURCE_DIR}/res/win32/icon.obj)
else()
add_executable(${PROJECT_NAME}-control control.c)
endif()
target_link_libraries(${PROJECT_NAME}-control ${PROJECT_NAME}_shared)
target_link_libraries(${PROJECT_NAME}-control ${CMAKE_DL_LIBS})
if(${ZWAVE} MATCHES "ON")
target_link_libraries(${PROJECT_NAME}-control stdc++)
endif()
target_link_libraries(${PROJECT_NAME}-control m)
if(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
target_link_libraries(${PROJECT_NAME}-control ${Backtrace_LIBRARIES})
endif()
target_link_libraries(${PROJECT_NAME}-control ${CMAKE_THREAD_LIBS_INIT})
if(WIN32)
add_executable(${PROJECT_NAME}-receive receive.c ${PROJECT_SOURCE_DIR}/res/win32/icon.obj)
else()
add_executable(${PROJECT_NAME}-receive receive.c)
endif()
target_link_libraries(${PROJECT_NAME}-receive ${PROJECT_NAME}_shared)
if(${ZWAVE} MATCHES "ON")
target_link_libraries(${PROJECT_NAME}-receive stdc++)
endif()
target_link_libraries(${PROJECT_NAME}-receive ${CMAKE_DL_LIBS})
target_link_libraries(${PROJECT_NAME}-receive m)
if(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
target_link_libraries(${PROJECT_NAME}-receive ${Backtrace_LIBRARIES})
endif()
target_link_libraries(${PROJECT_NAME}-receive ${CMAKE_THREAD_LIBS_INIT})
if(WIN32)
add_executable(${PROJECT_NAME}-debug debug.c ${PROJECT_SOURCE_DIR}/res/win32/icon.obj)
else()
add_executable(${PROJECT_NAME}-debug debug.c)
endif()
target_link_libraries(${PROJECT_NAME}-debug ${PROJECT_NAME}_shared)
if(${ZWAVE} MATCHES "ON")
target_link_libraries(${PROJECT_NAME}-debug stdc++)
endif()
target_link_libraries(${PROJECT_NAME}-debug ${CMAKE_DL_LIBS})
target_link_libraries(${PROJECT_NAME}-debug m)
if(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
target_link_libraries(${PROJECT_NAME}-debug ${Backtrace_LIBRARIES})
endif()
target_link_libraries(${PROJECT_NAME}-debug ${CMAKE_THREAD_LIBS_INIT})
if(WIN32)
add_executable(${PROJECT_NAME}-uuid uuid.c ${PROJECT_SOURCE_DIR}/res/win32/icon.obj)
else()
add_executable(${PROJECT_NAME}-uuid uuid.c)
endif()
target_link_libraries(${PROJECT_NAME}-uuid ${PROJECT_NAME}_shared)
if(${ZWAVE} MATCHES "ON")
target_link_libraries(${PROJECT_NAME}-uuid stdc++)
endif()
target_link_libraries(${PROJECT_NAME}-uuid ${CMAKE_DL_LIBS})
target_link_libraries(${PROJECT_NAME}-uuid m)
if(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
target_link_libraries(${PROJECT_NAME}-uuid ${Backtrace_LIBRARIES})
endif()
target_link_libraries(${PROJECT_NAME}-uuid ${CMAKE_THREAD_LIBS_INIT})
if(WIN32)
add_executable(${PROJECT_NAME}-sha256 sha256.c ${PROJECT_SOURCE_DIR}/res/win32/icon.obj)
else()
add_executable(${PROJECT_NAME}-sha256 sha256.c)
endif()
target_link_libraries(${PROJECT_NAME}-sha256 ${PROJECT_NAME}_shared)
if(${ZWAVE} MATCHES "ON")
target_link_libraries(${PROJECT_NAME}-sha256 stdc++)
endif()
target_link_libraries(${PROJECT_NAME}-sha256 ${CMAKE_DL_LIBS})
target_link_libraries(${PROJECT_NAME}-sha256 m)
if(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
target_link_libraries(${PROJECT_NAME}-sha256 ${Backtrace_LIBRARIES})
endif()
target_link_libraries(${PROJECT_NAME}-sha256 ${CMAKE_THREAD_LIBS_INIT})
if(WIN32)
add_executable(${PROJECT_NAME}-flash flash.c ${PROJECT_SOURCE_DIR}/res/win32/icon.obj)
else()
add_executable(${PROJECT_NAME}-flash flash.c)
endif()
target_link_libraries(${PROJECT_NAME}-flash ${PROJECT_NAME}_shared)
if(${ZWAVE} MATCHES "ON")
target_link_libraries(${PROJECT_NAME}-flash stdc++)
endif()
target_link_libraries(${PROJECT_NAME}-flash ${CMAKE_DL_LIBS})
target_link_libraries(${PROJECT_NAME}-flash m)
if(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
target_link_libraries(${PROJECT_NAME}-flash ${Backtrace_LIBRARIES})
endif()
target_link_libraries(${PROJECT_NAME}-flash ${CMAKE_THREAD_LIBS_INIT})
if(WIN32)
install(FILES "${PROJECT_SOURCE_DIR}/res/firmware/${PROJECT_NAME}_usb_nano.hex" DESTINATION . COMPONENT ${PROJECT_NAME})
endif()
if(NOT WIN32)
if(EXISTS "/usr/local/sbin/${PROJECT_NAME}-send")
install(CODE "execute_process(COMMAND rm /usr/local/sbin/${PROJECT_NAME}-send)")
endif()
if(EXISTS "/usr/local/sbin/${PROJECT_NAME}-receive")
install(CODE "execute_process(COMMAND rm /usr/local/sbin/${PROJECT_NAME}-receive)")
endif()
if(EXISTS "/usr/local/sbin/${PROJECT_NAME}-control")
install(CODE "execute_process(COMMAND rm /usr/local/sbin/${PROJECT_NAME}-control)")
endif()
if(EXISTS "/usr/local/sbin/${PROJECT_NAME}-uuid")
install(CODE "execute_process(COMMAND rm /usr/local/sbin/${PROJECT_NAME}-uuid)")
endif()
endif()
if(WIN32)
install(FILES "${PROJECT_SOURCE_DIR}/LICENSE.txt" DESTINATION . COMPONENT ${PROJECT_NAME})
install(FILES "${PROJECT_SOURCE_DIR}/res/win32/libmbedx509.dll" DESTINATION . COMPONENT ${PROJECT_NAME})
install(FILES "${PROJECT_SOURCE_DIR}/res/win32/libmbedcrypto.dll" DESTINATION . COMPONENT ${PROJECT_NAME})
install(FILES "${PROJECT_SOURCE_DIR}/res/win32/libmbedtls.dll" DESTINATION . COMPONENT ${PROJECT_NAME})
install(FILES "${PROJECT_SOURCE_DIR}/res/win32/libwinpthread-1.dll" DESTINATION . COMPONENT ${PROJECT_NAME})
install(FILES "${PROJECT_SOURCE_DIR}/res/win32/Packet.dll" DESTINATION . COMPONENT ${PROJECT_NAME})
install(FILES "${PROJECT_SOURCE_DIR}/res/win32/wpcap.dll" DESTINATION . COMPONENT ${PROJECT_NAME})
install(PROGRAMS ${CMAKE_BINARY_DIR}/${PROJECT_NAME}-daemon.exe DESTINATION . COMPONENT ${PROJECT_NAME})
install(PROGRAMS ${CMAKE_BINARY_DIR}/${PROJECT_NAME}-raw.exe DESTINATION . COMPONENT ${PROJECT_NAME})
install(PROGRAMS ${CMAKE_BINARY_DIR}/${PROJECT_NAME}-send.exe DESTINATION . COMPONENT ${PROJECT_NAME})
install(PROGRAMS ${CMAKE_BINARY_DIR}/${PROJECT_NAME}-control.exe DESTINATION . COMPONENT ${PROJECT_NAME})
install(PROGRAMS ${CMAKE_BINARY_DIR}/${PROJECT_NAME}-receive.exe DESTINATION . COMPONENT ${PROJECT_NAME})
install(PROGRAMS ${CMAKE_BINARY_DIR}/${PROJECT_NAME}-debug.exe DESTINATION . COMPONENT ${PROJECT_NAME})
install(PROGRAMS ${CMAKE_BINARY_DIR}/${PROJECT_NAME}-flash.exe DESTINATION . COMPONENT ${PROJECT_NAME})
install(PROGRAMS ${CMAKE_BINARY_DIR}/${PROJECT_NAME}-uuid.exe DESTINATION . COMPONENT ${PROJECT_NAME})
install(PROGRAMS ${CMAKE_BINARY_DIR}/${PROJECT_NAME}-sha256.exe DESTINATION . COMPONENT ${PROJECT_NAME})
else()
install(PROGRAMS ${CMAKE_BINARY_DIR}/${PROJECT_NAME}-daemon DESTINATION sbin COMPONENT ${PROJECT_NAME})
install(PROGRAMS ${CMAKE_BINARY_DIR}/${PROJECT_NAME}-raw DESTINATION sbin COMPONENT ${PROJECT_NAME})
install(PROGRAMS ${CMAKE_BINARY_DIR}/${PROJECT_NAME}-send DESTINATION bin COMPONENT ${PROJECT_NAME})
install(PROGRAMS ${CMAKE_BINARY_DIR}/${PROJECT_NAME}-control DESTINATION bin COMPONENT ${PROJECT_NAME})
install(PROGRAMS ${CMAKE_BINARY_DIR}/${PROJECT_NAME}-receive DESTINATION bin COMPONENT ${PROJECT_NAME})
install(PROGRAMS ${CMAKE_BINARY_DIR}/${PROJECT_NAME}-debug DESTINATION sbin COMPONENT ${PROJECT_NAME})
install(PROGRAMS ${CMAKE_BINARY_DIR}/${PROJECT_NAME}-flash DESTINATION sbin COMPONENT ${PROJECT_NAME})
install(PROGRAMS ${CMAKE_BINARY_DIR}/${PROJECT_NAME}-uuid DESTINATION bin COMPONENT ${PROJECT_NAME})
install(PROGRAMS ${CMAKE_BINARY_DIR}/${PROJECT_NAME}-sha256 DESTINATION bin COMPONENT ${PROJECT_NAME})
install(CODE "execute_process(COMMAND update-rc.d ${PROJECT_NAME} defaults)")
install(CODE "execute_process(COMMAND ldconfig)")
endif()
endif()
if(WIN32)
set(CPACK_MONOLITHIC_INSTALL True)
set(CPACK_NSIS_INSTALL_ROOT "c:")
set(CPACK_PACKAGE_INSTALL_DIRECTORY "${PROJECT_NAME}")
set(CPACK_NSIS_DISPLAY_NAME "${PROJECT_NAME}")
set(CPACK_NSIS_PACKAGE_NAME "${PROJECT_NAME} ${git_ver}")
set(CPACK_NSIS_URL_INFO_ABOUT "http://www.${PROJECT_NAME}.org")
set(CPACK_NSIS_CONTACT "info@${PROJECT_NAME}.org")
set(CPACK_NSIS_EXECUTABLES_DIRECTORY ".")
set(CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL True)
set(CPACK_NSIS_MENU_LINKS
"${PROJECT_NAME}-daemon" "${PROJECT_NAME}-daemon"
)
set(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/LICENSE.txt")
# set(CPACK_COMPONENTS_ALL ${PROJECT_NAME} webgui)
set(CPACK_GENERATOR "NSIS")
set(CPACK_PACKAGING_INSTALL_DIRECTORY "${PROJECT_NAME}")
set(CPACK_SOURCE_STRIP_FILES TRUE)
set(CPACK_STRIP_FILES TRUE)
set(CPACK_PACKAGE_CONTACT "CurlyMo <info@${PROJECT_NAME}.org>")
set(CPACK_PACKAGE_VERSION ${git_ver})
set(CPACK_PACKAGE_NAME "${PROJECT_NAME}")
set(CPACK_PACKAGE_VENDOR "${PROJECT_NAME}")
set(CPACK_PACKAGE_DESCRIPTION "Control RF devices with the Raspberry Pi")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Control RF devices with the Raspberry Pi")
include(CPack)
else()
WRITE_UNINSTALL_TARGET_SCRIPT()
configure_file("${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
IMMEDIATE @ONLY)
add_custom_target(uninstall COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)
set(CPACK_GENERATOR "DEB")
set(CPACK_PACKAGING_INSTALL_PREFIX "/usr/local/")
set(CPACK_SOURCE_STRIP_FILES TRUE)
set(CPACK_STRIP_FILES TRUE)
set(CPACK_PACKAGE_CONTACT "CurlyMo <info@${PROJECT_NAME}.org>")
set(CPACK_PACKAGE_VERSION ${VERSION})
set(CPACK_PACKAGE_NAME "${PROJECT_NAME}")
set(CPACK_DEBIAN_PACKAGE_DEPENDS "zlib1g-dev")
set(CPACK_DEBIAN_PACKAGE_PRIORITY "optional")
set(CPACK_PACKAGE_DESCRIPTION "Control RF devices with the Raspberry Pi")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Control RF devices with the Raspberry Pi")
include(CPack)
message("")
message("${Red}-- WARNING --${ColorReset}")
message("${Yellow}Manually compiling and installing ${PROJECT_NAME} will also clear all module folders:
/usr/local/lib/${PROJECT_NAME}/lua/
/usr/local/lib/${PROJECT_NAME}/storage/
/usr/local/lib/${PROJECT_NAME}/protocols/
/usr/local/lib/${PROJECT_NAME}/hardware/
/usr/local/lib/${PROJECT_NAME}/actions/
/usr/local/lib/${PROJECT_NAME}/operators/${ColorReset}")
message("${Red}-- WARNING --${ColorReset}")
message("")
endif()