Проба 2

This commit is contained in:
Andrei Astafev 2020-03-30 11:44:45 +03:00
parent 2d990c1747
commit 4964b3a6f2
6 changed files with 94 additions and 37 deletions

View File

@ -27,9 +27,9 @@ include(CMLibCompilerFlags)
include(CMLibDistCC) include(CMLibDistCC)
include(CMLibCompilerFeaturesHPPGenerate) include(CMLibCompilerFeaturesHPPGenerate)
include(CMLibFlagRemove) include(CMLibFlagRemove)
include(CMLibBuildTypes)
include(CMLibCommonTargetProperties) include(CMLibCommonTargetProperties)
include(CMLibCommonLibraryTarget) include(CMLibCommonLibraryTarget)
include(CMLibBuildTypes)
include(CMLibCodeAnalysisPvsStudio) include(CMLibCodeAnalysisPvsStudio)
include(CMLibCodeAnalysisClangAnalyze) include(CMLibCodeAnalysisClangAnalyze)
include(CMLibCodeAnalysisClangTidy) include(CMLibCodeAnalysisClangTidy)

View File

@ -92,4 +92,25 @@ function(common_target_properties Name)
endif() endif()
endif() endif()
if(CMAKE_BUILD_TYPE STREQUAL Profile)
target_compile_definitions(
${Name}
${__visibility}
PROFILE)
elseif(CMAKE_BUILD_TYPE STREQUAL Debug)
target_compile_definitions(
${Name}
${__visibility}
DEBUG)
elseif(CMAKE_BUILD_TYPE STREQUAL Release)
target_compile_definitions(
${Name}
${__visibility}
RELEASE)
elseif(CMAKE_BUILD_TYPE STREQUAL None)
target_compile_definitions(
${Name}
${__visibility}
ANALYSIS)
endif()
endfunction() endfunction()

View File

@ -3,6 +3,6 @@ function(cmlib_config_hpp_generate)
cmlib_test_large_files(HAVE_LARGEFILES) cmlib_test_large_files(HAVE_LARGEFILES)
get_property(PROJECT_VERSION_INT GLOBAL PROPERTY PROJECT_VERSION_INT) get_property(PROJECT_VERSION_INT GLOBAL PROPERTY PROJECT_VERSION_INT)
configure_file(${CMLIB_MODULE_DIR}/hpp/cmlib_config.hpp.in configure_file(${CMLIB_MODULE_DIR}/hpp/cmlib_private_config.hpp.in
${CMAKE_BINARY_DIR}/include/${CMLIB_PROJECT_NAME_LOWER}_cmlib_config.hpp) ${CMAKE_BINARY_DIR}/include/cmlib_private_config.hpp)
endfunction() endfunction()

View File

@ -1,33 +0,0 @@
#ifndef @CMLIB_PROJECT_NAME_CANONICAL@_CMLIB_CONFIG_HPP_
#define @CMLIB_PROJECT_NAME_CANONICAL@_CMLIB_CONFIG_HPP_
#pragma once
#define @CMLIB_PROJECT_NAME_CANONICAL@_VERSION_STR "@PROJECT_VERSION@"
#define @CMLIB_PROJECT_NAME_CANONICAL@_VERSION_INT @PROJECT_VERSION_INT@
#define ORGANIZATION_NAME "@ORGANIZATION_NAME@"
#define ORGANIZATION_NAME_LOWER "@ORGANIZATION_NAME_LOWER@"
#define ORGANIZATION_NAME_UPPER "@ORGANIZATION_NAME_UPPER@"
#define PROJECT_NAME "@CMAKE_PROJECT_NAME@"
#define PROJECT_NAME_LOWER "@CMAKE_PROJECT_NAME_LOWER@"
#define PROJECT_NAME_UPPER "@CMAKE_PROJECT_NAME_UPPER@"
#define BUILD_TYPE "@CMAKE_BUILD_TYPE@"
#define BUILD_DATE "@TODAY@"
#cmakedefine PROFILE @PROFILE@
#cmakedefine DEBUG @DEBUG@
#cmakedefine RELEASE @RELEASE@
#cmakedefine ANALYSIS @ANALYSIS@
#cmakedefine _LARGEFILE_SOURCE
#cmakedefine _LARGE_FILES
#cmakedefine _FILE_OFFSET_BITS @_FILE_OFFSET_BITS@
#cmakedefine HAVE_FSEEKO
#cmakedefine HAVE__FSEEKI64
#cmakedefine HAVE_LARGEFILES @HAVE_LARGEFILES@
#define TARGET_LSB_ID_@LSB_DISTRIBUTOR_ID@
#define TARGET_LSB_CODENAME_@LSB_CODENAME@
#define TARGET_LSB_RELEASE "@LSB_RELEASE@"
#endif /* @CMLIB_PROJECT_NAME_CANONICAL@_CMLIB_CONFIG_HPP_ */

