Browse Source

include_directories->target_include_directories

master
Tim Zeuner 1 year ago
parent
commit
1fd6853245

+ 19
- 24
AutonomousMode/CMakeLists.txt View File

@@ -9,23 +9,6 @@ set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package( OpenCV REQUIRED )
find_package(Threads REQUIRED)

include_directories( ${OpenCV_INCLUDE_DIRS}
${CMAKE_CURRENT_SOURCE_DIR}/Input
${CMAKE_CURRENT_SOURCE_DIR}/Processing
${CMAKE_CURRENT_SOURCE_DIR}/ControlModule
${CMAKE_CURRENT_SOURCE_DIR}/Interpreter
${CMAKE_CURRENT_SOURCE_DIR}/IntersectionHandler
${CMAKE_CURRENT_SOURCE_DIR}/Utils
)

link_directories( ${Input_SOURCE_DIRS}
${Processing_SOURCE_DIRS}
${ControlModule_SOURCE_DIRS}
${Interpreter_SOURCE_DIRS}
${IntersectionHandler_SOURCE_DIRS}
${Utils_SOURCE_DIRS}
)

add_subdirectory(Input)
add_subdirectory(Processing)
add_subdirectory(ControlModule)
@@ -34,16 +17,28 @@ add_subdirectory(IntersectionHandler)
add_subdirectory(Utils)
add_subdirectory(Spielwiese)

target_include_directories(Input PRIVATE .)
target_include_directories(Processing PRIVATE .)
target_include_directories(ControlModule PRIVATE .)
target_include_directories(Interpreter PRIVATE .)
target_include_directories(IntersectionHandler PRIVATE .)
target_include_directories(Utils PRIVATE .)

add_executable(lfr_image_processing lfr.cpp autonomous_mode_main.cpp)
add_library(lfr_image_processing_lib lfr.cpp)

target_include_directories(lfr_image_processing PUBLIC ${OpenCV_INCLUDE_DIRS})
target_include_directories(lfr_image_processing PUBLIC ${Input_SOURCE_DIRS})
target_include_directories(lfr_image_processing PUBLIC ${Processing_SOURCE_DIRS})
target_include_directories(lfr_image_processing PUBLIC ${ControlModule_SOURCE_DIRS})
target_include_directories(lfr_image_processing PUBLIC ${Interpreter_SOURCE_DIRS})
target_include_directories(lfr_image_processing PUBLIC ${IntersectionHandler_SOURCE_DIRS})
target_include_directories(lfr_image_processing PUBLIC ${Utils_SOURCE_DIRS})
target_include_directories(lfr_image_processing PUBLIC .)

target_include_directories(lfr_image_processing_lib PUBLIC ${OpenCV_INCLUDE_DIRS})
target_include_directories(lfr_image_processing_lib PUBLIC ${Input_SOURCE_DIRS})
target_include_directories(lfr_image_processing_lib PUBLIC ${Processing_SOURCE_DIRS})
target_include_directories(lfr_image_processing_lib PUBLIC ${ControlModule_SOURCE_DIRS})
target_include_directories(lfr_image_processing_lib PUBLIC ${Interpreter_SOURCE_DIRS})
target_include_directories(lfr_image_processing_lib PUBLIC ${IntersectionHandler_SOURCE_DIRS})
target_include_directories(lfr_image_processing_lib PUBLIC .)

target_link_libraries( lfr_image_processing ${OpenCV_LIBS} Input Processing ControlModule Interpreter IntersectionHandler Utils Threads::Threads)
target_link_libraries( lfr_image_processing_lib ${OpenCV_LIBS} Input Processing ControlModule Interpreter IntersectionHandler Utils Threads::Threads)

set(CPACK_PROJECT_NAME ${PROJECT_NAME})
set(CPACK_PROJECT_VERSION ${PROJECT_VERSION})

+ 2
- 4
AutonomousMode/ControlModule/CMakeLists.txt View File

@@ -1,10 +1,8 @@
include_directories( ${Utils_SOURCE_DIRS})
link_directories(${Utils_SOURCE_DIRS})

add_library(ControlModule control_module.cpp)
set_target_properties(ControlModule PROPERTIES VERSION ${PROJECT_VERSION})
target_include_directories(ControlModule PRIVATE .)

target_include_directories(ControlModule PRIVATE ${Utils_SOURCE_DIRS})
target_include_directories(ControlModule PUBLIC .)
target_link_libraries( ControlModule Utils)

