File: CMakeLists.txt

package info (click to toggle)
mathgl 2.4.4-7
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 34,092 kB
  • sloc: cpp: 82,288; javascript: 3,284; ansic: 3,178; pascal: 1,562; python: 37; makefile: 20; sh: 20
file content (54 lines) | stat: -rw-r--r-- 1,967 bytes parent folder | download | duplicates (6)
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
if(enable-qt5)
	include(../scripts/qt5.cmake)

	find_qt5_libs(OFF ON Network)
	if(TARGET Qt5::Network)
		set(MGL_QT5_LIBS ${MGL_QT5_LIBS} Qt5::Network)
		find_qt5_libs(OFF OFF WebKitWidgets WebEngineWidgets)
		if(enable-json-sample-we)
			if(TARGET Qt5::WebEngineWidgets)
				set(MGL_QT5_LIBS ${MGL_QT5_LIBS} Qt5::WebEngineWidgets)
				set(mgl_qt_def MGL_USE_QT5_WE)
			else(TARGET Qt5::WebEngineWidgets)
				message(STATUS "Couldn't find Qt5 WebEngineWidgets library. Trying WebKit.")
				set(enable-json-sample-we OFF)
			endif(TARGET Qt5::WebEngineWidgets)
		endif(enable-json-sample-we)
		if(TARGET Qt5::WebKitWidgets)
			set(MGL_QT5_LIBS ${MGL_QT5_LIBS} Qt5::WebKitWidgets)
		else(TARGET Qt5::WebKitWidgets)
			message(STATUS "Couldn't find Qt5 WebKitWidgets library. JSON sample disabled.")
			set(enable-json-sample OFF)
		endif(TARGET Qt5::WebKitWidgets)
	else(TARGET Qt5::Network)
		message(STATUS "Couldn't find Qt5 Network library. JSON sample disabled.")
		set(enable-json-sample OFF)
	endif(TARGET Qt5::Network)
else(enable-qt5)
	include(../scripts/qt4.cmake)

	foreach(mgl_qt4_lib ${MGL_QT4_LIBS_FIND_JSON})
		if(TARGET Qt4::${mgl_qt4_lib})
			set(MGL_QT4_LIBS ${MGL_QT4_LIBS} Qt4::${mgl_qt4_lib})
		else(TARGET Qt4::${mgl_qt4_lib})
			message(STATUS "Couldn't find Qt4 ${mgl_qt4_lib} library. JSON sample disabled.")
			set(enable-json-sample OFF)
		endif(TARGET Qt4::${mgl_qt4_lib})
	endforeach(mgl_qt4_lib)
endif(enable-qt5)

if(enable-json-sample)

set(json_src Backend.cpp MainWindow.cpp MainWindow.ui)
set(json_moc_hdr Backend.hpp MainWindow.hpp)

include_directories(${MathGL2_BINARY_DIR}/json)
add_executable(MglForJsTestBench ${json_src} ${json_moc_hdr})
if(enable-qt5)
	target_compile_definitions(MglForJsTestBench PUBLIC MGL_USE_QT5 ${mgl_qt_def})
	target_link_libraries(MglForJsTestBench mgl-qt5 ${MGL_QT5_LIBS})
else(enable-qt5)
	target_link_libraries(MglForJsTestBench mgl-qt4 ${MGL_QT4_LIBS})
endif(enable-qt5)

endif(enable-json-sample)