some cmake cleanups
This commit is contained in:
parent
60dbde92f0
commit
1e2cc17576
@ -3,11 +3,14 @@ set(SOURCES
|
||||
|
||||
add_executable(eedb ${SOURCES} )
|
||||
|
||||
include_directories( ${PostgreSQL_INCLUDE_DIRS} )
|
||||
|
||||
target_link_libraries(eedb
|
||||
wthttp # or {Wt_HTTP_DEBUG_LIBRARY}
|
||||
wt # or {Wt_DEBUG_LIBRARY}
|
||||
eedb_db
|
||||
auth
|
||||
eedb_auth
|
||||
eedb_app
|
||||
Boost::system
|
||||
Boost::filesystem
|
||||
Boost::thread
|
||||
|
||||
@ -1,16 +1,24 @@
|
||||
file(GLOB AUTH_SOURCE auth/* )
|
||||
|
||||
file(GLOB SOURCE
|
||||
EEDB.cpp
|
||||
WebSession.cpp
|
||||
|
||||
auth/PgUserAuth.cpp
|
||||
auth/Services.cpp
|
||||
data/*
|
||||
widgets/*
|
||||
)
|
||||
|
||||
include_directories( ${PostgreSQL_INCLUDE_DIRS} )
|
||||
include_directories(${CMAKE_BINARY_DIR}/external/include SYSTEM)
|
||||
|
||||
include_directories( ${PostgreSQL_INCLUDE_DIRS} )
|
||||
add_subdirectory(db)
|
||||
|
||||
add_library(auth STATIC ${SOURCE})
|
||||
target_link_libraries( auth eedb_db )
|
||||
add_library(eedb_auth ${AUTH_SOURCE})
|
||||
target_link_libraries(eedb_auth PUBLIC nlohmann_json)
|
||||
set_target_properties(eedb_auth PROPERTIES COTIRE_ADD_UNITY_BUILD FALSE)
|
||||
cotire(eedb_auth)
|
||||
|
||||
add_library(eedb_app ${SOURCE})
|
||||
target_link_libraries(eedb_app PUBLIC eedb_auth)
|
||||
set_target_properties(eedb_app PROPERTIES COTIRE_ADD_UNITY_BUILD FALSE)
|
||||
cotire(eedb_app)
|
||||
|
||||
@ -12,11 +12,17 @@ set(SOURCE
|
||||
RawSql.cpp
|
||||
)
|
||||
|
||||
file(GLOB INCLUDES
|
||||
*.h*
|
||||
data/*.hpp
|
||||
)
|
||||
|
||||
file(GLOB MODEL
|
||||
model/*
|
||||
)
|
||||
|
||||
add_library(eedb_db ${SOURCE} ${MODEL})
|
||||
target_link_libraries(eedb_db wt sqlpp-postgresql )
|
||||
add_library(eedb_db ${SOURCE} ${MODEL} ${INCLUDES})
|
||||
target_link_libraries(eedb_db sqlpp-postgresql)
|
||||
|
||||
set_target_properties(eedb_db PROPERTIES COTIRE_ADD_UNITY_BUILD FALSE)
|
||||
cotire(eedb_db)
|
||||
|
||||
@ -18,7 +18,7 @@ include_directories( ${gmock_SOURCE_DIR}/include)
|
||||
INCLUDE_DIRECTORIES(${PostgreSQL_INCLUDE_DIRS})
|
||||
add_executable( ${TEST_EXECUTABLE_NAME} ${TEST_FILES} ${MOCK_FILES} )
|
||||
|
||||
target_link_libraries( ${TEST_EXECUTABLE_NAME} GMock::main wt wttest eedb_db auth ${Boost_LIBRARIES} stdc++fs)
|
||||
target_link_libraries( ${TEST_EXECUTABLE_NAME} GMock::main wt wttest eedb_db eedb_auth eedb_app ${Boost_LIBRARIES} stdc++fs)
|
||||
|
||||
add_test( ${TEST_EXECUTABLE_NAME} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${TEST_EXECUTABLE_NAME})
|
||||
#endif()
|
||||
|
||||
Loading…
Reference in New Issue
Block a user