- changed title to Default Helper Application Path should not contain spaces
Default Helper Application Path should not contain spaces
I have an issue with the "cefsimple" project:
the CMakeList.txt file:
The Helper Target is set. CMake (at least version 3.9.1) doesn't like spaces in the target name.
* CMake Error at gui/cefsimple/CMakeLists.txt:173 (add_executable): The target name "cefsimple Helper" is reserved or not valid for certain CMake features, such as generator expressions, and may result in undefined behavior.*
Therefore I needed to patch the CMakeLists.txt file with:
set(CEF_HELPER_TARGET "cefsimpleHelper") set(CEF_HELPER_TARGET_OUTPUTNAME "cefsimple Helper") ... set_target_properties(${CEF_HELPER_TARGET} PROPERTIES OUTPUT_NAME ${CEF_HELPER_TARGET_OUTPUTNAME} )
Only with this patch, the project configures and builds.
Since the Helper Path is hardcoded in CEF and contains a space "<app> Helper". Anway, why there is a whitespace in the path I dont understand. Normally, I always try to avoid spaces, which only give problems. Why not making the hardcoded path "<app>-Helper", wouldn't that be better?
Comments (9)
-
reporter -
(Similarly, pkg-config doesn't like spaces in framework names; its output has to be useful in enough contexts that you just can't get the quoting right. But that's another bug.)
-
- changed status to wontfix
This naming style is required by Chromium.
-
reporter Ok but we should at least fix the cmake error such that the cefsimple configures!
-
- changed status to open
Sorry, I missed your report that this has become a fatal error with newer CMake versions. With CMake 3.6 it's just a warning:
CMake Warning (dev) at tests/cefclient/CMakeLists.txt:457 (add_executable): Policy CMP0037 is not set: Target names should not be reserved and should match a validity pattern. Run "cmake --help-policy CMP0037" for policy details. Use the cmake_policy command to set the policy and suppress this warning. The target name "cefclient Helper" is reserved or not valid for certain CMake features, such as generator expressions, and may result in undefined behavior. This warning is for project developers. Use -Wno-dev to suppress it.
-
reporter a strange error from cmake. why should cefsimple Helper be reserved lol :)
Von meinem iPhone gesendet
-
The problem is that there is a space in the name, which is not allowed in CMake target names. Its error message is a bit confusing.
The initially suggested fix seems to be the correct one. Rename the CMake target to not have spaces, then configure the output name to conform to Chromium's requirements.
To fix this issue in another CMake project I used
RUNTIME_OUTPUT_NAME
instead of the more genericOUTPUT_NAME
, though. -
@fxb Either
RUNTIME_OUTPUT_NAME
orOUTPUT_NAME
should work in this case since only a runtime executable (cefclient Helper
) is created. In general, though, I think usingOUTPUT_NAME
more closely matches the desired behavior (e.g. runtime, library and archive outputs all receive the output name with spaces instead of the target name without spaces). -
- changed status to resolved
- Log in to comment