corrected find_package and target_link_libraries stuff
This commit is contained in:
parent
3274c6d97c
commit
89dfc20089
|
@ -1,7 +1,6 @@
|
|||
#cPNG source files
|
||||
cmake_minimum_required(VERSION 3.16)
|
||||
project(cPNG VERSION 1.5.30 LANGUAGES C)
|
||||
find_package(Gint 2.9.0 REQUIRED)
|
||||
find_package(cZlib 1.2.5 REQUIRED)
|
||||
|
||||
set(SOURCES
|
||||
|
@ -24,7 +23,8 @@ set(SOURCES
|
|||
|
||||
# Target name is "cPNG", output file is "libcPNG.a" (by default)
|
||||
add_library(cPNG STATIC ${SOURCES})
|
||||
target_compile_options(cPNG PRIVATE -Os -std=c11 -lcZlib)
|
||||
target_compile_options(cPNG PRIVATE -Os -std=c11)
|
||||
target_link_libraries(cPNG PRIVATE cZlib::cZlib)
|
||||
|
||||
# After building, install the target (that is, cPNG.a) in the compiler
|
||||
install(TARGETS cPNG
|
||||
|
|
|
@ -14,5 +14,5 @@ if(cPNG_FOUND)
|
|||
set_target_properties(cPNG::cPNG PROPERTIES
|
||||
IMPORTED_LOCATION "${CPNG_PATH}"
|
||||
INTERFACE_LINK_OPTIONS -lcPNG
|
||||
IMPORTED_LINK_INTERFACE_LIBRARIES Gint::Gint -lcZlib)
|
||||
IMPORTED_LINK_INTERFACE_LIBRARIES cZlib::cZlib)
|
||||
endif()
|
||||
|
|
Loading…
Reference in New Issue