Windows build configuration
This commit is contained in:
+33
-19
@@ -1,11 +1,16 @@
|
||||
find_package(Boost COMPONENTS date_time filesystem system thread program_options REQUIRED)
|
||||
set(BOOST_LIBS date_time filesystem system thread program_options)
|
||||
if(WIN32)
|
||||
list(APPEND BOOST_LIBS regex chrono)
|
||||
endif()
|
||||
|
||||
find_package(Boost COMPONENTS ${BOOST_LIBS} REQUIRED)
|
||||
find_package(Threads)
|
||||
|
||||
configure_file("config.h.in" "config.h")
|
||||
|
||||
include_directories(
|
||||
${PROJECT_BINARY_DIR}
|
||||
${Boost_INLUDE_DIRS}
|
||||
${Boost_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
add_library(slbu-lib
|
||||
@@ -29,6 +34,13 @@ target_link_libraries(syslog-bulk-uploader
|
||||
slbu-lib
|
||||
)
|
||||
|
||||
if(WIN32)
|
||||
target_link_libraries(syslog-bulk-uploader
|
||||
${Boost_REGEX_LIBRARY}
|
||||
${Boost_CHRONO_LIBRARY}
|
||||
)
|
||||
endif()
|
||||
|
||||
install(TARGETS syslog-bulk-uploader DESTINATION bin)
|
||||
|
||||
##
|
||||
@@ -54,22 +66,24 @@ include(CPack)
|
||||
##
|
||||
## Generate documentation
|
||||
##
|
||||
find_program(A2X_EXECUTABLE NAMES a2x)
|
||||
set(A2X_OPTS --doctype manpage --format manpage -D ${CMAKE_CURRENT_BINARY_DIR})
|
||||
if(UNIX)
|
||||
find_program(A2X_EXECUTABLE NAMES a2x)
|
||||
set(A2X_OPTS --doctype manpage --format manpage -D ${CMAKE_CURRENT_BINARY_DIR})
|
||||
|
||||
set(MAN_NAMES syslog-bulk-uploader.1)
|
||||
set(MAN_FILES)
|
||||
foreach(m IN LISTS MAN_NAMES)
|
||||
set(mf ${CMAKE_CURRENT_BINARY_DIR}/${m})
|
||||
set(ms ${CMAKE_CURRENT_SOURCE_DIR}/${m}.txt)
|
||||
add_custom_command(OUTPUT ${mf}
|
||||
COMMAND ${A2X_EXECUTABLE} ${A2X_OPTS} ${ms}
|
||||
DEPENDS ${ms}
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
||||
COMMENT "Building manpage ${mf}"
|
||||
VERBATIM)
|
||||
list(APPEND MAN_FILES ${mf})
|
||||
endforeach()
|
||||
set(MAN_NAMES syslog-bulk-uploader.1)
|
||||
set(MAN_FILES)
|
||||
foreach(m IN LISTS MAN_NAMES)
|
||||
set(mf ${CMAKE_CURRENT_BINARY_DIR}/${m})
|
||||
set(ms ${CMAKE_CURRENT_SOURCE_DIR}/${m}.txt)
|
||||
add_custom_command(OUTPUT ${mf}
|
||||
COMMAND ${A2X_EXECUTABLE} ${A2X_OPTS} ${ms}
|
||||
DEPENDS ${ms}
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
||||
COMMENT "Building manpage ${mf}"
|
||||
VERBATIM)
|
||||
list(APPEND MAN_FILES ${mf})
|
||||
endforeach()
|
||||
|
||||
add_custom_target(man ALL DEPENDS ${MAN_FILES})
|
||||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/syslog-bulk-uploader.1 DESTINATION man/man1/)
|
||||
add_custom_target(man ALL DEPENDS ${MAN_FILES})
|
||||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/syslog-bulk-uploader.1 DESTINATION man/man1/)
|
||||
endif()
|
||||
Reference in New Issue
Block a user