-
Notifications
You must be signed in to change notification settings - Fork 482
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
Issue compiling ishapes with CMake: try_compile() works only for enabled languages.
#4849
Comments
try_compile() works only for enabled languages.
This is the real issue: Try switching around these two lines: OpenDDS/examples/DCPS/ishapes/CMakeLists.txt Lines 2 to 3 in 1aa7ae0
So it's: project(ishapes VERSION ${OpenDDS_VERSION} LANGUAGES CXX)
find_package(OpenDDS REQUIRED) For me it gives a warning about the For the real fix I think this has two parts to it:
|
That worked! Thank you. Would you like me to submit a PR with this change? |
Thanks for offering, but I'm not sure that's necessary. I wrote this code not too long ago in #4487. Reopening though because the actual fix still needs to be done. |
Fixes OpenDDS#4849 Changes from OpenDDS#4487 require C++ language to be enabled in CMake, which it basically is all the time through `project(... LANGUAGES CXX)` expect in ishapes. There `find_project(OpenDDS)` was used to get the OpenDDS version before `project` enabled C++ which results in `try_compile` failing fatally. These changes both make sure C and C++ are enabled early in CMake initialization and switch the `project` and `find_package` to comply with https://cmake.org/cmake/help/latest/policy/CMP0165.html#policy:CMP0165 Also changed the C++ standard checks to include the min C++ standard (currently C++98/03), so it would never mistake a broken compiler setup with a compiler that only supports the min standard.
I was able to successfully compile
OpenDDS-DDS-3.30/OpenDDS-3.30
usingUbuntu 20.04/22.04 LTS
,CMake 3.27/3.31
,g++ 9/10
and run themessenger
example.However, while compiling
OpenDDS-DDS-3.30/examples/DCPS/ishapes
source, I get the following error:TIA
The text was updated successfully, but these errors were encountered: