Skip to content
Snippets Groups Projects
Commit 7db1409a authored by Wuttke, Joachim's avatar Wuttke, Joachim
Browse files

CMake: modernize BornAgain* library references

parent 8dd85b59
No related branches found
No related tags found
1 merge request!842CMake: modernize target dependencies
Pipeline #64276 passed
...@@ -20,11 +20,11 @@ set(${lib}_LIBRARY ${lib} PARENT_SCOPE) ...@@ -20,11 +20,11 @@ set(${lib}_LIBRARY ${lib} PARENT_SCOPE)
target_link_libraries(${lib} target_link_libraries(${lib}
PUBLIC PUBLIC
${BornAgainBase_LIBRARY} BornAgainBase
${BornAgainFit_LIBRARY} BornAgainFit
${BornAgainParam_LIBRARY} BornAgainParam
${BornAgainSample_LIBRARY} BornAgainSample
${BornAgainResample_LIBRARY} BornAgainResample
${CMAKE_THREAD_LIBS_INIT} ${CMAKE_THREAD_LIBS_INIT}
${tspectrum_LIBRARY} ${tspectrum_LIBRARY}
) )
......
...@@ -7,6 +7,6 @@ include_directories(${CMAKE_SOURCE_DIR}/Tests/Unit/utilities) ...@@ -7,6 +7,6 @@ include_directories(${CMAKE_SOURCE_DIR}/Tests/Unit/utilities)
file(GLOB source_files "*.cpp" ${CMAKE_SOURCE_DIR}/Tests/GTestWrapper/TestAll.cpp) file(GLOB source_files "*.cpp" ${CMAKE_SOURCE_DIR}/Tests/GTestWrapper/TestAll.cpp)
add_executable(${test} ${source_files}) add_executable(${test} ${source_files})
target_link_libraries(${test} ${BornAgainFit_LIBRARY} gtest) target_link_libraries(${test} BornAgainFit gtest)
gtest_discover_tests(${test} DISCOVERY_TIMEOUT 300 TEST_PREFIX Fit.Unit.) gtest_discover_tests(${test} DISCOVERY_TIMEOUT 300 TEST_PREFIX Fit.Unit.)
...@@ -20,8 +20,8 @@ set(${lib}_LIBRARY ${lib} PARENT_SCOPE) ...@@ -20,8 +20,8 @@ set(${lib}_LIBRARY ${lib} PARENT_SCOPE)
target_link_libraries(${lib} target_link_libraries(${lib}
PUBLIC PUBLIC
${BornAgainBase_LIBRARY} BornAgainBase
${BornAgainFit_LIBRARY} BornAgainFit
) )
target_include_directories(${lib} target_include_directories(${lib}
PUBLIC PUBLIC
......
...@@ -20,7 +20,7 @@ set(${lib}_LIBRARY ${lib} PARENT_SCOPE) ...@@ -20,7 +20,7 @@ set(${lib}_LIBRARY ${lib} PARENT_SCOPE)
target_link_libraries(${lib} target_link_libraries(${lib}
PUBLIC PUBLIC
${BornAgainSample_LIBRARY} BornAgainSample
) )
target_include_directories(${lib} target_include_directories(${lib}
PUBLIC PUBLIC
......
...@@ -20,7 +20,7 @@ set(${lib}_LIBRARY ${lib} PARENT_SCOPE) ...@@ -20,7 +20,7 @@ set(${lib}_LIBRARY ${lib} PARENT_SCOPE)
target_link_libraries(${lib} target_link_libraries(${lib}
PUBLIC PUBLIC
${BornAgainParam_LIBRARY} BornAgainParam
formfactor formfactor
) )
target_include_directories(${lib} target_include_directories(${lib}
......
...@@ -20,10 +20,10 @@ set(${lib}_LIBRARY ${lib} PARENT_SCOPE) ...@@ -20,10 +20,10 @@ set(${lib}_LIBRARY ${lib} PARENT_SCOPE)
target_link_libraries(${lib} target_link_libraries(${lib}
PUBLIC PUBLIC
${BornAgainSample_LIBRARY} BornAgainSample
${BornAgainDevice_LIBRARY} BornAgainDevice
PRIVATE PRIVATE
${BornAgainResample_LIBRARY} BornAgainResample
${CMAKE_THREAD_LIBS_INIT} ${CMAKE_THREAD_LIBS_INIT}
${cerf_target}) ${cerf_target})
......
...@@ -8,4 +8,4 @@ add_library(${lib} SHARED MakeSimulations.cpp) ...@@ -8,4 +8,4 @@ add_library(${lib} SHARED MakeSimulations.cpp)
target_include_directories(${lib} PUBLIC ${CMAKE_SOURCE_DIR}) target_include_directories(${lib} PUBLIC ${CMAKE_SOURCE_DIR})
target_link_libraries(${lib} PUBLIC ${BornAgainSim_LIBRARY}) target_link_libraries(${lib} PUBLIC BornAgainSim)
...@@ -5,6 +5,6 @@ set(test UnitTestBase) ...@@ -5,6 +5,6 @@ set(test UnitTestBase)
file(GLOB source_files "*.cpp" ${CMAKE_SOURCE_DIR}/Tests/GTestWrapper/TestAll.cpp) file(GLOB source_files "*.cpp" ${CMAKE_SOURCE_DIR}/Tests/GTestWrapper/TestAll.cpp)
add_executable(${test} ${source_files}) add_executable(${test} ${source_files})
target_link_libraries(${test} ${BornAgainBase_LIBRARY} gtest) target_link_libraries(${test} BornAgainBase gtest)
gtest_discover_tests(${test} DISCOVERY_TIMEOUT 300 TEST_PREFIX Base.Unit.) gtest_discover_tests(${test} DISCOVERY_TIMEOUT 300 TEST_PREFIX Base.Unit.)
...@@ -5,6 +5,6 @@ set(test UnitTestDevice) ...@@ -5,6 +5,6 @@ set(test UnitTestDevice)
file(GLOB source_files "*.cpp" ${CMAKE_SOURCE_DIR}/Tests/GTestWrapper/TestAll.cpp) file(GLOB source_files "*.cpp" ${CMAKE_SOURCE_DIR}/Tests/GTestWrapper/TestAll.cpp)
add_executable(${test} ${source_files}) add_executable(${test} ${source_files})
target_link_libraries(${test} ${BornAgainDevice_LIBRARY} gtest) target_link_libraries(${test} BornAgainDevice gtest)
gtest_discover_tests(${test} DISCOVERY_TIMEOUT 300 TEST_PREFIX Device.Unit.) gtest_discover_tests(${test} DISCOVERY_TIMEOUT 300 TEST_PREFIX Device.Unit.)
...@@ -12,7 +12,7 @@ add_executable(${test} ${source_files}) ...@@ -12,7 +12,7 @@ add_executable(${test} ${source_files})
target_include_directories(${test} PUBLIC target_include_directories(${test} PUBLIC
${CMAKE_SOURCE_DIR}/3rdparty/common/gtest/gtest-1.8.0/include ${CMAKE_SOURCE_DIR}/3rdparty/common/gtest/gtest-1.8.0/include
${CMAKE_SOURCE_DIR}/Tests/Unit/utilities) ${CMAKE_SOURCE_DIR}/Tests/Unit/utilities)
target_link_libraries(${test} ${BornAgainSim_LIBRARY} gtest) target_link_libraries(${test} BornAgainSim gtest)
if(GCC) if(GCC)
target_compile_options(${test} PUBLIC "-Wno-deprecated-copy") target_compile_options(${test} PUBLIC "-Wno-deprecated-copy")
endif() endif()
......
...@@ -5,6 +5,6 @@ set(test UnitTestParam) ...@@ -5,6 +5,6 @@ set(test UnitTestParam)
file(GLOB source_files "*.cpp" ${CMAKE_SOURCE_DIR}/Tests/GTestWrapper/TestAll.cpp) file(GLOB source_files "*.cpp" ${CMAKE_SOURCE_DIR}/Tests/GTestWrapper/TestAll.cpp)
add_executable(${test} ${source_files}) add_executable(${test} ${source_files})
target_link_libraries(${test} ${BornAgainParam_LIBRARY} gtest) target_link_libraries(${test} BornAgainParam gtest)
gtest_discover_tests(${test} DISCOVERY_TIMEOUT 300 TEST_PREFIX Param.Unit.) gtest_discover_tests(${test} DISCOVERY_TIMEOUT 300 TEST_PREFIX Param.Unit.)
...@@ -5,6 +5,6 @@ set(test UnitTestResample) ...@@ -5,6 +5,6 @@ set(test UnitTestResample)
file(GLOB source_files "*.cpp" ${CMAKE_SOURCE_DIR}/Tests/GTestWrapper/TestAll.cpp) file(GLOB source_files "*.cpp" ${CMAKE_SOURCE_DIR}/Tests/GTestWrapper/TestAll.cpp)
add_executable(${test} ${source_files}) add_executable(${test} ${source_files})
target_link_libraries(${test} ${BornAgainResample_LIBRARY} gtest) target_link_libraries(${test} BornAgainResample gtest)
gtest_discover_tests(${test} DISCOVERY_TIMEOUT 300 TEST_PREFIX Resample.Unit.) gtest_discover_tests(${test} DISCOVERY_TIMEOUT 300 TEST_PREFIX Resample.Unit.)
...@@ -5,6 +5,6 @@ set(test UnitTestSample) ...@@ -5,6 +5,6 @@ set(test UnitTestSample)
file(GLOB source_files "*.cpp" ${CMAKE_SOURCE_DIR}/Tests/GTestWrapper/TestAll.cpp) file(GLOB source_files "*.cpp" ${CMAKE_SOURCE_DIR}/Tests/GTestWrapper/TestAll.cpp)
add_executable(${test} ${source_files}) add_executable(${test} ${source_files})
target_link_libraries(${test} ${BornAgainSample_LIBRARY} gtest) target_link_libraries(${test} BornAgainSample gtest)
gtest_discover_tests(${test} DISCOVERY_TIMEOUT 300 TEST_PREFIX Sample.Unit.) gtest_discover_tests(${test} DISCOVERY_TIMEOUT 300 TEST_PREFIX Sample.Unit.)
...@@ -5,6 +5,6 @@ set(test UnitTestCore) ...@@ -5,6 +5,6 @@ set(test UnitTestCore)
file(GLOB source_files "*.cpp" ${CMAKE_SOURCE_DIR}/Tests/GTestWrapper/TestAll.cpp) file(GLOB source_files "*.cpp" ${CMAKE_SOURCE_DIR}/Tests/GTestWrapper/TestAll.cpp)
add_executable(${test} ${source_files}) add_executable(${test} ${source_files})
target_link_libraries(${test} ${BornAgainSim_LIBRARY} gtest) target_link_libraries(${test} BornAgainSim gtest)
gtest_discover_tests(${test} DISCOVERY_TIMEOUT 300 TEST_PREFIX Sim.Unit.) gtest_discover_tests(${test} DISCOVERY_TIMEOUT 300 TEST_PREFIX Sim.Unit.)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment