# =================================================================================== # The Pacpus CMake configuration file # # Usage from an external project: # In your CMakeLists.txt, add these lines: # # FIND_PACKAGE(Pacpus REQUIRED) # TARGET_LINK_LIBRARIES(MY_TARGET_NAME ${Pacpus_LIBS}) # # This file will define the following variables: # - Pacpus_LIBS : The list of libraries to links against. # - Pacpus_LIB_DIR : The directory(es) where lib files are. Calling LINK_DIRECTORIES # with this path is NOT needed. # - Pacpus_INCLUDE_DIRS : The Pacpus include directories. # - Pacpus_VERSION : The version of this Pacpus build. Example: "1.2.3" # - Pacpus_MAJOR_VERSION : Major version part of Pacpus_VERSION. Example: "1" # - Pacpus_MINOR_VERSION : Minor version part of Pacpus_VERSION. Example: "2" # - Pacpus_PATCH_VERSION : Patch version part of Pacpus_VERSION. Example: "3" # # Advanced variables: # - Pacpus_CONFIG_PATH # # =================================================================================== # Extract the directory where *this* file has been installed (determined at cmake run-time) get_filename_component(Pacpus_CONFIG_PATH "${CMAKE_CURRENT_LIST_FILE}" PATH CACHE) # ====================================================== # Include directories to add to the user project: # ====================================================== # Provide the include directories to the caller set(Pacpus_INCLUDE_DIRS "${Pacpus_CONFIG_PATH}/include") include_directories(${Pacpus_INCLUDE_DIRS}) # ====================================================== # Link directories to add to the user project: # ====================================================== # Provide the libs directories to the caller set(Pacpus_LIB_DIR_RELEASE "${Pacpus_CONFIG_PATH}/lib" CACHE PATH "Path where release Pacpus libraries are located") set(Pacpus_LIB_DIR_DEBUG "${Pacpus_CONFIG_PATH}/lib" CACHE PATH "Path where debug Pacpus libraries are located") set(Pacpus_3RDPARTY_LIB_DIR_RELEASE "${Pacpus_CONFIG_PATH}/3rdparty/lib" CACHE PATH "Path where release 3rdparty Pacpus dependencies are located") set(Pacpus_3RDPARTY_LIB_DIR_DEBUG "${Pacpus_CONFIG_PATH}/3rdparty/lib" CACHE PATH "Path where debug 3rdparty Pacpus dependencies are located") mark_as_advanced(FORCE Pacpus_LIB_DIR_RELEASE Pacpus_LIB_DIR_DEBUG Pacpus_3RDPARTY_LIB_DIR_RELEASE Pacpus_3RDPARTY_LIB_DIR_DEBUG Pacpus_CONFIG_PATH) # ====================================================== # Version variables: # ====================================================== set(Pacpus_MAJOR_VERSION @Pacpus_MAJOR_VERSION@) set(Pacpus_MINOR_VERSION @Pacpus_MINOR_VERSION@) set(Pacpus_PATCH_VERSION @Pacpus_PATCH_VERSION@) set(Pacpus_VERSION "${Pacpus_MAJOR_VERSION}.${Pacpus_MINOR_VERSION}.${Pacpus_PATCH_VERSION}") # ==================================================================== # Link libraries: e.g. libPacpusLib.so, PacpusLibd.lib, etc... # ==================================================================== set(Pacpus_LIB_COMPONENTS dbiteplayerlib FileLib PacpusLib PacpusTools ) if(WIN32) list(APPEND Pacpus_LIB_COMPONENTS ROAD_TIME ) endif() # ============================================================== set(_Pacpus_MODULE_MISSING FALSE) set(Pacpus_LIBS "") # Check the presence of each component foreach(__opttype RELEASE DEBUG) if(${__opttype} STREQUAL DEBUG) set(Pacpus_LIB_TYPE debug) set(Pacpus_LIB_SUFFIX "_d") else() set(Pacpus_LIB_TYPE optimized) set(Pacpus_LIB_SUFFIX "") endif() foreach(__component ${Pacpus_LIB_COMPONENTS}) find_library( Pacpus_${__component}_LIB_${__opttype} NAMES ${__component}${Pacpus_LIB_SUFFIX} HINTS ${Pacpus_LIB_DIR_${__opttype}} ) if(Pacpus_${__component}_LIB_${__opttype}) list(APPEND Pacpus_LIBS ${Pacpus_LIB_TYPE} ${Pacpus_${__component}_LIB_${__opttype}}) else() message(SEND_ERROR "Cannot find Pacpus component ${__component}${Pacpus_LIB_SUFFIX} (${Pacpus_LIB_TYPE} version)") set(_Pacpus_MODULE_MISSING TRUE) endif() endforeach() endforeach() # handle the QUIETLY and REQUIRED arguments and set PACPUS_FOUND to TRUE if # all listed variables are TRUE include (FindPackageHandleStandardArgs) set(Pacpus_ALL_MODULES_FOUND NOT _Pacpus_MODULE_MISSING) find_package_handle_standard_args (Pacpus DEFAULT_MSG Pacpus_LIBS Pacpus_INCLUDE_DIRS Pacpus_ALL_MODULES_FOUND) # ============================================================== set(Pacpus_INSTALL_DIR ${Pacpus_CONFIG_PATH}) set(Pacpus_CMAKE_DIR ${Pacpus_CONFIG_PATH}/cmake) set(CMAKE_INSTALL_PREFIX ${Pacpus_INSTALL_DIR}) list(APPEND CMAKE_PREFIX_PATH ${Pacpus_CMAKE_DIR}) list(APPEND CMAKE_MODULE_PATH ${Pacpus_CMAKE_DIR}) include(${Pacpus_CMAKE_DIR}/PacpusUtilities.cmake) include(${Pacpus_CMAKE_DIR}/PacpusConfiguration.cmake) include(${Pacpus_CMAKE_DIR}/PacpusDependencies.cmake) include(${Pacpus_CMAKE_DIR}/PacpusPlatforms.cmake) # ============================================================== # Compatibility stuff # ============================================================== set(Pacpus_ROOT ${Pacpus_CONFIG_PATH}) if(CMAKE_BUILD_TYPE MATCHES "Debug") set(Pacpus_LIB_DIR ${Pacpus_LIB_DIR_DEBUG} ${Pacpus_3RDPARTY_LIB_DIR_DEBUG}) else() set(Pacpus_LIB_DIR ${Pacpus_LIB_DIR_RELEASE} ${Pacpus_3RDPARTY_LIB_DIR_RELEASE}) endif() set(Pacpus_LIBRARIES ${Pacpus_LIBS}) set(Pacpus_INCLUDE_DIR ${Pacpus_INCLUDE_DIRS}) set(PACPUS_ROOT ${Pacpus_ROOT}) set(PACPUS_LIBRARIES ${Pacpus_LIBS}) set(PACPUS_INCLUDE_DIR ${Pacpus_INCLUDE_DIR})