From 5036c13b8835a4b5411074b13ca85d27407b16d1 Mon Sep 17 00:00:00 2001 From: Doug Barker Date: Wed, 6 Mar 2013 01:50:39 -0500 Subject: [PATCH 01/13] Added basic cmake build structure and fixed a few compile errors on linux --- CMakeLists.txt | 39 +++++++++++++++++++++++++ INSTALL.rst | 37 ++++++++++++++++++++++++ src_c/CMakeLists.txt | 69 ++++++++++++++++++++++++++++++++++++++++++++ src_c/globals.h | 2 +- src_c/tools.c | 2 +- 5 files changed, 147 insertions(+), 2 deletions(-) create mode 100644 CMakeLists.txt create mode 100644 src_c/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..2651072 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,39 @@ +# Main CMakeLists file +cmake_minimum_required (VERSION 2.8) + +project (3dptv_solution) + +set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}") +set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin) +# Add definitions and Find TIFF + +if (WIN32) + add_definitions( -D_CONSOLE -D_CRT_SECURE_NO_WARNINGS ) + set(TIFF_LIBRARY "${CMAKE_SOURCE_DIR}/src_c/libtiff.lib") +else() + set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} "/opt/ActiveTcl-8.4") + set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} "/usr/lib") + find_package( TIFF REQUIRED ) +endif() + +# Find TCL/TK +find_package( TCL REQUIRED 8.4) + +if (TCLTK_FOUND ) + message(STATUS "TCL INCLUDE: " ${TCL_INCLUDE_PATH}) + message(STATUS "TCL LIB: " ${TCL_LIBRARY}) + message(STATUS "TK INCLUDE: " ${TCL_INCLUDE_PATH}) + message(STATUS "TK LIB: " ${TK_LIBRARY}) + link_directories( ${TCL_LIBRARY} ${TK_LIBRARY} ) + include_directories( ${TCL_INCLUDE_PATH} ${TK_INCLUDE_PATH} ) +endif() + +set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MT") +set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MTd") +set(CMAKE_C_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MT") +set(CMAKE_C_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MTd") + +message(STATUS "gathering ptv tcl files:") +file(GLOB ptv_tcl "${CMAKE_SOURCE_DIR}/src_tcl/*.tcl") + +add_subdirectory("${CMAKE_SOURCE_DIR}/src_c") diff --git a/INSTALL.rst b/INSTALL.rst index 5ec84a6..6f5b1aa 100644 --- a/INSTALL.rst +++ b/INSTALL.rst @@ -45,5 +45,42 @@ Compilation from source on _nix platforms 1. Read https://github.com/3dptv/3dptv/blob/master/install_nix.md +Multi-platform build using CMake +----------------------------------------- +1. Download and install CMake (version 2.8 or higher) + + http://www.cmake.org/cmake/resources/software.html + +2. Download and install ActiveTCL 8.4 for the desired platform + + http://www.activestate.com/activetcl/downloads + +3. (linux systems) Download and install gcc and libtiff + + -- for Ubuntu run the following in a bash shell + sudo apt-get install build-essential + sudo apt-get install libtiff-dev + +4. create a build directory inside the main 3dptv directory (3dptv/build) +5. Run CMake and generate the project or make files + + a. start the cmake-gui from the desktop shortcut or program list + - alternatively run the following in a bash shell + cd + + b. browse for the source directory: 3dptv/ + + c. browse for the build directory just created: 3dptv/build/ + + d. click configure + + Note: if an error occurs saying that libtiff or ActiveTCL cannot be found + click on the entry in the "value" column and browse for the libraries' "include" and "lib" directories + Click configure again to locate the libraries. If any rows appear red, click configure once more. + + e. click generate to create the project files (Visual studio) or make files (linux) + +6. Run Visual Studio and open the solution file in 3dptv/build/ or run make from within the build directory to compile the code. + --The executable will be generated and placed inside 3dptv/build/bin/ \ No newline at end of file diff --git a/src_c/CMakeLists.txt b/src_c/CMakeLists.txt new file mode 100644 index 0000000..3f0df59 --- /dev/null +++ b/src_c/CMakeLists.txt @@ -0,0 +1,69 @@ +# This is the 3dptv/src_c CMakeLists.txt file + +message(STATUS "gathering ptv project files from 3dptv/src_c/:") + +set(TARGET_NAME "3dptv") + +# gather the header files + +file ( GLOB ptv_hdrs +globals.h +ptv.h +tcl.h +tiff.h +tiffio.h +tiffvers.h +tk.h +typedefs.h +) + +# gather the source files + +file ( GLOB ptv_srcs +change_parameter.c +checkpoints.c +correspondences.c +demo.c +draw.c +epi.c +image_processing.c +imgcoord.c +intersect.c +jw_ImgFmtTIF.c +jw_main.c +jw_ptv.c +lsqadj.c +mousefunction.c +multimed.c +orientation.c +peakfitting.c +pointpos.c +ptv.c +ray_tracing.c +resource1.h +resource2.h +rotation.c +segmentation.c +sortgrid.c +tools.c +track.c +trafo.c +ttools.c +vrml.c +) + +# organize the files into folders inside the project + +source_group("Header Files" FILES ${ptv_hdrs}) +source_group("Source Files" FILES ${ptv_srcs}) +source_group("Tcl Files" FILES ${ptv_tcl}) + +add_executable(${TARGET_NAME} ${ptv_srcs} ${ptv_hdrs} ${ptv_tcl} ) + +if(WIN32) + set_target_properties(${TARGET_NAME} PROPERTIES LINKER_LANGUAGE C) + set_target_properties(${TARGET_NAME} PROPERTIES LINK_FLAGS "/NODEFAULTLIB:libc") +endif() + +set(EXTRA_LIBS ${EXTRA_LIBS} ${TCL_LIBRARY} ${TK_LIBRARY} ${TIFF_LIBRARY}) +target_link_libraries(${TARGET_NAME} ${EXTRA_LIBS} ) \ No newline at end of file diff --git a/src_c/globals.h b/src_c/globals.h index 91e15e0..1b682be 100644 --- a/src_c/globals.h +++ b/src_c/globals.h @@ -252,7 +252,7 @@ void sortgrid_file (Tcl_Interp* interp, Exterior Ex, Interior I, Glass G, ap_52 // --- tools.c --- void write_ori (Exterior Ex, Interior I, Glass G, char filename[64]); int read_ori (Exterior *Ex, Interior *I, Glass *G, char filename[64]); -FILE *fopen_r (CHAR filename[256]); +FILE *fopen_r (char filename[256]); FILE *fopen_rp (char *filename); int read_image (Tcl_Interp* interp, char path[128], unsigned char *img); int write_tiff (const char path[256], unsigned char *data, int nx, int ny); diff --git a/src_c/tools.c b/src_c/tools.c index c5f02e3..1838dfe 100644 --- a/src_c/tools.c +++ b/src_c/tools.c @@ -66,7 +66,7 @@ FILE *fopen_rp (char *filename) return (fp); } -FILE *fopen_r (CHAR filename[256]) +FILE *fopen_r (char filename[256]) /* tries to open a file; gives a message, if it cannot open it and waits until it has been created */ From b790dde66af5e76164ffcdc66b7cb3de4f26fe0d Mon Sep 17 00:00:00 2001 From: Alex Liberzon Date: Fri, 8 Mar 2013 10:18:46 +0200 Subject: [PATCH 02/13] Update README link to the updated INSTALL.TXT --- README | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README b/README index 1dece95..087b19b 100644 --- a/README +++ b/README @@ -9,7 +9,7 @@ If you want to use the source code and contribute to the project: Installation instructions: --------------------------- -https://github.com/3dptv/3dptv/blob/master/INSTALL.rst +https://github.com/dbarker/3dptv/blob/master/INSTALL.rst From a10dd66ebfb65cd30c206a8a260b3791590bb255 Mon Sep 17 00:00:00 2001 From: Alex Liberzon Date: Fri, 8 Mar 2013 21:36:07 +0200 Subject: [PATCH 03/13] jw_ImgFmtTIFF.c is ready for Tcl/Tk 8.6, CmakeLists.txt require Tcl/Tk 8.6 and we ignore the build/ directory --- .gitignore | 7 ++----- CMakeLists.txt | 2 +- src_c/jw_ImgFmtTIF.c | 4 ++-- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index cefd9cd..fff9e63 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,3 @@ - -src_c/homemakefile - [Dd]ebug/ [Rr]elease/ ipch/ @@ -8,5 +5,5 @@ ipch/ *.suo *.exe *.ilk -*.pdb - +*.pdb +build/ diff --git a/CMakeLists.txt b/CMakeLists.txt index 2651072..5565688 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,7 +17,7 @@ else() endif() # Find TCL/TK -find_package( TCL REQUIRED 8.4) +find_package( TCL REQUIRED 8.6) if (TCLTK_FOUND ) message(STATUS "TCL INCLUDE: " ${TCL_INCLUDE_PATH}) diff --git a/src_c/jw_ImgFmtTIF.c b/src_c/jw_ImgFmtTIF.c index ba3a7f5..6da724e 100644 --- a/src_c/jw_ImgFmtTIF.c +++ b/src_c/jw_ImgFmtTIF.c @@ -321,7 +321,7 @@ int FileReadTIF(Tcl_Interp *interp, printf("\nFileReadTIF: block.pixelSize = %d", block.pixelSize); printf("\nFileReadTIF: scanline size = %d", TIFFScanlineSize(tif)); */ - Tk_PhotoExpand(imageHandle, destX + width, destY + height); + Tk_PhotoExpand(interp,imageHandle, destX + width, destY + height); /* if (srcY > 0) { @@ -365,7 +365,7 @@ int FileReadTIF(Tcl_Interp *interp, } block.height = nLines; - Tk_PhotoPutBlock(imageHandle, &block, destX, destY, width, nLines, TK_PHOTO_COMPOSITE_SET); + Tk_PhotoPutBlock(interp,imageHandle, &block, destX, destY, width, nLines, TK_PHOTO_COMPOSITE_SET); destY += nLines; } From 8c0789daa8eef25002f748cacfaa4b9a0261e980 Mon Sep 17 00:00:00 2001 From: Alex Liberzon Date: Fri, 8 Mar 2013 21:53:02 +0200 Subject: [PATCH 04/13] updated INSTALL.rst, README and removed obsolete instructions for _nix installation --- INSTALL.rst | 87 ++++++++++------------------------ README | 2 +- install_nix.md | 125 ------------------------------------------------- 3 files changed, 26 insertions(+), 188 deletions(-) delete mode 100644 install_nix.md diff --git a/INSTALL.rst b/INSTALL.rst index 6f5b1aa..ab2d38e 100644 --- a/INSTALL.rst +++ b/INSTALL.rst @@ -1,86 +1,49 @@ -Prerequisities ---------------- - -1. Download and install ActiveTCL 8.4 ( not 8.5 or 8.6) e.g. -http://downloads.activestate.com/ActiveTcl/releases/8.4.19.6/ActiveTcl8.4.19.6.295590-win32-ix86-threaded.exe - - - Install it to ``C:\Tcl`` (the path is important) - - - -Download the pre-compiled binary for Windows 32- or 64-bit platform ---------------------- - - -1. If you use 32bit or 64 bit Windows platform you can use the binary distributions: - - 1. download the executable file from: https://github.com/3dptv/3dptv/downloads (Tcl/Tk 8.4 has to be installed), save it as ``C:\PTV\3dptv.exe`` - 2. download the test folder https://github.com/downloads/3dptv/3dptv/test.zip, extract it to ``C:\PTV\test`` and test the software by running the ``C:\PTV\test\start.bat`` - -2. If you use another platform or you want to compile from the source, download the latest snapshot: -https://github.com/3dptv/3dptv/zipball/master - - -Compilation instructions from source on Windows platform ------------- - -1. If you want to compile from the source code on Windows, you recommend downloading the Visual C++ 2010 Express http://www.microsoft.com/visualstudio/en-us/products/2010-editions/visual-cpp-express - - Important note for the first-time installation - RESTART YOUR WINDOWS after installing the ActiveTcl and Visual C++ - -2. Double-click the ``3dptv_vc2010.sln`` to open the 3DPTV package in Visual C++ 2010 Express. - -3. If all the paths are the same as ours, Build the solution and you should see the 3DPTV software up and running - -If you use different paths it is important to: - a. add ``\Tcl\Include`` to the list of included directories - b. add ``\Tcl\tcl84.lib`` and ``\Tcl\tk84.lib`` to the additional libraries - c. on Windows XP it is important to ignore ``LIBC.LIB`` and also to use ``MFC as Static Library`` - - -Compilation from source on _nix platforms ------------------------------------------ - -1. Read https://github.com/3dptv/3dptv/blob/master/install_nix.md - - Multi-platform build using CMake ----------------------------------------- 1. Download and install CMake (version 2.8 or higher) - http://www.cmake.org/cmake/resources/software.html + http://www.cmake.org/cmake/resources/software.html -2. Download and install ActiveTCL 8.4 for the desired platform +2. Download and install ActiveTCL for the desired platform - http://www.activestate.com/activetcl/downloads + http://www.activestate.com/activetcl/downloads -3. (linux systems) Download and install gcc and libtiff +3. (Linux systems) Download and install gcc and libtiff -- for Ubuntu run the following in a bash shell - sudo apt-get install build-essential - sudo apt-get install libtiff-dev + + sudo apt-get install build-essential + sudo apt-get install libtiff-dev + +on Mac OS X is recommended to install libtiff using Homebrew: + brew install libtiff -4. create a build directory inside the main 3dptv directory (3dptv/build) +4. create a build directory inside the main 3dptv directory (```3dptv/build```) 5. Run CMake and generate the project or make files - a. start the cmake-gui from the desktop shortcut or program list - - alternatively run the following in a bash shell - cd + a. start the ```cmake-gui``` from the desktop shortcut or program list + - alternatively run the following in a bash shell + ```cd``` + b. browse for the source directory: ```3dptv/``` - b. browse for the source directory: 3dptv/ + c. browse for the build directory just created: ```3dptv/build/``` - c. browse for the build directory just created: 3dptv/build/ - - d. click configure + d. click ```configure``` (on Mac OS X choose the following options: UNIX makefiles, native compilers) Note: if an error occurs saying that libtiff or ActiveTCL cannot be found click on the entry in the "value" column and browse for the libraries' "include" and "lib" directories - Click configure again to locate the libraries. If any rows appear red, click configure once more. + Click ```configure``` again to locate the libraries. If any rows appear red, click configure once more. e. click generate to create the project files (Visual studio) or make files (linux) 6. Run Visual Studio and open the solution file in 3dptv/build/ or run make from within the build directory to compile the code. - --The executable will be generated and placed inside 3dptv/build/bin/ \ No newline at end of file + --The executable will be generated and placed inside 3dptv/build/bin/ + +7. Run the software from the ```test``` folder with a link to ```ptv.tcl``` as an input: + + cd 3dptv/test + ../build/bin/3dptv ../ptv.tcl + \ No newline at end of file diff --git a/README b/README index 1dece95..afcc05a 100644 --- a/README +++ b/README @@ -9,7 +9,7 @@ If you want to use the source code and contribute to the project: Installation instructions: --------------------------- -https://github.com/3dptv/3dptv/blob/master/INSTALL.rst +[](./INSTALL.rst) diff --git a/install_nix.md b/install_nix.md deleted file mode 100644 index c924d7a..0000000 --- a/install_nix.md +++ /dev/null @@ -1,125 +0,0 @@ -Installation and Handling of the PTV-Software -============================================= - -The ptvmanual.pdf contains information to use the -software and gives a description of the input data -file which have to be provided. - - -The test data set contains the following: -
-
-Cam1*                   Cam3.addpar*            man_ori.dat*
-Cam1.addpar*            Cam3.ori*               parameters/
-Cam1.ori*               Cam4*                   ptvmanual.pdf*
-Cam2*                   Cam4.addpar*            res/
-Cam2.addpar*            Cam4.ori*               start.bat*
-Cam2.ori*               calFieldApril.txt*
-Cam3*                   img/
-
-
- -images for calibration, camera orientation data, files for -additional parameters as well as the coordinate file of the -points on the reference. -In man_ori.dat the manually measured image coordinates for -the pre-orientation (for calibration purpose) are stored. - -* subdirectory ```/img``` contains the image sequences -* subdirectory ```/res``` for storage of results -& subdirectory ```/parameters``` contains the parameter files - -The data mentioned above are the data for the experiment itself. -To avoid confusion this data should be kept separated to the -software data! - -The software for PTV is stored under /tk84ptv. -To start the software >> click double on start.bat, which establishes -the link to the software. Project and software data should not be -confused. To start the software it is sufficient that a start.bat-file, -thus the software (and code) can be stored independently. - - -Tcl/Tk-Installation -------------------- - -The install executable for Tcl/Tk is ActiceTcl8.4.2-win32-ix86.exe -in this directory. Or can be downloaded from a webpage. - -Download under http://downloads.activestate.com/ActiveTcl/Windows/8.4.2/ - -After installing Tcl/Tk 8.4.2 all files with extension *.tcl should -appear with the Tcl/Tk-symbol (feather). Otherwise repeat installation. -Make sure that the flag for the extensions (*.tcl) is included in the -path. Otherwise not all needed dll-files can be found from arbitrary -directories on the PC. - - -Compilation of the source code of PTV --------------------------------------- - -In the /tk84ptv directory You will find the following data: -
-index		script to generate tclIndex (/ might be missing in the generated tclIndex!)
-ptv.tcl		main script to start graphical user interface (Windows)
-ptvunix.tcl	dito for Unix
-start		start file for Unix
-tclIndex	Index with relative paths to Tcl functions
-/src_c		source code directory
-/src_tcl	tcl script directory
-
- -The contents of the /src_c:: - -
-change_parameter.c*     jw_main.c*              segmentation.c*
-checkpoints.c*          jw_ptv.c*               sortgrid.c*
-correspondences.c*      libtiff.lib*            testvrml.c*
-demo.c*                 lsqadj.c*               tiff.h*
-draw.c*                 mousefunction.c*        tiffio.h*
-epi.c*                  multimed.c*             tiffvers.h*
-globals.h*              orientation.c*          tools.c*
-homemakefile*           peakfitting.c*          track.c*
-homemakefile.mak*       pointpos.c*             trafo.c*
-image_processing.c*     ptv.c*                  ttools.c*
-imgcoord.c*             ptv.h*                  typedefs.h*
-intersect.c*            ray_tracing.c*          unixmakefile*
-jw_ImgFmtTIF.c*         rotation.c*             vrml.c*
-
- -The contents of the /src_tcl:: - -
-button.tcl*     display.tcl*    mainpar.tcl
-calpar.tcl*     draw.tcl*       trackpar.tcl*
-
- -The source code is written in C in combination with Tcl/Tk. -The directory ```/src_c``` contains some old makefile (```homemakefile.mak```) - -Notice: The paths to the libs in the makefile have to be adjusted:: - -``` -INC_DIR1 = C:\Tcl\include\ - -TCL_LIB = C:\Tcl\lib\tcl84.lib -TK_LIB = C:\Tcl\lib\tk84.lib -TIFF_LIB = H:\tk84ptv\src_c\libtiff.lib -``` -For compilation in the DOS-prompt first perform vcvars32.bat for -initalization, after that nmake -f homemakefile.mak - - -IMPORTANT! ----------- - -Before running the software some paths have to be set. -In start.bat, may contain: -``` -C:/PTV/3dptv.exe C:/PTV/ptv.tcl -``` - -has to be modified to the actual position on the PC. -First the path to the jw_prog.exe followed by the -path to the ```ptv.tcl``` script file. - From 585f788b93d89283f34ee3fe3b7319ed2dd3ce35 Mon Sep 17 00:00:00 2001 From: Alex Liberzon Date: Fri, 8 Mar 2013 21:54:00 +0200 Subject: [PATCH 05/13] Update README --- README | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README b/README index afcc05a..bafd6a0 100644 --- a/README +++ b/README @@ -9,7 +9,7 @@ If you want to use the source code and contribute to the project: Installation instructions: --------------------------- -[](./INSTALL.rst) +./INSTALL.rst From 5f9c7026e72845a3820aa6ba794bd3b846ec5147 Mon Sep 17 00:00:00 2001 From: Alex Liberzon Date: Fri, 8 Mar 2013 21:55:10 +0200 Subject: [PATCH 06/13] Update README --- README | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README b/README index bafd6a0..c515086 100644 --- a/README +++ b/README @@ -6,10 +6,10 @@ If you want to use the source code and contribute to the project: 3) send us the pull request when you feel like ready to submit your branch or your master into the community branch -Installation instructions: +Installation instructions in the INSTALL.rst --------------------------- -./INSTALL.rst + From e12cb5f90d26f6506927dfa94e0892d7fa70ff4b Mon Sep 17 00:00:00 2001 From: Alex Liberzon Date: Fri, 8 Mar 2013 21:56:50 +0200 Subject: [PATCH 07/13] Update README --- README | 48 +++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 45 insertions(+), 3 deletions(-) diff --git a/README b/README index c515086..898c1d8 100644 --- a/README +++ b/README @@ -6,10 +6,52 @@ If you want to use the source code and contribute to the project: 3) send us the pull request when you feel like ready to submit your branch or your master into the community branch -Installation instructions in the INSTALL.rst ---------------------------- + +Multi-platform build using CMake +----------------------------------------- +1. Download and install CMake (version 2.8 or higher) + http://www.cmake.org/cmake/resources/software.html - +2. Download and install ActiveTCL 8.6 for the desired platform + + http://www.activestate.com/activetcl/downloads + +3. (Linux systems) Download and install gcc and libtiff + + -- for Ubuntu run the following in a bash shell + + sudo apt-get install build-essential + sudo apt-get install libtiff-dev + +on Mac OS X is recommended to install libtiff using Homebrew: + brew install libtiff + +4. create a build directory inside the main 3dptv directory (```3dptv/build```) + + +5. Run CMake and generate the project or make files + + a. start the ```cmake-gui``` from the desktop shortcut or program list + - alternatively run the following in a bash shell + ```cd``` + b. browse for the source directory: ```3dptv/``` + + c. browse for the build directory just created: ```3dptv/build/``` + + d. click ```configure``` (on Mac OS X choose the following options: UNIX makefiles, native compilers) + + Note: if an error occurs saying that libtiff or ActiveTCL cannot be found + click on the entry in the "value" column and browse for the libraries' "include" and "lib" directories + Click ```configure``` again to locate the libraries. If any rows appear red, click configure once more. + + e. click generate to create the project files (Visual studio) or make files (linux) +6. Run Visual Studio and open the solution file in 3dptv/build/ or run make from within the build directory to compile the code. + --The executable will be generated and placed inside 3dptv/build/bin/ + +7. Run the software from the ```test``` folder with a link to ```ptv.tcl``` as an input: + cd 3dptv/test + ../build/bin/3dptv ../ptv.tcl + From 6e98f8e4db166991229fa54168a27c21bc27837a Mon Sep 17 00:00:00 2001 From: Alex Liberzon Date: Fri, 8 Mar 2013 21:57:45 +0200 Subject: [PATCH 08/13] Update README --- README | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/README b/README index 898c1d8..1cf6c38 100644 --- a/README +++ b/README @@ -1,14 +1,13 @@ -If you want to use the source code and contribute to the project: ------------------------------------------------------------------ +## If you want to use the source code and contribute to the project: -1) Fork this repository to your account, using the Fork button -2) create branch or fix the master branch if you feel confident enough -3) send us the pull request when you feel like ready to submit your branch or your master into the community branch +1. Fork this repository to your account, using the Fork button +2. create branch or fix the master branch if you feel confident enough +3. send us the pull request when you feel like ready to submit your branch or your master into the community branch -Multi-platform build using CMake ------------------------------------------ +## Multi-platform build using CMake + 1. Download and install CMake (version 2.8 or higher) http://www.cmake.org/cmake/resources/software.html From c21b8eca6b94669b7eba3c66bff5a065811075f4 Mon Sep 17 00:00:00 2001 From: Alex Liberzon Date: Fri, 8 Mar 2013 21:58:30 +0200 Subject: [PATCH 09/13] Create README.md --- README.md | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..5bca4a8 --- /dev/null +++ b/README.md @@ -0,0 +1,55 @@ +## If you want to use the source code and contribute to the project: + +1. Fork this repository to your account, using the Fork button +2. create branch or fix the master branch if you feel confident enough +3. send us the pull request when you feel like ready to submit your branch or your master into the community branch + + + +## Multi-platform build using CMake + +1. Download and install CMake (version 2.8 or higher) + + http://www.cmake.org/cmake/resources/software.html + +2. Download and install ActiveTCL 8.6 for the desired platform + + http://www.activestate.com/activetcl/downloads + +3. (Linux systems) Download and install gcc and libtiff + + -- for Ubuntu run the following in a bash shell + + sudo apt-get install build-essential + sudo apt-get install libtiff-dev + +on Mac OS X is recommended to install libtiff using Homebrew: + brew install libtiff + +4. create a build directory inside the main 3dptv directory (```3dptv/build```) + + +5. Run CMake and generate the project or make files + + a. start the ```cmake-gui``` from the desktop shortcut or program list + - alternatively run the following in a bash shell + ```cd``` + b. browse for the source directory: ```3dptv/``` + + c. browse for the build directory just created: ```3dptv/build/``` + + d. click ```configure``` (on Mac OS X choose the following options: UNIX makefiles, native compilers) + + Note: if an error occurs saying that libtiff or ActiveTCL cannot be found + click on the entry in the "value" column and browse for the libraries' "include" and "lib" directories + Click ```configure``` again to locate the libraries. If any rows appear red, click configure once more. + + e. click generate to create the project files (Visual studio) or make files (linux) + +6. Run Visual Studio and open the solution file in 3dptv/build/ or run make from within the build directory to compile the code. + --The executable will be generated and placed inside 3dptv/build/bin/ + +7. Run the software from the ```test``` folder with a link to ```ptv.tcl``` as an input: + + cd 3dptv/test + ../build/bin/3dptv ../ptv.tcl From c16554e1a12031c78f59b593450c937b7a6964ca Mon Sep 17 00:00:00 2001 From: Alex Liberzon Date: Fri, 8 Mar 2013 22:00:57 +0200 Subject: [PATCH 10/13] removed obsolete README and Install.rst, created README.m --- INSTALL.rst | 49 ---------------------------------------------- README | 56 ----------------------------------------------------- 2 files changed, 105 deletions(-) delete mode 100644 INSTALL.rst delete mode 100644 README diff --git a/INSTALL.rst b/INSTALL.rst deleted file mode 100644 index ab2d38e..0000000 --- a/INSTALL.rst +++ /dev/null @@ -1,49 +0,0 @@ - -Multi-platform build using CMake ------------------------------------------ -1. Download and install CMake (version 2.8 or higher) - - http://www.cmake.org/cmake/resources/software.html - -2. Download and install ActiveTCL for the desired platform - - http://www.activestate.com/activetcl/downloads - -3. (Linux systems) Download and install gcc and libtiff - - -- for Ubuntu run the following in a bash shell - - sudo apt-get install build-essential - sudo apt-get install libtiff-dev - -on Mac OS X is recommended to install libtiff using Homebrew: - brew install libtiff - -4. create a build directory inside the main 3dptv directory (```3dptv/build```) - - -5. Run CMake and generate the project or make files - - a. start the ```cmake-gui``` from the desktop shortcut or program list - - alternatively run the following in a bash shell - ```cd``` - b. browse for the source directory: ```3dptv/``` - - c. browse for the build directory just created: ```3dptv/build/``` - - d. click ```configure``` (on Mac OS X choose the following options: UNIX makefiles, native compilers) - - Note: if an error occurs saying that libtiff or ActiveTCL cannot be found - click on the entry in the "value" column and browse for the libraries' "include" and "lib" directories - Click ```configure``` again to locate the libraries. If any rows appear red, click configure once more. - - e. click generate to create the project files (Visual studio) or make files (linux) - -6. Run Visual Studio and open the solution file in 3dptv/build/ or run make from within the build directory to compile the code. - --The executable will be generated and placed inside 3dptv/build/bin/ - -7. Run the software from the ```test``` folder with a link to ```ptv.tcl``` as an input: - - cd 3dptv/test - ../build/bin/3dptv ../ptv.tcl - \ No newline at end of file diff --git a/README b/README deleted file mode 100644 index 1cf6c38..0000000 --- a/README +++ /dev/null @@ -1,56 +0,0 @@ -## If you want to use the source code and contribute to the project: - -1. Fork this repository to your account, using the Fork button -2. create branch or fix the master branch if you feel confident enough -3. send us the pull request when you feel like ready to submit your branch or your master into the community branch - - - -## Multi-platform build using CMake - -1. Download and install CMake (version 2.8 or higher) - - http://www.cmake.org/cmake/resources/software.html - -2. Download and install ActiveTCL 8.6 for the desired platform - - http://www.activestate.com/activetcl/downloads - -3. (Linux systems) Download and install gcc and libtiff - - -- for Ubuntu run the following in a bash shell - - sudo apt-get install build-essential - sudo apt-get install libtiff-dev - -on Mac OS X is recommended to install libtiff using Homebrew: - brew install libtiff - -4. create a build directory inside the main 3dptv directory (```3dptv/build```) - - -5. Run CMake and generate the project or make files - - a. start the ```cmake-gui``` from the desktop shortcut or program list - - alternatively run the following in a bash shell - ```cd``` - b. browse for the source directory: ```3dptv/``` - - c. browse for the build directory just created: ```3dptv/build/``` - - d. click ```configure``` (on Mac OS X choose the following options: UNIX makefiles, native compilers) - - Note: if an error occurs saying that libtiff or ActiveTCL cannot be found - click on the entry in the "value" column and browse for the libraries' "include" and "lib" directories - Click ```configure``` again to locate the libraries. If any rows appear red, click configure once more. - - e. click generate to create the project files (Visual studio) or make files (linux) - -6. Run Visual Studio and open the solution file in 3dptv/build/ or run make from within the build directory to compile the code. - --The executable will be generated and placed inside 3dptv/build/bin/ - -7. Run the software from the ```test``` folder with a link to ```ptv.tcl``` as an input: - - cd 3dptv/test - ../build/bin/3dptv ../ptv.tcl - From ba0f39690e9259b0dee08680a1cde77bc576be42 Mon Sep 17 00:00:00 2001 From: Alex Liberzon Date: Fri, 8 Mar 2013 22:02:14 +0200 Subject: [PATCH 11/13] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5bca4a8..02bf44d 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ 2. Download and install ActiveTCL 8.6 for the desired platform - http://www.activestate.com/activetcl/downloads + http://www.activestate.com/activetcl/downloads 3. (Linux systems) Download and install gcc and libtiff From 041fe4b5f7387fbe3a13765cfb0092f985c18f6f Mon Sep 17 00:00:00 2001 From: Douglas Barker Date: Sun, 10 Mar 2013 20:40:18 -0400 Subject: [PATCH 12/13] Minor updates to main CMakeLists.txt file and readme.md --- CMakeLists.txt | 6 +++--- README.md | 36 ++++++++++++++++++++---------------- 2 files changed, 23 insertions(+), 19 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5565688..e3c0c76 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,7 +11,7 @@ if (WIN32) add_definitions( -D_CONSOLE -D_CRT_SECURE_NO_WARNINGS ) set(TIFF_LIBRARY "${CMAKE_SOURCE_DIR}/src_c/libtiff.lib") else() - set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} "/opt/ActiveTcl-8.4") + set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} "/opt/ActiveTcl-8.6") set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} "/usr/lib") find_package( TIFF REQUIRED ) endif() @@ -30,8 +30,8 @@ endif() set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MT") set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MTd") -set(CMAKE_C_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MT") -set(CMAKE_C_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MTd") +set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /MT") +set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /MTd") message(STATUS "gathering ptv tcl files:") file(GLOB ptv_tcl "${CMAKE_SOURCE_DIR}/src_tcl/*.tcl") diff --git a/README.md b/README.md index 02bf44d..5042672 100644 --- a/README.md +++ b/README.md @@ -16,40 +16,44 @@ http://www.activestate.com/activetcl/downloads -3. (Linux systems) Download and install gcc and libtiff +3. Download and install libtiff (*nix and OSX systems) - -- for Ubuntu run the following in a bash shell + -- on Ubuntu run the following in a terminal: - sudo apt-get install build-essential - sudo apt-get install libtiff-dev + ```sudo apt-get install build-essential``` + ```sudo apt-get install libtiff-dev``` -on Mac OS X is recommended to install libtiff using Homebrew: - brew install libtiff + -- on Mac OS X is recommended to install libtiff using Homebrew: + ```brew install libtiff``` -4. create a build directory inside the main 3dptv directory (```3dptv/build```) +4. Create a build directory inside the main 3dptv directory (```3dptv/build```) 5. Run CMake and generate the project or make files a. start the ```cmake-gui``` from the desktop shortcut or program list - - alternatively run the following in a bash shell - ```cd``` + -- alternatively run the following from command line + ```cd 3dptv/build``` + ```cmake-gui ../``` b. browse for the source directory: ```3dptv/``` c. browse for the build directory just created: ```3dptv/build/``` - d. click ```configure``` (on Mac OS X choose the following options: UNIX makefiles, native compilers) + d. click ```configure``` and select the build type and compiler + --on Mac OS X choose the following options: UNIX makefiles, native compilers + --on Windows choose Visual Studio 2010 or 2008 (32-bit supported currently) + --on *nix systems choose Unix make files or alternatively use Eclipse CTD and unix make files Note: if an error occurs saying that libtiff or ActiveTCL cannot be found - click on the entry in the "value" column and browse for the libraries' "include" and "lib" directories - Click ```configure``` again to locate the libraries. If any rows appear red, click configure once more. + click on the entry in the "value" column and browse for the libraries' "include" directories and ".lib" files + click ```configure``` again to locate the libraries. If any rows appear red, click configure until no rows are highlighted. e. click generate to create the project files (Visual studio) or make files (linux) -6. Run Visual Studio and open the solution file in 3dptv/build/ or run make from within the build directory to compile the code. - --The executable will be generated and placed inside 3dptv/build/bin/ +6. Run Visual Studio and open the solution file in ```3dptv/build/``` or run make from within the build directory to compile the code. + --The executable will be generated and placed inside ```3dptv/build/bin/``` 7. Run the software from the ```test``` folder with a link to ```ptv.tcl``` as an input: - cd 3dptv/test - ../build/bin/3dptv ../ptv.tcl + ```cd 3dptv/test``` + ```../build/bin/3dptv ../ptv.tcl``` From 79dde3a6cdfcb04a8d37f5d2fd9c390705ea4949 Mon Sep 17 00:00:00 2001 From: Douglas Barker Date: Sun, 10 Mar 2013 20:52:20 -0400 Subject: [PATCH 13/13] readme formating --- README.md | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 5042672..e1d477c 100644 --- a/README.md +++ b/README.md @@ -20,11 +20,12 @@ -- on Ubuntu run the following in a terminal: - ```sudo apt-get install build-essential``` - ```sudo apt-get install libtiff-dev``` + sudo apt-get install build-essential + sudo apt-get install libtiff-dev -- on Mac OS X is recommended to install libtiff using Homebrew: - ```brew install libtiff``` + + brew install libtiff 4. Create a build directory inside the main 3dptv directory (```3dptv/build```) @@ -32,28 +33,35 @@ 5. Run CMake and generate the project or make files a. start the ```cmake-gui``` from the desktop shortcut or program list + -- alternatively run the following from command line - ```cd 3dptv/build``` - ```cmake-gui ../``` + + cd 3dptv/build + cmake-gui ../ + b. browse for the source directory: ```3dptv/``` c. browse for the build directory just created: ```3dptv/build/``` - d. click ```configure``` and select the build type and compiler + d. click ```configure``` and select the build type and compiler + --on Mac OS X choose the following options: UNIX makefiles, native compilers + --on Windows choose Visual Studio 2010 or 2008 (32-bit supported currently) + --on *nix systems choose Unix make files or alternatively use Eclipse CTD and unix make files Note: if an error occurs saying that libtiff or ActiveTCL cannot be found click on the entry in the "value" column and browse for the libraries' "include" directories and ".lib" files click ```configure``` again to locate the libraries. If any rows appear red, click configure until no rows are highlighted. - e. click generate to create the project files (Visual studio) or make files (linux) + e. click generate to create the project or make files 6. Run Visual Studio and open the solution file in ```3dptv/build/``` or run make from within the build directory to compile the code. + --The executable will be generated and placed inside ```3dptv/build/bin/``` 7. Run the software from the ```test``` folder with a link to ```ptv.tcl``` as an input: - ```cd 3dptv/test``` - ```../build/bin/3dptv ../ptv.tcl``` + cd 3dptv/test + ../build/bin/3dptv ../ptv.tcl