![]() ![]() (Boost is an excellent example of this.)ĬMake contains pre-existing "rules" for finding things that can make life difficult for people who specify -prefix when they install things. Unlike GNU autotools, you can't always point CMake to a path where you built something and expect it to "just work". Using the CMake function find_package() can cause many difficulties, because Cmake has an unusual way of dealing with software dependencies. Otherwise, changing the CMake command and running it again doesn't implement any of the changes. So, if I want to reconfigure, I have to blow away all of these files. ![]() There's CMakeCache.txt, CMakeFiles/, CPackConfig.cmake, CPackSourceConfig.cmake, CTestTestfile.cmake, and cmake_install.cmake. With CMake, there are a lot of files that CMake creates, and it's not clear which one needs to be deleted to re-configure with CMake. Worst case scenario, you nuke config.log. If you're using autotools, it's straightforward to re-make or re-configure: you either run "make clean", or you just run configure again. You can even use a tool like CDash to display your outputs in a pretty format. This makes regression testers quite simple. This test system allows for downloading from a version control system and outputting test results in a variety of formats. This is a convenient feature - anything that makes generating documentation easier is good.ĬMake makes running software tests very easy - you basically create your test and then add something like You can use a macro to generate Doxygen documentation if Doxygen is available on the system. You can also require users to have a certain minimum version of CMake (although this can sometimes be a pain for users.) You can specify which version of CMake to emulate when running CMake - so if you have CMake 2.6, you can make a CMakeLists.txt that works like CMake 2.4. It's always good to let people choose their own IDEs/platforms (even if their IDEs/platforms suck a golf ball through a garden hose). However, using CMake, you can specify that you want to create a configuration for a software project that will work for a Make system (Unix), or another IDE like XCode (Mac) or Visual C++ (Windows). Most software projects that are built from source code have to distribute binaries for non-Unix systems (basically, Windows). Recall that linking to shared libraries tells the code where to find the libraries linking to static libraries adds the library code used into the executable.Īdding the following will cause the created Makefiles to be more verbose:Īdvantages and Disadvantages Advantages Cross-Platform The keyword SHARED creates a shared library to create a static library, just remove the keyword "SHARED". PROJECT ( mylibrary ) SET ( mylib_SRCS library.cpp ) ADD_LIBRARY ( my SHARED $ )ĪDD_LIBRARY creates a library from the list of source code files in "mylib_SRCS". ![]()
0 Comments
Leave a Reply. |