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

CMake fixes for linux distros. #49

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
23 changes: 18 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,14 @@ project(SMESH VERSION 9.6.0.2 LANGUAGES C CXX)
# --------------------------------------------------------------------------- #
option(ENABLE_NETGEN "Enable Netgen" ON)
set(CMAKE_INSTALL_PREFIX "${CMAKE_SOURCE_DIR}/install" CACHE PATH "Installation directory")
set(CMAKE_INSTALL_LIBDIR lib CACHE PATH "Output directory for libraries")
if(UNIX)
include(GNUInstallDirs)
mark_as_advanced(CLEAR CMAKE_INSTALL_BINDIR)
mark_as_advanced(CLEAR CMAKE_INSTALL_LIBDIR)
else()
set(CMAKE_INSTALL_LIBDIR lib CACHE PATH "Output directory for libraries")
set(CMAKE_INSTALL_BINDIR bin CACHE PATH "Output directory for binaries")
endif()


# --------------------------------------------------------------------------- #
Expand Down Expand Up @@ -156,11 +163,17 @@ get_directory_property(SMESH_LIBRARIES
# Install
# --------------------------------------------------------------------------- #
install(TARGETS ${Netgen_LIBRARIES} ${Kernel_LIBRARIES} ${Geom_LIBRARIES} ${SMESH_LIBRARIES} EXPORT SMESH-targets
ARCHIVE DESTINATION "lib"
RUNTIME DESTINATION "bin"
ARCHIVE DESTINATION ${CMAKE_INSTALL_LINDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})

install(EXPORT SMESH-targets DESTINATION cmake)
if(UNIX)
set(CMAKE_EXPORT_DIR ${CMAKE_INSTALL_LIBDIR}/cmake)
else()
set(CMAKE_EXPORT_DIR cmake)
endif()

install(EXPORT SMESH-targets DESTINATION ${CMAKE_EXPORT_DIR})


# --------------------------------------------------------------------------- #
Expand All @@ -176,4 +189,4 @@ write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/SMESHConfigVersion.

install(FILES ${CMAKE_CURRENT_BINARY_DIR}/SMESHConfig.cmake
${CMAKE_CURRENT_BINARY_DIR}/SMESHConfigVersion.cmake
DESTINATION cmake)
DESTINATION ${CMAKE_EXPORT_DIR})