[openrtm-commit:02472] r692 - in trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/template/cmake: . idl src
openrtm @ openrtm.org
openrtm @ openrtm.org
2017年 2月 21日 (火) 12:40:01 JST
Author: ga
Date: 2017-02-21 12:40:01 +0900 (Tue, 21 Feb 2017)
New Revision: 692
Modified:
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/template/cmake/CMakeLists.txt.vsl
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/template/cmake/idl/IdlCMakeLists.txt.vsl
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/template/cmake/src/SrcCMakeLists.txt.vsl
Log:
Modified generated CMakeFile for DEB/RPM Packaging #3601
Modified: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/template/cmake/CMakeLists.txt.vsl
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/template/cmake/CMakeLists.txt.vsl 2017-02-21 03:21:59 UTC (rev 691)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/template/cmake/CMakeLists.txt.vsl 2017-02-21 03:40:01 UTC (rev 692)
@@ -1,4 +1,8 @@
cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
+cmake_policy(SET CMP0002 OLD)
+if(POLICY CMP0046)
+ cmake_policy(SET CMP0046 OLD)
+endif()
if(POLICY CMP0048)
cmake_policy(SET CMP0048 OLD)
endif()
@@ -16,6 +20,58 @@
set(PROJECT_MAINTAINER "unknown")
set(PROJECT_TYPE "c++/${rtcParam.category}")
+function(get_dist ARG0)
+ if(NOT ${dol}{CMAKE_SYSTEM_NAME} MATCHES "Linux")
+ set(${dol}{ARG0} ${dol}{CMAKE_SYSTEM_NAME} PARENT_SCOPE)
+ return()
+ endif()
+ foreach(dist Debian Ubuntu RedHat Fedora CentOS)
+ execute_process(
+ COMMAND grep ${dol}{dist} -s /etc/issue /etc/os-release /etc/redhat-release /etc/system-release
+ OUTPUT_VARIABLE dist_name
+ )
+ if(${dol}{dist_name} MATCHES ${dol}{dist})
+ set(${dol}{ARG0} ${dol}{dist} PARENT_SCOPE)
+ return()
+ endif()
+ endforeach()
+endfunction(get_dist)
+
+function(get_pkgmgr ARG0)
+ get_dist(DIST_NAME)
+ if(${dol}{DIST_NAME} MATCHES "Debian" OR
+ ${dol}{DIST_NAME} MATCHES "Ubuntu")
+ set(${dol}{ARG0} "DEB" PARENT_SCOPE)
+ return()
+ endif()
+ if(${dol}{DIST_NAME} MATCHES "RedHat" OR
+ ${dol}{DIST_NAME} MATCHES "Fedora" OR
+ ${dol}{DIST_NAME} MATCHES "CentOS")
+ set(${dol}{ARG0} "RPM" PARENT_SCOPE)
+ return()
+ endif()
+endfunction(get_pkgmgr)
+
+get_dist(DIST_NAME)
+MESSAGE(STATUS "Distribution is ${dol}{DIST_NAME}")
+
+get_pkgmgr(PKGMGR)
+if(PKGMGR AND NOT LINUX_PACKAGE_GENERATOR)
+ set(LINUX_PACKAGE_GENERATOR ${dol}{PKGMGR})
+ if(${dol}{PKGMGR} MATCHES "DEB")
+ execute_process(COMMAND dpkg --print-architecture
+ OUTPUT_VARIABLE CPACK_DEBIAN_PACKAGE_ARCHITECTURE
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+ message(STATUS "Package manager is ${dol}{PKGMGR}. Arch is ${dol}{CPACK_DEBIAN_PACKAGE_ARCHITECTURE}.")
+ endif()
+ if(${dol}{PKGMGR} MATCHES "RPM")
+ execute_process(COMMAND uname "-m"
+ OUTPUT_VARIABLE CPACK_RPM_PACKAGE_ARCHITECTURE
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+ message(STATUS "Package manager is ${dol}{PKGMGR}. Arch is ${dol}{CPACK_RPM_PACKAGE_ARCHITECTURE}.")
+ endif()
+endif()
+
${sharp} Add an "uninstall" target
CONFIGURE_FILE ("${dol}{PROJECT_SOURCE_DIR}/cmake/uninstall_target.cmake.in"
"${dol}{PROJECT_BINARY_DIR}/uninstall_target.cmake" IMMEDIATE @ONLY)
Modified: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/template/cmake/idl/IdlCMakeLists.txt.vsl
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/template/cmake/idl/IdlCMakeLists.txt.vsl 2017-02-21 03:21:59 UTC (rev 691)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/template/cmake/idl/IdlCMakeLists.txt.vsl 2017-02-21 03:40:01 UTC (rev 692)
@@ -1,8 +1,5 @@
set(idls ${tmpltHelper.getIDLFilesforIDLCMake(${rtcParam})})
-install(FILES ${dol}{idls} DESTINATION ${dol}{INC_INSTALL_DIR}/idl
- COMPONENT idl)
-
macro(_IDL_OUTPUTS _idl _dir _result)
set(${_result} ${_dir}/${_idl}SK.cc ${_dir}/${_idl}.hh
${_dir}/${_idl}DynSK.cc)
@@ -50,7 +47,3 @@
OPENRTM_COMPILE_IDL_FILES(${dol}{idls})
set(ALL_IDL_SRCS ${dol}{ALL_IDL_SRCS} PARENT_SCOPE)
FILTER_LIST("ALL_IDL_SRCS" "hh${dol}" idl_headers)
-install(FILES ${dol}{idl_headers}
- DESTINATION ${dol}{INC_INSTALL_DIR}/${dol}{PROJECT_NAME_LOWER}/idl
- COMPONENT headers)
-
Modified: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/template/cmake/src/SrcCMakeLists.txt.vsl
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/template/cmake/src/SrcCMakeLists.txt.vsl 2017-02-21 03:21:59 UTC (rev 691)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/template/cmake/src/SrcCMakeLists.txt.vsl 2017-02-21 03:40:01 UTC (rev 692)
@@ -41,7 +41,7 @@
set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "")
set_source_files_properties(${dol}{ALL_IDL_SRCS} PROPERTIES GENERATED 1)
if(NOT TARGET ALL_IDL_TGT)
- add_custom_target(ALL_IDL_TGT)
+ add_custom_target(ALL_IDL_TGT)
endif(NOT TARGET ALL_IDL_TGT)
add_dependencies(${dol}{PROJECT_NAME} ALL_IDL_TGT)
target_link_libraries(${dol}{PROJECT_NAME} ${dol}{OPENRTM_LIBRARIES})
@@ -52,6 +52,31 @@
install(TARGETS ${dol}{PROJECT_NAME} ${dol}{PROJECT_NAME}Comp
EXPORT ${dol}{PROJECT_NAME}
- RUNTIME DESTINATION ${dol}{INSTALL_DIR} COMPONENT component
- LIBRARY DESTINATION ${dol}{INSTALL_DIR} COMPONENT component
- ARCHIVE DESTINATION ${dol}{INSTALL_DIR} COMPONENT component)
+ RUNTIME DESTINATION ${dol}{INSTALL_PREFIX} COMPONENT component
+ LIBRARY DESTINATION ${dol}{INSTALL_PREFIX} COMPONENT component
+ ARCHIVE DESTINATION ${dol}{INSTALL_PREFIX} COMPONENT component)
+
+if (SolutionDir)
+ if (MSVC)
+ add_custom_command(
+ TARGET ${dol}{PROJECT_NAME}
+ POST_BUILD
+ COMMAND ${dol}{CMAKE_COMMAND} -E
+ copy ${dol}{PROJECT_BINARY_DIR}/src/Release/${dol}{PROJECT_NAME}.dll ${dol}{SolutionDir}/bin
+ )
+ add_custom_command(
+ TARGET ${dol}{PROJECT_NAME}Comp
+ POST_BUILD
+ COMMAND ${dol}{CMAKE_COMMAND} -E
+ copy ${dol}{PROJECT_BINARY_DIR}/src/Release/${dol}{PROJECT_NAME}Comp.exe ${dol}{SolutionDir}/bin
+ )
+
+ else (MSVC)
+ add_custom_command(
+ TARGET ${dol}{PROJECT_NAME}Comp
+ POST_BUILD
+ COMMAND ${dol}{CMAKE_COMMAND} -E
+ copy ${dol}{PROJECT_BINARY_DIR}/src/${dol}{PROJECT_NAME}Comp ${dol}{SolutionDir}/bin
+ )
+ endif (MSVC)
+endif (SolutionDir)
openrtm-commit メーリングリストの案内