From eab3d7c831122f7026c80ee9292d75eaedad5bfa Mon Sep 17 00:00:00 2001 From: Patrix Date: Thu, 7 Jul 2022 21:11:24 +0200 Subject: [PATCH] Updated dependencies structure: - Added CMakeLists.txt for each dependency - Added dependencies/CMakeLists.txt for specifying relation between main lib and it's dependencies --- CMakeLists.txt | 8 ++++---- dependencies/CMakeLists.txt | 5 +++++ dependencies/sqrat/CMakeLists.txt | 15 +++++++++++++++ dependencies/squirrel/CMakeLists.txt | 16 ++++++++++++++++ 4 files changed, 40 insertions(+), 4 deletions(-) create mode 100644 dependencies/CMakeLists.txt create mode 100644 dependencies/sqrat/CMakeLists.txt create mode 100644 dependencies/squirrel/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index f40ef8f..8f43139 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,11 +8,11 @@ set(GAME_PATH "" CACHE PATH "This option specifies the game location. It's only set(SERVER_PATH "" CACHE PATH "This option specifies the server location. It's only used for the installation step.") file(GLOB SRC - "dependencies/squirrel/include/*.h" - "dependencies/sqrat/include/*.h" "src/api/squirrel_api.h" + "src/api/module_api.h" "src/api/module_api.cpp" + "src/pch.h" "src/sqmain.cpp" ) @@ -25,10 +25,10 @@ target_include_directories(SqModule "include/" PRIVATE "src/" - "dependencies/squirrel/include/" - "dependencies/sqrat/include/" ) +add_subdirectory(dependencies) + if(DEFINED SHARED_LIBRARY_SUFFIX) set_target_properties(SqModule PROPERTIES diff --git a/dependencies/CMakeLists.txt b/dependencies/CMakeLists.txt new file mode 100644 index 0000000..6ba1899 --- /dev/null +++ b/dependencies/CMakeLists.txt @@ -0,0 +1,5 @@ +add_subdirectory(squirrel) +add_subdirectory(sqrat) + +target_link_libraries(SqModule PUBLIC Squirrel) +target_link_libraries(SqModule PUBLIC SqRat) \ No newline at end of file diff --git a/dependencies/sqrat/CMakeLists.txt b/dependencies/sqrat/CMakeLists.txt new file mode 100644 index 0000000..eeb4fe6 --- /dev/null +++ b/dependencies/sqrat/CMakeLists.txt @@ -0,0 +1,15 @@ +cmake_minimum_required(VERSION 3.17) + +project(SqRat) + +file(GLOB_RECURSE SRC + "include/*.h" +) + +add_library(SqRat INTERFACE) +target_sources(SqRat INTERFACE ${SRC}) + +target_include_directories(SqRat + INTERFACE + "include/" +) \ No newline at end of file diff --git a/dependencies/squirrel/CMakeLists.txt b/dependencies/squirrel/CMakeLists.txt new file mode 100644 index 0000000..304d40f --- /dev/null +++ b/dependencies/squirrel/CMakeLists.txt @@ -0,0 +1,16 @@ +cmake_minimum_required(VERSION 3.17) + +project(Squirrel) + +file(GLOB_RECURSE SRC + "include/*.h" +) + +add_library(Squirrel INTERFACE) +target_sources(Squirrel INTERFACE ${SRC}) + +target_include_directories(Squirrel + INTERFACE + "./" + "include/" +) \ No newline at end of file