[CMake] problem using cmake with FreeBSD ports collection ...

Matthew Grooms mgrooms at shrew.net
Tue Oct 2 22:40:51 EDT 2007


All,

I am using cmake / qt for a project and recently submitted a port to 
FreeBSD for inclusion. Apparently, the process manipulates a file 
outside of the working build directory before the install phase. This 
appears to live in the <qt prefix>/etc/settings directory. I'm not 
exactly sure what this might be but was hoping someone on this list 
would have more information on how to get this resolved. Here is the 
error forwarded to me from the ports guy that reviewed the build ...

================================================================
Fatal error: filesystem was touched prior to 'make install' phase
usr/local/etc/settings extra
================================================================

... I don't do anything specific in this directory with my CMakeLists 
files ( attached ) so I assume that the file manipulation taking place 
is due to some part of the automated cmake / qt build process. Anyone 
have any ideas?

Thanks in advance,

-Matthew

-------------- next part --------------
#
# Shrew Soft VPN / Access Manager Application
# Cross Platform Make File
#
# author : Matthew Grooms
#        : mgrooms at shrew.net
#        : Copyright 2007, Shrew Soft Inc
#

include_directories(
	${IKE_SOURCE_DIR}/source/
	${IKE_SOURCE_DIR}/source/libip
	${QT_INCLUDE_DIR} )

link_directories(
	${IKE_SOURCE_DIR}/source/libip )

set(
	UIC_FILES
	site.ui
	root.ui
	topology.ui
	about.ui )

set(
	IMG_FILES
	png/policy_exc.png
	png/policy_inc.png
	png/site.png
	png/site_add.png
	png/site_con.png
	png/site_del.png
	png/site_mod.png
	png/ikea.png )

qt_wrap_ui(
	LIB_FILES
	INC_FILES
	CPP_FILES
	${UIC_FILES} )

qt_wrap_cpp(
	LIB_FILES
	MOC_FILES
	${INC_FILES} )

add_executable(
	ikea
	main.cpp
	ikea.cpp
	config.cpp
	images.cxx
	${CPP_FILES} )

target_link_libraries(
	ikea
        ip
	pthread
	${QT_LIBRARIES} )

# qt image support

add_custom_command(  
	SOURCE ${IMG_FILES}
        COMMAND ${QT_UIC_EXECUTABLE}
        ARGS -embed ikea ${IMG_FILES} -o images.cxx
        TARGET ikea
        OUTPUTS images.cxx )

# install support

install(
	TARGETS ikea
	RUNTIME	DESTINATION bin )

-------------- next part --------------
#
# Shrew Soft VPN / Client Connect Application
# Cross Platform Make File
#
# author : Matthew Grooms
#        : mgrooms at shrew.net
#        : Copyright 2007, Shrew Soft Inc
#

include_directories(
	${IKE_SOURCE_DIR}/source/
	${IKE_SOURCE_DIR}/source/ikea
	${IKE_SOURCE_DIR}/source/iked
	${IKE_SOURCE_DIR}/source/libike
	${IKE_SOURCE_DIR}/source/libip
	${QT_INCLUDE_DIR} )

link_directories(
	${IKE_SOURCE_DIR}/source/libip )

set(
	UIC_FILES
	banner.ui
	root.ui )

set(
	IMG_FILES
	png/ikec.png )

qt_wrap_ui(
	LIB_FILES
	INC_FILES
	CPP_FILES
	${UIC_FILES} )

qt_wrap_cpp(
	LIB_FILES
	MOC_FILES
	${INC_FILES} )

add_executable(
	ikec
	main.cpp
	ikec.cpp
	../ikea/config.cpp
	images.cxx
	${CPP_FILES} )

target_link_libraries(
	ikec
	ike
        ip
	pthread
	${QT_LIBRARIES} )

# qt image support

add_custom_command(  
	SOURCE ${IMG_FILES}
        COMMAND ${QT_UIC_EXECUTABLE}
        ARGS -embed ikec ${IMG_FILES} -o images.cxx
        TARGET ikec
        OUTPUTS images.cxx )

