Below the variables you will need are mentioned:
# If you'd like to specify the installation of Python to use, you
should modify
# the following cache variables:
# PYTHON_LIBRARY - path to the python library
# PYTHON_INCLUDE_DIR - path to where Python.h is found
Maybe you need also specify (FindPythonInterp)
# PYTHON_EXECUTABLE - path to the Python interpreter
to select the matching Python interpreter.
Thomas
Use the GUI. There is see all parameters/options and can change them
easily (much much easily IMHO than on the command line).
Am Samstag, 19. Januar 2013 um 15:20:03, schrieb Harry van der Wolf <hvd...@gmail.com>
> 2013/1/19 T. Modes <Thomas...@gmx.de>
>
> >
> > Below the variables you will need are mentioned:
> > # If you'd like to specify the installation of Python to use, you
> > should modify
> > # the following cache variables:
> > # PYTHON_LIBRARY - path to the python library
> > # PYTHON_INCLUDE_DIR - path to where Python.h is found
> >
> > Maybe you need also specify (FindPythonInterp)
> > # PYTHON_EXECUTABLE - path to the Python interpreter
> > to select the matching Python interpreter.
> >
> > Thomas
> >
>
>
> Thanks.
> I now used:
> cmake .. -DBUILD_HSI:BOOL=ON -DSWIG_EXECUTABLE=/usr/bin/swig2.0
> -DCMAKE_BUILD_TYPE=RelWithDebInfo
> -DPYTHON_INCLUDE_DIR="/usr/include/python2.7"
> -DPYTHON_LIBRARY="/usr/lib/libpython2.7.so.1"
> -DPYTHON_EXECUTABLE="/usr/bin/python2
I am curious, why '-DSWIG_EXECUTABLE=/usr/bin/swig2.0' is needed?
In CMakeLists.txt:341, we already search for swig
find_program(SWIG_EXECUTABLE NAMES swig2.0 swig)
> This compiles fine.
>
> The following also compiles and builds fine.
> cmake .. -DBUILD_HSI:BOOL=ON -DSWIG_EXECUTABLE=/usr/bin/swig2.0
> -DCMAKE_BUILD_TYPE=RelWithDebInfo
> -DPYTHON_INCLUDE_DIR="/usr/include/python3.2"
> -DPYTHON_LIBRARY="/usr/lib/libpython3.2mu.so.1"
> -DPYTHON_EXECUTABLE="/usr/bin/python3"
>
>
>
> 2013/1/19 T. Modes <Thomas...@gmx.de>
>
> > Use the GUI. There is see all parameters/options and can change them
> > easily (much much easily IMHO than on the command line).
> >
>
>
> I didn't even know there was a gui.
You cane even start the gui from the build-directory with:
#make edit_cache
> It doesn't give me options for PYTHON*
> unless I set the "advanced" checkbox. So after configure/generate the unix
> makefiles are generated.
> And then I need to leave to gui to run make: how weird!
The gui is only a wrapper for the cmake-call with all the params.
> I know you use cmake to configure and then make to make but why not a
> complete gui? Coming from Mac OS X, with a no doubt excellent user-friendly
> design, such a gui design decision is for me utter nonsence.
> Anyway: the gui does the job correctly as well and when running make
> (actually make -j 3), the job gets done correctly.
>
> Now that I've found the correct settings I will update the wiki (
> http://wiki.panotools.org/Hugin_Compiling_Ubuntu) for mixed environments
> like I curently have.
>
...
> Harry
Kornel
> I now used:> cmake .. -DBUILD_HSI:BOOL=ON -DSWIG_EXECUTABLE=/usr/bin/swig2.0
> -DCMAKE_BUILD_TYPE=RelWithDebInfo
> -DPYTHON_INCLUDE_DIR="/usr/include/python2.7"
> -DPYTHON_LIBRARY="/usr/lib/libpython2.7.so.1"
> -DPYTHON_EXECUTABLE="/usr/bin/python2
I am curious, why '-DSWIG_EXECUTABLE=/usr/bin/swig2.0' is needed?
In CMakeLists.txt:341, we already search for swig
find_program(SWIG_EXECUTABLE NAMES swig2.0 swig)
> This compiles fine.
>
> The following also compiles and builds fine.
> cmake .. -DBUILD_HSI:BOOL=ON -DSWIG_EXECUTABLE=/usr/bin/swig2.0
> -DCMAKE_BUILD_TYPE=RelWithDebInfo
> -DPYTHON_INCLUDE_DIR="/usr/include/python3.2"
> -DPYTHON_LIBRARY="/usr/lib/libpython3.2mu.so.1"
> -DPYTHON_EXECUTABLE="/usr/bin/python3"
>
>
>
> 2013/1/19 T. Modes <Thomas...@gmx.de>
>
> > Use the GUI. There is see all parameters/options and can change them
> > easily (much much easily IMHO than on the command line).
> >
>
>
> I didn't even know there was a gui.
You cane even start the gui from the build-directory with:
#make edit_cache
Am Samstag, 19. Januar 2013 um 15:51:58, schrieb Harry van der Wolf <hvd...@gmail.com>
...
> > You cane even start the gui from the build-directory with:
> >
> > #make edit_cache
> >
> >
> >
> Thanks! I learn every day.
>
>
> I will dive into this cmake gui a little more. It might be THE way to build
> hugin on OS X with cmake instead of with XCode (and maybe not, but I will
> see).
>
> Harry
Since you are on ubuntu, you could also try
#cmake ... -DCPACK_BINARY_DEB:BOOL=ON ...
#make package
#sudo dpkg -i hugin-2012.1.0.6107-Linux.deb
Kornel
Am Samstag, 19. Januar 2013 um 16:37:32, schrieb Harry van der Wolf <hvd...@gmail.com>
We could here change the search for PythonLibs at CMakeLists.txt:314 to
FIND_PACKAGE(PythonLibs 2.7 REQUIRED)
> And that also works and is even simpler. Thanks as well.
>
> (I lost count of all the compilation runs I've done by now)
:)
> Harry
>
Kornel
Am Samstag, 19. Januar 2013 um 16:37:32, schrieb Harry van der Wolf <hvd...@gmail.com>
We could here change the search for PythonLibs at CMakeLists.txt:314 to
FIND_PACKAGE(PythonLibs 2.7 REQUIRED)
Am Samstag, 19. Januar 2013 um 16:51:44, schrieb Harry van der Wolf <hvd...@gmail.com>
> 2013/1/19 Kornel Benko <Kornel...@berlin.de>
>
> > **
Good point. We could make it depend on
find_program(PYTHON_EXE python3 python)
if(PYTHON_EXE_FOUND)
execute_process(COMMAND ${PYTHON_EXE} --version OUTPUT_VARIABLE P_VERS)
if(${P_VERS} MATCHES "Python \([0-9]+\\.[0-9]+[\\.0-9]*\)")
set(SEARCHP_VERS ${CMAKE_MATCH_1})
else()
set(SEARCHP_VERS)
endif()
find_package(PythonLibs ${SEARCHP_VERS} REQUIRED)
else()
message(FATAL_ERROR "Python required")
endif()
> Harry
Kornel
Am Samstag, 19. Januar 2013 um 09:37:52, schrieb T. Modes <Thomas...@gmx.de>
> @Kornel
> >
> > Good point. We could make it depend on
> > find_program(PYTHON_EXE python3 python)
> >
>
> Then you prefer Python3 before 2.x. And selecting a 2.x serie with
> installed 3.x will not be possible.
Yes.
> FindPythonLib and FindPythonInterpr handle both series. This is not
> the case with your approach.
I don't know FindPythonInterpr. Ähm, now I see FindPythonInterp.cmake. This is nice.
So
find_package(PythonInterp REQUIRED) #gives PYTHON_EXECUTABLE + PYTHON_VERSION_STRING
find_package(PythonLibs ${PYTHON_VERSION_STRING} REQUIRED)
would do?
> Also your approach will fail, if python is not in the path environment
> variable. FindPythonIntpr handle also this case.
I don't see it. If python is not on system path also FindPythonIntp fails.
But it handles more cases, so I prefer it too.
> So I think the
> approach with the switch at the command line is working for the time
> being.
But the opportunity to set it now correctly is good IMHO. And setting
-DPYTHON_EXECUTABLE=... -DPythonLibs_FIND_VERSION=...
were still possible.
> @Harry
> The CMake GUI can also generate project files for different IDE (MSVC,
> KDevelop, CodeBlocks, XCode, ...) and also for makefile. So starting
> the build process from the CMake GUI would be complicated and needed
> to adopt to all different IDE. I don't know if all IDE support this
> approach. So from this point of view I understand that they did not
> add this feature to the GUI.
>
> Thomas
>
Kornel
Am Sonntag, 20. Januar 2013 um 00:59:59, schrieb T. Modes <Thomas...@gmx.de>
OK, so we should remove the code from src/hugin_script_interface/CMakeLists.txt:206
and patch the top most CMakeLists.txt
IF(BUILD_HSI)
...
if(WIN32)
find_package(PythonLibs REQUIRED)
else()
# Linux/MacOS
find_package(PythonInterp REQUIRED)
find_package(PythonLibs ${PYTHON_VERSION_STRING} REQUIRED)
endif()
...
endif()
> Thomas
Kornel