<font size=2 face="sans-serif">Are you missing some INSTALL commands?</font>
<br>
<br><font size=2 face="sans-serif">-------------------------------------------------------------<br>
Aaron Wright<br>
Software Engineer - DCS Group<br>
Schweitzer Engineering Laboratories, Inc.<br>
Pullman, WA 99163<br>
509-334-8087</font>
<br>
<br>
<br>
<br>
<table width=100%>
<tr valign=top>
<td><font size=1 color=#5f5f5f face="sans-serif">From:</font>
<td><font size=1 face="sans-serif">Roger &lt;rnodal@gmail.com&gt;</font>
<tr valign=top>
<td><font size=1 color=#5f5f5f face="sans-serif">To:</font>
<td><font size=1 face="sans-serif">cmake@cmake.org</font>
<tr valign=top>
<td><font size=1 color=#5f5f5f face="sans-serif">Date:</font>
<td><font size=1 face="sans-serif">04/12/2010 08:50 AM</font>
<tr valign=top>
<td><font size=1 color=#5f5f5f face="sans-serif">Subject:</font>
<td><font size=1 face="sans-serif">[CMake] CMake and CPack question.</font>
<tr valign=top>
<td><font size=1 color=#5f5f5f face="sans-serif">Sent by:</font>
<td><font size=1 face="sans-serif">cmake-bounces@cmake.org</font></table>
<br>
<hr noshade>
<br>
<br>
<br><tt><font size=2>Hello,<br>
<br>
I have been using CMake (2.6) for a couple weeks now (I really like<br>
it) and so far I have been able to do all I needed by just following<br>
the documentation.<br>
After getting my software built and confirmed that it works in my<br>
development machine I would like to pack it so I can install it in my<br>
production machine<br>
using RPM. &nbsp;I have gotten as far as generating RPM, SH, TGZ etc<br>
packages to build but they seem to be useless (to say the least). I'm<br>
pretty sure that I'm missing something so<br>
I was wondering if someone with experience generating installation<br>
packages could point me in the right direction. This is a very simple<br>
project and there is only one file<br>
to install, a binary file. I know that using CMake for this may be<br>
overkill but I figured that I do this one then it would be easier to<br>
tackle bigger ones.<br>
Here is my current CMake files.<br>
<br>
============ CMakeLists.cmake ================<br>
# Minumum CMake version.<br>
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)<br>
<br>
# Set CMake modules path.<br>
SET(CMAKE_MODULE_PATH &quot;${CMAKE_SOURCE_DIR}/cmake/Modules/&quot;)<br>
<br>
# Project name.<br>
PROJECT(sqlconnmonit)<br>
<br>
# Find MYSQL.<br>
FIND_PACKAGE(SQL REQUIRED MYSQL_INCLUDE_DIR)<br>
<br>
# Add MYSQL headers.<br>
INCLUDE_DIRECTORIES(${MYSQL_INCLUDE_DIR})<br>
<br>
# Add MYSQL lib to the list of libraries to use.<br>
SET(LIBS ${LIBS} ${MYSQL_LIB_DIR})<br>
<br>
# Compiler flags.<br>
# SET(CMAKE_C_FLAGS &quot;${CMAKE_C_FLAGS} -g&quot;)<br>
<br>
# The source code file(s) that form the executable.<br>
ADD_EXECUTABLE(sqlconnmonit src/sqlconnmonit.c src/options.c<br>
src/utils.c src/mysql.c)<br>
<br>
# Link against external libraries.<br>
TARGET_LINK_LIBRARIES(sqlconnmonit ${LIBS})<br>
<br>
# CPACK.<br>
INCLUDE(InstallRequiredSystemLibraries)<br>
SET(CPACK_INSTALL_CMAKE_PROJECTS<br>
&quot;${CMAKE_SOURCE_DIR}/build;${CMAKE_PROJECT_NAME};ALL;/&quot;)<br>
SET(CPACK_GENERATOR &quot;STGZ;TGZ;TZ;RPM;DEB&quot;)<br>
SET(CPACK_PACKAGE_VERSION_MAJOR &quot;0&quot;)<br>
SET(CPACK_PACKAGE_VERSION_MINOR &quot;1&quot;)<br>
SET(CPACK_PACKAGE_VERSION_PATCH &quot;0&quot;)<br>
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY &quot;MySQL server connections monitor.&quot;)<br>
SET(CPACK_PACKAGE_VENDOR &quot;Super Cool Vendor&quot;)<br>
SET(CPACK_PACKAGE_INSTALL_DIRECTORY &quot;/opt/sqlmonitor/bin&quot;)<br>
<br>
SET(CPACK_RPM_PACKAGE_SUMMARY &quot;MySQL server connections monitor.&quot;)<br>
SET(CPACK_RPM_PACKAGE_NAME &quot;${CPACK_PACKAGE_NAME}&quot;)<br>
SET(CPACK_RPM_PACKAGE_VERSION &quot;${CPACK_PACKAGE_VERSION}&quot;)<br>
SET(CPACK_RPM_PACKAGE_RELEASE &quot;1&quot;)<br>
SET(CPACK_RPM_PACKAGE_LICENSE &quot;BSD&quot;)<br>
SET(CPACK_RPM_PACKAGE_GROUP &quot;unknown&quot;)<br>
SET(CPACK_RPM_PACKAGE_VENDOR &quot;Super Cool Vendor&quot;)<br>
SET(CPACK_RPM_PACKAGE_DESCRIPTION &quot;MySQL server connections monitor.&quot;)<br>
SET(CPACK_RPM_PACKAGE_REQUIRES &quot;cmake &gt;= 2.6, mysql-devel &gt;=
5.0&quot;)<br>
<br>
SET(CPACK_DEBIAN_PACKAGE_MAINTAINER &quot;ME&quot;)<br>
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY &quot;${CPACK_PACKAGE_DESCRIPTION_SUMMARY}&quot;)<br>
SET(CPACK_PACKAGE_DESCRIPTION &quot;${CPACK_PACKAGE_DESCRIPTION_SUMMARY}&quot;)<br>
<br>
INCLUDE(CPack)<br>
<br>
<br>
============ FindSQL.cmake ====================<br>
<br>
# Locate MYSQL library<br>
#<br>
<br>
# Find MYSQL include.<br>
MESSAGE(&quot;-- Looking for MySQL include directory&quot;)<br>
<br>
FIND_PATH(MYSQL_INCLUDE_DIR<br>
 &nbsp; &nbsp;mysql.h<br>
 &nbsp; &nbsp;PATHS<br>
 &nbsp; &nbsp; &nbsp; &nbsp;/usr/include/mysql<br>
 &nbsp; &nbsp; &nbsp; &nbsp;/usr/local/include/mysql<br>
<br>
)<br>
<br>
IF (MYSQL_INCLUDE_DIR)<br>
 &nbsp; &nbsp;MESSAGE(&quot;-- MySQL include directory found&quot;)<br>
 &nbsp; &nbsp;MESSAGE(&quot;-- MYSQL_INCLUDE_DIR is ${MYSQL_INCLUDE_DIR}&quot;)<br>
