diff --git a/CMakeLists.txt b/CMakeLists.txt index cf009cf..86ab624 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -59,22 +59,11 @@ 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) @@ -82,3 +71,6 @@ add_subdirectory(kk) if(PADE) add_subdirectory(pade/pade_arbitrary_degree) endif(PADE) + +#install +install(TARGETS maxent DESTINATION bin) diff --git a/cmake/EnableGtests.cmake b/cmake/EnableGtests.cmake index 69f37d8..ed164e8 100644 --- a/cmake/EnableGtests.cmake +++ b/cmake/EnableGtests.cmake @@ -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}) diff --git a/kk/CMakeLists.txt b/kk/CMakeLists.txt index 2bc7a5e..9b16a17 100644 --- a/kk/CMakeLists.txt +++ b/kk/CMakeLists.txt @@ -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) diff --git a/legendre_convert/CMakeLists.txt b/legendre_convert/CMakeLists.txt index 266d900..78bba2c 100644 --- a/legendre_convert/CMakeLists.txt +++ b/legendre_convert/CMakeLists.txt @@ -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) diff --git a/pade/pade_arbitrary_degree/CMakeLists.txt b/pade/pade_arbitrary_degree/CMakeLists.txt index a912be9..260757b 100644 --- a/pade/pade_arbitrary_degree/CMakeLists.txt +++ b/pade/pade_arbitrary_degree/CMakeLists.txt @@ -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) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt new file mode 100644 index 0000000..29e7ef6 --- /dev/null +++ b/test/CMakeLists.txt @@ -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) +