set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3")
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)

macro(add_example name switch)
	if(${switch})
		# 添加可执行程序名称
		add_executable(${name} ${name}.cpp)
		# 设置安装后的动态库调用地址
		set_target_properties(${name} PROPERTIES INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/lib)
		set_target_properties(${name} PROPERTIES CXX_STANDARD 17 CXX_STANDARD_REQUIRED ON)
		target_link_libraries(${name} PRIVATE gctl)
	endif()
endmacro()

add_example(spmat_ex OFF)
add_example(eemd_ex OFF)
add_example(ceemdan_ex OFF)
add_example(fft_ex OFF)
add_example(fft2d_ex OFF)
add_example(fir_filter_ex OFF)
add_example(fft_filter_ex OFF)
add_example(windowfunc_ex OFF)
add_example(legendre_ex OFF)
add_example(refellipsoid_ex OFF)
add_example(kde_ex OFF)
add_example(meshio_ex OFF)
add_example(autodiff_ex OFF)
add_example(multinary_ex OFF)
add_example(text_io_ex OFF)
add_example(getoption_ex OFF)
add_example(process_ex OFF)
add_example(array_ex OFF)
add_example(gmt_ex OFF)
add_example(gnuplot_ex OFF)
add_example(stl_io_ex OFF)