View File

@ -0,0 +1,69 @@
#ifndef @CMLIB_PROJECT_NAME_CANONICAL@_CMLIB_CONFIG_HPP_
#define @CMLIB_PROJECT_NAME_CANONICAL@_CMLIB_CONFIG_HPP_
#pragma once
#define @CMLIB_PROJECT_NAME_CANONICAL@_VERSION_STR "@PROJECT_VERSION@"
#define @CMLIB_PROJECT_NAME_CANONICAL@_VERSION_INT @PROJECT_VERSION_INT@
#if defined (CMLIB_ORGANIZATION_NAME)
#error "Duplicate definition of macros CMLIB_ORGANIZATION_NAME"
#else
#define CMLIB_ORGANIZATION_NAME "@ORGANIZATION_NAME@"
#endif
#if defined (CMLIB_ORGANIZATION_NAME_LOWER)
#error "Duplicate definition of macros CMLIB_ORGANIZATION_NAME_LOWER"
#else
#define CMLIB_ORGANIZATION_NAME_LOWER "@ORGANIZATION_NAME_LOWER@"
#endif
#if defined (CMLIB_ORGANIZATION_NAME_UPPER)
#error "Duplicate definition of macros CMLIB_ORGANIZATION_NAME_UPPER"
#else
#define CMLIB_ORGANIZATION_NAME_UPPER "@ORGANIZATION_NAME_UPPER@"
#endif
#if defined (CMLIB_PROJECT_NAME)
#error "Duplicate definition of macros CMLIB_PROJECT_NAME"
#else
#define CMLIB_PROJECT_NAME "@CMAKE_PROJECT_NAME@"
#endif
#if defined (CMLIB_PROJECT_NAME_LOWER)
#error "Duplicate definition of macros CMLIB_PROJECT_NAME_LOWER"
#else
#define CMLIB_PROJECT_NAME_LOWER "@CMAKE_PROJECT_NAME_LOWER@"
#endif
#if defined (CMLIB_PROJECT_NAME_UPPER)
#error "Duplicate definition of macros CMLIB_PROJECT_NAME_UPPER"
#else
#define CMLIB_PROJECT_NAME_UPPER "@CMAKE_PROJECT_NAME_UPPER@"
#endif
#if defined (CMLIB_BUILD_TYPE)
#error "Duplicate definition of macros CMLIB_BUILD_TYPE"
#else
#define CMLIB_BUILD_TYPE "@CMAKE_BUILD_TYPE@"
#endif
#if defined (CMLIB_BUILD_DATE)
#error "Duplicate definition of macros CMLIB_BUILD_DATE"
#else
#define CMLIB_BUILD_DATE "@TODAY@"
#endif
#cmakedefine _LARGEFILE_SOURCE
#cmakedefine _LARGE_FILES
#cmakedefine _FILE_OFFSET_BITS @_FILE_OFFSET_BITS@
#cmakedefine HAVE_FSEEKO
#cmakedefine HAVE__FSEEKI64
#cmakedefine HAVE_LARGEFILES @HAVE_LARGEFILES@
#define TARGET_LSB_ID_@LSB_DISTRIBUTOR_ID@
#define TARGET_LSB_CODENAME_@LSB_CODENAME@
#define TARGET_LSB_RELEASE "@LSB_RELEASE@"
#endif /* @CMLIB_PROJECT_NAME_CANONICAL@_CMLIB_CONFIG_HPP_ */

@ -1 +1 @@
Subproject commit 26eced86d8e759c625b697f6b0588d7a28746725 Subproject commit dfa7faf459634501a7b76944ad264d5959f14615