set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS TRUE)
add_library(wrapper_example SHARED test.hpp test_2.hpp)
set_target_properties(wrapper_example PROPERTIES LINKER_LANGUAGE CXX)
target_include_directories(wrapper_example PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})

option(DEFINE_TEST_PARAM1 "Adds a define parameter to change whether flag1_set function is defined" OFF)
if (DEFINE_TEST_PARAM1)
  target_compile_definitions(wrapper_example PUBLIC "-DTESTFLAG1")
endif()

option(DEFINE_TEST_PARAM2 "Adds a define parameter to change whether flag2_set function is defined" OFF)
if (DEFINE_TEST_PARAM2)
  target_compile_definitions(wrapper_example PUBLIC "-DTESTFLAG2")
endif()

autopybind11_fetch_build_pybind11()

# Create default library
add_subdirectory(additional)
add_subdirectory(operator_testing)

autopybind11_add_module("example" JSON_INPUT ${CMAKE_CURRENT_SOURCE_DIR}/wrapper_input.json
                        CONFIG_INPUT ${CMAKE_CURRENT_SOURCE_DIR}/config.yml
                        DESTINATION ${CMAKE_CURRENT_BINARY_DIR}
                        NAMESPACE "example"
                        LINK_LIBRARIES wrapper_example)

# Create default tests, importing the module
set(tgt_helper_name "example")
set(py_command "import ${tgt_helper_name}")
add_test(NAME test_import_${tgt_helper_name}
         COMMAND ${PYTHON_EXECUTABLE} -c ${py_command}
         WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
add_test(NAME example_unittest
         COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/tests/exampleTests.py
         WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
