-
Notifications
You must be signed in to change notification settings - Fork 3
/
FnmConfig.cmake.in
59 lines (51 loc) · 2.37 KB
/
FnmConfig.cmake.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# - Config file for the FNM package
# It defines the following variables
# FNM_INCLUDE_DIRS - include directories for FNM
# FNM_LIBRARIES - libraries to link against
# FNM_EXECUTABLE - the bar executable
# On Windows, the following is defined
# FNM_RUNTIME_LIBRARIES - the runtime libraries (if any)
# FNM_RUNTIME_DIR - the runtime directory (if any)
# FNM_RUNTIME_DIR_DEBUG - the runtime directory (if any)
# FNM_RUNTIME_DIR_RELEASE - the runtime directory (if any)
cmake_minimum_required(VERSION 2.8.9)
# Use DIRECTORY instead of PATH
#cmake_minimum_required(VERSION 2.8.12.2)
# Compute paths, FNM_CMAKE_DIR is just a variable name, used in CMakeLists.txt
get_filename_component(FNM_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
set(FNM_INCLUDE_DIRS "@CONF_INCLUDE_DIRS@")
# Our library dependencies (contains definitions for IMPORTED targets)
include("${FNM_CMAKE_DIR}/FNMTargets.cmake")
# These are IMPORTED targets created by FNMTargets.cmake
set(FNM_LIBRARIES bftx)
#set(FNM_EXECUTABLE bar)
# JEM: For dynamic libraries, the following run path's are added
set(FNM_RUNTIME_LIBRARIES "")
set(FNM_RUNTIME_DIR "")
set(FNM_RUNTIME_DIR_DEBUG "")
set(FNM_RUNTIME_DIR_RELEASE "")
# On Windows add run-time
if (WIN32)
# Add runtime libraries - doesn't exist for installed version
if (@FNM_DYNAMIC_LINKING@)
message("Foo is a dynamic library")
# TODO: Question is this independent of Visual Studio and release?
get_property(TMP TARGET foo PROPERTY IMPORTED_LOCATION_RELEASE)
if ("${TMP}" STREQUAL "")
# For installed libraries use relative path to FNM_CMAKE_DIR
set(FNM_RUNTIME_DIR "@CONF_LIBRARY_DIRS@")
set(FNM_RUNTIME_DIR_RELEASE "@CONF_LIBRARY_DIRS@")
set(FNM_RUNTIME_DIR_DEBUG "@CONF_LIBRARY_DIRS@")
set(FNM_RUNTIME_LIBRARIES "foo.dll")
else()
# For build tree configurations, multiple configurations are accessible
get_filename_component(FNM_RUNTIME_LIBRARIES ${TMP} NAME)
get_filename_component(FNM_RUNTIME_DIR_RELEASE ${TMP} PATH)
get_filename_component(FNM_RUNTIME_DIR ${FNM_RUNTIME_DIR_RELEASE} PATH)
get_property(TMP TARGET foo PROPERTY IMPORTED_LOCATION_DEBUG)
get_filename_component(FNM_RUNTIME_DIR_DEBUG ${TMP} PATH)
endif()
else()
message("Foo is a static library")
endif()
endif()