find_package(GSL REQUIRED)
include_directories(BEFORE ${fwdpy11_SOURCE_DIR}/fwdpy11/headers ${fwdpy11_SOURCE_DIR}/fwdpy11/headers/fwdpp)
message(STATUS "GSL headers in ${GSL_INCLUDE_DIRS}")
include_directories(BEFORE ${GSL_INCLUDE_DIRS})

set(CMAKE_CXX_FLAGS  "${CMAKE_CXX_FLAGS} -Wall")

# These are the main modules
pybind11_add_module(_init MODULE src/_init.cc)
target_link_libraries(_init PRIVATE GSL::gsl GSL::gslcblas)
pybind11_add_module(fwdpp_types MODULE src/fwdpp_types.cc)
target_link_libraries(fwdpp_types PRIVATE GSL::gsl GSL::gslcblas)
pybind11_add_module(_opaque_gametes MODULE src/_opaque_gametes.cc)
target_link_libraries(_opaque_gametes PRIVATE GSL::gsl GSL::gslcblas)
pybind11_add_module(_opaque_mutations MODULE src/_opaque_mutations.cc)
target_link_libraries(_opaque_mutations PRIVATE GSL::gsl GSL::gslcblas)
pybind11_add_module(_opaque_diploids MODULE src/_opaque_diploids.cc)
target_link_libraries(_opaque_diploids PRIVATE GSL::gsl GSL::gslcblas)
pybind11_add_module(fwdpp_extensions MODULE src/fwdpp_extensions.cc)
target_link_libraries(fwdpp_extensions PRIVATE GSL::gsl GSL::gslcblas)
pybind11_add_module(_Population MODULE src/_Population.cc)
# target_link_libraries(_Population PRIVATE GSL::gsl GSL::gslcblas)
pybind11_add_module(_Populations MODULE src/_Populations.cc)
target_link_libraries(_Populations PRIVATE GSL::gsl GSL::gslcblas)
pybind11_add_module(fwdpy11_types MODULE src/fwdpy11_types.cc)
target_link_libraries(fwdpy11_types PRIVATE GSL::gsl GSL::gslcblas)
pybind11_add_module(_gslrng MODULE src/_gslrng.cc)
target_link_libraries(_gslrng PRIVATE GSL::gsl GSL::gslcblas)
pybind11_add_module(sampling MODULE src/fwdpy11_sampling.cc)
target_link_libraries(sampling PRIVATE GSL::gsl GSL::gslcblas)
pybind11_add_module(genetic_values MODULE src/genetic_values.cc)
target_link_libraries(genetic_values PRIVATE GSL::gsl GSL::gslcblas)
pybind11_add_module(genetic_value_noise MODULE src/genetic_value_noise.cc)
target_link_libraries(genetic_value_noise PRIVATE GSL::gsl GSL::gslcblas)
pybind11_add_module(wright_fisher_slocus MODULE src/wright_fisher_slocus.cc)
target_link_libraries(wright_fisher_slocus PRIVATE GSL::gsl GSL::gslcblas)
pybind11_add_module(wright_fisher_mlocus MODULE src/wright_fisher_mlocus.cc)
target_link_libraries(wright_fisher_mlocus PRIVATE GSL::gsl GSL::gslcblas)
pybind11_add_module(gsl_random MODULE src/gsl_random.cc)
target_link_libraries(gsl_random PRIVATE GSL::gsl GSL::gslcblas)
pybind11_add_module(multilocus MODULE src/multilocus.cc)
target_link_libraries(multilocus PRIVATE GSL::gsl GSL::gslcblas)
pybind11_add_module(util MODULE src/fwdpy11_util.cc)
target_link_libraries(util PRIVATE GSL::gsl GSL::gslcblas)
pybind11_add_module(ts MODULE src/ts.cc)
target_link_libraries(ts PRIVATE GSL::gsl GSL::gslcblas)
pybind11_add_module(tsrecorders MODULE src/tsrecorders.cc)
target_link_libraries(tsrecorders PRIVATE GSL::gsl GSL::gslcblas)
pybind11_add_module(ts_from_msprime MODULE src/ts_from_msprime.cc)
target_link_libraries(ts_from_msprime PRIVATE GSL::gsl GSL::gslcblas)
pybind11_add_module(wright_fisher_slocus_ts MODULE src/wright_fisher_slocus_ts.cc)
target_link_libraries(wright_fisher_slocus_ts PRIVATE GSL::gsl GSL::gslcblas)
