Tinyxml2: لا يتضمن CMakeLists.txt تصدير المسارات.

تم إنشاؤها على ٢١ يونيو ٢٠١٦  ·  5تعليقات  ·  مصدر: leethomason/tinyxml2

الرجاء إضافة شيء مشابه لـ:
target_include_directories (tinyxml2 PUBLIC $ {CMAKE_CURRENT_SOURCE_DIR} /.)

target_include_directories (tinyxml2_static PUBLIC $ {CMAKE_CURRENT_SOURCE_DIR} /.)

إلى CMakeLists.txt. سيسمح هذا بالبناء والربط بـ tinyxml2 في شجرة بناء واحدة. سيكون التطبيق الذي يستخدم cmake قادرًا على: add_subdirectory (tinyxml2) ثم استخدام أهداف tinyxml2.

التعليق الأكثر فائدة

يتطلب استخدام target_include_directories إصدار cmake على الأقل 2.8.11. إذا كنت ترغب في الحفاظ على التوافق مع cmake 2.6 ، فيمكن رؤية طريقة جيدة للتعامل مع هذا في قوائم CMakeList الخاصة بـ googletest:

# If the CMake version supports it, attach header directory information
# to the targets for when we are part of a parent build (ie being pulled
# in via add_subdirectory() rather than being a standalone build).
if (DEFINED CMAKE_VERSION AND NOT "${CMAKE_VERSION}" VERSION_LESS "2.8.11")
  target_include_directories(gtest      INTERFACE "${gtest_SOURCE_DIR}/include")
  target_include_directories(gtest_main INTERFACE "${gtest_SOURCE_DIR}/include")
endif()

ال 5 كومينتر

هذا ما أحتاجه في مشروعي. ارفع ابهامك!

نعم ، ستكون هذه ميزة ملائمة حقًا.

اقتراح ميزة رائعة! أنا أتطلع أيضًا لاستخدامه في مشروعي.

يتطلب استخدام target_include_directories إصدار cmake على الأقل 2.8.11. إذا كنت ترغب في الحفاظ على التوافق مع cmake 2.6 ، فيمكن رؤية طريقة جيدة للتعامل مع هذا في قوائم CMakeList الخاصة بـ googletest:

# If the CMake version supports it, attach header directory information
# to the targets for when we are part of a parent build (ie being pulled
# in via add_subdirectory() rather than being a standalone build).
if (DEFINED CMAKE_VERSION AND NOT "${CMAKE_VERSION}" VERSION_LESS "2.8.11")
  target_include_directories(gtest      INTERFACE "${gtest_SOURCE_DIR}/include")
  target_include_directories(gtest_main INTERFACE "${gtest_SOURCE_DIR}/include")
endif()

مندمجة. شكرا kurylo

هل كانت هذه الصفحة مفيدة؟
0 / 5 - 0 التقييمات

القضايا ذات الصلة

leethomason picture leethomason  ·  4تعليقات

KerstinKeller picture KerstinKeller  ·  5تعليقات

MortenMacFly picture MortenMacFly  ·  18تعليقات

vigneshrams picture vigneshrams  ·  3تعليقات

ajtruckle picture ajtruckle  ·  9تعليقات