Commit 31d012a0 authored by Clément Péron's avatar Clément Péron

cmake: library source should only contains files to compile

Some executable and library add header files as source.
These should not be declared as source file, remove them.
Signed-off-by: default avatarClément Péron <peron.clem@gmail.com>
parent 3e7c1588
...@@ -91,10 +91,7 @@ set(TEST_DIR ${MAIN_DIR}/t) ...@@ -91,10 +91,7 @@ set(TEST_DIR ${MAIN_DIR}/t)
message(${MAIN_DIR}) message(${MAIN_DIR})
set(PC_SOURCES ${MAIN_DIR}/protobuf-c/protobuf-c.c add_library(protobuf-c ${MAIN_DIR}/protobuf-c/protobuf-c.c)
${MAIN_DIR}/protobuf-c/protobuf-c.h)
add_library(protobuf-c ${PC_SOURCES})
set_target_properties(protobuf-c PROPERTIES COMPILE_PDB_NAME protobuf-c) set_target_properties(protobuf-c PROPERTIES COMPILE_PDB_NAME protobuf-c)
target_include_directories( target_include_directories(
protobuf-c PUBLIC $<BUILD_INTERFACE:${MAIN_DIR}> protobuf-c PUBLIC $<BUILD_INTERFACE:${MAIN_DIR}>
...@@ -111,7 +108,6 @@ include_directories(${MAIN_DIR}/protobuf-c) ...@@ -111,7 +108,6 @@ include_directories(${MAIN_DIR}/protobuf-c)
if(BUILD_PROTOC) if(BUILD_PROTOC)
include_directories(${CMAKE_CURRENT_BINARY_DIR}) # for generated files include_directories(${CMAKE_CURRENT_BINARY_DIR}) # for generated files
endif() endif()
if(MSVC AND NOT BUILD_SHARED_LIBS) if(MSVC AND NOT BUILD_SHARED_LIBS)
...@@ -178,11 +174,10 @@ if(BUILD_PROTOC) ...@@ -178,11 +174,10 @@ if(BUILD_PROTOC)
BYPRODUCTS protobuf-c/protobuf-c.pb.cc protobuf-c/protobuf-c.pb.h BYPRODUCTS protobuf-c/protobuf-c.pb.cc protobuf-c/protobuf-c.pb.h
SOURCES ${MAIN_DIR}/protobuf-c/protobuf-c.proto) SOURCES ${MAIN_DIR}/protobuf-c/protobuf-c.proto)
file(GLOB PROTOC_GEN_C_SRC ${MAIN_DIR}/protoc-c/*.h ${MAIN_DIR}/protoc-c/*.cc) file(GLOB PROTOC_GEN_C_SRC ${MAIN_DIR}/protoc-c/*.cc)
add_executable( add_executable(
protoc-gen-c protoc-gen-c
${PROTOC_GEN_C_SRC} ${CMAKE_CURRENT_BINARY_DIR}/protobuf-c/protobuf-c.pb.cc ${PROTOC_GEN_C_SRC} ${CMAKE_CURRENT_BINARY_DIR}/protobuf-c/protobuf-c.pb.cc)
${CMAKE_CURRENT_BINARY_DIR}/protobuf-c/protobuf-c.pb.h)
add_dependencies(protoc-gen-c protoc-generated-files) add_dependencies(protoc-gen-c protoc-generated-files)
target_include_directories( target_include_directories(
protoc-gen-c PUBLIC $<BUILD_INTERFACE:${MAIN_DIR}> protoc-gen-c PUBLIC $<BUILD_INTERFACE:${MAIN_DIR}>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment