Skip to content
Snippets Groups Projects
Commit 55c07e46 authored by Valerio Mariani's avatar Valerio Mariani
Browse files

Implemented UBUNTU_LAYOUT flag

Substitutes DEBIAN_STYLE_LIBEXEC flag and manages location and name of lib and libexec folders on Debian/Ubuntu-based systems
parent 3f99da71
No related branches found
No related tags found
No related merge requests found
...@@ -48,7 +48,7 @@ option(ENABLE_SPNAV "whether 3DConnexion devices should be supported" ...@@ -48,7 +48,7 @@ option(ENABLE_SPNAV "whether 3DConnexion devices should be supported"
option(STATIC_PROPERTY_WORKAROUND "workaround for static property bug with some boost/boost_python combinations" OFF) option(STATIC_PROPERTY_WORKAROUND "workaround for static property bug with some boost/boost_python combinations" OFF)
option(COMPILE_TESTS "whether unit tests should be compiled by default" OFF) option(COMPILE_TESTS "whether unit tests should be compiled by default" OFF)
option(ENABLE_STATIC "whether static libraries should be compiled" OFF) option(ENABLE_STATIC "whether static libraries should be compiled" OFF)
option(DEBIAN_STYLE_LIBEXEC "whether 'libexec' should be put under 'lib/openstructure" OFF) option(UBUNTU_LAYOUT "whether Debian/Ubuntu's lib and libexec directory layout should be used" OFF)
option(HIDDEN_VISIBILITY "on gcc, use -fvisibility=hidden" OFF) option(HIDDEN_VISIBILITY "on gcc, use -fvisibility=hidden" OFF)
if (CXX) if (CXX)
...@@ -140,10 +140,10 @@ else() ...@@ -140,10 +140,10 @@ else()
set(_PROFILE OFF) set(_PROFILE OFF)
endif() endif()
if (DEBIAN_STYLE_LIBEXEC) if (UBUNTU_LAYOUT)
set(_DEBIAN_STYLE_LIBEXEC ON) set(_UBUNTU_LAYOUT ON)
else() else()
set(_DEBIAN_STYLE_LIBEXEC OFF) set(_UBUNTU_LAYOUT OFF)
endif() endif()
add_definitions(-DEIGEN2_SUPPORT) add_definitions(-DEIGEN2_SUPPORT)
...@@ -333,22 +333,22 @@ if (CMAKE_COMPILER_IS_GNUCXX) ...@@ -333,22 +333,22 @@ if (CMAKE_COMPILER_IS_GNUCXX)
endif() endif()
message(STATUS message(STATUS
"OpenStructure will be built with the following options:\n" "OpenStructure will be built with the following options:\n"
" Install Prefix (-DPREFIX) : ${CMAKE_INSTALL_PREFIX}\n" " Install Prefix (-DPREFIX) : ${CMAKE_INSTALL_PREFIX}\n"
" RPath in install (-DUSE_RPATH) : ${_USE_RPATH}\n" " RPath in install (-DUSE_RPATH) : ${_USE_RPATH}\n"
" Info support (-DENABLE_INFO) : ${_INFO}\n" " Info support (-DENABLE_INFO) : ${_INFO}\n"
" Graphical interface (-DENABLE_GUI) : ${_UI}\n" " Graphical interface (-DENABLE_GUI) : ${_UI}\n"
" OpenGL support (-DENABLE_GFX) : ${_OPENGL}\n" " OpenGL support (-DENABLE_GFX) : ${_OPENGL}\n"
" OpenGL via Mesa (-DUSE_MESA) : ${_USE_MESA}\n" " OpenGL via Mesa (-DUSE_MESA) : ${_USE_MESA}\n"
" Image Processing support (-DENABLE_IMG) : ${_IMG}\n" " Image Processing support (-DENABLE_IMG) : ${_IMG}\n"
" Shader support (-DUSE_SHADER) : ${_SHADER}\n" " Shader support (-DUSE_SHADER) : ${_SHADER}\n"
" Numpy support (-DUSE_NUMPY) : ${_NUMPY}\n" " Numpy support (-DUSE_NUMPY) : ${_NUMPY}\n"
" SpaceNav Device support (-DENABLE_SPNAV) : ${_SPNAV}\n" " SpaceNav Device support (-DENABLE_SPNAV) : ${_SPNAV}\n"
" Optimize (-DOPTIMIZE) : ${_OPT}\n" " Optimize (-DOPTIMIZE) : ${_OPT}\n"
" Profiling support (-DPROFILE) : ${_PROFILE}\n" " Profiling support (-DPROFILE) : ${_PROFILE}\n"
" Double Precision (-DUSE_DOUBLE_PRECISION) : ${_DOUBLE_PREC}\n" " Double Precision (-DUSE_DOUBLE_PRECISION) : ${_DOUBLE_PREC}\n"
" Compound Lib (-DCOMPOUND_LIB) : ${_COMP_LIB}\n" " Compound Lib (-DCOMPOUND_LIB) : ${_COMP_LIB}\n"
" TMAlign and TMScore (-DCOMPILE_TMTOOLS) : ${_TM_TOOLS}\n" " TMAlign and TMScore (-DCOMPILE_TMTOOLS) : ${_TM_TOOLS}\n"
" Static Libraries (-DENABLE_STATIC) : ${ENABLE_STATIC}\n" " Static Libraries (-DENABLE_STATIC) : ${ENABLE_STATIC}\n"
" Debian-style 'libexec' (-DDEBIAN_STYLE_LIBEXEC) : ${_DEBIAN_STYLE_LIBEXEC}" " Debian/Ubuntu directory layout (-DUBUNTU_LAYOUT) : ${_UBUNTU_LAYOUT}"
${HIDDEN_VIS_MSG}) ${HIDDEN_VIS_MSG})
...@@ -829,24 +829,21 @@ macro(setup_stage) ...@@ -829,24 +829,21 @@ macro(setup_stage)
check_architecture() check_architecture()
endif() endif()
set (ARCH ${CMAKE_NATIVE_ARCH}) set (ARCH ${CMAKE_NATIVE_ARCH})
if ("${ARCH}" MATCHES "64") if ("${ARCH}" MATCHES "64" AND NOT _UBUNTU_LAYOUT)
set(LIB_DIR lib64 ) set(LIB_DIR lib64 )
set(LIB_STAGE_PATH "${STAGE_DIR}/lib64" ) set(LIB_STAGE_PATH "${STAGE_DIR}/lib64" )
else() else()
set(LIB_DIR lib ) set(LIB_DIR lib )
set(LIB_STAGE_PATH "${STAGE_DIR}/lib" ) set(LIB_STAGE_PATH "${STAGE_DIR}/lib" )
endif() endif()
if (_DEBIAN_STYLE_LIBEXEC) if (_UBUNTU_LAYOUT)
set(LIBEXEC_PATH ${LIB_DIR}/openstructure/libexec ) set(LIBEXEC_PATH ${LIB_DIR}/openstructure/libexec )
else()
set(LIBEXEC_PATH libexec/openstructure )
endif()
if (_DEBIAN_STYLE_LIBEXEC)
set(LIBEXEC_STAGE_PATH ${LIB_STAGE_PATH}/openstructure/libexec ) set(LIBEXEC_STAGE_PATH ${LIB_STAGE_PATH}/openstructure/libexec )
else() else()
set(LIBEXEC_PATH libexec/openstructure )
set(LIBEXEC_STAGE_PATH ${STAGE_DIR}/libexec/openstructure ) set(LIBEXEC_STAGE_PATH ${STAGE_DIR}/libexec/openstructure )
endif() endif()
include_directories("${HEADER_STAGE_PATH}") include_directories("${HEADER_STAGE_PATH}")
link_directories(${LIB_STAGE_PATH}) link_directories(${LIB_STAGE_PATH})
......
...@@ -57,10 +57,10 @@ if (FFTW_USE_THREADS) ...@@ -57,10 +57,10 @@ if (FFTW_USE_THREADS)
else() else()
set(fftw_use_threads 0) set(fftw_use_threads 0)
endif() endif()
if (_DEBIAN_STYLE_LIBEXEC) if (_UBUNTU_LAYOUT)
set(debian_style_libexec 1) set(ubuntu_layout 1)
else() else()
set(debian_style_libexec 0) set(ubuntu_layout 0)
endif() endif()
if (ENABLE_INFO) if (ENABLE_INFO)
set(info_enabled 1) set(info_enabled 1)
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
#define OST_STATIC_PROPERTY_WORKAROUND @static_props@ #define OST_STATIC_PROPERTY_WORKAROUND @static_props@
#define OST_FFT_USE_THREADS @fftw_use_threads@ #define OST_FFT_USE_THREADS @fftw_use_threads@
#define OST_NUMPY_SUPPORT_ENABLED @numpy_support@ #define OST_NUMPY_SUPPORT_ENABLED @numpy_support@
#define OST_DEBIAN_STYLE_LIBEXEC @debian_style_libexec@ #define OST_UBUNTU_LAYOUT @ubuntu_layout@
#define OST_INFO_ENABLED @info_enabled@ #define OST_INFO_ENABLED @info_enabled@
#endif #endif
...@@ -82,7 +82,7 @@ String get_ost_root() ...@@ -82,7 +82,7 @@ String get_ost_root()
{ {
QDir dir(QApplication::applicationDirPath()); QDir dir(QApplication::applicationDirPath());
#if OST_DEBIAN_STYLE_LIBEXEC #if OST_UBUNTU_LAYOUT
#ifdef _MSC_VER #ifdef _MSC_VER
dir.cdUp(); dir.cdUp();
dir.cdUp(); dir.cdUp();
...@@ -111,7 +111,7 @@ String setup_python_search_path(const String& root, PythonInterpreter& pi) ...@@ -111,7 +111,7 @@ String setup_python_search_path(const String& root, PythonInterpreter& pi)
#ifdef _MSC_VER #ifdef _MSC_VER
String loc=root+"\\lib\\"+site_pkgs.str()+"\\site-packages"; String loc=root+"\\lib\\"+site_pkgs.str()+"\\site-packages";
#else #else
# if (defined(__ppc64__) || defined(__x86_64__)) && !defined(__APPLE__) # if (defined(__ppc64__) || defined(__x86_64__)) && !defined(__APPLE__) && !OST_UBUNTU_LAYOUT
String loc=root+"/lib64/"+site_pkgs.str()+"/site-packages"; String loc=root+"/lib64/"+site_pkgs.str()+"/site-packages";
# else # else
String loc=root+"/lib/"+site_pkgs.str()+"/site-packages"; String loc=root+"/lib/"+site_pkgs.str()+"/site-packages";
......
...@@ -29,6 +29,9 @@ if (NOT ENABLE_STATIC) ...@@ -29,6 +29,9 @@ if (NOT ENABLE_STATIC)
endif() endif()
endif() endif()
script(NAME ost_startup.py INPUT ost_startup.py.in SUBSTITUTE ${SUBST_DICT}
TARGET ost_scripts OUTPUT_DIR "${LIB_DIR}/python${PYTHON_VERSION}/site-packages/ost" )
set(INIT_SCRIPTS set(INIT_SCRIPTS
ost_startup.py ost_startup.py
) )
......
...@@ -28,10 +28,7 @@ parser.disable_interspersed_args() ...@@ -28,10 +28,7 @@ parser.disable_interspersed_args()
_site_packs='python%d.%d/site-packages' % sys.version_info[0:2] _site_packs='python%d.%d/site-packages' % sys.version_info[0:2]
_base_dir=os.getenv('DNG_ROOT') _base_dir=os.getenv('DNG_ROOT')
if platform.machine()=='x86_64' and platform.system()!='Darwin' : sys.path.insert(0, os.path.join(_base_dir, '@LIBDIR@', _site_packs))
sys.path.insert(0, os.path.join(_base_dir, 'lib64', _site_packs))
else:
sys.path.insert(0,os.path.join(_base_dir, 'lib', _site_packs))
from ost import * from ost import *
import ost import ost
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment