As the radio spectrum usage paradigm shifting from the traditional command and control allocation scheme to the open spectrum allocation scheme, wireless mesh networks meet new opportunities and challenges. The open spectrum allocation scheme has potential to provide those networks more capacity, and make them more flexible and reliable. However, the freedom brought by the new spectrum usage paradigm introduces spectrum management and network coordination challenges. In this paper, we study the network formation problem in cognitive radio based mesh networks. A cluster-based approach is proposed to form a mesh network in the context of cognitive radio scenario. Moreover, a topology management algorithm is developed to optimize the cluster configuration with regard to the network topology. The prominent feature of the proposed approach lies in the capability to adapt the cluster configuration to network and radio environment changes.