1cmake_minimum_required(VERSION 3.1) 2project(examples) 3 4if ( CMAKE_C_COMPILER_ID MATCHES "MSVC" ) 5 # using Visual Studio C++ 6 message(STATUS "INFO: detected MSVC: will not link math lib m") 7 set(MATHLIB "") 8 add_definitions("/D_CRT_SECURE_NO_WARNINGS") 9 set(MSVC_DISABLED_WARNINGS_LIST "C4996") 10else() 11 if(PFFFT_DISABLE_LINK_WITH_M) 12 else() 13 message(STATUS "INFO: detected NO MSVC: ${CMAKE_C_COMPILER_ID}: will link math lib m") 14 set(MATHLIB "m") 15 endif() 16endif() 17 18set(STDCXXLIB "") 19if (MINGW) 20 set(STDCXXLIB "stdc++") 21endif() 22 23 24set(CMAKE_CXX_EXTENSIONS OFF) 25 26 27if (PFFFT_USE_TYPE_DOUBLE) 28 add_executable(example_cpp11_real_dbl_fwd example_cpp11_real_dbl_fwd.cpp) 29 target_compile_definitions(example_cpp11_real_dbl_fwd PRIVATE PFFFT_ENABLE_DOUBLE) 30 target_link_libraries(example_cpp11_real_dbl_fwd PFFFT ${STDCXXLIB} ${MATHLIB}) 31 set_property(TARGET example_cpp11_real_dbl_fwd PROPERTY CXX_STANDARD 11) 32 set_property(TARGET example_cpp11_real_dbl_fwd PROPERTY CXX_STANDARD_REQUIRED ON) 33 34 add_executable(example_cpp11_cplx_dbl_fwd example_cpp11_cplx_dbl_fwd.cpp) 35 target_compile_definitions(example_cpp11_cplx_dbl_fwd PRIVATE PFFFT_ENABLE_DOUBLE) 36 target_link_libraries(example_cpp11_cplx_dbl_fwd PFFFT ${STDCXXLIB} ${MATHLIB}) 37 set_property(TARGET example_cpp11_cplx_dbl_fwd PROPERTY CXX_STANDARD 11) 38 set_property(TARGET example_cpp11_cplx_dbl_fwd PROPERTY CXX_STANDARD_REQUIRED ON) 39 40 add_executable(example_c_cplx_dbl_fwd example_c_cplx_dbl_fwd.c) 41 target_compile_definitions(example_c_cplx_dbl_fwd PRIVATE PFFFT_ENABLE_FLOAT) 42 target_link_libraries(example_c_cplx_dbl_fwd PFFFT ${MATHLIB}) 43endif() 44 45 46if (PFFFT_USE_TYPE_FLOAT) 47 add_executable(example_cpp98_real_flt_fwd example_cpp98_real_flt_fwd.cpp) 48 target_compile_definitions(example_cpp98_real_flt_fwd PRIVATE PFFFT_ENABLE_FLOAT) 49 target_link_libraries(example_cpp98_real_flt_fwd PFFFT ${STDCXXLIB} ${MATHLIB}) 50 set_property(TARGET example_cpp98_real_flt_fwd PROPERTY CXX_STANDARD 98) 51 set_property(TARGET example_cpp98_real_flt_fwd PROPERTY CXX_STANDARD_REQUIRED ON) 52 53 add_executable(example_cpp98_cplx_flt_fwd example_cpp98_cplx_flt_fwd.cpp) 54 target_compile_definitions(example_cpp98_cplx_flt_fwd PRIVATE PFFFT_ENABLE_FLOAT) 55 target_link_libraries(example_cpp98_cplx_flt_fwd PFFFT ${STDCXXLIB} ${MATHLIB}) 56 set_property(TARGET example_cpp98_cplx_flt_fwd PROPERTY CXX_STANDARD 98) 57 set_property(TARGET example_cpp98_cplx_flt_fwd PROPERTY CXX_STANDARD_REQUIRED ON) 58 59 add_executable(example_c_real_flt_fwd example_c_real_flt_fwd.c) 60 target_compile_definitions(example_c_real_flt_fwd PRIVATE PFFFT_ENABLE_FLOAT) 61 target_link_libraries(example_c_real_flt_fwd PFFFT ${MATHLIB}) 62endif() 63 64