Re: [Point Cloud Library] Commit by Geoffrey Biggs: Started new build system

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: [Point Cloud Library] Commit by Geoffrey Biggs: Started new build system

nizar sallem
Hi Geoffrey, 

In my opinion the macro set_install_dirs is really optional and confusing:
even if the os is 64bits it has a lib directory for sure also include/project_name-version.revision is not something very common.

Sorry for duplicates.
--
Nizar SALLEM
Robotics and Artificial Intelligence PhD student
LAAS-CNRS
7, Avenue Colonel Roche
31077 Toulouse CEDEX 4
FRANCE




On Mar 3, 2011, at 3:20 PM, [hidden email] wrote:

Project: Point Cloud Library
Revision: 9 
Author: Geoffrey Biggs 
Summary: Started new build system 
Details: 

Please take a moment to review this checkin.


trunk/cmake/cpack_options.cmake.in (revision 9)
1
set(CPACK_PACKAGE_NAME "@PROJECT_NAME@")
2
set(CPACK_PACKAGE_VERSION_MAJOR "@PCL_MAJOR_VERSION@")
3
set(CPACK_PACKAGE_VERSION_MINOR "@PCL_MINOR_VERSION@")
4
set(CPACK_PACKAGE_VERSION_PATCH "@PCL_REVISION_VERSION@")
5
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Point cloud library")
6
set(CPACK_PACKAGE_INSTALL_DIRECTORY "@PROJECT_NAME@")
7
set(CPACK_PACKAGE_FILE_NAME "@PROJECT_NAME@-@PCL_VERSION@")
8
set(CPACK_RESOURCE_FILE_LICENSE "@PROJECT_SOURCE_DIR@/LICENSE.txt")
9
10
set(CPACK_COMPONENTS_ALL headers libraries utilities pkgconfig doc examples)
11
set(CPACK_COMPONENT_HEADERS_DISPLAY_NAME "Header files")
12
set(CPACK_COMPONENT_HEADERS_DESCRIPTION
13
    "Header files from the component.")
14
set(CPACK_COMPONENT_HEADERS_DEPENDS libraries)
15
set(CPACK_COMPONENT_LIBRARIES_DISPLAY_NAME "Libraries")
16
set(CPACK_COMPONENT_LIBRARIES_DESCRIPTION
17
    "Core libraries.")
18
set(CPACK_COMPONENT_UTILITIES_DISPLAY_NAME "Utilities")
19
set(CPACK_COMPONENT_UTILITIES_DESCRIPTION
20
    "Utilities for working with point clouds.")
21
set(CPACK_COMPONENT_UTILITIES_DEPENDS libraries)
22
set(CPACK_COMPONENT_PKGCONFIG_DISPLAY_NAME "pkg-config file.")
23
set(CPACK_COMPONENT_PKGCONFIG_DESCRIPTION
24
    "File for use with the pkg-config system.")
25
set(CPACK_COMPONENT_PKGCONFIG_DEPENDS libraries headers)
26
set(CPACK_COMPONENT_DOC_DISPLAY_NAME "Documentation")
27
set(CPACK_COMPONENT_DOC_DESCRIPTION
28
    "User's and developer's guides.")
29
set(CPACK_COMPONENT_DOC_DEPENDS libraries)
30
set(CPACK_COMPONENT_EXAMPLES_DISPLAY_NAME "Examples")
31
set(CPACK_COMPONENT_EXAMPLES_DESCRIPTION
32
    "Sample source code and executables.")
33
set(CPACK_COMPONENT_EXAMPLES_DEPENDS libraries headers pkgconfig)
34
35
IF (WIN32)
36
    set(CPACK_NSIS_MUI_ICON "@PROJECT_SOURCE_DIR@/cmake\\pcl_logo.ico")
37
    set(CPACK_NSIS_MUI_UNIICON "@PROJECT_SOURCE_DIR@/cmake\\pcl_logo.ico")
38
    set(CPACK_PACKAGE_ICON "@PROJECT_SOURCE_DIR@/cmake\\pcl_logo.bmp")
39
    set(CPACK_NSIS_HELP_LINK "http://www.pointclouds.org")
40
    set(CPACK_NSIS_URL_INFO_ABOUT "http://www.pointclouds.org")
41
    set(CPACK_NSIS_MODIFY_PATH ON)
42
    set(CPACK_PACKAGE_EXECUTABLES @PCL_EXECUTABLES@)
43
    set(CPACK_NSIS_MENU_LINKS "share/doc/@PROJECT_NAME@/user_guide.pdf"
44
        "User's guide")
45
    set(CPACK_NSIS_MENU_LINKS "share/doc/@PROJECT_NAME@/developer_guide.pdf"
46
        "Developer's guide")
47
ENDIF (WIN32)
48
trunk/cmake/pcl_utils.cmake (revision 9)
1
###############################################################################
2
# Turn a list into a string, with each item separated by spaces.
3
# _list List to stringify.
4
# _string Name of the destination variable.
5
macro(LIST_TO_STRING _list _string)
6
    set(${_string})
7
    foreach(_item ${_list})
8
        set(${_string} "${${_string}} ${_item}")
9
    endforeach(_item)
10
endmacro(LIST_TO_STRING)
11
12
13
###############################################################################
14
# Filter a list by a pattern.
15
# _list List to filter.
16
# _pattern The regular expression to filter by. See the if(... MATCHES ...)
17
#   expression in the CMake help.
18
# _output The name of the destination variable.
19
macro(FILTER_LIST _list _pattern _output)
20
    set(${_output})
21
    foreach(_item ${_list})
22
        if("${_item}" MATCHES ${_pattern})
23
            set(${_output} ${${_output}} ${_item})
24
        endif("${_item}" MATCHES ${_pattern})
25
    endforeach(_item)
26
endmacro(FILTER_LIST)
27
28
29
###############################################################################
30
# Find a pkg-config file and use it.
31
# _pkg The name of the package to search for.
32
# _required Set to "REQUIRED" to cause an error if the package is not found.
33
include(FindPkgConfig)
34
macro(GET_PKG_CONFIG_INFO _pkg _required)
35
    if(PKG_CONFIG_FOUND)
36
        pkg_check_modules(${_pkg}_PKG ${_required} ${_pkg})
37
        if(${_pkg}_PKG_CFLAGS_OTHER)
38
            LIST_TO_STRING(${_pkg}_CFLAGS "${${_pkg}_PKG_CFLAGS_OTHER}")
39
        else(${_pkg}_PKG_CFLAGS_OTHER)
40
            set(${_pkg}_CFLAGS "")
41
        endif(${_pkg}_PKG_CFLAGS_OTHER)
42
        set(${_pkg}_INCLUDE_DIRS ${${_pkg}_PKG_INCLUDE_DIRS})
43
        set(${_pkg}_LINK_LIBS ${${_pkg}_PKG_LIBRARIES})
44
        set(${_pkg}_LIBRARY_DIRS ${${_pkg}_PKG_LIBRARY_DIRS})
45
        if(${_pkg}_PKG_LDFLAGS_OTHER)
46
            LIST_TO_STRING(${_pkg}_LINK_FLAGS ${${_pkg}_PKG_LDFLAGS_OTHER})
47
        else(${_pkg}_PKG_LDFLAGS_OTHER)
48
            set(${_pkg}_LINK_FLAGS "")
49
        endif(${_pkg}_PKG_LDFLAGS_OTHER)
50
    else(PKG_CONFIG_FOUND)
51
        message(STATUS "Could not find pkg-config.")
52
        message(STATUS
53
            "You will need to set the following variables manually:")
54
        message(STATUS "${_pkg}_INCLUDE_DIRS ${_pkg}_CFLAGS_OTHER ${_pkg}_LINK_LIBS ${_pkg}_LIBRARY_DIRS ${_pkg}_LINK_FLAGS")
55
    endif(PKG_CONFIG_FOUND)
56
endmacro(GET_PKG_CONFIG_INFO)
57
58
59
###############################################################################
60
# Apply the results of a pkg-config search to the include and link directory
61
# settings.
62
# _pkg The name of the package who's settings should be applied.
63
macro(APPLY_PKG_CONFIG_DIRS _pkg)
64
    if(${_pkg}_INCLUDE_DIRS)
65
        include_directories(${${_pkg}_INCLUDE_DIRS})
66
    endif(${_pkg}_INCLUDE_DIRS)
67
    if(${_pkg}_LIBRARY_DIRS)
68
        link_directories(${${_pkg}_LIBRARY_DIRS})
69
    endif(${_pkg}_LIBRARY_DIRS)
70
endmacro(APPLY_PKG_CONFIG_DIRS)
71
72
73
###############################################################################
74
# Apply the results of a pkg-config search to a list of targets, setting the
75
# link flags and libraries to link to on each target based on the information
76
# from the pkg-config file.
77
# _pkg The name of the package who's settings should be applied.
78
# Extra arguments: The targets to apply to.
79
macro(APPLY_PKG_CONFIG_TO_TGTS _pkg)
80
    if(${_pkg}_LINK_FLAGS)
81
        foreach(_tgt ${ARGN})
