Jump to content

View more

Image of the Day

Inventory ! Va falloir trouver une autre couleur pour le cadre D: #AzTroScreenshot #screenshotsaturday https://t.co/PvxhGL7cOH
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

Ambiguity with search paths (when compiling and linking)

4: Adsense

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


  • You cannot reply to this topic
3 replies to this topic

#1 TheComet   Members   

3860
Like
0Likes
Like

Posted 12 June 2014 - 05:09 AM

Simple question really.

 

I'm compiling and installing all of the dependencies of a project to a custom location (project_root/build.dep). If one of the dependencies happens to exist on the host system as well, for instance python, how can I force the build environment to use project_root/build.dep/include/Python instead of /usr/include/Python, and link against project_root/build.dep/lib/libpython instead of /usr/lib/libpython?

 

I've used:

export CFLAGS=project_root/build.dep/include
export LDFLAGS=project_root/build.dep/lib

But it's still favouring the versions in PATH.

 

NOTE: Build systems in use by the dependencies are CMake, libtool, and bjam.


Edited by TheComet, 12 June 2014 - 05:12 AM.

"I would try to find halo source code by bungie best fps engine ever created, u see why call of duty loses speed due to its detail." -- GettingNifty

#2 BitMaster   Members   

8647
Like
0Likes
Like

Posted 12 June 2014 - 05:22 AM

I don't know how you use CMake, but in my use cases CMake would be responsible for finding which library to link, including the full path. Most libraries will find themselves using for example find_library and the documentation should include how the search happens and how you can modify it to deviate from the default.

Edit: A very simple solution might be to manually SET(<mylibrary>_LIBRARY "${CMAKE_SOURCE_DIR}/path/to/lib" CACHE path "my comment") for all relevant CMake variables instead of using find_package().

Edited by BitMaster, 12 June 2014 - 05:25 AM.


#3 Tribad   Members   

981
Like
0Likes
Like

Posted 12 June 2014 - 05:55 AM

you should have a look on the compiler options --sysroot --isysroot and the like.



#4 TheComet   Members   

3860
Like
0Likes
Like

Posted 13 June 2014 - 03:09 AM

Thanks for the help, got it working by manipulating the CMake find scripts to find local packages before it finds system wide packages.


"I would try to find halo source code by bungie best fps engine ever created, u see why call of duty loses speed due to its detail." -- GettingNifty




Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.