# Generated by cpp_to_rust. # See the template at "cpp_to_rust/cpp_to_rust_generator/templates/cpp_checker/CMakeLists.txt". cmake_minimum_required(VERSION 3.0.0 FATAL_ERROR) project (cpp_checker) include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) if(C2R_INCLUDE_PATHS) include_directories(${C2R_INCLUDE_PATHS}) endif() if(C2R_LIB_PATHS) link_directories(${C2R_LIB_PATHS}) endif() file(GLOB sources *.cpp) file(GLOB headers *.h) add_executable(cpp_checker ${sources}) if(C2R_LINKED_LIBS) target_link_libraries(cpp_checker ${C2R_LINKED_LIBS}) endif() macro(add_osx_framework fwname target) find_library(FRAMEWORK_${fwname} NAMES ${fwname} PATHS ${C2R_FRAMEWORK_PATHS} NO_DEFAULT_PATH) if( ${FRAMEWORK_${fwname} STREQUAL FRAMEWORK_${fwname}-NOTFOUND) message(FATAL_ERROR "Framework not found: ${fwname} (paths: ${C2R_FRAMEWORK_PATHS})") else() target_link_libraries(${target} "${FRAMEWORK_${fwname}/${fwname}") message(STATUS "Framework ${fwname} found at ${FRAMEWORK_${fwname}") endif() endmacro(add_osx_framework) if(C2R_LINKED_FRAMEWORKS) foreach(framework ${C2R_LINKED_FRAMEWORKS}) ADD_OSX_FRAMEWORK(${framework} cpp_checker) endforeach() endif() if(${CMAKE_COMPILER_IS_GNUCXX}) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Werror=return-type") endif() if(C2R_COMPILER_FLAGS) set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${C2R_COMPILER_FLAGS}") endif() if(C2R_LINKED_FRAMEWORKS) foreach(framework ${C2R_LINKED_FRAMEWORKS}) ADD_OSX_FRAMEWORK(${framework} type_sizes) endforeach() endif() add_custom_command(TARGET cpp_checker POST_BUILD COMMAND cpp_checker)