source: pacpusframework/trunk/cmake/FindPacpus.cmake@ 63

Last change on this file since 63 was 50, checked in by Marek Kurdej, 12 years ago

CMake: updated to conform to the coding style.

File size: 2.1 KB
Line 
1#################################################
2# ___________ ____ ______ __ __ _____ #
3# \____ \__ \ _/ ___\\____ \| | \/ ___/ #
4# | |_> > __ \\ \___| |_> > | /\___ \ #
5# | __(____ /\___ > __/|____//____ > #
6# |__| \/ \/|__| \/ #
7# #
8#################################################
9
10# TODO: write the output variables of this CMake file.
11
12# Check PACPUS_ROOT
13if(NOT PACPUS_ROOT)
14 if(NOT ENV{PACPUS_ROOT} STREQUAL "")
15 set(PACPUS_ROOT $ENV{PACPUS_ROOT})
16 message(STATUS "Detected PACPUS_ROOT, set to '${PACPUS_ROOT}'")
17 endif()
18endif()
19
20# Configure Pacpus
21include(${PACPUS_ROOT}/cmake/PacpusUtilities.cmake)
22include(${PACPUS_ROOT}/cmake/PacpusConfiguration.cmake)
23include(${PACPUS_ROOT}/cmake/PacpusDependencies.cmake)
24include(${PACPUS_ROOT}/cmake/PacpusPlatforms.cmake)
25
26# Hint directories
27set(PACPUS_INCLUDE_HINT ${PACPUS_ROOT}/include)
28set(PACPUS_LIBRARY_HINT ${PACPUS_ROOT}/lib)
29
30# Locate the include files
31find_path(
32 PACPUS_INCLUDE_DIR
33 NAMES
34 "Pacpus"
35 HINTS
36 ${PACPUS_INCLUDE_HINT}
37 DOC
38 "The Pacpus include directory"
39)
40
41# List of required modules
42set(PACPUS_MODULES "FileLib" "PacpusLib" "PacpusTools" "dbiteplayerlib")
43if(WIN32)
44 list(APPEND PACPUS_MODULES "ROAD_TIME")
45endif()
46
47set(MODULE_MISSING FALSE)
48set(PACPUS_LIBRARIES "")
49
50# Check the presence of each module
51foreach(module ${PACPUS_MODULES})
52 find_library(
53 PACPUS_${module}_LIB
54 NAMES
55 ${module}
56 HINTS
57 ${PACPUS_LIBRARY_HINT}
58 )
59 find_library(
60 PACPUS_${module}_LIBD
61 NAMES
62 ${module}_d
63 HINTS
64 ${PACPUS_LIBRARY_HINT}
65 )
66
67 if(PACPUS_${module}_LIB AND PACPUS_${module}_LIBD)
68 list(APPEND PACPUS_LIBRARIES optimized ${PACPUS_${module}_LIB})
69 list(APPEND PACPUS_LIBRARIES debug ${PACPUS_${module}_LIBD})
70 else()
71 set(MODULE_MISSING TRUE)
72 endif()
73endforeach()
74
75if(NOT MODULE_MISSING AND PACPUS_INCLUDE_DIR)
76 set(PACPUS_FOUND TRUE)
77else()
78 set(PACPUS_FOUND FALSE)
79endif()
Note: See TracBrowser for help on using the repository browser.