How do I build and use my own VHDL library?
Xilinx Vivado:


  You can create/change the library a file resides in Vivado by clicking on the file, then clicking the button to the right of the Library label in the Source File Properties tab. You can create a library by assigning a file to a library that doesn't exist.


Altera Quartus II:


  You can specify the library under Properties, for example:
  
  You can also modify the Quartus II settings (".qsf") file for the project using set_global_assignment options.