diff --git a/CMakeLists.txt b/CMakeLists.txt index b751d0b..c997d9d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,7 +18,6 @@ if (NOT mstch_FOUND) GIT_SUBMODULES "NONE\ COMMAND\ true\ ERROR_QUIET" CMAKE_ARGS -DWITH_UNIT_TESTS=NO INSTALL_COMMAND "" - EXCLUDE_FROM_ALL 1 ) add_library(mstch::mstch IMPORTED STATIC GLOBAL) @@ -30,17 +29,13 @@ if (NOT mstch_FOUND) endif() ExternalProject_Add(ext-optparse - GIT_REPOSITORY https://github.com/weisslj/cpp-optparse - PATCH_COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/cmake/OptParse.cmakelists" "${CMAKE_CURRENT_BINARY_DIR}/ext-optparse-prefix/src/ext-optparse/CMakeLists.txt" + GIT_REPOSITORY https://github.com/myint/optparse + CONFIGURE_COMMAND "" + BUILD_COMMAND "" INSTALL_COMMAND "" - EXCLUDE_FROM_ALL 1 ) -add_library(cpp-optparse IMPORTED STATIC GLOBAL) -add_dependencies(cpp-optparse ext-optparse) - -ExternalProject_Get_Property(ext-optparse source_dir binary_dir) -set_target_properties(cpp-optparse PROPERTIES "IMPORTED_LOCATION" "${binary_dir}/${CMAKE_STATIC_LIBRARY_PREFIX}cpp-optparse${CMAKE_STATIC_LIBRARY_SUFFIX}") +ExternalProject_Get_Property(ext-optparse source_dir) include_directories(${source_dir}) ########################################## @@ -54,6 +49,7 @@ set(CMAKE_INSTALL_PREFIX "${CMAKE_CURRENT_BINARY_DIR}") include_directories(include) add_subdirectory(src) +add_dependencies(Lexesis ext-optparse) install(DIRECTORY templates DESTINATION share/Lexesis diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 09c9e26..69f50a5 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -15,7 +15,7 @@ add_executable(Lexesis inputparser.cpp template.cpp ) -target_link_libraries(Lexesis Lexesis-backends mstch::mstch cpp-optparse) +target_link_libraries(Lexesis Lexesis-backends mstch::mstch) install(TARGETS Lexesis RUNTIME DESTINATION bin diff --git a/src/main.cpp b/src/main.cpp index e2dd158..fdac507 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2,7 +2,7 @@ #include "Lexesis/backends/cpp.h" #include "Lexesis/driver.h" -#include "OptionParser.h" +#include "optparse.h" #include #include