@@ -14,50 +14,11 @@ FetchContent_Declare(
1414)
1515FetchContent_MakeAvailable (argparse)
1616
17- include (FetchContent )
18- FetchContent_Declare (
19- pybind11
20- GIT_REPOSITORY https://github.com/pybind/pybind11.git
21- GIT_TAG v2.11.1
22- )
23- FetchContent_MakeAvailable (pybind11)
24-
2517find_package (OpenCV REQUIRED )
2618find_package (fmt REQUIRED )
27- find_package (Python3 REQUIRED COMPONENTS Interpreter Development )
2819
29- # Library
30- if (EXISTS "${CMAKE_SOURCE_DIR} /src" )
31- file (GLOB LIB_SOURCES
32- "${CMAKE_SOURCE_DIR} /src/*.cpp"
33- "${CMAKE_SOURCE_DIR} /src/detector/*.cpp"
34- "${CMAKE_SOURCE_DIR} /src/bindings/*.cpp" )
35- else ()
36- FetchContent_MakeAvailable (shutoh)
37- file (GLOB LIB_SOURCES
38- "${shutoh_SOURCE_DIR} /src/*.cpp"
39- "${shutoh_SOURCE_DIR} /src/detector/*.cpp"
40- "${shutoh_SOURCE_DIR} /src/bindings/*.cpp"
41- )
42- set (SKIP_TESTS TRUE )
43- endif ()
44- add_library (shutoh SHARED ${LIB_SOURCES} )
20+ file (GLOB SOURCE_FILES "${CMAKE_SOURCE_DIR} /src/*.cpp" )
21+ add_executable (shutoh ${SOURCE_FILES} )
4522target_compile_options (shutoh PRIVATE -O3 -Wall )
46- target_include_directories (shutoh PUBLIC include ${OpenCV_INCLUDE_DIRS} ${Python3_INCLUDE_DIRS} )
47- target_link_libraries (shutoh PUBLIC ${OpenCV_LIBS} fmt::fmt argparse pybind11::module ${Python3_LIBRARIES} )
48-
49- # CLI
50- add_executable (shutoh_cli src/main.cpp )
51- set_target_properties (shutoh_cli PROPERTIES OUTPUT_NAME "shutoh" )
52- target_link_libraries (shutoh_cli PRIVATE shutoh )
53-
54- # Tests
55- if (NOT SKIP_TESTS)
56- enable_testing ()
57- add_subdirectory (tests )
58-
59- # Install
60- install (TARGETS shutoh DESTINATION lib)
61- install (TARGETS shutoh_cli DESTINATION bin)
62- install (DIRECTORY include/ DESTINATION include)
63- endif ()
23+ target_include_directories (shutoh PUBLIC ${OpenCV_INCLUDE_DIRS} ${Python3_INCLUDE_DIRS} )
24+ target_link_libraries (shutoh PUBLIC ${OpenCV_LIBS} fmt::fmt argparse )
0 commit comments