Hi, I want to use dependent libraries like freetype or jpeg, which are already supplied in lib directory. How can I do it correctly with FindSFML.cmake?
My current CMakeLists.txt is:
cmake_minimum_required(VERSION 2.6)
add_executable(main main.cpp)
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake_modules" ${CMAKE_MODULE_PATH})
set(SFML_STATIC_LIBRARIES TRUE)
find_package(SFML 2 COMPONENTS system graphics window)
if(SFML_FOUND)
include_directories(${SFML_INCLUDE_DIR})
target_link_libraries(main winmm opengl32 freetype jpeg gdi32 ${SFML_LIBRARIES})
endif()
C:\Users\User\Desktop\wa\build>cmake .. -G"MinGW Makefiles" -DSFML_ROOT=C:\Prog
ramming\SFML-2.4.2
-- The C compiler identification is GNU 7.1.0
-- The CXX compiler identification is GNU 7.1.0
-- Check for working C compiler: C:/Programming/mingw32/bin/gcc.exe
-- Check for working C compiler: C:/Programming/mingw32/bin/gcc.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: C:/Programming/mingw32/bin/g++.exe
-- Check for working CXX compiler: C:/Programming/mingw32/bin/g++.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found SFML 2.4.2 in C:/Programming/SFML-2.4.2/include
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Users/User/Desktop/wa/build
C:\Users\User\Desktop\wa\build>make
Scanning dependencies of target main
[ 50%] Building CXX object CMakeFiles/main.dir/main.cpp.obj
[100%] Linking CXX executable main.exe
C:/Programming/mingw32/bin/../lib/gcc/i686-w64-mingw32/7.1.0/../../../../i686-w6
4-mingw32/bin/ld.exe: cannot find -lfreetype
C:/Programming/mingw32/bin/../lib/gcc/i686-w64-mingw32/7.1.0/../../../../i686-w6
4-mingw32/bin/ld.exe: cannot find -ljpeg
collect2.exe: error: ld returned 1 exit status
make[2]: *** [main.exe] Ошибка 1
make[1]: *** [CMakeFiles/main.dir/all] Ошибка 2
make: *** [all] Ошибка 2