diff --git a/.gitignore b/.gitignore index db7a40bee46e0e4dbd9dfcd80178d47317bd0d6a..2b8662f3cd8ad8ca12a3561bff071ee4ae3bc040 100644 --- a/.gitignore +++ b/.gitignore @@ -139,5 +139,10 @@ local.properties .sts4-cache/ +### Kate ### +# Swap Files # +.*.kate-swp +.swp.* + # End of https://www.gitignore.io/api/c++,cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index ce564250905b0d9f5e9159bfa473343360d450d6..8d84c87aacc3d00cea471e8bf45dc37a379b4f7b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -21,18 +21,29 @@ set(SYLVAN_DIR "${CMAKE_SOURCE_DIR}/third-party/sylvan") include_directories(${SYLVAN_DIR}) add_subdirectory(${SYLVAN_DIR}) -# add spot -include(ExternalProject) -message(STATUS "Building Spot ...") -set(SPOT_SOURCE_DIR "${CMAKE_SOURCE_DIR}/third-party/spot") -set(SPOT_DIR "${CMAKE_BINARY_DIR}/third-party/spot") -ExternalProject_Add(SpotLibrary - PREFIX ${SPOT_DIR} - SOURCE_DIR ${SPOT_SOURCE_DIR} - CONFIGURE_COMMAND autoreconf -if ${SPOT_SOURCE_DIR} && ${SPOT_SOURCE_DIR}/configure --disable-python --prefix=<INSTALL_DIR> --enable-static - BUILD_COMMAND make -j -) -include_directories("${SPOT_DIR}/include") +# build spot if it is not installed on the system +find_library(SPOT_LIBRARY "spot") +find_library(BDDX_LIBRARY "bddx") + +if(NOT SPOT_LIBRARY) + include(ExternalProject) + + message(STATUS "Building Spot ...") + set(SPOT_SOURCE_DIR "${CMAKE_SOURCE_DIR}/third-party/spot") + set(SPOT_DIR "${CMAKE_BINARY_DIR}/third-party/spot") + + ExternalProject_Add(SpotLibrary + PREFIX ${SPOT_DIR} + SOURCE_DIR ${SPOT_SOURCE_DIR} + CONFIGURE_COMMAND autoreconf -if ${SPOT_SOURCE_DIR} && ${SPOT_SOURCE_DIR}/configure --disable-python --prefix=<INSTALL_DIR> + BUILD_COMMAND make -j + ) + + include_directories("${SPOT_DIR}/include") +else () + message(STATUS "Found spot: ${SPOT_LIBRARY}") + message(STATUS "Found bddx: ${BDDX_LIBRARY}") +endif() # add source folder include_directories(src) diff --git a/src/.MCHybridSOG.h.kate-swp b/src/.MCHybridSOG.h.kate-swp deleted file mode 100644 index a65057426854c2e2438dac15c8c74a0492744abb..0000000000000000000000000000000000000000 Binary files a/src/.MCHybridSOG.h.kate-swp and /dev/null differ diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 4231a5f4049a99848bcad77aa9f95f6f12914afe..f15c8d0ddd665170645551fb2761245cfc54faf5 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -6,27 +6,20 @@ find_package(MPI REQUIRED) include_directories(${MPI_INCLUDE_PATH}) # include openssl -find_package(OpenSSL) +find_package(OpenSSL REQUIRED) include_directories(${OPENSSL_INCLUDE_DIR}) -include_directories("${CMAKE_SOURCE_DIR}/third-party/sylvan/src") - - -add_library(spot SHARED IMPORTED) # or STATIC instead of SHARED -set_target_properties(spot PROPERTIES - IMPORTED_LOCATION "/usr/lib/x86_64-linux-gnu/libspot.so" - INTERFACE_INCLUDE_DIRECTORIES "/usr/include/spot/" -) - -add_library(bddx SHARED IMPORTED) # or STATIC instead of SHARED -set_target_properties(bddx PROPERTIES - IMPORTED_LOCATION "/usr/lib/x86_64-linux-gnu/libbddx.so" - INTERFACE_INCLUDE_DIRECTORIES "/usr/include/spot/" -) - - - +# include spot and bddx library +add_library(spot SHARED IMPORTED) +add_library(bddx SHARED IMPORTED) +if(NOT SPOT_LIBRARY) + set_target_properties(spot PROPERTIES IMPORTED_LOCATION "${SPOT_DIR}/lib/libspot.so") + set_target_properties(bddx PROPERTIES IMPORTED_LOCATION "${SPOT_DIR}/lib/libbddx.so") +else() + set_target_properties(spot PROPERTIES IMPORTED_LOCATION ${BDDX_LIBRARY}) + set_target_properties(bddx PROPERTIES IMPORTED_LOCATION ${SPOT_LIBRARY}) +endif() # Hybrid SOG executable add_executable(hybrid-sog main.cpp