Skip to content

Commit

Permalink
Attempt to Handle Installation Correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
iguessthislldo committed Apr 10, 2024
1 parent 4086945 commit 3b1cf38
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 6 deletions.
2 changes: 2 additions & 0 deletions cmake/config.cmake.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
set(_OPENDDS_CMAKE_BUILT_AND_INSTALLED TRUE)
set(OPENDDS_USE_PREFIX_PATH TRUE)
set(OPENDDS_INSTALL_LIB @CMAKE_INSTALL_LIBDIR@)
set(OPENDDS_CXX_STD @OPENDDS_CXX_STD@)
set(OPENDDS_CXX_STD_YEAR @OPENDDS_CXX_STD_YEAR@)

@opendds_feature_vars@
20 changes: 14 additions & 6 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,12 @@ my $debug = exists $opts{'debug'} ? $opts{'debug'} : 1;
my $backup = exists $opts{'backup'} ? $opts{'backup'} : 1;
my $force_ace_tao = exists $opts{'force-ace-tao'} ? $opts{'force-ace-tao'} : 0;
my $no_disable_deprecated = exists $opts{'no-disable-deprecated'} ? $opts{'no-disable-deprecated'} : 0;
my $cxx_std;
if (exists($opts{'std'})) {
$cxx_std = $opts{'std'};
# Accept any of --std=17, --std=stdcpp17, --std=c++17, etc.
$cxx_std =~ s/^(std)?(cpp|c\+\+)//;
}

$opts{'host'} = perlOS_to_host() unless $opts{'host'};

Expand Down Expand Up @@ -736,12 +742,10 @@ EOF
print "Visual C++ has >= C++11 support\n" if $opts{'verbose'};
}
if ($opts{'std'}) {
# Accept any of --std=17, --std=stdcpp17, --std=c++17, etc.
$opts{'std'} =~ s/^(std)?(cpp|c\+\+)//;
my $prefix = 'stdcpp';
push(@{$opts{'mpcopts'}}, "-value_template LanguageStandard=$prefix$opts{'std'}");
print "Setting Visual C++ LanguageStandard to $prefix$opts{'std'}\n" if $opts{'verbose'};
if ($opts{'std'} eq 'latest' || $opts{'std'} >= 17) {
my $std = "stdcpp$cxx_std";
push(@{$opts{'mpcopts'}}, "-value_template LanguageStandard=$std");
print "Setting Visual C++ LanguageStandard to $std\n" if $opts{'verbose'};
if ($opts{'std'} eq 'latest' || $cxx_std >= 17) {
push(@{$opts{'features'}}, 'no_cxx17=0');
print "Visual C++ has >= C++17 support\n" if $opts{'verbose'};
}
Expand Down Expand Up @@ -2856,6 +2860,10 @@ sub write_cmake_file {
print_cmake_config($fh, $config->{name}, $enabled);
}

if (defined($cxx_std)) {
print_cmake_config($fh, 'OPENDDS_CXX_STD', $cxx_std);
}

# TODO(iguessthislldo): Move to a smarter system that can use existing
# ACE/TAO and that works with cross compiling.
print $fh "\n# Based on configure script options\n";
Expand Down
1 change: 1 addition & 0 deletions dds/DdsDcps.mpc
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ project(OpenDDS_Dcps): core, coverage_optional, \
" cp $(DDS_ROOT)/user_macros.GNU $(DESTDIR)$(INSTALL_PREFIX)/share/dds $(ACE_NUL_STDERR)"
" @$(MKDIR) $(cmake_dir_install_dest)"
" cp $(DDS_ROOT)/cmake/*.cmake $(cmake_dir_install_dest)"
" cp $(DDS_ROOT)/cmake/cplusplus.cpp $(cmake_dir_install_dest)"
" cp $(DDS_ROOT)/cmake/export.h.in $(cmake_dir_install_dest)"
" echo '' >> $(cmake_config_install_dest)"
" echo '# From make install' >> $(cmake_config_install_dest)"
Expand Down

0 comments on commit 3b1cf38

Please sign in to comment.