File: CMakeLists.txt

package info (click to toggle)
cppcheck 2.19.0-1
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 26,412 kB
  • sloc: cpp: 272,462; python: 22,408; ansic: 8,088; sh: 1,059; makefile: 1,041; xml: 987; cs: 291
file content (24 lines) | stat: -rw-r--r-- 987 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
file(GLOB hdrs "*.h")
file(GLOB srcs "*.cpp")

add_library(tinyxml2 ${srcs} ${hdrs})
target_dll_compile_definitions(tinyxml2 EXPORT TINYXML2_EXPORT IMPORT TINYXML2_IMPORT)

# TODO: needs to be fixed upstream
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
    target_compile_options(tinyxml2 PRIVATE -Wno-suggest-attribute=format)
    target_compile_options(tinyxml2 PRIVATE -Wno-useless-cast)
endif()
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
    target_compile_options_safe(tinyxml2 -Wno-implicit-fallthrough)
    target_compile_options_safe(tinyxml2 -Wno-suggest-destructor-override)
    target_compile_options_safe(tinyxml2 -Wno-zero-as-null-pointer-constant)
    target_compile_options_safe(tinyxml2 -Wno-format-nonliteral)
    target_compile_options_safe(tinyxml2 -Wno-inconsistent-missing-destructor-override)
endif()
if(CYGWIN)
    target_compile_definitions(-D_LARGEFILE_SOURCE)  # required for fseeko() and ftello()
endif()

target_externals_include_directories(tinyxml2 PUBLIC .)