# Find CEF # # This module defines # CEF_FOUND # CEF_INCLUDE_DIRS # CEF_LIBRARIES # CEF_BINARIES_DEBUG # CEF_BINARIES_RELEASE # # Copyright (c) 2012 I-maginer # # This program is free software; you can redistribute it and/or modify it under # the terms of the GNU Lesser General Public License as published by the Free Software # Foundation; either version 2 of the License, or (at your option) any later # version. # # This program is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS # FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public License along with # this program; if not, write to the Free Software Foundation, Inc., 59 Temple # Place - Suite 330, Boston, MA 02111-1307, USA, or go to # http://www.gnu.org/copyleft/lesser.txt # # On a new cmake run, we do not need to be verbose IF(CEF_INCLUDE_DIR AND CEF_LIBRARY) SET(CEF_FIND_QUIETLY TRUE) ENDIF() # If CEF_ROOT was defined in the environment, use it. Else, search in default dependency dir. IF(NOT CEF_ROOT) if(CMAKE_CL_64) SET(CEF_ROOT "$ENV{SCOL_DEPENDENCIES_PATH}/cef3/x64") else(CMAKE_CL_64) SET(CEF_ROOT "$ENV{SCOL_DEPENDENCIES_PATH}/cef3/x86") endif(CMAKE_CL_64) ENDIF() # concat all the search paths IF(CEF_ROOT) SET(CEF_INCLUDE_SEARCH_DIRS ${CEF_INCLUDE_SEARCH_DIRS} ${CEF_ROOT} ) SET(CEF_LIBRARY_SEARCH_DEBUG_DIRS ${CEF_LIBRARY_SEARCH_DIRS} ${CEF_ROOT}/Debug/lib ${CEF_ROOT}/lib/Debug ${CEF_ROOT}/Debug/lib ${CEF_ROOT}/Debug ) SET(CEF_LIBRARY_SEARCH_RELEASE_DIRS ${CEF_LIBRARY_SEARCH_DIRS} ${CEF_ROOT}/Release/lib ${CEF_ROOT}/lib/Release ${CEF_ROOT}/Release ) SET(CEF_BINARY_SEARCH_DEBUG_DIRS ${CEF_BINARY_SEARCH_DIRS} ${CEF_ROOT}/Debug ) SET(CEF_BINARY_SEARCH_RELEASE_DIRS ${CEF_BINARY_SEARCH_DIRS} ${CEF_ROOT}/Release ) SET(CEF_RESOURCES_SEARCH_DIRS ${CEF_BINARY_SEARCH_DIRS} ${CEF_ROOT}/Resources ) ENDIF() # log message IF (NOT CEF_FIND_QUIETLY) MESSAGE(STATUS "Checking for CEF library") ENDIF() # Search for header files FIND_PATH(CEF_INCLUDE_DIR include/cef_base.h PATHS ${CEF_INCLUDE_SEARCH_DIRS}) # Search for libraries files (debug mode) FIND_LIBRARY(CEF_LIBRARY_DEBUG libcef PATHS ${CEF_LIBRARY_SEARCH_DEBUG_DIRS}) FIND_LIBRARY(CEF_WRAPPER_LIBRARY_DEBUG libcef_dll_wrapper PATHS ${CEF_LIBRARY_SEARCH_DEBUG_DIRS}) # Search for libraries files (release mode) FIND_LIBRARY(CEF_LIBRARY_RELEASE libcef PATHS ${CEF_LIBRARY_SEARCH_RELEASE_DIRS}) FIND_LIBRARY(CEF_WRAPPER_LIBRARY_RELEASE libcef_dll_wrapper PATHS ${CEF_LIBRARY_SEARCH_RELEASE_DIRS}) # Search for cef binary files (debug mode) FIND_FILE(CEF_BINARY_PATH_DEBUG NAMES "libcef.dll" HINTS ${CEF_BINARY_SEARCH_DEBUG_DIRS}) # Search for cef binary files (release mode) FIND_FILE(CEF_BINARY_PATH_RELEASE NAMES "libcef.dll" HINTS ${CEF_BINARY_SEARCH_RELEASE_DIRS}) # Search for CHROME binary files (debug mode) FIND_FILE(CHROME_BINARY_PATH_DEBUG NAMES "chrome_elf.dll" HINTS ${CEF_BINARY_SEARCH_DEBUG_DIRS}) # Search for avcodec binary files (release mode) FIND_FILE(CHROME_BINARY_PATH_RELEASE NAMES "chrome_elf.dll" HINTS ${CEF_BINARY_SEARCH_RELEASE_DIRS}) # Search for NBLOB binary files (debug mode) FIND_FILE(NBLOB_BINARY_PATH_DEBUG NAMES "natives_blob.bin" HINTS ${CEF_BINARY_SEARCH_DEBUG_DIRS}) # Search for NBLOB binary files (release mode) FIND_FILE(NBLOB_BINARY_PATH_RELEASE NAMES "natives_blob.bin" HINTS ${CEF_BINARY_SEARCH_RELEASE_DIRS}) # Search for "locales" directory FIND_PATH(CEF_LOCALES_DIRECTORY_PATH "en-US.pak" PATH ${CEF_RESOURCES_SEARCH_DIRS}/locales) FIND_PATH(CEF_ICUDTL_DIRECTORY_PATH "icudtl.dat" PATH ${CEF_RESOURCES_SEARCH_DIRS}) # Configure libraries for debug/release SET(CEF_INCLUDE_DIRS ${CEF_INCLUDE_DIR} CACHE STRING "Directory containing CEF header files") SET(CEF_LIBRARY debug ${CEF_LIBRARY_DEBUG} optimized ${CEF_LIBRARY_RELEASE}) SET(CEF_WRAPPER_LIBRARY debug ${CEF_WRAPPER_LIBRARY_DEBUG} optimized ${CEF_WRAPPER_LIBRARY_RELEASE}) SET(CEF_LIBRARIES ${CEF_LIBRARY} ${CEF_WRAPPER_LIBRARY} CACHE STRING "CEF libraries files") # Configure binaries for debug/release SET(CEF_BINARIES_DEBUG ${CEF_BINARY_PATH_DEBUG} ${CHROME_BINARY_PATH_DEBUG} ${NBLOB_BINARY_PATH_DEBUG} CACHE STRING "CEF debug binaries files") SET(CEF_BINARIES_RELEASE ${CEF_BINARY_PATH_RELEASE} ${CHROME_BINARY_PATH_RELEASE} ${NBLOB_BINARY_PATH_RELEASE} CACHE STRING "CEF release binaries files") IF(CEF_INCLUDE_DIR AND CEF_LIBRARY AND CEF_WRAPPER_LIBRARY AND CEF_BINARIES_DEBUG AND CEF_BINARIES_RELEASE) SET(CEF_FOUND TRUE) ENDIF() # Hide those variables in GUI SET(CEF_INCLUDE_DIR ${CEF_INCLUDE_DIR} CACHE INTERNAL "") SET(CEF_LIBRARY_DEBUG ${CEF_LIBRARY_DEBUG} CACHE INTERNAL "") SET(CEF_LIBRARY_RELEASE ${CEF_LIBRARY_RELEASE} CACHE INTERNAL "") SET(CEF_LIBRARY ${CEF_LIBRARY} CACHE INTERNAL "") SET(CEF_WRAPPER_LIBRARY_DEBUG ${CEF_WRAPPER_LIBRARY_DEBUG} CACHE INTERNAL "") SET(CEF_WRAPPER_LIBRARY_RELEASE ${CEF_WRAPPER_LIBRARY_RELEASE} CACHE INTERNAL "") SET(CEF_WRAPPER_LIBRARY ${CEF_WRAPPER_LIBRARY} CACHE INTERNAL "") SET(CEF_BINARY_PATH_DEBUG ${CEF_BINARY_PATH_DEBUG} CACHE INTERNAL "") SET(CEF_BINARY_PATH_RELEASE ${CEF_BINARY_PATH_RELEASE} CACHE INTERNAL "") SET(CHROME_BINARY_PATH_DEBUG ${CHROME_BINARY_PATH_DEBUG} CACHE INTERNAL "") SET(CHROME_BINARY_PATH_RELEASE ${CHROME_BINARY_PATH_RELEASE} CACHE INTERNAL "") SET(NBLOB_BINARY_PATH_DEBUG ${NBLOB_BINARY_PATH_DEBUG} CACHE INTERNAL "") SET(NBLOB_BINARY_PATH_RELEASE ${NBLOB_BINARY_PATH_RELEASE} CACHE INTERNAL "") # log find result IF(CEF_FOUND) IF(NOT CEF_FIND_QUIETLY) MESSAGE(STATUS " libraries: ${CEF_LIBRARIES}") MESSAGE(STATUS " includes: ${CEF_INCLUDE_DIRS}") ENDIF() ELSE(CEF_FOUND) IF(NOT CEF_LIBRARIES) MESSAGE(STATUS, "CEF library could not be found.") ENDIF() IF(NOT (CEF_BINARIES_DEBUG AND CEF_BINARIES_RELEASE)) MESSAGE(STATUS, "CEF binaries files could not be found.") ENDIF() IF(NOT CEF_INCLUDE_DIRS) MESSAGE(STATUS "Cef include files could not be found.") ENDIF() ENDIF(CEF_FOUND)