Skip to content

Commit

Permalink
Cmake fix
Browse files Browse the repository at this point in the history
  • Loading branch information
viktorteren committed Apr 19, 2024
1 parent 774b634 commit 0b009fa
Showing 1 changed file with 9 additions and 20 deletions.
29 changes: 9 additions & 20 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.9)
cmake_minimum_required(VERSION 3.1)
project (Seto LANGUAGES CXX C)

include(GNUInstallDirs)
Expand Down Expand Up @@ -36,33 +36,22 @@ add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/libs)
file(GLOB SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp)
file(GLOB HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/include/*.h)

add_executable(${PROJECT_NAME} ${SOURCES} ${HEADERS}
include/main.h)
add_executable(${PROJECT_NAME} ${SOURCES} ${HEADERS})

target_link_libraries(${PROJECT_NAME} libminisat)
target_link_libraries(${PROJECT_NAME} pblib)
if( python3.10_FOUND )
target_link_libraries(${PROJECT_NAME} python3.10) #needed for networkx usage
endif()
target_link_libraries(${PROJECT_NAME} python3.10) #needed for networkx usage
target_link_libraries(${PROJECT_NAME} cudd)
if( OpenMP_FOUND )
target_link_libraries(${PROJECT_NAME} OpenMP::OpenMP_CXX)
endif()
target_include_directories(${PROJECT_NAME} PRIVATE ${CUDD_INCLUDE_DIR})
add_dependencies(${PROJECT_NAME} cudd)

if( python3.10_FOUND )
if ( CMAKE_CXX_COMPILER_ID MATCHES "Clang|AppleClang|GNU" )
target_compile_options(${PROJECT_NAME} PRIVATE -Wall -Wextra -I/usr/include/python3.10)
endif()
if ( CMAKE_CXX_COMPILER_ID MATCHES "MSVC" )
target_compile_options(${PROJECT_NAME} PRIVATE /W4 /wd4267 -I/usr/include/python3.10)
endif()
else()
if ( CMAKE_CXX_COMPILER_ID MATCHES "Clang|AppleClang|GNU" )
target_compile_options(${PROJECT_NAME} PRIVATE -Wall -Wextra)
endif()
if ( CMAKE_CXX_COMPILER_ID MATCHES "MSVC" )
target_compile_options(${PROJECT_NAME} PRIVATE /W4 /wd4267)
endif()

if ( CMAKE_CXX_COMPILER_ID MATCHES "Clang|AppleClang|GNU" )
target_compile_options(${PROJECT_NAME} PRIVATE -Wall -Wextra -I/usr/include/python3.10)
endif()
if ( CMAKE_CXX_COMPILER_ID MATCHES "MSVC" )
target_compile_options(${PROJECT_NAME} PRIVATE /W4 /wd4267 -I/usr/include/python3.10)
endif()

0 comments on commit 0b009fa

Please sign in to comment.