Skip to content

Commit

Permalink
Merge pull request #7 from mloskot/ml/select_library_configurations
Browse files Browse the repository at this point in the history
Add support for select_library_configurations
  • Loading branch information
letmaik authored Jun 4, 2019
2 parents c8a8028 + 190332a commit e681f1b
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@ SET(INSTALL_CMAKE_MODULE_PATH "${CMAKE_ROOT}/Modules" CACHE STRING

SET(LIB_SUFFIX "" CACHE STRING "Define suffix of lib directory name (32/64)" )

IF(WIN32 AND NOT DEFINED CMAKE_DEBUG_POSTFIX)
SET(CMAKE_DEBUG_POSTFIX "d")
ENDIF()

# To prevent warnings from M$ compiler
IF(WIN32 AND MSVC)
ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS)
Expand Down
21 changes: 19 additions & 2 deletions cmake/modules/FindLibRaw.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,35 @@ FIND_PATH(LibRaw_INCLUDE_DIR libraw.h
PATH_SUFFIXES libraw
)

FIND_LIBRARY(LibRaw_LIBRARIES NAMES raw
FIND_LIBRARY(LibRaw_LIBRARY_RELEASE NAMES raw
HINTS
${PC_LIBRAW_LIBDIR}
${PC_LIBRAW_LIBRARY_DIRS}
)

FIND_LIBRARY(LibRaw_r_LIBRARIES NAMES raw_r
FIND_LIBRARY(LibRaw_LIBRARY_DEBUG NAMES rawd
HINTS
${PC_LIBRAW_LIBDIR}
${PC_LIBRAW_LIBRARY_DIRS}
)

include(SelectLibraryConfigurations)
select_library_configurations(LibRaw)

FIND_LIBRARY(LibRaw_r_LIBRARY_RELEASE NAMES raw_r
HINTS
${PC_LIBRAW_R_LIBDIR}
${PC_LIBRAW_R_LIBRARY_DIRS}
)

FIND_LIBRARY(LibRaw_r_LIBRARY_DEBUG NAMES raw_rd
HINTS
${PC_LIBRAW_R_LIBDIR}
${PC_LIBRAW_R_LIBRARY_DIRS}
)

select_library_configurations(LibRaw_r)

IF(LibRaw_INCLUDE_DIR)
FILE(READ ${LibRaw_INCLUDE_DIR}/libraw_version.h _libraw_version_content)

Expand Down

0 comments on commit e681f1b

Please sign in to comment.