# SPDX-License-Identifier: LGPL-2.1-or-later

add_executable(FreeCADWebPartBoxProbe PartBoxProbe.cpp)
target_compile_features(FreeCADWebPartBoxProbe PRIVATE cxx_std_17)
target_compile_options(FreeCADWebPartBoxProbe PRIVATE "-O2" "-g0" "-fexceptions")
target_include_directories(FreeCADWebPartBoxProbe PRIVATE
    "${CMAKE_BINARY_DIR}"
    "${CMAKE_BINARY_DIR}/src"
    "${CMAKE_SOURCE_DIR}/src"
)
set(_freecad_web_python_build "${FREECAD_WEB_DEPENDENCY_ROOT}/python-probe")
set(_freecad_web_python_encodings "${FREECAD_WEB_PYTHON_ROOT}/lib/python3.12/encodings")
target_link_libraries(FreeCADWebPartBoxProbe PRIVATE
    Part
    ${Python3_LIBRARIES}
    "${_freecad_web_python_build}/Modules/_decimal/libmpdec/libmpdec.a"
    "${_freecad_web_python_build}/Modules/_hacl/libHacl_Hash_SHA2.a"
    "${_freecad_web_python_build}/Modules/expat/libexpat.a"
)
target_link_options(FreeCADWebPartBoxProbe PRIVATE
    "-O2"
    "-g0"
    "--no-entry"
    "-sWASM=1"
    "-sMODULARIZE=1"
    "-sEXPORT_ES6=1"
    "-sEXPORT_NAME=FreeCADWebPartBoxProbe"
    "-sALLOW_MEMORY_GROWTH=1"
    "-sINITIAL_MEMORY=33554432"
    "-sENVIRONMENT=web,worker,node"
    "-sUSE_BZIP2=1"
    "-sDISABLE_EXCEPTION_CATCHING=0"
    "-sEXPORTED_RUNTIME_METHODS=['ccall']"
    "--embed-file=${_freecad_web_python_encodings}@/freecad-python/encodings"
)
set_target_properties(FreeCADWebPartBoxProbe PROPERTIES
    SUFFIX ".js"
    RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin"
)

add_executable(FreeCADWebPartIoProbe PartIoProbe.cpp)
target_compile_features(FreeCADWebPartIoProbe PRIVATE cxx_std_17)
target_compile_options(FreeCADWebPartIoProbe PRIVATE "-O2" "-g0" "-fexceptions")
target_include_directories(FreeCADWebPartIoProbe PRIVATE "${CMAKE_BINARY_DIR}" "${CMAKE_BINARY_DIR}/src" "${CMAKE_SOURCE_DIR}/src")
target_link_libraries(FreeCADWebPartIoProbe PRIVATE Part ${Python3_LIBRARIES}
    "${_freecad_web_python_build}/Modules/_decimal/libmpdec/libmpdec.a"
    "${_freecad_web_python_build}/Modules/_hacl/libHacl_Hash_SHA2.a"
    "${_freecad_web_python_build}/Modules/expat/libexpat.a")
