Re: [CMake] How to hundle gcc link options(like whole-archive, --allow-multiple-definition) in CMake?

2016-05-31 Thread Chuck Atkins
Hi Chao, You want to let CMake to as much of the work for you as possible. You're still trying to explicitly pass the path to the library file to target_link_libraries. If you look at the line: target_link_library(exe1 "-Wl, --whole-archive ../sub_dir1/liblib1.a --no-whole-archive") there's no

Re: [CMake] C header file cross dependency

2016-05-31 Thread Wagner Martin
Thank you for your answer! > > How do I resolve something like this? Right now CMake evaluates the > > compiler includes in the order that subdirectories are added. This > > gives me an compilation error in uart.c that terminal.h cannot be > > found. > > This is not a cmake-problem, but seems to

Re: [CMake] CMake+QT always failed for the first build, and succeeded for second build or later.

2016-05-31 Thread irene w
It seems CMakw could not find the generated moc_xxx files. I modified the scripts to specify moc_xxx files is generated, but it still has same errors. ADD_CUSTOM_COMMAND ( OUTPUT ${Qt_tmp}/moc_GMWindow.cpp COMMAND ${QT_MOC_CMD} ${GM_DIR}/GMWindow.h -o ${Qt_tmp}/moc_GMWindow.c

Re: [CMake] How to hundle gcc link options(like whole-archive, --allow-multiple-definition) in CMake?

2016-05-31 Thread Chaos Zhang
Thanks for your generous Mr. Atkins, what you answer me worked well and solved my question. I would keep 'always use target names in a CMakeLists.txt instead of the actual output file' in my mind. :-) Chao Chuck Atkins wrote > Hi Chao, > > You want to let CMake to as much of the work for you as