2016-11-09 13:04:56 +01:00
cmake_minimum_required ( VERSION 3.2.2 )
project ( Parsodus VERSION 1.0 )
2016-11-25 16:30:56 +01:00
set ( CMAKE_CXX_STANDARD 14 )
set ( CMAKE_CXX_STANDARD_REQUIRED 14 )
2016-11-09 13:04:56 +01:00
include ( ExternalProject )
find_package ( mstch QUIET )
if ( NOT mstch_FOUND )
ExternalProject_Add ( ext-mstch
G I T _ R E P O S I T O R Y h t t p s : / / g i t h u b . c o m / n o 1 m s d / m s t c h
G I T _ T A G 1 . 0 . 2
#The following line is a dirty hack
#to prevent cmake from needlessly clone any submodule
#inspect `ext-mstch-prefix/tmp/ext-mstch-gitclone.cmake` for more info
G I T _ S U B M O D U L E S " N O N E \ C O M M A N D \ t r u e \ E R R O R _ Q U I E T "
C M A K E _ A R G S - D W I T H _ U N I T _ T E S T S = N O
I N S T A L L _ C O M M A N D " "
)
add_library ( mstch::mstch IMPORTED STATIC GLOBAL )
add_dependencies ( mstch::mstch ext-mstch )
ExternalProject_Get_Property ( ext-mstch source_dir binary_dir )
set_target_properties ( mstch::mstch PROPERTIES "IMPORTED_LOCATION" "${binary_dir}/src/${CMAKE_STATIC_LIBRARY_PREFIX}mstch${CMAKE_STATIC_LIBRARY_SUFFIX}" )
include_directories ( ${ source_dir } /include )
endif ( )
ExternalProject_Add ( ext-optparse
G I T _ R E P O S I T O R Y h t t p s : / / g i t h u b . c o m / m y i n t / o p t p a r s e
C O N F I G U R E _ C O M M A N D " "
B U I L D _ C O M M A N D " "
I N S T A L L _ C O M M A N D " "
)
ExternalProject_Get_Property ( ext-optparse source_dir )
include_directories ( ${ source_dir } )
##########################################
find_package ( Doxygen )
if ( DOXYGEN_FOUND )
configure_file ( ${ CMAKE_CURRENT_SOURCE_DIR } /Doxyfile.in ${ CMAKE_CURRENT_BINARY_DIR } /Doxyfile @ONLY )
add_custom_target ( doc ${ DOXYGEN_EXECUTABLE } ${ CMAKE_CURRENT_BINARY_DIR } /Doxyfile WORKING_DIRECTORY ${ CMAKE_CURRENT_BINARY_DIR } COMMENT "Generating API documentation" VERBATIM )
endif ( DOXYGEN_FOUND )
set ( CMAKE_INSTALL_PREFIX "${CMAKE_CURRENT_BINARY_DIR}" )
include_directories ( include )
add_subdirectory ( src )
add_dependencies ( Parsodus ext-optparse )
install ( DIRECTORY templates
D E S T I N A T I O N s h a r e / P a r s o d u s
)
# add_subdirectory(examples)