-
-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
internal: optimize CMake calls to find_package (#1952)
- Loading branch information
Showing
10 changed files
with
106 additions
and
106 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,15 @@ | ||
project(libespm) | ||
include(${CMAKE_SOURCE_DIR}/cmake/apply_default_settings.cmake) | ||
include(${CMAKE_SOURCE_DIR}/cmake/link_vcpkg_dependencies.cmake) | ||
|
||
file(GLOB ESPM_SRC "include/*.h" "src/*.cpp" "src/*.h") | ||
add_library(espm STATIC ${ESPM_SRC}) | ||
target_include_directories(espm PUBLIC ${CMAKE_CURRENT_LIST_DIR}/include) | ||
target_include_directories(espm PUBLIC ${CMAKE_CURRENT_LIST_DIR}/src) | ||
|
||
apply_default_settings(TARGETS espm) | ||
link_vcpkg_dependencies(TARGETS espm) | ||
|
||
add_library(libespm ALIAS espm) | ||
|
||
find_path(SPARSEPP_INCLUDE_DIR NAMES spp.h PATH_SUFFIXES sparsepp) | ||
get_filename_component(SPARSEPP_INCLUDE_DIR ${SPARSEPP_INCLUDE_DIR} DIRECTORY) | ||
target_include_directories(espm PUBLIC ${SPARSEPP_INCLUDE_DIR}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,13 @@ | ||
include(${CMAKE_SOURCE_DIR}/cmake/apply_default_settings.cmake) | ||
include(${CMAKE_SOURCE_DIR}/cmake/link_vcpkg_dependencies.cmake) | ||
|
||
file(GLOB_RECURSE viet_sources "${CMAKE_CURRENT_SOURCE_DIR}/src/*" "${CMAKE_CURRENT_SOURCE_DIR}/include/*") | ||
add_library(viet STATIC ${viet_sources}) | ||
target_include_directories(viet PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/src") | ||
target_include_directories(viet PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include") | ||
apply_default_settings(TARGETS viet) | ||
link_vcpkg_dependencies(TARGETS viet) | ||
|
||
find_path(MAKEID_INCLUDE_DIR NAMES MakeID.h) | ||
target_include_directories(viet PUBLIC ${MAKEID_INCLUDE_DIR}) | ||
|
||
find_package(spdlog CONFIG REQUIRED) | ||
target_link_libraries(viet PUBLIC spdlog::spdlog) |