Using recent results on measure theory and algebraic geometry, we show how semidefinite programming can be used to construct invariant measures of one-dimensional discrete dynamical systems (iterated maps on a real interval). In particular we show that both discrete measures (corresponding to finite cycles) and continuous measures (corresponding to chaotic behavior) can be recovered using standard software.