Skip to content

Commit 7c8fcc9

Browse files
jfsmigfvennetier
authored andcommitted
cmake: Adapt cmake to the new libdill dependency
1 parent c0435f6 commit 7c8fcc9

File tree

1 file changed

+10
-30
lines changed

1 file changed

+10
-30
lines changed

CMakeLists.txt

Lines changed: 10 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -120,48 +120,28 @@ endif()
120120

121121
find_package(PkgConfig)
122122
pkg_check_modules(GLIB2 REQUIRED glib-2.0 gthread-2.0 gmodule-2.0)
123+
pkg_check_modules(DILL REQUIRED libdill)
123124

124-
add_custom_target(
125-
libdill_s
126-
ALL
127-
COMMAND ./autogen.sh
128-
COMMAND ./configure --enable-static --disable-shared
129-
COMMAND make
130-
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/vendor/sustrik/libdill
131-
COMMENT "Building libdill")
132-
133-
if (NOT (${CMAKE_BINARY_DIR} STREQUAL ${CMAKE_SOURCE_DIR}))
134-
add_custom_target(
135-
libdill_source
136-
ALL
137-
COMMAND mkdir -p ${CMAKE_BINARY_DIR}/vendor/sustrik/libdill
138-
COMMAND cd ${CMAKE_BINARY_DIR}/vendor/sustrik/libdill && lndir ${CMAKE_SOURCE_DIR}/vendor/sustrik/libdill
139-
COMMENT "Preparing the source of libdill")
140-
add_dependencies(libdill_s libdill_source)
141-
endif()
142-
143-
set(CMAKE_LIBRARY_PATH "")
144-
set(CMAKE_INCLUDE_PATH "")
145125
include_directories(AFTER
146-
${CMAKE_SOURCE_DIR}/vendor/sustrik/libdill
126+
${DILL_INCLUDE_DIRS}
147127
${GLIB2_INCLUDE_DIRS})
148128

149-
add_definitions(-DLOG_DOMAIN="gridinit")
129+
link_directories(
130+
${DILL_LIBRARY_DIRS}
131+
${GLIB2_LIBRARY_DIRS})
150132

151-
include_directories(BEFORE ${CMAKE_SOURCE_DIR}/main)
133+
include_directories(BEFORE
134+
${CMAKE_SOURCE_DIR}/main)
135+
136+
add_definitions(-DLOG_DOMAIN="gridinit")
152137

153138
add_executable(gridinit
154139
main/gridinit.c
155140
main/children.c
156141
main/limits.c
157142
main/uid.c
158143
main/utils.c)
159-
target_link_libraries(gridinit
160-
${GLIB2_LIBRARIES}
161-
${CMAKE_BINARY_DIR}/vendor/sustrik/libdill/.libs/libdill.a
162-
-pthread -lrt)
163-
add_dependencies(gridinit
164-
libdill_s)
144+
target_link_libraries(gridinit ${GLIB2_LIBRARIES} ${DILL_LIBRARIES})
165145

166146

167147
add_executable(gridinit_cmd

0 commit comments

Comments
 (0)