From 02eb3ffcd16a3b098ac937d82a2f42c9ad14977e Mon Sep 17 00:00:00 2001 From: Paul Cercueil Date: Tue, 12 May 2015 16:22:15 +0200 Subject: [PATCH 1/3] Revert "CMake: Update included cmakelists.txt to reflect new target name" This reverts commit f10a8fbcb2b70e6351022d1945f3dbc147bbe8f3. --- iiod/CMakeLists.txt | 2 +- tests/CMakeLists.txt | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/iiod/CMakeLists.txt b/iiod/CMakeLists.txt index 11bb0142d..17c7ac4d8 100644 --- a/iiod/CMakeLists.txt +++ b/iiod/CMakeLists.txt @@ -15,7 +15,7 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR}) set(IIOD_CFILES iiod.c ops.c ${BISON_parser_OUTPUTS} ${FLEX_lexer_OUTPUTS}) add_executable(iiod ${IIOD_CFILES}) -target_link_libraries(iiod libiio ${PTHREAD_LIBRARIES} ${AVAHI_LIBRARIES}) +target_link_libraries(iiod iio ${PTHREAD_LIBRARIES} ${AVAHI_LIBRARIES}) if(NOT SKIP_INSTALL_ALL) install(TARGETS iiod RUNTIME DESTINATION sbin) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 60cbca778..fcd8d8f7f 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -10,15 +10,15 @@ add_executable(iio_info iio_info.c) add_executable(iio_readdev iio_readdev.c) add_executable(iio_reg iio_reg.c) -target_link_libraries(iio_genxml libiio) -target_link_libraries(iio_info libiio) -target_link_libraries(iio_readdev libiio) -target_link_libraries(iio_reg libiio) +target_link_libraries(iio_genxml iio) +target_link_libraries(iio_info iio) +target_link_libraries(iio_readdev iio) +target_link_libraries(iio_reg iio) if(PTHREAD_LIBRARIES) project(iio_adi_xflow_check C) add_executable(iio_adi_xflow_check iio_adi_xflow_check.c) - target_link_libraries(iio_adi_xflow_check libiio pthread) + target_link_libraries(iio_adi_xflow_check iio pthread) endif() if(NOT SKIP_INSTALL_ALL) From e558265cc906cf9ef7cd6ae53c23968a4bf758f0 Mon Sep 17 00:00:00 2001 From: Paul Cercueil Date: Tue, 12 May 2015 16:22:19 +0200 Subject: [PATCH 2/3] Revert "CMake: Fix target name different from project name" This is actually normal that the library is called 'lib.a' under Linux and just '.dll' under Windows, and has nothing to see with the project name. However, by changing the target name to 'libiio' instead of just 'iio', the CMake build system was creating the library as 'liblibiio.a'. This reverts commit 8c46d527eba891e3cd437a73af807ac03a9c6cbf. --- CMakeLists.txt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 54321ad7b..f87a4785f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -156,16 +156,16 @@ install(FILES ${LIBIIO_PC} DESTINATION "${INSTALL_PKGCONFIG_DIR}") #set(SETUP_PY ${CMAKE_CURRENT_SOURCE_DIR}/bindings/python/setup.py) #configure_file(python/setup.py.in ${SETUP_PY} @ONLY) -add_library(libiio ${LIBIIO_CFILES} ${LIBIIO_HEADERS}) -set_target_properties(libiio PROPERTIES VERSION ${VERSION} SOVERSION ${LIBIIO_VERSION_MAJOR}) -target_link_libraries(libiio LINK_PRIVATE ${LIBS_TO_LINK}) +add_library(iio ${LIBIIO_CFILES} ${LIBIIO_HEADERS}) +set_target_properties(iio PROPERTIES VERSION ${VERSION} SOVERSION ${LIBIIO_VERSION_MAJOR}) +target_link_libraries(iio LINK_PRIVATE ${LIBS_TO_LINK}) if (NOT SKIP_INSTALL_HEADERS AND NOT SKIP_INSTALL_ALL) install(FILES ${LIBIIO_HEADERS} DESTINATION "${INSTALL_INC_DIR}") endif() if(NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL) - install(TARGETS libiio + install(TARGETS iio ARCHIVE DESTINATION "${INSTALL_LIB_DIR}" LIBRARY DESTINATION "${INSTALL_LIB_DIR}" RUNTIME DESTINATION "${INSTALL_BIN_DIR}") @@ -180,7 +180,7 @@ if(DOXYGEN_FOUND) set(HTML_DEST_DIR ${CMAKE_BINARY_DIR}/html) file(COPY ${CMAKE_SOURCE_DIR}/doc DESTINATION ${HTML_DEST_DIR}) - add_custom_command(TARGET libiio POST_BUILD + add_custom_command(TARGET iio POST_BUILD COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_BINARY_DIR}/Doxyfile WORKING_DIRECTORY ${CMAKE_BINARY_DIR} COMMENT "Generating API documentation with Doxygen" VERBATIM From d84e05c17562dcc6cf3559d237535f37e3583652 Mon Sep 17 00:00:00 2001 From: Paul Cercueil Date: Tue, 12 May 2015 16:40:29 +0200 Subject: [PATCH 3/3] CMake: Name the lib 'libiio.dll' instead of 'iio.dll' under Windows Signed-off-by: Paul Cercueil --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index f87a4785f..2738214c7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -160,6 +160,10 @@ add_library(iio ${LIBIIO_CFILES} ${LIBIIO_HEADERS}) set_target_properties(iio PROPERTIES VERSION ${VERSION} SOVERSION ${LIBIIO_VERSION_MAJOR}) target_link_libraries(iio LINK_PRIVATE ${LIBS_TO_LINK}) +if (MSVC) + set_target_properties(iio PROPERTIES OUTPUT_NAME libiio) +endif() + if (NOT SKIP_INSTALL_HEADERS AND NOT SKIP_INSTALL_ALL) install(FILES ${LIBIIO_HEADERS} DESTINATION "${INSTALL_INC_DIR}") endif()