Skip to content

Commit

Permalink
Update examples CMakeList to force default CMAKE_BUILD_TYPE (#5360)
Browse files Browse the repository at this point in the history
Signed-off-by: eProsima <[email protected]>
  • Loading branch information
JesusPoderoso authored Nov 5, 2024
1 parent 680329c commit 82059aa
Show file tree
Hide file tree
Showing 13 changed files with 117 additions and 0 deletions.
9 changes: 9 additions & 0 deletions examples/cpp/configuration/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,15 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
endif()
endif()

# Set CMAKE_BUILD_TYPE to Release by default.
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
message(STATUS "Setting build type to 'Release' as none was specified.")
set(CMAKE_BUILD_TYPE Release CACHE STRING
"Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel."
FORCE)
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
endif()

message(STATUS "Configuring configuration example...")
file(GLOB CONFIGURATION_SOURCES_CXX "*.cxx")
file(GLOB CONFIGURATION_SOURCES_CPP "*.cpp")
Expand Down
9 changes: 9 additions & 0 deletions examples/cpp/content_filter/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,15 @@ if(NOT fastdds_FOUND)
find_package(fastdds 3 REQUIRED)
endif()

# Set CMAKE_BUILD_TYPE to Release by default.
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
message(STATUS "Setting build type to 'Release' as none was specified.")
set(CMAKE_BUILD_TYPE Release CACHE STRING
"Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel."
FORCE)
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
endif()

message(STATUS "Configuring content filter example...")

file(GLOB CONTENT_FILTER_SOURCES_CXX "*.cxx")
Expand Down
9 changes: 9 additions & 0 deletions examples/cpp/custom_payload_pool/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,15 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
endif()
endif()

# Set CMAKE_BUILD_TYPE to Release by default.
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
message(STATUS "Setting build type to 'Release' as none was specified.")
set(CMAKE_BUILD_TYPE Release CACHE STRING
"Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel."
FORCE)
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
endif()

message(STATUS "Configuring custom payload pool example...")
file(GLOB CUSTOM_PAYLOAD_POOL_DATA_EXAMPLE_SOURCES_CXX "*.cxx")
file(GLOB CUSTOM_PAYLOAD_POOL_DATA_EXAMPLE_SOURCES_CPP "*.cpp")
Expand Down
9 changes: 9 additions & 0 deletions examples/cpp/delivery_mechanisms/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,15 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
endif()
endif()

# Set CMAKE_BUILD_TYPE to Release by default.
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
message(STATUS "Setting build type to 'Release' as none was specified.")
set(CMAKE_BUILD_TYPE Release CACHE STRING
"Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel."
FORCE)
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
endif()

message(STATUS "Configuring delivery mechanisms example...")
file(GLOB DELIVERY_MECHANISMS_SOURCES_CXX "*.cxx")
file(GLOB DELIVERY_MECHANISMS_SOURCES_CPP "*.cpp")
Expand Down
9 changes: 9 additions & 0 deletions examples/cpp/discovery_server/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,15 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
endif()
endif()

# Set CMAKE_BUILD_TYPE to Release by default.
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
message(STATUS "Setting build type to 'Release' as none was specified.")
set(CMAKE_BUILD_TYPE Release CACHE STRING
"Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel."
FORCE)
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
endif()

message(STATUS "Configuring discovery server example...")
file(GLOB DISCOVERY_SERVER_SOURCES_CXX "*.cxx")
file(GLOB DISCOVERY_SERVER_SOURCES_CPP "*.cpp")
Expand Down
9 changes: 9 additions & 0 deletions examples/cpp/flow_control/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,15 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
endif()
endif()

# Set CMAKE_BUILD_TYPE to Release by default.
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
message(STATUS "Setting build type to 'Release' as none was specified.")
set(CMAKE_BUILD_TYPE Release CACHE STRING
"Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel."
FORCE)
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
endif()

message(STATUS "Configuring DDS Flow Control example...")
file(GLOB DDS_FLOWCONTROL_EXAMPLE_SOURCES_CXX "*.cxx")
file(GLOB DDS_FLOWCONTROL_EXAMPLE_SOURCES_CPP "*.cpp")
Expand Down
9 changes: 9 additions & 0 deletions examples/cpp/hello_world/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,15 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
endif()
endif()

# Set CMAKE_BUILD_TYPE to Release by default.
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
message(STATUS "Setting build type to 'Release' as none was specified.")
set(CMAKE_BUILD_TYPE Release CACHE STRING
"Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel."
FORCE)
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
endif()

message(STATUS "Configuring hello world example...")
file(GLOB HELLO_WORLD_SOURCES_CXX "*.cxx")
file(GLOB HELLO_WORLD_SOURCES_CPP "*.cpp")
Expand Down
9 changes: 9 additions & 0 deletions examples/cpp/request_reply/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,15 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
endif()
endif()

# Set CMAKE_BUILD_TYPE to Release by default.
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
message(STATUS "Setting build type to 'Release' as none was specified.")
set(CMAKE_BUILD_TYPE Release CACHE STRING
"Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel."
FORCE)
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
endif()

message(STATUS "Configuring ${PROJECT_NAME}...")
file(GLOB REQUEST_REPLY_TYPES_SOURCES_CXX "types/*.cxx")
file(GLOB REQUEST_REPLY_SOURCES_CXX "*.cxx")
Expand Down
9 changes: 9 additions & 0 deletions examples/cpp/rtps/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,15 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
endif()
endif()

# Set CMAKE_BUILD_TYPE to Release by default.
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
message(STATUS "Setting build type to 'Release' as none was specified.")
set(CMAKE_BUILD_TYPE Release CACHE STRING
"Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel."
FORCE)
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
endif()

message(STATUS "Configuring Registered...")
file(GLOB RTPS_SOURCES_CPP "*.cpp")

Expand Down
9 changes: 9 additions & 0 deletions examples/cpp/security/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,15 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
endif()
endif()

# Set CMAKE_BUILD_TYPE to Release by default.
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
message(STATUS "Setting build type to 'Release' as none was specified.")
set(CMAKE_BUILD_TYPE Release CACHE STRING
"Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel."
FORCE)
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
endif()

message(STATUS "Configuring secure hello world example...")

file(GLOB SECURE_HELLO_WORLD_SOURCES_CXX "*.cxx")
Expand Down
9 changes: 9 additions & 0 deletions examples/cpp/static_edp_discovery/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,15 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
endif()
endif()

# Set CMAKE_BUILD_TYPE to Release by default.
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
message(STATUS "Setting build type to 'Release' as none was specified.")
set(CMAKE_BUILD_TYPE Release CACHE STRING
"Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel."
FORCE)
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
endif()

message(STATUS "Configuring static edp discovery example...")
file(GLOB STATIC_EDP_DISCOVERY_SOURCES_CXX "*.cxx")
file(GLOB STATIC_EDP_DISCOVERY_SOURCES_CPP "*.cpp")
Expand Down
9 changes: 9 additions & 0 deletions examples/cpp/topic_instances/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,15 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
endif()
endif()

# Set CMAKE_BUILD_TYPE to Release by default.
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
message(STATUS "Setting build type to 'Release' as none was specified.")
set(CMAKE_BUILD_TYPE Release CACHE STRING
"Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel."
FORCE)
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
endif()

message(STATUS "Configuring topic instances example...")
file(GLOB TOPIC_INSTANCES_SOURCES_CXX "*.cxx")
file(GLOB TOPIC_INSTANCES_SOURCES_CPP "*.cpp")
Expand Down
9 changes: 9 additions & 0 deletions examples/cpp/xtypes/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,15 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
endif()
endif()

# Set CMAKE_BUILD_TYPE to Release by default.
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
message(STATUS "Setting build type to 'Release' as none was specified.")
set(CMAKE_BUILD_TYPE Release CACHE STRING
"Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel."
FORCE)
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
endif()

message(STATUS "Configuring ${PROJECT_NAME}...")
file(GLOB EXAMPLE_SOURCES "*.cpp")

Expand Down

0 comments on commit 82059aa

Please sign in to comment.