I'm trying to compile a c++ program with the SDL package using cmake but I have issues finding the SDL.h file when I compile it with the make command.
Currently the CMakeLists.txt looks like this:
cmake_minimum_required(VERSION 3.5)
set(CMAKE_CXX_STANDARD 17)
project(TestProject VERsion 1.0 DESCRIPTION "Game project" LANGUAGES CXX)
add_compile_options(-Wall -Wextra -pedantic -Werror)
add_library(Gamelib ${PROJECT_SOURCE_DIR}/Source/Game/game.cc)
target_include_directories(Gamelib PUBLIC ${PROJECT_SOURCE_DIR}/Source/include
${PROJECT_SOURCE_DIR}/SDL/include)
add_executable(main ${PROJECT_SOURCE_DIR}/Source/main.cc)
target_link_libraries(main Gamelib)
The project structure looks like this:
|--project
|
+-- CMakeLists.txt
|
+-- Source
| |
| +--Game
| | |
| | +-- game.cc
| |
| +--include
| | |
| | +--game.h
| |
| +-- main.cc
|
|
+--SDL
|
+--include
I also tried with using the find_package command but then I ended up with a linker error instead. Does anybody have an idea of how I can solve this?
I have a CMake project with following structure:
project
|- src
| |- plugins
| | |- class1
| | | |- class1.hpp
| | | |- class1.cpp
| | | |- CMakeLists.txt
| | |- class2
| | |- class2.hpp
| | |- class2.cpp
| | |- CMakeLists.txt
| |- tests
| |- CMakeLists.txt
| |- test_1
| | |- test.cpp
| | |- CMakeLists.txt
| |- test_2
| |- test.cpp
| |- CMakeLists.txt
|- CMakeLists.txt
The contents of the CMakeLists is as follows:
project/CMakeLists:
cmake_minimum_required (VERSION 3.7)
project(project-name)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14")
add_subdirectory(src/plugins/class1)
add_subdirectory(src/plugins/class2)
## Tests
option(CMAKE_BUILD_TESTS "Build tests" ON)
if(CMAKE_BUILD_TESTS)
enable_testing()
add_subdirectory(src/tests)
endif()
project/src/plugins/class1/CMakeLists.txt (similarly for class2):
project(plugin_1)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14")
add_library(class1 SHARED class1.cpp class1.hpp)
target_compile_options(class1 PRIVATE $<$<CXX_COMPILER_ID:GNU>:-Wall>)
install(TARGETS class1
COMPONENT bin
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
project/src/tests/CMakeLists.txt:
cmake_minimum_required (VERSION 3.7)
project(unit-tests)
add_subdirectory(test_1)
add_test(NAME test_1 COMMAND test_1)
add_subdirectory(test_2)
add_test(NAME test_2 COMMAND test_2)
project/src/tests/test_1/CMakeLists.txt (similarly for test_2):
cmake_minimum_required (VERSION 3.7)
project(test_1)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
include_directories(${CMAKE_SOURCE_DIR}/src/plugins/class1)
add_executable(test_1 test.cpp)
target_compile_definitions(test_1 PUBLIC UNIT_TESTS)
target_link_libraries(test_1 class1)
install(TARGETS test_1
COMPONENT bin
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
I am building the project as follows:
$ mkdir build && cd build
$ cmake -DCMAKE_BUILD_TESTS=ON ..
$ make && make install
Question:
Whilst building the project, it builds the tests as: OFFtest_1 and OFFtest_2. How to get rid if the 'OFF' prefix? Where is it coming from?
I`m trying to create a CMake setup for a project with the following structure:
workshop
| CMakeLists.txt
| utilities
| | utilities.h
| | utilities.cpp
| | CMakeLists.txt
| week_1
| | week_1.h
| | week_1.cpp
| | main.cpp
| | CMakeLists.txt
| week_2
| | main.h
| | week_2.cpp
| | main.cpp
| | CMakeLists.txt
Everything depends on OpenCV and the programs in week_X depend also on utilities.
I was able to do everything except the connection with utilities.
My trial:
File workshop\CMakeLists.txt
cmake_minimum_required(VERSION 2.8.12)
PROJECT(workshop)
SET(OpenCV_DIR OPENCV_DIR)
find_package( OpenCV REQUIRED )
include_directories( ${OpenCV_INCLUDE_DIRS})
add_subdirectory(${CMAKE_SOURCE_DIR}/utilities)
add_subdirectory(${CMAKE_SOURCE_DIR}/week_1)
add_subdirectory(${CMAKE_SOURCE_DIR}/week_2)
File week_1\CMakeLists.txt (week_2\CMakeLists.txt is identical just changing 1 by 2)
cmake_minimum_required(VERSION 2.8.12)
include_directories( ${OpenCV_INCLUDE_DIRS})
set(SRCFILES week_1.cpp week_1.h main.cpp)
source_group(week_1 FILES ${SRCFILES})
add_executable(week_1 ${SRCFILES})
target_link_libraries(week_1 ${OpenCV_LIBS})
All is okay until the utilities. How would be the utilities\CMakeLists.txt?
I think you want utilities to be a library.
In the utilities CMakeLists.txt
# This will create libutilities.a
add_library(utilities
utilities.cpp
)
target_include_directories( utilities PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}
# Third party libs
${OpenCV_INCLUDE_DIRS}
)
target_link_libraries(utilities
${OpenCV_LIBRARIES}
)
In week_X you'll use it as a library like so:
include_directories(
${OpenCV_INCLUDE_DIRS}
${CMAKE_SOURCE_DIR}/utilities # Include utilities header
)
set(SRCFILES week_1.cpp week_1.h main.cpp)
source_group(week_1 FILES ${SRCFILES})
add_executable(week_1 ${SRCFILES})
target_link_libraries(
${OpenCV_LIBS}
utilities # Link to libutilites.a
)
I am writing a Game Engine, which is going very well. But I am running into a problem where my CMakeLists.txt is just too messy, and I don't know enough about CMake. My project uses multiple (CMake) libraries, which are added using add_subdirectory and then target_link_libraries. My project consists of the Engine(executable), the Editor(library), and some tests/examples. Here is my file structure:
C:.
| CMakeLists.txt
| tree.txt
|
+---Editor
| | README.md
| |
| \---src
| main.cpp
|
+---Engine
| | README.md
| |
| +---src
| | | main.cpp
| | |
| | +---API
| | | Core.h
| | |
| | +---App
| | | Application.cpp
| | |
| | +---ExtApp
| | | | AppInterface.cpp
| | | |
| | | +---Engine
| | | | ExtAppLoader.cpp
| | | |
| | | \---Game
| | | InfoExport.cpp
| | |
| | +---Framework
| | | Asset.cpp
| | |
| | +---Managing
| | | AssetLoader.cpp
| | |
| | +---Rendering
| | | | Renderer.cpp
| | | |
| | | \---Renderables
| | | Canvas2DRenderable.cpp
| | |
| | \---Types
| | Vector3f.cpp
| |
| \---TestResources
| \---Shaders
| Canvas2DTexturedTriangle.f
| Canvas2DTexturedTriangle.v
| Canvas2DUntexturedTriangle.f
| Canvas2DUntexturedTriangle.v
| ImTest.f
| ImTest.v
|
+---Libraries
| +---glfw
| | CMakeLists.txt
| |
| \---glm
| CMakeLists.txt
|
\---Tests
\---TestGame
\---src
main.cpp
As you can see I have one CMakeLists at the begin, which loads all the projects. Then I have libraries, which have a CMakeLists too. Every directory has only one file to make the tree less big, but there are multiple fies in a directory. Also, here is my current, messy, almost-useless CMakeLists file:
cmake_minimum_required(VERSION 3.6)
#project(3DEngine)
add_subdirectory(Libraries/glfw) #Add glfw to the project
# Make sure we're running C++17 so all features(like std::filesystem) are present.
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
option(BUILD_ENGINE_FOR_EDITOR "Build the engine as DLL/SO for the editor and add editor specific things. Otherwise build engine as game exec" OFF)
option(BUILD_ENGINE_FOR_DLL_APPS "Have the Engine load the game(and plugins) from dll's." ON)
project (Engine)#project engine
include_directories(Libraries/whereami/src)
include_directories(Engine/src/)
include_directories(Libraries/glfw/include)
include_directories(Libraries/glm)
include_directories(Libraries/glad/include)
include_directories(Libraries/stb)
file(GLOB EngineRootSOURCES "Engine/src/*.cpp" "Engine/src/*.h")
file(GLOB EngineRenderingSOURCES "Engine/src/Rendering/*.cpp" "Engine/src/Rendering/*.h")
file(GLOB EngineAppSOURCES "Engine/src/App/*.cpp" "Engine/src/App/*.h")
file(GLOB EngineRenderingRenderablesSOURCES "Engine/src/Rendering/Renderables/*.cpp" "Engine/src/Rendering/Renderables/*.h")
file(GLOB EngineManagingSOURCES "Engine/src/Managing/*.cpp" "Engine/src/Managing/*.h")
file(GLOB EngineTypesSOURCES "Engine/src/Types/*.cpp" "Engine/src/Types/*.h")
file(GLOB EngineGameEssentialsSOURCES "Engine/src/GameEssentials/*.cpp" "Engine/src/GameEssentials/*.h")
file(GLOB EngineLibsSOURCES "Libraries/whereami/src/whereami.c" "Libraries/glad/src/glad.c")
file(GLOB EngineFrameworkSOURCES "Engine/src/Framework/*.h" "Engine/src/Framework/*.cpp")
file(GLOB APISOURCES "Engine/src/API/*.cpp" "Engine/src/API/*.h")
file(GLOB EngineExtAppSOURCES "Engine/src/ExtApp/*.cpp" "Engine/src/ExtApp/*.h"
"Engine/src/ExtApp/Interface/*.cpp" "Engine/src/ExtApp/Interface/*.h")
file(GLOB EngineExtAppGameSOURCES "Engine/src/ExtApp/Game/*.cpp" "Engine/src/ExtApp/Game/*.h")
source_group("ExtApp" FILES ${EngineExtAppGameSOURCES})
file(GLOB EngineExtAppEngineSOURCES "Engine/src/ExtApp/Engine/*.cpp" "Engine/src/ExtApp/Engine/*.h")
source_group("ExtApp" FILES ${EngineExtAppEngineSOURCES})
if(BUILD_ENGINE_FOR_EDITOR)
file(GLOB EngineEditorSOURCES "Engine/src/ExtApp/*.cpp" "Engine/src/ExtApp/*.h"
"Engine/src/ExtApp/Interface/*.cpp" "Engine/src/ExtApp/Interface/*.h")
if(BUILD_ENGINE_FOR_DLL_APPS)
add_library(Engine SHARED ${EngineRootSOURCES} ${EngineRenderingSOURCES} ${EngineTypesSOURCES} ${EngineRenderingRenderablesSOURCES} ${EngineManagingSOURCES} ${EngineGameEssentialsSOURCES} ${EngineLibsSOURCES} ${EngineEditorSOURCES} ${EngineExtAppSOURCES} ${EngineAppSOURCES} ${APISOURCES} ${EngineExtAppEngineSOURCES} ${EngineFrameworkSOURCES})
source_group("ExtApp" FILES ${EngineExtAppSOURCES})
elseif(NOT BUILD_ENGINE_FOR_DLL_APPS)
add_library(Engine SHARED ${EngineRootSOURCES} ${EngineRenderingSOURCES} ${EngineTypesSOURCES} ${EngineRenderingRenderablesSOURCES} ${EngineManagingSOURCES} ${EngineGameEssentialsSOURCES} ${EngineLibsSOURCES} ${EngineEditorSOURCES} ${EngineExtAppSOURCES} ${EngineAppSOURCES} ${APISOURCES} ${EngineExtAppEngineSOURCES} ${EngineFrameworkSOURCES})
endif()
target_link_libraries(Engine glfw)
source_group("Rendering" FILES ${EngineRenderingSOURCES})
source_group("Rendering/Renderables" FILES ${EngineRenderingRenderablesSOURCES})
source_group("Managing" FILES ${EngineManagingSOURCES})
source_group("App" FILES ${EngineAppSOURCES})
source_group("Types" FILES ${EngineTypesSOURCES})
source_group("GameEssentials" FILES ${EngineGameEssentialsSOURCES})
source_group("Libs" FILES ${EngineLibsSOURCES})
source_group("ExtApp" FILES ${EngineEditorSOURCES})
source_group("API" FILES ${APISOURCES})
source_group("Framework" FILES ${EngineFrameworkSOURCES})
elseif(NOT BUILD_ENGINE_FOR_EDITOR)
if(BUILD_ENGINE_FOR_DLL_APPS)
file(GLOB EngineExtAppSOURCES "Engine/src/ExtApp/*.cpp" "Engine/src/ExtApp/*.h"
"Engine/src/ExtApp/Interface/*.cpp" "Engine/src/ExtApp/Interface/*.h")
add_executable(Engine ${EngineRootSOURCES} ${EngineRenderingSOURCES} ${EngineTypesSOURCES} ${EngineRenderingRenderablesSOURCES} ${EngineManagingSOURCES} ${EngineGameEssentialsSOURCES} ${EngineLibsSOURCES} ${EngineExtAppSOURCES} ${EngineAppSOURCES} ${APISOURCES} ${EngineExtAppEngineSOURCES} ${EngineFrameworkSOURCES})
source_group("ExtApp" FILES ${EngineExtAppSOURCES})
elseif(NOT BUILD_ENGINE_FOR_DLL_APPS)
add_executable(Engine ${EngineRootSOURCES} ${EngineRenderingSOURCES} ${EngineTypesSOURCES} ${EngineRenderingRenderablesSOURCES} ${EngineManagingSOURCES} ${EngineGameEssentialsSOURCES} ${EngineLibsSOURCES} ${EngineExtAppSOURCES} ${EngineAppSOURCES} ${APISOURCES} ${EngineExtAppEngineSOURCES} ${EngineFrameworkSOURCES})
endif()
target_link_libraries(Engine glfw)
source_group("Rendering" FILES ${EngineRenderingSOURCES})
source_group("Rendering/Renderables" FILES ${EngineRenderingRenderablesSOURCES})
source_group("Managing" FILES ${EngineManagingSOURCES})
source_group("App" FILES ${EngineAppSOURCES})
source_group("Types" FILES ${EngineTypesSOURCES})
source_group("GameEssentials" FILES ${EngineGameEssentialsSOURCES})
source_group("Libs" FILES ${EngineLibsSOURCES})
source_group("API" FILES ${APISOURCES})
source_group("Framework" FILES ${EngineFrameworkSOURCES})
endif()
#add_library(Engine SHARED ${EngineSOURCES})
## END project engine
project (Module_OpenGL_Renderer_Input)#project module_renderer_opengl3
include_directories(Libraries/glfw/include)
include_directories(Libraries/glm)
include_directories(Libraries/glad/include)
include_directories(Libraries/stb)
file(GLOB Module_OpenGL_Renderer_InputSOURCES "Modules/Module_OpenGL_Renderer_Input/src/*.cpp" "Modules/Module_OpenGL_Renderer_Input/src/*.h" "Libraries/glad/src/glad.c")
add_library(Module_OpenGL_Renderer_Input SHARED ${Module_OpenGL_Renderer_InputSOURCES})
target_link_libraries(glfw)
##END project module_renderer_opengl3
project (Test1)#project test | This project is used to test the engine functionality.
include_directories(Libraries/imgui)
file(GLOB Test1SOURCES "Tests/Test1/src/*.cpp" "Tests/Test1/src/*.h" "Libraries/imgui/imgui*.cpp" ${APISOURCES})
add_executable(Test1 ${Test1SOURCES})
target_link_libraries(Test1 ${CMAKE_DL_LIBS})
project (TestGame)#project test | This project is used to test the engine functionality.
include_directories(Libraries/imgui)
file(GLOB TestGameSOURCES "Tests/TestGame/src/*.cpp" "Tests/TestGame/src/*.h" "Libraries/imgui/imgui*.cpp" ${EngineRenderingSOURCES} ${EngineTypesSOURCES} ${EngineRenderingRenderablesSOURCES} ${EngineManagingSOURCES} ${EngineGameEssentialsSOURCES} ${EngineLibsSOURCES} ${EngineAppSOURCES} ${APISOURCES} ${EngineExtAppSOURCES} ${EngineExtAppGameSOURCES} ${EngineFrameworkSOURCES})
add_library(TestGame SHARED ${TestGameSOURCES})
target_link_libraries(TestGame glfw)
project (Editor)#project editor | This is used to make projects and build projects(using the engine)
include_directories(Libraries/imgui)
file(GLOB EditorSOURCES "Editor/src/*.cpp" "Editor/src/*.h" "Libraries/imgui/imgui*.cpp" ${APISOURCES})
add_executable(Editor ${EditorSOURCES})
I contains lot's of things that are completely useless, or not needed anymore.
So here are my questions:
Does every directory NEED a CMakeLists file, like I see in a lot of projects?
Do I need to provide every directory containing source files, or can I have it search automatically for source and header files in directories?
I also see that a lot of other CMake projects provide each source/header file seperately, why? Isn't that a lot of work every time you add a file?
Does anyone have examples of large CMake projects that I can use as a guide?
Is there ANYTHING else I can improve?
Thanks!
Does every directory NEED a CMakeLists file
No, that is not necessary.
It's probably a good idea to have a CMakeLists.txt for each submodule and library - and one in the root for the project itself.
Do I need to provide every directory containing source files, or can I have it search automatically for source and header files in directories?
Firstly, see the answer to your question 3.
Secondly, I don't see why you'd want to search for header files. Simply specify the include directories.
Finally, if you want to use globbing, it is possible to put all your source files under a single directory, and use a single glob.
I also see that a lot of other CMake projects provide each source ... file seperately, why?
This is what the docs say:
Note
We do not recommend using GLOB to collect a list of source files from your source tree. If no CMakeLists.txt file changes when a source is added or removed then the generated build system cannot know when to ask CMake to regenerate. The CONFIGURE_DEPENDS flag may not work reliably on all generators, or if a new generator is added in the future that cannot support it, projects using it will be stuck. Even if CONFIGURE_DEPENDS works reliably, there is still a cost to perform the check on every rebuild.
... each header file separately, why?
I've never seen this.
Is there ANYTHING else I can improve?
Use target_include_directories instead of include_directories. In general, always use target_X directives.
This is the directory structure of my project:
|-- CMakeLists.txt
|-- libdashframework
| |-- Buffer
| | |-- IMediaObjectBufferObserver.h
| | |-- MediaObjectBuffer.cpp
| | `-- MediaObjectBuffer.h
| |-- Input
| | |-- DASHReceiver.cpp
| | |-- DASHReceiver.h
| | |-- IDASHReceiverObserver.h
| | `-- MediaObject.h
| |-- MPD
| | |-- AbstractRepresentationStream.cpp
| | |-- AbstractRepresentationStream.h
| | |-- AdaptationSetStream.cpp
| | |-- AdaptationSetStream.h
| | |-- BaseUrlResolver.cpp
| | |-- BaseUrlResolver.h
| | |-- IRepresentationStream.h
| | |-- RepresentationStreamFactory.cpp
| | |-- RepresentationStreamFactory.h
| | |-- SegmentListStream.cpp
| | |-- SegmentListStream.h
| | |-- SegmentTemplateStream.cpp
| | |-- SegmentTemplateStream.h
| | |-- SingleMediaSegmentStream.cpp
| | |-- SingleMediaSegmentStream.h
| | |-- TimeResolver.cpp
| | `-- TimeResolver.h
| `-- Portable
| |-- MultiThreading.cpp
| `-- MultiThreading.h
|-- libdash_test_automoc.cpp
|-- libdash_test.cpp
`-- Makefile
I am having a linking error in the project and can't figure out how to remove it.
CMakeLists.txt:
cmake_minimum_required(VERSION 2.8)
file(GLOB test_source RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
libdashframework/MPD/*.cpp
libdashframework/Buffer/*.cpp
libdashframework/Input/*.cpp
libdashframework/Portable/*.cpp
libdash_test.cpp )
add_executable(libdash_test ${test_source})
target_link_libraries(libdash_test dash -lpthread)
Error:
Linking CXX executable libdash_test
CMakeFiles/libdash_test.dir/libdashframework/Buffer/MediaObjectBuffer.cpp.o: In function `libdash::framework::buffer::MediaObjectBuffer::SetEOS(bool)':
MediaObjectBuffer.cpp:(.text+0x55d): undefined reference to `libdash::framework::input::MediaObject::AbortDownload()'
CMakeFiles/libdash_test.dir/libdashframework/Input/DASHReceiver.cpp.o: In function `libdash::framework::input::DASHReceiver::GetNextSegment()':
DASHReceiver.cpp:(.text+0x48e): undefined reference to `libdash::framework::input::MediaObject::MediaObject(dash::mpd::ISegment*, dash::mpd::IRepresentation*)'
CMakeFiles/libdash_test.dir/libdashframework/Input/DASHReceiver.cpp.o: In function `libdash::framework::input::DASHReceiver::GetSegment(unsigned int)':
DASHReceiver.cpp:(.text+0x57f): undefined reference to `libdash::framework::input::MediaObject::MediaObject(dash::mpd::ISegment*, dash::mpd::IRepresentation*)'
CMakeFiles/libdash_test.dir/libdashframework/Input/DASHReceiver.cpp.o: In function `libdash::framework::input::DASHReceiver::GetInitSegment()':
DASHReceiver.cpp:(.text+0x615): undefined reference to `libdash::framework::input::MediaObject::MediaObject(dash::mpd::ISegment*, dash::mpd::IRepresentation*)'
CMakeFiles/libdash_test.dir/libdashframework/Input/DASHReceiver.cpp.o: In function `libdash::framework::input::DASHReceiver::DownloadInitSegment(dash::mpd::IRepresentation*)':
DASHReceiver.cpp:(.text+0x9b0): undefined reference to `libdash::framework::input::MediaObject::StartDownload()'
CMakeFiles/libdash_test.dir/libdashframework/Input/DASHReceiver.cpp.o: In function `libdash::framework::input::DASHReceiver::DoBuffering(void*)':
DASHReceiver.cpp:(.text+0xa84): undefined reference to `libdash::framework::input::MediaObject::StartDownload()'
DASHReceiver.cpp:(.text+0xab5): undefined reference to `libdash::framework::input::MediaObject::WaitFinished()'
collect2: error: ld returned 1 exit status
make[2]: *** [libdash_test] Error 1
make[1]: *** [CMakeFiles/libdash_test.dir/all] Error 2
make: *** [all] Error 2
How can I remove this linking error?
After reading other similar questions, I have tried and changed the order of files in file() function. The order is similar to a working sample project so I think thats not the problem.
EDIT:
Although I had already linked the so file of libdash by putting it in the /usr/bin and /usr/lib/ dir. But I also updated the cmake too. It still didn't help.
updated CMakeLists.txt:
cmake_minimum_required(VERSION 2.8)
project(libdash_test)
set(CMAKE_VERBOSE_MAKEFILE ON)
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_MODULE_PATH})
set(CMAKE_CXX_FLAGS "-D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS")
# Find includes in corresponding build directories
set(CMAKE_INCLUDE_CURRENT_DIR ON)
# Instruct CMake to run moc automatically when needed.
set(CMAKE_AUTOMOC ON)
#libdash has to be manually installed
set (DASH_INCLUDE_DIR /usr/include/libdash)
find_package(DASH REQUIRED)
link_directories(${DASH_LIBRARIES})
#set(LIBDASH_LIBRARIES "../build/bin" CACHE PATH "Path to libdash.so")
#set(LIBDASH_INCLUDES "../libdash/include/" CACHE PATH "Path to libdash includes")
file(GLOB test_source RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
libdashframework/MPD/*.cpp
libdashframework/Buffer/*.cpp
libdashframework/Input/*.cpp
libdashframework/Portable/*.cpp
libdash_test.cpp )
add_executable(libdash_test ${test_source})
target_link_libraries(libdash_test DASH -ldash ${DASH_LIBRARIES} -lpthread)
Error in the current CMakeLists.txt (the one under EDIT):
CMake Error at CMakeLists.txt:20 (find_package):
By not providing "FindDASH.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "DASH", but
CMake did not find one.
Could not find a package configuration file provided by "DASH" with any of
the following names:
DASHConfig.cmake
dash-config.cmake
Add the installation prefix of "DASH" to CMAKE_PREFIX_PATH or set
"DASH_DIR" to a directory containing one of the above files. If "DASH"
provides a separate development package or SDK, be sure it has been
installed.
-- Configuring incomplete, errors occurred!