2016-09-25 16:19:39 -04:00
|
|
|
#############################################################################
|
|
|
|
# Name: build/cmake/install.cmake
|
|
|
|
# Purpose: Install target CMake file
|
|
|
|
# Author: Tobias Taschner
|
|
|
|
# Created: 2016-10-17
|
|
|
|
# Copyright: (c) 2016 wxWidgets development team
|
|
|
|
# Licence: wxWindows licence
|
|
|
|
#############################################################################
|
|
|
|
|
|
|
|
if(NOT wxBUILD_INSTALL)
|
|
|
|
return()
|
|
|
|
endif()
|
|
|
|
|
|
|
|
install(CODE "message(STATUS \"Installing: Headers...\")")
|
2021-05-24 15:10:14 -04:00
|
|
|
if(WIN32_MSVC_NAMING)
|
2016-09-25 16:19:39 -04:00
|
|
|
wx_install(
|
2018-12-06 16:27:25 -05:00
|
|
|
DIRECTORY "${wxSOURCE_DIR}/include/wx"
|
2020-02-16 09:23:03 -05:00
|
|
|
DESTINATION "include")
|
2021-05-24 15:10:14 -04:00
|
|
|
if(MSVC)
|
|
|
|
wx_install(
|
|
|
|
DIRECTORY "${wxSOURCE_DIR}/include/msvc"
|
|
|
|
DESTINATION "include")
|
|
|
|
endif()
|
2018-12-06 16:27:25 -05:00
|
|
|
else()
|
2021-06-06 16:48:27 -04:00
|
|
|
wx_get_flavour(lib_flavour "-")
|
2018-12-06 16:27:25 -05:00
|
|
|
wx_install(
|
|
|
|
DIRECTORY "${wxSOURCE_DIR}/include/wx"
|
2021-06-06 16:48:27 -04:00
|
|
|
DESTINATION "include/wx-${wxMAJOR_VERSION}.${wxMINOR_VERSION}${lib_flavour}")
|
2016-09-25 16:19:39 -04:00
|
|
|
endif()
|
2018-12-02 11:34:20 -05:00
|
|
|
|
|
|
|
# setup header and wx-config
|
2021-05-24 15:10:14 -04:00
|
|
|
if(WIN32_MSVC_NAMING)
|
2016-09-25 16:19:39 -04:00
|
|
|
wx_install(
|
|
|
|
DIRECTORY "${wxSETUP_HEADER_PATH}"
|
2021-10-17 05:52:30 -04:00
|
|
|
DESTINATION "lib/${wxPLATFORM_LIB_DIR}")
|
2020-02-16 09:23:03 -05:00
|
|
|
else()
|
2018-12-02 11:34:20 -05:00
|
|
|
wx_install(
|
|
|
|
DIRECTORY "${wxSETUP_HEADER_PATH}"
|
|
|
|
DESTINATION "lib/wx/include")
|
|
|
|
|
|
|
|
wx_install(
|
|
|
|
FILES "${wxOUTPUT_DIR}/wx/config/${wxBUILD_FILE_ID}"
|
|
|
|
DESTINATION "lib/wx/config"
|
|
|
|
PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ
|
|
|
|
GROUP_EXECUTE GROUP_READ
|
|
|
|
WORLD_EXECUTE WORLD_READ
|
|
|
|
)
|
|
|
|
|
|
|
|
install(DIRECTORY DESTINATION "bin")
|
|
|
|
install(CODE "execute_process( \
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E create_symlink \
|
|
|
|
${CMAKE_INSTALL_PREFIX}/lib/wx/config/${wxBUILD_FILE_ID} \
|
|
|
|
${CMAKE_INSTALL_PREFIX}/bin/wx-config \
|
|
|
|
)"
|
|
|
|
)
|
2016-09-25 16:19:39 -04:00
|
|
|
endif()
|
|
|
|
|
2022-04-12 15:12:57 -04:00
|
|
|
install(EXPORT wxWidgetsTargets NAMESPACE wx:: DESTINATION "lib/cmake/wxWidgets")
|
|
|
|
|
2016-09-25 16:19:39 -04:00
|
|
|
# uninstall target
|
|
|
|
if(MSVC_IDE)
|
|
|
|
set(UNINST_NAME UNINSTALL)
|
|
|
|
else()
|
|
|
|
set(UNINST_NAME uninstall)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(NOT TARGET ${UNINST_NAME})
|
2021-05-24 15:10:14 -04:00
|
|
|
# these symlinks are not included in the install manifest
|
|
|
|
set(WX_EXTRA_UNINSTALL_FILES)
|
|
|
|
if(NOT WIN32_MSVC_NAMING)
|
2021-06-06 17:14:22 -04:00
|
|
|
if(IPHONE)
|
|
|
|
set(EXE_SUFFIX ".app")
|
|
|
|
else()
|
|
|
|
set(EXE_SUFFIX ${CMAKE_EXECUTABLE_SUFFIX})
|
|
|
|
endif()
|
|
|
|
|
2021-05-24 15:10:14 -04:00
|
|
|
set(WX_EXTRA_UNINSTALL_FILES
|
|
|
|
"${CMAKE_INSTALL_PREFIX}/bin/wx-config"
|
2021-06-06 17:14:22 -04:00
|
|
|
"${CMAKE_INSTALL_PREFIX}/bin/wxrc${EXE_SUFFIX}"
|
2018-12-02 11:34:20 -05:00
|
|
|
)
|
2021-05-24 15:10:14 -04:00
|
|
|
endif()
|
2018-12-02 11:34:20 -05:00
|
|
|
|
2016-09-25 16:19:39 -04:00
|
|
|
configure_file(
|
|
|
|
"${wxSOURCE_DIR}/build/cmake/uninstall.cmake.in"
|
|
|
|
"${wxBINARY_DIR}/uninstall.cmake"
|
|
|
|
IMMEDIATE @ONLY)
|
|
|
|
|
|
|
|
add_custom_target(${UNINST_NAME}
|
|
|
|
COMMAND ${CMAKE_COMMAND} -P ${wxBINARY_DIR}/uninstall.cmake)
|
|
|
|
get_property(PREDEF_FOLDER GLOBAL PROPERTY PREDEFINED_TARGETS_FOLDER)
|
|
|
|
if(NOT PREDEF_FOLDER)
|
|
|
|
set(PREDEF_FOLDER "CMakePredefinedTargets")
|
|
|
|
endif()
|
|
|
|
set_target_properties(${UNINST_NAME} PROPERTIES FOLDER "${PREDEF_FOLDER}")
|
|
|
|
endif()
|