I am trying to use mFast for FastFix protocol on my windows machine but not able to install using cmake-gui.exe I am using Visual studio 2010 on Windows Server 2003.
cmake-gui tool.exe image with configurations
CMAKE-LISTS.txt
file (GLOB headers "*.h") ## retrieve all header files in current directory
file (GLOB sources "*.cpp") ## retrieve all source files in current directory I had added Executable path and Library path.
file (GLOB instruction_headers "instructions/*.h") ## retrieve all header files in instructions directory
file (GLOB instruction_sources "instructions/*.cpp") ## retrieve all source files in instructions directory
SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib)
set(mfast_SRCS ${sources} ${instruction_sources} ${headers} ${instruction_headers})
add_library(mfast_static STATIC ${mfast_SRCS})
target_include_directories(mfast_static PUBLIC $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/src>)
if (UNIX)
set_target_properties(mfast_static PROPERTIES OUTPUT_NAME mfast)
endif()
set_target_properties(mfast_static PROPERTIES COMPILE_FLAGS -DMFAST_STATIC_DEFINE)
install(TARGETS mfast_static
EXPORT mFASTTargets
RUNTIME DESTINATION "${INSTALL_BIN_DIR}" COMPONENT bin
ARCHIVE DESTINATION "${INSTALL_LIB_DIR}" COMPONENT lib)
set(MFAST_STATIC_LIBRARIES ${MFAST_STATIC_LIBRARIES} mfast_static CACHE INTERNAL "")
if (BUILD_SHARED_LIBS)
add_library(mfast SHARED ${mfast_SRCS})
if (NOT "${CMAKE_VERSION}" VERSION_LESS "2.8.12")
target_compile_definitions(mfast INTERFACE "-DMFAST_DYN_LINK")
endif (NOT "${CMAKE_VERSION}" VERSION_LESS "2.8.12")
if (CMAKE_COMPILER_IS_GNUCXX OR ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang"))
set_target_properties(mfast PROPERTIES COMPILE_FLAGS -fvisibility=hidden)
endif()
set_target_properties(mfast PROPERTIES
VERSION "${MFAST_VERSION}"
SOVERSION "${MFAST_SOVERSION}")
install(TARGETS mfast
EXPORT mFASTTargets
RUNTIME DESTINATION "${INSTALL_BIN_DIR}" COMPONENT bin
LIBRARY DESTINATION "${INSTALL_LIB_DIR}" COMPONENT lib)
set(MFAST_SHARED_LIBRARIES ${MFAST_SHARED_LIBRARIES} mfast CACHE INTERNAL "")
endif (BUILD_SHARED_LIBS)
add_subdirectory (coder)
add_subdirectory (xml_parser)
add_subdirectory (json)
if (BUILD_SQLITE3)
add_subdirectory (sqlite3)
endif(BUILD_SQLITE3)
install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
DESTINATION "${INSTALL_INCLUDE_DIR}"
FILES_MATCHING PATTERN "*.h")
Error Log file
CMake Error at mfast/CMakeLists.txt:20 (install):
install TARGETS given no ARCHIVE DESTINATION for static library target
"mfast_static".
CMake Error at mfast/coder/CMakeLists.txt:28 (install):
install TARGETS given no ARCHIVE DESTINATION for static library target
"mfast_coder_static".
CMake Error at mfast/xml_parser/CMakeLists.txt:22 (install):
install TARGETS given no ARCHIVE DESTINATION for static library target
"mfast_xml_parser_static".
CMake Error at mfast/json/CMakeLists.txt:19 (install):
install TARGETS given no ARCHIVE DESTINATION for static library target
"mfast_json_static".
CMake Error at fast_type_gen/CMakeLists.txt:18 (install):
install TARGETS given no RUNTIME DESTINATION for executable target
"fast_type_gen".
CMake Warning (dev) at CMakeLists.txt:5 (set):
Cannot set "FAST_TYPE_GEN_INSTALL_LOCATION": current scope has no parent.
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Error at CMakeLists.txt:7 (install):
install FILES given no DESTINATION!
CMake Warning (dev) in CMakeLists.txt:
No cmake_minimum_required command is present. A line of code such as
cmake_minimum_required(VERSION 3.12)
should be added at the top of the file. The version specified may be lower
if you wish to support older CMake versions for this project. For more
information run "cmake --help-policy CMP0000".
This warning is for project developers. Use -Wno-dev to suppress it.
Configuring incomplete, errors occurred!
See also "D:/Mihir/mFastVisualStudioProject/CMakeFiles/CMakeOutput.log".
what I have tried:
Added Executable Path and Library
Installed Boost-library 1.63 and added in Path,But found no luck whatsoever as you can see i am getting static library file error. Thanking in Advance
Related
Question
Why .dlls are not copied to the build/Release/ directory as .exe is built?
Description
I create a new CMake file with this simple setup:
cmake_minimum_required(VERSION 3.21)
project(use_sort)
find_package(sortdemo REQUIRED)
add_executable(example main.cpp)
target_link_libraries(example PRIVATE sortdemo::my_sort_lib sortdemo::my_print_lib)
The project gets configured and installed as x64 Release linked to SHARED libs.
But in Release folder I can only see the .exe, without .dlls.
The libraries my_sort_lib and my_print_lib are my libraries that were installed before in C:\Program Files:
I do not know if it is necessary, but I also add a link to the CMakeLists of these libraries: https://github.com/petrasvestartas/CMAKE/tree/main/install_export
The full project is here:
https://github.com/petrasvestartas/CMAKE/tree/main/find_package
What I tried:
This does not copy any dlls
include(GNUInstallDirs )
install(
TARGETS "example"
RUNTIME_DEPENDENCIES
)
This gives me error
include(GNUInstallDirs )
install(
TARGETS "example"
RUNTIME_DEPENDENCIES "sortdemo::my_sort_lib"
)
Error:
CMake Error at CMakeLists.txt:28 (install):
install TARGETS given unknown argument "sortdemo::my_sort_lib".
This gives me error too and not understandable (use this answer from another stackoverflow post)
MACRO(INSTALL_ADD_IMPORTED_DLLS target_list target_component destination_folder)
foreach(one_trg ${target_list})
get_target_property(one_trg_type ${one_trg} TYPE)
if (NOT one_trg_type STREQUAL "INTERFACE_LIBRARY")
get_target_property(one_trg_dll_location ${one_trg} IMPORTED_LOCATION_RELEASE)
if( one_trg_dll_location MATCHES ".dll$")
install(FILES ${one_trg_dll_location} DESTINATION ${destination_folder} CONFIGURATIONS Release COMPONENT ${target_component})
endif()
get_target_property(one_trg_dll_location ${one_trg} IMPORTED_LOCATION_DEBUG)
if( one_trg_dll_location MATCHES ".dll$")
install(FILES ${one_trg_dll_location} DESTINATION ${destination_folder} CONFIGURATIONS Debug COMPONENT ${target_component})
endif()
endif()
endforeach()
ENDMACRO()
set(THIRDPARTY_TARGETS "sortdemo::my_sort_lib" "sortdemo::my_print_lib")
if(MSVC)
INSTALL_ADD_IMPORTED_DLLS("${THIRDPARTY_TARGETS}" bin bin)
endif()
Error
Make Error at CMakeLists.txt:28 (get_target_property):
get_target_property() called with non-existent target "my_sort_lib".
Call Stack (most recent call first):
CMakeLists.txt:44 (INSTALL_ADD_IMPORTED_DLLS)
How can I link OpenNI (libOpenNI2.so) at run time to my C++ program? This question/answer is most relevant to my question. I followed it and prepared the following CMakeLists.txt but still it cannot link the .so file and generates an error /usr/bin/ld: cannot find -lOpenNI2
I use cmake .. && cmake --build . --config Release to compile the program.
I tried $ORIGIN, $$ORIGIN, \$ORIGIN and I noticed that ORIGIN is empty string.
What am I doing wrong?
cmake_minimum_required(VERSION 3.1)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED TRUE)
project(rgbd)# project name
# to link OpenNI2 at runtime
SET(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH FALSE)
SET(CMAKE_INSTALL_RPATH "")
add_executable(rgbd rgbd.cpp)
message(STATUS ${ORIGIN})# display ORIGIN
set_target_properties(rgbd PROPERTIES LINK_FLAGS "-Wl,-rpath,$ORIGIN/../OpenNI-Linux-x64-2.3.0.66/Redist")
target_link_libraries(rgbd libOpenNI2.so)
The error you get isn't at runtime but at link time. ld cannot find the specified libOpenNI2.so because you haven't provided any search path to the linker.
You shouldn't have to do anything special as CMake will use build rpath by default (that gets removed during installation, but this is not a step that you've configured anyway).
This should be enough:
cmake_minimum_required(VERSION 3.13)
project(rgbd)
add_executable(${PROJECT_NAME} rgbd.cpp)
target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11)
target_link_directories(${PROJECT_NAME} PRIVATE ../OpenNI-Linux-x64-2.3.0.66/Redist)
target_link_libraries(${PROJECT_NAME} PRIVATE OpenNI2)
cd path/to/project
cmake -B build/Release -DCMAKE_BUILD_TYPE=Release
cmake --build build/Release
./build/Release/rgbd
Now if you're going to ship your executable, consider adding a correct installation step with install rpath handled:
cmake_policy(SET CMP0095 OLD) //CMake>=3.16 handles $ORIGIN escaping differently
set_target_properties(${PROJECT_NAME}
PROPERTIES
INSTALL_RPATH "\\\$ORIGIN/../lib"
)
include(GNUInstallDirs)
install(TARGETS ${PROJECT_NAME})
install(FILES ../OpenNI-Linux-x64-2.3.0.66/Redist/libOpenNI2.so TYPE LIB)
cmake -B build/Release -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$PWD/package
cmake --build build/Release --target install
./package/bin/rgbd
The rpath is information that's only used at runtime to find the lib. The linker will not use it to determine the location of the location of libraries to link.
With cmake you could specify an absolute path for target_link_libraries here or add a link directory and let the linker figure out which file to use.
Path to lib
# not sure if this is the exact path; you may need to do some adjustments
target_link_libraries(rgbd "${CMAKE_CURRENT_SOURCE_DIR}/../OpenNI-Linux-x64-2.3.0.66/Redist/libOpenNI2.so")
Link directory
# again not sure, if the path is correct here
target_link_directories(rgdb PRIVATE ../OpenNI-Linux-x64-2.3.0.66/Redist)
target_link_libraries(rgbd PRIVATE OpenNI2)
If you're linking the lib to multiple targets, using an imported library may be a good idea, since it allows you to add info like include directories and additional dependencies to the lib.
add_library(OpenNI2_import SHARED IMPORTED GLOBAL)
set_target_properties(OpenNI2_import PROPERTIES
IMPORTED_LOCATION "${CMAKE_CURRENT_SOURCE_DIR}/../OpenNI-Linux-x64-2.3.0.66/Redist/libOpenNI2.so"
)
# include directories could be added
target_include_directories(OpenNI2_import INTERFACE
"${CMAKE_CURRENT_SOURCE_DIR}/../OpenNI-Linux-x64-2.3.0.66/include" # probably not the correct path; use absolute paths here
)
# could add dependencies, if necessary
target_link_libraries(OpenNI2_import INTERFACE some_other_lib)
...
target_link_libraries(rgbd PRIVATE OpenNI2_import)
You may still need to adjust the rpath, but using \$ORIGIN/... should work to get "cmake" to put $ORIGIN/... in the rpath of the resulting binary.
I am currently migrating a couple of CodeBlock projects to use CMake and Visual Studio Code. I am facing an issue related to the include directory not being known by the consuming target.
I followed a guide so far as I was not aware of the "modern CMake way" using targets at all until yet. Mainly referring to here: https://rix0r.nl/blog/2015/08/13/cmake-guide/ and the official CMake docs.
There are two libraries (.so). One of them needs to other one to be there (build) when it get's loaded by the application later on.
I am not sure if everything is even intended to work like I assume it to work so I will just continue with the code and the expected result.
Library A (which is needed by Library B) has following CMakeLists
cmake_minimum_required(VERSION 3.0.0)
project(A)
set(SOURCE somesource.c)
include(GNUInstallDirs)
find_package(JNI REQUIRED)
add_library(JNI SHARED IMPORTED)
set_property(TARGET JNI PROPERTY INTERFACE_INCLUDE_DIRECTORIES $ENV{JAVA_HOME}/include $ENV{JAVA_HOME}/include/linux)
set_property(TARGET JNI PROPERTY IMPORTED_LOCATION ${JNI_LIBRARIES})
add_library(${PROJECT_NAME} SHARED ${SOURCE})
target_include_directories(${PROJECT_NAME}
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include $ENV{JAVA_HOME}/include $ENV{JAVA_HOME}/include/linux>
$<INSTALL_INTERFACE:include>
)
install(DIRECTORY include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
install(TARGETS ${PROJECT_NAME} EXPORT ${PROJECT_NAME}Config
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
install(EXPORT ${PROJECT_NAME}Config DESTINATION ${CMAKE_INSTALL_PREFIX}/cmake)
Notice I only have one include file which is public and located in "include", so its used by the library itself but should also be part of the install interface
used by the "consuming" target.
Library B (which uses Library A and its header)
cmake_minimum_required(VERSION 3.0)
project(B)
set(SOURCE somesource.c)
add_library(${PROJECT_NAME} SHARED ${SOURCE})
find_package(A REQUIRED)
target_include_directories(${PROJECT_NAME}
PRIVATE ${PROJECT_SOURCE_DIR}
)
So in Library B I assume that I do not need to add the include_directories from Library A again. This is why I actually did the target approach so there is no need to keep track of linker/include dependencies. "find_package" should handle these on it's own right? I do not link neither because it is a shared object, not a static library.
Both libraries use the same CMAKE_INSTALL_PREFIX ofc and library A has been installed (make install). I double-checked on this. In case of using a different prefix or not doing the install, CMake already complains about not finding it.
So considering the issue now:
Within a source file from library B, I am using
#include <libcobjava.h>
resulting in an error when building as the compiler complains about "No such file or directory" Am I missing something? The file is definitely located at
CMAKE_INSTALL_PREFIX/include.
Apart from that as I am still new to CMake: Is this even the way you would do things if you own all the source?
Edit: Some more details on the follow-up issue as discussed in comments. Library A is libcobjava.
First I had the target_include_directories part as following (including the path where jni.h is located in $<INSTALL_INTERFACE:)
target_include_directories(${PROJECT_NAME}
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include $ENV{JAVA_HOME}/include $ENV{JAVA_HOME}/include/linux>
$<INSTALL_INTERFACE:include $ENV{JAVA_HOME}/include $ENV{JAVA_HOME}/include/linux>
)
results in following error:
[cmake] Configuring done
[cmake] CMake Error in CMakeLists.txt:
[cmake] Target "libcobjava" INTERFACE_INCLUDE_DIRECTORIES property contains path:
[cmake]
[cmake] "/media/rbs42/data/Gebos/RBS42/tools/libcobjava/${_IMPORT_PREFIX}/include"
[cmake]
[cmake] which is prefixed in the source directory.
[cmake]
[cmake]
[cmake] Generating done
[cms-driver] Error during CMake configure: [cmake-server] Failed to compute build system.
This is why I removed $ENV{JAVA_HOME}/include $ENV{JAVA_HOME}/include/linux> from $<INSTALL_INTERFACE again.
The actual error I am getting in library B now is during compiling:
[build] /media/rbs42/data/rbs42/usr/include/libcobjava.h:1:10: fatal error: jni.h: No such file or directory
[build] #include <jni.h>
because library B does not have the include directories from library A that are not included in the $<INSTALL_INTERFACE. This is what one would expect. And thats the reason I added the following code before in library A.
set_property(TARGET JNI PROPERTY INTERFACE_INCLUDE_DIRECTORIES $ENV{JAVA_HOME}/include $ENV{JAVA_HOME}/include/linux)
which I assumed is taking care of propagating the include dependencies from library A to the "consuming" library B, although they are not part of the $<INSTALL_INTERFACE.
Im trying to build a vala-application together with an own library in the same project using CMake. Building the application works fine, so I've added a new "lib" directory to my project with the following CMakeLists.txt:
# Configure precompile
vala_precompile (LIB_VALA_C ${LIB_NAME}
Session.vala
PACKAGES
gio-2.0
gee-0.8
OPTIONS
--thread
--vapidir=${CMAKE_SOURCE_DIR}/vapi
--target-glib 2.32
GENERATE_VAPI
${LIB_NAME}
GENERATE_HEADER
${CMAKE_PROJECT_NAME}
)
# Add executable
add_library (${LIB_NAME} SHARED ${LIB_VALA_C})
# Set library properties
set_target_properties (${LIB_NAME} PROPERTIES
OUTPUT_NAME ${LIB_NAME}
VERSION ${LIB_SOVERSION}.${LIB_VERSION}
SOVERSION ${LIB_SOVERSION}
)
target_link_libraries (${LIB_NAME} ${LIB_LIBRARIES})
# Installation
install (TARGETS ${LIB_NAME} DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR}/)
install (FILES ${CMAKE_CURRENT_BINARY_DIR}/${LIB_NAME}.pc DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR}/pkgconfig/)
install (FILES ${CMAKE_CURRENT_BINARY_DIR}/${LIB_NAME}.vapi DESTINATION ${CMAKE_INSTALL_FULL_DATAROOTDIR}/vala/vapi/)
install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/${LIB_NAME}.deps DESTINATION ${CMAKE_INSTALL_FULL_DATAROOTDIR}/vala/vapi/)
install (FILES ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_PROJECT_NAME}.h DESTINATION ${CMAKE_INSTALL_FULL_INCLUDEDIR}/${LIB_NAME}/)
The CMakeLists.txt in the project's root contains the following:
# Project name
project (drop)
# Minimum requirements of build-system
cmake_minimum_required (VERSION 2.8)
cmake_policy (VERSION 2.6)
# Global configuration
set (DATADIR "${CMAKE_INSTALL_PREFIX}/share")
set (PKGDATADIR "${DATADIR}/${CMAKE_PROJECT_NAME}")
set (GETTEXT_PACKAGE "${CMAKE_PROJECT_NAME}")
set (RELEASE_NAME "${CMAKE_PROJECT_NAME}")
set (VERSION "0.1")
set (VERSION_INFO "Release")
set (PREFIX ${CMAKE_INSTALL_PREFIX})
set (DOLLAR "$")
# Library configuration
set (LIB_VERSION 1.0)
set (LIB_SOVERSION 0)
set (LIB_NAME ${CMAKE_PROJECT_NAME}-${LIB_VERSION})
# Cmake-files
list (APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
# Configuration file
configure_file (${CMAKE_SOURCE_DIR}/dropd/config.vala.cmake ${CMAKE_SOURCE_DIR}/dropd/config.vala)
# Check for vala
find_package (Vala REQUIRED)
include (ValaVersion)
ensure_vala_version ("0.18" MINIMUM)
include (ValaPrecompile)
# Disable C compiler warnings
add_definitions (-w)
# Set gettext-package
add_definitions (-DGETTEXT_PACKAGE="${CMAKE_PROJECT_NAME}")
# Check for required dependencies
find_package (PkgConfig)
pkg_check_modules (DEPS REQUIRED granite gthread-2.0 gio-2.0 gee-0.8 avahi-gobject avahi-client)
# Link the avahi library
add_definitions (-lavahi)
# Link dependencies
add_definitions (${DEPS_CFLAGS})
add_definitions (${LIB_CFLAGS})
link_libraries (${DEPS_LIBRARIES})
link_directories (${DEPS_LIBRARY_DIRS})
link_directories (${LIB_LIBRARY_DIRS})
# Load directories
add_subdirectory (dropd)
add_subdirectory (lib)
add_subdirectory (po)
add_subdirectory (data)
add_subdirectory (schemas)
When building the project now the main application still builds without problems, but when the build of the library begins this error appears (translated):
make[2]: *** No rule to make »../lib/drop-1.0«,
required by »lib/drop-1.0«. End.
make[1]: *** [lib/CMakeFiles/drop-1.0.dir/all] Errors 2
make: *** [all] Errors 2
Badly Im not that familar with CMake and don't get what that error message means, neither what is causing it.
I have already compared my CMakeLists.txt files with them in another project that's also built out of a 'normal' application and one library, but I couldn't find the difference that makes my code not working: http://bazaar.launchpad.net/~wingpanel-devs/wingpanel/trunk/files/head:/
It would be very nice if you could give me some tips what I could have missed in the CMake-Files.
For the ones with the same problem: I've now solved the issue myself with removing the ${LIB_NAME} from the line vala_precompile (LIB_VALA_C ${LIB_NAME}. Im still not sure what's happening here, but this "solution" seemed to work.
Better ways to solve this issue are still appreciated. ;)
I have created a project that uses some boost libraries. Originally the project was created as Eclipse project using MinGW and was working correctly. Now I am trying to convert it into CMake project.
I prepare MinGW makefile with CMake and try to compile it but get the following error:
In file included from D:/Krzych/usr/local/include/boost/date_time/c_time.hpp:17:0,
from D:/Krzych/usr/local/include/boost/date_time/time_clock.hpp:16,
from D:/Krzych/usr/local/include/boost/date_time/posix_time/posix_time_types.hpp:10,
from D:/Krzych/usr/local/include/boost/asio/time_traits.hpp:24,
from D:/Krzych/usr/local/include/boost/asio/deadline_timer_service.hpp:27,
from D:/Krzych/usr/local/include/boost/asio/basic_deadline_timer.hpp:25,
from D:/Krzych/usr/local/include/boost/asio.hpp:22,
from D:/Krzych/Projects/Picard/PicardDebugLink/include/CCommunicationAgent.h:22,
from D:\Krzych\Projects\Picard\PicardDebugLink\source\CCommunicationAgent.cpp:12:
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\ctime:65:11: error: '::difftime' has not been declared
using ::difftime;
^
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\ctime:66:11: error: '::mktime' has not been declared
using ::mktime;
The same kind of error is repeated for every symbol from time.h referenced in ctime. As you can see ctime is directly included by boost date_time library.
Edit -- CMake files --
main CMakeLists.txt
cmake_minimum_required (VERSION 2.6)
project (PicardDebugLink)
# The version number.
set (PicardDebugLink_VERSION_MAJOR 0)
set (PicardDebugLink_VERSION_MINOR 9)
if(WIN32)
macro(get_WIN32_WINNT version)
if (WIN32 AND CMAKE_SYSTEM_VERSION)
set(ver ${CMAKE_SYSTEM_VERSION})
string(REPLACE "." "" ver ${ver})
string(REGEX REPLACE "([0-9])" "0\\1" ver ${ver})
set(${version} "0x${ver}" CACHE PATH "x")
endif()
endmacro()
get_WIN32_WINNT(platform_code)
add_definitions(-D_WIN32_WINNT=${platform_code})
endif()
# configure a header file to pass some of the CMake settings
# to the source code
configure_file (
"${PROJECT_SOURCE_DIR}/PicardDebugLinkConfig.h.in"
"${PROJECT_BINARY_DIR}/PicardDebugLinkConfig.h"
)
set(CMAKE_CXX_FLAGS "-std=c++11" CACHE STRING "C++2011 features are required" FORCE)
find_package (Boost REQUIRED atomic chrono date_time system timer thread)
include_directories( ${Boost_INCLUDE_DIRS} )
# add the binary tree to the search path for include files
include_directories("${PROJECT_BINARY_DIR}")
include_directories(include)
add_subdirectory(source)
get_property(inc_dirs DIRECTORY PROPERTY INCLUDE_DIRECTORIES)
message(status "** inc_dirs: ${inc_dirs}")
# build a CPack driven installer package
# include (InstallRequiredSystemLibraries)
set (CPACK_PACKAGE_VERSION_MAJOR "${TreeEight_VERSION_MAJOR}")
set (CPACK_PACKAGE_VERSION_MINOR "${TreeEight_VERSION_MINOR}")
include (CPack)
File for source subdirectory:
# add the executable
add_library(PicardDebugLink SHARED CCommunicationAgent.cpp
CCommProtocol.cpp
CCreateTest.cpp
CDataStorage.cpp
CException.cpp
CFlashErase.cpp
CFlashFileIOBuff.cpp
CFlashMemIOBuff.cpp
CFlashWriteFile.cpp
CFlashWriteMem.cpp
CFrameCreator.cpp
CIOBuff.cpp
CSerialLink.cpp
ErrorCategories.cpp
FlashProtocols.cpp
IThrowable.cpp
ProgramFPGADataHelpers.cpp
ProgramFPGAProtocols.cpp
SPicardCommunicationFrame.cpp
utilities.cpp
)
get_property(inc_dirs DIRECTORY PROPERTY INCLUDE_DIRECTORIES)
target_link_libraries(PicardDebugLink ${Boost_LIBRARIES} )
# add the install targets
install (TARGETS PicardDebugLink DESTINATION bin)
install (FILES "include/*.h" DESTINATION include)