-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
try_compile in DetermineGflagsNamespace generates invalid compile command #193
Comments
Rewriting it as
fixes the issue |
I don't follow. What's the difference between the two |
The difference is quotations. CMake flags need to be quoted for the command to work correctly |
Please give #209 a try and let me if the PR works for you. |
cmake: fixed gflags namespace detection (fixes #193)
This commit fixes gflags namespace detection using Intel compiler and ensures the generated try_compile command line does not produce malformed paths.
cmake: fixed gflags namespace detection (fixes google#193)
Hi,
Currently try_compile is specified as..
However, when
${CMAKE_BINARY_DIR}
is set to/home/amitprakash/CLionProjects/or-tools/cmake-build-manual/glog_project/src/glog
and${gflags_INCLUDE_DIR}
is set to/home/amitprakash/CLionProjects/or-tools/cmake-build-manual/gflags_project/src/gflags/include
, the build command generated by try_compile is ../usr/bin/c++ -DGFLAGS_NAMESPACE=google -I/home/amitprakash/CLionProjects/or-tools/cmake-build-manual/glog_project/src/glog/CMakeFiles/CMakeTmp/\"/home/amitprakash/CLionProjects/or-tools/cmake-build-manual/gflags_project/src/gflags/include\" -fPIE -o CMakeFiles/cmTC_6795b.dir/DetermineGflagsNamespace.cxx.o -c /home/amitprakash/CLionProjects/or-tools/cmake-build-manual/glog_project/src/glog/CMakeFiles/CMakeTmp/DetermineGflagsNamespace.cxx
I'm unsure why, but the include dir has changed from an ABSPATH to a RELPATH of the form
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/${gflags_INCLUDE_DIR}
The same happens when glog is installed to /usr/include, but the try_compile succeeds anyways, since /usr/include is part of system include dirs
The text was updated successfully, but these errors were encountered: