Tweaked CMake file
This commit is contained in:
parent
090ae9f6ce
commit
07c5734498
1 changed files with 11 additions and 9 deletions
|
@ -328,19 +328,21 @@ elseif(MSYS)
|
||||||
pkg_check_modules(FREETYPE REQUIRED freetype2)
|
pkg_check_modules(FREETYPE REQUIRED freetype2)
|
||||||
|
|
||||||
target_include_directories(CSE2 PRIVATE ${SDL2_STATIC_INCLUDE_DIRS} ${FREETYPE_STATIC_INCLUDE_DIRS})
|
target_include_directories(CSE2 PRIVATE ${SDL2_STATIC_INCLUDE_DIRS} ${FREETYPE_STATIC_INCLUDE_DIRS})
|
||||||
target_compile_options(CSE2 PRIVATE ${SDL2_STATIC_CFLAGS_OTHER} ${FREETYPE_STATIC_CFLAGS_OTHER})
|
|
||||||
target_link_libraries(CSE2 ${SDL2_STATIC_LIBRARIES} ${FREETYPE_STATIC_LIBRARIES})
|
target_link_libraries(CSE2 ${SDL2_STATIC_LIBRARIES} ${FREETYPE_STATIC_LIBRARIES})
|
||||||
else()
|
else()
|
||||||
# SDL2 has no standard way of being used by cmake, so avoid
|
find_package(SDL2 REQUIRED)
|
||||||
# that mess entirely and just use pkg-config instead
|
if(TARGET SDL2::SDL2)
|
||||||
find_package(PkgConfig REQUIRED)
|
# CMake-generated config (Arch, vcpkg, Raspbian)
|
||||||
pkg_check_modules(SDL2 REQUIRED sdl2)
|
target_link_libraries(CSE2 SDL2::SDL2 SDL2::SDL2main)
|
||||||
|
else()
|
||||||
|
# Autotools-generated config (MSYS2)
|
||||||
|
target_include_directories(CSE2 PRIVATE ${SDL2_INCLUDE_DIRS})
|
||||||
|
target_link_libraries(CSE2 ${SDL2_LIBRARIES})
|
||||||
|
endif()
|
||||||
|
|
||||||
find_package(Freetype REQUIRED)
|
find_package(Freetype REQUIRED)
|
||||||
|
target_include_directories(CSE2 PRIVATE ${FREETYPE_INCLUDE_DIRS})
|
||||||
target_include_directories(CSE2 PRIVATE ${SDL2_INCLUDE_DIRS} ${FREETYPE_INCLUDE_DIRS})
|
target_link_libraries(CSE2 ${FREETYPE_LIBRARIES})
|
||||||
target_compile_options(CSE2 PRIVATE ${SDL2_CFLAGS_OTHER} ${FREETYPE_CFLAGS_OTHER})
|
|
||||||
target_link_libraries(CSE2 ${SDL2_LIBRARIES} ${FREETYPE_LIBRARIES})
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Send executable to the build_en/build_jp directory
|
# Send executable to the build_en/build_jp directory
|
||||||
|
|
Loading…
Add table
Reference in a new issue