visual c++ - Problems with CMAKE vars -


i'm using cmake generate vs2008 sln/vcproj files few simple things don't appear work:

1)this works: include_directories ($env{mcs_ogre_home}/ogremain/include)

but doesn't, vc++ additional include dirs gets totally screwed when this, brackets , kinds floating around:

set (ogre_path $env{ogre_home}/ogremain) include_directories (${ogre_path}/include) 

2)this works: target_link_libraries( debug $env{ogre_home}/lib/ogremainstatic_d.lib )

but doesn't, library path isn't shown under library paths in vc++:

link_directories($env{ogre_home}/lib/) target_link_libraries( debug ogremainstatic_d.lib ) 

i figure must simple?

rather than:

set(ogre_path $env{ogre_home}/ogremain) 

use:

string(replace "\\" "/" ogre_path "$env{ogre_home}/ogremain") 

cmake uses "/" path separators on platforms.

also, it's recommended use full path names (with "/" separators) library arguments target_link_libraries rather specifying link_directories. cmake takes whole set of libraries linked , figures out right order pass linker flags on platforms.

one more comment: looks have library or executable named "debug" call target_link_libraries. true? or missing first argument in question posted here?

should like:

target_link_libraries(mylib   debug /path/to/debuglib.lib   optimized /path/to/releaselib.lib) 

Comments

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -