
configure_file(${CMAKE_UTILS_PATH}/src-config.h.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/config.h)

# Now we can configure the build of both libraries
add_subdirectory(XpertMassCore)
add_subdirectory(XpertMassGui)

# Generate and install config files
include(CMakePackageConfigHelpers)

if(UNIX)
  configure_package_config_file(${CMAKE_UTILS_PATH}/XpertMassConfig.cmake.in
    "${CMAKE_CURRENT_BINARY_DIR}/XpertMassConfig.cmake"
    INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/XpertMass)

  write_basic_package_version_file(
    "${CMAKE_CURRENT_BINARY_DIR}/XpertMassConfigVersion.cmake"
    VERSION "${CMAKE_PROJECT_VERSION_MAJOR}.${CMAKE_PROJECT_VERSION_MINOR}"
    COMPATIBILITY SameMinorVersion)

  install(FILES
    "${CMAKE_CURRENT_BINARY_DIR}/XpertMassConfig.cmake"
    "${CMAKE_CURRENT_BINARY_DIR}/XpertMassConfigVersion.cmake"
    DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/XpertMass)
endif()
