mirror of
https://github.com/SWG-Source/stationapi.git
synced 2026-07-13 21:01:03 -04:00
Use modern cmake best practices for target creation
This commit is contained in:
@@ -1,11 +1,5 @@
|
||||
include_directories(
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
${PROJECT_SOURCE_DIR}/externals/easyloggingpp
|
||||
${PROJECT_SOURCE_DIR}/externals/udplibrary
|
||||
${Boost_INCLUDE_DIRS}
|
||||
${SQLite3_INCLUDE_DIR})
|
||||
|
||||
set(SOURCES
|
||||
add_library(stationapi
|
||||
Node.hpp
|
||||
NodeClient.cpp
|
||||
NodeClient.hpp
|
||||
@@ -16,6 +10,17 @@ set(SOURCES
|
||||
StringUtils.cpp
|
||||
StringUtils.hpp)
|
||||
|
||||
add_library(stationapi ${SOURCES})
|
||||
target_include_directories(stationapi PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
${PROJECT_SOURCE_DIR}/externals/catch
|
||||
${PROJECT_SOURCE_DIR}/externals/easyloggingpp
|
||||
${PROJECT_SOURCE_DIR}/externals/udplibrary
|
||||
${Boost_INCLUDE_DIRS}
|
||||
${SQLite3_INCLUDE_DIR})
|
||||
|
||||
GroupSourceByFilesystem("${SOURCES}")
|
||||
add_executable(stationapi_tests
|
||||
Serialization_Tests.cpp
|
||||
StringUtils_Tests.cpp)
|
||||
|
||||
target_link_libraries(stationapi_tests
|
||||
stationapi)
|
||||
|
||||
@@ -1,12 +1,5 @@
|
||||
include_directories(
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
${PROJECT_SOURCE_DIR}/src/stationapi
|
||||
${PROJECT_SOURCE_DIR}/externals/easyloggingpp
|
||||
${PROJECT_SOURCE_DIR}/externals/udplibrary
|
||||
${Boost_INCLUDE_DIRS}
|
||||
${SQLite3_INCLUDE_DIR})
|
||||
|
||||
set(SOURCES
|
||||
add_executable(stationchat
|
||||
protocol/AddBan.hpp
|
||||
protocol/AddFriend.hpp
|
||||
protocol/AddIgnore.hpp
|
||||
@@ -69,16 +62,15 @@ set(SOURCES
|
||||
StationChatApp.hpp
|
||||
StationChatConfig.hpp)
|
||||
|
||||
add_executable(stationchat ${SOURCES})
|
||||
|
||||
GroupSourceByFilesystem("${SOURCES}")
|
||||
|
||||
target_link_libraries(stationchat
|
||||
stationapi
|
||||
udplibrary
|
||||
${Boost_LIBRARIES}
|
||||
${SQLite3_LIBRARY})
|
||||
|
||||
target_include_directories(stationchat PRIVATE
|
||||
${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
||||
if(WIN32)
|
||||
target_link_libraries(stationchat ws2_32)
|
||||
endif()
|
||||
|
||||
Reference in New Issue
Block a user