CMake: Use inherited dependencies in database, shared and game
This commit is contained in:
1 parent
8a58b9a295
commit
b2348b8915
8 files changed
+139
-313
No files matched your search
@@ -8,62 +8,50 @@
|
||||
# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
|
||||
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
if( USE_COREPCH )
|
||||
include_directories(${CMAKE_CURRENT_BINARY_DIR})
|
||||
endif()
|
||||
|
||||
file(GLOB_RECURSE sources_Cryptography Cryptography/*.cpp Cryptography/*.h)
|
||||
file(GLOB_RECURSE sources_DataStores DataStores/*.cpp DataStores/*.h)
|
||||
file(GLOB_RECURSE sources_Dynamic Dynamic/*.cpp Dynamic/*.h)
|
||||
file(GLOB_RECURSE sources_Networking Networking/*.cpp Networking/*.h)
|
||||
file(GLOB_RECURSE sources_Packets Packets/*.cpp Packets/*.h)
|
||||
file(GLOB_RECURSE sources_Realm Realm/*.cpp Realm/*.h)
|
||||
file(GLOB sources_localdir *.cpp *.h)
|
||||
CollectSourceFiles(
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
PRIVATE_SOURCES
|
||||
# Exclude
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/PrecompiledHeaders)
|
||||
|
||||
#
|
||||
# Build shared sourcelist
|
||||
#
|
||||
|
||||
if (USE_COREPCH)
|
||||
set(shared_STAT_PCH_HDR PrecompiledHeaders/sharedPCH.h)
|
||||
set(shared_STAT_PCH_SRC PrecompiledHeaders/sharedPCH.cpp)
|
||||
set(PRIVATE_PCH_HEADER PrecompiledHeaders/sharedPCH.h)
|
||||
set(PRIVATE_PCH_SOURCE PrecompiledHeaders/sharedPCH.cpp)
|
||||
endif()
|
||||
|
||||
set(shared_STAT_SRCS
|
||||
${shared_STAT_SRCS}
|
||||
${sources_Cryptography}
|
||||
${sources_DataStores}
|
||||
${sources_Dynamic}
|
||||
${sources_Networking}
|
||||
${sources_Packets}
|
||||
${sources_Realm}
|
||||
${sources_Service}
|
||||
${sources_localdir}
|
||||
)
|
||||
|
||||
include_directories(
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/Dynamic
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/Networking
|
||||
${CMAKE_SOURCE_DIR}/dep/cppformat
|
||||
${CMAKE_SOURCE_DIR}/src/common/
|
||||
${CMAKE_SOURCE_DIR}/src/common/Debugging
|
||||
${CMAKE_SOURCE_DIR}/src/common/Logging
|
||||
${CMAKE_SOURCE_DIR}/src/common/Utilities
|
||||
${MYSQL_INCLUDE_DIR}
|
||||
${OPENSSL_INCLUDE_DIR}
|
||||
${VALGRIND_INCLUDE_DIR}
|
||||
)
|
||||
|
||||
GroupSources(${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
||||
add_library(shared STATIC
|
||||
${shared_STAT_SRCS}
|
||||
${shared_STAT_PCH_SRC}
|
||||
add_library(shared
|
||||
${PRIVATE_SOURCES}
|
||||
${PRIVATE_PCH_SOURCE}
|
||||
)
|
||||
|
||||
add_dependencies(shared revision_data.h)
|
||||
CollectIncludeDirectories(
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
PUBLIC_INCLUDES
|
||||
# Exclude
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/PrecompiledHeaders)
|
||||
|
||||
target_include_directories(shared
|
||||
PUBLIC
|
||||
${PUBLIC_INCLUDES}
|
||||
PRIVATE
|
||||
${CMAKE_CURRENT_BINARY_DIR})
|
||||
|
||||
target_link_libraries(shared
|
||||
PUBLIC
|
||||
database)
|
||||
|
||||
set_target_properties(shared
|
||||
PROPERTIES
|
||||
FOLDER
|
||||
"server")
|
||||
|
||||
# Generate precompiled header
|
||||
if (USE_COREPCH)
|
||||
add_cxx_pch(shared ${shared_STAT_PCH_HDR} ${shared_STAT_PCH_SRC})
|
||||
add_cxx_pch(shared ${PRIVATE_PCH_HEADER} ${PRIVATE_PCH_SOURCE})
|
||||
endif ()
|
||||
Reference in new issue
Block a user