comparison cmake/IrccdSystem.cmake @ 101:113d909fdfe1

CMake: disallow absolute paths, #389
author David Demelier <markand@malikania.fr>
date Mon, 25 Apr 2016 21:16:47 +0200
parents 1125d90b3b44
children bc291b131f6a
comparison
equal deleted inserted replaced
100:a3814665a60d 101:113d909fdfe1
64 64
65 if (CMAKE_SIZEOF_VOID_P MATCHES "8") 65 if (CMAKE_SIZEOF_VOID_P MATCHES "8")
66 set(IRCCD_64BITS TRUE) 66 set(IRCCD_64BITS TRUE)
67 else () 67 else ()
68 set(IRCCD_64BITS FALSE) 68 set(IRCCD_64BITS FALSE)
69 endif ()
70
71 set(IRCCD_FAKEROOTDIR ${CMAKE_BINARY_DIR}/fakeroot)
72
73 if (NOT EXISTS ${IRCCD_FAKEROOTDIR})
74 file(MAKE_DIRECTORY ${IRCCD_FAKEROOTDIR})
69 endif () 75 endif ()
70 76
71 # --------------------------------------------------------- 77 # ---------------------------------------------------------
72 # System identification 78 # System identification
73 # --------------------------------------------------------- 79 # ---------------------------------------------------------
248 check_struct_has_member("struct stat" st_rdev sys/stat.h HAVE_STAT_ST_RDEV) 254 check_struct_has_member("struct stat" st_rdev sys/stat.h HAVE_STAT_ST_RDEV)
249 check_struct_has_member("struct stat" st_size sys/stat.h HAVE_STAT_ST_SIZE) 255 check_struct_has_member("struct stat" st_size sys/stat.h HAVE_STAT_ST_SIZE)
250 check_struct_has_member("struct stat" st_uid sys/stat.h HAVE_STAT_ST_UID) 256 check_struct_has_member("struct stat" st_uid sys/stat.h HAVE_STAT_ST_UID)
251 257
252 # Configuration file. 258 # Configuration file.
253 file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/irccd)
254
255 configure_file( 259 configure_file(
256 ${CMAKE_CURRENT_LIST_DIR}/internal/sysconfig.hpp.in 260 ${CMAKE_CURRENT_LIST_DIR}/internal/sysconfig.hpp.in
257 ${CMAKE_BINARY_DIR}/irccd/sysconfig.hpp 261 ${IRCCD_FAKEROOTDIR}/include/irccd/sysconfig.hpp
258 ) 262 )
259
260 install(
261 FILES ${CMAKE_BINARY_DIR}/irccd/sysconfig.hpp
262 DESTINATION include/irccd
263 )
264
265 # Also copy to fakedir if possible
266 if (IRCCD_RELOCATABLE)
267 file(
268 COPY ${CMAKE_BINARY_DIR}/irccd/sysconfig.hpp
269 DESTINATION ${IRCCD_FAKEDIR}/include/irccd
270 )
271 endif ()