Created
October 11, 2021 12:15
-
-
Save mlcollard/818623508b8c74634678c22132bced42 to your computer and use it in GitHub Desktop.
CMake file for srcComplexity
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# @file CMakeLists.txt | |
# | |
# CMake files for the srccomplexity program | |
cmake_minimum_required(VERSION 3.20) | |
# project info | |
project(srcComplexity) | |
find_package(LibXml2 REQUIRED) | |
# C++17 | |
set(CMAKE_CXX_STANDARD 17) | |
# Turn on warnings | |
if (MSVC) | |
# warning level 4 | |
add_compile_options(/W4) | |
else() | |
# standard warnings | |
add_compile_options(-Wall) | |
endif() | |
# srcomplexity program | |
add_executable(srccomplexity srcComplexity.cpp srcMLXPathCount.cpp) | |
target_include_directories(srccomplexity SYSTEM PRIVATE ${LIBXML2_INCLUDE_DIRS}) | |
target_link_libraries(srccomplexity PRIVATE ${LIBXML2_LIBRARIES}) | |
# run command | |
add_custom_target(run ${CMAKE_BINARY_DIR}/srccomplexity ${CMAKE_SOURCE_DIR}/srcMLXPathCount.cpp.xml) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment