Browse Source

Remove include_directories call for Qt headers

In general this cmake function is considered deprecated
in modern cmake. See https://stackoverflow.com/questions/24031127/cmake-remove-include-directory
for discussion

Test *.proto files removed from add_executable command
Viktor Kopp 6 years ago
parent
commit
5150c9eb47
3 changed files with 3 additions and 9 deletions
  1. 2 1
      src/grpc/CMakeLists.txt
  2. 0 1
      src/protobuf/CMakeLists.txt
  3. 1 7
      tests/CMakeLists.txt

+ 2 - 1
src/grpc/CMakeLists.txt

@@ -1,6 +1,7 @@
 set(GRPC_SUPPORT_LIBRARY_TARGET qtgrpc)
 
-include_directories(${Qt5Core_INCLUDE_DIRS} ${Qt5Network_INCLUDE_DIRS} ${CMAKE_SOURCE_DIR}/src/protobuf)
+# FIXME: replace with 'target_include_directories'
+include_directories(${CMAKE_SOURCE_DIR}/src/protobuf)
 
 set(CMAKE_INCLUDE_CURRENT_DIR ON)
 set(CMAKE_AUTOMOC ON)

+ 0 - 1
src/protobuf/CMakeLists.txt

@@ -1,6 +1,5 @@
 set(SUPPORT_LIBRARY_TARGET qtprotobufsupport)
 
-include_directories(${Qt5Core_INCLUDE_DIRS} ${Qt5Network_INCLUDE_DIRS})
 set(CMAKE_INCLUDE_CURRENT_DIR ON)
 set(CMAKE_AUTOMOC ON)
 set(CMAKE_AUTORCC ON)

+ 1 - 7
tests/CMakeLists.txt

@@ -11,7 +11,6 @@ if (UNIX AND NOT GTest_FOUND)
     add_subdirectory(${GTest_SOURCE_DIR} ${GTest_BINARY_DIR})
 endif()
 
-include_directories(${Qt5Core_INCLUDE_DIRS})
 set(CMAKE_INCLUDE_CURRENT_DIR OFF)
 set(CMAKE_AUTOMOC OFF)
 set(CMAKE_AUTORCC ON)
@@ -34,11 +33,8 @@ if(WIN32)
     set(GTEST_BOTH_LIBRARIES "")
     #Set  path to GTest include directory
     include_directories(${GTEST_INCLUDE_PATHS} "/")
-elseif(UNIX)
-    include_directories(${GTEST_INCLUDE_DIRS})
 endif()
 
-file(GLOB HEADERS ${TESTS_OUT_DIR}/*.h)
 file(GLOB SOURCES main.cpp
     simpletest.cpp
     serializationtest.cpp
@@ -46,10 +42,8 @@ file(GLOB SOURCES main.cpp
     servertest.cpp
     clienttest.cpp)
 
-file(GLOB PROTOS proto/*.proto)
-
 set(testtarget "qtprotobuf_test")
-add_executable(${testtarget} ${SOURCES} ${MOC_SOURCES} ${GENERATED_SOURCES} ${PROTOS})
+add_executable(${testtarget} ${SOURCES} ${MOC_SOURCES} ${GENERATED_SOURCES})
 if(WIN32)
     target_link_libraries(${testtarget} "${GTEST_BOTH_LIBRARIES}/gmock_main.lib" "${GTEST_BOTH_LIBRARIES}/gmock.lib" qtprotobufsupport qtgrpc Qt5::Core)
 elseif(UNIX)