Skip to content

Commit

Permalink
Move include_directories() to proper places
Browse files Browse the repository at this point in the history
We should scope these as narrowely as possible to avoid side effects.
  • Loading branch information
CendioOssman committed Aug 25, 2022
1 parent 79329c0 commit f2bbb6b
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 9 deletions.
4 changes: 0 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -231,8 +231,6 @@ if(NOT FOUND_LIBJPEG_TURBO)
message(STATUS "WARNING: You are not using libjpeg-turbo. Performance will suffer.")
endif()

include_directories(${JPEG_INCLUDE_DIR})

option(BUILD_JAVA "Build Java version of the TigerVNC Viewer" FALSE)
if(BUILD_JAVA)
add_subdirectory(java)
Expand Down Expand Up @@ -273,9 +271,7 @@ option(ENABLE_GNUTLS "Enable protocol encryption and advanced authentication" ON
if(ENABLE_GNUTLS)
find_package(GnuTLS)
if (GNUTLS_FOUND)
include_directories(${GNUTLS_INCLUDE_DIR})
add_definitions("-DHAVE_GNUTLS")
add_definitions(${GNUTLS_DEFINITIONS})
endif()
endif()

Expand Down
4 changes: 3 additions & 1 deletion common/rdr/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
include_directories(${CMAKE_SOURCE_DIR}/common ${ZLIB_INCLUDE_DIRS})
include_directories(${CMAKE_SOURCE_DIR}/common)
include_directories(${ZLIB_INCLUDE_DIRS})

add_library(rdr STATIC
BufferedInStream.cxx
Expand All @@ -19,6 +20,7 @@ add_library(rdr STATIC
target_link_libraries(rdr ${ZLIB_LIBRARIES} os)

if(GNUTLS_FOUND)
include_directories(${GNUTLS_INCLUDE_DIR})
target_link_libraries(rdr ${GNUTLS_LIBRARIES})
endif()
if(WIN32)
Expand Down
6 changes: 5 additions & 1 deletion common/rfb/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
include_directories(${CMAKE_SOURCE_DIR}/common ${JPEG_INCLUDE_DIR} ${PIXMAN_INCLUDE_DIRS} ${H264_INCLUDE_DIRS})
include_directories(${CMAKE_SOURCE_DIR}/common)
include_directories(${JPEG_INCLUDE_DIR})
include_directories(${PIXMAN_INCLUDE_DIRS})

add_library(rfb STATIC
Blacklist.cxx
Expand Down Expand Up @@ -75,6 +77,7 @@ if(ENABLE_H264 AND NOT H264_LIBS STREQUAL "NONE")
elseif(H264_LIBS STREQUAL "WIN")
target_sources(rfb PRIVATE H264WinDecoderContext.cxx)
endif()
include_directories(${H264_INCLUDE_DIRS})
target_link_libraries(rfb ${H264_LIBRARIES})
target_link_directories(rfb PUBLIC ${H264_LIBRARY_DIRS})
endif()
Expand All @@ -95,6 +98,7 @@ endif()

if(GNUTLS_FOUND)
target_sources(rfb PRIVATE CSecurityTLS.cxx SSecurityTLS.cxx)
include_directories(${GNUTLS_INCLUDE_DIR})
target_link_libraries(rfb ${GNUTLS_LIBRARIES})
endif()

Expand Down
3 changes: 1 addition & 2 deletions tests/perf/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
include_directories(${GETTEXT_INCLUDE_DIR})

include_directories(${CMAKE_SOURCE_DIR}/common)
include_directories(${GETTEXT_INCLUDE_DIR})

add_library(test_util STATIC util.cxx)

Expand Down
3 changes: 2 additions & 1 deletion tests/unit/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
include_directories(${CMAKE_SOURCE_DIR}/common)
include_directories(${CMAKE_SOURCE_DIR}/vncviewer)
include_directories(${GETTEXT_INCLUDE_DIR})

add_executable(conv conv.cxx)
target_link_libraries(conv rfb)
Expand All @@ -20,4 +21,4 @@ add_executable(unicode unicode.cxx)
target_link_libraries(unicode rfb)

add_executable(emulatemb emulatemb.cxx ../../vncviewer/EmulateMB.cxx)
target_link_libraries(emulatemb rfb ${GETTEXT_LIBRARIES})
target_link_libraries(emulatemb rfb ${GETTEXT_LIBRARIES})

0 comments on commit f2bbb6b

Please sign in to comment.