File: CMakeLists.txt

package info (click to toggle)
mathgl 8.0.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, trixie
  • size: 248,044 kB
  • sloc: cpp: 87,365; ansic: 3,299; javascript: 3,284; pascal: 1,562; python: 52; sh: 51; makefile: 47; f90: 22
file content (34 lines) | stat: -rw-r--r-- 1,468 bytes parent folder | download | duplicates (2)
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
include(../scripts/qt.cmake)

find_qt_libs(${mgl_qt_major} ${mgl_qt_version} OFF ON ${mgl_qt_components})
set(mgl_json_libs ${MGL_QT_LIBS})

find_qt_libs(${mgl_qt_major} ${mgl_qt_version} OFF ON ${mgl_qt_components_wk})
if(MGL_HAVE_QT)
	list(APPEND mgl_json_libs ${MGL_QT_LIBS})
else(MGL_HAVE_QT)
	message("Couldn't find Qt${mgl_qt_major} WebKitWidgets or Network library. JSON sample disabled.")
	set(enable-json-sample OFF CACHE BOOL "Enable JSON sample (WebKit variant is the default)." FORCE)
endif(MGL_HAVE_QT)

if(enable-json-sample)
	find_qt_libs(${mgl_qt_major} ${mgl_qt_version} OFF ON ${mgl_qt_components_we})
	if(MGL_HAVE_QT)
		list(APPEND mgl_json_libs ${MGL_QT_LIBS})
		set(enable-json-sample-we ON CACHE BOOL "Enable JSON sample (WebEngine variant)." FORCE)
		set(mgl_qt_def MGL_USE_QT5_WE)
	else(MGL_HAVE_QT)
		message("Couldn't find Qt${mgl_qt_major} WebEngineWidgets. Disabling...")
		set(enable-json-sample-we OFF CACHE BOOL "Enable JSON sample (WebEngine variant)." FORCE)
	endif(MGL_HAVE_QT)

	set(json_src Backend.cpp MainWindow.cpp MainWindow.ui)
	set(json_moc_hdr Backend.hpp MainWindow.hpp)
	include_directories(${MathGL2_BINARY_DIR}/json)

	if(DEFINED mgl_qt_def)
		add_executable(MglForJsTestBench ${json_src} ${json_moc_hdr})
		target_link_libraries(MglForJsTestBench mgl-qt ${mgl_json_libs})
		target_compile_definitions(MglForJsTestBench PUBLIC MGL_USE_QT${mgl_qt_major} ${mgl_qt_def})
	endif(DEFINED mgl_qt_def)
endif(enable-json-sample)