ArUco Compilation

Hi, I am trying to debug my code which uses ArUco library. I am thinking to edit the source code of the ArUco module to help me debug my problems and help me understand it better. I was wondering if it is possible to just copy out the code into another folder and write a CMakeLists.txt to compile the module? If it is possible, how should i go about writing the CMakeLists.txt?