target_link_options(FreeCADWebPartIoProbe PRIVATE "-O2" "-g0" "--no-entry" "-sWASM=1" "-sMODULARIZE=1" "-sEXPORT_ES6=1" "-sEXPORT_NAME=FreeCADWebPartIoProbe" "-sALLOW_MEMORY_GROWTH=1" "-sINITIAL_MEMORY=33554432" "-sENVIRONMENT=web,worker,node" "-sUSE_BZIP2=1" "-sDISABLE_EXCEPTION_CATCHING=0" "-sEXPORTED_RUNTIME_METHODS=['ccall']" "--embed-file=${_freecad_web_python_encodings}@/freecad-python/encodings")
set_target_properties(FreeCADWebPartIoProbe PROPERTIES SUFFIX ".js" RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")

add_executable(FreeCADWebModuleLoaderProbe ModuleLoaderProbe.cpp)
target_compile_features(FreeCADWebModuleLoaderProbe PRIVATE cxx_std_17)
target_compile_options(FreeCADWebModuleLoaderProbe PRIVATE "-O2" "-g0" "-fexceptions")
target_include_directories(FreeCADWebModuleLoaderProbe PRIVATE
    "${CMAKE_BINARY_DIR}"
    "${CMAKE_BINARY_DIR}/src"
    "${CMAKE_SOURCE_DIR}/src"
)
target_link_libraries(FreeCADWebModuleLoaderProbe PRIVATE
    Part
    ${Python3_LIBRARIES}
    "${_freecad_web_python_build}/Modules/_decimal/libmpdec/libmpdec.a"
    "${_freecad_web_python_build}/Modules/_hacl/libHacl_Hash_SHA2.a"
    "${_freecad_web_python_build}/Modules/expat/libexpat.a"
)
target_link_options(FreeCADWebModuleLoaderProbe PRIVATE
    "-O2"
    "-g0"
    "--no-entry"
    "-sWASM=1"
    "-sMODULARIZE=1"
    "-sEXPORT_ES6=1"
    "-sEXPORT_NAME=FreeCADWebModuleLoaderProbe"
    "-sALLOW_MEMORY_GROWTH=1"
    "-sINITIAL_MEMORY=33554432"
    "-sENVIRONMENT=web,worker,node"
    "-sUSE_BZIP2=1"
    "-sDISABLE_EXCEPTION_CATCHING=0"
    "-sEXPORTED_RUNTIME_METHODS=['ccall']"
    "--embed-file=${_freecad_web_python_encodings}@/freecad-python/encodings"
)
set_target_properties(FreeCADWebModuleLoaderProbe PROPERTIES
    SUFFIX ".js"
    RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin"
)

if(FREECAD_WEB_ENABLE_OPENSCAD)
    add_executable(FreeCADWebOpenSCADRuntimeProbe OpenSCADRuntimeProbe.cpp)
    target_compile_features(FreeCADWebOpenSCADRuntimeProbe PRIVATE cxx_std_17)
    target_compile_options(FreeCADWebOpenSCADRuntimeProbe PRIVATE "-O2" "-g0" "-fexceptions")
    target_include_directories(FreeCADWebOpenSCADRuntimeProbe PRIVATE
        "${CMAKE_BINARY_DIR}"
        "${CMAKE_BINARY_DIR}/src"
        "${CMAKE_SOURCE_DIR}/src"
    )
    target_link_libraries(FreeCADWebOpenSCADRuntimeProbe PRIVATE
        Part
        ${Python3_LIBRARIES}
        "${_freecad_web_python_build}/Modules/_decimal/libmpdec/libmpdec.a"
        "${_freecad_web_python_build}/Modules/_hacl/libHacl_Hash_SHA2.a"
        "${_freecad_web_python_build}/Modules/expat/libexpat.a"
    )
    target_link_options(FreeCADWebOpenSCADRuntimeProbe PRIVATE
        "-O2"
        "-g0"
        "--no-entry"
        "-sWASM=1"
        "-sMODULARIZE=1"
        "-sEXPORT_ES6=1"
        "-sEXPORT_NAME=FreeCADWebOpenSCADRuntimeProbe"
        "-sALLOW_MEMORY_GROWTH=1"
        "-sINITIAL_MEMORY=33554432"
        "-sENVIRONMENT=web,worker,node"
        "-sUSE_BZIP2=1"
        "-sDISABLE_EXCEPTION_CATCHING=0"
        "-sEXPORTED_RUNTIME_METHODS=['ccall']"
        "--embed-file=${_freecad_web_python_encodings}@/freecad-python/encodings"
        "--embed-file=${CMAKE_SOURCE_DIR}/src/Mod/OpenSCAD/Init.py@/freecad-mod/OpenSCAD/Init.py"
        "--embed-file=${CMAKE_SOURCE_DIR}/src/Mod/OpenSCAD/OpenSCADUtils.py@/freecad-mod/OpenSCAD/OpenSCADUtils.py"
    )
    set_target_properties(FreeCADWebOpenSCADRuntimeProbe PROPERTIES
        SUFFIX ".js"
        RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin"
    )
endif()

add_executable(FreeCADWebImportRuntimeProbe ImportRuntimeProbe.cpp)
target_compile_features(FreeCADWebImportRuntimeProbe PRIVATE cxx_std_17)
target_compile_options(FreeCADWebImportRuntimeProbe PRIVATE "-O2" "-g0" "-fexceptions")
target_include_directories(FreeCADWebImportRuntimeProbe PRIVATE
    "${CMAKE_BINARY_DIR}"
    "${CMAKE_BINARY_DIR}/src"
    "${CMAKE_SOURCE_DIR}/src"
)
target_link_libraries(FreeCADWebImportRuntimeProbe PRIVATE
    Import
    ${Python3_LIBRARIES}
    "${_freecad_web_python_build}/Modules/_decimal/libmpdec/libmpdec.a"
    "${_freecad_web_python_build}/Modules/_hacl/libHacl_Hash_SHA2.a"
    "${_freecad_web_python_build}/Modules/expat/libexpat.a"
)
target_link_options(FreeCADWebImportRuntimeProbe PRIVATE
    "-O2"
    "-g0"
    "--no-entry"
    "-sWASM=1"
    "-sMODULARIZE=1"
    "-sEXPORT_ES6=1"
    "-sEXPORT_NAME=FreeCADWebImportRuntimeProbe"
    "-sALLOW_MEMORY_GROWTH=1"
    "-sINITIAL_MEMORY=33554432"
    "-sENVIRONMENT=web,worker,node"
    "-sUSE_BZIP2=1"
    "-sDISABLE_EXCEPTION_CATCHING=0"
    "-sEXPORTED_RUNTIME_METHODS=['ccall']"
    "--embed-file=${_freecad_web_python_encodings}@/freecad-python/encodings"
    "--embed-file=${CMAKE_SOURCE_DIR}/../web/public/samples/freecad-sample.step@/fixtures/freecad-sample.step"
)
set_target_properties(FreeCADWebImportRuntimeProbe PROPERTIES
    SUFFIX ".js"
    RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin"
)

if(BUILD_INSPECTION)
    add_executable(FreeCADWebInspectionRuntimeProbe InspectionRuntimeProbe.cpp)
    target_compile_features(FreeCADWebInspectionRuntimeProbe PRIVATE cxx_std_17)
    target_compile_options(FreeCADWebInspectionRuntimeProbe PRIVATE "-O2" "-g0" "-fexceptions")
    target_include_directories(FreeCADWebInspectionRuntimeProbe PRIVATE
        "${CMAKE_BINARY_DIR}"
        "${CMAKE_BINARY_DIR}/src"
        "${CMAKE_SOURCE_DIR}/src"
    )
    target_link_libraries(FreeCADWebInspectionRuntimeProbe PRIVATE
        Inspection
        ${Python3_LIBRARIES}
        "${_freecad_web_python_build}/Modules/_decimal/libmpdec/libmpdec.a"
        "${_freecad_web_python_build}/Modules/_hacl/libHacl_Hash_SHA2.a"
        "${_freecad_web_python_build}/Modules/expat/libexpat.a"
    )
    target_link_options(FreeCADWebInspectionRuntimeProbe PRIVATE
        "-O2"
        "-g0"
        "--no-entry"
        "-sWASM=1"
        "-sMODULARIZE=1"
        "-sEXPORT_ES6=1"
        "-sEXPORT_NAME=FreeCADWebInspectionRuntimeProbe"
        "-sALLOW_MEMORY_GROWTH=1"
        "-sINITIAL_MEMORY=33554432"
        "-sENVIRONMENT=web,worker,node"
        "-sUSE_BZIP2=1"
        "-sDISABLE_EXCEPTION_CATCHING=0"
        "-sEXPORTED_RUNTIME_METHODS=['ccall']"
        "--embed-file=${_freecad_web_python_encodings}@/freecad-python/encodings"
    )
set_target_properties(FreeCADWebInspectionRuntimeProbe PROPERTIES
        SUFFIX ".js"
        RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin"
    )
endif()

if(BUILD_MATERIAL)
    add_executable(FreeCADWebMaterialRuntimeProbe MaterialRuntimeProbe.cpp)
    target_compile_features(FreeCADWebMaterialRuntimeProbe PRIVATE cxx_std_17)
    target_compile_options(FreeCADWebMaterialRuntimeProbe PRIVATE "-O2" "-g0" "-fexceptions")
    target_include_directories(FreeCADWebMaterialRuntimeProbe PRIVATE
        "${CMAKE_BINARY_DIR}" "${CMAKE_BINARY_DIR}/src" "${CMAKE_SOURCE_DIR}/src")
    target_link_libraries(FreeCADWebMaterialRuntimeProbe PRIVATE
        Materials
        ${Python3_LIBRARIES}
        "${_freecad_web_python_build}/Modules/_decimal/libmpdec/libmpdec.a"
        "${_freecad_web_python_build}/Modules/_hacl/libHacl_Hash_SHA2.a"
        "${_freecad_web_python_build}/Modules/expat/libexpat.a")
    target_link_options(FreeCADWebMaterialRuntimeProbe PRIVATE
        "-O2" "-g0" "--no-entry" "-sWASM=1" "-sMODULARIZE=1" "-sEXPORT_ES6=1"
        "-sEXPORT_NAME=FreeCADWebMaterialRuntimeProbe" "-sALLOW_MEMORY_GROWTH=1"
        "-sINITIAL_MEMORY=33554432" "-sENVIRONMENT=web,worker,node" "-sUSE_BZIP2=1"
        "-sDISABLE_EXCEPTION_CATCHING=0" "-sEXPORTED_RUNTIME_METHODS=['ccall']"
        "--embed-file=${_freecad_web_python_encodings}@/freecad-python/encodings")
    set_target_properties(FreeCADWebMaterialRuntimeProbe PROPERTIES
        SUFFIX ".js" RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
    add_executable(FreeCADWebMaterialKernelProbe MaterialKernelProbe.cpp)
    target_compile_features(FreeCADWebMaterialKernelProbe PRIVATE cxx_std_17)
    target_compile_options(FreeCADWebMaterialKernelProbe PRIVATE "-O2" "-g0" "-fexceptions")
    target_include_directories(FreeCADWebMaterialKernelProbe PRIVATE
        "${CMAKE_BINARY_DIR}" "${CMAKE_BINARY_DIR}/src" "${CMAKE_SOURCE_DIR}/src")
    target_link_libraries(FreeCADWebMaterialKernelProbe PRIVATE
        Materials
        ${Python3_LIBRARIES}
        "${_freecad_web_python_build}/Modules/_decimal/libmpdec/libmpdec.a"
        "${_freecad_web_python_build}/Modules/_hacl/libHacl_Hash_SHA2.a"
        "${_freecad_web_python_build}/Modules/expat/libexpat.a")
    target_link_options(FreeCADWebMaterialKernelProbe PRIVATE
        "-O2" "-g0" "--no-entry" "-sWASM=1" "-sMODULARIZE=1" "-sEXPORT_ES6=1"
        "-sEXPORT_NAME=FreeCADWebMaterialKernelProbe" "-sALLOW_MEMORY_GROWTH=1"
        "-sINITIAL_MEMORY=33554432" "-sENVIRONMENT=web,worker,node" "-sUSE_BZIP2=1"
        "-sDISABLE_EXCEPTION_CATCHING=0" "-sEXPORTED_RUNTIME_METHODS=['ccall']"
        "--embed-file=${_freecad_web_python_encodings}@/freecad-python/encodings")
    set_target_properties(FreeCADWebMaterialKernelProbe PROPERTIES
        SUFFIX ".js" RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
    add_executable(FreeCADWebMaterialPythonKernelProbe MaterialPythonKernelProbe.cpp)
    target_compile_features(FreeCADWebMaterialPythonKernelProbe PRIVATE cxx_std_17)
    target_compile_options(FreeCADWebMaterialPythonKernelProbe PRIVATE "-O2" "-g0" "-fexceptions")
    target_include_directories(FreeCADWebMaterialPythonKernelProbe PRIVATE
        "${CMAKE_BINARY_DIR}" "${CMAKE_BINARY_DIR}/src" "${CMAKE_SOURCE_DIR}/src")
    target_link_libraries(FreeCADWebMaterialPythonKernelProbe PRIVATE
        Materials
        ${Python3_LIBRARIES}
        "${_freecad_web_python_build}/Modules/_decimal/libmpdec/libmpdec.a"
        "${_freecad_web_python_build}/Modules/_hacl/libHacl_Hash_SHA2.a"
        "${_freecad_web_python_build}/Modules/expat/libexpat.a")
    target_link_options(FreeCADWebMaterialPythonKernelProbe PRIVATE
        "-O2" "-g0" "--no-entry" "-sWASM=1" "-sMODULARIZE=1" "-sEXPORT_ES6=1"
        "-sEXPORT_NAME=FreeCADWebMaterialPythonKernelProbe" "-sALLOW_MEMORY_GROWTH=1"
        "-sINITIAL_MEMORY=33554432" "-sENVIRONMENT=web,worker,node" "-sUSE_BZIP2=1"
        "-sDISABLE_EXCEPTION_CATCHING=0" "-sEXPORTED_RUNTIME_METHODS=['ccall']"
        "--embed-file=${_freecad_web_python_encodings}@/freecad-python/encodings")
    set_target_properties(FreeCADWebMaterialPythonKernelProbe PROPERTIES
        SUFFIX ".js" RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
endif()

if(BUILD_JTREADER)
    add_executable(FreeCADWebJtReaderRuntimeProbe JtReaderRuntimeProbe.cpp)
    target_compile_features(FreeCADWebJtReaderRuntimeProbe PRIVATE cxx_std_17)
    target_compile_options(FreeCADWebJtReaderRuntimeProbe PRIVATE "-O2" "-g0" "-fexceptions")
    target_include_directories(FreeCADWebJtReaderRuntimeProbe PRIVATE
        "${CMAKE_BINARY_DIR}" "${CMAKE_BINARY_DIR}/src" "${CMAKE_SOURCE_DIR}/src")
    target_link_libraries(FreeCADWebJtReaderRuntimeProbe PRIVATE
        JtReader
        ${Python3_LIBRARIES}
        "${_freecad_web_python_build}/Modules/_decimal/libmpdec/libmpdec.a"
        "${_freecad_web_python_build}/Modules/_hacl/libHacl_Hash_SHA2.a"
        "${_freecad_web_python_build}/Modules/expat/libexpat.a")
    target_link_options(FreeCADWebJtReaderRuntimeProbe PRIVATE
        "-O2" "-g0" "--no-entry" "-sWASM=1" "-sMODULARIZE=1" "-sEXPORT_ES6=1"
        "-sEXPORT_NAME=FreeCADWebJtReaderRuntimeProbe" "-sALLOW_MEMORY_GROWTH=1"
        "-sINITIAL_MEMORY=33554432" "-sENVIRONMENT=web,worker,node" "-sUSE_BZIP2=1"
        "-sDISABLE_EXCEPTION_CATCHING=0" "-sEXPORTED_RUNTIME_METHODS=['ccall']"
        "--embed-file=${_freecad_web_python_encodings}@/freecad-python/encodings")
    set_target_properties(FreeCADWebJtReaderRuntimeProbe PROPERTIES
        SUFFIX ".js" RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
endif()

if(BUILD_MEASURE)
    add_executable(FreeCADWebMeasureRuntimeProbe MeasureRuntimeProbe.cpp)
    target_compile_features(FreeCADWebMeasureRuntimeProbe PRIVATE cxx_std_17)
    target_compile_options(FreeCADWebMeasureRuntimeProbe PRIVATE "-O2" "-g0" "-fexceptions")
    target_include_directories(FreeCADWebMeasureRuntimeProbe PRIVATE "${CMAKE_BINARY_DIR}" "${CMAKE_BINARY_DIR}/src" "${CMAKE_SOURCE_DIR}/src")
    target_link_libraries(FreeCADWebMeasureRuntimeProbe PRIVATE Measure Materials ${Python3_LIBRARIES} "${_freecad_web_python_build}/Modules/_decimal/libmpdec/libmpdec.a" "${_freecad_web_python_build}/Modules/_hacl/libHacl_Hash_SHA2.a" "${_freecad_web_python_build}/Modules/expat/libexpat.a")
    target_link_options(FreeCADWebMeasureRuntimeProbe PRIVATE "-O2" "-g0" "--no-entry" "-sWASM=1" "-sMODULARIZE=1" "-sEXPORT_ES6=1" "-sEXPORT_NAME=FreeCADWebMeasureRuntimeProbe" "-sALLOW_MEMORY_GROWTH=1" "-sINITIAL_MEMORY=33554432" "-sENVIRONMENT=web,worker,node" "-sUSE_BZIP2=1" "-sDISABLE_EXCEPTION_CATCHING=0" "-sEXPORTED_RUNTIME_METHODS=['ccall']" "--embed-file=${_freecad_web_python_encodings}@/freecad-python/encodings")
    set_target_properties(FreeCADWebMeasureRuntimeProbe PROPERTIES SUFFIX ".js" RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
    add_executable(FreeCADWebMeasureKernelProbe MeasureKernelProbe.cpp)
    target_compile_features(FreeCADWebMeasureKernelProbe PRIVATE cxx_std_17)
    target_compile_options(FreeCADWebMeasureKernelProbe PRIVATE "-O2" "-g0" "-fexceptions")
    target_include_directories(FreeCADWebMeasureKernelProbe PRIVATE "${CMAKE_BINARY_DIR}" "${CMAKE_BINARY_DIR}/src" "${CMAKE_SOURCE_DIR}/src")
    target_link_libraries(FreeCADWebMeasureKernelProbe PRIVATE Measure Materials ${Python3_LIBRARIES} "${_freecad_web_python_build}/Modules/_decimal/libmpdec/libmpdec.a" "${_freecad_web_python_build}/Modules/_hacl/libHacl_Hash_SHA2.a" "${_freecad_web_python_build}/Modules/expat/libexpat.a")
    target_link_options(FreeCADWebMeasureKernelProbe PRIVATE "-O2" "-g0" "--no-entry" "-sWASM=1" "-sMODULARIZE=1" "-sEXPORT_ES6=1" "-sEXPORT_NAME=FreeCADWebMeasureKernelProbe" "-sALLOW_MEMORY_GROWTH=1" "-sINITIAL_MEMORY=33554432" "-sENVIRONMENT=web,worker,node" "-sUSE_BZIP2=1" "-sDISABLE_EXCEPTION_CATCHING=0" "-sEXPORTED_RUNTIME_METHODS=['ccall']" "--embed-file=${_freecad_web_python_encodings}@/freecad-python/encodings")
    set_target_properties(FreeCADWebMeasureKernelProbe PROPERTIES SUFFIX ".js" RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
endif()

if(BUILD_MESH)
    add_executable(FreeCADWebMeshRuntimeProbe MeshRuntimeProbe.cpp)
    target_compile_features(FreeCADWebMeshRuntimeProbe PRIVATE cxx_std_17)
    target_compile_options(FreeCADWebMeshRuntimeProbe PRIVATE "-O2" "-g0" "-fexceptions")
    target_include_directories(FreeCADWebMeshRuntimeProbe PRIVATE "${CMAKE_BINARY_DIR}" "${CMAKE_BINARY_DIR}/src" "${CMAKE_SOURCE_DIR}/src")
    target_link_libraries(FreeCADWebMeshRuntimeProbe PRIVATE Mesh ${Python3_LIBRARIES} "${_freecad_web_python_build}/Modules/_decimal/libmpdec/libmpdec.a" "${_freecad_web_python_build}/Modules/_hacl/libHacl_Hash_SHA2.a" "${_freecad_web_python_build}/Modules/expat/libexpat.a")
    target_link_options(FreeCADWebMeshRuntimeProbe PRIVATE "-O2" "-g0" "--no-entry" "-sWASM=1" "-sMODULARIZE=1" "-sEXPORT_ES6=1" "-sEXPORT_NAME=FreeCADWebMeshRuntimeProbe" "-sALLOW_MEMORY_GROWTH=1" "-sINITIAL_MEMORY=33554432" "-sENVIRONMENT=web,worker,node" "-sUSE_BZIP2=1" "-sDISABLE_EXCEPTION_CATCHING=0" "-sEXPORTED_RUNTIME_METHODS=['ccall']" "--embed-file=${_freecad_web_python_encodings}@/freecad-python/encodings")
    set_target_properties(FreeCADWebMeshRuntimeProbe PROPERTIES SUFFIX ".js" RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
endif()

if(BUILD_MESH_PART)
    add_executable(FreeCADWebMeshPartRuntimeProbe MeshPartRuntimeProbe.cpp)
    target_compile_features(FreeCADWebMeshPartRuntimeProbe PRIVATE cxx_std_17)
    target_compile_options(FreeCADWebMeshPartRuntimeProbe PRIVATE "-O2" "-g0" "-fexceptions")
    target_include_directories(FreeCADWebMeshPartRuntimeProbe PRIVATE "${CMAKE_BINARY_DIR}" "${CMAKE_BINARY_DIR}/src" "${CMAKE_SOURCE_DIR}/src")
    target_link_libraries(FreeCADWebMeshPartRuntimeProbe PRIVATE MeshPart Materials ${Python3_LIBRARIES} "${_freecad_web_python_build}/Modules/_decimal/libmpdec/libmpdec.a" "${_freecad_web_python_build}/Modules/_hacl/libHacl_Hash_SHA2.a" "${_freecad_web_python_build}/Modules/expat/libexpat.a")
    target_link_options(FreeCADWebMeshPartRuntimeProbe PRIVATE "-O2" "-g0" "--no-entry" "-sWASM=1" "-sMODULARIZE=1" "-sEXPORT_ES6=1" "-sEXPORT_NAME=FreeCADWebMeshPartRuntimeProbe" "-sALLOW_MEMORY_GROWTH=1" "-sINITIAL_MEMORY=33554432" "-sENVIRONMENT=web,worker,node" "-sUSE_BZIP2=1" "-sDISABLE_EXCEPTION_CATCHING=0" "-sEXPORTED_RUNTIME_METHODS=['ccall']" "--embed-file=${_freecad_web_python_encodings}@/freecad-python/encodings")
    set_target_properties(FreeCADWebMeshPartRuntimeProbe PROPERTIES SUFFIX ".js" RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
endif()

add_executable(FreeCADWebAssemblyProbe AssemblyRuntimeProbe.cpp)
target_compile_features(FreeCADWebAssemblyProbe PRIVATE cxx_std_17)
target_compile_options(FreeCADWebAssemblyProbe PRIVATE "-O2" "-g0" "-fexceptions")
target_include_directories(FreeCADWebAssemblyProbe PRIVATE
    "${CMAKE_BINARY_DIR}"
    "${CMAKE_BINARY_DIR}/src"
    "${CMAKE_SOURCE_DIR}/src"
)
target_link_libraries(FreeCADWebAssemblyProbe PRIVATE
    Assembly
    ${Python3_LIBRARIES}
    "${_freecad_web_python_build}/Modules/_decimal/libmpdec/libmpdec.a"
    "${_freecad_web_python_build}/Modules/_hacl/libHacl_Hash_SHA2.a"
    "${_freecad_web_python_build}/Modules/expat/libexpat.a"
)
target_link_options(FreeCADWebAssemblyProbe PRIVATE
    "-O2"
    "-g0"
    "--no-entry"
    "-sWASM=1"
    "-sMODULARIZE=1"
    "-sEXPORT_ES6=1"
    "-sEXPORT_NAME=FreeCADWebAssemblyProbe"
    "-sALLOW_MEMORY_GROWTH=1"
    "-sINITIAL_MEMORY=33554432"
    "-sENVIRONMENT=web,worker,node"
    "-sUSE_BZIP2=1"
    "-sDISABLE_EXCEPTION_CATCHING=0"
    "-sEXPORTED_RUNTIME_METHODS=['ccall']"
    "--embed-file=${_freecad_web_python_encodings}@/freecad-python/encodings"
)
set_target_properties(FreeCADWebAssemblyProbe PROPERTIES
    SUFFIX ".js"
    RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin"
)

add_executable(FreeCADWebAssemblyKernelProbe AssemblyKernelProbe.cpp)
target_compile_features(FreeCADWebAssemblyKernelProbe PRIVATE cxx_std_17)
target_compile_options(FreeCADWebAssemblyKernelProbe PRIVATE "-O2" "-g0" "-fexceptions")
target_include_directories(FreeCADWebAssemblyKernelProbe PRIVATE
    "${CMAKE_BINARY_DIR}"
    "${CMAKE_BINARY_DIR}/src"
    "${CMAKE_SOURCE_DIR}/src"
    "${CMAKE_SOURCE_DIR}/src/3rdParty/OndselSolver"
)
target_link_libraries(FreeCADWebAssemblyKernelProbe PRIVATE
    Assembly
    ${Python3_LIBRARIES}
    "${_freecad_web_python_build}/Modules/_decimal/libmpdec/libmpdec.a"
    "${_freecad_web_python_build}/Modules/_hacl/libHacl_Hash_SHA2.a"
    "${_freecad_web_python_build}/Modules/expat/libexpat.a"
)
target_link_options(FreeCADWebAssemblyKernelProbe PRIVATE
    "-O2"
    "-g0"
    "--no-entry"
    "-sWASM=1"
    "-sMODULARIZE=1"
    "-sEXPORT_ES6=1"
    "-sEXPORT_NAME=FreeCADWebAssemblyKernelProbe"
    "-sALLOW_MEMORY_GROWTH=1"
    "-sINITIAL_MEMORY=33554432"
    "-sENVIRONMENT=web,worker,node"
    "-sUSE_BZIP2=1"
    "-sDISABLE_EXCEPTION_CATCHING=0"
    "-sEXPORTED_RUNTIME_METHODS=['ccall']"
    "--embed-file=${_freecad_web_python_encodings}@/freecad-python/encodings"
)
set_target_properties(FreeCADWebAssemblyKernelProbe PROPERTIES
    SUFFIX ".js"
    RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin"
)

if(BUILD_CAM)
    add_executable(FreeCADWebCAMProbe CAMRuntimeProbe.cpp)
    target_compile_features(FreeCADWebCAMProbe PRIVATE cxx_std_17)
    target_compile_options(FreeCADWebCAMProbe PRIVATE "-O2" "-g0" "-fexceptions")
    target_include_directories(FreeCADWebCAMProbe PRIVATE
        "${CMAKE_BINARY_DIR}"
        "${CMAKE_BINARY_DIR}/src"
        "${CMAKE_SOURCE_DIR}/src"
    )
    target_link_libraries(FreeCADWebCAMProbe PRIVATE
        Path
        ${Python3_LIBRARIES}
        "${_freecad_web_python_build}/Modules/_decimal/libmpdec/libmpdec.a"
        "${_freecad_web_python_build}/Modules/_hacl/libHacl_Hash_SHA2.a"
        "${_freecad_web_python_build}/Modules/expat/libexpat.a"
    )
    target_link_options(FreeCADWebCAMProbe PRIVATE
        "-O2"
        "-g0"
        "--no-entry"
        "-sWASM=1"
        "-sMODULARIZE=1"
        "-sEXPORT_ES6=1"
        "-sEXPORT_NAME=FreeCADWebCAMProbe"
        "-sALLOW_MEMORY_GROWTH=1"
        "-sINITIAL_MEMORY=33554432"
        "-sENVIRONMENT=web,worker,node"
        "-sUSE_BZIP2=1"
        "-sDISABLE_EXCEPTION_CATCHING=0"
        "-sEXPORTED_RUNTIME_METHODS=['ccall','FS']"
        "--embed-file=${_freecad_web_python_encodings}@/freecad-python/encodings"
    )
    set_target_properties(FreeCADWebCAMProbe PROPERTIES
        SUFFIX ".js"
        RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin"
    )
endif()

add_executable(FreeCADWebDocumentProbe DocumentProbe.cpp)
target_compile_features(FreeCADWebDocumentProbe PRIVATE cxx_std_17)
target_compile_options(FreeCADWebDocumentProbe PRIVATE "-O2" "-g0" "-fexceptions")
target_include_directories(FreeCADWebDocumentProbe PRIVATE
    "${CMAKE_BINARY_DIR}"
    "${CMAKE_BINARY_DIR}/src"
    "${CMAKE_SOURCE_DIR}/src"
)
target_link_libraries(FreeCADWebDocumentProbe PRIVATE
    Part
    ${Python3_LIBRARIES}
    "${_freecad_web_python_build}/Modules/_decimal/libmpdec/libmpdec.a"
    "${_freecad_web_python_build}/Modules/_hacl/libHacl_Hash_SHA2.a"
    "${_freecad_web_python_build}/Modules/expat/libexpat.a"
)
target_link_options(FreeCADWebDocumentProbe PRIVATE
    "-O2"
    "-g0"
    "--no-entry"
    "-sWASM=1"
    "-sMODULARIZE=1"
    "-sEXPORT_ES6=1"
    "-sEXPORT_NAME=FreeCADWebDocumentProbe"
    "-sALLOW_MEMORY_GROWTH=1"
    "-sINITIAL_MEMORY=33554432"
    "-sENVIRONMENT=web,worker,node"
    "-sUSE_BZIP2=1"
    "-sDISABLE_EXCEPTION_CATCHING=0"
    "-sEXPORTED_RUNTIME_METHODS=['ccall','FS']"
    "--embed-file=${_freecad_web_python_encodings}@/freecad-python/encodings"
)
set_target_properties(FreeCADWebDocumentProbe PROPERTIES
    SUFFIX ".js"
    RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin"
)

add_executable(FreeCADWebSketcherProbe SketcherProbe.cpp)
target_compile_features(FreeCADWebSketcherProbe PRIVATE cxx_std_17)
target_compile_options(FreeCADWebSketcherProbe PRIVATE "-O2" "-g0" "-fexceptions")
target_include_directories(FreeCADWebSketcherProbe PRIVATE
    "${CMAKE_BINARY_DIR}"
    "${CMAKE_BINARY_DIR}/src"
    "${CMAKE_SOURCE_DIR}/src"
)
target_link_libraries(FreeCADWebSketcherProbe PRIVATE
    Sketcher
    ${Python3_LIBRARIES}
    "${_freecad_web_python_build}/Modules/_decimal/libmpdec/libmpdec.a"
    "${_freecad_web_python_build}/Modules/_hacl/libHacl_Hash_SHA2.a"
    "${_freecad_web_python_build}/Modules/expat/libexpat.a"
)
target_link_options(FreeCADWebSketcherProbe PRIVATE
    "-O2"
    "-g0"
    "--no-entry"
    "-sWASM=1"
    "-sMODULARIZE=1"
    "-sEXPORT_ES6=1"
    "-sEXPORT_NAME=FreeCADWebSketcherProbe"
    "-sALLOW_MEMORY_GROWTH=1"
    "-sINITIAL_MEMORY=33554432"
    "-sENVIRONMENT=web,worker,node"
    "-sUSE_BZIP2=1"
    "-sDISABLE_EXCEPTION_CATCHING=0"
    "-sEXPORTED_RUNTIME_METHODS=['ccall']"
    "--embed-file=${_freecad_web_python_encodings}@/freecad-python/encodings"
)
set_target_properties(FreeCADWebSketcherProbe PROPERTIES
    SUFFIX ".js"
    RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin"
)

add_executable(FreeCADWebPythonProbe PythonRuntimeProbe.cpp)
target_compile_features(FreeCADWebPythonProbe PRIVATE cxx_std_17)
target_compile_options(FreeCADWebPythonProbe PRIVATE "-O2" "-g0" "-fexceptions")
target_include_directories(FreeCADWebPythonProbe PRIVATE
    "${CMAKE_BINARY_DIR}"
    "${CMAKE_BINARY_DIR}/src"
    "${CMAKE_SOURCE_DIR}/src"
)
target_link_libraries(FreeCADWebPythonProbe PRIVATE
    Part
    ${Python3_LIBRARIES}
    "${_freecad_web_python_build}/Modules/_decimal/libmpdec/libmpdec.a"
    "${_freecad_web_python_build}/Modules/_hacl/libHacl_Hash_SHA2.a"
    "${_freecad_web_python_build}/Modules/expat/libexpat.a"
)
target_link_options(FreeCADWebPythonProbe PRIVATE
    "-O2"
    "-g0"
    "--no-entry"
    "-sWASM=1"
    "-sMODULARIZE=1"
    "-sEXPORT_ES6=1"
    "-sEXPORT_NAME=FreeCADWebPythonProbe"
    "-sALLOW_MEMORY_GROWTH=1"
    "-sINITIAL_MEMORY=33554432"
    "-sENVIRONMENT=web,worker,node"
    "-sUSE_BZIP2=1"
    "-sDISABLE_EXCEPTION_CATCHING=0"
    "-sEXPORTED_RUNTIME_METHODS=['ccall']"
    "--embed-file=${_freecad_web_python_encodings}@/freecad-python/encodings"
)
set_target_properties(FreeCADWebPythonProbe PROPERTIES
    SUFFIX ".js"
    RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin"
)

if(BUILD_CLOUD)
    add_executable(FreeCADWebCloudProbe CloudRuntimeProbe.cpp)
    target_compile_features(FreeCADWebCloudProbe PRIVATE cxx_std_17)
    target_compile_options(FreeCADWebCloudProbe PRIVATE "-O2" "-g0" "-fexceptions")
    target_include_directories(FreeCADWebCloudProbe PRIVATE
        "${CMAKE_BINARY_DIR}"
        "${CMAKE_BINARY_DIR}/src"
        "${CMAKE_SOURCE_DIR}/src"
    )
    target_link_libraries(FreeCADWebCloudProbe PRIVATE
        Cloud
        ${Python3_LIBRARIES}
        "${_freecad_web_python_build}/Modules/_decimal/libmpdec/libmpdec.a"
        "${_freecad_web_python_build}/Modules/_hacl/libHacl_Hash_SHA2.a"
        "${_freecad_web_python_build}/Modules/expat/libexpat.a"
    )
    target_link_options(FreeCADWebCloudProbe PRIVATE
        "-O2"
        "-g0"
        "--no-entry"
        "-sWASM=1"
        "-sMODULARIZE=1"
        "-sEXPORT_ES6=1"
        "-sEXPORT_NAME=FreeCADWebCloudProbe"
        "-sALLOW_MEMORY_GROWTH=1"
        "-sINITIAL_MEMORY=33554432"
        "-sENVIRONMENT=web,worker,node"
        "-sUSE_BZIP2=1"
        "-sDISABLE_EXCEPTION_CATCHING=0"
        "-sEXPORTED_RUNTIME_METHODS=['ccall']"
        "--embed-file=${_freecad_web_python_encodings}@/freecad-python/encodings"
    )
    set_target_properties(FreeCADWebCloudProbe PROPERTIES
        SUFFIX ".js"
        RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin"
    )
    add_executable(FreeCADWebCloudKernelProbe CloudKernelProbe.cpp)
    target_compile_features(FreeCADWebCloudKernelProbe PRIVATE cxx_std_17)
    target_compile_options(FreeCADWebCloudKernelProbe PRIVATE "-O2" "-g0" "-fexceptions")
    target_include_directories(FreeCADWebCloudKernelProbe PRIVATE
        "${CMAKE_BINARY_DIR}"
        "${CMAKE_BINARY_DIR}/src"
        "${CMAKE_SOURCE_DIR}/src"
    )
    target_link_libraries(FreeCADWebCloudKernelProbe PRIVATE
        Cloud
        Part
        ${Python3_LIBRARIES}
        "${_freecad_web_python_build}/Modules/_decimal/libmpdec/libmpdec.a"
        "${_freecad_web_python_build}/Modules/_hacl/libHacl_Hash_SHA2.a"
        "${_freecad_web_python_build}/Modules/expat/libexpat.a"
    )
    target_link_options(FreeCADWebCloudKernelProbe PRIVATE
        "-O2"
        "-g0"
        "--no-entry"
        "-sWASM=1"
        "-sMODULARIZE=1"
        "-sEXPORT_ES6=1"
        "-sEXPORT_NAME=FreeCADWebCloudKernelProbe"
        "-sALLOW_MEMORY_GROWTH=1"
        "-sINITIAL_MEMORY=33554432"
        "-sENVIRONMENT=web,worker,node"
        "-sUSE_BZIP2=1"
        "-sDISABLE_EXCEPTION_CATCHING=0"
        "-sEXPORTED_RUNTIME_METHODS=['ccall']"
        "--embed-file=${_freecad_web_python_encodings}@/freecad-python/encodings"
    )
    set_target_properties(FreeCADWebCloudKernelProbe PROPERTIES
        SUFFIX ".js"
        RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin"
    )
endif()
