Changeset 306 in pacpusframework for branches/0.1.x/cmake/FindPacpus.cmake
- Timestamp:
- Apr 11, 2014, 4:16:51 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/0.1.x/cmake/FindPacpus.cmake
r304 r306 12 12 # Check PACPUS_ROOT 13 13 if(NOT PACPUS_ROOT) 14 15 16 17 18 19 20 21 22 23 24 25 14 if(NOT ENV{PACPUS_ROOT} STREQUAL "") 15 set(PACPUS_ROOT $ENV{PACPUS_ROOT}) 16 string (REPLACE "\\" "/" PACPUS_ROOT ${PACPUS_ROOT}) 17 message(STATUS "Detected PACPUS_ROOT in environment, set to '${PACPUS_ROOT}'") 18 else() 19 if(PACPUS_FIND_REQUIRED) 20 MESSAGE(FATAL_ERROR "Could'not find PACPUS_ROOT ") 21 else() 22 MESSAGE(STATUS "Could'not find PACPUS_ROOT ") 23 return() 24 endif() 25 endif() 26 26 else() 27 28 27 string (REPLACE "\\" "/" PACPUS_ROOT ${PACPUS_ROOT}) 28 message(STATUS "Detected PACPUS_ROOT as argument with the path: '${PACPUS_ROOT}'") 29 29 endif() 30 30 31 31 32 32 # Locate the include files 33 set(PACPUS_INCLUDE_HINTS 34 "${PACPUS_ROOT}/include" 35 "$ENV{PACPUS_ROOT}/include" 36 ) 37 if(WIN32) 38 list(APPEND PACPUS_INCLUDE_HINTS 39 "C:/Program Files/Pacpus/include" 40 "C:/Program Files (x86)/Pacpus/include" 41 "C:/Pacpus/include" 42 "C:/lib/Pacpus/include" 43 "D:/Program Files/Pacpus/include" 44 "D:/Program Files (x86)/Pacpus/include" 45 "D:/Pacpus/include" 46 "D:/lib/Pacpus/include" 47 ) 48 else() 49 # TODO: add default paths no Unix-like systems 50 list(APPEND PACPUS_INCLUDE_HINTS 51 ) 52 endif() 53 find_path(PACPUS_INCLUDE_DIR 54 NAMES "Pacpus/kernel/pacpus.h" 55 HINTS ${PACPUS_INCLUDE_HINTS} 56 DOC "The Pacpus include directory" 33 set(PACPUS_INCLUDE_DIR 34 "${PACPUS_ROOT}/include" 57 35 ) 58 36 59 37 if(NOT PACPUS_INCLUDE_DIR) 60 38 message(FATAL_ERROR "Could not find PACPUS. Please set CMake variable PACPUS_ROOT or environment variable PACPUS_ROOT.") 61 39 endif() 62 63 40 64 41 #get_filename_component(PACPUS_ROOT ${PACPUS_INCLUDE_DIR}/.. ABSOLUTE) … … 68 45 set(PACPUS_MODULES "FileLib" "PacpusLib" "PacpusTools" "dbiteplayerlib") 69 46 if(WIN32) 70 47 list(APPEND PACPUS_MODULES "ROAD_TIME") 71 48 endif() 72 49 … … 78 55 # Check the presence of each module 79 56 foreach(module ${PACPUS_MODULES}) 80 # release version 81 find_library( 82 PACPUS_${module}_LIB 83 NAMES ${module} 84 HINTS ${PACPUS_LIB_DIR} 85 ) 86 if(PACPUS_${module}_LIB AND PACPUS_${module}_LIBD) 87 list(APPEND PACPUS_LIBRARIES optimized ${PACPUS_${module}_LIB}) 88 else() 89 message(SEND_ERROR "Cannot find Pacpus module ${module} (release version)") 90 set(MODULE_MISSING TRUE) 91 endif() 92 93 # debug version 94 find_library( 95 PACPUS_${module}_LIBD 96 NAMES ${module}_d 97 HINTS ${PACPUS_LIB_DIR} 98 ) 99 if(PACPUS_${module}_LIB AND PACPUS_${module}_LIBD) 100 list(APPEND PACPUS_LIBRARIES debug ${PACPUS_${module}_LIBD}) 101 else() 102 message(SEND_ERROR "Cannot find Pacpus module ${module}_d (debug version)") 103 set(MODULE_MISSING TRUE) 104 endif() 57 58 # release version 59 find_library( 60 PACPUS_${module}_LIB 61 NAMES ${module} 62 HINTS ${PACPUS_LIB_DIR} 63 ) 64 if(PACPUS_${module}_LIB) 65 list(APPEND PACPUS_LIBRARIES optimized ${PACPUS_${module}_LIB}) 66 else() 67 message(SEND_ERROR "Cannot find Pacpus module ${module} (release version)") 68 set(MODULE_MISSING TRUE) 69 endif() 70 71 # debug version 72 find_library( 73 PACPUS_${module}_LIBD 74 NAMES ${module}_d 75 HINTS ${PACPUS_LIB_DIR} 76 ) 77 if(PACPUS_${module}_LIBD) 78 list(APPEND PACPUS_LIBRARIES debug ${PACPUS_${module}_LIBD}) 79 else() 80 message(SEND_ERROR "Cannot find Pacpus module ${module}_d (debug version)") 81 set(MODULE_MISSING TRUE) 82 endif() 83 105 84 endforeach() 106 85 … … 112 91 113 92 if(PACPUS_FOUND) 114 115 116 117 118 119 120 121 122 123 93 set(PACPUS_INSTALL_DIR ${PACPUS_ROOT}) 94 set(PACPUS_CMAKE_DIR ${PACPUS_ROOT}/cmake) 95 set(CMAKE_INSTALL_PREFIX ${PACPUS_INSTALL_DIR}) 96 list(APPEND CMAKE_PREFIX_PATH ${PACPUS_CMAKE_DIR}) 97 list(APPEND CMAKE_MODULE_PATH "${PACPUS_CMAKE_DIR}") 98 99 include(${PACPUS_CMAKE_DIR}/PacpusUtilities.cmake) 100 include(${PACPUS_CMAKE_DIR}/PacpusConfiguration.cmake) 101 include(${PACPUS_CMAKE_DIR}/PacpusDependencies.cmake) 102 include(${PACPUS_CMAKE_DIR}/PacpusPlatforms.cmake) 124 103 endif()
Note:
See TracChangeset
for help on using the changeset viewer.