Skip to content

Commit

Permalink
Merge pull request #422 from Nuzhny007/master
Browse files Browse the repository at this point in the history
Add folders in cmake
  • Loading branch information
Nuzhny007 authored Jul 27, 2023
2 parents 9395be3 + 5012953 commit 38c500d
Show file tree
Hide file tree
Showing 10 changed files with 46 additions and 47 deletions.
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ cmake_minimum_required(VERSION 3.9)

project(MTTracking VERSION 1.1.0)

set_property(GLOBAL PROPERTY USE_FOLDERS ON)

unset(CMAKE_C_FLAGS CACHE)
unset(CMAKE_CXX_FLAGS CACHE)
unset(CMAKE_CXX_FLAGS_RELEASE CACHE)
Expand Down
30 changes: 12 additions & 18 deletions async_detector/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,26 @@ cmake_minimum_required (VERSION 3.5)

project(AsyncDetector)

set(SOURCES
main.cpp
AsyncDetector.cpp
)
set(SOURCES main.cpp
AsyncDetector.cpp)

set(HEADERS
AsyncDetector.h
Queue.h
)
set(HEADERS AsyncDetector.h
Queue.h)

# ----------------------------------------------------------------------------
# добавляем include директории
# ----------------------------------------------------------------------------
INCLUDE_DIRECTORIES(
${PROJECT_SOURCE_DIR}/../src
INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/../src
${PROJECT_SOURCE_DIR}/../src/common
${PROJECT_SOURCE_DIR}/../src/Detector
${PROJECT_SOURCE_DIR}/../src/Detector/vibe_src
${PROJECT_SOURCE_DIR}/../src/Detector/Subsense
${PROJECT_SOURCE_DIR}/../src/Tracker
${PROJECT_SOURCE_DIR}/../src/Tracker/HungarianAlg
)

set(LIBS
${OpenCV_LIBS}
mtracking
mdetection
)
${PROJECT_SOURCE_DIR}/../src/Tracker/HungarianAlg)

set(LIBS ${OpenCV_LIBS}
mtracking
mdetection)

if (BUILD_YOLO_LIB)
if (MSVC)
Expand All @@ -49,3 +41,5 @@ ADD_EXECUTABLE(${PROJECT_NAME} ${SOURCES} ${HEADERS})


TARGET_LINK_LIBRARIES(${PROJECT_NAME} PRIVATE ${LIBS})

set_target_properties(${PROJECT_NAME} PROPERTIES FOLDER "apps")
16 changes: 7 additions & 9 deletions combined/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,17 @@ set(SOURCES main.cpp combined.cpp)

set(HEADERS combined.h)

INCLUDE_DIRECTORIES(
${PROJECT_SOURCE_DIR}/../src
INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/../src
${PROJECT_SOURCE_DIR}/../src/common
${PROJECT_SOURCE_DIR}/../src/Detector
${PROJECT_SOURCE_DIR}/../src/Detector/vibe_src
${PROJECT_SOURCE_DIR}/../src/Detector/Subsense
${PROJECT_SOURCE_DIR}/../src/Tracker
${PROJECT_SOURCE_DIR}/../src/Tracker/HungarianAlg
)
${PROJECT_SOURCE_DIR}/../src/Tracker/HungarianAlg)

set(LIBS
${OpenCV_LIBS}
mtracking
mdetection
)
set(LIBS ${OpenCV_LIBS}
mtracking
mdetection)

if (BUILD_YOLO_LIB)
if (MSVC)
Expand All @@ -43,3 +39,5 @@ endif(BUILD_YOLO_TENSORRT)
ADD_EXECUTABLE(${PROJECT_NAME} ${SOURCES} ${HEADERS})

TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${LIBS})

set_target_properties(${PROJECT_NAME} PROPERTIES FOLDER "apps")
34 changes: 14 additions & 20 deletions example/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,13 @@ cmake_minimum_required (VERSION 3.5)

