get lepton compiler flags without having to link its library twice

This commit is contained in:
Axel Kohlmeyer
2022-12-29 20:09:42 -05:00
parent cae18d01a3
commit ec244dbad3

View File

@ -20,8 +20,12 @@ target_link_libraries(test_platform PRIVATE lammps GTest::GMockMain)
add_test(NAME Platform COMMAND test_platform)
if(PKG_LEPTON)
get_target_property(LEPTON_DEF lepton COMPILE_DEFINITONS)
get_target_property(LEPTON_INC lepton INCLUDE_DIRECTORIES)
add_executable(test_lepton test_lepton.cpp)
target_link_libraries(test_lepton PRIVATE lepton lammps GTest::GMockMain)
target_link_libraries(test_lepton PRIVATE lammps GTest::GMockMain)
target_compile_definitions(test_lepton PRIVATE ${LEPTON_DEF})
target_include_directories(test_lepton PRIVATE ${LEPTON_INC})
add_test(NAME Lepton COMMAND test_lepton)
endif()