Путь к модулям CMLib
This commit is contained in:
parent
7302444663
commit
959a730ec6
@ -20,6 +20,6 @@ function(add_common_library LIBNAME SOURCES)
|
||||
set_target_properties(${LIBNAME}_static PROPERTIES
|
||||
OUTPUT_NAME ${LIBNAME}
|
||||
ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_INSTALL_LIBDIR})
|
||||
configure_file(${CMAKE_SOURCE_DIR}/cmake/cmlib/pc/lib.pc.in ${CMAKE_BINARY_DIR}/${LIBNAME}.pc)
|
||||
configure_file(${CMLIB_MODULE_DIR}/pc/lib.pc.in ${CMAKE_BINARY_DIR}/${LIBNAME}.pc)
|
||||
endfunction()
|
||||
|
||||
|
@ -2,5 +2,5 @@ function(cmlib_config_hpp_generate)
|
||||
get_property(VERSION_INT GLOBAL PROPERTY VERSION_INT)
|
||||
get_property(VERSION_STR GLOBAL PROPERTY VERSION_STR)
|
||||
get_property(ORGANIZATION_NAME GLOBAL PROPERTY ORGANIZATION_NAME)
|
||||
configure_file(${CMAKE_SOURCE_DIR}/cmake/cmlib/hpp/config.hpp.in ${CMAKE_BINARY_DIR}/include/config.hpp)
|
||||
configure_file(${CMLIB_MODULE_DIR}/hpp/config.hpp.in ${CMAKE_BINARY_DIR}/include/config.hpp)
|
||||
endfunction()
|
||||
|
@ -3,3 +3,12 @@ string(TOUPPER ${PROJECT_NAME} _project_name_uppercase)
|
||||
string(REGEX REPLACE "[ -]" "_" _project_name_fixed ${_project_name_uppercase})
|
||||
set(CMLIB_PROJECT_NAME_CANONICAL ${_project_name_fixed})
|
||||
|
||||
# CMLIB_MODULE_DIR
|
||||
set(CMLIB_MODULE_DIR "")
|
||||
foreach(_m ${CMAKE_MODULE_PATH})
|
||||
if(EXISTS ${_m}/CMLibCommon.cmake)
|
||||
get_filename_component(CMLIB_MODULE_DIR ${_m}/CMLibCommon.cmake DIRECTORY)
|
||||
break()
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
|
@ -10,7 +10,7 @@ macro(test_large_files VARIABLE USE_64_SUFFIX)
|
||||
|
||||
# First try without any macros defined
|
||||
try_compile(LARGE_FILES_SUPPORTED "${CMAKE_BINARY_DIR}"
|
||||
"${CMAKE_MODULE_PATH}/tests/LargeFiles${SUFFIX_64}.c"
|
||||
"${CMLIB_MODULE_DIR}/tests/LargeFiles${SUFFIX_64}.c"
|
||||
OUTPUT_VARIABLE TRY_LARGE_FILES_OUTPUT)
|
||||
|
||||
if(VERBOSE_LARGE_FILES)
|
||||
@ -20,7 +20,7 @@ macro(test_large_files VARIABLE USE_64_SUFFIX)
|
||||
if(NOT LARGE_FILES_SUPPORTED)
|
||||
# Try with C macro _FILE_OFFSET_BITS=64
|
||||
try_compile(LARGE_FILES_SUPPORTED "${CMAKE_BINARY_DIR}"
|
||||
"${CMAKE_MODULE_PATH}/tests/LargeFiles${SUFFIX_64}.c"
|
||||
"${CMLIB_MODULE_DIR}/tests/LargeFiles${SUFFIX_64}.c"
|
||||
COMPILE_DEFINITIONS "-D_FILE_OFFSET_BITS=64"
|
||||
OUTPUT_VARIABLE TRY_LARGE_FILES_OUTPUT)
|
||||
|
||||
@ -37,7 +37,7 @@ macro(test_large_files VARIABLE USE_64_SUFFIX)
|
||||
# Try with C macro _LARGEFILE_SOURCE
|
||||
|
||||
try_compile(LARGE_FILES_SUPPORTED "${CMAKE_BINARY_DIR}"
|
||||
"${CMAKE_MODULE_PATH}/tests/LargeFiles${SUFFIX_64}.c"
|
||||
"${CMLIB_MODULE_DIR}/tests/LargeFiles${SUFFIX_64}.c"
|
||||
COMPILE_DEFINITIONS "-D_LARGEFILE${SUFFIX_64}_SOURCE"
|
||||
OUTPUT_VARIABLE TRY_LARGE_FILES_OUTPUT)
|
||||
|
||||
@ -53,7 +53,7 @@ macro(test_large_files VARIABLE USE_64_SUFFIX)
|
||||
if(NOT LARGE_FILES_SUPPORTED)
|
||||
# Try with both C macro _FILE_OFFSET_BITS=64 and _LARGEFILE_SOURCE
|
||||
try_compile(LARGE_FILES_SUPPORTED "${CMAKE_BINARY_DIR}"
|
||||
"${CMAKE_MODULE_PATH}/tests/LargeFiles${SUFFIX_64}.c"
|
||||
"${CMLIB_MODULE_DIR}/tests/LargeFiles${SUFFIX_64}.c"
|
||||
COMPILE_DEFINITIONS "-D_FILE_OFFSET_BITS=64" "-D_LARGEFILE${SUFFIX_64}_SOURCE"
|
||||
OUTPUT_VARIABLE TRY_LARGE_FILES_OUTPUT)
|
||||
|
||||
@ -70,7 +70,7 @@ macro(test_large_files VARIABLE USE_64_SUFFIX)
|
||||
if(NOT LARGE_FILES_SUPPORTED)
|
||||
# Maybe we are using the Windows C standard library
|
||||
try_compile(LARGE_FILES_SUPPORTED "${CMAKE_BINARY_DIR}"
|
||||
"${CMAKE_MODULE_PATH}/tests/LargeFilesWindows.c")
|
||||
"${CMLIB_MODULE_DIR}/tests/LargeFilesWindows.c")
|
||||
endif(NOT LARGE_FILES_SUPPORTED)
|
||||
|
||||
if(LARGE_FILES_SUPPORTED)
|
||||
|
@ -40,7 +40,7 @@ function(qt_translation)
|
||||
COMMAND ${Qt5_LUPDATE_EXECUTABLE} ARGS ${_sources_list} -ts ${_ts_list}
|
||||
DEPENDS ${_sources_list})
|
||||
|
||||
configure_file(${CMAKE_SOURCE_DIR}/cmake/cmlib/qrc/l10n.qrc.in ${CMAKE_BINARY_DIR}/${_target}_l10n.qrc)
|
||||
configure_file(${CMLIB_MODULE_DIR}/qrc/l10n.qrc.in ${CMAKE_BINARY_DIR}/${_target}_l10n.qrc)
|
||||
qt5_add_resources(_qrc ${CMAKE_BINARY_DIR}/${_target}_l10n.qrc)
|
||||
add_custom_target(_qrc_target DEPENDS ${_qrc})
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
if(NOT TARGET uninstall)
|
||||
configure_file(
|
||||
"${CMAKE_SOURCE_DIR}/cmake/cmlib/CMLibUninstall.cmake.in"
|
||||
"${CMLIB_MODULE_DIR}/CMLibUninstall.cmake.in"
|
||||
"${CMAKE_BINARY_DIR}/cmake_uninstall.cmake"
|
||||
IMMEDIATE @ONLY)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user