c++ - cmake find_library with version number -


i have library in different flavours libsoci-3.2.2_core_s.a libsoci-3.2.2_core_sd.a etc.. 1 static debug version or static release version , other versions (unicode, dll, etc.).

now when use cmake statement finds first library instead of correct one.

set(cmake_prefix_path ${soci_library_path}) find_library(soci_library     names "soci-3.2.2_core_${unicode_flag}s${build_type_flag}"     hints "${soci_library_path}" ) message("soci_searchname: soci-3.2.2_core_s${build_type_flag}") message("soci_found: ${soci_library}   soci-3.2.2_core_s${build_type_flag}") 

currently have static versions of lib, put 's' hardcoded. build_type_flag 'd' debug or empty , in case 'd' cmake returns

d:\src\c\github\build\datinator>make soci_searchname: soci-3.2.2_core_sd soci_found: d:/opt/soci/lib/libsoci-3.2.2_core_s.a   soci-3.2.2_core_sd -- configuring done -- generating done 

so have do, cmake finds correct library version, apart putting in separate directories (which don't like).

also, there way cmake finds versionnumber 3.2.2 or have hardcode this?


Comments

Popular posts from this blog

javascript - How to process users in one specific order using map o each function? -

javascript - Linking from page A to a specific iframe on page B -

java - Two interface have same method name with different return type -