Link against libpng and libm
Tested against Ubuntu 18.04.
This commit is contained in:
parent
42b80fe839
commit
2eb722d3a4
4 changed files with 13 additions and 1 deletions
|
|
@ -29,6 +29,14 @@ find_package(SDL2 2.0.1)
|
|||
find_package(SDL2_mixer 2.0.0)
|
||||
find_package(SDL2_net 2.0.0)
|
||||
|
||||
# Check for libpng.
|
||||
find_package(PNG)
|
||||
if(PNG_FOUND)
|
||||
set(HAVE_LIBPNG TRUE)
|
||||
endif()
|
||||
|
||||
find_package(m)
|
||||
|
||||
include(CheckFunctionExists)
|
||||
check_function_exists(strcasecmp HAVE_DECL_STRCASECMP)
|
||||
check_function_exists(strncasecmp HAVE_DECL_STRNCASECMP)
|
||||
|
|
|
|||
|
|
@ -4,5 +4,6 @@
|
|||
#cmakedefine PACKAGE_STRING "@PACKAGE_STRING@"
|
||||
#cmakedefine PROGRAM_PREFIX "@PROGRAM_PREFIX@"
|
||||
|
||||
#cmakedefine01 HAVE_LIBPNG
|
||||
#cmakedefine01 HAVE_DECL_STRCASECMP
|
||||
#cmakedefine01 HAVE_DECL_STRNCASECMP
|
||||
|
|
|
|||
|
|
@ -106,6 +106,9 @@ set(SOURCE_FILES ${COMMON_SOURCE_FILES} ${GAME_SOURCE_FILES})
|
|||
set(SOURCE_FILES_WITH_DEH ${SOURCE_FILES} ${DEHACKED_SOURCE_FILES})
|
||||
|
||||
set(EXTRA_LIBS textscreen pcsound opl SDL2::SDL2main SDL2::SDL2 SDL2::mixer SDL2::net)
|
||||
if(PNG_FOUND)
|
||||
list(APPEND EXTRA_LIBS PNG::PNG)
|
||||
endif()
|
||||
|
||||
if(WIN32)
|
||||
add_executable("${PROGRAM_PREFIX}doom" WIN32 ${SOURCE_FILES_WITH_DEH} "${CMAKE_CURRENT_BINARY_DIR}/resource.rc")
|
||||
|
|
|
|||
|
|
@ -25,4 +25,4 @@ add_library(textscreen
|
|||
target_include_directories(textscreen
|
||||
INTERFACE "."
|
||||
PRIVATE "../src/")
|
||||
target_link_libraries(textscreen SDL2::SDL2)
|
||||
target_link_libraries(textscreen m SDL2::SDL2)
|
||||
|
|
|
|||
Loading…
Reference in a new issue