# install support

install(
	TARGETS ikec
	RUNTIME	DESTINATION bin )

-------------- next part --------------
#
# Shrew Soft VPN / IKE Tools
# Cross Platform Make File
#
# author : Matthew Grooms
#        : mgrooms at shrew.net
#        : Copyright 2007, Shrew Soft Inc
#

project( IKE )

#
# Unix Target Constants
#

add_definitions( -DUNIX )

include( CheckCSourceCompiles )
include( CheckLibraryExists )

subdirs(
	source/iked
	source/libike
	source/libip
	source/libith
	source/liblog
	source/libpfk )

set(
	SEARCH_INC
	/usr/include
	/usr/local/include )

set(
	SEARCH_LIB
	/usr/lib
	/usr/local/lib )

set(
	SEARCH_BIN
	/usr/local/bin
	/usr/pkg/bin
	/usr/bin )

set(
	SEARCH_SYS
	/usr/local
	/usr/share
	/usr )

#
# PreRequisite Checks
#

find_path(
	PATH_INC_CRYPTO
	NAMES "openssl/evp.h"
	PATHS ${SEARCH_INC} )

if( NOT PATH_INC_CRYPTO )

	message(
		FATAL_ERROR
		"Unable to locate openssl crypto include files" )

endif( NOT PATH_INC_CRYPTO )

find_library(
	PATH_LIB_CRYPTO
	NAMES "crypto"
	PATHS ${SEARCH_LIB} )

if( NOT PATH_LIB_CRYPTO )

	message(
		FATAL_ERROR
		"Unable to locate openssl crypto library file" )

endif( NOT PATH_LIB_CRYPTO )

find_package( Threads )

if( NOT CMAKE_USE_PTHREADS_INIT )

	message(
		FATAL_ERROR
		"Unable to locate required package : pthreads" )

endif( NOT CMAKE_USE_PTHREADS_INIT )

check_library_exists(
	${CMAKE_THREAD_LIBS_INIT}
	"pthread_mutex_timedlock"
	""
	FUNC_LIB_TIMEDLOCK )

if( FUNC_LIB_TIMEDLOCK )

	add_definitions( -DOPT_TIMEDLOCK )

endif( FUNC_LIB_TIMEDLOCK )

find_program(
	PATH_BIN_FLEX
	NAMES "flex"
	PATHS ${SEARCH_BIN} )

if( NOT PATH_BIN_FLEX )

	message(
		FATAL_ERROR
		"Unable to locate required binary : flex" )

endif( NOT PATH_BIN_FLEX )
		
message(
	STATUS 
	"Using binary ${PATH_BIN_FLEX} ..." )

find_program(
	PATH_BIN_BISON
	NAMES "bison"
	PATHS ${SEARCH_BIN} )

if( NOT PATH_BIN_BISON )

	message(
		FATAL_ERROR
		"Unable to locate required binary : bison" )

endif( NOT PATH_BIN_BISON )
		
message(
	STATUS 
	"Using binary ${PATH_BIN_BISON} ..." )

find_path(
	PATH_INC_NETIPSEC
	NAMES "ipsec.h"
	PATHS "/usr/include/netipsec" )

if( PATH_INC_NETIPSEC )

	add_definitions( -DOPT_NETIPSEC )

endif( PATH_INC_NETIPSEC )

find_library(
	PATH_LIB_RT
	NAMES "rt"
	PATHS ${SEARCH_LIB} )

#
# Install Path Checks
#

if( NOT EXISTS ${CMAKE_INSTALL_PREFIX} )

	set(
		CMAKE_INSTALL_PREFIX
		"/usr" )

endif( NOT EXISTS ${CMAKE_INSTALL_PREFIX} )

message(
	STATUS 
	"Using install prefix ${CMAKE_INSTALL_PREFIX} ..." )

# etc path

if( ETCDIR )

	set(	PATH_ETC
		${ETCDIR} )

