From 13ad73c6d9824a643948e519ce3fe5224a68288f Mon Sep 17 00:00:00 2001 From: Kei Okada Date: Tue, 4 Jul 2017 22:25:01 +0900 Subject: [PATCH] CMakeLists.txt : remove -O2 from OPENHRP_DEFINITIONS --- CMakeLists.txt | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 364eb55b03b..3113ba4e4bb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -68,7 +68,13 @@ find_package(OpenHRP REQUIRED) include_directories(${OPENHRP_INCLUDE_DIRS}) link_directories(${OPENHRP_LIBRARY_DIRS}) if(UNIX) + # remove -O2 ... from ${OPENHRP_DEFINITIONS} + message(STATUS "OPENHRP_DEFINITIONS: ${OPENHRP_DEFINITIONS}") + message(STATUS "REMOVE -Ox option from OPENHRP_DEFINITIONS, use CMAKE_BUILD_TYPE") + string(REGEX REPLACE "[ ]+-O[0-9][ ]+" " " OPENHRP_DEFINITIONS ${OPENHRP_DEFINITIONS}) + message(STATUS "OPENHRP_DEFINITIONS: ${OPENHRP_DEFINITIONS}") add_definitions(${OPENHRP_DEFINITIONS}) + endif() if(ENABLE_INSTALL_RPATH) @@ -97,6 +103,11 @@ if(NOT CMAKE_BUILD_TYPE OR CMAKE_BUILD_TYPE STREQUAL None) "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel." FORCE) endif() +message(STATUS "Compile with ${CMAKE_BUILD_TYPE}") +message(STATUS " -- CMAKE_C_FLAGS / CMAKE_CXX_FLAGS ${CMAKE_C_FLAGS} / ${CMAKE_C_FLAGS}") +message(STATUS " -- CMAKE_C_FLAGS_DEBUG / CMAKE_CXX_FLAGS_DEBUG ${CMAKE_C_FLAGS_DEBUG} / ${CMAKE_C_FLAGS_DEBUG}") +message(STATUS " -- CMAKE_C_FLAGS_RELEASE / CMAKE_CXX_FLAGS_RELEASE ${CMAKE_C_FLAGS_RELEASE} / ${CMAKE_C_FLAGS_RELEASE}") +message(STATUS " -- CMAKE_C_FLAGS_RELWITHDEBINFO / CMAKE_CXX_FLAGS_RELWITHDEBINFO ${CMAKE_C_FLAGS_RELWITHDEBINFO} / ${CMAKE_C_FLAGS_RELWITHDEBINFO}") set(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib) set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)