National security and foreign policy were mainly an afterthought in President Trump’s State of the Union address. What he said was less notable than what he did not say.

The National Defense Strategy, recently released by Secretary of Defense Jim Mattis, suggests that “interstate strategic competition, not terrorism, is now the primary concern in U.S. national security.” It goes on to cite China and Russia as primary threats. Listed next are North Korea and Iran, only then followed by terrorism.

As noted by the Brookings Institution’s Tom Wright, the State of the Union reversed the priorities: Trump mentioned “trade deals, immigrants, terrorism, and North Korea” as primary threats. Great power rivals were barely mentioned. This was Trump’s only mention of Russia and China: “Around the world, we face rogue regimes, terrorist groups, and rivals like China and Russia that challenge our interests, our economy, and our values. In confronting these dangers, we know that weakness is the surest path to conflict, and unmatched power is the surest means of our defense.”

That box checked off, Trump moved on to calling for more defense spending and more nuclear weapons. As with his call for more infrastructure spending, he showed no awareness that his ambitious plans are undermined by the GOP tax bill, which will add an estimated $1 trillion to our debt.

Trump took an understandable victory lap for the military success against the Islamic State — “I am proud to report that the coalition to defeat ISIS has liberated almost 100 percent of the territory once held by these killers in Iraq and Syria” — without, of course, mentioning that his strategy to combat the Islamic State is largely the same one laid out and implemented by President Barack Obama. Praising his predecessor would have been an easy bipartisan note to strike, but Trump simply couldn’t bring himself to do it.

He also made no mention of something Secretary of State Rex Tillerson recently said: U.S. troops would remain in Syria to stabilize the areas liberated from the Islamic State. This would seem to be at odds with Trump’s aversion to nation-building and prolonged military deployments overseas, but whether this plan has his approval must remain a matter of conjecture. He also made no comment on the growing confrontation between Turkey, a NATO ally, and America’s Kurdish allies in Syria, giving no clue about how he hopes to resolve this intractable conflict.

Nor did Trump have much to say about the Iran nuclear deal: Will he pull out or not? All he said was, “I am asking Congress to address the fundamental flaws in the terrible Iran nuclear deal,” without specifying what changes he would like, or how he hopes to get the other parties to the deal — including the European Union, China and Russia — to go along.

What about North Korea? Trump mentioned that its “reckless pursuit of nuclear missiles could very soon threaten our homeland,” without saying what he will do about it. It’s not a good sign that the administration just abandoned the appointment of Victor Cha, one of the most respected Korea experts in Washington, as the ambassador to South Korea, reportedly because he opposes launching a preventive “bloody nose” strike on the North. But if Trump is seriously considering attacking North Korea (a very bad idea, for reasons Cha spelled out in The Post), he gave no hint of it in the State of the Union. You would think that if the administration is seriously considering going to war — and all indications are that it is — the president would want to make the case to the public for why military action is necessary.

Instead, Trump excoriated North Korea for its abysmal human rights record. He showcased the parents of American student Otto Warmbier, who died after imprisonment by North Korea, and Ji Seong-ho, a North Korean refugee who lost his legs while searching for food. “Your great sacrifice is an inspiration to us all,” Trump said to Ji, who waved his crutches in defiance. It was a moving moment, but it is hard to know what it tells us about Trump’s policy. Does the president view North Korea’s terrible human rights record as cause for more sanctions — or as a rationale for a military strike? He didn’t say.

Trump’s outrage over North Korea’s human rights abuses, and those in Iran, Cuba and Venezuela, is undermined by the fact that he had nothing to say about human rights abuses in countries whose rulers he plainly admires. Countries such as the Philippines, Egypt, Turkey, China — and Russia. Trump tweeted up a storm after Iran crushed anti-regime demonstrations. But he was silent this past weekend when Vladimir Putin’s goons arrested Russian opposition leader Alexei Navalny. Trump’s highly selective invocation of human rights makes it hard for anyone to take him seriously.

In general, it is hard to know where Trump is headed in foreign policy because of the continuing conflict between his isolationist and protectionist impulses, and the more internationalist worldview of his senior advisers. The State of the Union provided no help in explicating the administration’s path ahead.