forked from ebertolazzi/Clothoids
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeInstall.txt
83 lines (73 loc) · 2.88 KB
/
CMakeInstall.txt
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
if(INSTALL_HERE)
# install in the home of the whole project
if ( ${CMAKE_HOME_DIRECTORY} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR} )
set(INSTALL_PREFIX "${CMAKE_CURRENT_SOURCE_DIR}/lib")
else()
set(INSTALL_PREFIX "${CMAKE_HOME_DIRECTORY}/lib3rd")
endif()
set(PROJECT_PUBLIC_HEADER_DESTINATION "${INSTALL_PREFIX}/include")
else()
set(INSTALL_TARGETS ${INSTALL_TARGETS} UtilsStatic QuarticStatic)
set(INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
set(PROJECT_PUBLIC_HEADER_DESTINATION "${CMAKE_INSTALL_PREFIX}/include/${PROJECT_NAME}")
endif()
#MESSAGE( STATUS "\n\n\nCMAKE_HOME_DIRECTORY = ${CMAKE_HOME_DIRECTORY}\n\n\n")
#MESSAGE( STATUS "\n\n\nCMAKE_CURRENT_SOURCE_DIR = ${CMAKE_CURRENT_SOURCE_DIR}\n\n\n")
#MESSAGE( STATUS "\n\n\nINSTALL_PREFIX = ${INSTALL_PREFIX}\n\n\n")
# Installing Dependencies
install(
TARGETS ${INSTALL_TARGETS}
EXPORT ClothoidsTargets
RUNTIME DESTINATION "${INSTALL_PREFIX}/bin"
ARCHIVE DESTINATION "${INSTALL_PREFIX}/lib"
LIBRARY DESTINATION "${INSTALL_PREFIX}/dll"
PUBLIC_HEADER DESTINATION "${PROJECT_PUBLIC_HEADER_DESTINATION}"
)
# FIXME: The header structure forces me to do this... And this will create issues!
install(FILES "${Clothoids_DIR}/Clothoids.hh" DESTINATION "${PROJECT_PUBLIC_HEADER_DESTINATION}")
install(DIRECTORY "${Clothoids_DIR}/Clothoids" DESTINATION "${PROJECT_PUBLIC_HEADER_DESTINATION}")
#----------------------------------------
# CPACK INSTALL TARGETS (Leaving almost as it is...)
IF ( APPLE OR LINUX OR UNIX )
install(
EXPORT ClothoidsTargets
FILE ClothoidsTargets.cmake
DESTINATION lib/cmake/Clothoids
)
set(INCLUDE_INSTALL_DIR include/ CACHE STRING "Include install directory")
set(LIBRARIES_INSTALL_DIR lib/ CACHE STRING "Libraries install directory")
get_target_property(CLOTHOIDS_LIB_OUTPUT_NAME ${STATIC_PROJECT} OUTPUT_NAME)
if(UNIX)
set(CLOTHOIDS_LIB_PREFIX lib)
set(CLOTHOIDS_LIB_SUFFIX .a)
else()
set(CLOTHOIDS_LIB_PREFIX "")
set(CLOTHOIDS_LIB_SUFFIX .lib)
endif()
set(CLOTHOIDS_LIB_NAME "${CLOTHOIDS_LIB_PREFIX}${CLOTHOIDS_LIB_OUTPUT_NAME}${CLOTHOIDS_LIB_SUFFIX}")
set(LIBRARIES lib/${CLOTHOIDS_LIB_NAME} CACHE STRING "Libraries directory")
include(CMakePackageConfigHelpers)
configure_package_config_file(
ClothoidsConfig.cmake.in
"${CMAKE_CURRENT_BINARY_DIR}/ClothoidsConfig.cmake"
INSTALL_DESTINATION "lib/Clothoids/cmake"
PATH_VARS INCLUDE_INSTALL_DIR LIBRARIES_INSTALL_DIR LIBRARIES
)
write_basic_package_version_file(
"ClothoidsConfigVersion.cmake"
VERSION 2.0.9
COMPATIBILITY SameMajorVersion
)
install(
FILES
${CMAKE_CURRENT_BINARY_DIR}/ClothoidsConfig.cmake
${CMAKE_CURRENT_BINARY_DIR}/ClothoidsConfigVersion.cmake
DESTINATION lib/cmake/Clothoids
)
endif()
if(INSTALL_HERE)
add_custom_command(
TARGET ${STATIC_PROJECT} POST_BUILD
COMMAND cmake --build . --config Release --target install
)
endif()