Skip to content

Commit

Permalink
add install to all targets and move tests to subdirectory
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanlevy committed May 9, 2016
1 parent d726426 commit cb80315
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 14 deletions.
18 changes: 5 additions & 13 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -59,26 +59,18 @@ target_link_libraries(maxent libmaxent ${ALPSCore_LIBRARIES} ${GSL_LIBRARIES} ${

#testing setup
option(Testing "Enable testing" ON)
include(EnableGtests) #defined in ./cmake
include_directories("test")


list(APPEND LINK_ALL libmaxent ${ALPSCore_LIBRARIES} ${GSL_LIBRARIES} ${BLAS_LIBRARIES} ${LAPACK_LIBRARIES})
enable_testing(test)
set(test_src
default_modelTest
backcontTest
gridTest
parmsTest
simulationTest
paramFailureTest
)
foreach(test ${test_src})
add_gtest(${test} test)
endforeach(test)
add_subdirectory(test)

#add companion utilities
add_subdirectory(legendre_convert)
add_subdirectory(kk)
if(PADE)
add_subdirectory(pade/pade_arbitrary_degree)
endif(PADE)

#install
install(TARGETS maxent DESTINATION bin)
2 changes: 1 addition & 1 deletion cmake/EnableGtests.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function(add_gtest test)
set(gtest_src "${ARGV1}/gtest_main.cc;${ARGV1}/gtest-all.cc")
else(${ARGC} EQUAL 2)
set(source "${test}")
set(gtest_src "gtest/gtest_main.cc;gtest/gtest-all.cc")
set(gtest_src "gtest_main.cc;gtest-all.cc")
endif(${ARGC} EQUAL 2)

add_executable(${test} ${source} ${gtest_src})
Expand Down
1 change: 1 addition & 0 deletions kk/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -O3 -DNDEBUG")

add_executable(kk kk.cpp )
target_link_libraries(kk ${ALPSCore_LIBRARIES} ${GSL_LIBRARIES} ${Boost_LIBRARIES})
install(TARGETS kk DESTINATION bin)
1 change: 1 addition & 0 deletions legendre_convert/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ add_executable(legendre_convert legendre_convert.cpp)
set(CMAKE_CXX_FLAGS "-W -Wno-sign-compare -O2 -g")
#target_link_libraries("/opt/local/lib/")
target_link_libraries(legendre_convert ${Boost_LIBRARIES})
install(TARGETS legendre_convert DESTINATION bin)
1 change: 1 addition & 0 deletions pade/pade_arbitrary_degree/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ link_directories("/opt/local/lib")

add_executable(pade pade.cpp pade_grid.cpp pade_real.cpp pade_imag.cpp pade_interpolator.cpp pade_solver.cpp)
target_link_libraries(pade ${ALPSCore_LIBRARIES} gmpxx gmp)
install(TARGETS pade DESTINATION bin)
14 changes: 14 additions & 0 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
cmake_minimum_required(VERSION 2.8.12)
include(EnableGtests) #defined in ./cmake
set(test_src
default_modelTest
backcontTest
gridTest
parmsTest
simulationTest
paramFailureTest
)
foreach(test ${test_src})
add_gtest(${test})
endforeach(test)

0 comments on commit cb80315

Please sign in to comment.