I would like to "port" this C++ project, which uses qmake
(i.e., a Tool.pro file) for building, to cmake
.
Essentially, I'm asking how to go about writing the necessary CMakeLists.txt
file(s) by looking at the Tool.pro
file above.
This is what I've done so far:
include_directories(../lib/cudd-2.5.0/include BFAbstractionLibrary)
add_executable(slugs BFAbstractionLibrary/bddDump.cpp BFAbstractionLibrary/BFCuddVarVector.cpp BFAbstractionLibrary/BFCudd.cpp BFAbstractionLibrary/BFCuddManager.cpp \
BFAbstractionLibrary/BFCuddVarCube.cpp tools.cpp synthesisAlgorithm.cpp synthesisContextBasics.cpp variableManager.cpp \
BFAbstractionLibrary/BFCuddMintermEnumerator.cpp)
add_library(lcudd ../lib/cudd-2.5.0/cudd)
add_library(ldddmp ../lib/cudd-2.5.0/dddmp)
add_library(lmtr ../lib/cudd-2.5.0/mtr)
add_library(lepd ../lib/cudd-2.5.0/epd)
add_library(lst ../lib/cudd-2.5.0/st)
add_library(lutil ../lib/cudd-2.5.0/util)
target_link_libraries(slugs lcudd, lutil, lmtr, lst, ldddmp, lepd)
This is definitely missing the headers that are present in the Tool.pro
file. I'm also not sure what I have to do with the flags in the first 24 lines of the Tool.pro
file.
Could you point me in the right direction please?
- PS1. I have already looked at the CMake Tutorial.
- PS2. I have tried
two scripts:
q2c
,qmake2cmake
. The former built an essentially emptyCMakeLists.txt
file. The latter built a seemingly OK file but thenmake
failed saying it couldn't find some header file (which is located in a subdirectory). - PS3. I have successfully built the project with
qmake
.
After sacrificing some of the modularity and complexity of the
Tool.pro
file above, I was able to build the project usingcmake
. Here's theCMakeLists.txt
file that I wrote: