Пути для генерируемых файлов

This commit is contained in:
Andrei Astafev 2020-04-21 12:26:03 +03:00
parent 2909f5a9d4
commit e5fbb90235
2 changed files with 16 additions and 3 deletions

View File

@ -1,7 +1,12 @@
include(WriteCompilerDetectionHeader) include(WriteCompilerDetectionHeader)
set(OUTPUT_FILE ${CMAKE_BINARY_DIR}/include/compiler_features.hpp)
if(CMLIB_GENERATED_HEADERS_PATH)
set(OUTPUT_FILE ${CMLIB_GENERATED_HEADERS_PATH}/compiler_features.hpp)
endif()
write_compiler_detection_header( write_compiler_detection_header(
FILE include/compiler_features.hpp FILE ${OUTPUT_FILE}
PREFIX ${CMLIB_PROJECT_NAME_CANONICAL} PREFIX ${CMLIB_PROJECT_NAME_CANONICAL}
COMPILERS GNU Clang MSVC Intel COMPILERS GNU Clang MSVC Intel
FEATURES FEATURES
@ -14,3 +19,5 @@ write_compiler_detection_header(
cxx_constexpr cxx_constexpr
cxx_digit_separators cxx_digit_separators
cxx_range_for) cxx_range_for)
unset(OUTPUT_FILE)

View File

@ -2,7 +2,13 @@ function(cmlib_config_hpp_generate)
include(CMLibLargeFiles) include(CMLibLargeFiles)
cmlib_test_large_files(HAVE_LARGEFILES) cmlib_test_large_files(HAVE_LARGEFILES)
set(OUTPUT_FILE ${CMAKE_BINARY_DIR}/include/cmlib_private_config.hpp)
if(CMLIB_GENERATED_HEADERS_PATH)
set(OUTPUT_FILE ${CMLIB_GENERATED_HEADERS_PATH}/cmlib_private_config.hpp)
elseif(ARGV0)
set(OUTPUT_FILE ${ARGV0})
endif()
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_private_config.hpp.in configure_file(${CMLIB_MODULE_DIR}/hpp/cmlib_private_config.hpp.in ${OUTPUT_FILE})
${CMAKE_BINARY_DIR}/include/cmlib_private_config.hpp)
endfunction() endfunction()