project(MultitargetTracker)

set(SOURCES
main.cpp
VideoExample.cpp
)
set(SOURCES main.cpp
VideoExample.cpp)

set(HEADERS
MouseExample.h
VideoExample.h
examples.h
FileLogger.h
)
set(HEADERS MouseExample.h
VideoExample.h
examples.h
FileLogger.h)

if (BUILD_CARS_COUNTING)
set(SOURCES ${SOURCES} CarsCounting.cpp)
Expand All @@ -22,23 +18,19 @@ endif(BUILD_CARS_COUNTING)
# ----------------------------------------------------------------------------
# добавляем include директории
# ----------------------------------------------------------------------------
INCLUDE_DIRECTORIES(
${PROJECT_SOURCE_DIR}/../src
INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/../src
${PROJECT_SOURCE_DIR}/../src/common
${PROJECT_SOURCE_DIR}/../src/Detector
${PROJECT_SOURCE_DIR}/../src/Detector/vibe_src
${PROJECT_SOURCE_DIR}/../src/Detector/Subsense
${PROJECT_SOURCE_DIR}/../src/Tracker
${PROJECT_SOURCE_DIR}/../src/Tracker/HungarianAlg
${PROJECT_SOURCE_DIR}/../thirdparty
)
${PROJECT_SOURCE_DIR}/../thirdparty)

set(LIBS
${OpenCV_LIBS}
mtracking
mdetection
inih
)
set(LIBS ${OpenCV_LIBS}
mtracking
mdetection
inih)

if (BUILD_YOLO_LIB)
if (MSVC)
Expand Down Expand Up @@ -66,3 +58,5 @@ endif(BUILD_CARS_COUNTING)
ADD_EXECUTABLE(${PROJECT_NAME} ${SOURCES} ${HEADERS})

TARGET_LINK_LIBRARIES(${PROJECT_NAME} PRIVATE ${LIBS})

set_target_properties(${PROJECT_NAME} PROPERTIES FOLDER "apps")
2 changes: 2 additions & 0 deletions src/Detector/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -112,3 +112,5 @@ install(TARGETS ${PROJECT_NAME}
LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib
RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_PREFIX}/include/${PROJECT_NAME})

set_target_properties(${PROJECT_NAME} PROPERTIES FOLDER "libs")
2 changes: 2 additions & 0 deletions src/Detector/darknet/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -118,3 +118,5 @@ if (MSVC)
install(FILES "${LINK_DIRECTORY}/${LIB_PTHREAD}.lib"
DESTINATION ${CMAKE_INSTALL_PREFIX}/lib)
endif()

set_target_properties(${PROJECT_NAME} PROPERTIES FOLDER "libs")
2 changes: 2 additions & 0 deletions src/Detector/tensorrt_yolo/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -89,3 +89,5 @@ install(TARGETS ${libname_rt}
LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib
RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_PREFIX}/include/${PROJECT_NAME})

set_target_properties(${PROJECT_NAME} PROPERTIES FOLDER "libs")
2 changes: 2 additions & 0 deletions src/Tracker/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -229,3 +229,5 @@ install(TARGETS ${PROJECT_NAME}
LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib
RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_PREFIX}/include/${PROJECT_NAME})

set_target_properties(${PROJECT_NAME} PROPERTIES FOLDER "libs")
1 change: 1 addition & 0 deletions thirdparty/inih/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ install(TARGETS ${PROJECT_NAME}
RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_PREFIX}/include/${PROJECT_NAME})

set_target_properties(${PROJECT_NAME} PROPERTIES FOLDER "libs")
2 changes: 2 additions & 0 deletions thirdparty/pybind11/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -155,3 +155,5 @@ if (PYBIND11_INSTALL)
endif()
endif()
endif()

set_target_properties(${PROJECT_NAME} PROPERTIES FOLDER "libs")

0 comments on commit 38c500d

Please sign in to comment.