- Most of your find package calls have to come after the project(...)
call. deal.II is a bit special - we call find_package(deal.II) before
project() so that the compiler is configured to be the same as the
one used for deal.II.
- Also you only need to call target_link_libraries() with the imported
libraries. This will set up everything:
- You cannot use the "PUBLIC" keyword with target_link_libraries at
the moment in combination with DEAL_II_INVOKE_AUTOPILOT... :-(
- I am guessing a bit because you have not quoted the full
CMakeLists.txt.
but the following should work:
set(TARGET "cook_membrane")
set(TARGET_SRC
gcmma/GCMMASolver.cpp
mma/MMASolver.cpp
cook_membrane.cpp
)
find_package(deal.II 9.3.0 REQUIRED
HINTS ${deal.II_DIR} ${DEAL_II_DIR} ../ ../../ $ENV{DEAL_II_DIR}
)
DEAL_II_INITIALIZE_CACHED_VARIABLES()
project(${TARGET})
DEAL_II_INVOKE_AUTOPILOT()
find_package(Eigen3 REQUIRED)
find_package(OpenMP REQUIRED)
target_link_libraries(${TARGET} Eigen3::Eigen OpenMP::OpenMP_CXX)