else( ETCDIR )

	if( EXISTS ${CMAKE_INSTALL_PREFIX}/etc )

		set(	PATH_ETC
			"${CMAKE_INSTALL_PREFIX}/etc" )

	else( EXISTS ${CMAKE_INSTALL_PREFIX}/etc )
		
		set(	PATH_ETC
			"/etc" )

	endif( EXISTS ${CMAKE_INSTALL_PREFIX}/etc )

endif( ETCDIR )

message(
	STATUS
	"Using etc path ${PATH_ETC} ..." )

# man path

if( MANDIR )

	set(	PATH_MAN
		${MANDIR} )

else( MANDIR )

	find_path(
		PATH_MAN
		NAMES "man"
		PATHS ${SEARCH_SYS}
		NO_DEFAULT_PATH )

	if( PATH_MAN )

		set(	PATH_MAN
			"${PATH_MAN}/man" )

	else( PATH_MAN )

		set(	PATH_MAN
			"${CMAKE_INSTALL_PREFIX}/man" )

	endif( PATH_MAN )

endif( MANDIR )

message(
	STATUS
	"Using man path ${PATH_MAN} ..." )

#
# Build Options
#

OPTION( DEBUG  "include Debug Symbol support" )
OPTION( NATT   "include NAT Traversal support" )
OPTION( LDAP   "include LDAP Authentication support" )
OPTION( QTGUI  "include Client QT GUI support" )

OPTION( ETCDIR "etc install directory" )
OPTION( MANDIR "man install directory" )


# Debug Symbols Option

if( DEBUG )

	add_definitions( -g )

endif( DEBUG )

# NAT Traversion option

if( NATT )

	check_c_source_compiles(
		"
		#ifdef __linux__
		# include <inttypes.h>
		# include <linux/pfkeyv2.h>
		#else
		# include <sys/types.h>
		# include <net/pfkeyv2.h>
                #endif

		int main()
		{
			struct sadb_x_nat_t_type test;

			return 0;
		}
		"
		NATT_FOUND )

	if( NOT NATT_FOUND )

		message(
			FATAL_ERROR
			"Unable to locate required NAT-T pfkey structures" )

	endif( NOT NATT_FOUND )

	# success

	message(
		STATUS 
		"Enabled NAT Traversal support ..." )

	add_definitions( -DOPT_NATT )

endif( NATT )

# LDAP support option

if( LDAP )

	# ldap include

	find_path(
		PATH_INC_LDAP
		NAMES "ldap.h"
		PATHS ${SEARCH_INC} )

	if( NOT PATH_INC_LDAP )

		message(
			FATAL_ERROR
			"Unable to locate LDAP include file" )

	endif( NOT PATH_INC_LDAP )

	# ldap libraries

	find_library(
		PATH_LIB_LDAP
		NAMES "ldap"
		PATHS ${SEARCH_LIB} )

	find_library(
		PATH_LIB_LBER
		NAMES "lber"
		PATHS ${SEARCH_LIB} )

	if( NOT PATH_LIB_LDAP OR NOT PATH_LIB_LBER )

		message(
			FATAL_ERROR
			"Unable to locate LDAP library file" )

	endif( NOT PATH_LIB_LDAP OR NOT PATH_LIB_LBER )

	# success

	message( 
		STATUS
		"Enabled LDAP Authentication support ..." )

	add_definitions( -DOPT_LDAP )

endif( LDAP )

# Client GUI option

if( QTGUI )

	add_definitions( -DQT_THREAD_SUPPORT )

	set( QT_MT_REQUIRED TRUE )

	find_package( Qt3 )

	if( NOT QT_FOUND )

		message(
			FATAL_ERROR
			"Unable to locate required package : QT" )

	endif( NOT QT_FOUND )
		
	# success

	message(
		STATUS 
		"Enabled Client QT GUI support ..." )

	add_definitions( ${QT_DEFINITIONS} )

	add_subdirectory( source/ikea )
	add_subdirectory( source/ikec )

endif( QTGUI )





More information about the CMake mailing list