Skip to content

Commit b7a7ba5

Browse files
committed
Fix cmake usage
1 parent ccc118a commit b7a7ba5

File tree

4 files changed

+25
-35
lines changed

4 files changed

+25
-35
lines changed

CMakeLists.txt

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
1919
# THE SOFTWARE.
2020

21-
cmake_minimum_required(VERSION 3.12 FATAL_ERROR)
21+
cmake_minimum_required(VERSION 3.15 FATAL_ERROR)
2222

2323
# -----------------------------------------------------------------------------
2424
# Make RelWithDebInfo the default build type if otherwise not set
@@ -54,6 +54,8 @@ foreach(build_config ${build_types})
5454
endforeach()
5555
endforeach()
5656

57+
set(CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY ON)
58+
set(CMAKE_EXPORT_PACKAGE_REGISTRY OFF)
5759
project(approxmc)
5860
set(CMAKE_CXX_EXTENSIONS OFF)
5961
set(CMAKE_C_STANDARD 99)
@@ -90,9 +92,6 @@ if((${CMAKE_SYSTEM_NAME} MATCHES "Linux") OR (${CMAKE_SYSTEM_NAME} MATCHES "Darw
9092
endif()
9193
endif()
9294

93-
set(THREADS_PREFER_PTHREAD_FLAG ON)
94-
find_package(Threads REQUIRED)
95-
9695
option(SANITIZE "Use Clang sanitizers. You MUST use clang++ as the compiler for this to work" OFF)
9796
if(SANITIZE)
9897
message(WARNING " --Using clang sanitizers -- you MUST use clang++ or the compile WILL fail")
@@ -349,31 +348,30 @@ endmacro()
349348
# -----------------------------------------------------------------------------
350349
# Dependencies
351350
# -----------------------------------------------------------------------------
352-
option(NOZLIB "Don't use zlib" OFF)
353-
if(NOT NOZLIB AND NOT (STATICCOMPILE AND WIN32))
354-
find_package(ZLIB)
355-
if(ZLIB_FOUND)
356-
message(STATUS "OK, Found ZLIB!")
357-
add_compile_definitions(USE_ZLIB)
358-
else()
359-
message(STATUS "WARNING: Did not find ZLIB, gzipped file support will be disabled")
360-
endif()
361-
endif()
362-
363351
find_package(GMP REQUIRED)
364-
352+
set(cryptominisat5_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../cryptominisat/build")
365353
find_package(cryptominisat5 CONFIG REQUIRED)
366354
message(STATUS "CryptoMiniSat5 dynamic lib: ${CRYPTOMINISAT5_LIBRARIES}")
367355
message(STATUS "CryptoMiniSat5 static lib: ${CRYPTOMINISAT5_STATIC_LIBRARIES}")
368356
message(STATUS "CryptoMiniSat5 static lib deps: ${CRYPTOMINISAT5_STATIC_LIBRARIES_DEPS}")
369357
message(STATUS "CryptoMiniSat5 include dirs: ${CRYPTOMINISAT5_INCLUDE_DIRS}")
370358

359+
set(arjun_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../arjun/build")
371360
find_package(arjun CONFIG REQUIRED)
372361
message(STATUS "Arjun dynamic lib : ${ARJUN_LIBRARIES}")
362+
message(STATUS "Arjun dynamic lib : ${ARJUN_STATIC_LIBRARIES}")
373363
message(STATUS "Arjun include dirs: ${ARJUN_INCLUDE_DIRS}")
374-
find_package(sbva CONFIG REQUIRED)
375-
find_package(EvalMaxSAT CONFIG REQUIRED)
376-
find_package(treedecomp CONFIG REQUIRED)
364+
365+
option(NOZLIB "Don't use zlib" OFF)
366+
if(NOT NOZLIB AND NOT (STATICCOMPILE AND WIN32))
367+
find_package(ZLIB)
368+
if(ZLIB_FOUND)
369+
message(STATUS "OK, Found ZLIB!")
370+
add_compile_definitions(USE_ZLIB)
371+
else()
372+
message(STATUS "WARNING: Did not find ZLIB, gzipped file support will be disabled")
373+
endif()
374+
endif()
377375

378376
# -----------------------------------------------------------------------------
379377
# Provide an export name to be used by targets that wish to export themselves.
Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
2+
set -euo pipefail
23

3-
set -e
4-
5-
rm -rf lib* Test* tests* include tests scalmc* CM* cmake* approxmc* apx-src
4+
rm -rf .cmake lib* Test* tests* include tests scalmc* CM* cmake* approxmc* apx-src
65
cmake -DENABLE_TESTING=ON ..
76
make -j16
87
make test

src/CMakeLists.txt

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,31 +51,29 @@ target_include_directories(approxmc
5151
${CMAKE_CURRENT_BINARY_DIR}
5252
PUBLIC
5353
${CRYPTOMINISAT5_INCLUDE_DIRS}
54-
${ARJUN_INCLUDE_DIRS}
55-
${GMP_INCLUDE_DIRS}
5654
)
5755

5856
target_link_libraries(approxmc
5957
PUBLIC
60-
Threads::Threads
61-
${ARJUN_LIBRARIES}
6258
${CRYPTOMINISAT5_LIBRARIES}
6359
)
6460

6561
add_executable(approxmc-bin main.cpp ${approxmc_lib_files})
6662

67-
target_include_directories(approxmc-bin PRIVATE
63+
target_include_directories(approxmc-bin
64+
PRIVATE
6865
${PROJECT_SOURCE_DIR}
6966
${CMAKE_CURRENT_SOURCE_DIR}
7067
${CMAKE_CURRENT_BINARY_DIR}
71-
${CRYPTOMINISAT5_INCLUDE_DIRS}
7268
${ARJUN_INCLUDE_DIRS}
73-
${GMP_INCLUDE_DIRS}
69+
PUBLIC
70+
${CRYPTOMINISAT5_INCLUDE_DIRS}
7471
)
7572

7673
target_link_libraries(approxmc-bin
7774
PRIVATE
7875
${GMP_LIBRARY}
76+
${ARJUN_LIBRARIES}
7977
approxmc
8078
)
8179

src/counter.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,6 @@
4141
#include "counter.h"
4242
#include "appmc_constants.h"
4343
#include "time_mem.h"
44-
#ifdef CMS_LOCAL_BUILD
45-
#include "arjun.h"
46-
#else
47-
#include <arjun/arjun.h>
48-
#endif
4944

5045
using std::cout;
5146
using std::endl;

0 commit comments

Comments
 (0)