Re: [CMake] Get target name from command line for IF statement

2016-01-04 Thread Attila Krasznahorkay
Hi Yann, I have no idea what LINKER_SCATTER_FILE does, but... if( TARGET ) is a check that will evaluate to true if a target named *exists*. In this configuration neither "target_1" or "target_2" exist at the point when you run this check. So LINKER_SCATTER_FILE will always be set to "file_2

[CMake] Get target name from command line for IF statement

2015-12-30 Thread yann suisini
Hi, I have a cmake file with 2 targets defined inside. For each target I have to specify a different scatter file for my linker so I want to use : if (TARGET target_1) SET (LINKER_SCATTER_FILE file_1) else () SET (LINKER_SCATTER_FILE file_2) endif () add_executable(target_1 ${srcs_target_1}) add