Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix multiarch compatibility #206

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -101,14 +101,15 @@ endif()

# Installation paths
if(UNIX AND SYSTEM_DIR_INSTALL)
include(GNUInstallDirs)
# Install into the system (/usr/bin or /usr/local/bin)
set(INSTALL_ROOT "share/${project}") # /usr/[local]/share/<project>
set(INSTALL_CMAKE "share/${project}/cmake") # /usr/[local]/share/<project>/cmake
set(INSTALL_CMAKE "${CMAKE_INSTALL_LIBDIR}/cmake/${project}") # /usr/[local]/lib/<arch>/cmake/<project>
set(INSTALL_EXAMPLES "share/${project}") # /usr/[local]/share/<project>
set(INSTALL_DATA "share/${project}") # /usr/[local]/share/<project>
set(INSTALL_BIN "bin") # /usr/[local]/bin
set(INSTALL_SHARED "lib") # /usr/[local]/lib
set(INSTALL_LIB "lib") # /usr/[local]/lib
set(INSTALL_SHARED "${CMAKE_INSTALL_LIBDIR}") # /usr/[local]/lib/<arch>
set(INSTALL_LIB "${CMAKE_INSTALL_LIBDIR}") # /usr/[local]/lib/<arch>
set(INSTALL_INCLUDE "include") # /usr/[local]/include
set(INSTALL_DOC "share/doc/${project}") # /usr/[local]/share/doc/<project>
set(INSTALL_SHORTCUTS "share/applications") # /usr/[local]/share/applications
Expand Down Expand Up @@ -163,7 +164,7 @@ add_subdirectory(deploy)
install(FILES "${PROJECT_BINARY_DIR}/VERSION" DESTINATION ${INSTALL_ROOT} COMPONENT runtime)

# Install cmake find script for the project
install(FILES ${META_PROJECT_NAME}-config.cmake DESTINATION ${INSTALL_ROOT} COMPONENT dev)
install(FILES ${META_PROJECT_NAME}-config.cmake DESTINATION ${INSTALL_CMAKE} COMPONENT dev)

# Install the project meta files
install(FILES AUTHORS DESTINATION ${INSTALL_ROOT} COMPONENT runtime)
Expand Down
40 changes: 1 addition & 39 deletions glbinding-config.cmake
Original file line number Diff line number Diff line change
@@ -1,40 +1,2 @@
include("${CMAKE_CURRENT_LIST_DIR}/glbinding-export.cmake")

# This config script tries to locate the project either in its source tree
# of from an install location.
#
# Please adjust the list of submodules to search for.


# List of modules
set(MODULE_NAMES
glbinding
)


# Macro to search for a specific module
macro(find_module FILENAME)
if(EXISTS "${FILENAME}")
set(MODULE_FOUND TRUE)
include("${FILENAME}")
endif()
endmacro()

# Macro to search for all modules
macro(find_modules PREFIX)
foreach(module_name ${MODULE_NAMES})
find_module("${CMAKE_CURRENT_LIST_DIR}/${PREFIX}/${module_name}/${module_name}-export.cmake")
endforeach(module_name)
endmacro()


# Try install location
set(MODULE_FOUND FALSE)
find_modules("cmake")

if(MODULE_FOUND)
return()
endif()

# Try common build locations
find_modules("build/cmake")
find_modules("build-debug/cmake")
2 changes: 1 addition & 1 deletion source/glbinding/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,6 @@ install(DIRECTORY
# CMake config
install(EXPORT ${target}-export
NAMESPACE ${META_PROJECT_NAME}::
DESTINATION ${INSTALL_CMAKE}/${target}
DESTINATION ${INSTALL_CMAKE}
COMPONENT dev
)