File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3,16 +3,14 @@ set(PROJECT_NAME "to-dos-api")
33project (${PROJECT_NAME} CXX )
44
55file (GLOB_RECURSE sources CONFIGURE_DEPENDS
6- ${CMAKE_SOURCE_DIR} /src/*.cpp
76 ${CMAKE_SOURCE_DIR} /src/data/models/odb-gen/*.cxx
87)
9- list (REMOVE_ITEM sources ${CMAKE_SOURCE_DIR} /src/main.cpp)
108
11- set (LIB_TARGET ${PROJECT_NAME} _lib)
9+ set (PROJECT_OBJECTS ${PROJECT_NAME} _lib)
1210
13- add_library (${LIB_TARGET } OBJECT ${sources} )
11+ add_library (${PROJECT_OBJECTS } OBJECT ${sources} )
1412
15- target_include_directories (${LIB_TARGET } PUBLIC
13+ target_include_directories (${PROJECT_OBJECTS } PUBLIC
1614 ${CMAKE_SOURCE_DIR} /src
1715 /usr/include
1816 src/data/models/
@@ -21,19 +19,19 @@ target_include_directories(${LIB_TARGET} PUBLIC
2119find_package (Drogon REQUIRED )
2220find_package (jsoncpp REQUIRED )
2321
24- target_link_libraries (${LIB_TARGET } PUBLIC
22+ target_link_libraries (${PROJECT_OBJECTS } PUBLIC
2523 Drogon::Drogon
2624 JsonCpp::JsonCpp
2725 odb odb-pgsql
2826)
2927
3028add_executable (${PROJECT_NAME}
3129 ${CMAKE_SOURCE_DIR} /src/main.cpp
32- $<TARGET_OBJECTS :${LIB_TARGET } >
30+ $<TARGET_OBJECTS :${PROJECT_OBJECTS } >
3331)
3432
3533target_link_libraries (${PROJECT_NAME} PUBLIC
36- ${LIB_TARGET }
34+ ${PROJECT_OBJECTS }
3735)
3836
3937if ("$ENV{SKIPTESTS} " STREQUAL "TRUE" )
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ add_executable(${TEST_TARGET} ${test_sources})
99find_package (GTest REQUIRED )
1010
1111target_link_libraries (${TEST_TARGET} PRIVATE
12- ${LIB_TARGET }
12+ ${PROJECT_OBJECTS }
1313 gtest::gtest
1414)
1515
You can’t perform that action at this time.
0 commit comments