82
            set_target_properties(${_tgt} PROPERTIES
83
                LINK_FLAGS "${${_pkg}_LINK_FLAGS}")
84
        endforeach(_tgt)
85
    endif(${_pkg}_LINK_FLAGS)
86
    if(${_pkg}_LINK_LIBS)
87
        foreach(_tgt ${ARGN})
88
            target_link_libraries(${_tgt} ${${_pkg}_LINK_LIBS})
89
        endforeach(_tgt)
90
    endif(${_pkg}_LINK_LIBS)
91
endmacro(APPLY_PKG_CONFIG_TO_TGTS)
92
93
94
###############################################################################
95
# Apply the results of a pkg-config search to a list of source files, setting
96
# the compile flags on each file based on the information from the pkg-config
97
# file.
98
# _pkg The name of the package who's settings should be applied.
99
# Extra arguments: The files to apply to.
100
macro(APPLY_PKG_CONFIG_TO_SRCS _pkg)
101
    if(${_pkg}_CFLAGS)
102
        set_source_files_properties(${ARGN}
103
            PROPERTIES COMPILE_FLAGS "${${_pkg}_CFLAGS}")
104
    endif(${_pkg}_CFLAGS)
105
endmacro(APPLY_PKG_CONFIG_TO_SRCS)
106
107
108
###############################################################################
109
# Pull the component parts out of the version number.
110
macro(DISSECT_VERSION)
111
    # Find version components
112
    string(REGEX REPLACE "^([0-9]+).*" "<a href="smb://1">\\1"
113
        PCL_MAJOR_VERSION "${PCL_VERSION}")
114
    string(REGEX REPLACE "^[0-9]+\\.([0-9]+).*" "<a href="smb://1">\\1"
115
        PCL_MINOR_VERSION "${PCL_VERSION}")
116
    string(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]+)" "<a href="smb://1">\\1"
117
        PCL_REVISION_VERSION ${PCL_VERSION})
118
    string(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.[0-9]+(.*)" "<a href="smb://1">\\1"
119
        PCL_CANDIDATE_VERSION ${PCL_VERSION})
120
endmacro(DISSECT_VERSION)
121
122
###############################################################################
123
# Get the operating system information. Generally, CMake does a good job of
124
# this. Sometimes, though, it doesn't give enough information. This macro will
125
# distinguish between the UNIX variants. Otherwise, use the CMake variables
126
# such as WIN32 and APPLE and CYGWIN.
127
# Sets OS_IS_64BIT if the operating system is 64-bit.
128
# Sets LINUX if the operating system is Linux.
129
macro(GET_OS_INFO)
130
    string(REGEX MATCH "Linux" OS_IS_LINUX ${CMAKE_SYSTEM_NAME})
