Jump to content
  • Advertisement
Sign in to follow this  

Compiled library is not placed in the cmake build directory

This topic is 724 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

The compiled library is placed in a directory related to project sources dir:




This causes issues when you have more than single build directory in the project. I personally have maybe 10 different build directories for different compilers/platforms ;) (linux compilation, mingw-32bit, mingw-64bit, 32-bit linux static package, 64-bit static package etc...). All these build directories use by default single library which is placed in "${PROJECT_SOURCE_DIR}/../../lib". This causes erros when linking final executable. For example the 32-bit executable tries to link previously compiled 64-bit library.


Here is original bug report:



We fixed this by just removing this line. It would be nice to make this fix upstream, so that we won't need to apply this modification after every update.

Share this post

Link to post
Share on other sites

Thanks for the bug report. It makes perfect sense. I'll have the changes made in the SVN.



Please excuse my ignorance (I'm not a Linux developer and don't personally use cmake), but where will the library be written to by removing this line? 

Share this post

Link to post
Share on other sites

Actually there were two lines that I removed. It was this commit:



In our case it is placed in build directory:



The path seems to be a bit complicated because cmake file is in "projects\cmake". Otherwise it would be:



If you need something more simple, you can use ${CMAKE_BINARY_DIR} for the LIBRARY_OUTPUT_PATH variable, for example something like:



Though I didn't check if it works ;)

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!