Работа с ExternalProject

This commit is contained in:
Andrei Astafev 2021-12-09 17:55:30 +03:00
parent 79492c8464
commit b69aa4819d
2 changed files with 50 additions and 2 deletions

View File

@ -34,12 +34,11 @@ include(MyxCMakePkgConfig)
include(MyxCMakeNinjaGeneratorHelper)
# include(CMLibDocDoxygen) include(CMLibDocBreathe)
# include(CMLibExternalProject)
include(MyxCMakeExternalProject)
include(MyxCMakeCPack)
include(MyxCMakeUninstall)
# Additional functions
include(MyxCMakeGenerateGitInfoHeader)
include(MyxCMakeGeneratePrivateConfigHeader)

View File

@ -0,0 +1,49 @@
include(ExternalProject)
if(CMAKE_BUILD_TYPE)
list(APPEND MYX_CMAKE_EXTERNAL_PROJECT_ARGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE})
endif()
if(MYX_CMAKE_DIR)
list(APPEND MYX_CMAKE_EXTERNAL_PROJECT_ARGS -DMYX_CMAKE_MAIN_DIR=${MYX_CMAKE_DIR})
endif()
if(CMAKE_C_COMPILER)
list(APPEND MYX_CMAKE_EXTERNAL_PROJECT_ARGS -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER})
endif()
if(CMAKE_C_FLAGS)
list(APPEND MYX_CMAKE_EXTERNAL_PROJECT_ARGS -E env "CFLAGS=${CMAKE_C_FLAGS}")
endif()
if(CMAKE_CPP_COMPILER)
list(APPEND MYX_CMAKE_EXTERNAL_PROJECT_ARGS -DCMAKE_CPP_COMPILER=${CMAKE_CPP_COMPILER})
endif()
if(CMAKE_CXX_FLAGS)
list(APPEND MYX_CMAKE_EXTERNAL_PROJECT_ARGS -E env "CXXFLAGS=${CMAKE_CXX_FLAGS}")
endif()
if(CMAKE_Fortran_COMPILER)
list(APPEND MYX_CMAKE_EXTERNAL_PROJECT_ARGS -DCMAKE_Fortran_COMPILER=${CMAKE_Fortran_COMPILER})
endif()
if(CMAKE_Fortran_FLAGS)
list(APPEND MYX_CMAKE_EXTERNAL_PROJECT_ARGS -E env "FFLAGS=${CMAKE_Fortran_FLAGS}")
endif()
if(CMAKE_INSTALL_PREFIX)
list(APPEND MYX_CMAKE_EXTERNAL_PROJECT_ARGS -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR})
endif()
if(CMAKE_PREFIX_PATH)
list(APPEND MYX_CMAKE_EXTERNAL_PROJECT_ARGS -DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH})
endif()
if(Qt5_DIR)
list(APPEND MYX_CMAKE_EXTERNAL_PROJECT_ARGS -DQt5_DIR=${Qt5_DIR})
endif()
if(Qt5Core_DIR)
list(APPEND MYX_CMAKE_EXTERNAL_PROJECT_ARGS -DQt5Core_DIR=${Qt5Core_DIR})
endif()