ELSE (MYSQL_INCLUDE_DIR)<br>
 &nbsp; &nbsp;MESSAGE(FATAL_ERROR &quot;-- Could not find MySQL includes
directory&quot;)<br>
ENDIF (MYSQL_INCLUDE_DIR)<br>
<br>
# Find MYSQL lib.<br>
MESSAGE(&quot;-- Looking for MySQL lib directory&quot;)<br>
<br>
FIND_LIBRARY(MYSQL_LIB_DIR<br>
 &nbsp; &nbsp;NAMES<br>
 &nbsp; &nbsp; &nbsp; &nbsp;mysqlclient libmysqlclient<br>
 &nbsp; &nbsp;PATHS<br>
 &nbsp; &nbsp; &nbsp; &nbsp;/usr/local/lib<br>
 &nbsp; &nbsp; &nbsp; &nbsp;/usr/local/lib64<br>
 &nbsp; &nbsp; &nbsp; &nbsp;/usr/lib<br>
 &nbsp; &nbsp; &nbsp; &nbsp;/usr/lib/mysql<br>
 &nbsp; &nbsp; &nbsp; &nbsp;/usr/lib64<br>
 &nbsp; &nbsp; &nbsp; &nbsp;/usr/lib64/mysql<br>
)<br>
<br>
<br>
IF (MYSQL_LIB_DIR)<br>
 &nbsp; &nbsp;MESSAGE(&quot;-- MySQL lib directory found&quot;)<br>
 &nbsp; &nbsp;MESSAGE(&quot;-- MYSQL_LIB_DIR is ${MYSQL_LIB_DIR}&quot;)<br>
ELSE (MYSQL_LIB_DIR)<br>
 &nbsp; &nbsp;MESSAGE(FATAL_ERROR &quot;-- Could not find MySQL lib directory&quot;)<br>
ENDIF (MYSQL_LIB_DIR)<br>
<br>
=============================================<br>
<br>
Any input would be appreciated. Any complete sample to a CMake to<br>
generate a RPM package<br>
would be greatly appreciated. Anything would be appreciated.<br>
<br>
Thank you for your time,<br>
<br>
-r<br>
_______________________________________________<br>
Powered by </font></tt><a href=www.kitware.com><tt><font size=2>www.kitware.com</font></tt></a><tt><font size=2><br>
<br>
Visit other Kitware open-source projects at </font></tt><a href=http://www.kitware.com/opensource/opensource.html><tt><font size=2>http://www.kitware.com/opensource/opensource.html</font></tt></a><tt><font size=2><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: </font></tt><a href=http://www.cmake.org/Wiki/CMake_FAQ><tt><font size=2>http://www.cmake.org/Wiki/CMake_FAQ</font></tt></a><tt><font size=2><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
</font></tt><a href=http://www.cmake.org/mailman/listinfo/cmake><tt><font size=2>http://www.cmake.org/mailman/listinfo/cmake</font></tt></a><tt><font size=2><br>
</font></tt>
<br>