From a57c04d449f4562d1c8b7b458b5d175fcdc7c17c Mon Sep 17 00:00:00 2001 From: Andrey Astafyev Date: Mon, 8 Apr 2024 21:45:06 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9E=D0=B1=D0=BD=D0=BE=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5=20MyxCMake?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cmake/myx/MyxCMakeConfigVersion.cmake | 2 +- cmake/myx/lib/TargetSetup.cmake | 9 +++++++-- cmake/myx_setup.cmake | 4 ++-- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/cmake/myx/MyxCMakeConfigVersion.cmake b/cmake/myx/MyxCMakeConfigVersion.cmake index 6fb62d5..697afba 100644 --- a/cmake/myx/MyxCMakeConfigVersion.cmake +++ b/cmake/myx/MyxCMakeConfigVersion.cmake @@ -1,4 +1,4 @@ -set(MYX_CMAKE_PACKAGE_VERSION "2.4.33") +set(MYX_CMAKE_PACKAGE_VERSION "2.4.37") if(MYX_CMAKE_PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION) set(PACKAGE_VERSION_COMPATIBLE FALSE) else() diff --git a/cmake/myx/lib/TargetSetup.cmake b/cmake/myx/lib/TargetSetup.cmake index 18ec31d..7daf147 100644 --- a/cmake/myx/lib/TargetSetup.cmake +++ b/cmake/myx/lib/TargetSetup.cmake @@ -75,8 +75,13 @@ function(myx_target_setup TARGET_NAME) install(TARGETS ${TARGET_NAME} COMPONENT MAIN RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) endif() - target_sources(${TARGET_NAME} PUBLIC ${ARG_PUBLIC_HEADERS}) - target_sources(${TARGET_NAME} PRIVATE ${ARG_CPP} ${ARG_PCH} ${ARG_PRIVATE_HEADERS}) + if(${CMAKE_VERSION} VERSION_LESS "3.11.99") + target_sources(${TARGET_NAME} PRIVATE $) + target_sources(${TARGET_NAME} PRIVATE $) + else() + target_sources(${TARGET_NAME} PRIVATE ${ARG_PUBLIC_HEADERS}) + target_sources(${TARGET_NAME} PRIVATE ${ARG_CPP} ${ARG_PCH} ${ARG_PRIVATE_HEADERS}) + endif() target_compile_definitions(${TARGET_NAME} PRIVATE ${ARG_COMPILE_DEFINITIONS}) target_include_directories(${TARGET_NAME} PRIVATE ${ARG_INCLUDE_DIRECTORIES}) diff --git a/cmake/myx_setup.cmake b/cmake/myx_setup.cmake index 848853d..fd79b4b 100644 --- a/cmake/myx_setup.cmake +++ b/cmake/myx_setup.cmake @@ -20,11 +20,11 @@ if(ENV{MYX_CMAKE_DIR}) set(MYX_CMAKE_DIR $ENV{MYX_CMAKE_DIR}) endif() if(MYX_CMAKE_DIR) - find_package(MyxCMake 2.4.33 REQUIRED CONFIG PATHS ${MYX_CMAKE_DIR} NO_DEFAULT_PATH) + find_package(MyxCMake 2.4.37 REQUIRED CONFIG PATHS ${MYX_CMAKE_DIR} NO_DEFAULT_PATH) myx_message_notice("== MyxCMake directory: ${MyxCMake_CONFIG} ==") else() if(MYX_CMAKE_USE_SYSTEM) - find_package(MyxCMake 2.4.33 REQUIRED) + find_package(MyxCMake 2.4.37 REQUIRED) myx_message_notice("== MyxCMake directory: ${MyxCMake_CONFIG} ==") else() include(${PROJECT_SOURCE_DIR}/cmake/myx/MyxCMakeConfig.cmake)