From b757183f51920e8445ed0ea0bbdb490d99781ec6 Mon Sep 17 00:00:00 2001 From: Vo Trung Chi Date: Wed, 3 Jul 2019 09:41:38 +0700 Subject: cmake-improvements (#135) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. Allow building as a subproject of another cmake project (CMAKE_* vs PROJECT_* variables) 2. Do not generate header files within source – bad practice, use build directory for that(e.g. change location where dlt_version.h is being generated) 3. Use add_compile_options() instead of *_C/CXX_FLAGS variables for proper compile environment definition, also bad practice, also see p.2 4. Add WITH_DLT_PKGCONFIG – add generate pkgconfig .pc files as switchable option, should probably be part of headers install routine. Signed-off-by: Radoslaw Kaczorowski --- include/dlt/CMakeLists.txt | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'include') diff --git a/include/dlt/CMakeLists.txt b/include/dlt/CMakeLists.txt index 057af1f..d782d8a 100644 --- a/include/dlt/CMakeLists.txt +++ b/include/dlt/CMakeLists.txt @@ -15,13 +15,16 @@ # @licence end@ ####### -install(FILES dlt.h dlt_user.h dlt_user_macros.h dlt_client.h dlt_protocol.h dlt_common.h dlt_types.h dlt_version.h dlt_shm.h dlt_offline_trace.h dlt_filetransfer.h dlt_common_api.h +install(FILES dlt.h dlt_user.h dlt_user_macros.h dlt_client.h dlt_protocol.h + dlt_common.h dlt_types.h dlt_shm.h dlt_offline_trace.h + dlt_filetransfer.h dlt_common_api.h + ${PROJECT_BINARY_DIR}/include/dlt/dlt_version.h DESTINATION include/dlt COMPONENT devel) +if(WITH_DLT_CXX11_EXT) + install(FILES dlt_cpp_extension.hpp + DESTINATION include/dlt + COMPONENT devel) +endif() -if(${WITH_DLT_CXX11_EXT}) - install(FILES dlt_cpp_extension.hpp - DESTINATION include/dlt - COMPONENT devel) -endif() \ No newline at end of file -- cgit v1.2.1