I am currently trying to set up the opendnp3 C++ library as a static library. I've built the solution following their build guide for Windows and have been able to generate several .lib files which I assume to be the static libraries.
In a completely separate folder, I have the following files under the following folder structure:
C:/Development/C++/opendnp3/lib/ # .lib files are contained in this directory
C:/Development/pybexample/
--> CMakeLists.txt
--> src/
--> test.cpp
I have the CMakeLists.txt configured as follows:
cmake_minimum_required(VERSION 2.8)
project(pybexample)
set(SOURCE_FILES src/test.cpp)
add_library(opendnp3 STATIC IMPORTED)
set_target_properties(opendnp3 PROPERTIES IMPORTED_LOCATION C:/Development/C++/opendnp3/lib/opendnp3.lib)
add_executable(pybexample ${SOURCE_FILES})
target_link_libraries(pybexample opendnp3)
Within test.cpp, I am simply calling:
#include <iostream>
#include "opendnp3/LogLevels.h"
using namespace std;
int main(void) {
cout << "Hello world!" << endl;
system("pause");
}
However, when I try to build test.cpp, I receive an error indicating: "Cannot open include file: 'opendnp3/LogLevels.h': No such file or directory". I feel like there must be something pretty basic that I've missed but I'm pretty new to using static libraries and with CMake so I can't seem to figure it out. Would anyone be able to help give some pointers as to why my include is failing?