c++cmakerapidxml

How to add RapidXml to a CMake Project?


I want to add RapidXML to my CMake Project, so i can use it. My Project Structure looks like this:

Root
|
|_inc (for my own Headers)
|    |_main.h
|    |_CMakeList.txt
|_src (for my own Sources)
|    |_main.cpp
|    |_CMakeList.txt
|_libs (for third party libs)
|     |_rapidxml
|     |_CMakeList.txt
|_CMakeList.txt

Can someone help me? Thanks in advance!


Solution

  • I found a Solution myself. :) In the /Root/libs/CMakeList.txt I added the following lines:

    add_subdirectory(rapidxml)
    add_library(rapidxml INTERFACE)
    target_include_directories(rapidxml INTERFACE rapidxml/ )
    

    if there is a better solution I am happy to hear!