set(CPACK_PROJECT_NAME ${PROJECT_NAME})

+ 2
- 4
AutonomousMode/Input/CMakeLists.txt View File

@@ -1,12 +1,10 @@
find_package( OpenCV REQUIRED )
include_directories( ${OpenCV_INCLUDE_DIRS} ${Utils_SOURCE_DIRS})

link_directories(${Utils_SOURCE_DIRS})

add_library(Input input.cpp)
set_target_properties(Input PROPERTIES VERSION ${PROJECT_VERSION})
target_include_directories(Input PRIVATE .)

target_include_directories(Input PRIVATE ${OpenCV_INCLUDE_DIRS} ${Utils_SOURCE_DIRS})
target_include_directories(Input PUBLIC .)
target_link_libraries( Input ${OpenCV_LIBS} Utils)

set(CPACK_PROJECT_NAME ${PROJECT_NAME})

+ 2
- 4
AutonomousMode/Interpreter/CMakeLists.txt View File

@@ -1,10 +1,8 @@
include_directories( ${Utils_SOURCE_DIRS})
link_directories(${Utils_SOURCE_DIRS})

add_library(Interpreter interpreter.cpp)
set_target_properties(Interpreter PROPERTIES VERSION ${PROJECT_VERSION})
target_include_directories(Interpreter PRIVATE .)

target_include_directories(Interpreter PRIVATE ${Utils_SOURCE_DIRS})
target_include_directories(Interpreter PUBLIC .)
target_link_libraries( Interpreter Utils)

set(CPACK_PROJECT_NAME ${PROJECT_NAME})

+ 3
- 4
AutonomousMode/IntersectionHandler/CMakeLists.txt View File

@@ -1,10 +1,9 @@
include_directories( ${Utils_SOURCE_DIRS})
link_directories(${Utils_SOURCE_DIRS})

add_library(IntersectionHandler intersection_handler.cpp)
set_target_properties(IntersectionHandler PROPERTIES VERSION ${PROJECT_VERSION})
target_include_directories(IntersectionHandler PRIVATE .)

#target_include_directories(IntersectionHandler PRIVATE ${Utils_SOURCE_DIRS})
target_include_directories(IntersectionHandler PRIVATE ${Utils_SOURCE_DIRS})
target_include_directories(IntersectionHandler PUBLIC .)
target_link_libraries( IntersectionHandler Utils)

set(CPACK_PROJECT_NAME ${PROJECT_NAME})

+ 3
- 5
AutonomousMode/Processing/CMakeLists.txt View File

@@ -1,13 +1,11 @@
find_package( OpenCV REQUIRED )
include_directories( ${OpenCV_INCLUDE_DIRS} )
include_directories( ${Utils_SOURCE_DIRS})

link_directories(${Utils_SOURCE_DIRS})

add_library(Processing processing.cpp)
set_target_properties(Processing PROPERTIES VERSION ${PROJECT_VERSION})
target_include_directories(Processing PRIVATE .)

target_include_directories(Processing PRIVATE ${Utils_INCLUDE_DIRS})
target_include_directories(Processing PRIVATE ${OpenCV_INCLUDE_DIRS})
target_include_directories(Processing PUBLIC .)
target_link_libraries( Processing ${OpenCV_LIBS} Utils)

set(CPACK_PROJECT_NAME ${PROJECT_NAME})

+ 4
- 3
AutonomousMode/Utils/CMakeLists.txt View File

@@ -1,12 +1,13 @@
find_package( OpenCV REQUIRED )
include_directories( ${OpenCV_INCLUDE_DIRS} )

add_library(Utils utils.cpp)
add_library(Utils SHARED utils.cpp)
set_target_properties(Utils PROPERTIES VERSION ${PROJECT_VERSION})
target_include_directories(Utils PRIVATE .)

target_include_directories(Utils PRIVATE ${OpenCV_INCLUDE_DIRS})
target_include_directories(Utils PUBLIC .)
target_link_libraries( Utils ${OpenCV_LIBS} )

set(CPACK_PROJECT_NAME ${PROJECT_NAME})
set(CPACK_PROJECT_VERSION ${PROJECT_VERSION})
set (UTILS_SRC_DIR ${CMAKE_CURRENT_SOURCE_DIR})
include(CPack)

Loading…
Cancel
Save