X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=cmake%2Fcmake.d%2F01-build_options.cmake;h=84649fc3efdabf18dea90dc5ac84100dd362dc29;hb=37d062dd381e1c35014e1c4209eb05a734608aa4;hp=246d650b16f6a4d21ba354c85835777a13703f7a;hpb=22fee6b6b2241421f3471f0f842d6349272790de;p=apps%2Fapp-templates.git diff --git a/cmake/cmake.d/01-build_options.cmake b/cmake/cmake.d/01-build_options.cmake index 246d650..84649fc 100644 --- a/cmake/cmake.d/01-build_options.cmake +++ b/cmake/cmake.d/01-build_options.cmake @@ -39,7 +39,7 @@ set(CMP0048 1) # Default compilation options ############################################################################ link_libraries(-Wl,--as-needed -Wl,--gc-sections) -set(COMPILE_OPTIONS "-Wall" "-Wextra" "-Wconversion" "-Wno-unused-parameter" "-Wno-sign-compare" "-Wno-sign-conversion" "-Werror=maybe-uninitialized" "-Werror=implicit-function-declaration" "-ffunction-sections" "-fdata-sections" "-fPIC" CACHE STRING "Compilation flags") +set(COMPILE_OPTIONS -Wall -Wextra -Wconversion -Wno-unused-parameter -Wno-sign-compare -Wno-sign-conversion -Werror=maybe-uninitialized -Werror=implicit-function-declaration -ffunction-sections -fdata-sections -fPIC CACHE STRING "Compilation flags") foreach(option ${COMPILE_OPTIONS}) add_compile_options($<$:${option}>) endforeach() @@ -58,10 +58,10 @@ endforeach() # Compilation option depending on CMAKE_BUILD_TYPE ################################################## -set(PROFILING_COMPILE_OPTIONS "-g" "-O0" "-pg" "-Wp,-U_FORTIFY_SOURCE" CACHE STRING "Compilation flags for PROFILING build type.") -set(DEBUG_COMPILE_OPTIONS "-g" "-ggdb" "-Wp,-U_FORTIFY_SOURCE" CACHE STRING "Compilation flags for DEBUG build type.") -set(CCOV_COMPILE_OPTIONS "-g" "-O2" "--coverage" CACHE STRING "Compilation flags for CCOV build type.") -set(RELEASE_COMPILE_OPTIONS "-g" "-O2" CACHE STRING "Compilation flags for RELEASE build type.") +set(PROFILING_COMPILE_OPTIONS -g -O0 -pg -Wp,-U_FORTIFY_SOURCE CACHE STRING "Compilation flags for PROFILING build type.") +set(DEBUG_COMPILE_OPTIONS -g -ggdb -Wp,-U_FORTIFY_SOURCE CACHE STRING "Compilation flags for DEBUG build type.") +set(CCOV_COMPILE_OPTIONS -g -O2 --coverage CACHE STRING "Compilation flags for CCOV build type.") +set(RELEASE_COMPILE_OPTIONS -g -O2 CACHE STRING "Compilation flags for RELEASE build type.") foreach(option ${PROFILING_COMPILE_OPTIONS}) add_compile_options($<$:${option}>) endforeach() @@ -76,12 +76,15 @@ foreach(option ${RELEASE_COMPILE_OPTIONS}) endforeach() # Env variable overload default -if(DEFINED ENV{INSTALL_PREFIX}) - set(INSTALL_PREFIX $ENV{INSTALL_PREFIX} CACHE PATH "The path where to install") -else() - set(INSTALL_PREFIX "${CMAKE_SOURCE_DIR}/Install" CACHE PATH "The path where to install") -endif() -set(CMAKE_INSTALL_PREFIX ${INSTALL_PREFIX} CACHE STRING "Installation Prefix") +# Disabled by default now. Tell me if you need really it +# but you should not have needs for that since you can +# set CMAKE_INSTALL_PREFIX in your config.cmake. +#if(DEFINED ENV{INSTALL_PREFIX}) +# set(INSTALL_PREFIX $ENV{INSTALL_PREFIX} CACHE PATH "The path where to install") +#else() +# set(INSTALL_PREFIX "${CMAKE_SOURCE_DIR}/Install" CACHE PATH "The path where to install") +#endif() +#set(CMAKE_INSTALL_PREFIX ${INSTALL_PREFIX} CACHE PATH "Installation Prefix") # Loop on required package and add options foreach (PKG_CONFIG ${PKG_REQUIRED_LIST})