131
    if(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86_64")
132
        set(OS_IS_64BIT TRUE)
133
    else(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86_64")
134
        set(OS_IS_64BIT FALSE)
135
    endif(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86_64")
136
endmacro(GET_OS_INFO)
137
138
139
###############################################################################
140
# Set the destination directories for installing stuff.
141
# Sets LIB_INSTALL_DIR. Install libraries here.
142
# Sets BIN_INSTALL_DIR. Install binaries here.
143
# Sets INCLUDE_INSTALL_DIR. Install include files here, preferably in a
144
# subdirectory named after the library in question (e.g.
145
# "registration/blorgle.h")
146
macro(SET_INSTALL_DIRS)
147
    if(OS_IS_64BIT)
148
        set(LIB_INSTALL_DIR "lib64")
149
    else(OS_IS_64BIT)
150
        set(LIB_INSTALL_DIR "lib")
151
    endif(OS_IS_64BIT)
152
    set(INCLUDE_INSTALL_DIR
153
        "include/${PROJECT_NAME_LOWER}-${PCL_MAJOR_VERSION}.${PCL_MINOR_VERSION}")
154
endmacro(SET_INSTALL_DIRS)
155
trunk/visualization/CMakeLists.txt (revision 9)
1
cmake_minimum_required (VERSION 2.4.6)
1
set(LIB_NAME visualization)
2
set(LIB_DESC "Point cloud visualization classes")
3
set(LIB_DEPS pcl)
24
3
include ($ENV{ROS_ROOT}/core/rosbuild/rosbuild.cmake)
4
set (ROS_BUILD_TYPE RelWithDebInfo)
5
rosbuild_init ()
6
rosbuild_add_boost_directories ()
5
set(build TRUE)
6
PCL_LIB_OPTION(build LIB ${LIB_NAME} ON ${LIB_DEPS})
77
8
set (EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)
9
include_directories (${CMAKE_CURRENT_BINARY_DIR})
10
include_directories (src)
8
if(build)
9
    # Find Boost
10
    # find_package(wxWidgets REQUIRED)
11
    # include(${wxWidgets_USE_FILE})
12
    # include_directories(${wxWidgets_INCLUDE_DIRS})
13
    # find_package (VTK REQUIRED)
14
    # include (${VTK_USE_FILE})
1115
12
find_package(wxWidgets REQUIRED)
13
include(${wxWidgets_USE_FILE})
14
include_directories(${wxWidgets_INCLUDE_DIRS})
15
find_package (VTK REQUIRED)
16
include (${VTK_USE_FILE})
16
    set(viz_srcs src/libpcl_visualization/interactor.cpp
17
        src/libpcl_visualization/interactor_style.cpp
18
        src/libpcl_visualization/point_cloud_handlers.cpp
19
        src/libpcl_visualization/pcl_visualizer.cpp
20
        src/libpcl_visualization/histogram_visualizer.cpp
21
        src/libpcl_visualization/common/common.cpp
22
        src/libpcl_visualization/common/io.cpp
23
        src/libpcl_visualization/common/shapes.cpp
24
        src/libpcl_visualization/common/float_image_utils.cpp
25
        src/libpcl_visualization/common/image_widget_wx.cpp
26
        src/libpcl_visualization/range_image_visualizer.cpp
27
        src/libpcl_visualization/cloud_viewer.cpp
28
        )
1729
18
## ---[ Point Cloud Library - Visualization
19
rosbuild_add_library (pcl_visualization
20
                      src/libpcl_visualization/interactor.cpp
21
                      src/libpcl_visualization/interactor_style.cpp
22
                      src/libpcl_visualization/point_cloud_handlers.cpp
23
                      src/libpcl_visualization/pcl_visualizer.cpp
24
                      src/libpcl_visualization/histogram_visualizer.cpp
25
                      src/libpcl_visualization/common/common.cpp
26
                      src/libpcl_visualization/common/io.cpp
27
                      src/libpcl_visualization/common/shapes.cpp
28
                      src/libpcl_visualization/common/float_image_utils.cpp
29
                      src/libpcl_visualization/common/image_widget_wx.cpp
30
                      src/libpcl_visualization/range_image_visualizer.cpp
31
                      src/libpcl_visualization/cloud_viewer.cpp
32
                     )
33
target_link_libraries (pcl_visualization vtkCommon vtkWidgets vtkHybrid ${wxWidgets_LIBRARIES})
30
    # link to vtkCommon, vtkWIdgets, vtkHybrid, ${wxWidgets_LIBRARIES}
3431
35
rosbuild_add_executable (test_pcl_vis src/test.cpp)
36
target_link_libraries (test_pcl_vis pcl_visualization)
32
    # executable: test_pcl_vis src/test.cpp
33
    # executable: test_geometry src/test_geometry.cpp
34
    # executable: test_shapes src/test_shapes.cpp
35
    # share data: http://pr.willowgarage.com/data/pcl/partial_cup_model_new.pcd
36
    # subdir: src/examples
37
    # subdir: src/tools
38
endif(build)
3739
38
rosbuild_add_executable (test_geometry src/test_geometry.cpp)
39
target_link_libraries (test_geometry pcl_visualization)
40
41
rosbuild_add_executable (test_shapes src/test_shapes.cpp)
42
target_link_libraries (test_shapes pcl_visualization)
43
44
rosbuild_download_data (http://pr.willowgarage.com/data/pcl/partial_cup_model_new.pcd data/partial_cup_model.pcd a9acd00d71cfdd3c176053f1fd1497c8)
45
46
add_subdirectory (src/examples)
47
add_subdirectory (src/tools)
48
# Option to generate a standalone tarball
49
add_custom_target (tarball ${PROJECT_SOURCE_DIR}/make_tarball WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} VERBATIM)
50
51
trunk/CMakeLists.txt (revision 9)
1
cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
2
13
project(PCL)
4
string(TOLOWER ${PROJECT_NAME} PROJECT_NAME_LOWER)
25
6
include(${PROJECT_SOURCE_DIR}/cmake/pcl_utils.cmake)
7
set(PCL_VERSION 2.0.0 CACHE STRING "PCL version")
8
DISSECT_VERSION()
9
GET_OS_INFO()
10
SET_INSTALL_DIRS()
11
12
# Add an "uninstall" target
13
CONFIGURE_FILE ("${PROJECT_SOURCE_DIR}/cmake/uninstall_target.cmake.in"
14
    "${PROJECT_BINARY_DIR}/uninstall_target.cmake" IMMEDIATE @ONLY)
15
ADD_CUSTOM_TARGET (uninstall "${CMAKE_COMMAND}" -P
16
    "${PROJECT_BINARY_DIR}/uninstall_target.cmake")
17
18
# Add the library subdirectories
19
add_subdirectory(pcl)
20
add_subdirectory(visualization)
21
22
# Package creation
23
include(InstallRequiredSystemLibraries)
24
configure_file("${PROJECT_SOURCE_DIR}/cmake/cpack_options.cmake.in"
25
    "${PROJECT_BINARY_DIR}/cpack_options.cmake" @ONLY)
26
set(CPACK_PROJECT_CONFIG_FILE "${PROJECT_BINARY_DIR}/cpack_options.cmake")
27
include(CPack)
28

You have received this notification because you have either subscribed to it, or are involved in it.
To change your notification preferences, please click here: http://pointclouds.org/devel/my/account.

<changeset_rev_9.diff>

Reply | Threaded
Open this post in threaded view
|

Re: [Point Cloud Library] Commit by Geoffrey Biggs: Started new build system

Geoff Biggs
Hi Nizar,

We found with Player that it was a benefit to properly install into
lib64 on 64-bit operating systems. Some distros expect this and were
doing strange things when we didn't keep in line. That macro also only
gets called once, so I'm not sure who it would be confusing to.

include/project_name is fairly common for projects that have several
sub-libraries and divide their includes up into matching directories.
It's taken care of by the cflags that will be provided in pkg-config
files, plus anyone who uses the to-be-written CMake modules will have it
even easier. Appending the version is not common but useful if we want
to support multiple versions of the libraries installed at once. That's
something that's not decided yet, though.

Geoff


On 03/03/11 23:50, Nizar Khalifa Sallem wrote:

> Hi Geoffrey,
>
> In my opinion the macro set_install_dirs is really optional and confusing:
> even if the os is 64bits it has a lib directory for sure also
> include/project_name-version.revision is not something very common.
>
> Sorry for duplicates.
> --
> Nizar SALLEM
> Robotics and Artificial Intelligence PhD student
> LAAS-CNRS
> 7, Avenue Colonel Roche
> 31077 Toulouse CEDEX 4
> FRANCE
>
>
>
>
> On Mar 3, 2011, at 3:20 PM, [hidden email]
> <mailto:[hidden email]> wrote:
>
>> *Project:* Point Cloud Library <http://dev.pointclouds.org/projects/1>
>> *Revision:* 9
>> <http://dev.pointclouds.org/projects/1/repository/revisions/9/diff>
>> *Author:* Geoffrey Biggs
>> *Summary:* Started new build system
>> *Details:*
>>
>> Please take a moment to review this checkin.
>>
>> ------------------------------------------------------------------------
>> trunk/cmake/cpack_options.cmake.in (revision 9)
>> 1
>> set(CPACK_PACKAGE_NAME "@PROJECT_NAME@")
>> 2
>> set(CPACK_PACKAGE_VERSION_MAJOR "@PCL_MAJOR_VERSION@")
>> 3
>> set(CPACK_PACKAGE_VERSION_MINOR "@PCL_MINOR_VERSION@")
>> 4
>> set(CPACK_PACKAGE_VERSION_PATCH "@PCL_REVISION_VERSION@")
>> 5
>> set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Point cloud library")
>> 6
>> set(CPACK_PACKAGE_INSTALL_DIRECTORY "@PROJECT_NAME@")
>> 7
>> set(CPACK_PACKAGE_FILE_NAME "@PROJECT_NAME@-@PCL_VERSION@")
>> 8
>> set(CPACK_RESOURCE_FILE_LICENSE "@PROJECT_SOURCE_DIR@/LICENSE.txt")
>> 9
>> 10
>> set(CPACK_COMPONENTS_ALL headers libraries utilities pkgconfig doc examples)
>> 11
>> set(CPACK_COMPONENT_HEADERS_DISPLAY_NAME "Header files")
>> 12
>> set(CPACK_COMPONENT_HEADERS_DESCRIPTION
>> 13
>>     "Header files from the component.")
>> 14
>> set(CPACK_COMPONENT_HEADERS_DEPENDS libraries)
>> 15
>> set(CPACK_COMPONENT_LIBRARIES_DISPLAY_NAME "Libraries")
>> 16
>> set(CPACK_COMPONENT_LIBRARIES_DESCRIPTION
>> 17
>>     "Core libraries.")
>> 18
>> set(CPACK_COMPONENT_UTILITIES_DISPLAY_NAME "Utilities")
>> 19
>> set(CPACK_COMPONENT_UTILITIES_DESCRIPTION
>> 20
>>     "Utilities for working with point clouds.")
>> 21
>> set(CPACK_COMPONENT_UTILITIES_DEPENDS libraries)
>> 22
>> set(CPACK_COMPONENT_PKGCONFIG_DISPLAY_NAME "pkg-config file.")
>> 23
>> set(CPACK_COMPONENT_PKGCONFIG_DESCRIPTION
>> 24
>>     "File for use with the pkg-config system.")
>> 25
>> set(CPACK_COMPONENT_PKGCONFIG_DEPENDS libraries headers)
>> 26
>> set(CPACK_COMPONENT_DOC_DISPLAY_NAME "Documentation")
>> 27
>> set(CPACK_COMPONENT_DOC_DESCRIPTION
>> 28
>>     "User's and developer's guides.")
>> 29
>> set(CPACK_COMPONENT_DOC_DEPENDS libraries)
>> 30
>> set(CPACK_COMPONENT_EXAMPLES_DISPLAY_NAME "Examples")
>> 31
>> set(CPACK_COMPONENT_EXAMPLES_DESCRIPTION
>> 32
>>     "Sample source code and executables.")
>> 33
>> set(CPACK_COMPONENT_EXAMPLES_DEPENDS libraries headers pkgconfig)
>> 34
>> 35
>> IF (WIN32)
>> 36
>>     set(CPACK_NSIS_MUI_ICON "@PROJECT_SOURCE_DIR@/cmake\\pcl_logo.ico")
>> 37
>>     set(CPACK_NSIS_MUI_UNIICON "@PROJECT_SOURCE_DIR@/cmake\\pcl_logo.ico")
>> 38
>>     set(CPACK_PACKAGE_ICON "@PROJECT_SOURCE_DIR@/cmake\\pcl_logo.bmp")
>> 39
>>     set(CPACK_NSIS_HELP_LINK "http://www.pointclouds.org <http://www.pointclouds.org/>")
>> 40
>>     set(CPACK_NSIS_URL_INFO_ABOUT "http://www.pointclouds.org <http://www.pointclouds.org/>")
>> 41
>>     set(CPACK_NSIS_MODIFY_PATH ON)
>> 42
>>     set(CPACK_PACKAGE_EXECUTABLES @PCL_EXECUTABLES@)
>> 43
>>     set(CPACK_NSIS_MENU_LINKS "share/doc/@PROJECT_NAME@/user_guide.pdf"
>> 44
>>         "User's guide")
>> 45
>>     set(CPACK_NSIS_MENU_LINKS "share/doc/@PROJECT_NAME@/developer_guide.pdf"
>> 46
>>         "Developer's guide")
>> 47
>> ENDIF (WIN32)
>> 48
>>
>> trunk/cmake/pcl_utils.cmake (revision 9)
>> 1
>> ###############################################################################
>> 2
>> # Turn a list into a string, with each item separated by spaces.
>> 3
>> # _list List to stringify.
>> 4
>> # _string Name of the destination variable.
>> 5
>> macro(LIST_TO_STRING _list _string)
>> 6
>>     set(${_string})
>> 7
>>     foreach(_item ${_list})
>> 8
>>         set(${_string} "${${_string}} ${_item}")
>> 9
>>     endforeach(_item)
>> 10
>> endmacro(LIST_TO_STRING)
>> 11
>> 12
>> 13
>> ###############################################################################
>> 14
>> # Filter a list by a pattern.
>> 15
>> # _list List to filter.
>> 16
>> # _pattern The regular expression to filter by. See the if(... MATCHES ...)
>> 17
>> #   expression in the CMake help.
>> 18
>> # _output The name of the destination variable.
>> 19
>> macro(FILTER_LIST _list _pattern _output)
>> 20
>>     set(${_output})
>> 21
>>     foreach(_item ${_list})
>> 22
>>         if("${_item}" MATCHES ${_pattern})
>> 23
>>             set(${_output} ${${_output}} ${_item})
>> 24
>>         endif("${_item}" MATCHES ${_pattern})
>> 25
>>     endforeach(_item)
>> 26
>> endmacro(FILTER_LIST)
>> 27
>> 28
>> 29
>> ###############################################################################
>> 30
>> # Find a pkg-config file and use it.
>> 31
>> # _pkg The name of the package to search for.
>> 32
>> # _required Set to "REQUIRED" to cause an error if the package is not found.
>> 33
>> include(FindPkgConfig)
>> 34
>> macro(GET_PKG_CONFIG_INFO _pkg _required)
>> 35
>>     if(PKG_CONFIG_FOUND)
>> 36
>>         pkg_check_modules(${_pkg}_PKG ${_required} ${_pkg})
>> 37
>>         if(${_pkg}_PKG_CFLAGS_OTHER)
>> 38
>>             LIST_TO_STRING(${_pkg}_CFLAGS "${${_pkg}_PKG_CFLAGS_OTHER}")
>> 39
>>         else(${_pkg}_PKG_CFLAGS_OTHER)
>> 40
>>             set(${_pkg}_CFLAGS "")
>> 41
>>         endif(${_pkg}_PKG_CFLAGS_OTHER)
>> 42
>>         set(${_pkg}_INCLUDE_DIRS ${${_pkg}_PKG_INCLUDE_DIRS})
>> 43
>>         set(${_pkg}_LINK_LIBS ${${_pkg}_PKG_LIBRARIES})
>> 44
>>         set(${_pkg}_LIBRARY_DIRS ${${_pkg}_PKG_LIBRARY_DIRS})
>> 45
>>         if(${_pkg}_PKG_LDFLAGS_OTHER)
>> 46
>>             LIST_TO_STRING(${_pkg}_LINK_FLAGS ${${_pkg}_PKG_LDFLAGS_OTHER})
>> 47
>>         else(${_pkg}_PKG_LDFLAGS_OTHER)
>> 48
>>             set(${_pkg}_LINK_FLAGS "")
>> 49
>>         endif(${_pkg}_PKG_LDFLAGS_OTHER)
>> 50
>>     else(PKG_CONFIG_FOUND)
>> 51
>>         message(STATUS "Could not find pkg-config.")
>> 52
>>         message(STATUS
>> 53
>>             "You will need to set the following variables manually:")
>> 54
>>         message(STATUS "${_pkg}_INCLUDE_DIRS ${_pkg}_CFLAGS_OTHER ${_pkg}_LINK_LIBS ${_pkg}_LIBRARY_DIRS ${_pkg}_LINK_FLAGS")
>> 55
>>     endif(PKG_CONFIG_FOUND)
>> 56
>> endmacro(GET_PKG_CONFIG_INFO)
>> 57
>> 58
>> 59
>> ###############################################################################
>> 60
>> # Apply the results of a pkg-config search to the include and link directory
>> 61
>> # settings.
>> 62
>> # _pkg The name of the package who's settings should be applied.
>> 63
>> macro(APPLY_PKG_CONFIG_DIRS _pkg)
>> 64
>>     if(${_pkg}_INCLUDE_DIRS)
>> 65
>>         include_directories(${${_pkg}_INCLUDE_DIRS})
>> 66
>>     endif(${_pkg}_INCLUDE_DIRS)
>> 67
>>     if(${_pkg}_LIBRARY_DIRS)
>> 68
>>         link_directories(${${_pkg}_LIBRARY_DIRS})
>> 69
>>     endif(${_pkg}_LIBRARY_DIRS)
>> 70
>> endmacro(APPLY_PKG_CONFIG_DIRS)
>> 71
>> 72
>> 73
>> ###############################################################################
>> 74
>> # Apply the results of a pkg-config search to a list of targets, setting the
>> 75
>> # link flags and libraries to link to on each target based on the information
>> 76
>> # from the pkg-config file.
>> 77
>> # _pkg The name of the package who's settings should be applied.
>> 78
>> # Extra arguments: The targets to apply to.
>> 79
>> macro(APPLY_PKG_CONFIG_TO_TGTS _pkg)
>> 80
>>     if(${_pkg}_LINK_FLAGS)
>> 81
>>         foreach(_tgt ${ARGN})
>> 82
>>             set_target_properties(${_tgt} PROPERTIES
>> 83
>>                 LINK_FLAGS "${${_pkg}_LINK_FLAGS}")
>> 84
>>         endforeach(_tgt)
>> 85
>>     endif(${_pkg}_LINK_FLAGS)
>> 86
>>     if(${_pkg}_LINK_LIBS)
>> 87
>>         foreach(_tgt ${ARGN})
>> 88
>>             target_link_libraries(${_tgt} ${${_pkg}_LINK_LIBS})
>> 89
>>         endforeach(_tgt)
>> 90
>>     endif(${_pkg}_LINK_LIBS)
>> 91
>> endmacro(APPLY_PKG_CONFIG_TO_TGTS)
>> 92
>> 93
>> 94
>> ###############################################################################
>> 95
>> # Apply the results of a pkg-config search to a list of source files, setting
>> 96
>> # the compile flags on each file based on the information from the pkg-config
>> 97
>> # file.
>> 98
>> # _pkg The name of the package who's settings should be applied.
>> 99
>> # Extra arguments: The files to apply to.
>> 100
>> macro(APPLY_PKG_CONFIG_TO_SRCS _pkg)
>> 101
>>     if(${_pkg}_CFLAGS)
>> 102
>>         set_source_files_properties(${ARGN}
>> 103
>>             PROPERTIES COMPILE_FLAGS "${${_pkg}_CFLAGS}")
>> 104
>>     endif(${_pkg}_CFLAGS)
>> 105
>> endmacro(APPLY_PKG_CONFIG_TO_SRCS)
>> 106
>> 107
>> 108
>> ###############################################################################
>> 109
>> # Pull the component parts out of the version number.
>> 110
>> macro(DISSECT_VERSION)
>> 111
>>     # Find version components
>> 112
>>     string(REGEX REPLACE "^([0-9]+).*" "\\1 <smb://1>"
>> 113
>>         PCL_MAJOR_VERSION "${PCL_VERSION}")
>> 114
>>     string(REGEX REPLACE "^[0-9]+\\.([0-9]+).*" "\\1 <smb://1>"
>> 115
>>         PCL_MINOR_VERSION "${PCL_VERSION}")
>> 116
>>     string(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]+)" "\\1 <smb://1>"
>> 117
>>         PCL_REVISION_VERSION ${PCL_VERSION})
>> 118
>>     string(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.[0-9]+(.*)" "\\1 <smb://1>"
>> 119
>>         PCL_CANDIDATE_VERSION ${PCL_VERSION})
>> 120
>> endmacro(DISSECT_VERSION)
>> 121
>> 122
>> ###############################################################################
>> 123
>> # Get the operating system information. Generally, CMake does a good job of
>> 124
>> # this. Sometimes, though, it doesn't give enough information. This macro will
>> 125
>> # distinguish between the UNIX variants. Otherwise, use the CMake variables
>> 126
>> # such as WIN32 and APPLE and CYGWIN.
>> 127
>> # Sets OS_IS_64BIT if the operating system is 64-bit.
>> 128
>> # Sets LINUX if the operating system is Linux.
>> 129
>> macro(GET_OS_INFO)
>> 130
>>     string(REGEX MATCH "Linux" OS_IS_LINUX ${CMAKE_SYSTEM_NAME})
>> 131
>>     if(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86_64")
>> 132
>>         set(OS_IS_64BIT TRUE)
>> 133
>>     else(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86_64")
>> 134
>>         set(OS_IS_64BIT FALSE)
>> 135
>>     endif(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86_64")
>> 136
>> endmacro(GET_OS_INFO)
>> 137
>> 138
>> 139
>> ###############################################################################
>> 140
>> # Set the destination directories for installing stuff.
>> 141
>> # Sets LIB_INSTALL_DIR. Install libraries here.
>> 142
>> # Sets BIN_INSTALL_DIR. Install binaries here.
>> 143
>> # Sets INCLUDE_INSTALL_DIR. Install include files here, preferably in a
>> 144
>> # subdirectory named after the library in question (e.g.
>> 145
>> # "registration/blorgle.h")
>> 146
>> macro(SET_INSTALL_DIRS)
>> 147
>>     if(OS_IS_64BIT)
>> 148
>>         set(LIB_INSTALL_DIR "lib64")
>> 149
>>     else(OS_IS_64BIT)
>> 150
>>         set(LIB_INSTALL_DIR "lib")
>> 151
>>     endif(OS_IS_64BIT)
>> 152
>>     set(INCLUDE_INSTALL_DIR
>> 153
>>         "include/${PROJECT_NAME_LOWER}-${PCL_MAJOR_VERSION}.${PCL_MINOR_VERSION}")
>> 154
>> endmacro(SET_INSTALL_DIRS)
>> 155
>>
>> trunk/visualization/CMakeLists.txt (revision 9)
>> 1
>> cmake_minimum_required (VERSION 2.4.6)
>> 1
>> set(LIB_NAME visualization)
>> 2
>> set(LIB_DESC "Point cloud visualization classes")
>> 3
>> set(LIB_DEPS pcl)
>> 2 4
>> 3
>> include ($ENV{ROS_ROOT}/core/rosbuild/rosbuild.cmake)
>> 4
>> set (ROS_BUILD_TYPE RelWithDebInfo)
>> 5
>> rosbuild_init ()
>> 6
>> rosbuild_add_boost_directories ()
>> 5
>> set(build TRUE)
>> 6
>> PCL_LIB_OPTION(build LIB ${LIB_NAME} ON ${LIB_DEPS})
>> 7 7
>> 8
>> set (EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)
>> 9
>> include_directories (${CMAKE_CURRENT_BINARY_DIR})
>> 10
>> include_directories (src)
>> 8
>> if(build)
>> 9
>>     # Find Boost
>> 10
>>     # find_package(wxWidgets REQUIRED)
>> 11
>>     # include(${wxWidgets_USE_FILE})
>> 12
>>     # include_directories(${wxWidgets_INCLUDE_DIRS})
>> 13
>>     # find_package (VTK REQUIRED)
>> 14
>>     # include (${VTK_USE_FILE})
>> 11 15
>> 12
>> find_package(wxWidgets REQUIRED)
>> 13
>> include(${wxWidgets_USE_FILE})
>> 14
>> include_directories(${wxWidgets_INCLUDE_DIRS})
>> 15
>> find_package (VTK REQUIRED)
>> 16
>> include (${VTK_USE_FILE})
>> 16
>>     set(viz_srcs src/libpcl_visualization/interactor.cpp
>> 17
>>         src/libpcl_visualization/interactor_style.cpp
>> 18
>>         src/libpcl_visualization/point_cloud_handlers.cpp
>> 19
>>         src/libpcl_visualization/pcl_visualizer.cpp
>> 20
>>         src/libpcl_visualization/histogram_visualizer.cpp
>> 21
>>         src/libpcl_visualization/common/common.cpp
>> 22
>>         src/libpcl_visualization/common/io.cpp
>> 23
>>         src/libpcl_visualization/common/shapes.cpp
>> 24
>>         src/libpcl_visualization/common/float_image_utils.cpp
>> 25
>>         src/libpcl_visualization/common/image_widget_wx.cpp
>> 26
>>         src/libpcl_visualization/range_image_visualizer.cpp
>> 27
>>         src/libpcl_visualization/cloud_viewer.cpp
>> 28
>>         )
>> 17 29
>> 18
>> ## ---[ Point Cloud Library - Visualization
>> 19
>> rosbuild_add_library (pcl_visualization
>> 20
>>                       src/libpcl_visualization/interactor.cpp
>> 21
>>                       src/libpcl_visualization/interactor_style.cpp
>> 22
>>                       src/libpcl_visualization/point_cloud_handlers.cpp
>> 23
>>                       src/libpcl_visualization/pcl_visualizer.cpp
>> 24
>>                       src/libpcl_visualization/histogram_visualizer.cpp
>> 25
>>                       src/libpcl_visualization/common/common.cpp
>> 26
>>                       src/libpcl_visualization/common/io.cpp
>> 27
>>                       src/libpcl_visualization/common/shapes.cpp
>> 28
>>                       src/libpcl_visualization/common/float_image_utils.cpp
>> 29
>>                       src/libpcl_visualization/common/image_widget_wx.cpp
>> 30
>>                       src/libpcl_visualization/range_image_visualizer.cpp
>> 31
>>                       src/libpcl_visualization/cloud_viewer.cpp
>> 32
>>                      )
>> 33
>> target_link_libraries (pcl_visualization vtkCommon vtkWidgets vtkHybrid ${wxWidgets_LIBRARIES})
>> 30
>>     # link to vtkCommon, vtkWIdgets, vtkHybrid, ${wxWidgets_LIBRARIES}
>> 34 31
>> 35
>> rosbuild_add_executable (test_pcl_vis src/test.cpp)
>> 36
>> target_link_libraries (test_pcl_vis pcl_visualization)
>> 32
>>     # executable: test_pcl_vis src/test.cpp
>> 33
>>     # executable: test_geometry src/test_geometry.cpp
>> 34
>>     # executable: test_shapes src/test_shapes.cpp
>> 35
>>     # share data: http://pr.willowgarage.com/data/pcl/partial_cup_model_new.pcd
>> 36
>>     # subdir: src/examples
>> 37
>>     # subdir: src/tools
>> 38
>> endif(build)
>> 37 39
>> 38
>> rosbuild_add_executable (test_geometry src/test_geometry.cpp)
>> 39
>> target_link_libraries (test_geometry pcl_visualization)
>> 40
>> 41
>> rosbuild_add_executable (test_shapes src/test_shapes.cpp)
>> 42
>> target_link_libraries (test_shapes pcl_visualization)
>> 43
>> 44
>> rosbuild_download_data (http://pr.willowgarage.com/data/pcl/partial_cup_model_new.pcd data/partial_cup_model.pcd a9acd00d71cfdd3c176053f1fd1497c8 <http://pr.willowgarage.com/data/pcl/partial_cup_model_new.pcd%20data/partial_cup_model.pcd%20a9acd00d71cfdd3c176053f1fd1497c8>)
>> 45
>> 46
>> add_subdirectory (src/examples)
>> 47
>> add_subdirectory (src/tools)
>> 48
>> # Option to generate a standalone tarball
>> 49
>> add_custom_target (tarball ${PROJECT_SOURCE_DIR}/make_tarball WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} VERBATIM)
>> 50
>> 51
>>
>> trunk/CMakeLists.txt (revision 9)
>> 1
>> cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
>> 2
>> 1 3
>> project(PCL)
>> 4
>> string(TOLOWER ${PROJECT_NAME} PROJECT_NAME_LOWER)
>> 2 5
>> 6
>> include(${PROJECT_SOURCE_DIR}/cmake/pcl_utils.cmake)
>> 7
>> set(PCL_VERSION 2.0.0 CACHE STRING "PCL version")
>> 8
>> DISSECT_VERSION()
>> 9
>> GET_OS_INFO()
>> 10
>> SET_INSTALL_DIRS()
>> 11
>> 12
>> # Add an "uninstall" target
>> 13
>> CONFIGURE_FILE ("${PROJECT_SOURCE_DIR}/cmake/uninstall_target.cmake.in"
>> 14
>>     "${PROJECT_BINARY_DIR}/uninstall_target.cmake" IMMEDIATE @ONLY)
>> 15
>> ADD_CUSTOM_TARGET (uninstall "${CMAKE_COMMAND}" -P
>> 16
>>     "${PROJECT_BINARY_DIR}/uninstall_target.cmake")
>> 17
>> 18
>> # Add the library subdirectories
>> 19
>> add_subdirectory(pcl)
>> 20
>> add_subdirectory(visualization)
>> 21
>> 22
>> # Package creation
>> 23
>> include(InstallRequiredSystemLibraries)
>> 24
>> configure_file("${PROJECT_SOURCE_DIR}/cmake/cpack_options.cmake.in"
>> 25
>>     "${PROJECT_BINARY_DIR}/cpack_options.cmake" @ONLY)
>> 26
>> set(CPACK_PROJECT_CONFIG_FILE "${PROJECT_BINARY_DIR}/cpack_options.cmake")
>> 27
>> include(CPack)
>> 28
>>
>> You have received this notification because you have either subscribed
>> to it, or are involved in it.
>> To change your notification preferences, please click
>> here: http://pointclouds.org/devel/my/account.
>>
>> <changeset_rev_9.diff>
>
>
>
> _______________________________________________
> PCL-developers mailing list
> [hidden email]
> http://pointclouds.org/mailman/listinfo/pcl-developers
> http://pointclouds.org

Reply | Threaded
Open this post in threaded view
|

Re: [Point Cloud Library] Commit by Geoffrey Biggs: Started new build system

nizar sallem

On Mar 3, 2011, at 4:20 PM, Geoff Biggs wrote:

> Hi Nizar,
>
> We found with Player that it was a benefit to properly install into
> lib64 on 64-bit operating systems. Some distros expect this and were
> doing strange things when we didn't keep in line. That macro also only
> gets called once, so I'm not sure who it would be confusing to.
>
I had experimented this with a LAAS project and on Mac OS it behaves really strange if installed on some 64 folder
> include/project_name is fairly common for projects that have several
> sub-libraries and divide their includes up into matching directories.
> It's taken care of by the cflags that will be provided in pkg-config
> files, plus anyone who uses the to-be-written CMake modules will have it
> even easier. Appending the version is not common but useful if we want
> to support multiple versions of the libraries installed at once. That's
> something that's not decided yet, though.
>
This is the confusing part :)

--
Nizar SALLEM
Robotics and Artificial Intelligence PhD student
LAAS-CNRS
7, Avenue Colonel Roche
31077 Toulouse CEDEX 4
FRANCE

> Geoff
>
>
> On 03/03/11 23:50, Nizar Khalifa Sallem wrote:
>> Hi Geoffrey,
>>
>> In my opinion the macro set_install_dirs is really optional and confusing:
>> even if the os is 64bits it has a lib directory for sure also
>> include/project_name-version.revision is not something very common.
>>
>> Sorry for duplicates.
>> --
>> Nizar SALLEM
>> Robotics and Artificial Intelligence PhD student
>> LAAS-CNRS
>> 7, Avenue Colonel Roche
>> 31077 Toulouse CEDEX 4
>> FRANCE
>>
>>
>>
>>
>> On Mar 3, 2011, at 3:20 PM, [hidden email]
>> <mailto:[hidden email]> wrote:
>>
>>> *Project:* Point Cloud Library <http://dev.pointclouds.org/projects/1>
>>> *Revision:* 9
>>> <http://dev.pointclouds.org/projects/1/repository/revisions/9/diff>
>>> *Author:* Geoffrey Biggs
>>> *Summary:* Started new build system
>>> *Details:*
>>>
>>> Please take a moment to review this checkin.
>>>
>>> ------------------------------------------------------------------------
>>> trunk/cmake/cpack_options.cmake.in (revision 9)
>>> 1
>>> set(CPACK_PACKAGE_NAME "@PROJECT_NAME@")
>>> 2
>>> set(CPACK_PACKAGE_VERSION_MAJOR "@PCL_MAJOR_VERSION@")
>>> 3
>>> set(CPACK_PACKAGE_VERSION_MINOR "@PCL_MINOR_VERSION@")
>>> 4
>>> set(CPACK_PACKAGE_VERSION_PATCH "@PCL_REVISION_VERSION@")
>>> 5
>>> set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Point cloud library")
>>> 6
>>> set(CPACK_PACKAGE_INSTALL_DIRECTORY "@PROJECT_NAME@")
>>> 7
>>> set(CPACK_PACKAGE_FILE_NAME "@PROJECT_NAME@-@PCL_VERSION@")
>>> 8
>>> set(CPACK_RESOURCE_FILE_LICENSE "@PROJECT_SOURCE_DIR@/LICENSE.txt")
>>> 9
>>> 10
>>> set(CPACK_COMPONENTS_ALL headers libraries utilities pkgconfig doc examples)
>>> 11
>>> set(CPACK_COMPONENT_HEADERS_DISPLAY_NAME "Header files")
>>> 12
>>> set(CPACK_COMPONENT_HEADERS_DESCRIPTION
>>> 13
>>>    "Header files from the component.")
>>> 14
>>> set(CPACK_COMPONENT_HEADERS_DEPENDS libraries)
>>> 15
>>> set(CPACK_COMPONENT_LIBRARIES_DISPLAY_NAME "Libraries")
>>> 16
>>> set(CPACK_COMPONENT_LIBRARIES_DESCRIPTION
>>> 17
>>>    "Core libraries.")
>>> 18
>>> set(CPACK_COMPONENT_UTILITIES_DISPLAY_NAME "Utilities")
>>> 19
>>> set(CPACK_COMPONENT_UTILITIES_DESCRIPTION
>>> 20
>>>    "Utilities for working with point clouds.")
>>> 21
>>> set(CPACK_COMPONENT_UTILITIES_DEPENDS libraries)
>>> 22
>>> set(CPACK_COMPONENT_PKGCONFIG_DISPLAY_NAME "pkg-config file.")
>>> 23
>>> set(CPACK_COMPONENT_PKGCONFIG_DESCRIPTION
>>> 24
>>>    "File for use with the pkg-config system.")
>>> 25
>>> set(CPACK_COMPONENT_PKGCONFIG_DEPENDS libraries headers)
>>> 26
>>> set(CPACK_COMPONENT_DOC_DISPLAY_NAME "Documentation")
>>> 27
>>> set(CPACK_COMPONENT_DOC_DESCRIPTION
>>> 28
>>>    "User's and developer's guides.")
>>> 29
>>> set(CPACK_COMPONENT_DOC_DEPENDS libraries)
>>> 30
>>> set(CPACK_COMPONENT_EXAMPLES_DISPLAY_NAME "Examples")
>>> 31
>>> set(CPACK_COMPONENT_EXAMPLES_DESCRIPTION
>>> 32
>>>    "Sample source code and executables.")
>>> 33
>>> set(CPACK_COMPONENT_EXAMPLES_DEPENDS libraries headers pkgconfig)
>>> 34
>>> 35
>>> IF (WIN32)
>>> 36
>>>    set(CPACK_NSIS_MUI_ICON "@PROJECT_SOURCE_DIR@/cmake\\pcl_logo.ico")
>>> 37
>>>    set(CPACK_NSIS_MUI_UNIICON "@PROJECT_SOURCE_DIR@/cmake\\pcl_logo.ico")
>>> 38
>>>    set(CPACK_PACKAGE_ICON "@PROJECT_SOURCE_DIR@/cmake\\pcl_logo.bmp")
>>> 39
>>>    set(CPACK_NSIS_HELP_LINK "http://www.pointclouds.org <http://www.pointclouds.org/>")
>>> 40
>>>    set(CPACK_NSIS_URL_INFO_ABOUT "http://www.pointclouds.org <http://www.pointclouds.org/>")
>>> 41
>>>    set(CPACK_NSIS_MODIFY_PATH ON)
>>> 42
>>>    set(CPACK_PACKAGE_EXECUTABLES @PCL_EXECUTABLES@)
>>> 43
>>>    set(CPACK_NSIS_MENU_LINKS "share/doc/@PROJECT_NAME@/user_guide.pdf"
>>> 44
>>>        "User's guide")
>>> 45
>>>    set(CPACK_NSIS_MENU_LINKS "share/doc/@PROJECT_NAME@/developer_guide.pdf"
>>> 46
>>>        "Developer's guide")
>>> 47
>>> ENDIF (WIN32)
>>> 48
>>>
>>> trunk/cmake/pcl_utils.cmake (revision 9)
>>> 1
>>> ###############################################################################
>>> 2
>>> # Turn a list into a string, with each item separated by spaces.
>>> 3
>>> # _list List to stringify.
>>> 4
>>> # _string Name of the destination variable.
>>> 5
>>> macro(LIST_TO_STRING _list _string)
>>> 6
>>>    set(${_string})
>>> 7
>>>    foreach(_item ${_list})
>>> 8
>>>        set(${_string} "${${_string}} ${_item}")
>>> 9
>>>    endforeach(_item)
>>> 10
>>> endmacro(LIST_TO_STRING)
>>> 11
>>> 12
>>> 13
>>> ###############################################################################
>>> 14
>>> # Filter a list by a pattern.
>>> 15
>>> # _list List to filter.
>>> 16
>>> # _pattern The regular expression to filter by. See the if(... MATCHES ...)
>>> 17
>>> #   expression in the CMake help.
>>> 18
>>> # _output The name of the destination variable.
>>> 19
>>> macro(FILTER_LIST _list _pattern _output)
>>> 20
>>>    set(${_output})
>>> 21
>>>    foreach(_item ${_list})
>>> 22
>>>        if("${_item}" MATCHES ${_pattern})
>>> 23
>>>            set(${_output} ${${_output}} ${_item})
>>> 24
>>>        endif("${_item}" MATCHES ${_pattern})
>>> 25
>>>    endforeach(_item)
>>> 26
>>> endmacro(FILTER_LIST)
>>> 27
>>> 28
>>> 29
>>> ###############################################################################
>>> 30
>>> # Find a pkg-config file and use it.
>>> 31
>>> # _pkg The name of the package to search for.
>>> 32
>>> # _required Set to "REQUIRED" to cause an error if the package is not found.
>>> 33
>>> include(FindPkgConfig)
>>> 34
>>> macro(GET_PKG_CONFIG_INFO _pkg _required)
>>> 35
>>>    if(PKG_CONFIG_FOUND)
>>> 36
>>>        pkg_check_modules(${_pkg}_PKG ${_required} ${_pkg})
>>> 37
>>>        if(${_pkg}_PKG_CFLAGS_OTHER)
>>> 38
>>>            LIST_TO_STRING(${_pkg}_CFLAGS "${${_pkg}_PKG_CFLAGS_OTHER}")
>>> 39
>>>        else(${_pkg}_PKG_CFLAGS_OTHER)
>>> 40
>>>            set(${_pkg}_CFLAGS "")
>>> 41
>>>        endif(${_pkg}_PKG_CFLAGS_OTHER)
>>> 42
>>>        set(${_pkg}_INCLUDE_DIRS ${${_pkg}_PKG_INCLUDE_DIRS})
>>> 43
>>>        set(${_pkg}_LINK_LIBS ${${_pkg}_PKG_LIBRARIES})
>>> 44
>>>        set(${_pkg}_LIBRARY_DIRS ${${_pkg}_PKG_LIBRARY_DIRS})
>>> 45
>>>        if(${_pkg}_PKG_LDFLAGS_OTHER)
>>> 46
>>>            LIST_TO_STRING(${_pkg}_LINK_FLAGS ${${_pkg}_PKG_LDFLAGS_OTHER})
>>> 47
>>>        else(${_pkg}_PKG_LDFLAGS_OTHER)
>>> 48
>>>            set(${_pkg}_LINK_FLAGS "")
>>> 49
>>>        endif(${_pkg}_PKG_LDFLAGS_OTHER)
>>> 50
>>>    else(PKG_CONFIG_FOUND)
>>> 51
>>>        message(STATUS "Could not find pkg-config.")
>>> 52
>>>        message(STATUS
>>> 53
>>>            "You will need to set the following variables manually:")
>>> 54
>>>        message(STATUS "${_pkg}_INCLUDE_DIRS ${_pkg}_CFLAGS_OTHER ${_pkg}_LINK_LIBS ${_pkg}_LIBRARY_DIRS ${_pkg}_LINK_FLAGS")
>>> 55
>>>    endif(PKG_CONFIG_FOUND)
>>> 56
>>> endmacro(GET_PKG_CONFIG_INFO)
>>> 57
>>> 58
>>> 59
>>> ###############################################################################
>>> 60
>>> # Apply the results of a pkg-config search to the include and link directory
>>> 61
>>> # settings.
>>> 62
>>> # _pkg The name of the package who's settings should be applied.
>>> 63
>>> macro(APPLY_PKG_CONFIG_DIRS _pkg)
>>> 64
>>>    if(${_pkg}_INCLUDE_DIRS)
>>> 65
>>>        include_directories(${${_pkg}_INCLUDE_DIRS})
>>> 66
>>>    endif(${_pkg}_INCLUDE_DIRS)
>>> 67
>>>    if(${_pkg}_LIBRARY_DIRS)
>>> 68
>>>        link_directories(${${_pkg}_LIBRARY_DIRS})
>>> 69
>>>    endif(${_pkg}_LIBRARY_DIRS)
>>> 70
>>> endmacro(APPLY_PKG_CONFIG_DIRS)
>>> 71
>>> 72
>>> 73
>>> ###############################################################################
>>> 74
>>> # Apply the results of a pkg-config search to a list of targets, setting the
>>> 75
>>> # link flags and libraries to link to on each target based on the information
>>> 76
>>> # from the pkg-config file.
>>> 77
>>> # _pkg The name of the package who's settings should be applied.
>>> 78
>>> # Extra arguments: The targets to apply to.
>>> 79
>>> macro(APPLY_PKG_CONFIG_TO_TGTS _pkg)
>>> 80
>>>    if(${_pkg}_LINK_FLAGS)
>>> 81
>>>        foreach(_tgt ${ARGN})
>>> 82
>>>            set_target_properties(${_tgt} PROPERTIES
>>> 83
>>>                LINK_FLAGS "${${_pkg}_LINK_FLAGS}")
>>> 84
>>>        endforeach(_tgt)
>>> 85
>>>    endif(${_pkg}_LINK_FLAGS)
>>> 86
>>>    if(${_pkg}_LINK_LIBS)
>>> 87
>>>        foreach(_tgt ${ARGN})
>>> 88
>>>            target_link_libraries(${_tgt} ${${_pkg}_LINK_LIBS})
>>> 89
>>>        endforeach(_tgt)
>>> 90
>>>    endif(${_pkg}_LINK_LIBS)
>>> 91
>>> endmacro(APPLY_PKG_CONFIG_TO_TGTS)
>>> 92
>>> 93
>>> 94
>>> ###############################################################################
>>> 95
>>> # Apply the results of a pkg-config search to a list of source files, setting
>>> 96
>>> # the compile flags on each file based on the information from the pkg-config
>>> 97
>>> # file.
>>> 98
>>> # _pkg The name of the package who's settings should be applied.
>>> 99
>>> # Extra arguments: The files to apply to.
>>> 100
>>> macro(APPLY_PKG_CONFIG_TO_SRCS _pkg)
>>> 101
>>>    if(${_pkg}_CFLAGS)
>>> 102
>>>        set_source_files_properties(${ARGN}
>>> 103
>>>            PROPERTIES COMPILE_FLAGS "${${_pkg}_CFLAGS}")
>>> 104
>>>    endif(${_pkg}_CFLAGS)
>>> 105
>>> endmacro(APPLY_PKG_CONFIG_TO_SRCS)
>>> 106
>>> 107
>>> 108
>>> ###############################################################################
>>> 109
>>> # Pull the component parts out of the version number.
>>> 110
>>> macro(DISSECT_VERSION)
>>> 111
>>>    # Find version components
>>> 112
>>>    string(REGEX REPLACE "^([0-9]+).*" "\\1 <smb://1>"
>>> 113
>>>        PCL_MAJOR_VERSION "${PCL_VERSION}")
>>> 114
>>>    string(REGEX REPLACE "^[0-9]+\\.([0-9]+).*" "\\1 <smb://1>"
>>> 115
>>>        PCL_MINOR_VERSION "${PCL_VERSION}")
>>> 116
>>>    string(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]+)" "\\1 <smb://1>"
>>> 117
>>>        PCL_REVISION_VERSION ${PCL_VERSION})
>>> 118
>>>    string(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.[0-9]+(.*)" "\\1 <smb://1>"
>>> 119
>>>        PCL_CANDIDATE_VERSION ${PCL_VERSION})
>>> 120
>>> endmacro(DISSECT_VERSION)
>>> 121
>>> 122
>>> ###############################################################################
>>> 123
>>> # Get the operating system information. Generally, CMake does a good job of
>>> 124
>>> # this. Sometimes, though, it doesn't give enough information. This macro will
>>> 125
>>> # distinguish between the UNIX variants. Otherwise, use the CMake variables
>>> 126
>>> # such as WIN32 and APPLE and CYGWIN.
>>> 127
>>> # Sets OS_IS_64BIT if the operating system is 64-bit.
>>> 128
>>> # Sets LINUX if the operating system is Linux.
>>> 129
>>> macro(GET_OS_INFO)
>>> 130
>>>    string(REGEX MATCH "Linux" OS_IS_LINUX ${CMAKE_SYSTEM_NAME})
>>> 131
>>>    if(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86_64")
>>> 132
>>>        set(OS_IS_64BIT TRUE)
>>> 133
>>>    else(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86_64")
>>> 134
>>>        set(OS_IS_64BIT FALSE)
>>> 135
>>>    endif(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86_64")
>>> 136
>>> endmacro(GET_OS_INFO)
>>> 137
>>> 138
>>> 139
>>> ###############################################################################
>>> 140
>>> # Set the destination directories for installing stuff.
>>> 141
>>> # Sets LIB_INSTALL_DIR. Install libraries here.
>>> 142
>>> # Sets BIN_INSTALL_DIR. Install binaries here.
>>> 143
>>> # Sets INCLUDE_INSTALL_DIR. Install include files here, preferably in a
>>> 144
>>> # subdirectory named after the library in question (e.g.
>>> 145
>>> # "registration/blorgle.h")
>>> 146
>>> macro(SET_INSTALL_DIRS)
>>> 147
>>>    if(OS_IS_64BIT)
>>> 148
>>>        set(LIB_INSTALL_DIR "lib64")
>>> 149
>>>    else(OS_IS_64BIT)
>>> 150
>>>        set(LIB_INSTALL_DIR "lib")
>>> 151
>>>    endif(OS_IS_64BIT)
>>> 152
>>>    set(INCLUDE_INSTALL_DIR
>>> 153
>>>        "include/${PROJECT_NAME_LOWER}-${PCL_MAJOR_VERSION}.${PCL_MINOR_VERSION}")
>>> 154
>>> endmacro(SET_INSTALL_DIRS)
>>> 155
>>>
>>> trunk/visualization/CMakeLists.txt (revision 9)
>>> 1
>>> cmake_minimum_required (VERSION 2.4.6)
>>> 1
>>> set(LIB_NAME visualization)
>>> 2
>>> set(LIB_DESC "Point cloud visualization classes")
>>> 3
>>> set(LIB_DEPS pcl)
>>> 2 4
>>> 3
>>> include ($ENV{ROS_ROOT}/core/rosbuild/rosbuild.cmake)
>>> 4
>>> set (ROS_BUILD_TYPE RelWithDebInfo)
>>> 5
>>> rosbuild_init ()
>>> 6
>>> rosbuild_add_boost_directories ()
>>> 5
>>> set(build TRUE)
>>> 6
>>> PCL_LIB_OPTION(build LIB ${LIB_NAME} ON ${LIB_DEPS})
>>> 7 7
>>> 8
>>> set (EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)
>>> 9
>>> include_directories (${CMAKE_CURRENT_BINARY_DIR})
>>> 10
>>> include_directories (src)
>>> 8
>>> if(build)
>>> 9
>>>    # Find Boost
>>> 10
>>>    # find_package(wxWidgets REQUIRED)
>>> 11
>>>    # include(${wxWidgets_USE_FILE})
>>> 12
>>>    # include_directories(${wxWidgets_INCLUDE_DIRS})
>>> 13
>>>    # find_package (VTK REQUIRED)
>>> 14
>>>    # include (${VTK_USE_FILE})
>>> 11 15
>>> 12
>>> find_package(wxWidgets REQUIRED)
>>> 13
>>> include(${wxWidgets_USE_FILE})
>>> 14
>>> include_directories(${wxWidgets_INCLUDE_DIRS})
>>> 15
>>> find_package (VTK REQUIRED)
>>> 16
>>> include (${VTK_USE_FILE})
>>> 16
>>>    set(viz_srcs src/libpcl_visualization/interactor.cpp
>>> 17
>>>        src/libpcl_visualization/interactor_style.cpp
>>> 18
>>>        src/libpcl_visualization/point_cloud_handlers.cpp
>>> 19
>>>        src/libpcl_visualization/pcl_visualizer.cpp
>>> 20
>>>        src/libpcl_visualization/histogram_visualizer.cpp
>>> 21
>>>        src/libpcl_visualization/common/common.cpp
>>> 22
>>>        src/libpcl_visualization/common/io.cpp
>>> 23
>>>        src/libpcl_visualization/common/shapes.cpp
>>> 24
>>>        src/libpcl_visualization/common/float_image_utils.cpp
>>> 25
>>>        src/libpcl_visualization/common/image_widget_wx.cpp
>>> 26
>>>        src/libpcl_visualization/range_image_visualizer.cpp
>>> 27
>>>        src/libpcl_visualization/cloud_viewer.cpp
>>> 28
>>>        )
>>> 17 29
>>> 18
>>> ## ---[ Point Cloud Library - Visualization
>>> 19
>>> rosbuild_add_library (pcl_visualization
>>> 20
>>>                      src/libpcl_visualization/interactor.cpp
>>> 21
>>>                      src/libpcl_visualization/interactor_style.cpp
>>> 22
>>>                      src/libpcl_visualization/point_cloud_handlers.cpp
>>> 23
>>>                      src/libpcl_visualization/pcl_visualizer.cpp
>>> 24
>>>                      src/libpcl_visualization/histogram_visualizer.cpp
>>> 25
>>>                      src/libpcl_visualization/common/common.cpp
>>> 26
>>>                      src/libpcl_visualization/common/io.cpp
>>> 27
>>>                      src/libpcl_visualization/common/shapes.cpp
>>> 28
>>>                      src/libpcl_visualization/common/float_image_utils.cpp
>>> 29
>>>                      src/libpcl_visualization/common/image_widget_wx.cpp
>>> 30
>>>                      src/libpcl_visualization/range_image_visualizer.cpp
>>> 31
>>>                      src/libpcl_visualization/cloud_viewer.cpp
>>> 32
>>>                     )
>>> 33
>>> target_link_libraries (pcl_visualization vtkCommon vtkWidgets vtkHybrid ${wxWidgets_LIBRARIES})
>>> 30
>>>    # link to vtkCommon, vtkWIdgets, vtkHybrid, ${wxWidgets_LIBRARIES}
>>> 34 31
>>> 35
>>> rosbuild_add_executable (test_pcl_vis src/test.cpp)
>>> 36
>>> target_link_libraries (test_pcl_vis pcl_visualization)
>>> 32
>>>    # executable: test_pcl_vis src/test.cpp
>>> 33
>>>    # executable: test_geometry src/test_geometry.cpp
>>> 34
>>>    # executable: test_shapes src/test_shapes.cpp
>>> 35
>>>    # share data: http://pr.willowgarage.com/data/pcl/partial_cup_model_new.pcd
>>> 36
>>>    # subdir: src/examples
>>> 37
>>>    # subdir: src/tools
>>> 38
>>> endif(build)
>>> 37 39
>>> 38
>>> rosbuild_add_executable (test_geometry src/test_geometry.cpp)
>>> 39
>>> target_link_libraries (test_geometry pcl_visualization)
>>> 40
>>> 41
>>> rosbuild_add_executable (test_shapes src/test_shapes.cpp)
>>> 42
>>> target_link_libraries (test_shapes pcl_visualization)
>>> 43
>>> 44
>>> rosbuild_download_data (http://pr.willowgarage.com/data/pcl/partial_cup_model_new.pcd data/partial_cup_model.pcd a9acd00d71cfdd3c176053f1fd1497c8 <http://pr.willowgarage.com/data/pcl/partial_cup_model_new.pcd%20data/partial_cup_model.pcd%20a9acd00d71cfdd3c176053f1fd1497c8>)
>>> 45
>>> 46
>>> add_subdirectory (src/examples)
>>> 47
>>> add_subdirectory (src/tools)
>>> 48
>>> # Option to generate a standalone tarball
>>> 49
>>> add_custom_target (tarball ${PROJECT_SOURCE_DIR}/make_tarball WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} VERBATIM)
>>> 50
>>> 51
>>>
>>> trunk/CMakeLists.txt (revision 9)
>>> 1
>>> cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
>>> 2
>>> 1 3
>>> project(PCL)
>>> 4
>>> string(TOLOWER ${PROJECT_NAME} PROJECT_NAME_LOWER)
>>> 2 5
>>> 6
>>> include(${PROJECT_SOURCE_DIR}/cmake/pcl_utils.cmake)
>>> 7
>>> set(PCL_VERSION 2.0.0 CACHE STRING "PCL version")
>>> 8
>>> DISSECT_VERSION()
>>> 9
>>> GET_OS_INFO()
>>> 10
>>> SET_INSTALL_DIRS()
>>> 11
>>> 12
>>> # Add an "uninstall" target
>>> 13
>>> CONFIGURE_FILE ("${PROJECT_SOURCE_DIR}/cmake/uninstall_target.cmake.in"
>>> 14
>>>    "${PROJECT_BINARY_DIR}/uninstall_target.cmake" IMMEDIATE @ONLY)
>>> 15
>>> ADD_CUSTOM_TARGET (uninstall "${CMAKE_COMMAND}" -P
>>> 16
>>>    "${PROJECT_BINARY_DIR}/uninstall_target.cmake")
>>> 17
>>> 18
>>> # Add the library subdirectories
>>> 19
>>> add_subdirectory(pcl)
>>> 20
>>> add_subdirectory(visualization)
>>> 21
>>> 22
>>> # Package creation
>>> 23
>>> include(InstallRequiredSystemLibraries)
>>> 24
>>> configure_file("${PROJECT_SOURCE_DIR}/cmake/cpack_options.cmake.in"
>>> 25
>>>    "${PROJECT_BINARY_DIR}/cpack_options.cmake" @ONLY)
>>> 26
>>> set(CPACK_PROJECT_CONFIG_FILE "${PROJECT_BINARY_DIR}/cpack_options.cmake")
>>> 27
>>> include(CPack)
>>> 28
>>>
>>> You have received this notification because you have either subscribed
>>> to it, or are involved in it.
>>> To change your notification preferences, please click
>>> here: http://pointclouds.org/devel/my/account.
>>>
>>> <changeset_rev_9.diff>
>>
>>
>>
>> _______________________________________________
>> PCL-developers mailing list
>> [hidden email]
>> http://pointclouds.org/mailman/listinfo/pcl-developers
>> http://pointclouds.org
> _______________________________________________
> PCL-developers mailing list
> [hidden email]
> http://pointclouds.org/mailman/listinfo/pcl-developers
> http://pointclouds.org


Reply | Threaded
Open this post in threaded view
|

Re: [Point Cloud Library] Commit by Geoffrey Biggs: Started new build system

Geoff Biggs
On Thu, 03 Mar 2011 16:31 +0100, "Nizar Khalifa Sallem"
<[hidden email]> wrote:

>
> On Mar 3, 2011, at 4:20 PM, Geoff Biggs wrote:
>
> > Hi Nizar,
> >
> > We found with Player that it was a benefit to properly install into
> > lib64 on 64-bit operating systems. Some distros expect this and were
> > doing strange things when we didn't keep in line. That macro also only
> > gets called once, so I'm not sure who it would be confusing to.
> >
> I had experimented this with a LAAS project and on Mac OS it behaves
> really strange if installed on some 64 folder

If that's all the problem is, then it's easy to deal with. I'll make the
install folder "lib" on OSX.

> > include/project_name is fairly common for projects that have several
> > sub-libraries and divide their includes up into matching directories.
> > It's taken care of by the cflags that will be provided in pkg-config
> > files, plus anyone who uses the to-be-written CMake modules will have it
> > even easier. Appending the version is not common but useful if we want
> > to support multiple versions of the libraries installed at once. That's
> > something that's not decided yet, though.
> >
> This is the confusing part :)

And it's something we need to decide. :) Do we want to support multiple
versions
installed at once?

Pros:
- It's easy to do for the shared modules and include files and shared
data
- It allows the user to work with multiple versions should the API
change

Cons:
- It's hard to manage binaries because they'll clash
- There's no proven need for users to want to work with multiple
versions

Geoff

Reply | Threaded
Open this post in threaded view
|

Re: [Point Cloud Library] Commit by Geoffrey Biggs: Started new build system

Radu B. Rusu
Administrator

On 03/03/2011 04:34 PM, Geoff wrote:
> And it's something we need to decide. :) Do we want to support multiple
> versions
> installed at once?

+1 here. It does make sense. If boost can do it, so we can we :) (last famous words).

>
> Pros:
> - It's easy to do for the shared modules and include files and shared
> data
> - It allows the user to work with multiple versions should the API
> change
>
> Cons:
> - It's hard to manage binaries because they'll clash

We don't have a lot of binaries, but in principle, I agree.

> - There's no proven need for users to want to work with multiple
> versions

True, not right now. One thing would be "stable" vs "devel" (1.x, 2.x).


Cheers,
Radu.
--
http://pointclouds.org