cmake - cmake_current_source_dir used as avariable -


please check below scenerio :

cmakelists_1.txt

set( variable_name      ${cmake_current_source_dir}/sub_folder1      ${cmake_current_source_dir}/sub_folder2     ) 

cmakelists_2.txt

include_directories(     ${variable_name} ) 

now when cmakelists_2 executes doesn't include files present in sub_folders. works if give absolute path sub_folders in cmakelists_1.

please point me if missing something.

cmake_current_source_dir current source directory cmakelists.txt mentions lives. expands different depending on directory used from. expanding you, , how different hard-coded path works? once see difference you'll know how fix it, in both files this:

message(${variable_name}) 

then re-run cmake , see prints.


Comments

Popular posts from this blog

c++ - llvm function pass ReplaceInstWithInst malloc -

Cross-Compiling Linux Kernel for Raspberry Pi - ${CCPREFIX}gcc -v does not work -

java.lang.NoClassDefFoundError When Creating New Android Project -