PSOPT / psopt

PSOPT Optimal Control Software
GNU Lesser General Public License v2.1
193 stars 75 forks source link

Examplefix #21

Closed schulz0r closed 3 years ago

schulz0r commented 3 years ago

I had to work on the CMakeLists of all examples. First, the linker configuration was not right. Normally, you do not link against library directories, but simply the libraries themselves, like ${ipopt_LIBRARIES}. Then, I removed the include directories because there are none in the examples. I only see one .cxx file per example. Since I wrote Findpackage files in cmake/, you can use find_package() to find ColPack and AdolC. You don't need to add INCLUDE_DIRS for each dependency, just drop their names in target_link_libraries(). CMake will automatically add include dirs as needed.

The resulting CMake files work fine for me and are by far simpler. I renamed some directories so their names match the names of the cxx file of the example. That is because it is easier to script the CMake file generation that way.