Skip to content
Snippets Groups Projects
Commit 30bbc07d authored by Jaime Arias's avatar Jaime Arias
Browse files

Merge branch 'feature/fix_cmake' into 'master'

Fix CMake to find spot library

See merge request !2
parents ac81aad5 cf184c6f
No related branches found
No related tags found
1 merge request!2Fix CMake to find spot library
......@@ -139,5 +139,10 @@ local.properties
.sts4-cache/
### Kate ###
# Swap Files #
.*.kate-swp
.swp.*
# End of https://www.gitignore.io/api/c++,cmake
......@@ -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)
......
File deleted
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment