Skip to content
Snippets Groups Projects
Commit 20aef88f authored by Attila Krasznahorkay's avatar Attila Krasznahorkay Committed by Graeme Stewart
Browse files

Introduced FindJava.cmake (AtlasLCG-00-00-77)

	* Created a FindJava.cmake module to wrap CMake's FindJava.cmake.
	  Now that LCG actually comes with Java included.
	* This is to replace using FindJavaSDK.cmake that is in AtlasCMake.
	  But for the moment that module is also kept alive to allow clients
	  to migrate to this new module at their own pace.
	* Tagging as AtlasLCG-00-00-77

2016-11-29 Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch>
	* Updated FindPythonLibs.cmake and FindPythonInterp.cmake to
	  set PYTHONHOME forcefully. To be able to fix a wrong setting
	  picked up by some base project, in a higher level project.
	* Tagging as AtlasLCG-00-00-76


Former-commit-id: 74aa21629c19c843fbcac86a2e3e3f636b646f11
parent 4a140174
No related branches found
No related tags found
No related merge requests found
# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration # Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
# $Id: LCGConfig.cmake 769797 2016-08-24 10:03:31Z krasznaa $ # $Id: LCGConfig.cmake 790613 2016-12-20 14:56:58Z krasznaa $
# #
# File implementing the code that gets called when a project imports # File implementing the code that gets called when a project imports
# LCG using something like: # LCG using something like:
...@@ -403,6 +403,7 @@ if( NOT LCG_VERSION EQUAL 0 ) ...@@ -403,6 +403,7 @@ if( NOT LCG_VERSION EQUAL 0 )
list( APPEND CMAKE_PREFIX_PATH ${COIN3D_ROOT} ) list( APPEND CMAKE_PREFIX_PATH ${COIN3D_ROOT} )
list( APPEND CMAKE_PREFIX_PATH ${EXPAT_ROOT} ) list( APPEND CMAKE_PREFIX_PATH ${EXPAT_ROOT} )
set( TCMALLOC_ROOT ${GPERFTOOLS_ROOT} ) set( TCMALLOC_ROOT ${GPERFTOOLS_ROOT} )
set( JAVA_HOME ${JAVA_ROOT} )
endif() endif()
......
# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
# $Id: FindJava.cmake 790613 2016-12-20 14:56:58Z krasznaa $
#
# This file is here to intercept find_package(Java) calls, and
# massage the paths produced by the system module, to make them relocatable.
#
# The LCG include(s):
include( LCGFunctions )
# Temporarily clean out CMAKE_MODULE_PATH, so that we could pick up
# FindJava.cmake from CMake:
set( _modulePathBackup ${CMAKE_MODULE_PATH} )
set( CMAKE_MODULE_PATH )
# Make the code ignore the system path(s):
if( JAVA_ROOT )
set( CMAKE_SYSTEM_IGNORE_PATH /usr/include /usr/bin /usr/lib /usr/lib32
/usr/lib64 )
endif()
# Call CMake's own FindJava.cmake. Note that the arguments created
# for this script by CMake pass through to the official script. So we don't
# need to give any extra arguments to this call.
find_package( Java )
# Restore CMAKE_MODULE_PATH:
set( CMAKE_MODULE_PATH ${_modulePathBackup} )
unset( _modulePathBackup )
set( CMAKE_SYSTEM_IGNORE_PATH )
# Massage the paths found by the system module:
if( Java_FOUND AND NOT GAUDI_ATLAS )
# Set up the include path(s) for Java:
set( _newIncludes )
foreach( _inc ${Java_INCLUDE_DIRS} )
set( _relocatableDir ${_inc} )
_lcg_make_paths_relocatable( _relocatableDir )
list( APPEND _newIncludes
$<BUILD_INTERFACE:${_inc}>
$<INSTALL_INTERFACE:${_relocatableDir}> )
unset( _relocatableDir )
endforeach()
set( Java_INCLUDE_DIRS ${_newIncludes} )
unset( _newIncludes )
# Set up the libraries for Java:
set( Java_LIBRARY_DIRS )
set( _newLibraries )
foreach( _lib ${Java_LIBRARIES} )
get_filename_component( _libDir "${_lib}" PATH )
set( _relocatableDir ${_libDir} )
_lcg_make_paths_relocatable( _relocatableDir )
list( APPEND Java_LIBRARY_DIRS
$<BUILD_INTERFACE:${_libDir}>
$<INSTALL_INTERFACE:${_relocatableDir}> )
unset( _relocatableDir )
set( _relocatableLib ${_lib} )
_lcg_make_paths_relocatable( _relocatableLib )
list( APPEND _newLibraries
$<BUILD_INTERFACE:${_lib}>
$<INSTALL_INTERFACE:${_relocatableLib}> )
unset( _relocatableLib )
endforeach()
set( Java_LIBRARIES ${_newLibraries} )
unset( _newLibraries )
endif()
# Set up the RPM dependency:
lcg_need_rpm( java FOUND_NAME Java VERSION_NAME JAVA )
# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration # Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
# $Id: FindPythonInterp.cmake 782719 2016-11-07 12:30:42Z limosani $ # $Id: FindPythonInterp.cmake 787095 2016-11-29 13:47:14Z krasznaa $
# #
# This file is here to intercept find_package(PythonInterp) calls, and extend # This file is here to intercept find_package(PythonInterp) calls, and extend
# the environment setup file of the project with the correct Python paths. # the environment setup file of the project with the correct Python paths.
...@@ -36,7 +36,7 @@ if( PYTHON_EXECUTABLE ) ...@@ -36,7 +36,7 @@ if( PYTHON_EXECUTABLE )
get_filename_component( PythonInterp_BINARY_PATH ${PYTHON_EXECUTABLE} PATH ) get_filename_component( PythonInterp_BINARY_PATH ${PYTHON_EXECUTABLE} PATH )
get_filename_component( PYTHONHOME ${PythonInterp_BINARY_PATH} PATH ) get_filename_component( PYTHONHOME ${PythonInterp_BINARY_PATH} PATH )
set ( PythonInterp_ENVIRONMENT set ( PythonInterp_ENVIRONMENT
SET PYTHONHOME ${PYTHONHOME} ) FORCESET PYTHONHOME ${PYTHONHOME} )
endif() endif()
......
# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration # Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
# $Id: FindPythonLibs.cmake 782719 2016-11-07 12:30:42Z limosani $ # $Id: FindPythonLibs.cmake 787095 2016-11-29 13:47:14Z krasznaa $
# #
# This file is here to intercept find_package(PythonLibs) calls, and # This file is here to intercept find_package(PythonLibs) calls, and
# massage the paths produced by the system module, to make them relocatable. # massage the paths produced by the system module, to make them relocatable.
...@@ -72,7 +72,7 @@ if( PYTHONLIBS_FOUND AND NOT GAUDI_ATLAS ) ...@@ -72,7 +72,7 @@ if( PYTHONLIBS_FOUND AND NOT GAUDI_ATLAS )
get_filename_component( PYTHONHOME ${PYTHONLIBS_LIBRARY_DIRS} PATH ) get_filename_component( PYTHONHOME ${PYTHONLIBS_LIBRARY_DIRS} PATH )
set( PythonLibs_ENVIRONMENT set( PythonLibs_ENVIRONMENT
SET PYTHONHOME ${PYTHONHOME} ) FORCESET PYTHONHOME ${PYTHONHOME} )
endif() endif()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment