CMake: _LIBRARIES is a magic suffix
Makes CMake automatically pass lib to target_link_libraries()
This commit is contained in:
@@ -44,6 +44,8 @@ find_path(OCIO_INCLUDE_DIR
|
|||||||
"OCIO headers path"
|
"OCIO headers path"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
list(APPEND OCIO_INCLUDE_DIRS ${OCIO_INCLUDE_DIR})
|
||||||
|
|
||||||
find_library(OCIO_LIBRARY
|
find_library(OCIO_LIBRARY
|
||||||
NAMES
|
NAMES
|
||||||
libOpenColorIO.so.2.0 # libOpenColorIO.so.2.0 (Linux)
|
libOpenColorIO.so.2.0 # libOpenColorIO.so.2.0 (Linux)
|
||||||
@@ -60,7 +62,9 @@ find_library(OCIO_LIBRARY
|
|||||||
"OCIO library path"
|
"OCIO library path"
|
||||||
)
|
)
|
||||||
|
|
||||||
if(OCIO_INCLUDE_DIR AND EXISTS "${OCIO_INCLUDE_DIR}/OpenColorIO/OpenColorABI.h")
|
list(APPEND OCIO_LIBRARIES ${OCIO_LIBRARY})
|
||||||
|
|
||||||
|
if(OCIO_INCLUDE_DIRS AND EXISTS "${OCIO_INCLUDE_DIR}/OpenColorIO/OpenColorABI.h")
|
||||||
file(STRINGS ${OCIO_INCLUDE_DIR}/OpenColorIO/OpenColorABI.h
|
file(STRINGS ${OCIO_INCLUDE_DIR}/OpenColorIO/OpenColorABI.h
|
||||||
fullVersion
|
fullVersion
|
||||||
REGEX
|
REGEX
|
||||||
@@ -74,8 +78,8 @@ include(FindPackageHandleStandardArgs)
|
|||||||
|
|
||||||
find_package_handle_standard_args(OpenColorIO
|
find_package_handle_standard_args(OpenColorIO
|
||||||
REQUIRED_VARS
|
REQUIRED_VARS
|
||||||
OCIO_LIBRARY
|
OCIO_LIBRARIES
|
||||||
OCIO_INCLUDE_DIR
|
OCIO_INCLUDE_DIRS
|
||||||
VERSION_VAR
|
VERSION_VAR
|
||||||
OCIO_VERSION
|
OCIO_VERSION
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user