@Thrasher: I've checked the link, but this doesnt really help sme a lot. Or maybe I can not filter the neccessary information out of it.
I have tried few things out and got stuck with the inclusion of the freetype depencency.
I had to install it initially (rather generate the .dll and .lib files using VisualStudio)
but cmake cant find the libraries, whats quite strage.
find_package() doesnt throw an error, so I assupe that freetype is actually found...
cmake_minimum_required(VERSION 3.0.0)
#set(CMAKE_CXX_FLAGS "-gdwarf-4")
project(sfml_static_include VERSION 0.1.0 LANGUAGES C CXX)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED True)
set(CMAKE_PREFIX_PATH "C:/Users/myId/Documents/Libraries/freetype-2.13.0")
#If you are using Windows, manually set the location where you installed SFML.
set(SFML_DIR "C:/Users/myId/Documents/Libraries/SFML-2.6.0/lib/cmake/SFML")
set(SFML_INCLUDE_DIR "C:/Users/myId/Documents/Libraries/SFML-2.6.0/include")
set(FREETYPE_LIBRARY_DEBUG "C:/Users/myId/Documents/Libraries/freetype-2.13.0/objs/x64/Debug/freetype.lib")
set(SFML_STATIC_LIBRARIES TRUE)
find_package(SFML COMPONENTS graphics window system REQUIRED)
add_executable(${PROJECT_NAME} main.cpp)
target_include_directories(${PROJECT_NAME} PRIVATE SFML_INCLUDE_DIR)
target_include_directories(${PROJECT_NAME} PRIVATE ${FREETYPE_INCLUDE_DIR})
target_link_libraries(${PROJECT_NAME} ${FREETYPE_LIBRARY_DEBUG})
find_package(Freetype 2.13.0 REQUIRED)
if(SFML_FOUND)
include_directories(${SFML_INCLUDE_DIR})
# SFML version >= 2.5
#In SFML Version 2.5 or later, ${SFML_LIBRARIES}, ${SFML_DEPENDENCIES}, ${SFML_INCLUDE_DIR} no longer exist. Specify libraries individually.
target_link_libraries(${PROJECT_NAME}
#${SFML_INCLUDE_DIR}/sfml-network-s
#${SFML_INCLUDE_DIR}/sfml-audio-s
sfml-graphics
sfml-window
sfml-system
opengl32
winmm
gdi32
freetype
)
endif()
error message:
[cmake] -- Found SFML 2.6.0 in C:/Users/myId/Documents/Libraries/SFML-2.6.0/lib/cmake/SFML
[cmake] -- Found Freetype: C:/Users/myId/Documents/Libraries/freetype-2.13.0/objs/x64/Debug/freetype.lib (found suitable version "2.13.0", minimum required is "2.13.0")
[cmake] -- Configuring done
[cmake] -- Generating done
[cmake] -- Build files have been written to: C:/myFolder/CPP/SFML/sfml_static_include/build
[build] Starting build
[proc] Executing command: C:\toolbase\cmake\3.20.2\bin\cmake.EXE --build c:/myFolder/CPP/SFML/sfml_static_include/build --config Debug --target all -j 10 --
[build] [ 50%] Building CXX object CMakeFiles/sfml_static_include.dir/main.cpp.obj
[build] [100%] Linking CXX executable sfml_static_include.exe
[build] c:/toolbase/mingw/comp_10.4.0_multilib_1f/bin/../lib/gcc/x86_64-w64-mingw32/10.4.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lfreetype
[build] collect2.exe: error: ld returned 1 exit status
[build] mingw32-make.exe[2]: *** [CMakeFiles\sfml_static_include.dir\build.make:104: sfml_static_include.exe] Error 1
[build] mingw32-make.exe[1]: *** [CMakeFiles\Makefile2:82: CMakeFiles/sfml_static_include.dir/all] Error 2
[build] mingw32-make.exe: *** [Makefile:90: all] Error 2
[proc] The command: C:\toolbase\cmake\3.20.2\bin\cmake.EXE --build c:/myFolder/CPP/SFML/sfml_static_include/build --config Debug --target all -j 10 -- exited with code: 2
[driver] Build completed: 00:00:01.799
[build] Build finished with exit code 2
UPDATE
@exploit3r thanks, I had included the macro already, but the issue is coming up as described above...