From e46226b3a171a6a39c493aaa7cb975e51ab793fd Mon Sep 17 00:00:00 2001 From: Bartosz Broda <bartosz.broda@gmail.com> Date: Thu, 20 Sep 2012 20:36:36 +0200 Subject: [PATCH] poprawki pod win --- CMakeLists.txt | 9 ++++++--- corpus2tools/CMakeLists.txt | 7 +++++-- libcorpus2/CMakeLists.txt | 1 + libcorpus2_whole/CMakeLists.txt | 1 + libpwrutils/CMakeLists.txt | 1 + libpwrutils/plugin.cpp | 8 ++++++++ swig/CMakeLists.txt | 1 + 7 files changed, 23 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 51b499c..ebf6430 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -83,9 +83,12 @@ add_subdirectory(libpwrutils) add_subdirectory(libcorpus2) add_subdirectory(libcorpus2_whole) add_subdirectory(corpus2tools) -add_subdirectory(tests) -if(CORPUS2_BUILD_SWIG) +if(UNIX) + add_subdirectory(tests) +endif(UNIX) + +if(UNIX AND CORPUS2_BUILD_SWIG) FIND_PACKAGE(SWIG) if(SWIG_FOUND) message(STATUS "SWIG found, Python wrappers will be built") @@ -95,7 +98,7 @@ if(CORPUS2_BUILD_SWIG) endif(SWIG_FOUND) else() message(STATUS "Not building SWIG Python wrappers") -endif(CORPUS2_BUILD_SWIG) +endif(UNIX AND CORPUS2_BUILD_SWIG) if(NOT CORPUS2_BUILD_POLIQARP) message(STATUS "*****************************************************") diff --git a/corpus2tools/CMakeLists.txt b/corpus2tools/CMakeLists.txt index 40508ee..cdfc097 100644 --- a/corpus2tools/CMakeLists.txt +++ b/corpus2tools/CMakeLists.txt @@ -9,13 +9,16 @@ endif (Libedit_FOUND) include_directories( ${CMAKE_SOURCE_DIR} ) include_directories(${corpus2_BINARY_DIR}/include) +set(LIBS ${LIBS} ${ICU_LIBRARIES}) -add_executable( tagset-tool tagset-tool.cpp ) -target_link_libraries ( tagset-tool corpus2 pwrutils ${Boost_LIBRARIES} ${LIBS}) +include_directories(${ICU_INCLUDE_DIR}) include_directories(${Boost_INCLUDE_DIR}) link_directories(${Boost_LIBRARY_DIRS}) +link_directories(${ICU_LIBRARY_DIRS}) +add_executable( tagset-tool tagset-tool.cpp ) +target_link_libraries ( tagset-tool corpus2 pwrutils ${Boost_LIBRARIES} ${LIBS}) if(UNIX) install(TARGETS tagset-tool diff --git a/libcorpus2/CMakeLists.txt b/libcorpus2/CMakeLists.txt index ad79001..7f507e7 100644 --- a/libcorpus2/CMakeLists.txt +++ b/libcorpus2/CMakeLists.txt @@ -21,6 +21,7 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR}/include/) find_package(ICU REQUIRED QUIET) include_directories(${ICU_INCLUDE_DIR}) +include_directories(${Boost_INCLUDE_DIR}) link_directories(${ICU_LIBRARY_DIRS}) set(LIBS ${LIBS} icuuc icuio) diff --git a/libcorpus2_whole/CMakeLists.txt b/libcorpus2_whole/CMakeLists.txt index 9606df2..1f410bd 100755 --- a/libcorpus2_whole/CMakeLists.txt +++ b/libcorpus2_whole/CMakeLists.txt @@ -2,6 +2,7 @@ PROJECT(corpus2_whole) find_package(LibXML++ REQUIRED QUIET) include_directories(${LibXML++_INCLUDE_DIRS}) +include_directories(${Boost_INCLUDE_DIRS}) link_directories(${LibXML++_LIBRARY_DIRS}) set(LIBS ${LIBS} ${LibXML++_LIBRARIES}) diff --git a/libpwrutils/CMakeLists.txt b/libpwrutils/CMakeLists.txt index 69a9912..05192d0 100644 --- a/libpwrutils/CMakeLists.txt +++ b/libpwrutils/CMakeLists.txt @@ -19,6 +19,7 @@ include_directories( ${CMAKE_SOURCE_DIR} ) find_package(ICU REQUIRED) include_directories(${ICU_INCLUDE_DIR}) +include_directories(${Boost_INCLUDE_DIR}) link_directories(${ICU_LIBRARY_DIRS}) set(LIBS ${LIBS} icuuc icuio) diff --git a/libpwrutils/plugin.cpp b/libpwrutils/plugin.cpp index b0700ce..3c129a8 100644 --- a/libpwrutils/plugin.cpp +++ b/libpwrutils/plugin.cpp @@ -13,7 +13,9 @@ or FITNESS FOR A PARTICULAR PURPOSE. See the LICENCE, COPYING.LESSER and COPYING files for more details. */ #include <libpwrutils/plugin.h> +#ifdef __UNIX__ #include <dlfcn.h> +#endif #include <iostream> namespace PwrNlp { @@ -30,6 +32,7 @@ std::string make_soname(const std::string &scope, const std::string &name) bool load(const std::string &scope, const std::string &name, bool quiet) { +#ifdef __UNIX__ std::string soname = make_soname(scope, name); // std::cerr << "PLUGIN LOAD " << scope << " " << name << " " << soname << "\n"; // first check if the plugin was already loaded @@ -65,12 +68,14 @@ bool load(const std::string &scope, const std::string &name, bool quiet) if (!quiet) { std::cerr << "Loaded " << scope << " plugin '" << name << "'\n"; } +#endif return true; } bool load_check(const std::string &scope, const std::string &name, bool quiet, boost::function<size_t (void)> counter, const std::string &what) { +#ifdef __UNIX__ size_t before = counter(); if (load(scope, name, quiet)) { size_t after = counter(); @@ -86,6 +91,9 @@ bool load_check(const std::string &scope, const std::string &name, bool quiet, } else { return false; } +#else + return true; +#endif } } /* end ns Plugin */ diff --git a/swig/CMakeLists.txt b/swig/CMakeLists.txt index dd7bb2c..7c5be20 100644 --- a/swig/CMakeLists.txt +++ b/swig/CMakeLists.txt @@ -18,6 +18,7 @@ INCLUDE(${SWIG_USE_FILE}) FIND_PACKAGE(LibXML++ REQUIRED QUIET) include_directories(${LibXML++_INCLUDE_DIRS}) +include_directories(${Boost_INCLUDE_DIRS}) find_package(PythonLibs) -- GitLab