+cmake_minimum_required( VERSION 2.6 )
+
# project definitions
project( libpingcheck CXX )
-set( VERSION 0.0.1 )
-cmake_minimum_required( VERSION 2.6 )
+set( MAJOR_VERSION 0 )
+set( MINOR_VERSION 1 )
+set( VERSION_STRING ${MAJOR_VERSION}.${MINOR_VERSION} )
# set the directory where the executable will be placed
set( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} )
# set the directory where the make install places the executable
#set( CMAKE_INSTALL_PREFIX ${CMAKE_CURRENT_BINARY_DIR} )
+# enable or disable the full compiler output
+set( CMAKE_VERBOSE_MAKEFILE OFF )
+
+# add definitions, compiler switches, etc.
+add_definitions( -Werror -Wall -Wextra -O2 )
+
# more build in the source folder
add_subdirectory( src )
-# binary name
-set( TARGET pingcheck )
-
# required boost libraries
set( Boost_USE_STATIC_LIBS ON )
set( Boost_USE_MULTITHREADED ON )
set( Boost_USE_STATIC_RUNTIME OFF )
-find_package( Boost 1.36.0 REQUIRED COMPONENTS filesystem )
+find_package( Boost COMPONENTS filesystem program_options REQUIRED )
-include_directories( config )
-include_directories( ping )
-include_directories( ${Boost_INCLUDE_DIRS} )
+# include directories
+include_directories(
+ config
+ ping
+ ${Boost_INCLUDE_DIRS}
+)
+# source code
set( SOURCES
config/configuration.cpp
- config/configurationcommandline.cpp
- config/configurationfile.cpp
config/configurationreader.cpp
ping/boostpinger.cpp
ping/host.cpp
main.cpp
)
+# binary name
+set( TARGET pingcheck )
+
# creates the binary
add_executable( ${TARGET} ${SOURCES} )
target_link_libraries( ${TARGET} ${Boost_LIBRARIES} )
# creates the install rule for the binary
-install( TARGETS ${TARGET} DESTINATION . )
+install( TARGETS ${TARGET} DESTINATION bin )