So the program I'm making has been a journey for me to try and take on a semi-large project. I've done a lot of wrong with it that I've tried to right, and the one thing I never really got around to until now was dependency management. I tried integrating Vcpkg into my CMake file and obviously one of the things I need was SFML. So, I wrote a vcpkg.json file and when I run CMake everything builds fine, but when it gets to linking I get an error saying System couldn't be found in the SFMLConfig.cmake file. Specifically, the error says:
```
CMake Error at build-d/vcpkg_installed/x64-windows/share/sfml/SFMLConfig.cmake:144 (message):
Found SFML but requested component 'System' is missing in the config
defined in
C:/Users/My_Name/Documents/dev/FortIDE/build-d/vcpkg_installed/x64-windows/share/sfml.
Call Stack (most recent call first):
C:/Users/My_Name/Documents/dev/vcpkg/scripts/buildsystems/vcpkg.cmake:859 (_find_package)
CMakeLists.txt:78 (find_package)
CMake Error at C:/Users/My_Name/Documents/dev/vcpkg/scripts/buildsystems/vcpkg.cmake:859 (_find_package):
Found package configuration file:
C:/Users/My_Name/Documents/dev/FortIDE/build-d/vcpkg_installed/x64-windows/share/sfml/SFMLConfig.cmake
but it set SFML_FOUND to FALSE so package "SFML" is considered to be NOT
FOUND.
Call Stack (most recent call first):
CMakeLists.txt:78 (find_package)
-- Configuring incomplete, errors occurred!
```
Is this something new. The installed SFML version is 2.6.2. When I run `vcpkg list` it says all the packages but system are installed even though when I look in the lib and bin folders in the install directory for the deps, the -system.dll and system.lib are there. Has anybody else come across this or am I doing something wrong here? If it helps this is my cmake file:
```
cmake_minimum_required(VERSION 3.15)
if (DEFINED ENV{VCPKG_ROOT})
set(CMAKE_TOOLCHAIN_FILE "$ENV{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake" CACHE STRING "Vcpkg toolchain file")
else()
message(FATAL_ERROR "VCPKG_ROOT environment variable not set. Please set it to the root directory of your vcpkg installation.")
endif()
project(FortIDE)
# Set C++ standard
add_compile_definitions(ANTLR4CPP_STATIC SFML_STATIC GIT_STATIC)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g")
set(CMAKE_BUILD_TYPE "Release")
# Set Boost root and include/library directories
#set(BOOST_ROOT "${CMAKE_SOURCE_DIR}/deps/boost")
#set(BOOST_INCLUDEDIR "${BOOST_ROOT}/boost")
#set(BOOST_LIBRARYDIR "${BOOST_ROOT}/stage/lib")
#set(SFML_DIR "${CMAKE_SOURCE_DIR}/deps/SFML/build")
#set(spdlog_DIR "${CMAKE_SOURCE_DIR}/deps/spdlog/build")
#set(TinyXML_DIR "${CMAKE_SOURCE_DIR}/deps/tinyxml2/build")
#set(FREETYPE_LIBRARY "${CMAKE_SOURCE_DIR}/deps/freetype/build")
#set(FREETYPE_INCLUDE_DIRS "${CMAKE_SOURCE_DIR}/deps/freetype/include")
# Policy to handle FindBoost module removal warning
cmake_policy(SET CMP0167 OLD)
# Create the executable target
add_executable(FortIDE src/Main.cpp) # Replace `main.cpp` with your main source file
# Specify source files for ImGui
#set(IMGUI_SOURCES
# ${CMAKE_SOURCE_DIR}/deps/imgui/imgui.cpp
# ${CMAKE_SOURCE_DIR}/deps/imgui/imgui_draw.cpp
# ${CMAKE_SOURCE_DIR}/deps/imgui/imgui_tables.cpp
# ${CMAKE_SOURCE_DIR}/deps/imgui/imgui_widgets.cpp
# ${CMAKE_SOURCE_DIR}/deps/imgui/imgui_demo.cpp # Optional
#)
file(GLOB FILETREE_SOURCES ${CMAKE_SOURCE_DIR}/src/mainfunc/FileTree/*.cpp)
file(GLOB ANTLR_SOURCES ${CMAKE_SOURCE_DIR}/src/mainfunc/F90Files/*.cpp)
set (MAIN_SOURCES
${CMAKE_SOURCE_DIR}/src/mainfunc/mainfunc.cpp
${CMAKE_SOURCE_DIR}/src/mainfunc/c_Parser.cpp
${CMAKE_SOURCE_DIR}/src/mainfunc/Config.cpp
${CMAKE_SOURCE_DIR}/src/mainfunc/f_MainMenu.cpp
${CMAKE_SOURCE_DIR}/src/mainfunc/searchParser/s_Parser.cpp
${CMAKE_SOURCE_DIR}/src/mainfunc/FileTree/FileTree.cpp
${CMAKE_SOURCE_DIR}/deps/ImGuiColorTextEdit/ImGuiDebugPanel.cpp
${CMAKE_SOURCE_DIR}/deps/ImGuiColorTextEdit/LanguageDefinitions.cpp
${CMAKE_SOURCE_DIR}/deps/ImGuiColorTextEdit/TextEditor.cpp
${CMAKE_SOURCE_DIR}/deps/ImGuiColorTextEdit/UnitTests.cpp
${FILETREE_SOURCES}
${ANTLR_SOURCES}
)
# Add source files to the target
target_sources(FortIDE PRIVATE ${MAIN_SOURCES})
# Include directories
#target_include_directories(FortIDE PRIVATE
# ${CMAKE_SOURCE_DIR}/deps/spdlog/include
# ${CMAKE_SOURCE_DIR}/deps/libgit2/include
# ${CMAKE_SOURCE_DIR}/deps/imgui
# ${CMAKE_SOURCE_DIR}/deps/imgui-sfml
# ${CMAKE_SOURCE_DIR}/deps/SFML/include
# ${CMAKE_SOURCE_DIR}/deps/tinyxml2/
# ${CMAKE_SOURCE_DIR}/deps/boost_1_86_0
# ${CMAKE_SOURCE_DIR}/deps/antlr4/runtime/Cpp/runtime/src
# ${CMAKE_SOURCE_DIR}/deps/portable-file-dialogs/
# ${CMAKE_SOURCE_DIR}/deps/ImGuiColorTextEdit/
#)
# Use vcpkg packages
find_package(Boost REQUIRED COMPONENTS filesystem system)
find_package(SFML 2.6.2 REQUIRED COMPONENTS Main Graphics Window System)
find_package(spdlog REQUIRED)
find_package(TinyXML2 REQUIRED)
find_package(portable-file-dialogs CONFIG REQUIRED)
find_package(antlr4-runtime REQUIRED)
find_package(libgit2 REQUIRED)
# Platform-specific settings
if (WIN32)
target_compile_definitions(FortIDE PRIVATE)
target_link_libraries(FortIDE PRIVATE OpenGL32 winmm glu32)
elseif (UNIX)
target_link_libraries(FortIDE PRIVATE pthread dl)
endif()
target_link_libraries(FortIDE PRIVATE
Boost::filesystem
Boost::system
sfml-main
sfml-graphics
sfml-window
sfml-system
spdlog::spdlog
tinyxml2
portable-file-dialogs
antlr4-runtime
git2
)
```