Skip to content

Commit

Permalink
Fixing installation of header files
Browse files Browse the repository at this point in the history
  • Loading branch information
msoos committed Jul 6, 2020
1 parent e55f148 commit fe1f668
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 14 deletions.
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ cmake_minimum_required(VERSION 3.3 FATAL_ERROR)
set(CMAKE_C_STANDARD 99)
set(CMAKE_CXX_STANDARD 11)

include (GenerateExportHeader)
include (GNUInstallDirs)

message(STATUS "LIB directory is '${CMAKE_INSTALL_LIBDIR}'")
message(STATUS "BIN directory is '${CMAKE_INSTALL_BINDIR}'")

Expand Down Expand Up @@ -86,6 +83,9 @@ endforeach()

PROJECT(approxmc)

include (GenerateExportHeader)
include (GNUInstallDirs)

# contains some library search cmake scripts
SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)

Expand Down
17 changes: 8 additions & 9 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,6 @@ set_target_properties(approxmc PROPERTIES
SOVERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}
)

install(TARGETS approxmc
EXPORT ${CRYPTOMINISAT5_EXPORT_NAME}
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/approxmc"
)

approxmc_add_public_header(approxmc ${CMAKE_CURRENT_BINARY_DIR}/approxmc/approxmc.h )


Expand All @@ -107,6 +99,14 @@ foreach(public_header ${approxmc_public_headers})
)
endforeach()

install(TARGETS approxmc
EXPORT ${CRYPTOMINISAT5_EXPORT_NAME}
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/approxmc"
)

add_executable(approxmc-bin
main.cpp
${approxmc_lib_files}
Expand All @@ -116,7 +116,6 @@ set(approxmc_exec_link_libs
${Boost_LIBRARIES}
${GMP_LIBRARY}
${CRYPTOMINISAT5_LIBRARIES}
${cms_libs}
)

IF (ZLIB_FOUND)
Expand Down
3 changes: 1 addition & 2 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,8 @@ foreach(F ${MY_TESTS})
)
target_link_libraries(${F}
${GMP_LIBRARY}
${CRYPTOMINISAT5_LIBRARIES}
${cms_libs}
${GTEST_BOTH_LIBRARIES}
${CRYPTOMINISAT5_LIBRARIES}
approxmc
)
add_test (
Expand Down

0 comments on commit fe1f668

Please sign in to comment.