target_link_libraries
This commit is contained in:
parent
65d2440e26
commit
8c8adb397e
@ -7,7 +7,7 @@ if(NANA_CMAKE_ENABLE_AUDIO)
|
||||
find_package(ASOUND)
|
||||
if(ASOUND_FOUND)
|
||||
target_include_directories(nana PUBLIC ${ASOUND_INCLUDE_DIRS})
|
||||
target_compile_options(nana PUBLIC -lasound)
|
||||
target_link_libraries(nana PUBLIC ${ASOUND_LIBRARY})
|
||||
else()
|
||||
message(FATAL_ERROR "libasound is not found")
|
||||
endif()
|
||||
|
@ -4,14 +4,15 @@ option(NANA_CMAKE_LIBJPEG_FROM_OS "Use libjpeg from operating system." ON)
|
||||
# todo: decide - PUBLIC vs PRIVATE
|
||||
|
||||
if(NANA_CMAKE_ENABLE_JPEG)
|
||||
target_compile_definitions(nana PUBLIC NANA_ENABLE_JPEG)
|
||||
if(NANA_CMAKE_LIBJPEG_FROM_OS)
|
||||
find_package(JPEG)
|
||||
if(JPEG_FOUND)
|
||||
target_include_directories(nana PUBLIC ${JPEG_INCLUDE_DIR})
|
||||
target_compile_options (nana PUBLIC ${JPEG_LIBRARY})
|
||||
target_compile_definitions(nana PUBLIC NANA_ENABLE_JPEG USE_LIBJPEG_FROM_OS)
|
||||
target_link_libraries (nana PUBLIC ${JPEG_LIBRARY})
|
||||
target_compile_definitions(nana PUBLIC USE_LIBJPEG_FROM_OS)
|
||||
endif()
|
||||
else()
|
||||
target_compile_definitions(nana PUBLIC NANA_ENABLE_JPEG)
|
||||
target_compile_definitions(nana PUBLIC -ljpeg)
|
||||
endif()
|
||||
endif()
|
@ -4,14 +4,15 @@ option(NANA_CMAKE_LIBPNG_FROM_OS "Use libpng from operating system." ON)
|
||||
# todo: decide - PUBLIC vs PRIVATE
|
||||
|
||||
if(NANA_CMAKE_ENABLE_PNG)
|
||||
target_compile_definitions(nana PUBLIC NANA_ENABLE_PNG)
|
||||
if(NANA_CMAKE_LIBPNG_FROM_OS)
|
||||
find_package(PNG)
|
||||
if(PNG_FOUND)
|
||||
target_include_directories(nana PUBLIC ${PNG_INCLUDE_DIRS})
|
||||
target_compile_options (nana PUBLIC ${PNG_LIBRARIES})
|
||||
target_compile_definitions(nana PUBLIC NANA_ENABLE_PNG USE_LIBPNG_FROM_OS)
|
||||
target_link_libraries (nana PUBLIC ${PNG_LIBRARIES})
|
||||
target_compile_definitions(nana PUBLIC USE_LIBPNG_FROM_OS ${PNG_DEFINITIONS})
|
||||
endif()
|
||||
else()
|
||||
target_compile_definitions(nana PUBLIC NANA_ENABLE_PNG)
|
||||
target_compile_definitions(nana PUBLIC -lpng)
|
||||
endif()
|
||||
endif()
|
Loading…
x
Reference in New Issue
Block a user