Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
7166CEM_Assignment/CMakeLists.txt
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
40 lines (24 sloc)
993 Bytes
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
cmake_minimum_required(VERSION 3.0) | |
set(CMAKE_CXX_STANDARD 17) | |
set(CMAKE_EXPORT_COMPILE_COMMANDS ON CACHE INTERNAL "") | |
project(Application C) | |
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wvla -Werror=vla") | |
file( MAKE_DIRECTORY Src_autogen ) | |
add_custom_command( OUTPUT Src_autogen/candata.h Src_autogen/candata.c | |
COMMAND python3 -m cantools generate_c_source candata.dbc -o Src_autogen | |
MAIN_DEPENDENCY candata.dbc | |
COMMENT "Auto code generation from DBC file" ) | |
find_package(Doxygen) | |
add_subdirectory(Docs) | |
include_directories( Include ) | |
include_directories( Src_autogen ) | |
file( MAKE_DIRECTORY bin ) | |
set( CMAKE_RUNTIME_OUTPUT_DIRECTORY bin ) | |
file( MAKE_DIRECTORY lib ) | |
SET( LIBRARY_OUTPUT_PATH lib ) | |
add_library( candata SHARED Src_autogen/candata.c ) | |
target_include_directories( candata PUBLIC Src_autogen ) | |
add_executable( Application Src/Application.c ) | |
target_link_libraries( Application PUBLIC candata ) | |
enable_testing() | |
add_subdirectory(Testing) | |